|
|
@@ -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": {
|
|
|
"get": {
|
|
|
"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})"
|
|
|
}
|
|
|
]
|
|
|
+ },
|
|
|
+ "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": {
|
|
|
@@ -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": {
|
|
|
"post": {
|
|
|
"tags": ["session questions"],
|
|
|
@@ -20623,38 +20950,38 @@
|
|
|
"required": ["_tag", "message"],
|
|
|
"additionalProperties": false
|
|
|
},
|
|
|
- "ConflictError": {
|
|
|
+ "SessionNotFoundError": {
|
|
|
"type": "object",
|
|
|
"properties": {
|
|
|
"_tag": {
|
|
|
"type": "string",
|
|
|
- "enum": ["ConflictError"]
|
|
|
+ "enum": ["SessionNotFoundError"]
|
|
|
},
|
|
|
- "message": {
|
|
|
+ "sessionID": {
|
|
|
"type": "string"
|
|
|
},
|
|
|
- "resource": {
|
|
|
+ "message": {
|
|
|
"type": "string"
|
|
|
}
|
|
|
},
|
|
|
- "required": ["_tag", "message"],
|
|
|
+ "required": ["_tag", "sessionID", "message"],
|
|
|
"additionalProperties": false
|
|
|
},
|
|
|
- "SessionNotFoundError": {
|
|
|
+ "ConflictError": {
|
|
|
"type": "object",
|
|
|
"properties": {
|
|
|
"_tag": {
|
|
|
"type": "string",
|
|
|
- "enum": ["SessionNotFoundError"]
|
|
|
+ "enum": ["ConflictError"]
|
|
|
},
|
|
|
- "sessionID": {
|
|
|
+ "message": {
|
|
|
"type": "string"
|
|
|
},
|
|
|
- "message": {
|
|
|
+ "resource": {
|
|
|
"type": "string"
|
|
|
}
|
|
|
},
|
|
|
- "required": ["_tag", "sessionID", "message"],
|
|
|
+ "required": ["_tag", "message"],
|
|
|
"additionalProperties": false
|
|
|
},
|
|
|
"ServiceUnavailableError": {
|
|
|
@@ -28875,6 +29202,10 @@
|
|
|
"name": "opencode HttpApi",
|
|
|
"description": "Experimental HttpApi surface for selected instance routes."
|
|
|
},
|
|
|
+ {
|
|
|
+ "name": "opencode HttpApi",
|
|
|
+ "description": "Experimental HttpApi surface for selected instance routes."
|
|
|
+ },
|
|
|
{
|
|
|
"name": "sessions",
|
|
|
"description": "Experimental session routes."
|