@kvman/sdk 0.1.0
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/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/ctx.d.ts +142 -0
- package/dist/ctx.d.ts.map +1 -0
- package/dist/ctx.js +2 -0
- package/dist/ctx.js.map +1 -0
- package/dist/envelope.d.ts +285 -0
- package/dist/envelope.d.ts.map +1 -0
- package/dist/envelope.js +25 -0
- package/dist/envelope.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/json.d.ts +14 -0
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +4 -0
- package/dist/json.js.map +1 -0
- package/dist/kernel-api.d.ts +550 -0
- package/dist/kernel-api.d.ts.map +1 -0
- package/dist/kernel-api.js +110 -0
- package/dist/kernel-api.js.map +1 -0
- package/dist/manifest.d.ts +34 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +25 -0
- package/dist/manifest.js.map +1 -0
- package/dist/preset.d.ts +38 -0
- package/dist/preset.d.ts.map +1 -0
- package/dist/preset.js +26 -0
- package/dist/preset.js.map +1 -0
- package/dist/problem.d.ts +63 -0
- package/dist/problem.d.ts.map +1 -0
- package/dist/problem.js +45 -0
- package/dist/problem.js.map +1 -0
- package/dist/registrations.d.ts +92 -0
- package/dist/registrations.d.ts.map +1 -0
- package/dist/registrations.js +2 -0
- package/dist/registrations.js.map +1 -0
- package/dist/registry.d.ts +24 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +2 -0
- package/dist/registry.js.map +1 -0
- package/dist/rows.d.ts +113 -0
- package/dist/rows.d.ts.map +1 -0
- package/dist/rows.js +53 -0
- package/dist/rows.js.map +1 -0
- package/dist/store.d.ts +90 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +2 -0
- package/dist/store.js.map +1 -0
- package/dist/web.d.ts +158 -0
- package/dist/web.d.ts.map +1 -0
- package/dist/web.js +2 -0
- package/dist/web.js.map +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Accepts a JSON Schema, as the kernel lists schemas for forms (plan 02 §2.12). */
|
|
3
|
+
export declare const jsonSchemaDocumentSchema: z.ZodRecord<z.ZodString, z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>;
|
|
4
|
+
/** Accepts a command or query as `kernel.extensions.list` describes it. */
|
|
5
|
+
export declare const registrationInfoSchema: z.ZodObject<{
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
description: z.ZodString;
|
|
8
|
+
public: z.ZodBoolean;
|
|
9
|
+
input: z.ZodRecord<z.ZodString, z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>;
|
|
10
|
+
output: z.ZodRecord<z.ZodString, z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
/** Accepts a command or query as `kernel.registrations.list` lists it: with its owner, and without its schemas. */
|
|
13
|
+
export declare const registrationRowSchema: z.ZodObject<{
|
|
14
|
+
name: z.ZodString;
|
|
15
|
+
kind: z.ZodEnum<{
|
|
16
|
+
command: "command";
|
|
17
|
+
query: "query";
|
|
18
|
+
}>;
|
|
19
|
+
extension: z.ZodString;
|
|
20
|
+
public: z.ZodBoolean;
|
|
21
|
+
description: z.ZodString;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
/** Accepts an extension as `kernel.extensions.list` describes it. */
|
|
24
|
+
export declare const extensionInfoSchema: z.ZodObject<{
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
version: z.ZodString;
|
|
27
|
+
source: z.ZodUnion<readonly [z.ZodLiteral<"bundled">, z.ZodTemplateLiteral<`npm:${string}`>, z.ZodTemplateLiteral<`path:${string}`>]>;
|
|
28
|
+
revision: z.ZodNumber;
|
|
29
|
+
namespace: z.ZodString;
|
|
30
|
+
commands: z.ZodArray<z.ZodObject<{
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
description: z.ZodString;
|
|
33
|
+
public: z.ZodBoolean;
|
|
34
|
+
input: z.ZodRecord<z.ZodString, z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>;
|
|
35
|
+
output: z.ZodRecord<z.ZodString, z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>;
|
|
36
|
+
}, z.core.$strict>>;
|
|
37
|
+
queries: z.ZodArray<z.ZodObject<{
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
description: z.ZodString;
|
|
40
|
+
public: z.ZodBoolean;
|
|
41
|
+
input: z.ZodRecord<z.ZodString, z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>;
|
|
42
|
+
output: z.ZodRecord<z.ZodString, z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>;
|
|
43
|
+
}, z.core.$strict>>;
|
|
44
|
+
settings: z.ZodArray<z.ZodObject<{
|
|
45
|
+
key: z.ZodString;
|
|
46
|
+
description: z.ZodString;
|
|
47
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
48
|
+
global: "global";
|
|
49
|
+
workspace: "workspace";
|
|
50
|
+
}>>;
|
|
51
|
+
}, z.core.$strict>>;
|
|
52
|
+
handlers: z.ZodArray<z.ZodObject<{
|
|
53
|
+
point: z.ZodString;
|
|
54
|
+
description: z.ZodString;
|
|
55
|
+
}, z.core.$strict>>;
|
|
56
|
+
}, z.core.$strict>;
|
|
57
|
+
/** Accepts a setting as `kernel.settings.list` describes it: its JSON Schema, its scopes, and where its value comes from. */
|
|
58
|
+
export declare const settingInfoSchema: z.ZodObject<{
|
|
59
|
+
key: z.ZodString;
|
|
60
|
+
description: z.ZodString;
|
|
61
|
+
schema: z.ZodRecord<z.ZodString, z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>;
|
|
62
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
63
|
+
global: "global";
|
|
64
|
+
workspace: "workspace";
|
|
65
|
+
}>>;
|
|
66
|
+
value: z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>;
|
|
67
|
+
source: z.ZodEnum<{
|
|
68
|
+
default: "default";
|
|
69
|
+
global: "global";
|
|
70
|
+
workspace: "workspace";
|
|
71
|
+
preset: "preset";
|
|
72
|
+
}>;
|
|
73
|
+
}, z.core.$strict>;
|
|
74
|
+
/** Accepts a running long-lived process as `kernel.processes.list` describes it. */
|
|
75
|
+
export declare const processRowSchema: z.ZodObject<{
|
|
76
|
+
extension: z.ZodString;
|
|
77
|
+
workspaceId: z.ZodString;
|
|
78
|
+
name: z.ZodString;
|
|
79
|
+
pid: z.ZodNumber;
|
|
80
|
+
startedAt: z.ZodISODateTime;
|
|
81
|
+
}, z.core.$strict>;
|
|
82
|
+
/** Accepts the sub-folders of a folder as `kernel.folder.list` answers (plan 02 §2.12). */
|
|
83
|
+
export declare const folderListSchema: z.ZodObject<{
|
|
84
|
+
path: z.ZodString;
|
|
85
|
+
parent: z.ZodNullable<z.ZodString>;
|
|
86
|
+
folders: z.ZodArray<z.ZodObject<{
|
|
87
|
+
name: z.ZodString;
|
|
88
|
+
path: z.ZodString;
|
|
89
|
+
}, z.core.$strict>>;
|
|
90
|
+
truncated: z.ZodBoolean;
|
|
91
|
+
}, z.core.$strict>;
|
|
92
|
+
/** Accepts the answer of `kernel.health.get`; `rolledBack` is the Problem of the start that was undone before this one (ADR 0024, 5). */
|
|
93
|
+
export declare const healthSchema: z.ZodObject<{
|
|
94
|
+
version: z.ZodString;
|
|
95
|
+
preset: z.ZodString;
|
|
96
|
+
mode: z.ZodLiteral<"web">;
|
|
97
|
+
workers: z.ZodNumber;
|
|
98
|
+
uptimeMs: z.ZodNumber;
|
|
99
|
+
languages: z.ZodArray<z.ZodString>;
|
|
100
|
+
rolledBack: z.ZodExactOptional<z.ZodObject<{
|
|
101
|
+
code: z.ZodUnion<readonly [z.ZodEnum<{
|
|
102
|
+
VALIDATION_FAILED: "VALIDATION_FAILED";
|
|
103
|
+
NOT_FOUND: "NOT_FOUND";
|
|
104
|
+
NOT_PUBLIC: "NOT_PUBLIC";
|
|
105
|
+
NOT_A_COMMAND: "NOT_A_COMMAND";
|
|
106
|
+
READ_ONLY: "READ_ONLY";
|
|
107
|
+
NO_JOB: "NO_JOB";
|
|
108
|
+
TOO_LARGE: "TOO_LARGE";
|
|
109
|
+
TOO_DEEP: "TOO_DEEP";
|
|
110
|
+
TIMEOUT: "TIMEOUT";
|
|
111
|
+
CANCELLED: "CANCELLED";
|
|
112
|
+
WORKER_CRASHED: "WORKER_CRASHED";
|
|
113
|
+
INTERRUPTED: "INTERRUPTED";
|
|
114
|
+
HANDLER_FAILED: "HANDLER_FAILED";
|
|
115
|
+
FORBIDDEN_ORIGIN: "FORBIDDEN_ORIGIN";
|
|
116
|
+
PROCESS_RUNNING: "PROCESS_RUNNING";
|
|
117
|
+
PORT_IN_USE: "PORT_IN_USE";
|
|
118
|
+
EXTENSION_INVALID: "EXTENSION_INVALID";
|
|
119
|
+
KVMAN_RUNNING: "KVMAN_RUNNING";
|
|
120
|
+
}>, z.ZodString]>;
|
|
121
|
+
message: z.ZodString;
|
|
122
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>>;
|
|
123
|
+
}, z.core.$strict>>;
|
|
124
|
+
}, z.core.$strict>;
|
|
125
|
+
/** The input and output schemas of the kernel's own commands (plan 02 §2.12). */
|
|
126
|
+
export declare const kernelCommandSchemas: {
|
|
127
|
+
readonly 'kernel.workspace.open': {
|
|
128
|
+
readonly input: z.ZodObject<{
|
|
129
|
+
path: z.ZodString;
|
|
130
|
+
}, z.core.$strict>;
|
|
131
|
+
readonly output: z.ZodObject<{
|
|
132
|
+
id: z.ZodString;
|
|
133
|
+
name: z.ZodString;
|
|
134
|
+
path: z.ZodString;
|
|
135
|
+
}, z.core.$strict>;
|
|
136
|
+
};
|
|
137
|
+
readonly 'kernel.workspace.close': {
|
|
138
|
+
readonly input: z.ZodObject<{
|
|
139
|
+
workspaceId: z.ZodString;
|
|
140
|
+
}, z.core.$strict>;
|
|
141
|
+
readonly output: z.ZodObject<{}, z.core.$strict>;
|
|
142
|
+
};
|
|
143
|
+
readonly 'kernel.folder.create': {
|
|
144
|
+
readonly input: z.ZodObject<{
|
|
145
|
+
path: z.ZodString;
|
|
146
|
+
name: z.ZodString;
|
|
147
|
+
}, z.core.$strict>;
|
|
148
|
+
readonly output: z.ZodObject<{
|
|
149
|
+
path: z.ZodString;
|
|
150
|
+
}, z.core.$strict>;
|
|
151
|
+
};
|
|
152
|
+
readonly 'kernel.settings.set': {
|
|
153
|
+
readonly input: z.ZodObject<{
|
|
154
|
+
key: z.ZodString;
|
|
155
|
+
value: z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>;
|
|
156
|
+
scope: z.ZodEnum<{
|
|
157
|
+
global: "global";
|
|
158
|
+
workspace: "workspace";
|
|
159
|
+
}>;
|
|
160
|
+
}, z.core.$strict>;
|
|
161
|
+
readonly output: z.ZodObject<{}, z.core.$strict>;
|
|
162
|
+
};
|
|
163
|
+
readonly 'kernel.settings.reset': {
|
|
164
|
+
readonly input: z.ZodObject<{
|
|
165
|
+
key: z.ZodString;
|
|
166
|
+
scope: z.ZodEnum<{
|
|
167
|
+
global: "global";
|
|
168
|
+
workspace: "workspace";
|
|
169
|
+
}>;
|
|
170
|
+
}, z.core.$strict>;
|
|
171
|
+
readonly output: z.ZodObject<{}, z.core.$strict>;
|
|
172
|
+
};
|
|
173
|
+
readonly 'kernel.secrets.set': {
|
|
174
|
+
readonly input: z.ZodObject<{
|
|
175
|
+
extension: z.ZodString;
|
|
176
|
+
name: z.ZodString;
|
|
177
|
+
value: z.ZodString;
|
|
178
|
+
}, z.core.$strict>;
|
|
179
|
+
readonly output: z.ZodObject<{}, z.core.$strict>;
|
|
180
|
+
};
|
|
181
|
+
readonly 'kernel.secrets.delete': {
|
|
182
|
+
readonly input: z.ZodObject<{
|
|
183
|
+
extension: z.ZodString;
|
|
184
|
+
name: z.ZodString;
|
|
185
|
+
}, z.core.$strict>;
|
|
186
|
+
readonly output: z.ZodObject<{}, z.core.$strict>;
|
|
187
|
+
};
|
|
188
|
+
readonly 'kernel.files.unlink': {
|
|
189
|
+
readonly input: z.ZodObject<{
|
|
190
|
+
id: z.ZodString;
|
|
191
|
+
}, z.core.$strict>;
|
|
192
|
+
readonly output: z.ZodObject<{}, z.core.$strict>;
|
|
193
|
+
};
|
|
194
|
+
readonly 'kernel.extensions.install': {
|
|
195
|
+
readonly input: z.ZodObject<{
|
|
196
|
+
source: z.ZodUnion<readonly [z.ZodTemplateLiteral<`bundled:${string}`>, z.ZodTemplateLiteral<`npm:${string}@${string}`>, z.ZodTemplateLiteral<`path:${string}`>]>;
|
|
197
|
+
}, z.core.$strict>;
|
|
198
|
+
readonly output: z.ZodObject<{
|
|
199
|
+
file: z.ZodString;
|
|
200
|
+
restartRequired: z.ZodLiteral<true>;
|
|
201
|
+
}, z.core.$strict>;
|
|
202
|
+
};
|
|
203
|
+
readonly 'kernel.extensions.uninstall': {
|
|
204
|
+
readonly input: z.ZodObject<{
|
|
205
|
+
name: z.ZodString;
|
|
206
|
+
}, z.core.$strict>;
|
|
207
|
+
readonly output: z.ZodObject<{
|
|
208
|
+
file: z.ZodString;
|
|
209
|
+
restartRequired: z.ZodLiteral<true>;
|
|
210
|
+
}, z.core.$strict>;
|
|
211
|
+
};
|
|
212
|
+
readonly 'kernel.restart': {
|
|
213
|
+
readonly input: z.ZodObject<{}, z.core.$strict>;
|
|
214
|
+
readonly output: z.ZodObject<{
|
|
215
|
+
restarting: z.ZodLiteral<true>;
|
|
216
|
+
}, z.core.$strict>;
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
/** The input and output schemas of the kernel's own queries (plan 02 §2.12). */
|
|
220
|
+
export declare const kernelQuerySchemas: {
|
|
221
|
+
readonly 'kernel.workspace.list': {
|
|
222
|
+
readonly input: z.ZodObject<{}, z.core.$strict>;
|
|
223
|
+
readonly output: z.ZodArray<z.ZodObject<{
|
|
224
|
+
id: z.ZodString;
|
|
225
|
+
name: z.ZodString;
|
|
226
|
+
path: z.ZodString;
|
|
227
|
+
}, z.core.$strict>>;
|
|
228
|
+
};
|
|
229
|
+
readonly 'kernel.folder.list': {
|
|
230
|
+
readonly input: z.ZodObject<{
|
|
231
|
+
path: z.ZodExactOptional<z.ZodString>;
|
|
232
|
+
hidden: z.ZodExactOptional<z.ZodBoolean>;
|
|
233
|
+
}, z.core.$strict>;
|
|
234
|
+
readonly output: z.ZodObject<{
|
|
235
|
+
path: z.ZodString;
|
|
236
|
+
parent: z.ZodNullable<z.ZodString>;
|
|
237
|
+
folders: z.ZodArray<z.ZodObject<{
|
|
238
|
+
name: z.ZodString;
|
|
239
|
+
path: z.ZodString;
|
|
240
|
+
}, z.core.$strict>>;
|
|
241
|
+
truncated: z.ZodBoolean;
|
|
242
|
+
}, z.core.$strict>;
|
|
243
|
+
};
|
|
244
|
+
readonly 'kernel.settings.list': {
|
|
245
|
+
readonly input: z.ZodObject<{}, z.core.$strict>;
|
|
246
|
+
readonly output: z.ZodArray<z.ZodObject<{
|
|
247
|
+
key: z.ZodString;
|
|
248
|
+
description: z.ZodString;
|
|
249
|
+
schema: z.ZodRecord<z.ZodString, z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>;
|
|
250
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
251
|
+
global: "global";
|
|
252
|
+
workspace: "workspace";
|
|
253
|
+
}>>;
|
|
254
|
+
value: z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>;
|
|
255
|
+
source: z.ZodEnum<{
|
|
256
|
+
default: "default";
|
|
257
|
+
global: "global";
|
|
258
|
+
workspace: "workspace";
|
|
259
|
+
preset: "preset";
|
|
260
|
+
}>;
|
|
261
|
+
}, z.core.$strict>>;
|
|
262
|
+
};
|
|
263
|
+
readonly 'kernel.secrets.list': {
|
|
264
|
+
readonly input: z.ZodObject<{}, z.core.$strict>;
|
|
265
|
+
readonly output: z.ZodArray<z.ZodObject<{
|
|
266
|
+
extension: z.ZodString;
|
|
267
|
+
name: z.ZodString;
|
|
268
|
+
}, z.core.$strict>>;
|
|
269
|
+
};
|
|
270
|
+
readonly 'kernel.jobs.get': {
|
|
271
|
+
readonly input: z.ZodObject<{
|
|
272
|
+
id: z.ZodString;
|
|
273
|
+
}, z.core.$strict>;
|
|
274
|
+
readonly output: z.ZodObject<{
|
|
275
|
+
id: z.ZodUUID;
|
|
276
|
+
name: z.ZodString;
|
|
277
|
+
input: z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>;
|
|
278
|
+
workspaceId: z.ZodString;
|
|
279
|
+
caller: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
280
|
+
kind: z.ZodLiteral<"user">;
|
|
281
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
282
|
+
kind: z.ZodLiteral<"extension">;
|
|
283
|
+
name: z.ZodString;
|
|
284
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
285
|
+
kind: z.ZodLiteral<"kernel">;
|
|
286
|
+
}, z.core.$strict>], "kind">;
|
|
287
|
+
status: z.ZodEnum<{
|
|
288
|
+
queued: "queued";
|
|
289
|
+
running: "running";
|
|
290
|
+
succeeded: "succeeded";
|
|
291
|
+
failed: "failed";
|
|
292
|
+
cancelled: "cancelled";
|
|
293
|
+
}>;
|
|
294
|
+
attempts: z.ZodNumber;
|
|
295
|
+
retries: z.ZodNumber;
|
|
296
|
+
output: z.ZodOptional<z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>;
|
|
297
|
+
problem: z.ZodOptional<z.ZodObject<{
|
|
298
|
+
code: z.ZodUnion<readonly [z.ZodEnum<{
|
|
299
|
+
VALIDATION_FAILED: "VALIDATION_FAILED";
|
|
300
|
+
NOT_FOUND: "NOT_FOUND";
|
|
301
|
+
NOT_PUBLIC: "NOT_PUBLIC";
|
|
302
|
+
NOT_A_COMMAND: "NOT_A_COMMAND";
|
|
303
|
+
READ_ONLY: "READ_ONLY";
|
|
304
|
+
NO_JOB: "NO_JOB";
|
|
305
|
+
TOO_LARGE: "TOO_LARGE";
|
|
306
|
+
TOO_DEEP: "TOO_DEEP";
|
|
307
|
+
TIMEOUT: "TIMEOUT";
|
|
308
|
+
CANCELLED: "CANCELLED";
|
|
309
|
+
WORKER_CRASHED: "WORKER_CRASHED";
|
|
310
|
+
INTERRUPTED: "INTERRUPTED";
|
|
311
|
+
HANDLER_FAILED: "HANDLER_FAILED";
|
|
312
|
+
FORBIDDEN_ORIGIN: "FORBIDDEN_ORIGIN";
|
|
313
|
+
PROCESS_RUNNING: "PROCESS_RUNNING";
|
|
314
|
+
PORT_IN_USE: "PORT_IN_USE";
|
|
315
|
+
EXTENSION_INVALID: "EXTENSION_INVALID";
|
|
316
|
+
KVMAN_RUNNING: "KVMAN_RUNNING";
|
|
317
|
+
}>, z.ZodString]>;
|
|
318
|
+
message: z.ZodString;
|
|
319
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>>;
|
|
320
|
+
}, z.core.$strict>>;
|
|
321
|
+
createdAt: z.ZodISODateTime;
|
|
322
|
+
startedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
323
|
+
endedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
324
|
+
}, z.core.$strict>;
|
|
325
|
+
};
|
|
326
|
+
readonly 'kernel.jobs.list': {
|
|
327
|
+
readonly input: z.ZodObject<{
|
|
328
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
329
|
+
queued: "queued";
|
|
330
|
+
running: "running";
|
|
331
|
+
succeeded: "succeeded";
|
|
332
|
+
failed: "failed";
|
|
333
|
+
cancelled: "cancelled";
|
|
334
|
+
}>>;
|
|
335
|
+
limit: z.ZodNumber;
|
|
336
|
+
}, z.core.$strict>;
|
|
337
|
+
readonly output: z.ZodArray<z.ZodObject<{
|
|
338
|
+
id: z.ZodUUID;
|
|
339
|
+
name: z.ZodString;
|
|
340
|
+
input: z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>;
|
|
341
|
+
workspaceId: z.ZodString;
|
|
342
|
+
caller: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
343
|
+
kind: z.ZodLiteral<"user">;
|
|
344
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
345
|
+
kind: z.ZodLiteral<"extension">;
|
|
346
|
+
name: z.ZodString;
|
|
347
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
348
|
+
kind: z.ZodLiteral<"kernel">;
|
|
349
|
+
}, z.core.$strict>], "kind">;
|
|
350
|
+
status: z.ZodEnum<{
|
|
351
|
+
queued: "queued";
|
|
352
|
+
running: "running";
|
|
353
|
+
succeeded: "succeeded";
|
|
354
|
+
failed: "failed";
|
|
355
|
+
cancelled: "cancelled";
|
|
356
|
+
}>;
|
|
357
|
+
attempts: z.ZodNumber;
|
|
358
|
+
retries: z.ZodNumber;
|
|
359
|
+
output: z.ZodOptional<z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>;
|
|
360
|
+
problem: z.ZodOptional<z.ZodObject<{
|
|
361
|
+
code: z.ZodUnion<readonly [z.ZodEnum<{
|
|
362
|
+
VALIDATION_FAILED: "VALIDATION_FAILED";
|
|
363
|
+
NOT_FOUND: "NOT_FOUND";
|
|
364
|
+
NOT_PUBLIC: "NOT_PUBLIC";
|
|
365
|
+
NOT_A_COMMAND: "NOT_A_COMMAND";
|
|
366
|
+
READ_ONLY: "READ_ONLY";
|
|
367
|
+
NO_JOB: "NO_JOB";
|
|
368
|
+
TOO_LARGE: "TOO_LARGE";
|
|
369
|
+
TOO_DEEP: "TOO_DEEP";
|
|
370
|
+
TIMEOUT: "TIMEOUT";
|
|
371
|
+
CANCELLED: "CANCELLED";
|
|
372
|
+
WORKER_CRASHED: "WORKER_CRASHED";
|
|
373
|
+
INTERRUPTED: "INTERRUPTED";
|
|
374
|
+
HANDLER_FAILED: "HANDLER_FAILED";
|
|
375
|
+
FORBIDDEN_ORIGIN: "FORBIDDEN_ORIGIN";
|
|
376
|
+
PROCESS_RUNNING: "PROCESS_RUNNING";
|
|
377
|
+
PORT_IN_USE: "PORT_IN_USE";
|
|
378
|
+
EXTENSION_INVALID: "EXTENSION_INVALID";
|
|
379
|
+
KVMAN_RUNNING: "KVMAN_RUNNING";
|
|
380
|
+
}>, z.ZodString]>;
|
|
381
|
+
message: z.ZodString;
|
|
382
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>>;
|
|
383
|
+
}, z.core.$strict>>;
|
|
384
|
+
createdAt: z.ZodISODateTime;
|
|
385
|
+
startedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
386
|
+
endedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
387
|
+
}, z.core.$strict>>;
|
|
388
|
+
};
|
|
389
|
+
readonly 'kernel.files.get': {
|
|
390
|
+
readonly input: z.ZodObject<{
|
|
391
|
+
id: z.ZodString;
|
|
392
|
+
}, z.core.$strict>;
|
|
393
|
+
readonly output: z.ZodObject<{
|
|
394
|
+
id: z.ZodUUID;
|
|
395
|
+
name: z.ZodString;
|
|
396
|
+
type: z.ZodString;
|
|
397
|
+
size: z.ZodNumber;
|
|
398
|
+
owner: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
399
|
+
kind: z.ZodLiteral<"user">;
|
|
400
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
401
|
+
kind: z.ZodLiteral<"extension">;
|
|
402
|
+
name: z.ZodString;
|
|
403
|
+
}, z.core.$strict>], "kind">;
|
|
404
|
+
workspaceId: z.ZodString;
|
|
405
|
+
createdAt: z.ZodISODateTime;
|
|
406
|
+
}, z.core.$strict>;
|
|
407
|
+
};
|
|
408
|
+
readonly 'kernel.files.list': {
|
|
409
|
+
readonly input: z.ZodObject<{
|
|
410
|
+
limit: z.ZodNumber;
|
|
411
|
+
}, z.core.$strict>;
|
|
412
|
+
readonly output: z.ZodArray<z.ZodObject<{
|
|
413
|
+
id: z.ZodUUID;
|
|
414
|
+
name: z.ZodString;
|
|
415
|
+
type: z.ZodString;
|
|
416
|
+
size: z.ZodNumber;
|
|
417
|
+
owner: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
418
|
+
kind: z.ZodLiteral<"user">;
|
|
419
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
420
|
+
kind: z.ZodLiteral<"extension">;
|
|
421
|
+
name: z.ZodString;
|
|
422
|
+
}, z.core.$strict>], "kind">;
|
|
423
|
+
workspaceId: z.ZodString;
|
|
424
|
+
createdAt: z.ZodISODateTime;
|
|
425
|
+
}, z.core.$strict>>;
|
|
426
|
+
};
|
|
427
|
+
readonly 'kernel.extensions.list': {
|
|
428
|
+
readonly input: z.ZodObject<{}, z.core.$strict>;
|
|
429
|
+
readonly output: z.ZodArray<z.ZodObject<{
|
|
430
|
+
name: z.ZodString;
|
|
431
|
+
version: z.ZodString;
|
|
432
|
+
source: z.ZodUnion<readonly [z.ZodLiteral<"bundled">, z.ZodTemplateLiteral<`npm:${string}`>, z.ZodTemplateLiteral<`path:${string}`>]>;
|
|
433
|
+
revision: z.ZodNumber;
|
|
434
|
+
namespace: z.ZodString;
|
|
435
|
+
commands: z.ZodArray<z.ZodObject<{
|
|
436
|
+
name: z.ZodString;
|
|
437
|
+
description: z.ZodString;
|
|
438
|
+
public: z.ZodBoolean;
|
|
439
|
+
input: z.ZodRecord<z.ZodString, z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>;
|
|
440
|
+
output: z.ZodRecord<z.ZodString, z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>;
|
|
441
|
+
}, z.core.$strict>>;
|
|
442
|
+
queries: z.ZodArray<z.ZodObject<{
|
|
443
|
+
name: z.ZodString;
|
|
444
|
+
description: z.ZodString;
|
|
445
|
+
public: z.ZodBoolean;
|
|
446
|
+
input: z.ZodRecord<z.ZodString, z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>;
|
|
447
|
+
output: z.ZodRecord<z.ZodString, z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>;
|
|
448
|
+
}, z.core.$strict>>;
|
|
449
|
+
settings: z.ZodArray<z.ZodObject<{
|
|
450
|
+
key: z.ZodString;
|
|
451
|
+
description: z.ZodString;
|
|
452
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
453
|
+
global: "global";
|
|
454
|
+
workspace: "workspace";
|
|
455
|
+
}>>;
|
|
456
|
+
}, z.core.$strict>>;
|
|
457
|
+
handlers: z.ZodArray<z.ZodObject<{
|
|
458
|
+
point: z.ZodString;
|
|
459
|
+
description: z.ZodString;
|
|
460
|
+
}, z.core.$strict>>;
|
|
461
|
+
}, z.core.$strict>>;
|
|
462
|
+
};
|
|
463
|
+
readonly 'kernel.registrations.list': {
|
|
464
|
+
readonly input: z.ZodObject<{}, z.core.$strict>;
|
|
465
|
+
readonly output: z.ZodArray<z.ZodObject<{
|
|
466
|
+
name: z.ZodString;
|
|
467
|
+
kind: z.ZodEnum<{
|
|
468
|
+
command: "command";
|
|
469
|
+
query: "query";
|
|
470
|
+
}>;
|
|
471
|
+
extension: z.ZodString;
|
|
472
|
+
public: z.ZodBoolean;
|
|
473
|
+
description: z.ZodString;
|
|
474
|
+
}, z.core.$strict>>;
|
|
475
|
+
};
|
|
476
|
+
readonly 'kernel.preset.get': {
|
|
477
|
+
readonly input: z.ZodObject<{}, z.core.$strict>;
|
|
478
|
+
readonly output: z.ZodObject<{
|
|
479
|
+
name: z.ZodString;
|
|
480
|
+
extensions: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<"bundled">, z.ZodTemplateLiteral<`npm:${string}`>, z.ZodTemplateLiteral<`path:${string}`>]>>;
|
|
481
|
+
settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>>;
|
|
482
|
+
origin: z.ZodEnum<{
|
|
483
|
+
file: "file";
|
|
484
|
+
bundled: "bundled";
|
|
485
|
+
home: "home";
|
|
486
|
+
}>;
|
|
487
|
+
file: z.ZodExactOptional<z.ZodString>;
|
|
488
|
+
}, z.core.$strict>;
|
|
489
|
+
};
|
|
490
|
+
readonly 'kernel.processes.list': {
|
|
491
|
+
readonly input: z.ZodObject<{}, z.core.$strict>;
|
|
492
|
+
readonly output: z.ZodArray<z.ZodObject<{
|
|
493
|
+
extension: z.ZodString;
|
|
494
|
+
workspaceId: z.ZodString;
|
|
495
|
+
name: z.ZodString;
|
|
496
|
+
pid: z.ZodNumber;
|
|
497
|
+
startedAt: z.ZodISODateTime;
|
|
498
|
+
}, z.core.$strict>>;
|
|
499
|
+
};
|
|
500
|
+
readonly 'kernel.health.get': {
|
|
501
|
+
readonly input: z.ZodObject<{}, z.core.$strict>;
|
|
502
|
+
readonly output: z.ZodObject<{
|
|
503
|
+
version: z.ZodString;
|
|
504
|
+
preset: z.ZodString;
|
|
505
|
+
mode: z.ZodLiteral<"web">;
|
|
506
|
+
workers: z.ZodNumber;
|
|
507
|
+
uptimeMs: z.ZodNumber;
|
|
508
|
+
languages: z.ZodArray<z.ZodString>;
|
|
509
|
+
rolledBack: z.ZodExactOptional<z.ZodObject<{
|
|
510
|
+
code: z.ZodUnion<readonly [z.ZodEnum<{
|
|
511
|
+
VALIDATION_FAILED: "VALIDATION_FAILED";
|
|
512
|
+
NOT_FOUND: "NOT_FOUND";
|
|
513
|
+
NOT_PUBLIC: "NOT_PUBLIC";
|
|
514
|
+
NOT_A_COMMAND: "NOT_A_COMMAND";
|
|
515
|
+
READ_ONLY: "READ_ONLY";
|
|
516
|
+
NO_JOB: "NO_JOB";
|
|
517
|
+
TOO_LARGE: "TOO_LARGE";
|
|
518
|
+
TOO_DEEP: "TOO_DEEP";
|
|
519
|
+
TIMEOUT: "TIMEOUT";
|
|
520
|
+
CANCELLED: "CANCELLED";
|
|
521
|
+
WORKER_CRASHED: "WORKER_CRASHED";
|
|
522
|
+
INTERRUPTED: "INTERRUPTED";
|
|
523
|
+
HANDLER_FAILED: "HANDLER_FAILED";
|
|
524
|
+
FORBIDDEN_ORIGIN: "FORBIDDEN_ORIGIN";
|
|
525
|
+
PROCESS_RUNNING: "PROCESS_RUNNING";
|
|
526
|
+
PORT_IN_USE: "PORT_IN_USE";
|
|
527
|
+
EXTENSION_INVALID: "EXTENSION_INVALID";
|
|
528
|
+
KVMAN_RUNNING: "KVMAN_RUNNING";
|
|
529
|
+
}>, z.ZodString]>;
|
|
530
|
+
message: z.ZodString;
|
|
531
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./json.ts").Json, unknown, z.core.$ZodTypeInternals<import("./json.ts").Json, unknown>>>>;
|
|
532
|
+
}, z.core.$strict>>;
|
|
533
|
+
}, z.core.$strict>;
|
|
534
|
+
};
|
|
535
|
+
};
|
|
536
|
+
type Typed<Schemas extends Record<string, {
|
|
537
|
+
input: z.ZodType;
|
|
538
|
+
output: z.ZodType;
|
|
539
|
+
}>> = {
|
|
540
|
+
[Name in keyof Schemas]: {
|
|
541
|
+
input: z.input<Schemas[Name]['input']>;
|
|
542
|
+
output: z.output<Schemas[Name]['output']>;
|
|
543
|
+
};
|
|
544
|
+
};
|
|
545
|
+
/** The kernel's commands by name, each `{ input; output }`; `Commands` includes them. */
|
|
546
|
+
export type KernelCommands = Typed<typeof kernelCommandSchemas>;
|
|
547
|
+
/** The kernel's queries by name, each `{ input; output }`; `Queries` includes them. */
|
|
548
|
+
export type KernelQueries = Typed<typeof kernelQuerySchemas>;
|
|
549
|
+
export {};
|
|
550
|
+
//# sourceMappingURL=kernel-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kernel-api.d.ts","sourceRoot":"","sources":["../src/kernel-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,oFAAoF;AACpF,eAAO,MAAM,wBAAwB,qIAAmC,CAAC;AAEzE,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB;;;;;;kBAMjC,CAAC;AAEH,mHAAmH;AACnH,eAAO,MAAM,qBAAqB;;;;;;;;;kBAMhC,CAAC;AAEH,qEAAqE;AACrE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAU9B,CAAC;AAEH,6HAA6H;AAC7H,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;kBAO5B,CAAC;AAEH,oFAAoF;AACpF,eAAO,MAAM,gBAAgB;;;;;;kBAM3B,CAAC;AAEH,2FAA2F;AAC3F,eAAO,MAAM,gBAAgB;;;;;;;;kBAK3B,CAAC;AAEH,yIAAyI;AACzI,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAQvB,CAAC;AAEH,iFAAiF;AACjF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBvB,CAAC;AAEX,gFAAgF;AAChF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcrB,CAAC;AAEX,KAAK,KAAK,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC;IAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAA;CAAE,CAAC,IAAI;KACnF,IAAI,IAAI,MAAM,OAAO,GAAG;QAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAA;KAAE;CAC/G,CAAC;AAEF,yFAAyF;AACzF,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEhE,uFAAuF;AACvF,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { jsonSchema } from "./json.js";
|
|
3
|
+
import { packageNameSchema } from "./manifest.js";
|
|
4
|
+
import { extensionSourceSchema, installSourceSchema, presetStateSchema } from "./preset.js";
|
|
5
|
+
import { problemSchema } from "./problem.js";
|
|
6
|
+
import { fileSchema, isoTimeSchema, jobSchema, jobStatusSchema, workspaceSchema } from "./rows.js";
|
|
7
|
+
const emptySchema = z.strictObject({});
|
|
8
|
+
const scopeSchema = z.enum(['global', 'workspace']);
|
|
9
|
+
const listLimitSchema = z.number().int().positive().max(1000);
|
|
10
|
+
/** Accepts a JSON Schema, as the kernel lists schemas for forms (plan 02 §2.12). */
|
|
11
|
+
export const jsonSchemaDocumentSchema = z.record(z.string(), jsonSchema);
|
|
12
|
+
/** Accepts a command or query as `kernel.extensions.list` describes it. */
|
|
13
|
+
export const registrationInfoSchema = z.strictObject({
|
|
14
|
+
name: z.string(),
|
|
15
|
+
description: z.string(),
|
|
16
|
+
public: z.boolean(),
|
|
17
|
+
input: jsonSchemaDocumentSchema,
|
|
18
|
+
output: jsonSchemaDocumentSchema,
|
|
19
|
+
});
|
|
20
|
+
/** Accepts a command or query as `kernel.registrations.list` lists it: with its owner, and without its schemas. */
|
|
21
|
+
export const registrationRowSchema = z.strictObject({
|
|
22
|
+
name: z.string(),
|
|
23
|
+
kind: z.enum(['command', 'query']),
|
|
24
|
+
extension: z.string(),
|
|
25
|
+
public: z.boolean(),
|
|
26
|
+
description: z.string(),
|
|
27
|
+
});
|
|
28
|
+
/** Accepts an extension as `kernel.extensions.list` describes it. */
|
|
29
|
+
export const extensionInfoSchema = z.strictObject({
|
|
30
|
+
name: z.string(),
|
|
31
|
+
version: z.string(),
|
|
32
|
+
source: extensionSourceSchema,
|
|
33
|
+
revision: z.number().int().nonnegative(),
|
|
34
|
+
namespace: z.string(),
|
|
35
|
+
commands: z.array(registrationInfoSchema),
|
|
36
|
+
queries: z.array(registrationInfoSchema),
|
|
37
|
+
settings: z.array(z.strictObject({ key: z.string(), description: z.string(), scopes: z.array(scopeSchema) })),
|
|
38
|
+
handlers: z.array(z.strictObject({ point: z.string(), description: z.string() })),
|
|
39
|
+
});
|
|
40
|
+
/** Accepts a setting as `kernel.settings.list` describes it: its JSON Schema, its scopes, and where its value comes from. */
|
|
41
|
+
export const settingInfoSchema = z.strictObject({
|
|
42
|
+
key: z.string(),
|
|
43
|
+
description: z.string(),
|
|
44
|
+
schema: jsonSchemaDocumentSchema,
|
|
45
|
+
scopes: z.array(scopeSchema),
|
|
46
|
+
value: jsonSchema,
|
|
47
|
+
source: z.enum(['workspace', 'global', 'preset', 'default']),
|
|
48
|
+
});
|
|
49
|
+
/** Accepts a running long-lived process as `kernel.processes.list` describes it. */
|
|
50
|
+
export const processRowSchema = z.strictObject({
|
|
51
|
+
extension: z.string(),
|
|
52
|
+
workspaceId: z.string(),
|
|
53
|
+
name: z.string(),
|
|
54
|
+
pid: z.number().int(),
|
|
55
|
+
startedAt: isoTimeSchema,
|
|
56
|
+
});
|
|
57
|
+
/** Accepts the sub-folders of a folder as `kernel.folder.list` answers (plan 02 §2.12). */
|
|
58
|
+
export const folderListSchema = z.strictObject({
|
|
59
|
+
path: z.string(),
|
|
60
|
+
parent: z.string().nullable(),
|
|
61
|
+
folders: z.array(z.strictObject({ name: z.string(), path: z.string() })),
|
|
62
|
+
truncated: z.boolean(),
|
|
63
|
+
});
|
|
64
|
+
/** Accepts the answer of `kernel.health.get`; `rolledBack` is the Problem of the start that was undone before this one (ADR 0024, 5). */
|
|
65
|
+
export const healthSchema = z.strictObject({
|
|
66
|
+
version: z.string(),
|
|
67
|
+
preset: z.string(),
|
|
68
|
+
mode: z.literal('web'),
|
|
69
|
+
workers: z.number().int().positive(),
|
|
70
|
+
uptimeMs: z.number().nonnegative(),
|
|
71
|
+
languages: z.array(z.string()),
|
|
72
|
+
rolledBack: problemSchema.exactOptional(),
|
|
73
|
+
});
|
|
74
|
+
/** The input and output schemas of the kernel's own commands (plan 02 §2.12). */
|
|
75
|
+
export const kernelCommandSchemas = {
|
|
76
|
+
'kernel.workspace.open': { input: z.strictObject({ path: z.string().min(1) }), output: workspaceSchema },
|
|
77
|
+
'kernel.workspace.close': { input: z.strictObject({ workspaceId: z.string().min(1) }), output: emptySchema },
|
|
78
|
+
'kernel.folder.create': { input: z.strictObject({ path: z.string().min(1), name: z.string() }), output: z.strictObject({ path: z.string() }) },
|
|
79
|
+
'kernel.settings.set': { input: z.strictObject({ key: z.string().min(1), value: jsonSchema, scope: scopeSchema }), output: emptySchema },
|
|
80
|
+
'kernel.settings.reset': { input: z.strictObject({ key: z.string().min(1), scope: scopeSchema }), output: emptySchema },
|
|
81
|
+
'kernel.secrets.set': { input: z.strictObject({ extension: z.string().min(1), name: z.string().min(1), value: z.string() }), output: emptySchema },
|
|
82
|
+
'kernel.secrets.delete': { input: z.strictObject({ extension: z.string().min(1), name: z.string().min(1) }), output: emptySchema },
|
|
83
|
+
'kernel.files.unlink': { input: z.strictObject({ id: z.string().min(1) }), output: emptySchema },
|
|
84
|
+
'kernel.extensions.install': {
|
|
85
|
+
input: z.strictObject({ source: installSourceSchema }),
|
|
86
|
+
output: z.strictObject({ file: z.string(), restartRequired: z.literal(true) }),
|
|
87
|
+
},
|
|
88
|
+
'kernel.extensions.uninstall': {
|
|
89
|
+
input: z.strictObject({ name: packageNameSchema }),
|
|
90
|
+
output: z.strictObject({ file: z.string(), restartRequired: z.literal(true) }),
|
|
91
|
+
},
|
|
92
|
+
'kernel.restart': { input: emptySchema, output: z.strictObject({ restarting: z.literal(true) }) },
|
|
93
|
+
};
|
|
94
|
+
/** The input and output schemas of the kernel's own queries (plan 02 §2.12). */
|
|
95
|
+
export const kernelQuerySchemas = {
|
|
96
|
+
'kernel.workspace.list': { input: emptySchema, output: z.array(workspaceSchema) },
|
|
97
|
+
'kernel.folder.list': { input: z.strictObject({ path: z.string().min(1).exactOptional(), hidden: z.boolean().exactOptional() }), output: folderListSchema },
|
|
98
|
+
'kernel.settings.list': { input: emptySchema, output: z.array(settingInfoSchema) },
|
|
99
|
+
'kernel.secrets.list': { input: emptySchema, output: z.array(z.strictObject({ extension: z.string(), name: z.string() })) },
|
|
100
|
+
'kernel.jobs.get': { input: z.strictObject({ id: z.string().min(1) }), output: jobSchema },
|
|
101
|
+
'kernel.jobs.list': { input: z.strictObject({ status: jobStatusSchema.optional(), limit: listLimitSchema }), output: z.array(jobSchema) },
|
|
102
|
+
'kernel.files.get': { input: z.strictObject({ id: z.string().min(1) }), output: fileSchema },
|
|
103
|
+
'kernel.files.list': { input: z.strictObject({ limit: listLimitSchema }), output: z.array(fileSchema) },
|
|
104
|
+
'kernel.extensions.list': { input: emptySchema, output: z.array(extensionInfoSchema) },
|
|
105
|
+
'kernel.registrations.list': { input: emptySchema, output: z.array(registrationRowSchema) },
|
|
106
|
+
'kernel.preset.get': { input: emptySchema, output: presetStateSchema },
|
|
107
|
+
'kernel.processes.list': { input: emptySchema, output: z.array(processRowSchema) },
|
|
108
|
+
'kernel.health.get': { input: emptySchema, output: healthSchema },
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=kernel-api.js.map
|