@kilocode/protocol 0.0.0-stage → 0.0.0-v2-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.ts +58 -0
- package/dist/api.js +77 -0
- package/dist/client.d.ts +63 -0
- package/dist/client.js +55 -0
- package/dist/errors.d.ts +193 -0
- package/dist/errors.js +152 -0
- package/dist/groups/agent.d.ts +225 -0
- package/dist/groups/agent.js +30 -0
- package/dist/groups/command.d.ts +15 -0
- package/dist/groups/command.js +20 -0
- package/dist/groups/config.d.ts +14 -0
- package/dist/groups/config.js +32 -0
- package/dist/groups/credential.d.ts +93 -0
- package/dist/groups/credential.js +50 -0
- package/dist/groups/debug.d.ts +22 -0
- package/dist/groups/debug.js +49 -0
- package/dist/groups/event.d.ts +14853 -0
- package/dist/groups/event.js +51 -0
- package/dist/groups/form.d.ts +138 -0
- package/dist/groups/form.js +18 -0
- package/dist/groups/fs.d.ts +48 -0
- package/dist/groups/fs.js +73 -0
- package/dist/groups/generate.d.ts +33 -0
- package/dist/groups/generate.js +23 -0
- package/dist/groups/integration.d.ts +1724 -0
- package/dist/groups/integration.js +169 -0
- package/dist/groups/location.d.ts +23 -0
- package/dist/groups/location.js +45 -0
- package/dist/groups/mcp.d.ts +103 -0
- package/dist/groups/mcp.js +114 -0
- package/dist/groups/message.d.ts +1416 -0
- package/dist/groups/message.js +77 -0
- package/dist/groups/migration.d.ts +28 -0
- package/dist/groups/migration.js +21 -0
- package/dist/groups/model.d.ts +399 -0
- package/dist/groups/model.js +33 -0
- package/dist/groups/permission.d.ts +175 -0
- package/dist/groups/permission.js +110 -0
- package/dist/groups/persistent-pty.d.ts +242 -0
- package/dist/groups/persistent-pty.js +92 -0
- package/dist/groups/plugin.d.ts +86 -0
- package/dist/groups/plugin.js +45 -0
- package/dist/groups/project.d.ts +83 -0
- package/dist/groups/project.js +33 -0
- package/dist/groups/provider.d.ts +231 -0
- package/dist/groups/provider.js +34 -0
- package/dist/groups/pty.d.ts +151 -0
- package/dist/groups/pty.js +112 -0
- package/dist/groups/reference.d.ts +25 -0
- package/dist/groups/reference.js +33 -0
- package/dist/groups/rpc.d.ts +21 -0
- package/dist/groups/rpc.js +24 -0
- package/dist/groups/server.d.ts +44 -0
- package/dist/groups/server.js +53 -0
- package/dist/groups/session.d.ts +11380 -0
- package/dist/groups/session.js +611 -0
- package/dist/groups/shell.d.ts +125 -0
- package/dist/groups/shell.js +64 -0
- package/dist/groups/skill.d.ts +19 -0
- package/dist/groups/skill.js +20 -0
- package/dist/groups/vcs.d.ts +87 -0
- package/dist/groups/vcs.js +93 -0
- package/dist/groups/voice.d.ts +93 -0
- package/dist/groups/voice.js +89 -0
- package/dist/groups/websearch.d.ts +29 -0
- package/dist/groups/websearch.js +34 -0
- package/dist/groups/worktree.d.ts +41 -0
- package/dist/groups/worktree.js +52 -0
- package/dist/middleware/authorization.d.ts +13 -0
- package/dist/middleware/authorization.js +6 -0
- package/dist/middleware/schema-error.d.ts +13 -0
- package/dist/middleware/schema-error.js +4 -0
- package/dist/simulation.d.ts +1830 -0
- package/dist/simulation.js +497 -0
- package/package.json +45 -4
- package/README.md +0 -3
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { Agent } from "@opencode/schema/agent";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
4
|
+
import { AgentNotFoundError } from "../errors.js";
|
|
5
|
+
export declare const AgentGroup: HttpApiGroup.HttpApiGroup<"server.agent", HttpApiEndpoint.HttpApiEndpoint<"agent.get", "GET", "/api/agent/:agentID", Schema.toCodecStringTree<Schema.Struct<{
|
|
6
|
+
agentID: Schema.brand<Schema.String, "Agent.ID">;
|
|
7
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
8
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
9
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
10
|
+
}>>;
|
|
11
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
12
|
+
readonly location: Schema.Struct<{
|
|
13
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
14
|
+
}>;
|
|
15
|
+
readonly data: Schema.Struct<{
|
|
16
|
+
readonly id: Schema.brand<Schema.String, "Agent.ID">;
|
|
17
|
+
readonly name: Schema.brand<Schema.String, "Agent.Name">;
|
|
18
|
+
readonly model: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
19
|
+
readonly id: Schema.brand<Schema.String, "Model.ID">;
|
|
20
|
+
readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
|
|
21
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
22
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
23
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
24
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
25
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
26
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
27
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
28
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
29
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
30
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
31
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
32
|
+
};
|
|
33
|
+
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
|
|
34
|
+
}> & {
|
|
35
|
+
parse: (input: string) => {
|
|
36
|
+
readonly id: string & import("effect/Brand").Brand<"Model.ID">;
|
|
37
|
+
readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
38
|
+
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
39
|
+
};
|
|
40
|
+
}>>, Schema.optionalKey<Schema.Struct<{
|
|
41
|
+
readonly id: Schema.brand<Schema.String, "Model.ID">;
|
|
42
|
+
readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
|
|
43
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
44
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
45
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
46
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
47
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
48
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
49
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
50
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
51
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
52
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
53
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
54
|
+
};
|
|
55
|
+
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
|
|
56
|
+
}> & {
|
|
57
|
+
parse: (input: string) => {
|
|
58
|
+
readonly id: string & import("effect/Brand").Brand<"Model.ID">;
|
|
59
|
+
readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
60
|
+
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
61
|
+
};
|
|
62
|
+
}>, never, never>;
|
|
63
|
+
readonly request: Schema.Struct<{
|
|
64
|
+
readonly settings: Schema.withConstructorDefault<Schema.StructWithRest<Schema.Struct<{
|
|
65
|
+
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
66
|
+
readonly headerTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
67
|
+
readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
68
|
+
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
69
|
+
readonly type: Schema.Literal<"summary">;
|
|
70
|
+
}>, Schema.Struct<{
|
|
71
|
+
readonly type: Schema.Literal<"native">;
|
|
72
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
73
|
+
readonly type: Schema.Literal<"summary">;
|
|
74
|
+
}>, Schema.Struct<{
|
|
75
|
+
readonly type: Schema.Literal<"native">;
|
|
76
|
+
}>]>>, never, never>;
|
|
77
|
+
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
78
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
79
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>;
|
|
80
|
+
readonly headers: Schema.$Record<Schema.String, Schema.String>;
|
|
81
|
+
readonly body: Schema.$Record<Schema.String, Schema.Any>;
|
|
82
|
+
}>;
|
|
83
|
+
readonly system: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
84
|
+
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
85
|
+
readonly mode: Schema.Literals<readonly ["subagent", "primary", "all"]>;
|
|
86
|
+
readonly hidden: Schema.Boolean;
|
|
87
|
+
readonly color: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
88
|
+
readonly steps: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
89
|
+
readonly permissions: Schema.$Array<Schema.Struct<{
|
|
90
|
+
readonly action: Schema.String;
|
|
91
|
+
readonly resource: Schema.String;
|
|
92
|
+
readonly effect: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
93
|
+
}>>;
|
|
94
|
+
}> & {
|
|
95
|
+
default: (id: Agent.ID) => {
|
|
96
|
+
id: string & import("effect/Brand").Brand<"Agent.ID">;
|
|
97
|
+
name: string & import("effect/Brand").Brand<"Agent.Name">;
|
|
98
|
+
request: {
|
|
99
|
+
settings: {};
|
|
100
|
+
headers: {};
|
|
101
|
+
body: {};
|
|
102
|
+
};
|
|
103
|
+
mode: "primary";
|
|
104
|
+
hidden: false;
|
|
105
|
+
permissions: ({
|
|
106
|
+
action: string;
|
|
107
|
+
resource: string;
|
|
108
|
+
effect: "allow";
|
|
109
|
+
} | {
|
|
110
|
+
action: string;
|
|
111
|
+
resource: string;
|
|
112
|
+
effect: "ask";
|
|
113
|
+
})[];
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
}>>, Schema.toCodecJson<typeof AgentNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"agent.list", "GET", "/api/agent", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
117
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
118
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
119
|
+
}>>;
|
|
120
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
121
|
+
readonly location: Schema.Struct<{
|
|
122
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
123
|
+
}>;
|
|
124
|
+
readonly data: Schema.$Array<Schema.Struct<{
|
|
125
|
+
readonly id: Schema.brand<Schema.String, "Agent.ID">;
|
|
126
|
+
readonly name: Schema.brand<Schema.String, "Agent.Name">;
|
|
127
|
+
readonly model: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
128
|
+
readonly id: Schema.brand<Schema.String, "Model.ID">;
|
|
129
|
+
readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
|
|
130
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
131
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
132
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
133
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
134
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
135
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
136
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
137
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
138
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
139
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
140
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
141
|
+
};
|
|
142
|
+
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
|
|
143
|
+
}> & {
|
|
144
|
+
parse: (input: string) => {
|
|
145
|
+
readonly id: string & import("effect/Brand").Brand<"Model.ID">;
|
|
146
|
+
readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
147
|
+
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
148
|
+
};
|
|
149
|
+
}>>, Schema.optionalKey<Schema.Struct<{
|
|
150
|
+
readonly id: Schema.brand<Schema.String, "Model.ID">;
|
|
151
|
+
readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
|
|
152
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
153
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
154
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
155
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
156
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
157
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
158
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
159
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
160
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
161
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
162
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
163
|
+
};
|
|
164
|
+
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
|
|
165
|
+
}> & {
|
|
166
|
+
parse: (input: string) => {
|
|
167
|
+
readonly id: string & import("effect/Brand").Brand<"Model.ID">;
|
|
168
|
+
readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
169
|
+
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
170
|
+
};
|
|
171
|
+
}>, never, never>;
|
|
172
|
+
readonly request: Schema.Struct<{
|
|
173
|
+
readonly settings: Schema.withConstructorDefault<Schema.StructWithRest<Schema.Struct<{
|
|
174
|
+
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
175
|
+
readonly headerTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
176
|
+
readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
177
|
+
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
178
|
+
readonly type: Schema.Literal<"summary">;
|
|
179
|
+
}>, Schema.Struct<{
|
|
180
|
+
readonly type: Schema.Literal<"native">;
|
|
181
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
182
|
+
readonly type: Schema.Literal<"summary">;
|
|
183
|
+
}>, Schema.Struct<{
|
|
184
|
+
readonly type: Schema.Literal<"native">;
|
|
185
|
+
}>]>>, never, never>;
|
|
186
|
+
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
187
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
188
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>;
|
|
189
|
+
readonly headers: Schema.$Record<Schema.String, Schema.String>;
|
|
190
|
+
readonly body: Schema.$Record<Schema.String, Schema.Any>;
|
|
191
|
+
}>;
|
|
192
|
+
readonly system: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
193
|
+
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
194
|
+
readonly mode: Schema.Literals<readonly ["subagent", "primary", "all"]>;
|
|
195
|
+
readonly hidden: Schema.Boolean;
|
|
196
|
+
readonly color: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
197
|
+
readonly steps: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
198
|
+
readonly permissions: Schema.$Array<Schema.Struct<{
|
|
199
|
+
readonly action: Schema.String;
|
|
200
|
+
readonly resource: Schema.String;
|
|
201
|
+
readonly effect: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
202
|
+
}>>;
|
|
203
|
+
}> & {
|
|
204
|
+
default: (id: Agent.ID) => {
|
|
205
|
+
id: string & import("effect/Brand").Brand<"Agent.ID">;
|
|
206
|
+
name: string & import("effect/Brand").Brand<"Agent.Name">;
|
|
207
|
+
request: {
|
|
208
|
+
settings: {};
|
|
209
|
+
headers: {};
|
|
210
|
+
body: {};
|
|
211
|
+
};
|
|
212
|
+
mode: "primary";
|
|
213
|
+
hidden: false;
|
|
214
|
+
permissions: ({
|
|
215
|
+
action: string;
|
|
216
|
+
resource: string;
|
|
217
|
+
effect: "allow";
|
|
218
|
+
} | {
|
|
219
|
+
action: string;
|
|
220
|
+
resource: string;
|
|
221
|
+
effect: "ask";
|
|
222
|
+
})[];
|
|
223
|
+
};
|
|
224
|
+
}>;
|
|
225
|
+
}>>, never, never, never>, false>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Agent } from "@opencode/schema/agent";
|
|
2
|
+
import { Location } from "@opencode/schema/location";
|
|
3
|
+
import { Schema } from "effect";
|
|
4
|
+
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/http-api";
|
|
5
|
+
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
6
|
+
import { AgentNotFoundError } from "../errors.js";
|
|
7
|
+
export const AgentGroup = HttpApiGroup.make("server.agent")
|
|
8
|
+
.add(HttpApiEndpoint.get("agent.list", "/api/agent", {
|
|
9
|
+
query: LocationQuery,
|
|
10
|
+
success: Location.response(Schema.Array(Agent.Info)),
|
|
11
|
+
})
|
|
12
|
+
.annotateMerge(locationQueryOpenApi)
|
|
13
|
+
.annotateMerge(OpenApi.annotations({
|
|
14
|
+
identifier: "agent.list",
|
|
15
|
+
summary: "List agents",
|
|
16
|
+
description: "Retrieve currently registered agents.",
|
|
17
|
+
})))
|
|
18
|
+
.add(HttpApiEndpoint.get("agent.get", "/api/agent/:agentID", {
|
|
19
|
+
params: { agentID: Agent.ID },
|
|
20
|
+
query: LocationQuery,
|
|
21
|
+
success: Location.response(Agent.Info),
|
|
22
|
+
error: AgentNotFoundError,
|
|
23
|
+
})
|
|
24
|
+
.annotateMerge(locationQueryOpenApi)
|
|
25
|
+
.annotateMerge(OpenApi.annotations({
|
|
26
|
+
identifier: "agent.get",
|
|
27
|
+
summary: "Get agent",
|
|
28
|
+
description: "Retrieve a single currently registered agent.",
|
|
29
|
+
})))
|
|
30
|
+
.annotateMerge(OpenApi.annotations({ title: "agent" }));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
3
|
+
export declare const CommandGroup: HttpApiGroup.HttpApiGroup<"server.command", HttpApiEndpoint.HttpApiEndpoint<"command.list", "GET", "/api/command", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
4
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
5
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
6
|
+
}>>;
|
|
7
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
8
|
+
readonly location: Schema.Struct<{
|
|
9
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
10
|
+
}>;
|
|
11
|
+
readonly data: Schema.$Array<Schema.Struct<{
|
|
12
|
+
readonly name: Schema.String;
|
|
13
|
+
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
14
|
+
}>>;
|
|
15
|
+
}>>, never, never, never>, false>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Command } from "@opencode/schema/command";
|
|
2
|
+
import { Location } from "@opencode/schema/location";
|
|
3
|
+
import { Schema } from "effect";
|
|
4
|
+
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/http-api";
|
|
5
|
+
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
6
|
+
export const CommandGroup = HttpApiGroup.make("server.command")
|
|
7
|
+
.add(HttpApiEndpoint.get("command.list", "/api/command", {
|
|
8
|
+
query: LocationQuery,
|
|
9
|
+
success: Location.response(Schema.Array(Command.Info)),
|
|
10
|
+
})
|
|
11
|
+
.annotateMerge(locationQueryOpenApi)
|
|
12
|
+
.annotateMerge(OpenApi.annotations({
|
|
13
|
+
identifier: "command.list",
|
|
14
|
+
summary: "List commands",
|
|
15
|
+
description: "Retrieve currently registered commands.",
|
|
16
|
+
})))
|
|
17
|
+
.annotateMerge(OpenApi.annotations({
|
|
18
|
+
title: "command",
|
|
19
|
+
description: "Experimental command routes.",
|
|
20
|
+
}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Config } from "@opencode/schema/config";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/http-api";
|
|
4
|
+
export declare const ConfigGroup: HttpApiGroup.HttpApiGroup<"server.config", HttpApiEndpoint.HttpApiEndpoint<"config.get", "GET", "/api/config", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
5
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
6
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
7
|
+
}>>;
|
|
8
|
+
}>>, never, never, Schema.toCodecJson<Schema.$Array<Schema.Union<readonly [typeof Config.Document, typeof Config.Directory]>>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"config.shells", "GET", "/api/config/shell", never, never, never, never, Schema.toCodecJson<Schema.$Array<Schema.Struct<{
|
|
9
|
+
readonly path: Schema.String;
|
|
10
|
+
readonly name: Schema.String;
|
|
11
|
+
readonly acceptable: Schema.Boolean;
|
|
12
|
+
}>>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"config.update", "PATCH", "/api/experimental/config", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
13
|
+
readonly shell: Schema.NullOr<Schema.String>;
|
|
14
|
+
}>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never>, false>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Config } from "@opencode/schema/config";
|
|
2
|
+
import { ConfigShell } from "@opencode/schema/config/shell";
|
|
3
|
+
import { Schema } from "effect";
|
|
4
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
|
|
5
|
+
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
6
|
+
export const ConfigGroup = HttpApiGroup.make("server.config")
|
|
7
|
+
.add(HttpApiEndpoint.get("config.get", "/api/config", {
|
|
8
|
+
query: LocationQuery,
|
|
9
|
+
success: Schema.Array(Config.Entry),
|
|
10
|
+
})
|
|
11
|
+
.annotateMerge(locationQueryOpenApi)
|
|
12
|
+
.annotateMerge(OpenApi.annotations({
|
|
13
|
+
identifier: "config.get",
|
|
14
|
+
summary: "Get configuration",
|
|
15
|
+
description: "Return configuration documents and discovery sources for the requested location, from lowest to highest priority.",
|
|
16
|
+
})))
|
|
17
|
+
.add(HttpApiEndpoint.get("config.shells", "/api/config/shell", {
|
|
18
|
+
success: Schema.Array(ConfigShell.Option),
|
|
19
|
+
}).annotateMerge(OpenApi.annotations({
|
|
20
|
+
identifier: "config.shells",
|
|
21
|
+
summary: "List available shells",
|
|
22
|
+
description: "Return shells available to terminal and agent execution.",
|
|
23
|
+
})))
|
|
24
|
+
.add(HttpApiEndpoint.patch("config.update", "/api/experimental/config", {
|
|
25
|
+
payload: Config.Patch,
|
|
26
|
+
success: HttpApiSchema.NoContent,
|
|
27
|
+
}).annotateMerge(OpenApi.annotations({
|
|
28
|
+
identifier: "experimental.config.update",
|
|
29
|
+
summary: "Update global configuration",
|
|
30
|
+
description: "Patch supported fields in the highest-precedence global configuration document.",
|
|
31
|
+
})))
|
|
32
|
+
.annotateMerge(OpenApi.annotations({ title: "config", description: "Location-scoped configuration routes." }));
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/http-api";
|
|
3
|
+
import { ConflictError } from "../errors.js";
|
|
4
|
+
export declare const CredentialGroup: HttpApiGroup.HttpApiGroup<"server.credential", HttpApiEndpoint.HttpApiEndpoint<"credential.activate", "POST", "/api/credential/:credentialID/activate", Schema.toCodecStringTree<Schema.Struct<{
|
|
5
|
+
credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
|
|
6
|
+
create: () => string & import("effect/Brand").Brand<"Credential.ID">;
|
|
7
|
+
};
|
|
8
|
+
}>>, never, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"credential.create", "POST", "/api/credential", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
9
|
+
readonly id: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Credential.ID"> & {
|
|
10
|
+
create: () => string & import("effect/Brand").Brand<"Credential.ID">;
|
|
11
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Credential.ID"> & {
|
|
12
|
+
create: () => string & import("effect/Brand").Brand<"Credential.ID">;
|
|
13
|
+
}>, never, never>;
|
|
14
|
+
readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
|
|
15
|
+
readonly label: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
16
|
+
readonly value: Schema.Union<readonly [Schema.Struct<{
|
|
17
|
+
readonly type: Schema.Literal<"oauth">;
|
|
18
|
+
readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
|
|
19
|
+
readonly refresh: Schema.String;
|
|
20
|
+
readonly access: Schema.String;
|
|
21
|
+
readonly expires: Schema.Int;
|
|
22
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
23
|
+
}>, Schema.Struct<{
|
|
24
|
+
readonly type: Schema.Literal<"key">;
|
|
25
|
+
readonly key: Schema.String;
|
|
26
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
27
|
+
}>, Schema.Struct<{
|
|
28
|
+
readonly type: Schema.Literal<"external">;
|
|
29
|
+
readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
|
|
30
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
31
|
+
}>]>;
|
|
32
|
+
readonly activate: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
33
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
34
|
+
readonly data: Schema.Struct<{
|
|
35
|
+
readonly id: Schema.brand<Schema.String, "Credential.ID"> & {
|
|
36
|
+
create: () => string & import("effect/Brand").Brand<"Credential.ID">;
|
|
37
|
+
};
|
|
38
|
+
readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
|
|
39
|
+
readonly label: Schema.String;
|
|
40
|
+
readonly active: Schema.Boolean;
|
|
41
|
+
readonly value: Schema.Union<readonly [Schema.Struct<{
|
|
42
|
+
readonly type: Schema.Literal<"oauth">;
|
|
43
|
+
readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
|
|
44
|
+
readonly refresh: Schema.String;
|
|
45
|
+
readonly access: Schema.String;
|
|
46
|
+
readonly expires: Schema.Int;
|
|
47
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
48
|
+
}>, Schema.Struct<{
|
|
49
|
+
readonly type: Schema.Literal<"key">;
|
|
50
|
+
readonly key: Schema.String;
|
|
51
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
52
|
+
}>, Schema.Struct<{
|
|
53
|
+
readonly type: Schema.Literal<"external">;
|
|
54
|
+
readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
|
|
55
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
56
|
+
}>]>;
|
|
57
|
+
}>;
|
|
58
|
+
}>>, Schema.toCodecJson<typeof ConflictError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"credential.list", "GET", "/api/credential", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
59
|
+
readonly data: Schema.$Array<Schema.Struct<{
|
|
60
|
+
readonly id: Schema.brand<Schema.String, "Credential.ID"> & {
|
|
61
|
+
create: () => string & import("effect/Brand").Brand<"Credential.ID">;
|
|
62
|
+
};
|
|
63
|
+
readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
|
|
64
|
+
readonly label: Schema.String;
|
|
65
|
+
readonly active: Schema.Boolean;
|
|
66
|
+
readonly value: Schema.Union<readonly [Schema.Struct<{
|
|
67
|
+
readonly type: Schema.Literal<"oauth">;
|
|
68
|
+
readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
|
|
69
|
+
readonly refresh: Schema.String;
|
|
70
|
+
readonly access: Schema.String;
|
|
71
|
+
readonly expires: Schema.Int;
|
|
72
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
73
|
+
}>, Schema.Struct<{
|
|
74
|
+
readonly type: Schema.Literal<"key">;
|
|
75
|
+
readonly key: Schema.String;
|
|
76
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
77
|
+
}>, Schema.Struct<{
|
|
78
|
+
readonly type: Schema.Literal<"external">;
|
|
79
|
+
readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
|
|
80
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
81
|
+
}>]>;
|
|
82
|
+
}>>;
|
|
83
|
+
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"credential.remove", "DELETE", "/api/credential/:credentialID", Schema.toCodecStringTree<Schema.Struct<{
|
|
84
|
+
credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
|
|
85
|
+
create: () => string & import("effect/Brand").Brand<"Credential.ID">;
|
|
86
|
+
};
|
|
87
|
+
}>>, never, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"credential.update", "PATCH", "/api/credential/:credentialID", Schema.toCodecStringTree<Schema.Struct<{
|
|
88
|
+
credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
|
|
89
|
+
create: () => string & import("effect/Brand").Brand<"Credential.ID">;
|
|
90
|
+
};
|
|
91
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
92
|
+
readonly label: Schema.String;
|
|
93
|
+
}>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never>, false>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Credential } from "@opencode/schema/credential";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
|
|
4
|
+
import { ConflictError } from "../errors.js";
|
|
5
|
+
export const CredentialGroup = HttpApiGroup.make("server.credential")
|
|
6
|
+
.add(HttpApiEndpoint.get("credential.list", "/api/credential", {
|
|
7
|
+
success: Schema.Struct({ data: Schema.Array(Credential.Entry) }),
|
|
8
|
+
}).annotateMerge(OpenApi.annotations({
|
|
9
|
+
identifier: "credential.list",
|
|
10
|
+
summary: "List credentials",
|
|
11
|
+
description: "List every stored integration credential, including its secret value.",
|
|
12
|
+
})))
|
|
13
|
+
.add(HttpApiEndpoint.post("credential.create", "/api/credential", {
|
|
14
|
+
payload: Credential.CreateInput,
|
|
15
|
+
success: Schema.Struct({ data: Credential.Entry }),
|
|
16
|
+
error: ConflictError,
|
|
17
|
+
}).annotateMerge(OpenApi.annotations({
|
|
18
|
+
identifier: "credential.create",
|
|
19
|
+
summary: "Create credential",
|
|
20
|
+
description: "Store an integration credential. It becomes the integration's active credential unless activate is false and the integration already has one. Fails with a conflict when the requested ID already exists.",
|
|
21
|
+
})))
|
|
22
|
+
.add(HttpApiEndpoint.patch("credential.update", "/api/credential/:credentialID", {
|
|
23
|
+
params: { credentialID: Credential.ID },
|
|
24
|
+
payload: Schema.Struct({ label: Schema.String }),
|
|
25
|
+
success: HttpApiSchema.NoContent,
|
|
26
|
+
})
|
|
27
|
+
.annotateMerge(OpenApi.annotations({
|
|
28
|
+
identifier: "credential.update",
|
|
29
|
+
summary: "Update credential",
|
|
30
|
+
description: "Update a stored credential label.",
|
|
31
|
+
})))
|
|
32
|
+
.annotateMerge(OpenApi.annotations({ title: "credential" }))
|
|
33
|
+
.add(HttpApiEndpoint.post("credential.activate", "/api/credential/:credentialID/activate", {
|
|
34
|
+
params: { credentialID: Credential.ID },
|
|
35
|
+
success: HttpApiSchema.NoContent,
|
|
36
|
+
})
|
|
37
|
+
.annotateMerge(OpenApi.annotations({
|
|
38
|
+
identifier: "credential.activate",
|
|
39
|
+
summary: "Activate credential",
|
|
40
|
+
description: "Activate a stored integration credential.",
|
|
41
|
+
})))
|
|
42
|
+
.add(HttpApiEndpoint.delete("credential.remove", "/api/credential/:credentialID", {
|
|
43
|
+
params: { credentialID: Credential.ID },
|
|
44
|
+
success: HttpApiSchema.NoContent,
|
|
45
|
+
})
|
|
46
|
+
.annotateMerge(OpenApi.annotations({
|
|
47
|
+
identifier: "credential.remove",
|
|
48
|
+
summary: "Remove credential",
|
|
49
|
+
description: "Remove a stored integration credential.",
|
|
50
|
+
})));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/http-api";
|
|
3
|
+
import { InvalidRequestError, UnknownError } from "../errors.js";
|
|
4
|
+
export declare const DebugGroup: HttpApiGroup.HttpApiGroup<"server.debug", HttpApiEndpoint.HttpApiEndpoint<"debug.heapDump", "POST", "/api/debug/heap-dump", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
5
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
6
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
7
|
+
readonly path: Schema.String;
|
|
8
|
+
readonly pid: Schema.Int;
|
|
9
|
+
readonly memory: Schema.Struct<{
|
|
10
|
+
readonly rss: Schema.Number;
|
|
11
|
+
readonly heapTotal: Schema.Number;
|
|
12
|
+
readonly heapUsed: Schema.Number;
|
|
13
|
+
readonly external: Schema.Number;
|
|
14
|
+
readonly arrayBuffers: Schema.Number;
|
|
15
|
+
}>;
|
|
16
|
+
}>>, Schema.toCodecJson<typeof InvalidRequestError | typeof UnknownError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"debug.location", "GET", "/api/debug/location", never, never, never, never, Schema.toCodecJson<Schema.$Array<Schema.Struct<{
|
|
17
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
18
|
+
}>>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"debug.location.evict", "DELETE", "/api/debug/location", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
19
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
20
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
21
|
+
}>>;
|
|
22
|
+
}>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never>, false>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Location } from "@opencode/schema/location";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
|
|
4
|
+
import { InvalidRequestError, UnknownError } from "../errors.js";
|
|
5
|
+
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
6
|
+
export const DebugGroup = HttpApiGroup.make("server.debug")
|
|
7
|
+
.add(HttpApiEndpoint.post("debug.heapDump", "/api/debug/heap-dump", {
|
|
8
|
+
query: Schema.Struct({
|
|
9
|
+
directory: Schema.String.pipe(Schema.optional, Schema.annotate({
|
|
10
|
+
description: "Absolute server-local directory to write the snapshot into, created when missing. Defaults to the server's log directory.",
|
|
11
|
+
})),
|
|
12
|
+
}),
|
|
13
|
+
success: Schema.Struct({
|
|
14
|
+
path: Schema.String,
|
|
15
|
+
pid: Schema.Int,
|
|
16
|
+
memory: Schema.Struct({
|
|
17
|
+
rss: Schema.Number,
|
|
18
|
+
heapTotal: Schema.Number,
|
|
19
|
+
heapUsed: Schema.Number,
|
|
20
|
+
external: Schema.Number,
|
|
21
|
+
arrayBuffers: Schema.Number,
|
|
22
|
+
}).annotate({
|
|
23
|
+
description: "The server process's memory in bytes, read just before the snapshot (Node's process.memoryUsage()). rss covers native memory the snapshot cannot show.",
|
|
24
|
+
}),
|
|
25
|
+
}),
|
|
26
|
+
error: [InvalidRequestError, UnknownError],
|
|
27
|
+
}).annotateMerge(OpenApi.annotations({
|
|
28
|
+
identifier: "debug.heapDump",
|
|
29
|
+
summary: "Write a heap snapshot",
|
|
30
|
+
description: "Write a JavaScript heap snapshot of the server process into its log directory, or the requested directory, and return the server-local path once the file is complete. Pauses the server while the heap serializes and can temporarily increase its memory use. The snapshot can contain credentials, prompts, and file contents.",
|
|
31
|
+
})))
|
|
32
|
+
.add(HttpApiEndpoint.get("debug.location", "/api/debug/location", {
|
|
33
|
+
success: Schema.Array(Location.PublicRef),
|
|
34
|
+
}).annotateMerge(OpenApi.annotations({
|
|
35
|
+
identifier: "debug.location.list",
|
|
36
|
+
summary: "List loaded locations",
|
|
37
|
+
description: "List locations currently loaded by the server.",
|
|
38
|
+
})))
|
|
39
|
+
.add(HttpApiEndpoint.delete("debug.location.evict", "/api/debug/location", {
|
|
40
|
+
query: LocationQuery,
|
|
41
|
+
success: HttpApiSchema.NoContent,
|
|
42
|
+
})
|
|
43
|
+
.annotateMerge(locationQueryOpenApi)
|
|
44
|
+
.annotateMerge(OpenApi.annotations({
|
|
45
|
+
identifier: "debug.location.evict",
|
|
46
|
+
summary: "Evict a loaded location",
|
|
47
|
+
description: "Dispose the requested location's cached services so its next use boots them fresh.",
|
|
48
|
+
})))
|
|
49
|
+
.annotateMerge(OpenApi.annotations({ title: "debug" }));
|