everything-dev 0.2.1 → 0.3.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/package.json +80 -79
- package/src/cli.ts +1491 -1198
- package/src/components/monitor-view.tsx +423 -419
- package/src/config.ts +529 -241
- package/src/contract.ts +381 -364
- package/src/lib/env.ts +83 -65
- package/src/lib/nova.ts +207 -195
- package/src/lib/orchestrator.ts +232 -199
- package/src/lib/process-registry.ts +141 -132
- package/src/lib/process.ts +499 -409
- package/src/lib/resource-monitor/diff.ts +27 -9
- package/src/lib/resource-monitor/platform/darwin.ts +31 -18
- package/src/lib/resource-monitor/snapshot.ts +164 -151
- package/src/plugin.ts +2281 -1841
- package/src/types.ts +182 -83
- package/src/ui/head.ts +37 -26
- package/src/utils/banner.ts +7 -9
- package/src/utils/run.ts +27 -16
- package/src/lib/secrets.ts +0 -29
package/src/contract.ts
CHANGED
|
@@ -1,552 +1,569 @@
|
|
|
1
1
|
import { oc } from "every-plugin/orpc";
|
|
2
2
|
import { z } from "every-plugin/zod";
|
|
3
|
-
import {
|
|
4
|
-
BosConfigSchema,
|
|
5
|
-
SourceModeSchema,
|
|
6
|
-
} from "./types";
|
|
3
|
+
import { BosConfigSchema, SourceModeSchema } from "./types";
|
|
7
4
|
|
|
8
5
|
const DevOptionsSchema = z.object({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
host: SourceModeSchema.default("local"),
|
|
7
|
+
ui: SourceModeSchema.default("local"),
|
|
8
|
+
api: SourceModeSchema.default("local"),
|
|
9
|
+
proxy: z.boolean().default(false),
|
|
10
|
+
port: z.number().optional(),
|
|
11
|
+
interactive: z.boolean().optional(),
|
|
15
12
|
});
|
|
16
13
|
|
|
17
14
|
const DevResultSchema = z.object({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
status: z.enum(["started", "error"]),
|
|
16
|
+
description: z.string(),
|
|
17
|
+
processes: z.array(z.string()),
|
|
21
18
|
});
|
|
22
19
|
|
|
23
20
|
const StartOptionsSchema = z.object({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
port: z.number().optional(),
|
|
22
|
+
interactive: z.boolean().optional(),
|
|
23
|
+
account: z.string().optional(),
|
|
24
|
+
domain: z.string().optional(),
|
|
25
|
+
network: z.enum(["mainnet", "testnet"]).default("mainnet"),
|
|
29
26
|
});
|
|
30
27
|
|
|
31
28
|
const StartResultSchema = z.object({
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
status: z.enum(["running", "error"]),
|
|
30
|
+
url: z.string(),
|
|
34
31
|
});
|
|
35
32
|
|
|
36
33
|
const ServeOptionsSchema = z.object({
|
|
37
|
-
|
|
34
|
+
port: z.number().default(4000),
|
|
38
35
|
});
|
|
39
36
|
|
|
40
37
|
const ServeResultSchema = z.object({
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
status: z.enum(["serving", "error"]),
|
|
39
|
+
url: z.string(),
|
|
40
|
+
endpoints: z.object({
|
|
41
|
+
rpc: z.string(),
|
|
42
|
+
docs: z.string(),
|
|
43
|
+
}),
|
|
47
44
|
});
|
|
48
45
|
|
|
49
46
|
const BuildOptionsSchema = z.object({
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
packages: z.string().default("all"),
|
|
48
|
+
force: z.boolean().default(false),
|
|
49
|
+
deploy: z.boolean().default(false),
|
|
53
50
|
});
|
|
54
51
|
|
|
55
52
|
const BuildResultSchema = z.object({
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
status: z.enum(["success", "error"]),
|
|
54
|
+
built: z.array(z.string()),
|
|
55
|
+
deployed: z.boolean().optional(),
|
|
59
56
|
});
|
|
60
57
|
|
|
61
58
|
const SigningMethodSchema = z.enum([
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
"keychain",
|
|
60
|
+
"ledger",
|
|
61
|
+
"seed-phrase",
|
|
62
|
+
"access-key-file",
|
|
63
|
+
"private-key",
|
|
67
64
|
]);
|
|
68
65
|
|
|
69
66
|
const PublishOptionsSchema = z.object({
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
signWith: SigningMethodSchema.optional(),
|
|
68
|
+
network: z.enum(["mainnet", "testnet"]).default("mainnet"),
|
|
69
|
+
path: z.string().default("bos.config.json"),
|
|
70
|
+
dryRun: z.boolean().default(false),
|
|
74
71
|
});
|
|
75
72
|
|
|
76
73
|
const PublishResultSchema = z.object({
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
status: z.enum(["published", "error", "dry-run"]),
|
|
75
|
+
txHash: z.string(),
|
|
76
|
+
registryUrl: z.string(),
|
|
77
|
+
error: z.string().optional(),
|
|
81
78
|
});
|
|
82
79
|
|
|
83
80
|
const CreateOptionsSchema = z.object({
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
type: z.enum(["project", "ui", "api", "host", "cli", "gateway"]),
|
|
82
|
+
name: z.string().optional(),
|
|
83
|
+
// New fields - all optional, if provided skip prompts:
|
|
84
|
+
account: z
|
|
85
|
+
.string()
|
|
86
|
+
.optional()
|
|
87
|
+
.describe("NEAR mainnet account (e.g., myname.near)"),
|
|
88
|
+
testnet: z.string().optional().describe("NEAR testnet account (optional)"),
|
|
89
|
+
template: z
|
|
90
|
+
.string()
|
|
91
|
+
.optional()
|
|
92
|
+
.describe("Template BOS URL (default: bos://every.near/everything.dev)"),
|
|
93
|
+
includeHost: z
|
|
94
|
+
.boolean()
|
|
95
|
+
.optional()
|
|
96
|
+
.describe("Include host package locally (default: false)"),
|
|
97
|
+
includeGateway: z
|
|
98
|
+
.boolean()
|
|
99
|
+
.optional()
|
|
100
|
+
.describe("Include gateway package locally (default: false)"),
|
|
87
101
|
});
|
|
88
102
|
|
|
89
103
|
const CreateResultSchema = z.object({
|
|
90
|
-
|
|
91
|
-
|
|
104
|
+
status: z.enum(["created", "error"]),
|
|
105
|
+
path: z.string(),
|
|
106
|
+
error: z.string().optional(),
|
|
92
107
|
});
|
|
93
108
|
|
|
94
109
|
const InfoResultSchema = z.object({
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
110
|
+
config: BosConfigSchema,
|
|
111
|
+
packages: z.array(z.string()),
|
|
112
|
+
remotes: z.array(z.string()),
|
|
98
113
|
});
|
|
99
114
|
|
|
100
115
|
const EndpointStatusSchema = z.object({
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
116
|
+
name: z.string(),
|
|
117
|
+
url: z.string(),
|
|
118
|
+
type: z.enum(["host", "remote", "ssr"]),
|
|
119
|
+
healthy: z.boolean(),
|
|
120
|
+
latency: z.number().optional(),
|
|
106
121
|
});
|
|
107
122
|
|
|
108
123
|
const StatusOptionsSchema = z.object({
|
|
109
|
-
|
|
124
|
+
env: z.enum(["development", "production"]).default("development"),
|
|
110
125
|
});
|
|
111
126
|
|
|
112
127
|
const StatusResultSchema = z.object({
|
|
113
|
-
|
|
128
|
+
endpoints: z.array(EndpointStatusSchema),
|
|
114
129
|
});
|
|
115
130
|
|
|
116
131
|
const CleanResultSchema = z.object({
|
|
117
|
-
|
|
118
|
-
|
|
132
|
+
status: z.enum(["cleaned", "error"]),
|
|
133
|
+
removed: z.array(z.string()),
|
|
119
134
|
});
|
|
120
135
|
|
|
121
136
|
const RegisterOptionsSchema = z.object({
|
|
122
|
-
|
|
123
|
-
|
|
137
|
+
name: z.string(),
|
|
138
|
+
network: z.enum(["mainnet", "testnet"]).default("mainnet"),
|
|
124
139
|
});
|
|
125
140
|
|
|
126
141
|
const RegisterResultSchema = z.object({
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
142
|
+
status: z.enum(["registered", "error"]),
|
|
143
|
+
account: z.string(),
|
|
144
|
+
novaGroup: z.string().optional(),
|
|
145
|
+
error: z.string().optional(),
|
|
131
146
|
});
|
|
132
147
|
|
|
133
148
|
const SecretsSyncOptionsSchema = z.object({
|
|
134
|
-
|
|
149
|
+
envPath: z.string(),
|
|
135
150
|
});
|
|
136
151
|
|
|
137
152
|
const SecretsSyncResultSchema = z.object({
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
153
|
+
status: z.enum(["synced", "error"]),
|
|
154
|
+
count: z.number(),
|
|
155
|
+
cid: z.string().optional(),
|
|
156
|
+
error: z.string().optional(),
|
|
142
157
|
});
|
|
143
158
|
|
|
144
159
|
const SecretsSetOptionsSchema = z.object({
|
|
145
|
-
|
|
146
|
-
|
|
160
|
+
key: z.string(),
|
|
161
|
+
value: z.string(),
|
|
147
162
|
});
|
|
148
163
|
|
|
149
164
|
const SecretsSetResultSchema = z.object({
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
165
|
+
status: z.enum(["set", "error"]),
|
|
166
|
+
cid: z.string().optional(),
|
|
167
|
+
error: z.string().optional(),
|
|
153
168
|
});
|
|
154
169
|
|
|
155
170
|
const SecretsListResultSchema = z.object({
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
171
|
+
status: z.enum(["listed", "error"]),
|
|
172
|
+
keys: z.array(z.string()),
|
|
173
|
+
error: z.string().optional(),
|
|
159
174
|
});
|
|
160
175
|
|
|
161
176
|
const SecretsDeleteOptionsSchema = z.object({
|
|
162
|
-
|
|
177
|
+
key: z.string(),
|
|
163
178
|
});
|
|
164
179
|
|
|
165
180
|
const SecretsDeleteResultSchema = z.object({
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
181
|
+
status: z.enum(["deleted", "error"]),
|
|
182
|
+
cid: z.string().optional(),
|
|
183
|
+
error: z.string().optional(),
|
|
169
184
|
});
|
|
170
185
|
|
|
171
186
|
const LoginOptionsSchema = z.object({
|
|
172
|
-
|
|
173
|
-
|
|
187
|
+
token: z.string().optional(),
|
|
188
|
+
accountId: z.string().optional(),
|
|
174
189
|
});
|
|
175
190
|
|
|
176
191
|
const LoginResultSchema = z.object({
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
192
|
+
status: z.enum(["logged-in", "error"]),
|
|
193
|
+
accountId: z.string().optional(),
|
|
194
|
+
error: z.string().optional(),
|
|
180
195
|
});
|
|
181
196
|
|
|
182
197
|
const LogoutResultSchema = z.object({
|
|
183
|
-
|
|
184
|
-
|
|
198
|
+
status: z.enum(["logged-out", "error"]),
|
|
199
|
+
error: z.string().optional(),
|
|
185
200
|
});
|
|
186
201
|
|
|
187
202
|
const GatewayDevOptionsSchema = z.object({});
|
|
188
203
|
|
|
189
204
|
const GatewayDevResultSchema = z.object({
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
205
|
+
status: z.enum(["started", "error"]),
|
|
206
|
+
url: z.string(),
|
|
207
|
+
error: z.string().optional(),
|
|
193
208
|
});
|
|
194
209
|
|
|
195
210
|
const GatewayDeployOptionsSchema = z.object({
|
|
196
|
-
|
|
211
|
+
env: z.enum(["production", "staging"]).optional(),
|
|
197
212
|
});
|
|
198
213
|
|
|
199
214
|
const GatewayDeployResultSchema = z.object({
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
215
|
+
status: z.enum(["deployed", "error"]),
|
|
216
|
+
url: z.string(),
|
|
217
|
+
error: z.string().optional(),
|
|
203
218
|
});
|
|
204
219
|
|
|
205
220
|
const GatewaySyncOptionsSchema = z.object({});
|
|
206
221
|
|
|
207
222
|
const GatewaySyncResultSchema = z.object({
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
223
|
+
status: z.enum(["synced", "error"]),
|
|
224
|
+
gatewayDomain: z.string().optional(),
|
|
225
|
+
gatewayAccount: z.string().optional(),
|
|
226
|
+
error: z.string().optional(),
|
|
212
227
|
});
|
|
213
228
|
|
|
214
229
|
const UpdateOptionsSchema = z.object({
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
230
|
+
account: z.string().optional(),
|
|
231
|
+
gateway: z.string().optional(),
|
|
232
|
+
network: z.enum(["mainnet", "testnet"]).default("mainnet"),
|
|
233
|
+
force: z.boolean().optional(),
|
|
219
234
|
});
|
|
220
235
|
|
|
221
236
|
const UpdateResultSchema = z.object({
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
237
|
+
status: z.enum(["updated", "error"]),
|
|
238
|
+
account: z.string(),
|
|
239
|
+
gateway: z.string(),
|
|
240
|
+
socialUrl: z.string().optional(),
|
|
241
|
+
hostUrl: z.string(),
|
|
242
|
+
catalogUpdated: z.boolean(),
|
|
243
|
+
packagesUpdated: z.array(z.string()),
|
|
244
|
+
filesSynced: z
|
|
245
|
+
.array(
|
|
246
|
+
z.object({
|
|
247
|
+
package: z.string(),
|
|
248
|
+
files: z.array(z.string()),
|
|
249
|
+
}),
|
|
250
|
+
)
|
|
251
|
+
.optional(),
|
|
252
|
+
error: z.string().optional(),
|
|
234
253
|
});
|
|
235
254
|
|
|
236
255
|
const FilesSyncOptionsSchema = z.object({
|
|
237
|
-
|
|
238
|
-
|
|
256
|
+
packages: z.array(z.string()).optional(),
|
|
257
|
+
force: z.boolean().optional(),
|
|
239
258
|
});
|
|
240
259
|
|
|
241
260
|
const FilesSyncResultSchema = z.object({
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
261
|
+
status: z.enum(["synced", "error"]),
|
|
262
|
+
synced: z.array(
|
|
263
|
+
z.object({
|
|
264
|
+
package: z.string(),
|
|
265
|
+
files: z.array(z.string()),
|
|
266
|
+
depsAdded: z.array(z.string()).optional(),
|
|
267
|
+
depsUpdated: z.array(z.string()).optional(),
|
|
268
|
+
}),
|
|
269
|
+
),
|
|
270
|
+
error: z.string().optional(),
|
|
250
271
|
});
|
|
251
272
|
|
|
252
273
|
const KillOptionsSchema = z.object({
|
|
253
|
-
|
|
274
|
+
force: z.boolean().default(false),
|
|
254
275
|
});
|
|
255
276
|
|
|
256
277
|
const KillResultSchema = z.object({
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
278
|
+
status: z.enum(["killed", "error"]),
|
|
279
|
+
killed: z.array(z.number()),
|
|
280
|
+
failed: z.array(z.number()),
|
|
281
|
+
error: z.string().optional(),
|
|
261
282
|
});
|
|
262
283
|
|
|
263
284
|
const ProcessStatusSchema = z.object({
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
285
|
+
pid: z.number(),
|
|
286
|
+
name: z.string(),
|
|
287
|
+
port: z.number(),
|
|
288
|
+
startedAt: z.number(),
|
|
289
|
+
command: z.string(),
|
|
269
290
|
});
|
|
270
291
|
|
|
271
292
|
const PsResultSchema = z.object({
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
293
|
+
status: z.enum(["listed", "error"]),
|
|
294
|
+
processes: z.array(ProcessStatusSchema),
|
|
295
|
+
error: z.string().optional(),
|
|
275
296
|
});
|
|
276
297
|
|
|
277
298
|
const DockerBuildOptionsSchema = z.object({
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
299
|
+
target: z.enum(["production", "development"]).default("production"),
|
|
300
|
+
tag: z.string().optional(),
|
|
301
|
+
noCache: z.boolean().default(false),
|
|
281
302
|
});
|
|
282
303
|
|
|
283
304
|
const DockerBuildResultSchema = z.object({
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
305
|
+
status: z.enum(["built", "error"]),
|
|
306
|
+
image: z.string(),
|
|
307
|
+
tag: z.string(),
|
|
308
|
+
error: z.string().optional(),
|
|
288
309
|
});
|
|
289
310
|
|
|
290
311
|
const DockerRunOptionsSchema = z.object({
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
312
|
+
target: z.enum(["production", "development"]).default("production"),
|
|
313
|
+
mode: z.enum(["start", "serve", "dev"]).default("start"),
|
|
314
|
+
port: z.number().optional(),
|
|
315
|
+
detach: z.boolean().default(false),
|
|
316
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
296
317
|
});
|
|
297
318
|
|
|
298
319
|
const DockerRunResultSchema = z.object({
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
320
|
+
status: z.enum(["running", "error"]),
|
|
321
|
+
containerId: z.string(),
|
|
322
|
+
url: z.string(),
|
|
323
|
+
error: z.string().optional(),
|
|
303
324
|
});
|
|
304
325
|
|
|
305
326
|
const DockerStopOptionsSchema = z.object({
|
|
306
|
-
|
|
307
|
-
|
|
327
|
+
containerId: z.string().optional(),
|
|
328
|
+
all: z.boolean().default(false),
|
|
308
329
|
});
|
|
309
330
|
|
|
310
331
|
const DockerStopResultSchema = z.object({
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
332
|
+
status: z.enum(["stopped", "error"]),
|
|
333
|
+
stopped: z.array(z.string()),
|
|
334
|
+
error: z.string().optional(),
|
|
314
335
|
});
|
|
315
336
|
|
|
316
337
|
const MonitorOptionsSchema = z.object({
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
338
|
+
ports: z.array(z.number()).optional(),
|
|
339
|
+
json: z.boolean().default(false),
|
|
340
|
+
watch: z.boolean().default(false),
|
|
320
341
|
});
|
|
321
342
|
|
|
322
343
|
const PortInfoSchema = z.object({
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
344
|
+
port: z.number(),
|
|
345
|
+
pid: z.number().nullable(),
|
|
346
|
+
command: z.string().nullable(),
|
|
347
|
+
state: z.enum(["LISTEN", "ESTABLISHED", "TIME_WAIT", "FREE"]),
|
|
348
|
+
name: z.string().optional(),
|
|
328
349
|
});
|
|
329
350
|
|
|
330
351
|
const ProcessInfoSchema = z.object({
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
352
|
+
pid: z.number(),
|
|
353
|
+
ppid: z.number(),
|
|
354
|
+
command: z.string(),
|
|
355
|
+
args: z.array(z.string()),
|
|
356
|
+
rss: z.number(),
|
|
357
|
+
children: z.array(z.number()),
|
|
358
|
+
startTime: z.number().optional(),
|
|
338
359
|
});
|
|
339
360
|
|
|
340
361
|
const MemoryInfoSchema = z.object({
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
362
|
+
total: z.number(),
|
|
363
|
+
used: z.number(),
|
|
364
|
+
free: z.number(),
|
|
365
|
+
processRss: z.number(),
|
|
345
366
|
});
|
|
346
367
|
|
|
347
368
|
const SnapshotSchema = z.object({
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
369
|
+
timestamp: z.number(),
|
|
370
|
+
configPath: z.string().nullable(),
|
|
371
|
+
ports: z.record(z.string(), PortInfoSchema),
|
|
372
|
+
processes: z.array(ProcessInfoSchema),
|
|
373
|
+
memory: MemoryInfoSchema,
|
|
374
|
+
platform: z.string(),
|
|
354
375
|
});
|
|
355
376
|
|
|
356
377
|
const MonitorResultSchema = z.object({
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
378
|
+
status: z.enum(["snapshot", "watching", "error"]),
|
|
379
|
+
snapshot: SnapshotSchema.optional(),
|
|
380
|
+
error: z.string().optional(),
|
|
360
381
|
});
|
|
361
382
|
|
|
362
383
|
const SessionOptionsSchema = z.object({
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
384
|
+
headless: z.boolean().default(true),
|
|
385
|
+
timeout: z.number().default(120000),
|
|
386
|
+
output: z.string().default("./session-report.json"),
|
|
387
|
+
format: z.enum(["json", "html"]).default("json"),
|
|
388
|
+
flow: z.enum(["login", "navigation", "custom"]).default("login"),
|
|
389
|
+
routes: z.array(z.string()).optional(),
|
|
390
|
+
snapshotInterval: z.number().default(2000),
|
|
370
391
|
});
|
|
371
392
|
|
|
372
393
|
const SessionSummarySchema = z.object({
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
394
|
+
totalMemoryDeltaMb: z.number(),
|
|
395
|
+
peakMemoryMb: z.number(),
|
|
396
|
+
averageMemoryMb: z.number(),
|
|
397
|
+
processesSpawned: z.number(),
|
|
398
|
+
processesKilled: z.number(),
|
|
399
|
+
orphanedProcesses: z.number(),
|
|
400
|
+
portsUsed: z.array(z.number()),
|
|
401
|
+
portsLeaked: z.number(),
|
|
402
|
+
hasLeaks: z.boolean(),
|
|
403
|
+
eventCount: z.number(),
|
|
404
|
+
duration: z.number(),
|
|
384
405
|
});
|
|
385
406
|
|
|
386
407
|
const SessionResultSchema = z.object({
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
408
|
+
status: z.enum(["completed", "leaks_detected", "error", "timeout"]),
|
|
409
|
+
sessionId: z.string().optional(),
|
|
410
|
+
reportPath: z.string().optional(),
|
|
411
|
+
summary: SessionSummarySchema.optional(),
|
|
412
|
+
error: z.string().optional(),
|
|
392
413
|
});
|
|
393
414
|
|
|
394
415
|
const DepsUpdateOptionsSchema = z.object({
|
|
395
|
-
|
|
396
|
-
|
|
416
|
+
category: z.enum(["ui", "api"]).default("ui"),
|
|
417
|
+
packages: z.array(z.string()).optional(),
|
|
397
418
|
});
|
|
398
419
|
|
|
399
420
|
const DepsUpdateResultSchema = z.object({
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
421
|
+
status: z.enum(["updated", "cancelled", "error"]),
|
|
422
|
+
updated: z.array(
|
|
423
|
+
z.object({
|
|
424
|
+
name: z.string(),
|
|
425
|
+
from: z.string(),
|
|
426
|
+
to: z.string(),
|
|
427
|
+
}),
|
|
428
|
+
),
|
|
429
|
+
syncStatus: z.enum(["synced", "skipped", "error"]).optional(),
|
|
430
|
+
error: z.string().optional(),
|
|
408
431
|
});
|
|
409
432
|
|
|
410
433
|
export const bosContract = oc.router({
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
.output(MonitorResultSchema),
|
|
545
|
-
|
|
546
|
-
session: oc
|
|
547
|
-
.route({ method: "POST", path: "/session" })
|
|
548
|
-
.input(SessionOptionsSchema)
|
|
549
|
-
.output(SessionResultSchema),
|
|
434
|
+
dev: oc
|
|
435
|
+
.route({ method: "POST", path: "/dev" })
|
|
436
|
+
.input(DevOptionsSchema)
|
|
437
|
+
.output(DevResultSchema),
|
|
438
|
+
|
|
439
|
+
start: oc
|
|
440
|
+
.route({ method: "POST", path: "/start" })
|
|
441
|
+
.input(StartOptionsSchema)
|
|
442
|
+
.output(StartResultSchema),
|
|
443
|
+
|
|
444
|
+
serve: oc
|
|
445
|
+
.route({ method: "POST", path: "/serve" })
|
|
446
|
+
.input(ServeOptionsSchema)
|
|
447
|
+
.output(ServeResultSchema),
|
|
448
|
+
|
|
449
|
+
build: oc
|
|
450
|
+
.route({ method: "POST", path: "/build" })
|
|
451
|
+
.input(BuildOptionsSchema)
|
|
452
|
+
.output(BuildResultSchema),
|
|
453
|
+
|
|
454
|
+
publish: oc
|
|
455
|
+
.route({ method: "POST", path: "/publish" })
|
|
456
|
+
.input(PublishOptionsSchema)
|
|
457
|
+
.output(PublishResultSchema),
|
|
458
|
+
|
|
459
|
+
create: oc
|
|
460
|
+
.route({ method: "POST", path: "/create" })
|
|
461
|
+
.input(CreateOptionsSchema)
|
|
462
|
+
.output(CreateResultSchema),
|
|
463
|
+
|
|
464
|
+
info: oc.route({ method: "GET", path: "/info" }).output(InfoResultSchema),
|
|
465
|
+
|
|
466
|
+
status: oc
|
|
467
|
+
.route({ method: "GET", path: "/status" })
|
|
468
|
+
.input(StatusOptionsSchema)
|
|
469
|
+
.output(StatusResultSchema),
|
|
470
|
+
|
|
471
|
+
clean: oc.route({ method: "POST", path: "/clean" }).output(CleanResultSchema),
|
|
472
|
+
|
|
473
|
+
register: oc
|
|
474
|
+
.route({ method: "POST", path: "/register" })
|
|
475
|
+
.input(RegisterOptionsSchema)
|
|
476
|
+
.output(RegisterResultSchema),
|
|
477
|
+
|
|
478
|
+
secretsSync: oc
|
|
479
|
+
.route({ method: "POST", path: "/secrets/sync" })
|
|
480
|
+
.input(SecretsSyncOptionsSchema)
|
|
481
|
+
.output(SecretsSyncResultSchema),
|
|
482
|
+
|
|
483
|
+
secretsSet: oc
|
|
484
|
+
.route({ method: "POST", path: "/secrets/set" })
|
|
485
|
+
.input(SecretsSetOptionsSchema)
|
|
486
|
+
.output(SecretsSetResultSchema),
|
|
487
|
+
|
|
488
|
+
secretsList: oc
|
|
489
|
+
.route({ method: "GET", path: "/secrets/list" })
|
|
490
|
+
.output(SecretsListResultSchema),
|
|
491
|
+
|
|
492
|
+
secretsDelete: oc
|
|
493
|
+
.route({ method: "POST", path: "/secrets/delete" })
|
|
494
|
+
.input(SecretsDeleteOptionsSchema)
|
|
495
|
+
.output(SecretsDeleteResultSchema),
|
|
496
|
+
|
|
497
|
+
login: oc
|
|
498
|
+
.route({ method: "POST", path: "/login" })
|
|
499
|
+
.input(LoginOptionsSchema)
|
|
500
|
+
.output(LoginResultSchema),
|
|
501
|
+
|
|
502
|
+
logout: oc
|
|
503
|
+
.route({ method: "POST", path: "/logout" })
|
|
504
|
+
.output(LogoutResultSchema),
|
|
505
|
+
|
|
506
|
+
gatewayDev: oc
|
|
507
|
+
.route({ method: "POST", path: "/gateway/dev" })
|
|
508
|
+
.input(GatewayDevOptionsSchema)
|
|
509
|
+
.output(GatewayDevResultSchema),
|
|
510
|
+
|
|
511
|
+
gatewayDeploy: oc
|
|
512
|
+
.route({ method: "POST", path: "/gateway/deploy" })
|
|
513
|
+
.input(GatewayDeployOptionsSchema)
|
|
514
|
+
.output(GatewayDeployResultSchema),
|
|
515
|
+
|
|
516
|
+
gatewaySync: oc
|
|
517
|
+
.route({ method: "POST", path: "/gateway/sync" })
|
|
518
|
+
.input(GatewaySyncOptionsSchema)
|
|
519
|
+
.output(GatewaySyncResultSchema),
|
|
520
|
+
|
|
521
|
+
update: oc
|
|
522
|
+
.route({ method: "POST", path: "/update" })
|
|
523
|
+
.input(UpdateOptionsSchema)
|
|
524
|
+
.output(UpdateResultSchema),
|
|
525
|
+
|
|
526
|
+
depsUpdate: oc
|
|
527
|
+
.route({ method: "POST", path: "/deps/update" })
|
|
528
|
+
.input(DepsUpdateOptionsSchema)
|
|
529
|
+
.output(DepsUpdateResultSchema),
|
|
530
|
+
|
|
531
|
+
filesSync: oc
|
|
532
|
+
.route({ method: "POST", path: "/files/sync" })
|
|
533
|
+
.input(FilesSyncOptionsSchema)
|
|
534
|
+
.output(FilesSyncResultSchema),
|
|
535
|
+
|
|
536
|
+
kill: oc
|
|
537
|
+
.route({ method: "POST", path: "/kill" })
|
|
538
|
+
.input(KillOptionsSchema)
|
|
539
|
+
.output(KillResultSchema),
|
|
540
|
+
|
|
541
|
+
ps: oc.route({ method: "GET", path: "/ps" }).output(PsResultSchema),
|
|
542
|
+
|
|
543
|
+
dockerBuild: oc
|
|
544
|
+
.route({ method: "POST", path: "/docker/build" })
|
|
545
|
+
.input(DockerBuildOptionsSchema)
|
|
546
|
+
.output(DockerBuildResultSchema),
|
|
547
|
+
|
|
548
|
+
dockerRun: oc
|
|
549
|
+
.route({ method: "POST", path: "/docker/run" })
|
|
550
|
+
.input(DockerRunOptionsSchema)
|
|
551
|
+
.output(DockerRunResultSchema),
|
|
552
|
+
|
|
553
|
+
dockerStop: oc
|
|
554
|
+
.route({ method: "POST", path: "/docker/stop" })
|
|
555
|
+
.input(DockerStopOptionsSchema)
|
|
556
|
+
.output(DockerStopResultSchema),
|
|
557
|
+
|
|
558
|
+
monitor: oc
|
|
559
|
+
.route({ method: "GET", path: "/monitor" })
|
|
560
|
+
.input(MonitorOptionsSchema)
|
|
561
|
+
.output(MonitorResultSchema),
|
|
562
|
+
|
|
563
|
+
session: oc
|
|
564
|
+
.route({ method: "POST", path: "/session" })
|
|
565
|
+
.input(SessionOptionsSchema)
|
|
566
|
+
.output(SessionResultSchema),
|
|
550
567
|
});
|
|
551
568
|
|
|
552
569
|
export type BosContract = typeof bosContract;
|