diff --git a/packages/client/src/promise/generated/client.ts b/packages/client/src/promise/generated/client.ts index cadaa8b85a3..8aecf7404a1 100644 --- a/packages/client/src/promise/generated/client.ts +++ b/packages/client/src/promise/generated/client.ts @@ -488,7 +488,7 @@ export function make(options: ClientOptions) { path: `/api/location`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -513,7 +513,7 @@ export function make(options: ClientOptions) { path: `/api/agent`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404, 503], + declaredStatuses: [400, 401, 403, 404, 503], empty: false, }, requestOptions, @@ -525,7 +525,7 @@ export function make(options: ClientOptions) { path: `/api/agent/${encodeURIComponent(input.agentID)}`, query: { location: input["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -539,7 +539,7 @@ export function make(options: ClientOptions) { path: `/api/plugin`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -551,7 +551,7 @@ export function make(options: ClientOptions) { path: `/api/plugin/gui`, query: { location: input["location"], id: input["id"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -564,7 +564,7 @@ export function make(options: ClientOptions) { query: { location: input?.["location"] }, body: { target: input?.["target"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -577,7 +577,7 @@ export function make(options: ClientOptions) { query: { location: input["location"] }, body: { targets: input["targets"] }, successStatus: 204, - declaredStatuses: [400, 401, 404, 503], + declaredStatuses: [400, 401, 403, 404, 503], empty: true, }, requestOptions, @@ -708,7 +708,7 @@ export function make(options: ClientOptions) { archived: input["archived"], }, successStatus: 204, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: true, }, requestOptions, @@ -741,7 +741,7 @@ export function make(options: ClientOptions) { resume: input["resume"], }, successStatus: 200, - declaredStatuses: [400, 401, 404, 409], + declaredStatuses: [400, 401, 403, 404, 409], empty: false, }, requestOptions, @@ -760,7 +760,7 @@ export function make(options: ClientOptions) { delivery: input["delivery"], }, successStatus: 204, - declaredStatuses: [400, 401, 404, 500], + declaredStatuses: [400, 401, 403, 404, 500], empty: true, }, requestOptions, @@ -779,7 +779,7 @@ export function make(options: ClientOptions) { resume: input["resume"], }, successStatus: 200, - declaredStatuses: [400, 401, 404, 409], + declaredStatuses: [400, 401, 403, 404, 409], empty: false, }, requestOptions, @@ -791,7 +791,7 @@ export function make(options: ClientOptions) { path: `/api/session/${encodeURIComponent(input.sessionID)}/shell`, body: { id: input["id"], command: input["command"] }, successStatus: 204, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: true, }, requestOptions, @@ -803,7 +803,7 @@ export function make(options: ClientOptions) { path: `/api/session/${encodeURIComponent(input.sessionID)}/compact`, body: { id: input["id"], delivery: input["delivery"] }, successStatus: 200, - declaredStatuses: [400, 401, 404, 409], + declaredStatuses: [400, 401, 403, 404, 409], empty: false, }, requestOptions, @@ -816,7 +816,7 @@ export function make(options: ClientOptions) { path: `/api/session/${encodeURIComponent(input.sessionID)}/revert/stage`, body: { messageID: input["messageID"], files: input["files"] }, successStatus: 200, - declaredStatuses: [400, 401, 404, 409, 500], + declaredStatuses: [400, 401, 403, 404, 409, 500], empty: false, }, requestOptions, @@ -827,7 +827,7 @@ export function make(options: ClientOptions) { method: "DELETE", path: `/api/session/${encodeURIComponent(input.sessionID)}/revert`, successStatus: 204, - declaredStatuses: [400, 401, 404, 409, 500], + declaredStatuses: [400, 401, 403, 404, 409, 500], empty: true, }, requestOptions, @@ -862,7 +862,7 @@ export function make(options: ClientOptions) { path: `/api/session/${encodeURIComponent(input.sessionID)}/diff`, query: { from: input["from"], to: input["to"], context: input["context"] }, successStatus: 200, - declaredStatuses: [400, 401, 404, 500], + declaredStatuses: [400, 401, 403, 404, 500], empty: false, }, requestOptions, @@ -910,7 +910,7 @@ export function make(options: ClientOptions) { path: `/api/session/${encodeURIComponent(input.sessionID)}/generate`, body: { prompt: input["prompt"] }, successStatus: 200, - declaredStatuses: [400, 401, 404, 503], + declaredStatuses: [400, 401, 403, 404, 503], empty: false, }, requestOptions, @@ -958,7 +958,7 @@ export function make(options: ClientOptions) { method: "GET", path: `/api/session/${encodeURIComponent(input.sessionID)}/form`, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -970,7 +970,7 @@ export function make(options: ClientOptions) { path: `/api/session/${encodeURIComponent(input.sessionID)}/form`, body: { id: input["id"], title: input["title"], metadata: input["metadata"], fields: input["fields"] }, successStatus: 200, - declaredStatuses: [400, 401, 404, 409], + declaredStatuses: [400, 401, 403, 404, 409], empty: false, }, requestOptions, @@ -981,7 +981,7 @@ export function make(options: ClientOptions) { method: "GET", path: `/api/session/${encodeURIComponent(input.sessionID)}/form/${encodeURIComponent(input.formID)}`, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -993,7 +993,7 @@ export function make(options: ClientOptions) { path: `/api/session/${encodeURIComponent(input.sessionID)}/form/${encodeURIComponent(input.formID)}/reply`, body: { answer: input["answer"] }, successStatus: 204, - declaredStatuses: [400, 401, 404, 409], + declaredStatuses: [400, 401, 403, 404, 409], empty: true, }, requestOptions, @@ -1005,7 +1005,7 @@ export function make(options: ClientOptions) { path: `/api/session/${encodeURIComponent(input.sessionID)}/form/${encodeURIComponent(input.formID)}`, query: { message: input["message"] }, successStatus: 204, - declaredStatuses: [400, 401, 404, 409], + declaredStatuses: [400, 401, 403, 404, 409], empty: true, }, requestOptions, @@ -1087,7 +1087,7 @@ export function make(options: ClientOptions) { path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/skill`, body: { id: input["id"], resume: input["resume"] }, successStatus: 204, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: true, }, requestOptions, @@ -1165,7 +1165,7 @@ export function make(options: ClientOptions) { path: `/api/experimental/generate/text`, body: { prompt: input["prompt"], model: input["model"] }, successStatus: 200, - declaredStatuses: [400, 401, 404, 422, 502, 503], + declaredStatuses: [400, 401, 403, 404, 422, 502, 503], empty: false, }, requestOptions, @@ -1184,7 +1184,7 @@ export function make(options: ClientOptions) { resolution: input["resolution"], }, successStatus: 200, - declaredStatuses: [400, 401, 404, 422, 502, 503], + declaredStatuses: [400, 401, 403, 404, 422, 502, 503], empty: false, }, requestOptions, @@ -1196,7 +1196,7 @@ export function make(options: ClientOptions) { path: `/api/experimental/generate/decisions`, body: { model: input["model"], input: input["input"], questions: input["questions"] }, successStatus: 200, - declaredStatuses: [400, 401, 404, 422, 502, 503], + declaredStatuses: [400, 401, 403, 404, 422, 502, 503], empty: false, }, requestOptions, @@ -1209,7 +1209,7 @@ export function make(options: ClientOptions) { method: "GET", path: `/api/experimental/voice/models`, successStatus: 200, - declaredStatuses: [400, 401, 404, 503], + declaredStatuses: [400, 401, 403, 404, 503], empty: false, }, requestOptions, @@ -1221,7 +1221,7 @@ export function make(options: ClientOptions) { path: `/api/experimental/voice/session`, body: { model: input["model"], session: input["session"], transport: input["transport"] }, successStatus: 200, - declaredStatuses: [400, 401, 404, 503], + declaredStatuses: [400, 401, 403, 404, 503], empty: false, }, requestOptions, @@ -1237,7 +1237,7 @@ export function make(options: ClientOptions) { query: { location: input["location"] }, body: { url: input["url"] }, successStatus: 204, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: true, }, requestOptions, @@ -1253,7 +1253,7 @@ export function make(options: ClientOptions) { query: { location: input["location"] }, body: { config: input["config"] }, successStatus: 204, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: true, }, requestOptions, @@ -1265,7 +1265,7 @@ export function make(options: ClientOptions) { path: `/api/experimental/mcp/${encodeURIComponent(input.server)}`, query: { location: input["location"] }, successStatus: 204, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: true, }, requestOptions, @@ -1277,7 +1277,7 @@ export function make(options: ClientOptions) { path: `/api/experimental/mcp/${encodeURIComponent(input.server)}/connect`, query: { location: input["location"] }, successStatus: 204, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: true, }, requestOptions, @@ -1289,7 +1289,7 @@ export function make(options: ClientOptions) { path: `/api/experimental/mcp/${encodeURIComponent(input.server)}/disconnect`, query: { location: input["location"] }, successStatus: 204, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: true, }, requestOptions, @@ -1319,7 +1319,7 @@ export function make(options: ClientOptions) { query: { location: input["location"], path: input["path"] }, body: input["payload"], successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, binaryBody: true, }, @@ -1333,7 +1333,7 @@ export function make(options: ClientOptions) { query: { location: input["location"] }, body: { path: input["path"] }, successStatus: 204, - declaredStatuses: [400, 401, 404, 503], + declaredStatuses: [400, 401, 403, 404, 503], empty: true, }, requestOptions, @@ -1346,7 +1346,7 @@ export function make(options: ClientOptions) { query: { location: input["location"] }, body: { path: input["path"] }, successStatus: 204, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: true, }, requestOptions, @@ -1590,7 +1590,7 @@ export function make(options: ClientOptions) { path: `/api/experimental/usage/limits`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404, 503], + declaredStatuses: [400, 401, 403, 404, 503], empty: false, }, requestOptions, @@ -1604,7 +1604,7 @@ export function make(options: ClientOptions) { path: `/api/experimental/config`, body: { shell: input["shell"] }, successStatus: 204, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: true, }, requestOptions, @@ -1633,7 +1633,7 @@ export function make(options: ClientOptions) { path: `/api/model`, query: { location: input?.["location"], types: input?.["types"] }, successStatus: 200, - declaredStatuses: [400, 401, 404, 503], + declaredStatuses: [400, 401, 403, 404, 503], empty: false, }, requestOptions, @@ -1645,7 +1645,7 @@ export function make(options: ClientOptions) { path: `/api/model/default`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404, 503], + declaredStatuses: [400, 401, 403, 404, 503], empty: false, }, requestOptions, @@ -1659,7 +1659,7 @@ export function make(options: ClientOptions) { path: `/api/provider`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404, 503], + declaredStatuses: [400, 401, 403, 404, 503], empty: false, }, requestOptions, @@ -1671,7 +1671,7 @@ export function make(options: ClientOptions) { path: `/api/provider/${encodeURIComponent(input.providerID)}`, query: { location: input["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404, 503], + declaredStatuses: [400, 401, 403, 404, 503], empty: false, }, requestOptions, @@ -1685,7 +1685,7 @@ export function make(options: ClientOptions) { path: `/api/integration`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -1697,7 +1697,7 @@ export function make(options: ClientOptions) { path: `/api/integration/${encodeURIComponent(input.integrationID)}`, query: { location: input["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -1711,7 +1711,7 @@ export function make(options: ClientOptions) { query: { location: input["location"] }, body: { key: input["key"], answer: input["answer"], label: input["label"] }, successStatus: 204, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: true, }, requestOptions, @@ -1724,7 +1724,7 @@ export function make(options: ClientOptions) { query: { location: input["location"] }, body: { methodID: input["methodID"], answer: input["answer"], label: input["label"] }, successStatus: 204, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: true, }, requestOptions, @@ -1739,7 +1739,7 @@ export function make(options: ClientOptions) { query: { location: input["location"] }, body: { methodID: input["methodID"], answer: input["answer"], label: input["label"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -1751,7 +1751,7 @@ export function make(options: ClientOptions) { path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/oauth/${encodeURIComponent(input.attemptID)}`, query: { location: input["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -1764,7 +1764,7 @@ export function make(options: ClientOptions) { query: { location: input["location"] }, body: { code: input["code"] }, successStatus: 204, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: true, }, requestOptions, @@ -1776,7 +1776,7 @@ export function make(options: ClientOptions) { path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/oauth/${encodeURIComponent(input.attemptID)}`, query: { location: input["location"] }, successStatus: 204, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: true, }, requestOptions, @@ -1791,7 +1791,7 @@ export function make(options: ClientOptions) { query: { location: input["location"] }, body: { methodID: input["methodID"], label: input["label"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -1803,7 +1803,7 @@ export function make(options: ClientOptions) { path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/command/${encodeURIComponent(input.attemptID)}`, query: { location: input["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -1815,7 +1815,7 @@ export function make(options: ClientOptions) { path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/command/${encodeURIComponent(input.attemptID)}`, query: { location: input["location"] }, successStatus: 204, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: true, }, requestOptions, @@ -1830,7 +1830,7 @@ export function make(options: ClientOptions) { path: `/api/mcp`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -1843,7 +1843,7 @@ export function make(options: ClientOptions) { path: `/api/mcp/resource`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -1948,7 +1948,7 @@ export function make(options: ClientOptions) { path: `/api/form`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -1963,7 +1963,7 @@ export function make(options: ClientOptions) { path: `/api/permission/request`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -1977,7 +1977,7 @@ export function make(options: ClientOptions) { path: `/api/permission/saved`, query: { projectID: input?.["projectID"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2021,7 +2021,7 @@ export function make(options: ClientOptions) { agent: input["agent"], }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2032,7 +2032,7 @@ export function make(options: ClientOptions) { method: "GET", path: `/api/session/${encodeURIComponent(input.sessionID)}/permission`, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2043,7 +2043,7 @@ export function make(options: ClientOptions) { method: "GET", path: `/api/session/${encodeURIComponent(input.sessionID)}/permission/${encodeURIComponent(input.requestID)}`, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2055,7 +2055,7 @@ export function make(options: ClientOptions) { path: `/api/session/${encodeURIComponent(input.sessionID)}/permission/${encodeURIComponent(input.requestID)}/reply`, body: { decision: input["decision"], message: input["message"] }, successStatus: 204, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: true, }, requestOptions, @@ -2069,7 +2069,7 @@ export function make(options: ClientOptions) { path: `/api/fs/read/${encodePath(input.path)}`, query: { location: input["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, binary: true, }, @@ -2082,7 +2082,7 @@ export function make(options: ClientOptions) { path: `/api/fs/list`, query: { location: input?.["location"], path: input?.["path"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2094,7 +2094,7 @@ export function make(options: ClientOptions) { path: `/api/fs/find`, query: { location: input["location"], query: input["query"], type: input["type"], limit: input["limit"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2108,7 +2108,7 @@ export function make(options: ClientOptions) { path: `/api/command`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2122,7 +2122,7 @@ export function make(options: ClientOptions) { path: `/api/skill`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2137,7 +2137,7 @@ export function make(options: ClientOptions) { query: { location: input["location"] }, body: { input: input["input"] }, successStatus: 200, - declaredStatuses: [400, 401, 404, 500], + declaredStatuses: [400, 401, 403, 404, 500], empty: false, }, requestOptions, @@ -2165,7 +2165,7 @@ export function make(options: ClientOptions) { path: `/api/pty`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2184,7 +2184,7 @@ export function make(options: ClientOptions) { env: input?.["env"], }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2196,7 +2196,7 @@ export function make(options: ClientOptions) { path: `/api/pty/${encodeURIComponent(input.ptyID)}`, query: { location: input["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2209,7 +2209,7 @@ export function make(options: ClientOptions) { query: { location: input["location"] }, body: { title: input["title"], size: input["size"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2221,7 +2221,7 @@ export function make(options: ClientOptions) { path: `/api/pty/${encodeURIComponent(input.ptyID)}`, query: { location: input["location"] }, successStatus: 204, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: true, }, requestOptions, @@ -2250,7 +2250,7 @@ export function make(options: ClientOptions) { path: `/api/shell`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2268,7 +2268,7 @@ export function make(options: ClientOptions) { metadata: input["metadata"], }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2280,7 +2280,7 @@ export function make(options: ClientOptions) { path: `/api/shell/${encodeURIComponent(input.id)}`, query: { location: input["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2292,7 +2292,7 @@ export function make(options: ClientOptions) { path: `/api/shell/${encodeURIComponent(input.id)}/output`, query: { location: input["location"], cursor: input["cursor"], limit: input["limit"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2304,7 +2304,7 @@ export function make(options: ClientOptions) { path: `/api/shell/${encodeURIComponent(input.id)}`, query: { location: input["location"] }, successStatus: 204, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: true, }, requestOptions, @@ -2318,7 +2318,7 @@ export function make(options: ClientOptions) { path: `/api/reference`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2388,7 +2388,7 @@ export function make(options: ClientOptions) { path: `/api/vcs/init`, query: { location: input?.["location"], provider: input?.["provider"] }, successStatus: 204, - declaredStatuses: [400, 401, 404, 409, 501, 503], + declaredStatuses: [400, 401, 403, 404, 409, 501, 503], empty: true, }, requestOptions, @@ -2400,7 +2400,7 @@ export function make(options: ClientOptions) { path: `/api/vcs`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2412,7 +2412,7 @@ export function make(options: ClientOptions) { path: `/api/vcs/base`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404, 503], + declaredStatuses: [400, 401, 403, 404, 503], empty: false, }, requestOptions, @@ -2424,7 +2424,7 @@ export function make(options: ClientOptions) { path: `/api/vcs/status`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2437,7 +2437,7 @@ export function make(options: ClientOptions) { path: `/api/vcs/branch`, query: { location: input?.["location"], search: input?.["search"], limit: input?.["limit"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2456,7 +2456,7 @@ export function make(options: ClientOptions) { untracked: input["untracked"], }, successStatus: 200, - declaredStatuses: [400, 401, 404, 503], + declaredStatuses: [400, 401, 403, 404, 503], empty: false, }, requestOptions, @@ -2509,7 +2509,7 @@ export function make(options: ClientOptions) { path: `/api/websearch/provider`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404, 503], + declaredStatuses: [400, 401, 403, 404, 503], empty: false, }, requestOptions, @@ -2522,7 +2522,7 @@ export function make(options: ClientOptions) { query: { location: input["location"] }, body: { query: input["query"], providerID: input["providerID"] }, successStatus: 200, - declaredStatuses: [400, 401, 404, 503], + declaredStatuses: [400, 401, 403, 404, 503], empty: false, }, requestOptions, @@ -2536,7 +2536,7 @@ export function make(options: ClientOptions) { path: `/api/config`, query: { location: input?.["location"] }, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, @@ -2547,7 +2547,7 @@ export function make(options: ClientOptions) { method: "GET", path: `/api/config/shell`, successStatus: 200, - declaredStatuses: [400, 401, 404], + declaredStatuses: [400, 401, 403, 404], empty: false, }, requestOptions, diff --git a/packages/client/src/promise/generated/types.ts b/packages/client/src/promise/generated/types.ts index d9b299ebbd7..60ff8719499 100644 --- a/packages/client/src/promise/generated/types.ts +++ b/packages/client/src/promise/generated/types.ts @@ -2863,6 +2863,14 @@ export type UnauthorizedError = { readonly _tag: "UnauthorizedError"; readonly m export const isUnauthorizedError = (value: unknown): value is UnauthorizedError => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "UnauthorizedError" +export type LocationAccessDeniedError = { + readonly _tag: "LocationAccessDeniedError" + readonly location: { readonly directory: string } + readonly message: string +} +export const isLocationAccessDeniedError = (value: unknown): value is LocationAccessDeniedError => + typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "LocationAccessDeniedError" + export type LocationNotFoundError = { readonly _tag: "LocationNotFoundError" readonly location: { readonly directory: string } diff --git a/packages/protocol/openapi.json b/packages/protocol/openapi.json index 3fc515d3710..e2f193f6b3c 100644 --- a/packages/protocol/openapi.json +++ b/packages/protocol/openapi.json @@ -209,6 +209,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -350,6 +360,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -461,6 +481,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "AgentNotFoundError | LocationNotFoundError", "content": { @@ -564,6 +594,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -665,6 +705,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "PluginNotFoundError | LocationNotFoundError", "content": { @@ -768,6 +818,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -867,6 +927,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -1791,6 +1861,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "SessionNotFoundError | LocationNotFoundError", "content": { @@ -2241,6 +2321,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "SessionNotFoundError | LocationNotFoundError", "content": { @@ -2380,6 +2470,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "SessionNotFoundError | CommandNotFoundError | LocationNotFoundError", "content": { @@ -2502,6 +2602,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "SessionNotFoundError | SkillNotFoundError | LocationNotFoundError", "content": { @@ -2607,6 +2717,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "SessionNotFoundError | LocationNotFoundError", "content": { @@ -2738,6 +2858,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "SessionNotFoundError | LocationNotFoundError", "content": { @@ -2840,6 +2970,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "SessionNotFoundError | LocationNotFoundError", "content": { @@ -3022,6 +3162,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "MessageNotFoundError | SessionNotFoundError | LocationNotFoundError", "content": { @@ -3133,6 +3283,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "SessionNotFoundError | LocationNotFoundError", "content": { @@ -3422,6 +3582,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "MessageNotFoundError | SessionNotFoundError | LocationNotFoundError", "content": { @@ -3941,6 +4111,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "SessionNotFoundError | LocationNotFoundError", "content": { @@ -4433,6 +4613,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "SessionNotFoundError | LocationNotFoundError", "content": { @@ -4506,6 +4696,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "SessionNotFoundError | LocationNotFoundError", "content": { @@ -4609,6 +4809,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "SessionNotFoundError | FormNotFoundError | LocationNotFoundError", "content": { @@ -4694,6 +4904,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "SessionNotFoundError | FormNotFoundError | LocationNotFoundError", "content": { @@ -4783,6 +5003,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "SessionNotFoundError | FormNotFoundError | LocationNotFoundError", "content": { @@ -5232,6 +5462,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -5342,6 +5582,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -5404,6 +5654,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "ProviderNotFoundError | ModelNotFoundError | LocationNotFoundError", "content": { @@ -5523,6 +5783,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "ProviderNotFoundError | ModelNotFoundError | LocationNotFoundError", "content": { @@ -5643,6 +5913,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "ProviderNotFoundError | ModelNotFoundError | LocationNotFoundError", "content": { @@ -5745,6 +6025,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "ProviderNotFoundError | ModelNotFoundError | LocationNotFoundError", "content": { @@ -5847,6 +6137,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -5909,6 +6209,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -6045,6 +6355,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -6156,6 +6476,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "ProviderNotFoundError | LocationNotFoundError", "content": { @@ -6269,6 +6599,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -6370,6 +6710,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "IntegrationNotFoundError | LocationNotFoundError", "content": { @@ -6453,6 +6803,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -6554,6 +6914,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "IntegrationNotFoundError | LocationNotFoundError", "content": { @@ -6682,6 +7052,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "IntegrationNotFoundError | LocationNotFoundError", "content": { @@ -6827,6 +7207,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -6973,6 +7363,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "IntegrationNotFoundError | IntegrationAttemptNotFoundError | LocationNotFoundError", "content": { @@ -7073,6 +7473,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -7165,6 +7575,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "IntegrationNotFoundError | IntegrationAttemptNotFoundError | LocationNotFoundError", "content": { @@ -7299,6 +7719,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "IntegrationNotFoundError | IntegrationMethodNotFoundError | LocationNotFoundError", "content": { @@ -7445,6 +7875,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "IntegrationNotFoundError | IntegrationAttemptNotFoundError | LocationNotFoundError", "content": { @@ -7545,6 +7985,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -7641,6 +8091,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -7725,6 +8185,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -7831,6 +8301,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "McpServerNotFoundError | LocationNotFoundError", "content": { @@ -7922,6 +8402,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "McpServerNotFoundError | LocationNotFoundError", "content": { @@ -8013,6 +8503,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "McpServerNotFoundError | LocationNotFoundError", "content": { @@ -8113,6 +8613,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -8230,11 +8740,18 @@ } }, "403": { - "description": "ForbiddenError", + "description": "ForbiddenError | LocationAccessDeniedError", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ForbiddenErrorEncoded" + "anyOf": [ + { + "$ref": "#/components/schemas/ForbiddenErrorEncoded" + }, + { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + ] } } } @@ -8344,11 +8861,18 @@ } }, "403": { - "description": "ForbiddenError", + "description": "ForbiddenError | LocationAccessDeniedError", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ForbiddenErrorEncoded" + "anyOf": [ + { + "$ref": "#/components/schemas/ForbiddenErrorEncoded" + }, + { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + ] } } } @@ -8864,6 +9388,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -8960,6 +9494,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -9038,6 +9582,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -9269,6 +9823,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "SessionNotFoundError | LocationNotFoundError", "content": { @@ -9400,6 +9964,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "SessionNotFoundError | LocationNotFoundError", "content": { @@ -9483,6 +10057,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "SessionNotFoundError | PermissionNotFoundError | LocationNotFoundError", "content": { @@ -9555,6 +10139,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "SessionNotFoundError | PermissionNotFoundError | LocationNotFoundError", "content": { @@ -9676,6 +10270,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "FileNotFoundError | LocationNotFoundError", "content": { @@ -9795,6 +10399,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "FileNotFoundError | LocationNotFoundError", "content": { @@ -9930,6 +10544,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -10032,6 +10656,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -10119,6 +10753,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "FileNotFoundError | LocationNotFoundError", "content": { @@ -10228,6 +10872,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -10342,6 +10996,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -10438,6 +11102,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -10544,6 +11218,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -11010,6 +11694,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -11101,6 +11795,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -11236,6 +11940,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "PtyNotFoundError | LocationNotFoundError", "content": { @@ -11342,6 +12056,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "PtyNotFoundError | LocationNotFoundError", "content": { @@ -11464,6 +12188,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "PtyNotFoundError | LocationNotFoundError", "content": { @@ -11588,11 +12322,18 @@ } }, "403": { - "description": "ForbiddenError", + "description": "ForbiddenError | LocationAccessDeniedError", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ForbiddenErrorEncoded" + "anyOf": [ + { + "$ref": "#/components/schemas/ForbiddenErrorEncoded" + }, + { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + ] } } } @@ -11687,11 +12428,18 @@ } }, "403": { - "description": "ForbiddenError", + "description": "ForbiddenError | LocationAccessDeniedError", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ForbiddenErrorEncoded" + "anyOf": [ + { + "$ref": "#/components/schemas/ForbiddenErrorEncoded" + }, + { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + ] } } } @@ -13177,6 +13925,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -13268,6 +14026,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -13397,6 +14165,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "ShellNotFoundError | LocationNotFoundError", "content": { @@ -13486,6 +14264,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -13625,6 +14413,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "ShellNotFoundError | LocationNotFoundError", "content": { @@ -13728,6 +14526,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -14076,6 +14884,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -14199,6 +15017,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -14299,6 +15127,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -14405,6 +15243,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -14528,6 +15376,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -14663,6 +15521,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -15135,6 +16003,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -15238,6 +16116,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -15368,6 +16256,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -15464,6 +16362,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -15519,6 +16427,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -15564,6 +16482,16 @@ } } }, + "403": { + "description": "LocationAccessDeniedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocationAccessDeniedErrorEncoded" + } + } + } + }, "404": { "description": "LocationNotFoundError", "content": { @@ -19087,6 +20015,23 @@ "required": ["directory"], "additionalProperties": false }, + "LocationAccessDeniedErrorEncoded": { + "type": "object", + "properties": { + "_tag": { + "type": "string", + "enum": ["LocationAccessDeniedError"] + }, + "location": { + "$ref": "#/components/schemas/Location.PublicRef" + }, + "message": { + "type": "string" + } + }, + "required": ["_tag", "location", "message"], + "additionalProperties": false + }, "LocationNotFoundErrorEncoded": { "type": "object", "properties": { diff --git a/packages/protocol/src/client.ts b/packages/protocol/src/client.ts index 40ae172abb4..f817fa9b48a 100644 --- a/packages/protocol/src/client.ts +++ b/packages/protocol/src/client.ts @@ -1,4 +1,4 @@ -import { LocationNotFoundError, InvalidRequestError, SessionNotFoundError } from "./errors.js" +import { LocationAccessDeniedError, LocationNotFoundError, InvalidRequestError, SessionNotFoundError } from "./errors.js" import { makeDefaultApi } from "./api.js" import type { Api } from "./api.js" import type { Context } from "effect" @@ -7,12 +7,12 @@ import type { EventGroup } from "./groups/event.js" class LocationMiddleware extends HttpApiMiddleware.Service()( "@opencode/client/LocationMiddleware", - { error: [LocationNotFoundError] }, + { error: [LocationNotFoundError, LocationAccessDeniedError] }, ) {} class SessionLocationMiddleware extends HttpApiMiddleware.Service()( "@opencode/client/SessionLocationMiddleware", - { error: [InvalidRequestError, SessionNotFoundError, LocationNotFoundError] }, + { error: [InvalidRequestError, SessionNotFoundError, LocationNotFoundError, LocationAccessDeniedError] }, ) {} type ClientApiShape = Api< diff --git a/packages/protocol/src/errors.ts b/packages/protocol/src/errors.ts index 951db21b3d9..b561cfe358e 100644 --- a/packages/protocol/src/errors.ts +++ b/packages/protocol/src/errors.ts @@ -8,6 +8,12 @@ export class LocationNotFoundError extends Schema.TaggedError()( + "LocationAccessDeniedError", + { location: Location.PublicRef, message: Schema.String }, + { httpApiStatus: 403 }, +) {} + export class InvalidRequestError extends Schema.TaggedError()( "InvalidRequestError", { diff --git a/packages/protocol/src/groups/generate.ts b/packages/protocol/src/groups/generate.ts index f462b75d07d..cdac4adb814 100644 --- a/packages/protocol/src/groups/generate.ts +++ b/packages/protocol/src/groups/generate.ts @@ -4,6 +4,7 @@ import { Schema } from "effect" import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/http-api" import { InvalidRequestError, + LocationAccessDeniedError, LocationNotFoundError, ModelNotFoundError, ProviderNotFoundError, @@ -20,6 +21,7 @@ const errors = [ ProviderRequestError, ServiceUnavailableError, LocationNotFoundError, + LocationAccessDeniedError, ] const textContract = { diff --git a/packages/protocol/src/groups/mcp.ts b/packages/protocol/src/groups/mcp.ts index d32c57e9a70..dd3ef822dbd 100644 --- a/packages/protocol/src/groups/mcp.ts +++ b/packages/protocol/src/groups/mcp.ts @@ -3,7 +3,7 @@ import { Location } from "@opencode/schema/location" import { PtyTicket } from "@opencode/schema/pty-ticket" import { Context, Schema } from "effect" import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema, OpenApi } from "effect/http-api" -import { ForbiddenError, LocationNotFoundError, McpServerNotFoundError } from "../errors.js" +import { ForbiddenError, LocationAccessDeniedError, LocationNotFoundError, McpServerNotFoundError } from "../errors.js" import { LocationQuery, locationQueryOpenApi } from "./location.js" import { PTY_CONNECT_TICKET_QUERY, PTY_CONNECT_TOKEN_HEADER } from "./pty.js" @@ -139,7 +139,7 @@ export const makeMcpGroup = ()( "@opencode/HttpApiLocation", - { error: [LocationNotFoundError] }, + { error: [LocationNotFoundError, LocationAccessDeniedError] }, ) {} export function locationErrors(effect: Effect.Effect) { @@ -30,6 +35,20 @@ export function locationErrors(effect: Effect.Effect) { }), ), ), + // Location boot keeps an unreadable folder a defect, so clients would only see an empty 500. + Effect.catchDefect((defect) => + defect instanceof FileSystem.DirectoryAccessDeniedError + ? Effect.fail( + new LocationAccessDeniedError({ + location: { directory: defect.directory }, + message: + process.platform === "darwin" + ? `Location access denied: ${defect.directory}. If macOS privacy settings block it, allow access in System Settings > Privacy & Security > Files & Folders.` + : `Location access denied: ${defect.directory}`, + }), + ) + : Effect.die(defect), + ), ) } diff --git a/packages/server/src/middleware/form-location.ts b/packages/server/src/middleware/form-location.ts index 3bf93b33f66..3d526a72009 100644 --- a/packages/server/src/middleware/form-location.ts +++ b/packages/server/src/middleware/form-location.ts @@ -1,7 +1,12 @@ import { Instance } from "@opencode/core/instance/service" import { LocationServiceMap } from "@opencode/core/location-services" import { Session } from "@opencode/core/session" -import { LocationNotFoundError, InvalidRequestError, SessionNotFoundError } from "@opencode/protocol/errors" +import { + LocationAccessDeniedError, + LocationNotFoundError, + InvalidRequestError, + SessionNotFoundError, +} from "@opencode/protocol/errors" import { Effect, Layer } from "effect" import { HttpRouter, HttpServerRequest, HttpServerResponse } from "effect/http" import { HttpApiMiddleware } from "effect/http-api" @@ -11,7 +16,7 @@ export class FormLocationMiddleware extends HttpApiMiddleware.Service< FormLocationMiddleware, { provides: LocationServices } >()("@opencode/HttpApiFormLocation", { - error: [InvalidRequestError, SessionNotFoundError, LocationNotFoundError], + error: [InvalidRequestError, SessionNotFoundError, LocationNotFoundError, LocationAccessDeniedError], }) {} export const formLocationLayer = Layer.effect( diff --git a/packages/server/src/middleware/session-location.ts b/packages/server/src/middleware/session-location.ts index 3de912a04d2..f0ab9a9d9e9 100644 --- a/packages/server/src/middleware/session-location.ts +++ b/packages/server/src/middleware/session-location.ts @@ -3,14 +3,19 @@ import { Session } from "@opencode/core/session" import { Effect, Layer } from "effect" import { HttpRouter } from "effect/http" import { HttpApiMiddleware } from "effect/http-api" -import { LocationNotFoundError, InvalidRequestError, SessionNotFoundError } from "@opencode/protocol/errors" +import { + LocationAccessDeniedError, + LocationNotFoundError, + InvalidRequestError, + SessionNotFoundError, +} from "@opencode/protocol/errors" import { locationErrors, sessionInfo, type LocationServices } from "../location" export class SessionLocationMiddleware extends HttpApiMiddleware.Service< SessionLocationMiddleware, { provides: LocationServices } >()("@opencode/HttpApiSessionLocation", { - error: [InvalidRequestError, SessionNotFoundError, LocationNotFoundError], + error: [InvalidRequestError, SessionNotFoundError, LocationNotFoundError, LocationAccessDeniedError], }) {} export const sessionLocationLayer = Layer.effect( diff --git a/packages/server/test/fetch.test.ts b/packages/server/test/fetch.test.ts index 56f8a1dbf96..b42b85e7d7e 100644 --- a/packages/server/test/fetch.test.ts +++ b/packages/server/test/fetch.test.ts @@ -19,57 +19,81 @@ const options = { fs: { filewatcher: false }, } as const -it.live("returns LocationNotFoundError for a missing folder and recovers once it exists", () => - Effect.gen(function* () { - const config = yield* Effect.acquireDisposable(Effect.promise(() => tmpdir("opencode-directory-errors-"))) - const directory = path.join(config.path, "project") - const handler = yield* ServerFetch.make({ ...options, config: { directory: config.path } }) - // Session creation only resolves its placement; it does not boot the Location graph. - const created = yield* Effect.promise(() => - handler( - new Request("http://opencode.local/api/session", { - method: "POST", - headers: { "content-type": "application/json", "x-opencode-directory": encodeURIComponent(directory) }, - body: JSON.stringify({ location: { directory } }), - }), - ), - ) - expect(created.status).toBe(200) - const session = Schema.decodeUnknownSync(Schema.Struct({ data: Session.Info }))( - yield* Effect.promise(() => created.json()), - ).data - const endpoints = [ - "/api/model", - "/api/integration", - `/api/session/${session.id}/permission`, - "/api/session/global/form", - ] - for (const endpoint of endpoints) { - const response = yield* Effect.promise(() => +for (const input of [ + { + failure: "missing", + status: 404, + body: (directory: string) => ({ + _tag: "LocationNotFoundError", + location: { directory }, + message: `Location not found: ${directory}`, + }), + }, + { + failure: "unreadable", + status: 403, + body: (directory: string) => ({ + _tag: "LocationAccessDeniedError", + location: { directory }, + message: expect.stringContaining(`Location access denied: ${directory}`), + }), + }, +] as const) { + // Windows does not enforce POSIX directory modes, and root bypasses them. + const test = + input.failure === "unreadable" && (process.platform === "win32" || process.getuid?.() === 0) ? it.live.skip : it.live + test(`returns a typed error for a ${input.failure} folder and recovers once it is fixed`, () => + Effect.gen(function* () { + const config = yield* Effect.acquireDisposable(Effect.promise(() => tmpdir("opencode-directory-errors-"))) + const directory = path.join(config.path, "project") + if (input.failure === "unreadable") { + yield* Effect.promise(() => fs.mkdir(directory, { mode: 0o000 })) + yield* Effect.addFinalizer(() => Effect.promise(() => fs.chmod(directory, 0o755))) + } + const handler = yield* ServerFetch.make({ ...options, config: { directory: config.path } }) + // Session creation only resolves its placement; it does not boot the Location graph. + const created = yield* Effect.promise(() => handler( - new Request(`http://opencode.local${endpoint}`, { + new Request("http://opencode.local/api/session", { + method: "POST", + headers: { "content-type": "application/json", "x-opencode-directory": encodeURIComponent(directory) }, + body: JSON.stringify({ location: { directory } }), + }), + ), + ) + expect(created.status).toBe(200) + const session = Schema.decodeUnknownSync(Schema.Struct({ data: Session.Info }))( + yield* Effect.promise(() => created.json()), + ).data + const endpoints = [ + "/api/model", + "/api/integration", + `/api/session/${session.id}/permission`, + "/api/session/global/form", + ] + for (const endpoint of endpoints) { + const response = yield* Effect.promise(() => + handler( + new Request(`http://opencode.local${endpoint}`, { + headers: { "x-opencode-directory": encodeURIComponent(directory) }, + }), + ), + ) + expect({ endpoint, status: response.status }).toEqual({ endpoint, status: input.status }) + expect(yield* Effect.promise(() => response.json())).toEqual(input.body(directory)) + } + yield* Effect.promise(() => (input.failure === "missing" ? fs.mkdir(directory) : fs.chmod(directory, 0o755))) + const recovered = yield* Effect.promise(() => + handler( + new Request("http://opencode.local/api/model", { headers: { "x-opencode-directory": encodeURIComponent(directory) }, }), ), ) - expect({ endpoint, status: response.status }).toEqual({ endpoint, status: 404 }) - expect(yield* Effect.promise(() => response.json())).toEqual({ - _tag: "LocationNotFoundError", - location: { directory }, - message: `Location not found: ${directory}`, - }) - } - yield* Effect.promise(() => fs.mkdir(directory)) - const recovered = yield* Effect.promise(() => - handler( - new Request("http://opencode.local/api/model", { - headers: { "x-opencode-directory": encodeURIComponent(directory) }, - }), - ), - ) - expect(recovered.status).toBe(200) - }), -) + expect(recovered.status).toBe(200) + }), + ) +} it.live("manages a session whose directory was deleted", () => Effect.gen(function* () {