Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@openctx/schema

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openctx/schema - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

dist/opencodegraph.schema.d.ts

43

dist/openctx.schema.d.ts
/**
* A hint about how to best present an item to the human in the client's user interface.
* Metadata about code
*/
export type Schema = Item | Annotation;
/**
* A hint about how to best present an annotation to the human in the client's user interface.
*
* - `show-at-top-of-file`: Group all items with the same `ui.group` value together and display them at the top of the file instead of at their given file range.
* - `prefer-link-over-detail`: Prefer to show the item as a link over showing the detail text, if the client does not cleanly support doing both.
*/
export type PresentationHint = 'show-at-top-of-file' | 'prefer-link-over-detail';
export type PresentationHint = "prefer-link-over-detail";
/**
* Metadata about code
* An item contains contextual information relevant to a resource (or a range within a resource).
*/
export interface Schema {
items?: Item[];
}
/**
* An item contains contextual information relevant to a file (or a range within a file).
*/
export interface Item {

@@ -28,3 +25,2 @@ /**

ai?: AssistantInfo;
range?: Range;
}

@@ -36,10 +32,2 @@ /**

hover?: Hover;
/**
* If set, this item is grouped together with all other items with the same `group` value.
*/
group?: string;
/**
* Hints about the best way to present this item. Different clients interpret hints differently because they have different user interfaces.
*/
presentationHints?: PresentationHint[];
}

