Added History classes for JSON Schema generation
This commit is contained in:
parent
657b185c5d
commit
04e0ebd6ef
8 changed files with 1227 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
from .main import *
|
||||
from .filesystem import RangeInFile, FileEdit
|
||||
from .filesystem_edit import FileEditWithFullContents
|
||||
from ..core.main import History, HistoryNode
|
||||
from pydantic import schema_json_of
|
||||
import os
|
||||
|
||||
|
|
@ -10,6 +11,8 @@ MODELS_TO_GENERATE = [
|
|||
RangeInFile, FileEdit
|
||||
] + [
|
||||
FileEditWithFullContents
|
||||
] + [
|
||||
History, HistoryNode
|
||||
]
|
||||
|
||||
RENAMES = {
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@
|
|||
"package": "cp ./config/prod_config.json ./config/config.json && npm run compile && mkdir -p ./build && vsce package --out ./build && chmod 777 ./build/continue-0.0.1.vsix && cp ./config/dev_config.json ./config/config.json",
|
||||
"full-package": "cd ../continuedev && poetry build && cp ./dist/continuedev-0.1.0-py3-none-any.whl ../extension/scripts/continuedev-0.1.0-py3-none-any.whl && cd ../extension && npm run typegen && npm run clientgen && cd react-app && npm run build && cd .. && npm run package",
|
||||
"install-extension": "code --install-extension ./build/continue-0.0.1.vsix",
|
||||
"uninstall": "code --uninstall-extension Continue.continue",
|
||||
"uninstall": "code --uninstall-extension .continue",
|
||||
"reinstall": "rm -rf ./build && npm run package && npm run uninstall && npm run install-extension"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
|||
41
extension/schema/History.d.ts
vendored
Normal file
41
extension/schema/History.d.ts
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
/* eslint-disable */
|
||||
/**
|
||||
* This file was automatically generated by json-schema-to-typescript.
|
||||
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
||||
* and run json-schema-to-typescript to regenerate this file.
|
||||
*/
|
||||
|
||||
export type History = History1;
|
||||
export type Name = string;
|
||||
export type Hide = boolean;
|
||||
export type SystemMessage = string;
|
||||
export type Depth = number;
|
||||
export type Timeline = HistoryNode[];
|
||||
export type CurrentIndex = number;
|
||||
|
||||
/**
|
||||
* A history of steps taken and their results
|
||||
*/
|
||||
export interface History1 {
|
||||
timeline: Timeline;
|
||||
current_index: CurrentIndex;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
/**
|
||||
* A point in history, a list of which make up History
|
||||
*/
|
||||
export interface HistoryNode {
|
||||
step: Step;
|
||||
observation?: Observation;
|
||||
depth: Depth;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface Step {
|
||||
name?: Name;
|
||||
hide?: Hide;
|
||||
system_message?: SystemMessage;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface Observation {
|
||||
[k: string]: unknown;
|
||||
}
|
||||
31
extension/schema/HistoryNode.d.ts
vendored
Normal file
31
extension/schema/HistoryNode.d.ts
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/* eslint-disable */
|
||||
/**
|
||||
* This file was automatically generated by json-schema-to-typescript.
|
||||
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
||||
* and run json-schema-to-typescript to regenerate this file.
|
||||
*/
|
||||
|
||||
export type HistoryNode = HistoryNode1;
|
||||
export type Name = string;
|
||||
export type Hide = boolean;
|
||||
export type SystemMessage = string;
|
||||
export type Depth = number;
|
||||
|
||||
/**
|
||||
* A point in history, a list of which make up History
|
||||
*/
|
||||
export interface HistoryNode1 {
|
||||
step: Step;
|
||||
observation?: Observation;
|
||||
depth: Depth;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface Step {
|
||||
name?: Name;
|
||||
hide?: Hide;
|
||||
system_message?: SystemMessage;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface Observation {
|
||||
[k: string]: unknown;
|
||||
}
|
||||
Binary file not shown.
73
schema/json/History.json
Normal file
73
schema/json/History.json
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
{
|
||||
"title": "History",
|
||||
"$ref": "#/definitions/continuedev__src__continuedev__core__main__History",
|
||||
"definitions": {
|
||||
"Step": {
|
||||
"title": "Step",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"title": "Name",
|
||||
"type": "string"
|
||||
},
|
||||
"hide": {
|
||||
"title": "Hide",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"system_message": {
|
||||
"title": "System Message",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Observation": {
|
||||
"title": "Observation",
|
||||
"type": "object",
|
||||
"properties": {}
|
||||
},
|
||||
"HistoryNode": {
|
||||
"title": "HistoryNode",
|
||||
"description": "A point in history, a list of which make up History",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"step": {
|
||||
"$ref": "#/definitions/Step"
|
||||
},
|
||||
"observation": {
|
||||
"$ref": "#/definitions/Observation"
|
||||
},
|
||||
"depth": {
|
||||
"title": "Depth",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"step",
|
||||
"depth"
|
||||
]
|
||||
},
|
||||
"continuedev__src__continuedev__core__main__History": {
|
||||
"title": "History",
|
||||
"description": "A history of steps taken and their results",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"timeline": {
|
||||
"title": "Timeline",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/HistoryNode"
|
||||
}
|
||||
},
|
||||
"current_index": {
|
||||
"title": "Current Index",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"timeline",
|
||||
"current_index"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
51
schema/json/HistoryNode.json
Normal file
51
schema/json/HistoryNode.json
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"title": "HistoryNode",
|
||||
"$ref": "#/definitions/continuedev__src__continuedev__core__main__HistoryNode",
|
||||
"definitions": {
|
||||
"Step": {
|
||||
"title": "Step",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"title": "Name",
|
||||
"type": "string"
|
||||
},
|
||||
"hide": {
|
||||
"title": "Hide",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"system_message": {
|
||||
"title": "System Message",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Observation": {
|
||||
"title": "Observation",
|
||||
"type": "object",
|
||||
"properties": {}
|
||||
},
|
||||
"continuedev__src__continuedev__core__main__HistoryNode": {
|
||||
"title": "HistoryNode",
|
||||
"description": "A point in history, a list of which make up History",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"step": {
|
||||
"$ref": "#/definitions/Step"
|
||||
},
|
||||
"observation": {
|
||||
"$ref": "#/definitions/Observation"
|
||||
},
|
||||
"depth": {
|
||||
"title": "Depth",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"step",
|
||||
"depth"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
1027
schema/openapi.json
Normal file
1027
schema/openapi.json
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue