|
|
@@ -3156,6 +3156,185 @@
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
+ "/question": {
|
|
|
+ "get": {
|
|
|
+ "operationId": "question.list",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "in": "query",
|
|
|
+ "name": "directory",
|
|
|
+ "schema": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "summary": "List pending questions",
|
|
|
+ "description": "Get all pending question requests across all sessions.",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "List of pending questions",
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/components/schemas/QuestionRequest"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "x-codeSamples": [
|
|
|
+ {
|
|
|
+ "lang": "js",
|
|
|
+ "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/question/{requestID}/reply": {
|
|
|
+ "post": {
|
|
|
+ "operationId": "question.reply",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "in": "query",
|
|
|
+ "name": "directory",
|
|
|
+ "schema": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "in": "path",
|
|
|
+ "name": "requestID",
|
|
|
+ "schema": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "summary": "Reply to question request",
|
|
|
+ "description": "Provide answers to a question request from the AI assistant.",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "Question answered successfully",
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "type": "boolean"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "400": {
|
|
|
+ "description": "Bad request",
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/components/schemas/BadRequestError"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "404": {
|
|
|
+ "description": "Not found",
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/components/schemas/NotFoundError"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "requestBody": {
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "answers": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "required": ["answers"]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "x-codeSamples": [
|
|
|
+ {
|
|
|
+ "lang": "js",
|
|
|
+ "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/question/{requestID}/reject": {
|
|
|
+ "post": {
|
|
|
+ "operationId": "question.reject",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "in": "query",
|
|
|
+ "name": "directory",
|
|
|
+ "schema": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "in": "path",
|
|
|
+ "name": "requestID",
|
|
|
+ "schema": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "summary": "Reject question request",
|
|
|
+ "description": "Reject a question request from the AI assistant.",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "Question rejected successfully",
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "type": "boolean"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "400": {
|
|
|
+ "description": "Bad request",
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/components/schemas/BadRequestError"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "404": {
|
|
|
+ "description": "Not found",
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/components/schemas/NotFoundError"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "x-codeSamples": [
|
|
|
+ {
|
|
|
+ "lang": "js",
|
|
|
+ "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
"/command": {
|
|
|
"get": {
|
|
|
"operationId": "command.list",
|
|
|
@@ -6906,6 +7085,138 @@
|
|
|
},
|
|
|
"required": ["type", "properties"]
|
|
|
},
|
|
|
+ "QuestionOption": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "label": {
|
|
|
+ "description": "Display text (1-5 words, concise)",
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "description": {
|
|
|
+ "description": "Explanation of choice",
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "required": ["label", "description"]
|
|
|
+ },
|
|
|
+ "QuestionInfo": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "question": {
|
|
|
+ "description": "Complete question",
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "header": {
|
|
|
+ "description": "Very short label (max 12 chars)",
|
|
|
+ "type": "string",
|
|
|
+ "maxLength": 12
|
|
|
+ },
|
|
|
+ "options": {
|
|
|
+ "description": "Available choices",
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/components/schemas/QuestionOption"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "required": ["question", "header", "options"]
|
|
|
+ },
|
|
|
+ "QuestionRequest": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "id": {
|
|
|
+ "type": "string",
|
|
|
+ "pattern": "^que.*"
|
|
|
+ },
|
|
|
+ "sessionID": {
|
|
|
+ "type": "string",
|
|
|
+ "pattern": "^ses.*"
|
|
|
+ },
|
|
|
+ "questions": {
|
|
|
+ "description": "Questions to ask",
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/components/schemas/QuestionInfo"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "tool": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "messageID": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "callID": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "required": ["messageID", "callID"]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "required": ["id", "sessionID", "questions"]
|
|
|
+ },
|
|
|
+ "Event.question.asked": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "type": {
|
|
|
+ "type": "string",
|
|
|
+ "const": "question.asked"
|
|
|
+ },
|
|
|
+ "properties": {
|
|
|
+ "$ref": "#/components/schemas/QuestionRequest"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "required": ["type", "properties"]
|
|
|
+ },
|
|
|
+ "Event.question.replied": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "type": {
|
|
|
+ "type": "string",
|
|
|
+ "const": "question.replied"
|
|
|
+ },
|
|
|
+ "properties": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "sessionID": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "requestID": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "answers": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "required": ["sessionID", "requestID", "answers"]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "required": ["type", "properties"]
|
|
|
+ },
|
|
|
+ "Event.question.rejected": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "type": {
|
|
|
+ "type": "string",
|
|
|
+ "const": "question.rejected"
|
|
|
+ },
|
|
|
+ "properties": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "sessionID": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "requestID": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "required": ["sessionID", "requestID"]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "required": ["type", "properties"]
|
|
|
+ },
|
|
|
"Event.session.compacted": {
|
|
|
"type": "object",
|
|
|
"properties": {
|
|
|
@@ -7630,6 +7941,15 @@
|
|
|
{
|
|
|
"$ref": "#/components/schemas/Event.session.idle"
|
|
|
},
|
|
|
+ {
|
|
|
+ "$ref": "#/components/schemas/Event.question.asked"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "$ref": "#/components/schemas/Event.question.replied"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "$ref": "#/components/schemas/Event.question.rejected"
|
|
|
+ },
|
|
|
{
|
|
|
"$ref": "#/components/schemas/Event.session.compacted"
|
|
|
},
|
|
|
@@ -8289,6 +8609,9 @@
|
|
|
"todoread": {
|
|
|
"$ref": "#/components/schemas/PermissionActionConfig"
|
|
|
},
|
|
|
+ "question": {
|
|
|
+ "$ref": "#/components/schemas/PermissionActionConfig"
|
|
|
+ },
|
|
|
"webfetch": {
|
|
|
"$ref": "#/components/schemas/PermissionActionConfig"
|
|
|
},
|