@@ -69,4 +57,19 @@ /**

/**
* The range in the file that this item applies to. If not set, the item applies to the entire file.
* An annotation attaches an Item to a range in a document.
*/
export interface Annotation {
/**
* The URI of the document.
*/
uri: string;
range?: Range;
item: Item;
/**
* Hints about the best way to present this annotation. Different clients interpret hints differently because they have different user interfaces.
*/
presentationHints?: PresentationHint[];
}
/**
* The range in the resource that this item applies to. If not set, the item applies to the entire resource.
*/
export interface Range {

@@ -73,0 +76,0 @@ start: Position;

{
"name": "@openctx/schema",
"version": "0.0.3",
"version": "0.0.4",
"description": "OpenCtx schema",

@@ -20,3 +20,3 @@ "license": "Apache-2.0",

"devDependencies": {
"json-schema-to-typescript": "^13.1.1"
"json-schema-to-typescript": "^13.1.2"
},

@@ -23,0 +23,0 @@ "scripts": {

{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "openctx.schema.json#",
"title": "Schema",
"description": "Metadata about code",
"allowComments": true,
"type": "object",
"additionalProperties": false,
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/Item"
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "openctx.schema.json#",
"title": "Schema",
"description": "Metadata about code",
"allowComments": true,
"oneOf": [
{
"$ref": "#/definitions/Item"
},
{
"$ref": "#/definitions/Annotation"
}
],
"definitions": {
"Item": {
"description": "An item contains contextual information relevant to a resource (or a range within a resource).",
"type": "object",
"additionalProperties": false,
"required": ["title"],
"properties": {
"title": {
"description": "A descriptive title.",
"type": "string"
},
"url": {
"description": "An external URL with more information.",
"type": "string",
"format": "uri"
},
"ui": {
"description": "The human user interface of the item, with information for human consumption.",
"$ref": "#/definitions/UserInterface"
},
"ai": {
"description": "Information from the item intended for consumption by AI, not humans.",
"$ref": "#/definitions/AssistantInfo"
}
}
},
"UserInterface": {
"description": "The human user interface of an item, with information for human consumption.",
"type": "object",
"additionalProperties": false,
"properties": {
"hover": {
"title": "Hover",
"description": "Additional information for the human, shown in a tooltip-like widget when they interact with the item.",
"type": "object",
"properties": {
"markdown": {
"description": "The contents of the hover as Markdown, preferred over the text when rendered Markdown or HTML can be displayed.",
"type": "string"
},
"text": {
"description": "The contents of the hover as plain text, used when rendered Markdown or HTML can't be displayed.",
"type": "string"
}
}
}
}
},
"definitions": {
"Item": {
"description": "An item contains contextual information relevant to a file (or a range within a file).",
"type": "object",
"additionalProperties": false,
"required": ["title"],
"properties": {
"title": {
"description": "A descriptive title.",
"type": "string"
},
"url": {
"description": "An external URL with more information.",
"type": "string",
"format": "uri"
},
"ui": {
"description": "The human user interface of the item, with information for human consumption.",
"$ref": "#/definitions/UserInterface"
},
"ai": {
"description": "Information from the item intended for consumption by AI, not humans.",
"$ref": "#/definitions/AssistantInfo"
},
"range": {
"description": "The range in the file that this item applies to. If not set, the item applies to the entire file.",
"$ref": "#/definitions/Range"
}
}
"AssistantInfo": {
"description": "Information from an item intended for consumption by AI, not humans.",
"type": "object",
"additionalProperties": false,
"properties": {
"content": {
"description": "Text content for AI to consume.",
"type": "string"
}
}
},
"Annotation": {
"description": "An annotation attaches an Item to a range in a document.",
"type": "object",
"additionalProperties": false,
"required": ["uri", "item"],
"properties": {
"uri": {
"description": "The URI of the document.",
"type": "string",
"format": "uri"
},
"UserInterface": {
"description": "The human user interface of an item, with information for human consumption.",
"type": "object",
"additionalProperties": false,
"properties": {
"hover": {
"title": "Hover",
"description": "Additional information for the human, shown in a tooltip-like widget when they interact with the item.",
"type": "object",
"properties": {
"markdown": {
"description": "The contents of the hover as Markdown, preferred over the text when rendered Markdown or HTML can be displayed.",
"type": "string"
},
"text": {
"description": "The contents of the hover as plain text, used when rendered Markdown or HTML can't be displayed.",
"type": "string"
}
}
},
"group": {
"description": "If set, this item is grouped together with all other items with the same `group` value.",
"type": "string"
},
"presentationHints": {
"description": "Hints about the best way to present this item. Different clients interpret hints differently because they have different user interfaces.",
"type": "array",
"items": {
"title": "PresentationHint",
"description": "A hint about how to best present an item to the human in the client's user interface.\n\n- `show-at-top-of-file`: Group all items with the same `ui.group` value together and display them at the top of the file instead of at their given file range.\n- `prefer-link-over-detail`: Prefer to show the item as a link over showing the detail text, if the client does not cleanly support doing both.",
"type": "string",
"enum": ["show-at-top-of-file", "prefer-link-over-detail"]
}
}
}
"range": {
"description": "The range in the resource that this item applies to. If not set, the item applies to the entire resource.",
"$ref": "#/definitions/Range"
},
"AssistantInfo": {
"description": "Information from an item intended for consumption by AI, not humans.",
"type": "object",
"additionalProperties": false,
"properties": {
"content": {
"description": "Text content for AI to consume.",
"type": "string"
}
}
"item": {
"$ref": "#/definitions/Item"
},
"Range": {
"type": "object",
"additionalProperties": false,
"required": ["start", "end"],
"properties": {
"start": {
"$ref": "#/definitions/Position"
},
"end": {
"$ref": "#/definitions/Position"
}
}
"presentationHints": {
"description": "Hints about the best way to present this annotation. Different clients interpret hints differently because they have different user interfaces.",
"type": "array",
"items": {
"title": "PresentationHint",
"description": "A hint about how to best present an annotation to the human in the client's user interface.\n\n- `prefer-link-over-detail`: Prefer to show the item as a link over showing the detail text, if the client does not cleanly support doing both.",
"type": "string",
"enum": ["prefer-link-over-detail"]
}
}
}
},
"Range": {
"type": "object",
"additionalProperties": false,
"required": ["start", "end"],
"properties": {
"start": {
"$ref": "#/definitions/Position"
},
"Position": {
"type": "object",
"additionalProperties": false,
"required": ["line", "character"],
"properties": {
"line": {
"type": "integer"
},
"character": {
"type": "integer"
}
}
"end": {
"$ref": "#/definitions/Position"
}
}
},
"Position": {
"type": "object",
"additionalProperties": false,
"required": ["line", "character"],
"properties": {
"line": {
"type": "integer"
},
"character": {
"type": "integer"
}
}
}
}
}
/**
* A hint about how to best present an item to the human in the client's user interface.
* Metadata about code
*/
export type Schema = Item | Annotation
/**
* A hint about how to best present an annotation to the human in the client's user interface.
*
* - `show-at-top-of-file`: Group all items with the same `ui.group` value together and display them at the top of the file instead of at their given file range.
* - `prefer-link-over-detail`: Prefer to show the item as a link over showing the detail text, if the client does not cleanly support doing both.
*/
export type PresentationHint = 'show-at-top-of-file' | 'prefer-link-over-detail'
export type PresentationHint = 'prefer-link-over-detail'
/**
* Metadata about code
* An item contains contextual information relevant to a resource (or a range within a resource).
*/
export interface Schema {
items?: Item[]
}
/**
* An item contains contextual information relevant to a file (or a range within a file).
*/
export interface Item {

@@ -29,3 +26,2 @@ /**

ai?: AssistantInfo
range?: Range
}

@@ -37,10 +33,2 @@ /**

hover?: Hover
/**
* If set, this item is grouped together with all other items with the same `group` value.
*/
group?: string
/**
* Hints about the best way to present this item. Different clients interpret hints differently because they have different user interfaces.
*/
presentationHints?: PresentationHint[]
}

@@ -70,4 +58,19 @@ /**

/**
* The range in the file that this item applies to. If not set, the item applies to the entire file.
* An annotation attaches an Item to a range in a document.
*/
export interface Annotation {
/**
* The URI of the document.
*/
uri: string
range?: Range
item: Item
/**
* Hints about the best way to present this annotation. Different clients interpret hints differently because they have different user interfaces.
*/
presentationHints?: PresentationHint[]
}
/**
* The range in the resource that this item applies to. If not set, the item applies to the entire resource.
*/
export interface Range {

@@ -74,0 +77,0 @@ start: Position

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc