@opencode-cockpit/protocol 0.1.5 → 0.2.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/dist/index.js +2 -2
- package/dist/rpc.js +1 -1
- package/dist/shell/common.js +13 -0
- package/dist/shell/contract.js +55 -0
- package/dist/shell/index.js +6 -0
- package/dist/shell/info.js +33 -0
- package/dist/{shell.js → shell/params.js} +26 -75
- package/dist/shell/watch.js +37 -0
- package/package.json +3 -3
- package/types/index.d.ts +292 -1
- package/types/rpc.d.ts +1 -1
- package/types/shell/common.d.ts +16 -0
- package/types/{shell.d.ts → shell/contract.d.ts} +306 -241
- package/types/shell/index.d.ts +6 -0
- package/types/shell/info.d.ts +48 -0
- package/types/shell/params.d.ts +215 -0
- package/types/shell/watch.d.ts +46 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ShellInfo: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
title: z.ZodString;
|
|
5
|
+
command: z.ZodString;
|
|
6
|
+
args: z.ZodArray<z.ZodString>;
|
|
7
|
+
cwd: z.ZodString;
|
|
8
|
+
owner: z.ZodObject<{
|
|
9
|
+
project: z.ZodString;
|
|
10
|
+
session: z.ZodOptional<z.ZodString>;
|
|
11
|
+
instance: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
status: z.ZodEnum<{
|
|
14
|
+
exited: "exited";
|
|
15
|
+
failed: "failed";
|
|
16
|
+
killed: "killed";
|
|
17
|
+
running: "running";
|
|
18
|
+
}>;
|
|
19
|
+
run: z.ZodNumber;
|
|
20
|
+
pid: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
exitCode: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
signal: z.ZodOptional<z.ZodString>;
|
|
23
|
+
error: z.ZodOptional<z.ZodString>;
|
|
24
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
25
|
+
startedAt: z.ZodNumber;
|
|
26
|
+
endedAt: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
cols: z.ZodNumber;
|
|
28
|
+
rows: z.ZodNumber;
|
|
29
|
+
lines: z.ZodObject<{
|
|
30
|
+
first: z.ZodNumber;
|
|
31
|
+
last: z.ZodNumber;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
bytes: z.ZodNumber;
|
|
34
|
+
watch: z.ZodOptional<z.ZodObject<{
|
|
35
|
+
preset: z.ZodOptional<z.ZodString>;
|
|
36
|
+
status: z.ZodEnum<{
|
|
37
|
+
fail: "fail";
|
|
38
|
+
ok: "ok";
|
|
39
|
+
pending: "pending";
|
|
40
|
+
unknown: "unknown";
|
|
41
|
+
}>;
|
|
42
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
43
|
+
runs: z.ZodNumber;
|
|
44
|
+
since: z.ZodNumber;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
logFile: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export type ShellInfo = z.output<typeof ShellInfo>;
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const StartParams: z.ZodObject<{
|
|
3
|
+
command: z.ZodString;
|
|
4
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
5
|
+
cwd: z.ZodString;
|
|
6
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
7
|
+
title: z.ZodOptional<z.ZodString>;
|
|
8
|
+
cols: z.ZodDefault<z.ZodNumber>;
|
|
9
|
+
rows: z.ZodDefault<z.ZodNumber>;
|
|
10
|
+
owner: z.ZodObject<{
|
|
11
|
+
project: z.ZodString;
|
|
12
|
+
session: z.ZodOptional<z.ZodString>;
|
|
13
|
+
instance: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
idleTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
logFile: z.ZodDefault<z.ZodBoolean>;
|
|
18
|
+
reuse: z.ZodDefault<z.ZodBoolean>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export declare const ClearParams: z.ZodDefault<z.ZodObject<{
|
|
21
|
+
owner: z.ZodOptional<z.ZodObject<{
|
|
22
|
+
project: z.ZodOptional<z.ZodString>;
|
|
23
|
+
session: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
24
|
+
instance: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
finishedBeforeMs: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
export declare const ListParams: z.ZodDefault<z.ZodObject<{
|
|
29
|
+
owner: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
project: z.ZodOptional<z.ZodString>;
|
|
31
|
+
session: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
32
|
+
instance: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
33
|
+
}, z.core.$strip>>;
|
|
34
|
+
includeExited: z.ZodDefault<z.ZodBoolean>;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
export declare const IdParams: z.ZodObject<{
|
|
37
|
+
id: z.ZodString;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
export declare const LogLine: z.ZodObject<{
|
|
40
|
+
n: z.ZodNumber;
|
|
41
|
+
text: z.ZodString;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export declare const ReadParams: z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
after: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
tail: z.ZodDefault<z.ZodNumber>;
|
|
47
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
48
|
+
grep: z.ZodOptional<z.ZodString>;
|
|
49
|
+
ignoreCase: z.ZodDefault<z.ZodBoolean>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export declare const ReadResult: z.ZodObject<{
|
|
52
|
+
lines: z.ZodArray<z.ZodObject<{
|
|
53
|
+
n: z.ZodNumber;
|
|
54
|
+
text: z.ZodString;
|
|
55
|
+
}, z.core.$strip>>;
|
|
56
|
+
firstLine: z.ZodNumber;
|
|
57
|
+
lastLine: z.ZodNumber;
|
|
58
|
+
nextCursor: z.ZodNumber;
|
|
59
|
+
truncated: z.ZodBoolean;
|
|
60
|
+
hasMore: z.ZodBoolean;
|
|
61
|
+
status: z.ZodEnum<{
|
|
62
|
+
exited: "exited";
|
|
63
|
+
failed: "failed";
|
|
64
|
+
killed: "killed";
|
|
65
|
+
running: "running";
|
|
66
|
+
}>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
/** A run of characters sharing one style, so a UI can repaint colour without parsing escapes. */
|
|
69
|
+
export declare const ScreenRun: z.ZodObject<{
|
|
70
|
+
text: z.ZodString;
|
|
71
|
+
fg: z.ZodOptional<z.ZodString>;
|
|
72
|
+
bg: z.ZodOptional<z.ZodString>;
|
|
73
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
dim: z.ZodOptional<z.ZodBoolean>;
|
|
75
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
export declare const ScreenResult: z.ZodObject<{
|
|
79
|
+
text: z.ZodString;
|
|
80
|
+
cols: z.ZodNumber;
|
|
81
|
+
rows: z.ZodNumber;
|
|
82
|
+
cursor: z.ZodObject<{
|
|
83
|
+
x: z.ZodNumber;
|
|
84
|
+
y: z.ZodNumber;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
styled: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
87
|
+
text: z.ZodString;
|
|
88
|
+
fg: z.ZodOptional<z.ZodString>;
|
|
89
|
+
bg: z.ZodOptional<z.ZodString>;
|
|
90
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
91
|
+
dim: z.ZodOptional<z.ZodBoolean>;
|
|
92
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
93
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
94
|
+
}, z.core.$strip>>>>;
|
|
95
|
+
}, z.core.$strip>;
|
|
96
|
+
export declare const WriteParams: z.ZodObject<{
|
|
97
|
+
id: z.ZodString;
|
|
98
|
+
data: z.ZodString;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
export declare const ResizeParams: z.ZodObject<{
|
|
101
|
+
id: z.ZodString;
|
|
102
|
+
cols: z.ZodNumber;
|
|
103
|
+
rows: z.ZodNumber;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
export declare const WaitUntil: z.ZodObject<{
|
|
106
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
107
|
+
ignoreCase: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
+
exit: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
idleMs: z.ZodOptional<z.ZodNumber>;
|
|
110
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
host: z.ZodOptional<z.ZodString>;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
export declare const WaitParams: z.ZodObject<{
|
|
114
|
+
id: z.ZodString;
|
|
115
|
+
until: z.ZodObject<{
|
|
116
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
117
|
+
ignoreCase: z.ZodOptional<z.ZodBoolean>;
|
|
118
|
+
exit: z.ZodOptional<z.ZodBoolean>;
|
|
119
|
+
idleMs: z.ZodOptional<z.ZodNumber>;
|
|
120
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
121
|
+
host: z.ZodOptional<z.ZodString>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
timeoutMs: z.ZodNumber;
|
|
124
|
+
after: z.ZodOptional<z.ZodNumber>;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
export declare const WaitReason: z.ZodEnum<{
|
|
127
|
+
exit: "exit";
|
|
128
|
+
idle: "idle";
|
|
129
|
+
pattern: "pattern";
|
|
130
|
+
port: "port";
|
|
131
|
+
timeout: "timeout";
|
|
132
|
+
}>;
|
|
133
|
+
export declare const WaitResult: z.ZodObject<{
|
|
134
|
+
reason: z.ZodEnum<{
|
|
135
|
+
exit: "exit";
|
|
136
|
+
idle: "idle";
|
|
137
|
+
pattern: "pattern";
|
|
138
|
+
port: "port";
|
|
139
|
+
timeout: "timeout";
|
|
140
|
+
}>;
|
|
141
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
142
|
+
n: z.ZodNumber;
|
|
143
|
+
text: z.ZodString;
|
|
144
|
+
}, z.core.$strip>>;
|
|
145
|
+
info: z.ZodObject<{
|
|
146
|
+
id: z.ZodString;
|
|
147
|
+
title: z.ZodString;
|
|
148
|
+
command: z.ZodString;
|
|
149
|
+
args: z.ZodArray<z.ZodString>;
|
|
150
|
+
cwd: z.ZodString;
|
|
151
|
+
owner: z.ZodObject<{
|
|
152
|
+
project: z.ZodString;
|
|
153
|
+
session: z.ZodOptional<z.ZodString>;
|
|
154
|
+
instance: z.ZodOptional<z.ZodString>;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
status: z.ZodEnum<{
|
|
157
|
+
exited: "exited";
|
|
158
|
+
failed: "failed";
|
|
159
|
+
killed: "killed";
|
|
160
|
+
running: "running";
|
|
161
|
+
}>;
|
|
162
|
+
run: z.ZodNumber;
|
|
163
|
+
pid: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
exitCode: z.ZodOptional<z.ZodNumber>;
|
|
165
|
+
signal: z.ZodOptional<z.ZodString>;
|
|
166
|
+
error: z.ZodOptional<z.ZodString>;
|
|
167
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
168
|
+
startedAt: z.ZodNumber;
|
|
169
|
+
endedAt: z.ZodOptional<z.ZodNumber>;
|
|
170
|
+
cols: z.ZodNumber;
|
|
171
|
+
rows: z.ZodNumber;
|
|
172
|
+
lines: z.ZodObject<{
|
|
173
|
+
first: z.ZodNumber;
|
|
174
|
+
last: z.ZodNumber;
|
|
175
|
+
}, z.core.$strip>;
|
|
176
|
+
bytes: z.ZodNumber;
|
|
177
|
+
watch: z.ZodOptional<z.ZodObject<{
|
|
178
|
+
preset: z.ZodOptional<z.ZodString>;
|
|
179
|
+
status: z.ZodEnum<{
|
|
180
|
+
fail: "fail";
|
|
181
|
+
ok: "ok";
|
|
182
|
+
pending: "pending";
|
|
183
|
+
unknown: "unknown";
|
|
184
|
+
}>;
|
|
185
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
186
|
+
runs: z.ZodNumber;
|
|
187
|
+
since: z.ZodNumber;
|
|
188
|
+
}, z.core.$strip>>;
|
|
189
|
+
logFile: z.ZodOptional<z.ZodString>;
|
|
190
|
+
}, z.core.$strip>;
|
|
191
|
+
}, z.core.$strip>;
|
|
192
|
+
export declare const StopParams: z.ZodObject<{
|
|
193
|
+
id: z.ZodString;
|
|
194
|
+
signal: z.ZodDefault<z.ZodEnum<{
|
|
195
|
+
SIGHUP: "SIGHUP";
|
|
196
|
+
SIGINT: "SIGINT";
|
|
197
|
+
SIGKILL: "SIGKILL";
|
|
198
|
+
SIGTERM: "SIGTERM";
|
|
199
|
+
}>>;
|
|
200
|
+
graceMs: z.ZodDefault<z.ZodNumber>;
|
|
201
|
+
}, z.core.$strip>;
|
|
202
|
+
export declare const AttachParams: z.ZodObject<{
|
|
203
|
+
id: z.ZodString;
|
|
204
|
+
fromOffset: z.ZodOptional<z.ZodNumber>;
|
|
205
|
+
}, z.core.$strip>;
|
|
206
|
+
export type StartParams = z.output<typeof StartParams>;
|
|
207
|
+
export type ReadParams = z.output<typeof ReadParams>;
|
|
208
|
+
export type ReadResult = z.output<typeof ReadResult>;
|
|
209
|
+
export type ScreenResult = z.output<typeof ScreenResult>;
|
|
210
|
+
export type ScreenRun = z.output<typeof ScreenRun>;
|
|
211
|
+
export type WaitParams = z.output<typeof WaitParams>;
|
|
212
|
+
export type WaitResult = z.output<typeof WaitResult>;
|
|
213
|
+
export type WaitReason = z.output<typeof WaitReason>;
|
|
214
|
+
export type StopParams = z.output<typeof StopParams>;
|
|
215
|
+
export type LogLine = z.output<typeof LogLine>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* A watch rule is three regexes over a shell's log, not a parser: `done` marks the end of a run
|
|
4
|
+
* (a compile, a test pass), `fail` and `ok` say how it went. Presets are just named rules, so a
|
|
5
|
+
* new tool is a table entry or a rule in the caller's config — never new code.
|
|
6
|
+
*/
|
|
7
|
+
export declare const WatchRule: z.ZodObject<{
|
|
8
|
+
done: z.ZodOptional<z.ZodString>;
|
|
9
|
+
fail: z.ZodOptional<z.ZodString>;
|
|
10
|
+
ok: z.ZodOptional<z.ZodString>;
|
|
11
|
+
ignoreCase: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
idleSeconds: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const WatchStatus: z.ZodEnum<{
|
|
15
|
+
fail: "fail";
|
|
16
|
+
ok: "ok";
|
|
17
|
+
pending: "pending";
|
|
18
|
+
unknown: "unknown";
|
|
19
|
+
}>;
|
|
20
|
+
export declare const WatchState: z.ZodObject<{
|
|
21
|
+
preset: z.ZodOptional<z.ZodString>;
|
|
22
|
+
status: z.ZodEnum<{
|
|
23
|
+
fail: "fail";
|
|
24
|
+
ok: "ok";
|
|
25
|
+
pending: "pending";
|
|
26
|
+
unknown: "unknown";
|
|
27
|
+
}>;
|
|
28
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
29
|
+
runs: z.ZodNumber;
|
|
30
|
+
since: z.ZodNumber;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export declare const WatchParams: z.ZodObject<{
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
preset: z.ZodOptional<z.ZodString>;
|
|
35
|
+
rule: z.ZodOptional<z.ZodObject<{
|
|
36
|
+
done: z.ZodOptional<z.ZodString>;
|
|
37
|
+
fail: z.ZodOptional<z.ZodString>;
|
|
38
|
+
ok: z.ZodOptional<z.ZodString>;
|
|
39
|
+
ignoreCase: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
idleSeconds: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
}, z.core.$strip>>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export type WatchRule = z.output<typeof WatchRule>;
|
|
44
|
+
export type WatchState = z.output<typeof WatchState>;
|
|
45
|
+
export type WatchStatus = z.output<typeof WatchStatus>;
|
|
46
|
+
export type WatchParams = z.output<typeof WatchParams>;
|