@opencode-cockpit/protocol 0.1.4 → 0.1.5
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/build.js +32 -0
- package/dist/contract.js +6 -0
- package/dist/daemon.js +51 -0
- package/dist/framing.js +27 -0
- package/dist/index.js +19 -0
- package/dist/paths.js +16 -0
- package/dist/rpc.js +53 -0
- package/{src/shell.ts → dist/shell.js} +92 -98
- package/package.json +11 -4
- package/types/build.d.ts +6 -0
- package/{src/contract.ts → types/contract.d.ts} +10 -17
- package/types/daemon.d.ts +80 -0
- package/types/framing.d.ts +10 -0
- package/types/index.d.ts +463 -0
- package/types/paths.d.ts +12 -0
- package/types/rpc.d.ts +63 -0
- package/types/shell.d.ts +633 -0
- package/src/build.ts +0 -32
- package/src/daemon.ts +0 -48
- package/src/framing.ts +0 -26
- package/src/index.ts +0 -21
- package/src/paths.ts +0 -25
- package/src/rpc.ts +0 -96
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
export * from "./build.ts";
|
|
2
|
+
export * from "./contract.ts";
|
|
3
|
+
export * from "./daemon.ts";
|
|
4
|
+
export * from "./framing.ts";
|
|
5
|
+
export * from "./paths.ts";
|
|
6
|
+
export * from "./rpc.ts";
|
|
7
|
+
export * as shell from "./shell.ts";
|
|
8
|
+
/** Every method the daemon serves. Adding a module means spreading its contract here. */
|
|
9
|
+
export declare const contract: {
|
|
10
|
+
"daemon.hello": import("./contract.ts").MethodSpec<import("zod").ZodObject<{
|
|
11
|
+
client: import("zod").ZodObject<{
|
|
12
|
+
name: import("zod").ZodString;
|
|
13
|
+
version: import("zod").ZodString;
|
|
14
|
+
pid: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
15
|
+
}, import("zod/v4/core").$strip>;
|
|
16
|
+
protocol: import("zod").ZodObject<{
|
|
17
|
+
major: import("zod").ZodNumber;
|
|
18
|
+
minor: import("zod").ZodNumber;
|
|
19
|
+
}, import("zod/v4/core").$strip>;
|
|
20
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
21
|
+
daemonVersion: import("zod").ZodString;
|
|
22
|
+
build: import("zod").ZodOptional<import("zod").ZodString>;
|
|
23
|
+
protocol: import("zod").ZodObject<{
|
|
24
|
+
major: import("zod").ZodNumber;
|
|
25
|
+
minor: import("zod").ZodNumber;
|
|
26
|
+
}, import("zod/v4/core").$strip>;
|
|
27
|
+
modules: import("zod").ZodArray<import("zod").ZodString>;
|
|
28
|
+
pid: import("zod").ZodNumber;
|
|
29
|
+
startedAt: import("zod").ZodNumber;
|
|
30
|
+
}, import("zod/v4/core").$strip>>;
|
|
31
|
+
"daemon.status": import("./contract.ts").MethodSpec<import("zod").ZodOptional<import("zod").ZodObject<{}, import("zod/v4/core").$strip>>, import("zod").ZodObject<{
|
|
32
|
+
pid: import("zod").ZodNumber;
|
|
33
|
+
uptimeMs: import("zod").ZodNumber;
|
|
34
|
+
clients: import("zod").ZodNumber;
|
|
35
|
+
modules: import("zod").ZodArray<import("zod").ZodObject<{
|
|
36
|
+
name: import("zod").ZodString;
|
|
37
|
+
busy: import("zod").ZodBoolean;
|
|
38
|
+
}, import("zod/v4/core").$strip>>;
|
|
39
|
+
}, import("zod/v4/core").$strip>>;
|
|
40
|
+
"daemon.shutdown": import("./contract.ts").MethodSpec<import("zod").ZodOptional<import("zod").ZodObject<{
|
|
41
|
+
force: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
42
|
+
}, import("zod/v4/core").$strip>>, import("zod").ZodObject<{
|
|
43
|
+
accepted: import("zod").ZodBoolean;
|
|
44
|
+
}, import("zod/v4/core").$strip>>;
|
|
45
|
+
"events.subscribe": import("./contract.ts").MethodSpec<import("zod").ZodObject<{
|
|
46
|
+
topics: import("zod").ZodArray<import("zod").ZodString>;
|
|
47
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
48
|
+
topics: import("zod").ZodArray<import("zod").ZodString>;
|
|
49
|
+
}, import("zod/v4/core").$strip>>;
|
|
50
|
+
"events.unsubscribe": import("./contract.ts").MethodSpec<import("zod").ZodObject<{
|
|
51
|
+
topics: import("zod").ZodArray<import("zod").ZodString>;
|
|
52
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
53
|
+
topics: import("zod").ZodArray<import("zod").ZodString>;
|
|
54
|
+
}, import("zod/v4/core").$strip>>;
|
|
55
|
+
"shell.start": import("./contract.ts").MethodSpec<import("zod").ZodObject<{
|
|
56
|
+
command: import("zod").ZodString;
|
|
57
|
+
args: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
|
|
58
|
+
cwd: import("zod").ZodString;
|
|
59
|
+
env: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
60
|
+
title: import("zod").ZodOptional<import("zod").ZodString>;
|
|
61
|
+
cols: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
62
|
+
rows: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
63
|
+
owner: import("zod").ZodObject<{
|
|
64
|
+
project: import("zod").ZodString;
|
|
65
|
+
session: import("zod").ZodOptional<import("zod").ZodString>;
|
|
66
|
+
instance: import("zod").ZodOptional<import("zod").ZodString>;
|
|
67
|
+
}, import("zod/v4/core").$strip>;
|
|
68
|
+
timeoutMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
69
|
+
reuse: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
70
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
71
|
+
id: import("zod").ZodString;
|
|
72
|
+
title: import("zod").ZodString;
|
|
73
|
+
command: import("zod").ZodString;
|
|
74
|
+
args: import("zod").ZodArray<import("zod").ZodString>;
|
|
75
|
+
cwd: import("zod").ZodString;
|
|
76
|
+
owner: import("zod").ZodObject<{
|
|
77
|
+
project: import("zod").ZodString;
|
|
78
|
+
session: import("zod").ZodOptional<import("zod").ZodString>;
|
|
79
|
+
instance: import("zod").ZodOptional<import("zod").ZodString>;
|
|
80
|
+
}, import("zod/v4/core").$strip>;
|
|
81
|
+
status: import("zod").ZodEnum<{
|
|
82
|
+
exited: "exited";
|
|
83
|
+
failed: "failed";
|
|
84
|
+
killed: "killed";
|
|
85
|
+
running: "running";
|
|
86
|
+
}>;
|
|
87
|
+
run: import("zod").ZodNumber;
|
|
88
|
+
pid: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
89
|
+
exitCode: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
90
|
+
signal: import("zod").ZodOptional<import("zod").ZodString>;
|
|
91
|
+
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
92
|
+
summary: import("zod").ZodOptional<import("zod").ZodString>;
|
|
93
|
+
startedAt: import("zod").ZodNumber;
|
|
94
|
+
endedAt: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
95
|
+
cols: import("zod").ZodNumber;
|
|
96
|
+
rows: import("zod").ZodNumber;
|
|
97
|
+
lines: import("zod").ZodObject<{
|
|
98
|
+
first: import("zod").ZodNumber;
|
|
99
|
+
last: import("zod").ZodNumber;
|
|
100
|
+
}, import("zod/v4/core").$strip>;
|
|
101
|
+
bytes: import("zod").ZodNumber;
|
|
102
|
+
}, import("zod/v4/core").$strip>>;
|
|
103
|
+
"shell.list": import("./contract.ts").MethodSpec<import("zod").ZodDefault<import("zod").ZodObject<{
|
|
104
|
+
owner: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
105
|
+
project: import("zod").ZodOptional<import("zod").ZodString>;
|
|
106
|
+
session: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
107
|
+
instance: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
108
|
+
}, import("zod/v4/core").$strip>>;
|
|
109
|
+
includeExited: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
110
|
+
}, import("zod/v4/core").$strip>>, import("zod").ZodArray<import("zod").ZodObject<{
|
|
111
|
+
id: import("zod").ZodString;
|
|
112
|
+
title: import("zod").ZodString;
|
|
113
|
+
command: import("zod").ZodString;
|
|
114
|
+
args: import("zod").ZodArray<import("zod").ZodString>;
|
|
115
|
+
cwd: import("zod").ZodString;
|
|
116
|
+
owner: import("zod").ZodObject<{
|
|
117
|
+
project: import("zod").ZodString;
|
|
118
|
+
session: import("zod").ZodOptional<import("zod").ZodString>;
|
|
119
|
+
instance: import("zod").ZodOptional<import("zod").ZodString>;
|
|
120
|
+
}, import("zod/v4/core").$strip>;
|
|
121
|
+
status: import("zod").ZodEnum<{
|
|
122
|
+
exited: "exited";
|
|
123
|
+
failed: "failed";
|
|
124
|
+
killed: "killed";
|
|
125
|
+
running: "running";
|
|
126
|
+
}>;
|
|
127
|
+
run: import("zod").ZodNumber;
|
|
128
|
+
pid: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
129
|
+
exitCode: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
130
|
+
signal: import("zod").ZodOptional<import("zod").ZodString>;
|
|
131
|
+
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
132
|
+
summary: import("zod").ZodOptional<import("zod").ZodString>;
|
|
133
|
+
startedAt: import("zod").ZodNumber;
|
|
134
|
+
endedAt: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
135
|
+
cols: import("zod").ZodNumber;
|
|
136
|
+
rows: import("zod").ZodNumber;
|
|
137
|
+
lines: import("zod").ZodObject<{
|
|
138
|
+
first: import("zod").ZodNumber;
|
|
139
|
+
last: import("zod").ZodNumber;
|
|
140
|
+
}, import("zod/v4/core").$strip>;
|
|
141
|
+
bytes: import("zod").ZodNumber;
|
|
142
|
+
}, import("zod/v4/core").$strip>>>;
|
|
143
|
+
"shell.get": import("./contract.ts").MethodSpec<import("zod").ZodObject<{
|
|
144
|
+
id: import("zod").ZodString;
|
|
145
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
146
|
+
id: import("zod").ZodString;
|
|
147
|
+
title: import("zod").ZodString;
|
|
148
|
+
command: import("zod").ZodString;
|
|
149
|
+
args: import("zod").ZodArray<import("zod").ZodString>;
|
|
150
|
+
cwd: import("zod").ZodString;
|
|
151
|
+
owner: import("zod").ZodObject<{
|
|
152
|
+
project: import("zod").ZodString;
|
|
153
|
+
session: import("zod").ZodOptional<import("zod").ZodString>;
|
|
154
|
+
instance: import("zod").ZodOptional<import("zod").ZodString>;
|
|
155
|
+
}, import("zod/v4/core").$strip>;
|
|
156
|
+
status: import("zod").ZodEnum<{
|
|
157
|
+
exited: "exited";
|
|
158
|
+
failed: "failed";
|
|
159
|
+
killed: "killed";
|
|
160
|
+
running: "running";
|
|
161
|
+
}>;
|
|
162
|
+
run: import("zod").ZodNumber;
|
|
163
|
+
pid: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
164
|
+
exitCode: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
165
|
+
signal: import("zod").ZodOptional<import("zod").ZodString>;
|
|
166
|
+
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
167
|
+
summary: import("zod").ZodOptional<import("zod").ZodString>;
|
|
168
|
+
startedAt: import("zod").ZodNumber;
|
|
169
|
+
endedAt: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
170
|
+
cols: import("zod").ZodNumber;
|
|
171
|
+
rows: import("zod").ZodNumber;
|
|
172
|
+
lines: import("zod").ZodObject<{
|
|
173
|
+
first: import("zod").ZodNumber;
|
|
174
|
+
last: import("zod").ZodNumber;
|
|
175
|
+
}, import("zod/v4/core").$strip>;
|
|
176
|
+
bytes: import("zod").ZodNumber;
|
|
177
|
+
}, import("zod/v4/core").$strip>>;
|
|
178
|
+
"shell.read": import("./contract.ts").MethodSpec<import("zod").ZodObject<{
|
|
179
|
+
id: import("zod").ZodString;
|
|
180
|
+
after: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
181
|
+
tail: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
182
|
+
limit: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
183
|
+
grep: import("zod").ZodOptional<import("zod").ZodString>;
|
|
184
|
+
ignoreCase: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
185
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
186
|
+
lines: import("zod").ZodArray<import("zod").ZodObject<{
|
|
187
|
+
n: import("zod").ZodNumber;
|
|
188
|
+
text: import("zod").ZodString;
|
|
189
|
+
}, import("zod/v4/core").$strip>>;
|
|
190
|
+
firstLine: import("zod").ZodNumber;
|
|
191
|
+
lastLine: import("zod").ZodNumber;
|
|
192
|
+
nextCursor: import("zod").ZodNumber;
|
|
193
|
+
truncated: import("zod").ZodBoolean;
|
|
194
|
+
hasMore: import("zod").ZodBoolean;
|
|
195
|
+
status: import("zod").ZodEnum<{
|
|
196
|
+
exited: "exited";
|
|
197
|
+
failed: "failed";
|
|
198
|
+
killed: "killed";
|
|
199
|
+
running: "running";
|
|
200
|
+
}>;
|
|
201
|
+
}, import("zod/v4/core").$strip>>;
|
|
202
|
+
"shell.screen": import("./contract.ts").MethodSpec<import("zod").ZodObject<{
|
|
203
|
+
id: import("zod").ZodString;
|
|
204
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
205
|
+
text: import("zod").ZodString;
|
|
206
|
+
cols: import("zod").ZodNumber;
|
|
207
|
+
rows: import("zod").ZodNumber;
|
|
208
|
+
cursor: import("zod").ZodObject<{
|
|
209
|
+
x: import("zod").ZodNumber;
|
|
210
|
+
y: import("zod").ZodNumber;
|
|
211
|
+
}, import("zod/v4/core").$strip>;
|
|
212
|
+
}, import("zod/v4/core").$strip>>;
|
|
213
|
+
"shell.write": import("./contract.ts").MethodSpec<import("zod").ZodObject<{
|
|
214
|
+
id: import("zod").ZodString;
|
|
215
|
+
data: import("zod").ZodString;
|
|
216
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
217
|
+
bytes: import("zod").ZodNumber;
|
|
218
|
+
}, import("zod/v4/core").$strip>>;
|
|
219
|
+
"shell.resize": import("./contract.ts").MethodSpec<import("zod").ZodObject<{
|
|
220
|
+
id: import("zod").ZodString;
|
|
221
|
+
cols: import("zod").ZodNumber;
|
|
222
|
+
rows: import("zod").ZodNumber;
|
|
223
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{}, import("zod/v4/core").$strip>>;
|
|
224
|
+
"shell.wait": import("./contract.ts").MethodSpec<import("zod").ZodObject<{
|
|
225
|
+
id: import("zod").ZodString;
|
|
226
|
+
until: import("zod").ZodObject<{
|
|
227
|
+
pattern: import("zod").ZodOptional<import("zod").ZodString>;
|
|
228
|
+
ignoreCase: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
229
|
+
exit: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
230
|
+
idleMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
231
|
+
port: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
232
|
+
host: import("zod").ZodOptional<import("zod").ZodString>;
|
|
233
|
+
}, import("zod/v4/core").$strip>;
|
|
234
|
+
timeoutMs: import("zod").ZodNumber;
|
|
235
|
+
after: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
236
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
237
|
+
reason: import("zod").ZodEnum<{
|
|
238
|
+
exit: "exit";
|
|
239
|
+
idle: "idle";
|
|
240
|
+
pattern: "pattern";
|
|
241
|
+
port: "port";
|
|
242
|
+
timeout: "timeout";
|
|
243
|
+
}>;
|
|
244
|
+
match: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
245
|
+
n: import("zod").ZodNumber;
|
|
246
|
+
text: import("zod").ZodString;
|
|
247
|
+
}, import("zod/v4/core").$strip>>;
|
|
248
|
+
info: import("zod").ZodObject<{
|
|
249
|
+
id: import("zod").ZodString;
|
|
250
|
+
title: import("zod").ZodString;
|
|
251
|
+
command: import("zod").ZodString;
|
|
252
|
+
args: import("zod").ZodArray<import("zod").ZodString>;
|
|
253
|
+
cwd: import("zod").ZodString;
|
|
254
|
+
owner: import("zod").ZodObject<{
|
|
255
|
+
project: import("zod").ZodString;
|
|
256
|
+
session: import("zod").ZodOptional<import("zod").ZodString>;
|
|
257
|
+
instance: import("zod").ZodOptional<import("zod").ZodString>;
|
|
258
|
+
}, import("zod/v4/core").$strip>;
|
|
259
|
+
status: import("zod").ZodEnum<{
|
|
260
|
+
exited: "exited";
|
|
261
|
+
failed: "failed";
|
|
262
|
+
killed: "killed";
|
|
263
|
+
running: "running";
|
|
264
|
+
}>;
|
|
265
|
+
run: import("zod").ZodNumber;
|
|
266
|
+
pid: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
267
|
+
exitCode: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
268
|
+
signal: import("zod").ZodOptional<import("zod").ZodString>;
|
|
269
|
+
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
270
|
+
summary: import("zod").ZodOptional<import("zod").ZodString>;
|
|
271
|
+
startedAt: import("zod").ZodNumber;
|
|
272
|
+
endedAt: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
273
|
+
cols: import("zod").ZodNumber;
|
|
274
|
+
rows: import("zod").ZodNumber;
|
|
275
|
+
lines: import("zod").ZodObject<{
|
|
276
|
+
first: import("zod").ZodNumber;
|
|
277
|
+
last: import("zod").ZodNumber;
|
|
278
|
+
}, import("zod/v4/core").$strip>;
|
|
279
|
+
bytes: import("zod").ZodNumber;
|
|
280
|
+
}, import("zod/v4/core").$strip>;
|
|
281
|
+
}, import("zod/v4/core").$strip>>;
|
|
282
|
+
"shell.stop": import("./contract.ts").MethodSpec<import("zod").ZodObject<{
|
|
283
|
+
id: import("zod").ZodString;
|
|
284
|
+
signal: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
285
|
+
SIGHUP: "SIGHUP";
|
|
286
|
+
SIGINT: "SIGINT";
|
|
287
|
+
SIGKILL: "SIGKILL";
|
|
288
|
+
SIGTERM: "SIGTERM";
|
|
289
|
+
}>>;
|
|
290
|
+
graceMs: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
291
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
292
|
+
id: import("zod").ZodString;
|
|
293
|
+
title: import("zod").ZodString;
|
|
294
|
+
command: import("zod").ZodString;
|
|
295
|
+
args: import("zod").ZodArray<import("zod").ZodString>;
|
|
296
|
+
cwd: import("zod").ZodString;
|
|
297
|
+
owner: import("zod").ZodObject<{
|
|
298
|
+
project: import("zod").ZodString;
|
|
299
|
+
session: import("zod").ZodOptional<import("zod").ZodString>;
|
|
300
|
+
instance: import("zod").ZodOptional<import("zod").ZodString>;
|
|
301
|
+
}, import("zod/v4/core").$strip>;
|
|
302
|
+
status: import("zod").ZodEnum<{
|
|
303
|
+
exited: "exited";
|
|
304
|
+
failed: "failed";
|
|
305
|
+
killed: "killed";
|
|
306
|
+
running: "running";
|
|
307
|
+
}>;
|
|
308
|
+
run: import("zod").ZodNumber;
|
|
309
|
+
pid: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
310
|
+
exitCode: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
311
|
+
signal: import("zod").ZodOptional<import("zod").ZodString>;
|
|
312
|
+
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
313
|
+
summary: import("zod").ZodOptional<import("zod").ZodString>;
|
|
314
|
+
startedAt: import("zod").ZodNumber;
|
|
315
|
+
endedAt: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
316
|
+
cols: import("zod").ZodNumber;
|
|
317
|
+
rows: import("zod").ZodNumber;
|
|
318
|
+
lines: import("zod").ZodObject<{
|
|
319
|
+
first: import("zod").ZodNumber;
|
|
320
|
+
last: import("zod").ZodNumber;
|
|
321
|
+
}, import("zod/v4/core").$strip>;
|
|
322
|
+
bytes: import("zod").ZodNumber;
|
|
323
|
+
}, import("zod/v4/core").$strip>>;
|
|
324
|
+
"shell.restart": import("./contract.ts").MethodSpec<import("zod").ZodObject<{
|
|
325
|
+
id: import("zod").ZodString;
|
|
326
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
327
|
+
id: import("zod").ZodString;
|
|
328
|
+
title: import("zod").ZodString;
|
|
329
|
+
command: import("zod").ZodString;
|
|
330
|
+
args: import("zod").ZodArray<import("zod").ZodString>;
|
|
331
|
+
cwd: import("zod").ZodString;
|
|
332
|
+
owner: import("zod").ZodObject<{
|
|
333
|
+
project: import("zod").ZodString;
|
|
334
|
+
session: import("zod").ZodOptional<import("zod").ZodString>;
|
|
335
|
+
instance: import("zod").ZodOptional<import("zod").ZodString>;
|
|
336
|
+
}, import("zod/v4/core").$strip>;
|
|
337
|
+
status: import("zod").ZodEnum<{
|
|
338
|
+
exited: "exited";
|
|
339
|
+
failed: "failed";
|
|
340
|
+
killed: "killed";
|
|
341
|
+
running: "running";
|
|
342
|
+
}>;
|
|
343
|
+
run: import("zod").ZodNumber;
|
|
344
|
+
pid: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
345
|
+
exitCode: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
346
|
+
signal: import("zod").ZodOptional<import("zod").ZodString>;
|
|
347
|
+
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
348
|
+
summary: import("zod").ZodOptional<import("zod").ZodString>;
|
|
349
|
+
startedAt: import("zod").ZodNumber;
|
|
350
|
+
endedAt: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
351
|
+
cols: import("zod").ZodNumber;
|
|
352
|
+
rows: import("zod").ZodNumber;
|
|
353
|
+
lines: import("zod").ZodObject<{
|
|
354
|
+
first: import("zod").ZodNumber;
|
|
355
|
+
last: import("zod").ZodNumber;
|
|
356
|
+
}, import("zod/v4/core").$strip>;
|
|
357
|
+
bytes: import("zod").ZodNumber;
|
|
358
|
+
}, import("zod/v4/core").$strip>>;
|
|
359
|
+
"shell.remove": import("./contract.ts").MethodSpec<import("zod").ZodObject<{
|
|
360
|
+
id: import("zod").ZodString;
|
|
361
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{}, import("zod/v4/core").$strip>>;
|
|
362
|
+
"shell.clear": import("./contract.ts").MethodSpec<import("zod").ZodDefault<import("zod").ZodObject<{
|
|
363
|
+
owner: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
364
|
+
project: import("zod").ZodOptional<import("zod").ZodString>;
|
|
365
|
+
session: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
366
|
+
instance: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
367
|
+
}, import("zod/v4/core").$strip>>;
|
|
368
|
+
finishedBeforeMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
369
|
+
}, import("zod/v4/core").$strip>>, import("zod").ZodObject<{
|
|
370
|
+
removed: import("zod").ZodArray<import("zod").ZodString>;
|
|
371
|
+
}, import("zod/v4/core").$strip>>;
|
|
372
|
+
"shell.attach": import("./contract.ts").MethodSpec<import("zod").ZodObject<{
|
|
373
|
+
id: import("zod").ZodString;
|
|
374
|
+
fromOffset: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
375
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
376
|
+
offset: import("zod").ZodNumber;
|
|
377
|
+
replay: import("zod").ZodString;
|
|
378
|
+
}, import("zod/v4/core").$strip>>;
|
|
379
|
+
"shell.detach": import("./contract.ts").MethodSpec<import("zod").ZodObject<{
|
|
380
|
+
id: import("zod").ZodString;
|
|
381
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{}, import("zod/v4/core").$strip>>;
|
|
382
|
+
};
|
|
383
|
+
export type Methods = typeof contract;
|
|
384
|
+
export type MethodName = keyof Methods;
|
|
385
|
+
/** Every event topic the daemon emits. */
|
|
386
|
+
export declare const events: {
|
|
387
|
+
"shell.started": import("zod").ZodObject<{
|
|
388
|
+
id: import("zod").ZodString;
|
|
389
|
+
title: import("zod").ZodString;
|
|
390
|
+
command: import("zod").ZodString;
|
|
391
|
+
args: import("zod").ZodArray<import("zod").ZodString>;
|
|
392
|
+
cwd: import("zod").ZodString;
|
|
393
|
+
owner: import("zod").ZodObject<{
|
|
394
|
+
project: import("zod").ZodString;
|
|
395
|
+
session: import("zod").ZodOptional<import("zod").ZodString>;
|
|
396
|
+
instance: import("zod").ZodOptional<import("zod").ZodString>;
|
|
397
|
+
}, import("zod/v4/core").$strip>;
|
|
398
|
+
status: import("zod").ZodEnum<{
|
|
399
|
+
exited: "exited";
|
|
400
|
+
failed: "failed";
|
|
401
|
+
killed: "killed";
|
|
402
|
+
running: "running";
|
|
403
|
+
}>;
|
|
404
|
+
run: import("zod").ZodNumber;
|
|
405
|
+
pid: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
406
|
+
exitCode: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
407
|
+
signal: import("zod").ZodOptional<import("zod").ZodString>;
|
|
408
|
+
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
409
|
+
summary: import("zod").ZodOptional<import("zod").ZodString>;
|
|
410
|
+
startedAt: import("zod").ZodNumber;
|
|
411
|
+
endedAt: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
412
|
+
cols: import("zod").ZodNumber;
|
|
413
|
+
rows: import("zod").ZodNumber;
|
|
414
|
+
lines: import("zod").ZodObject<{
|
|
415
|
+
first: import("zod").ZodNumber;
|
|
416
|
+
last: import("zod").ZodNumber;
|
|
417
|
+
}, import("zod/v4/core").$strip>;
|
|
418
|
+
bytes: import("zod").ZodNumber;
|
|
419
|
+
}, import("zod/v4/core").$strip>;
|
|
420
|
+
"shell.exited": import("zod").ZodObject<{
|
|
421
|
+
id: import("zod").ZodString;
|
|
422
|
+
title: import("zod").ZodString;
|
|
423
|
+
command: import("zod").ZodString;
|
|
424
|
+
args: import("zod").ZodArray<import("zod").ZodString>;
|
|
425
|
+
cwd: import("zod").ZodString;
|
|
426
|
+
owner: import("zod").ZodObject<{
|
|
427
|
+
project: import("zod").ZodString;
|
|
428
|
+
session: import("zod").ZodOptional<import("zod").ZodString>;
|
|
429
|
+
instance: import("zod").ZodOptional<import("zod").ZodString>;
|
|
430
|
+
}, import("zod/v4/core").$strip>;
|
|
431
|
+
status: import("zod").ZodEnum<{
|
|
432
|
+
exited: "exited";
|
|
433
|
+
failed: "failed";
|
|
434
|
+
killed: "killed";
|
|
435
|
+
running: "running";
|
|
436
|
+
}>;
|
|
437
|
+
run: import("zod").ZodNumber;
|
|
438
|
+
pid: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
439
|
+
exitCode: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
440
|
+
signal: import("zod").ZodOptional<import("zod").ZodString>;
|
|
441
|
+
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
442
|
+
summary: import("zod").ZodOptional<import("zod").ZodString>;
|
|
443
|
+
startedAt: import("zod").ZodNumber;
|
|
444
|
+
endedAt: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
445
|
+
cols: import("zod").ZodNumber;
|
|
446
|
+
rows: import("zod").ZodNumber;
|
|
447
|
+
lines: import("zod").ZodObject<{
|
|
448
|
+
first: import("zod").ZodNumber;
|
|
449
|
+
last: import("zod").ZodNumber;
|
|
450
|
+
}, import("zod/v4/core").$strip>;
|
|
451
|
+
bytes: import("zod").ZodNumber;
|
|
452
|
+
}, import("zod/v4/core").$strip>;
|
|
453
|
+
"shell.removed": import("zod").ZodObject<{
|
|
454
|
+
id: import("zod").ZodString;
|
|
455
|
+
}, import("zod/v4/core").$strip>;
|
|
456
|
+
"shell.output": import("zod").ZodObject<{
|
|
457
|
+
id: import("zod").ZodString;
|
|
458
|
+
offset: import("zod").ZodNumber;
|
|
459
|
+
data: import("zod").ZodString;
|
|
460
|
+
}, import("zod/v4/core").$strip>;
|
|
461
|
+
};
|
|
462
|
+
export type Events = typeof events;
|
|
463
|
+
export type Topic = keyof Events;
|
package/types/paths.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface CockpitPaths {
|
|
2
|
+
home: string;
|
|
3
|
+
socket: string;
|
|
4
|
+
pidFile: string;
|
|
5
|
+
lockFile: string;
|
|
6
|
+
logFile: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Filesystem layout shared by daemon and clients. Pure: creates nothing.
|
|
10
|
+
* Kept short because unix socket paths are limited to 104 bytes on macOS.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolvePaths(env?: Record<string, string | undefined>): CockpitPaths;
|
package/types/rpc.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** Wire envelope: JSON-RPC 2.0, one JSON object per line (ADR 0002). */
|
|
2
|
+
/** Bump MAJOR on breaking changes to methods, events or framing. */
|
|
3
|
+
export declare const PROTOCOL_VERSION: {
|
|
4
|
+
readonly major: 1;
|
|
5
|
+
readonly minor: 1;
|
|
6
|
+
};
|
|
7
|
+
export type RequestId = number | string;
|
|
8
|
+
export interface RpcRequest {
|
|
9
|
+
jsonrpc: "2.0";
|
|
10
|
+
id: RequestId;
|
|
11
|
+
method: string;
|
|
12
|
+
params?: unknown;
|
|
13
|
+
}
|
|
14
|
+
export interface RpcNotification {
|
|
15
|
+
jsonrpc: "2.0";
|
|
16
|
+
method: string;
|
|
17
|
+
params?: unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface RpcSuccess {
|
|
20
|
+
jsonrpc: "2.0";
|
|
21
|
+
id: RequestId;
|
|
22
|
+
result: unknown;
|
|
23
|
+
}
|
|
24
|
+
export interface RpcFailure {
|
|
25
|
+
jsonrpc: "2.0";
|
|
26
|
+
id: RequestId | null;
|
|
27
|
+
error: RpcErrorShape;
|
|
28
|
+
}
|
|
29
|
+
export type RpcMessage = RpcRequest | RpcNotification | RpcSuccess | RpcFailure;
|
|
30
|
+
export interface RpcErrorShape {
|
|
31
|
+
code: number;
|
|
32
|
+
message: string;
|
|
33
|
+
data?: unknown;
|
|
34
|
+
}
|
|
35
|
+
export declare const ErrorCode: {
|
|
36
|
+
readonly ParseError: -32700;
|
|
37
|
+
readonly InvalidRequest: -32600;
|
|
38
|
+
readonly MethodNotFound: -32601;
|
|
39
|
+
readonly InvalidParams: -32602;
|
|
40
|
+
readonly InternalError: -32603;
|
|
41
|
+
readonly NotFound: -32001;
|
|
42
|
+
readonly InvalidState: -32002;
|
|
43
|
+
readonly ProtocolMismatch: -32003;
|
|
44
|
+
readonly SpawnFailed: -32004;
|
|
45
|
+
readonly ShuttingDown: -32005;
|
|
46
|
+
};
|
|
47
|
+
export type ErrorCodeValue = (typeof ErrorCode)[keyof typeof ErrorCode];
|
|
48
|
+
export declare class RpcError extends Error {
|
|
49
|
+
readonly code: number;
|
|
50
|
+
readonly data?: unknown;
|
|
51
|
+
constructor(code: number, message: string, data?: unknown);
|
|
52
|
+
toShape(): RpcErrorShape;
|
|
53
|
+
static from(shape: RpcErrorShape): RpcError;
|
|
54
|
+
}
|
|
55
|
+
/** Method name for daemon → client notifications. */
|
|
56
|
+
export declare const EVENT_METHOD = "event";
|
|
57
|
+
export interface EventEnvelope<T extends string = string, D = unknown> {
|
|
58
|
+
topic: T;
|
|
59
|
+
data: D;
|
|
60
|
+
}
|
|
61
|
+
export declare function isRequest(msg: RpcMessage): msg is RpcRequest;
|
|
62
|
+
export declare function isNotification(msg: RpcMessage): msg is RpcNotification;
|
|
63
|
+
export declare function isResponse(msg: RpcMessage): msg is RpcSuccess | RpcFailure;
|