chore: generate
This commit is contained in:
parent
38536cf733
commit
69623c2b79
3 changed files with 349 additions and 22 deletions
|
|
@ -180,10 +180,7 @@ const replacements = [
|
||||||
LayerNode.replace(SessionSummary.node, summary),
|
LayerNode.replace(SessionSummary.node, summary),
|
||||||
LayerNode.replace(RuntimeFlags.node, RuntimeFlags.layer({ experimentalEventSystem: true })),
|
LayerNode.replace(RuntimeFlags.node, RuntimeFlags.layer({ experimentalEventSystem: true })),
|
||||||
]
|
]
|
||||||
const env = LayerNode.buildLayer(
|
const env = LayerNode.buildLayer(LayerNode.group([root, LayerNode.make(TestLLMServer.layer, [])]), { replacements })
|
||||||
LayerNode.group([root, LayerNode.make(TestLLMServer.layer, [])]),
|
|
||||||
{ replacements },
|
|
||||||
)
|
|
||||||
|
|
||||||
const it = testEffect(env)
|
const it = testEffect(env)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9958,6 +9958,74 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/api/location": {
|
||||||
|
"get": {
|
||||||
|
"tags": ["opencode HttpApi"],
|
||||||
|
"operationId": "v2.location.get",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "location",
|
||||||
|
"in": "query",
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"directory": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"workspace": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"required": false,
|
||||||
|
"style": "deepObject",
|
||||||
|
"explode": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"security": [],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Location.Info",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/LocationInfo"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "InvalidRequestError",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/InvalidRequestError"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"description": "UnauthorizedError",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/UnauthorizedError"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Resolve the requested location or the server default location.",
|
||||||
|
"summary": "Get location",
|
||||||
|
"x-codeSamples": [
|
||||||
|
{
|
||||||
|
"lang": "js",
|
||||||
|
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.location.get({\n ...\n})"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"/api/agent": {
|
"/api/agent": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": ["opencode HttpApi"],
|
"tags": ["opencode HttpApi"],
|
||||||
|
|
@ -10163,6 +10231,180 @@
|
||||||
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.list({\n ...\n})"
|
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.list({\n ...\n})"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"post": {
|
||||||
|
"tags": ["sessions"],
|
||||||
|
"operationId": "v2.session.create",
|
||||||
|
"parameters": [],
|
||||||
|
"security": [],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Success",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/components/schemas/SessionV2Info"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["data"],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "InvalidRequestError",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/InvalidRequestError"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"description": "UnauthorizedError",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/UnauthorizedError"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Create a session at the requested location.",
|
||||||
|
"summary": "Create session",
|
||||||
|
"requestBody": {
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^ses"
|
||||||
|
},
|
||||||
|
"agent": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"model": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"providerID": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"variant": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["id", "providerID"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"location": {
|
||||||
|
"$ref": "#/components/schemas/LocationRef"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"x-codeSamples": [
|
||||||
|
{
|
||||||
|
"lang": "js",
|
||||||
|
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.create({\n ...\n})"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/api/session/{sessionID}": {
|
||||||
|
"get": {
|
||||||
|
"tags": ["sessions"],
|
||||||
|
"operationId": "v2.session.get",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "sessionID",
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^ses"
|
||||||
|
},
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"security": [],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Success",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/components/schemas/SessionV2Info"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["data"],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "InvalidRequestError",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/InvalidRequestError"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"description": "UnauthorizedError",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/UnauthorizedError"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"404": {
|
||||||
|
"description": "SessionNotFoundError",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/SessionNotFoundError"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/SessionNotFoundError"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Retrieve a session by ID.",
|
||||||
|
"summary": "Get session",
|
||||||
|
"x-codeSamples": [
|
||||||
|
{
|
||||||
|
"lang": "js",
|
||||||
|
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.get({\n ...\n})"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/api/session/{sessionID}/prompt": {
|
"/api/session/{sessionID}/prompt": {
|
||||||
|
|
@ -11917,6 +12159,91 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/api/session/{sessionID}/question": {
|
||||||
|
"get": {
|
||||||
|
"tags": ["session questions"],
|
||||||
|
"operationId": "v2.session.question.list",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "sessionID",
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^ses"
|
||||||
|
},
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"security": [],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Success",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/QuestionV2Request"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["data"],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "InvalidRequestError",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/InvalidRequestError"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"description": "UnauthorizedError",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/UnauthorizedError"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"404": {
|
||||||
|
"description": "SessionNotFoundError",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/SessionNotFoundError"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/SessionNotFoundError"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Retrieve pending question requests owned by a session.",
|
||||||
|
"summary": "List session question requests",
|
||||||
|
"x-codeSamples": [
|
||||||
|
{
|
||||||
|
"lang": "js",
|
||||||
|
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.question.list({\n ...\n})"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"/api/session/{sessionID}/question/{requestID}/reply": {
|
"/api/session/{sessionID}/question/{requestID}/reply": {
|
||||||
"post": {
|
"post": {
|
||||||
"tags": ["session questions"],
|
"tags": ["session questions"],
|
||||||
|
|
@ -20623,23 +20950,6 @@
|
||||||
"required": ["_tag", "message"],
|
"required": ["_tag", "message"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"ConflictError": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"_tag": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": ["ConflictError"]
|
|
||||||
},
|
|
||||||
"message": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"resource": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["_tag", "message"],
|
|
||||||
"additionalProperties": false
|
|
||||||
},
|
|
||||||
"SessionNotFoundError": {
|
"SessionNotFoundError": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
@ -20657,6 +20967,23 @@
|
||||||
"required": ["_tag", "sessionID", "message"],
|
"required": ["_tag", "sessionID", "message"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
|
"ConflictError": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"_tag": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["ConflictError"]
|
||||||
|
},
|
||||||
|
"message": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"resource": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["_tag", "message"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
"ServiceUnavailableError": {
|
"ServiceUnavailableError": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
@ -28875,6 +29202,10 @@
|
||||||
"name": "opencode HttpApi",
|
"name": "opencode HttpApi",
|
||||||
"description": "Experimental HttpApi surface for selected instance routes."
|
"description": "Experimental HttpApi surface for selected instance routes."
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "opencode HttpApi",
|
||||||
|
"description": "Experimental HttpApi surface for selected instance routes."
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "sessions",
|
"name": "sessions",
|
||||||
"description": "Experimental session routes."
|
"description": "Experimental session routes."
|
||||||
|
|
|
||||||
|
|
@ -117,14 +117,13 @@ export const SessionGroup = HttpApiGroup.make("server.session")
|
||||||
location: Location.Ref.pipe(Schema.optional),
|
location: Location.Ref.pipe(Schema.optional),
|
||||||
}),
|
}),
|
||||||
success: Schema.Struct({ data: SessionV2.Info }),
|
success: Schema.Struct({ data: SessionV2.Info }),
|
||||||
})
|
}).annotateMerge(
|
||||||
.annotateMerge(
|
OpenApi.annotations({
|
||||||
OpenApi.annotations({
|
identifier: "v2.session.create",
|
||||||
identifier: "v2.session.create",
|
summary: "Create session",
|
||||||
summary: "Create session",
|
description: "Create a session at the requested location.",
|
||||||
description: "Create a session at the requested location.",
|
}),
|
||||||
}),
|
),
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.add(
|
.add(
|
||||||
HttpApiEndpoint.get("session.get", "/api/session/:sessionID", {
|
HttpApiEndpoint.get("session.get", "/api/session/:sessionID", {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue