|
|
@@ -12807,6 +12807,139 @@
|
|
|
}
|
|
|
},
|
|
|
"/api/session/{sessionID}/permission": {
|
|
|
+ "post": {
|
|
|
+ "tags": ["permissions"],
|
|
|
+ "operationId": "v2.session.permission.create",
|
|
|
+ "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": "object",
|
|
|
+ "properties": {
|
|
|
+ "id": {
|
|
|
+ "type": "string",
|
|
|
+ "pattern": "^per"
|
|
|
+ },
|
|
|
+ "effect": {
|
|
|
+ "$ref": "#/components/schemas/PermissionV2Effect"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "required": ["id", "effect"],
|
|
|
+ "additionalProperties": false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "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": "Evaluate and, when approval is required, create a permission request for a session.",
|
|
|
+ "summary": "Create permission request",
|
|
|
+ "requestBody": {
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "id": {
|
|
|
+ "type": "string",
|
|
|
+ "pattern": "^per"
|
|
|
+ },
|
|
|
+ "action": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "resources": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "save": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "metadata": {
|
|
|
+ "type": "object"
|
|
|
+ },
|
|
|
+ "source": {
|
|
|
+ "$ref": "#/components/schemas/PermissionV2Source"
|
|
|
+ },
|
|
|
+ "agent": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "required": ["action", "resources"],
|
|
|
+ "additionalProperties": false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ "x-codeSamples": [
|
|
|
+ {
|
|
|
+ "lang": "js",
|
|
|
+ "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.permission.create({\n ...\n})"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
"get": {
|
|
|
"tags": ["permissions"],
|
|
|
"operationId": "v2.session.permission.list",
|
|
|
@@ -12891,6 +13024,100 @@
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
+ "/api/session/{sessionID}/permission/{requestID}": {
|
|
|
+ "get": {
|
|
|
+ "tags": ["permissions"],
|
|
|
+ "operationId": "v2.session.permission.get",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "name": "sessionID",
|
|
|
+ "in": "path",
|
|
|
+ "schema": {
|
|
|
+ "type": "string",
|
|
|
+ "pattern": "^ses"
|
|
|
+ },
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "name": "requestID",
|
|
|
+ "in": "path",
|
|
|
+ "schema": {
|
|
|
+ "type": "string",
|
|
|
+ "pattern": "^per"
|
|
|
+ },
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "security": [],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "Success",
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "$ref": "#/components/schemas/PermissionV2Request"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "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 | PermissionNotFoundError",
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "anyOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/components/schemas/PermissionNotFoundError"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "$ref": "#/components/schemas/SessionNotFoundError"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "$ref": "#/components/schemas/SessionNotFoundError"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "description": "Retrieve a pending permission request owned by a session.",
|
|
|
+ "summary": "Get permission request",
|
|
|
+ "x-codeSamples": [
|
|
|
+ {
|
|
|
+ "lang": "js",
|
|
|
+ "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.permission.get({\n ...\n})"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
"/api/session/{sessionID}/permission/{requestID}/reply": {
|
|
|
"post": {
|
|
|
"tags": ["permissions"],
|