|
|
@@ -10187,6 +10187,66 @@
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
+ "/api/session/active": {
|
|
|
+ "get": {
|
|
|
+ "tags": ["sessions"],
|
|
|
+ "operationId": "v2.session.active",
|
|
|
+ "parameters": [],
|
|
|
+ "security": [],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "Success",
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "object",
|
|
|
+ "patternProperties": {
|
|
|
+ "^ses": {
|
|
|
+ "$ref": "#/components/schemas/SessionActive"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "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": "Retrieve foreground Session drains currently owned by this OpenCode process. Sessions absent from the result are inactive.",
|
|
|
+ "summary": "List active sessions",
|
|
|
+ "x-codeSamples": [
|
|
|
+ {
|
|
|
+ "lang": "js",
|
|
|
+ "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.active({\n ...\n})"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
"/api/session/{sessionID}": {
|
|
|
"get": {
|
|
|
"tags": ["sessions"],
|
|
|
@@ -23445,6 +23505,17 @@
|
|
|
"required": ["_tag", "message"],
|
|
|
"additionalProperties": false
|
|
|
},
|
|
|
+ "SessionActive": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "type": {
|
|
|
+ "type": "string",
|
|
|
+ "enum": ["running"]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "required": ["type"],
|
|
|
+ "additionalProperties": false
|
|
|
+ },
|
|
|
"SessionNotFoundError": {
|
|
|
"type": "object",
|
|
|
"properties": {
|