diff --git a/lib/protocol/package.json b/lib/protocol/package.json index d941ad25..89e8e355 100644 --- a/lib/protocol/package.json +++ b/lib/protocol/package.json @@ -17,7 +17,7 @@ ], "sideEffects": false, "scripts": { - "generate": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only ../schema/dev/generateJsonSchemaTypes.ts src/opencodegraph-protocol.schema.json \"import { Item, Annotation } from '@opencodegraph/schema'\" > src/opencodegraph-protocol.schema.ts && pnpm -w run format \"$PNPM_SCRIPT_SRC_DIR/src/opencodegraph-protocol.schema.ts\"", + "generate": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only ../schema/dev/generateJsonSchemaTypes.ts src/opencodegraph-protocol.schema.json \"import { Annotation } from '@opencodegraph/schema'\" > src/opencodegraph-protocol.schema.ts && pnpm -w run format \"$PNPM_SCRIPT_SRC_DIR/src/opencodegraph-protocol.schema.ts\"", "build": "pnpm run --silent generate && tsc --build", "test": "vitest", "prepublishOnly": "tsc --build --clean && pnpm run build" diff --git a/lib/schema/src/opencodegraph.schema.json b/lib/schema/src/opencodegraph.schema.json index a59c7a82..7933a292 100644 --- a/lib/schema/src/opencodegraph.schema.json +++ b/lib/schema/src/opencodegraph.schema.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "$id": "opencodegraph.schema.json#", - "title": "Data", + "title": "Schema", "description": "Metadata about code", "allowComments": true, "type": "object", @@ -36,12 +36,6 @@ "description": "Information from the annotation intended for consumption by AI, not humans.", "$ref": "#/definitions/AnnotationAIInfo" }, - "meta": { - "description": "For future use.", - "type": "object", - "additionalProperties": false, - "properties": {} - }, "range": { "description": "The range in the file that this annotation applies to. If not set, the annotation applies to the entire file.", "$ref": "#/definitions/Range" diff --git a/lib/schema/src/opencodegraph.schema.ts b/lib/schema/src/opencodegraph.schema.ts index 82296fb0..46bc904b 100644 --- a/lib/schema/src/opencodegraph.schema.ts +++ b/lib/schema/src/opencodegraph.schema.ts @@ -1,7 +1,7 @@ /** * Metadata about code */ -export interface Data { +export interface Schema { annotations?: Annotation[] } /** @@ -18,10 +18,6 @@ export interface Annotation { url?: string ui?: AnnotationUI ai?: AnnotationAIInfo - /** - * For future use. - */ - meta?: {} range?: Range } /** diff --git a/web/content/docs/concepts.mdx b/web/content/docs/concepts.mdx index 4f76f41a..5b288dd5 100644 --- a/web/content/docs/concepts.mdx +++ b/web/content/docs/concepts.mdx @@ -63,3 +63,7 @@ How do clients authenticate with providers? Right now, a few hostnames are hard- ### Implementing providers: thin clients or lots-of-logic? Will OpenCodeGraph providers be super lightweight presentation-layer programs that hit some existing system that makes the data easy to fetch? Maybe that existing system is a separate server built for OCG to hit for now, but ideally in the future (years) it would become a common endpoint for dev tools vendors to expose, like oEmbed. + +### Recording additional metadata + +How should annotations record other kinds of metadata to make it searchable and exportable? For example, the Storybook provider could add `{"storybook": true}` metadata in an annotation on all storybook files, which would make it possible to identify all storybook files in a code search application.