diff --git a/packages/sdk/openapi.json b/packages/sdk/openapi.json index 5aa023619..9c99b760d 100644 --- a/packages/sdk/openapi.json +++ b/packages/sdk/openapi.json @@ -9349,6 +9349,168 @@ ] } }, + "/api/fs/read": { + "get": { + "tags": ["v2 filesystem"], + "operationId": "v2.fs.read", + "parameters": [ + { + "name": "location", + "in": "query", + "schema": { + "type": "object", + "properties": { + "directory": { + "type": "string" + }, + "workspace": { + "type": "string" + } + }, + "additionalProperties": false + }, + "required": false, + "style": "deepObject", + "explode": true + }, + { + "name": "path", + "in": "query", + "schema": { + "type": "string" + }, + "required": true + } + ], + "security": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/LocationFileSystemTextContent" + }, + { + "$ref": "#/components/schemas/LocationFileSystemBinaryContent" + } + ] + } + } + } + }, + "400": { + "description": "InvalidRequestError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestError" + } + } + } + }, + "401": { + "description": "UnauthorizedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedError" + } + } + } + } + }, + "description": "Read one file relative to the requested location.", + "summary": "Read file", + "x-codeSamples": [ + { + "lang": "js", + "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.fs.read({\n ...\n})" + } + ] + } + }, + "/api/fs/list": { + "get": { + "tags": ["v2 filesystem"], + "operationId": "v2.fs.list", + "parameters": [ + { + "name": "location", + "in": "query", + "schema": { + "type": "object", + "properties": { + "directory": { + "type": "string" + }, + "workspace": { + "type": "string" + } + }, + "additionalProperties": false + }, + "required": false, + "style": "deepObject", + "explode": true + }, + { + "name": "path", + "in": "query", + "schema": { + "type": "string" + }, + "required": false + } + ], + "security": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationFileSystemEntry" + } + } + } + } + }, + "400": { + "description": "InvalidRequestError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestError" + } + } + } + }, + "401": { + "description": "UnauthorizedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedError" + } + } + } + } + }, + "description": "List direct children of one directory relative to the requested location.", + "summary": "List directory", + "x-codeSamples": [ + { + "lang": "js", + "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.fs.list({\n ...\n})" + } + ] + } + }, "/tui/append-prompt": { "post": { "tags": ["tui"], @@ -21927,6 +22089,64 @@ "required": ["id", "projectID", "action", "resource"], "additionalProperties": false }, + "LocationFileSystemTextContent": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["text"] + }, + "content": { + "type": "string" + }, + "mime": { + "type": "string" + } + }, + "required": ["type", "content", "mime"], + "additionalProperties": false + }, + "LocationFileSystemBinaryContent": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["binary"] + }, + "content": { + "type": "string" + }, + "encoding": { + "type": "string", + "enum": ["base64"] + }, + "mime": { + "type": "string" + } + }, + "required": ["type", "content", "encoding", "mime"], + "additionalProperties": false + }, + "LocationFileSystemEntry": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "type": { + "type": "string", + "enum": ["file", "directory"] + }, + "mime": { + "type": "string" + } + }, + "required": ["path", "uri", "type", "mime"], + "additionalProperties": false + }, "EventModels-devRefreshed": { "type": "object", "properties": { @@ -24772,6 +24992,10 @@ "name": "v2 saved permissions", "description": "Experimental v2 saved permission routes." }, + { + "name": "v2 filesystem", + "description": "Experimental v2 location-scoped filesystem routes." + }, { "name": "tui", "description": "Experimental HttpApi TUI routes."