@kya-os/contracts 1.7.26 → 1.7.32

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.
Files changed (44) hide show
  1. package/dist/agent-deployment-utils.d.ts +20 -0
  2. package/dist/agent-deployment-utils.js +37 -0
  3. package/dist/agent-deployment.d.ts +19 -19
  4. package/dist/agent-deployment.js +2 -1
  5. package/dist/agentshield-api/admin-schemas.d.ts +2 -2
  6. package/dist/agentshield-api/schemas.d.ts +462 -462
  7. package/dist/audit/index.d.ts +24 -24
  8. package/dist/cli.d.ts +44 -44
  9. package/dist/compute-binding.d.ts +6 -6
  10. package/dist/compute.d.ts +27 -8
  11. package/dist/compute.js +6 -0
  12. package/dist/config/identity.d.ts +98 -98
  13. package/dist/consent/schemas.d.ts +72 -72
  14. package/dist/dashboard-config/schemas.d.ts +2191 -2191
  15. package/dist/delegation/constraints.d.ts +32 -32
  16. package/dist/delegation/schemas.d.ts +610 -610
  17. package/dist/deploy/schemas.d.ts +84 -84
  18. package/dist/gateway/index.d.ts +579 -0
  19. package/dist/gateway/index.js +103 -0
  20. package/dist/handshake.d.ts +42 -42
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.js +2 -0
  23. package/dist/molti/admin-ws.d.ts +116 -116
  24. package/dist/molti/schemas.d.ts +98 -98
  25. package/dist/openclaw/index.d.ts +20 -0
  26. package/dist/openclaw/index.js +28 -0
  27. package/dist/openclaw/types.d.ts +714 -0
  28. package/dist/openclaw/types.js +122 -0
  29. package/dist/pairing/index.d.ts +44 -0
  30. package/dist/pairing/index.js +11 -0
  31. package/dist/policy/schemas.d.ts +553 -553
  32. package/dist/proof/proof-record.d.ts +48 -48
  33. package/dist/proof/signing-spec.d.ts +8 -8
  34. package/dist/proof.d.ts +68 -68
  35. package/dist/registry.d.ts +24 -24
  36. package/dist/reputation/api.d.ts +156 -156
  37. package/dist/reputation/credentials.d.ts +48 -48
  38. package/dist/reputation/schemas.d.ts +48 -48
  39. package/dist/test.d.ts +22 -22
  40. package/dist/tlkrc/rotation.d.ts +12 -12
  41. package/dist/tool-protection/index.d.ts +22 -22
  42. package/dist/verifier.d.ts +17 -17
  43. package/dist/well-known/index.d.ts +72 -72
  44. package/package.json +10 -2
@@ -0,0 +1,579 @@
1
+ /**
2
+ * OpenClaw Gateway RPC Response Types
3
+ *
4
+ * Zod schemas and inferred types for responses from OpenClaw gateway
5
+ * WebSocket methods (skills.status, sessions.list, cron.list, agents.list,
6
+ * usage.cost).
7
+ *
8
+ * Source of truth for both xmcp-i compute and AgentShield dashboard.
9
+ *
10
+ * @module contracts/gateway
11
+ */
12
+ import { z } from "zod";
13
+ export declare const skillRequirementsSchema: z.ZodObject<{
14
+ bins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
15
+ envs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
16
+ configs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
17
+ os: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ bins?: string[] | undefined;
20
+ envs?: string[] | undefined;
21
+ configs?: string[] | undefined;
22
+ os?: string[] | undefined;
23
+ }, {
24
+ bins?: string[] | undefined;
25
+ envs?: string[] | undefined;
26
+ configs?: string[] | undefined;
27
+ os?: string[] | undefined;
28
+ }>;
29
+ export type SkillRequirements = z.infer<typeof skillRequirementsSchema>;
30
+ export declare const skillConfigCheckSchema: z.ZodObject<{
31
+ path: z.ZodString;
32
+ label: z.ZodOptional<z.ZodString>;
33
+ satisfied: z.ZodBoolean;
34
+ }, "strip", z.ZodTypeAny, {
35
+ path: string;
36
+ satisfied: boolean;
37
+ label?: string | undefined;
38
+ }, {
39
+ path: string;
40
+ satisfied: boolean;
41
+ label?: string | undefined;
42
+ }>;
43
+ export type SkillConfigCheck = z.infer<typeof skillConfigCheckSchema>;
44
+ export declare const skillInstallOptionSchema: z.ZodObject<{
45
+ id: z.ZodString;
46
+ kind: z.ZodEnum<["brew", "node", "go", "uv", "download"]>;
47
+ label: z.ZodString;
48
+ bins: z.ZodArray<z.ZodString, "many">;
49
+ }, "strip", z.ZodTypeAny, {
50
+ bins: string[];
51
+ label: string;
52
+ id: string;
53
+ kind: "brew" | "node" | "go" | "uv" | "download";
54
+ }, {
55
+ bins: string[];
56
+ label: string;
57
+ id: string;
58
+ kind: "brew" | "node" | "go" | "uv" | "download";
59
+ }>;
60
+ export type SkillInstallOption = z.infer<typeof skillInstallOptionSchema>;
61
+ export declare const skillStatusEntrySchema: z.ZodObject<{
62
+ name: z.ZodString;
63
+ description: z.ZodString;
64
+ source: z.ZodString;
65
+ bundled: z.ZodBoolean;
66
+ filePath: z.ZodString;
67
+ baseDir: z.ZodString;
68
+ skillKey: z.ZodString;
69
+ primaryEnv: z.ZodOptional<z.ZodString>;
70
+ emoji: z.ZodOptional<z.ZodString>;
71
+ homepage: z.ZodOptional<z.ZodString>;
72
+ always: z.ZodBoolean;
73
+ disabled: z.ZodBoolean;
74
+ blockedByAllowlist: z.ZodBoolean;
75
+ eligible: z.ZodBoolean;
76
+ requirements: z.ZodObject<{
77
+ bins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
78
+ envs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
79
+ configs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
80
+ os: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
81
+ }, "strip", z.ZodTypeAny, {
82
+ bins?: string[] | undefined;
83
+ envs?: string[] | undefined;
84
+ configs?: string[] | undefined;
85
+ os?: string[] | undefined;
86
+ }, {
87
+ bins?: string[] | undefined;
88
+ envs?: string[] | undefined;
89
+ configs?: string[] | undefined;
90
+ os?: string[] | undefined;
91
+ }>;
92
+ missing: z.ZodObject<{
93
+ bins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
94
+ envs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
95
+ configs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
96
+ os: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
97
+ }, "strip", z.ZodTypeAny, {
98
+ bins?: string[] | undefined;
99
+ envs?: string[] | undefined;
100
+ configs?: string[] | undefined;
101
+ os?: string[] | undefined;
102
+ }, {
103
+ bins?: string[] | undefined;
104
+ envs?: string[] | undefined;
105
+ configs?: string[] | undefined;
106
+ os?: string[] | undefined;
107
+ }>;
108
+ configChecks: z.ZodArray<z.ZodObject<{
109
+ path: z.ZodString;
110
+ label: z.ZodOptional<z.ZodString>;
111
+ satisfied: z.ZodBoolean;
112
+ }, "strip", z.ZodTypeAny, {
113
+ path: string;
114
+ satisfied: boolean;
115
+ label?: string | undefined;
116
+ }, {
117
+ path: string;
118
+ satisfied: boolean;
119
+ label?: string | undefined;
120
+ }>, "many">;
121
+ install: z.ZodArray<z.ZodObject<{
122
+ id: z.ZodString;
123
+ kind: z.ZodEnum<["brew", "node", "go", "uv", "download"]>;
124
+ label: z.ZodString;
125
+ bins: z.ZodArray<z.ZodString, "many">;
126
+ }, "strip", z.ZodTypeAny, {
127
+ bins: string[];
128
+ label: string;
129
+ id: string;
130
+ kind: "brew" | "node" | "go" | "uv" | "download";
131
+ }, {
132
+ bins: string[];
133
+ label: string;
134
+ id: string;
135
+ kind: "brew" | "node" | "go" | "uv" | "download";
136
+ }>, "many">;
137
+ }, "strip", z.ZodTypeAny, {
138
+ disabled: boolean;
139
+ name: string;
140
+ description: string;
141
+ source: string;
142
+ bundled: boolean;
143
+ filePath: string;
144
+ baseDir: string;
145
+ skillKey: string;
146
+ always: boolean;
147
+ blockedByAllowlist: boolean;
148
+ eligible: boolean;
149
+ requirements: {
150
+ bins?: string[] | undefined;
151
+ envs?: string[] | undefined;
152
+ configs?: string[] | undefined;
153
+ os?: string[] | undefined;
154
+ };
155
+ missing: {
156
+ bins?: string[] | undefined;
157
+ envs?: string[] | undefined;
158
+ configs?: string[] | undefined;
159
+ os?: string[] | undefined;
160
+ };
161
+ configChecks: {
162
+ path: string;
163
+ satisfied: boolean;
164
+ label?: string | undefined;
165
+ }[];
166
+ install: {
167
+ bins: string[];
168
+ label: string;
169
+ id: string;
170
+ kind: "brew" | "node" | "go" | "uv" | "download";
171
+ }[];
172
+ primaryEnv?: string | undefined;
173
+ emoji?: string | undefined;
174
+ homepage?: string | undefined;
175
+ }, {
176
+ disabled: boolean;
177
+ name: string;
178
+ description: string;
179
+ source: string;
180
+ bundled: boolean;
181
+ filePath: string;
182
+ baseDir: string;
183
+ skillKey: string;
184
+ always: boolean;
185
+ blockedByAllowlist: boolean;
186
+ eligible: boolean;
187
+ requirements: {
188
+ bins?: string[] | undefined;
189
+ envs?: string[] | undefined;
190
+ configs?: string[] | undefined;
191
+ os?: string[] | undefined;
192
+ };
193
+ missing: {
194
+ bins?: string[] | undefined;
195
+ envs?: string[] | undefined;
196
+ configs?: string[] | undefined;
197
+ os?: string[] | undefined;
198
+ };
199
+ configChecks: {
200
+ path: string;
201
+ satisfied: boolean;
202
+ label?: string | undefined;
203
+ }[];
204
+ install: {
205
+ bins: string[];
206
+ label: string;
207
+ id: string;
208
+ kind: "brew" | "node" | "go" | "uv" | "download";
209
+ }[];
210
+ primaryEnv?: string | undefined;
211
+ emoji?: string | undefined;
212
+ homepage?: string | undefined;
213
+ }>;
214
+ export type SkillStatusEntry = z.infer<typeof skillStatusEntrySchema>;
215
+ export declare const skillStatusReportSchema: z.ZodObject<{
216
+ workspaceDir: z.ZodString;
217
+ managedSkillsDir: z.ZodString;
218
+ skills: z.ZodArray<z.ZodObject<{
219
+ name: z.ZodString;
220
+ description: z.ZodString;
221
+ source: z.ZodString;
222
+ bundled: z.ZodBoolean;
223
+ filePath: z.ZodString;
224
+ baseDir: z.ZodString;
225
+ skillKey: z.ZodString;
226
+ primaryEnv: z.ZodOptional<z.ZodString>;
227
+ emoji: z.ZodOptional<z.ZodString>;
228
+ homepage: z.ZodOptional<z.ZodString>;
229
+ always: z.ZodBoolean;
230
+ disabled: z.ZodBoolean;
231
+ blockedByAllowlist: z.ZodBoolean;
232
+ eligible: z.ZodBoolean;
233
+ requirements: z.ZodObject<{
234
+ bins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
235
+ envs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
236
+ configs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
237
+ os: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
238
+ }, "strip", z.ZodTypeAny, {
239
+ bins?: string[] | undefined;
240
+ envs?: string[] | undefined;
241
+ configs?: string[] | undefined;
242
+ os?: string[] | undefined;
243
+ }, {
244
+ bins?: string[] | undefined;
245
+ envs?: string[] | undefined;
246
+ configs?: string[] | undefined;
247
+ os?: string[] | undefined;
248
+ }>;
249
+ missing: z.ZodObject<{
250
+ bins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
251
+ envs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
252
+ configs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
253
+ os: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
254
+ }, "strip", z.ZodTypeAny, {
255
+ bins?: string[] | undefined;
256
+ envs?: string[] | undefined;
257
+ configs?: string[] | undefined;
258
+ os?: string[] | undefined;
259
+ }, {
260
+ bins?: string[] | undefined;
261
+ envs?: string[] | undefined;
262
+ configs?: string[] | undefined;
263
+ os?: string[] | undefined;
264
+ }>;
265
+ configChecks: z.ZodArray<z.ZodObject<{
266
+ path: z.ZodString;
267
+ label: z.ZodOptional<z.ZodString>;
268
+ satisfied: z.ZodBoolean;
269
+ }, "strip", z.ZodTypeAny, {
270
+ path: string;
271
+ satisfied: boolean;
272
+ label?: string | undefined;
273
+ }, {
274
+ path: string;
275
+ satisfied: boolean;
276
+ label?: string | undefined;
277
+ }>, "many">;
278
+ install: z.ZodArray<z.ZodObject<{
279
+ id: z.ZodString;
280
+ kind: z.ZodEnum<["brew", "node", "go", "uv", "download"]>;
281
+ label: z.ZodString;
282
+ bins: z.ZodArray<z.ZodString, "many">;
283
+ }, "strip", z.ZodTypeAny, {
284
+ bins: string[];
285
+ label: string;
286
+ id: string;
287
+ kind: "brew" | "node" | "go" | "uv" | "download";
288
+ }, {
289
+ bins: string[];
290
+ label: string;
291
+ id: string;
292
+ kind: "brew" | "node" | "go" | "uv" | "download";
293
+ }>, "many">;
294
+ }, "strip", z.ZodTypeAny, {
295
+ disabled: boolean;
296
+ name: string;
297
+ description: string;
298
+ source: string;
299
+ bundled: boolean;
300
+ filePath: string;
301
+ baseDir: string;
302
+ skillKey: string;
303
+ always: boolean;
304
+ blockedByAllowlist: boolean;
305
+ eligible: boolean;
306
+ requirements: {
307
+ bins?: string[] | undefined;
308
+ envs?: string[] | undefined;
309
+ configs?: string[] | undefined;
310
+ os?: string[] | undefined;
311
+ };
312
+ missing: {
313
+ bins?: string[] | undefined;
314
+ envs?: string[] | undefined;
315
+ configs?: string[] | undefined;
316
+ os?: string[] | undefined;
317
+ };
318
+ configChecks: {
319
+ path: string;
320
+ satisfied: boolean;
321
+ label?: string | undefined;
322
+ }[];
323
+ install: {
324
+ bins: string[];
325
+ label: string;
326
+ id: string;
327
+ kind: "brew" | "node" | "go" | "uv" | "download";
328
+ }[];
329
+ primaryEnv?: string | undefined;
330
+ emoji?: string | undefined;
331
+ homepage?: string | undefined;
332
+ }, {
333
+ disabled: boolean;
334
+ name: string;
335
+ description: string;
336
+ source: string;
337
+ bundled: boolean;
338
+ filePath: string;
339
+ baseDir: string;
340
+ skillKey: string;
341
+ always: boolean;
342
+ blockedByAllowlist: boolean;
343
+ eligible: boolean;
344
+ requirements: {
345
+ bins?: string[] | undefined;
346
+ envs?: string[] | undefined;
347
+ configs?: string[] | undefined;
348
+ os?: string[] | undefined;
349
+ };
350
+ missing: {
351
+ bins?: string[] | undefined;
352
+ envs?: string[] | undefined;
353
+ configs?: string[] | undefined;
354
+ os?: string[] | undefined;
355
+ };
356
+ configChecks: {
357
+ path: string;
358
+ satisfied: boolean;
359
+ label?: string | undefined;
360
+ }[];
361
+ install: {
362
+ bins: string[];
363
+ label: string;
364
+ id: string;
365
+ kind: "brew" | "node" | "go" | "uv" | "download";
366
+ }[];
367
+ primaryEnv?: string | undefined;
368
+ emoji?: string | undefined;
369
+ homepage?: string | undefined;
370
+ }>, "many">;
371
+ }, "strip", z.ZodTypeAny, {
372
+ workspaceDir: string;
373
+ managedSkillsDir: string;
374
+ skills: {
375
+ disabled: boolean;
376
+ name: string;
377
+ description: string;
378
+ source: string;
379
+ bundled: boolean;
380
+ filePath: string;
381
+ baseDir: string;
382
+ skillKey: string;
383
+ always: boolean;
384
+ blockedByAllowlist: boolean;
385
+ eligible: boolean;
386
+ requirements: {
387
+ bins?: string[] | undefined;
388
+ envs?: string[] | undefined;
389
+ configs?: string[] | undefined;
390
+ os?: string[] | undefined;
391
+ };
392
+ missing: {
393
+ bins?: string[] | undefined;
394
+ envs?: string[] | undefined;
395
+ configs?: string[] | undefined;
396
+ os?: string[] | undefined;
397
+ };
398
+ configChecks: {
399
+ path: string;
400
+ satisfied: boolean;
401
+ label?: string | undefined;
402
+ }[];
403
+ install: {
404
+ bins: string[];
405
+ label: string;
406
+ id: string;
407
+ kind: "brew" | "node" | "go" | "uv" | "download";
408
+ }[];
409
+ primaryEnv?: string | undefined;
410
+ emoji?: string | undefined;
411
+ homepage?: string | undefined;
412
+ }[];
413
+ }, {
414
+ workspaceDir: string;
415
+ managedSkillsDir: string;
416
+ skills: {
417
+ disabled: boolean;
418
+ name: string;
419
+ description: string;
420
+ source: string;
421
+ bundled: boolean;
422
+ filePath: string;
423
+ baseDir: string;
424
+ skillKey: string;
425
+ always: boolean;
426
+ blockedByAllowlist: boolean;
427
+ eligible: boolean;
428
+ requirements: {
429
+ bins?: string[] | undefined;
430
+ envs?: string[] | undefined;
431
+ configs?: string[] | undefined;
432
+ os?: string[] | undefined;
433
+ };
434
+ missing: {
435
+ bins?: string[] | undefined;
436
+ envs?: string[] | undefined;
437
+ configs?: string[] | undefined;
438
+ os?: string[] | undefined;
439
+ };
440
+ configChecks: {
441
+ path: string;
442
+ satisfied: boolean;
443
+ label?: string | undefined;
444
+ }[];
445
+ install: {
446
+ bins: string[];
447
+ label: string;
448
+ id: string;
449
+ kind: "brew" | "node" | "go" | "uv" | "download";
450
+ }[];
451
+ primaryEnv?: string | undefined;
452
+ emoji?: string | undefined;
453
+ homepage?: string | undefined;
454
+ }[];
455
+ }>;
456
+ export type SkillStatusReport = z.infer<typeof skillStatusReportSchema>;
457
+ export declare const sessionEntrySchema: z.ZodObject<{
458
+ key: z.ZodString;
459
+ agentId: z.ZodOptional<z.ZodString>;
460
+ label: z.ZodOptional<z.ZodString>;
461
+ channel: z.ZodOptional<z.ZodString>;
462
+ kind: z.ZodOptional<z.ZodString>;
463
+ createdAt: z.ZodOptional<z.ZodNumber>;
464
+ updatedAt: z.ZodOptional<z.ZodNumber>;
465
+ messageCount: z.ZodOptional<z.ZodNumber>;
466
+ }, "strip", z.ZodTypeAny, {
467
+ key: string;
468
+ label?: string | undefined;
469
+ kind?: string | undefined;
470
+ agentId?: string | undefined;
471
+ channel?: string | undefined;
472
+ createdAt?: number | undefined;
473
+ updatedAt?: number | undefined;
474
+ messageCount?: number | undefined;
475
+ }, {
476
+ key: string;
477
+ label?: string | undefined;
478
+ kind?: string | undefined;
479
+ agentId?: string | undefined;
480
+ channel?: string | undefined;
481
+ createdAt?: number | undefined;
482
+ updatedAt?: number | undefined;
483
+ messageCount?: number | undefined;
484
+ }>;
485
+ export type SessionEntry = z.infer<typeof sessionEntrySchema>;
486
+ export declare const cronJobSchema: z.ZodObject<{
487
+ name: z.ZodString;
488
+ schedule: z.ZodOptional<z.ZodString>;
489
+ enabled: z.ZodBoolean;
490
+ lastRunAt: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
491
+ nextRunAt: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
492
+ lastStatus: z.ZodNullable<z.ZodOptional<z.ZodString>>;
493
+ agentId: z.ZodOptional<z.ZodString>;
494
+ model: z.ZodNullable<z.ZodOptional<z.ZodString>>;
495
+ task: z.ZodOptional<z.ZodString>;
496
+ }, "strip", z.ZodTypeAny, {
497
+ name: string;
498
+ enabled: boolean;
499
+ agentId?: string | undefined;
500
+ schedule?: string | undefined;
501
+ lastRunAt?: number | null | undefined;
502
+ nextRunAt?: number | null | undefined;
503
+ lastStatus?: string | null | undefined;
504
+ model?: string | null | undefined;
505
+ task?: string | undefined;
506
+ }, {
507
+ name: string;
508
+ enabled: boolean;
509
+ agentId?: string | undefined;
510
+ schedule?: string | undefined;
511
+ lastRunAt?: number | null | undefined;
512
+ nextRunAt?: number | null | undefined;
513
+ lastStatus?: string | null | undefined;
514
+ model?: string | null | undefined;
515
+ task?: string | undefined;
516
+ }>;
517
+ export type CronJob = z.infer<typeof cronJobSchema>;
518
+ export declare const agentEntrySchema: z.ZodObject<{
519
+ id: z.ZodString;
520
+ name: z.ZodOptional<z.ZodString>;
521
+ model: z.ZodOptional<z.ZodString>;
522
+ defaultModel: z.ZodOptional<z.ZodString>;
523
+ persona: z.ZodOptional<z.ZodString>;
524
+ }, "strip", z.ZodTypeAny, {
525
+ id: string;
526
+ name?: string | undefined;
527
+ model?: string | undefined;
528
+ defaultModel?: string | undefined;
529
+ persona?: string | undefined;
530
+ }, {
531
+ id: string;
532
+ name?: string | undefined;
533
+ model?: string | undefined;
534
+ defaultModel?: string | undefined;
535
+ persona?: string | undefined;
536
+ }>;
537
+ export type AgentEntry = z.infer<typeof agentEntrySchema>;
538
+ export declare const usageCostSchema: z.ZodObject<{
539
+ totalCostUsd: z.ZodOptional<z.ZodNumber>;
540
+ periodStart: z.ZodOptional<z.ZodString>;
541
+ periodEnd: z.ZodOptional<z.ZodString>;
542
+ byModel: z.ZodOptional<z.ZodArray<z.ZodObject<{
543
+ model: z.ZodString;
544
+ inputTokens: z.ZodNumber;
545
+ outputTokens: z.ZodNumber;
546
+ costUsd: z.ZodNumber;
547
+ }, "strip", z.ZodTypeAny, {
548
+ model: string;
549
+ inputTokens: number;
550
+ outputTokens: number;
551
+ costUsd: number;
552
+ }, {
553
+ model: string;
554
+ inputTokens: number;
555
+ outputTokens: number;
556
+ costUsd: number;
557
+ }>, "many">>;
558
+ }, "strip", z.ZodTypeAny, {
559
+ totalCostUsd?: number | undefined;
560
+ periodStart?: string | undefined;
561
+ periodEnd?: string | undefined;
562
+ byModel?: {
563
+ model: string;
564
+ inputTokens: number;
565
+ outputTokens: number;
566
+ costUsd: number;
567
+ }[] | undefined;
568
+ }, {
569
+ totalCostUsd?: number | undefined;
570
+ periodStart?: string | undefined;
571
+ periodEnd?: string | undefined;
572
+ byModel?: {
573
+ model: string;
574
+ inputTokens: number;
575
+ outputTokens: number;
576
+ costUsd: number;
577
+ }[] | undefined;
578
+ }>;
579
+ export type UsageCost = z.infer<typeof usageCostSchema>;
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ /**
3
+ * OpenClaw Gateway RPC Response Types
4
+ *
5
+ * Zod schemas and inferred types for responses from OpenClaw gateway
6
+ * WebSocket methods (skills.status, sessions.list, cron.list, agents.list,
7
+ * usage.cost).
8
+ *
9
+ * Source of truth for both xmcp-i compute and AgentShield dashboard.
10
+ *
11
+ * @module contracts/gateway
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.usageCostSchema = exports.agentEntrySchema = exports.cronJobSchema = exports.sessionEntrySchema = exports.skillStatusReportSchema = exports.skillStatusEntrySchema = exports.skillInstallOptionSchema = exports.skillConfigCheckSchema = exports.skillRequirementsSchema = void 0;
15
+ const zod_1 = require("zod");
16
+ // ── skills.status ──
17
+ exports.skillRequirementsSchema = zod_1.z.object({
18
+ bins: zod_1.z.array(zod_1.z.string()).optional(),
19
+ envs: zod_1.z.array(zod_1.z.string()).optional(),
20
+ configs: zod_1.z.array(zod_1.z.string()).optional(),
21
+ os: zod_1.z.array(zod_1.z.string()).optional(),
22
+ });
23
+ exports.skillConfigCheckSchema = zod_1.z.object({
24
+ path: zod_1.z.string(),
25
+ label: zod_1.z.string().optional(),
26
+ satisfied: zod_1.z.boolean(),
27
+ });
28
+ exports.skillInstallOptionSchema = zod_1.z.object({
29
+ id: zod_1.z.string(),
30
+ kind: zod_1.z.enum(["brew", "node", "go", "uv", "download"]),
31
+ label: zod_1.z.string(),
32
+ bins: zod_1.z.array(zod_1.z.string()),
33
+ });
34
+ exports.skillStatusEntrySchema = zod_1.z.object({
35
+ name: zod_1.z.string(),
36
+ description: zod_1.z.string(),
37
+ source: zod_1.z.string(),
38
+ bundled: zod_1.z.boolean(),
39
+ filePath: zod_1.z.string(),
40
+ baseDir: zod_1.z.string(),
41
+ skillKey: zod_1.z.string(),
42
+ primaryEnv: zod_1.z.string().optional(),
43
+ emoji: zod_1.z.string().optional(),
44
+ homepage: zod_1.z.string().optional(),
45
+ always: zod_1.z.boolean(),
46
+ disabled: zod_1.z.boolean(),
47
+ blockedByAllowlist: zod_1.z.boolean(),
48
+ eligible: zod_1.z.boolean(),
49
+ requirements: exports.skillRequirementsSchema,
50
+ missing: exports.skillRequirementsSchema,
51
+ configChecks: zod_1.z.array(exports.skillConfigCheckSchema),
52
+ install: zod_1.z.array(exports.skillInstallOptionSchema),
53
+ });
54
+ exports.skillStatusReportSchema = zod_1.z.object({
55
+ workspaceDir: zod_1.z.string(),
56
+ managedSkillsDir: zod_1.z.string(),
57
+ skills: zod_1.z.array(exports.skillStatusEntrySchema),
58
+ });
59
+ // ── sessions.list ──
60
+ exports.sessionEntrySchema = zod_1.z.object({
61
+ key: zod_1.z.string(),
62
+ agentId: zod_1.z.string().optional(),
63
+ label: zod_1.z.string().optional(),
64
+ channel: zod_1.z.string().optional(),
65
+ kind: zod_1.z.string().optional(),
66
+ createdAt: zod_1.z.number().optional(),
67
+ updatedAt: zod_1.z.number().optional(),
68
+ messageCount: zod_1.z.number().optional(),
69
+ });
70
+ // ── cron.list ──
71
+ exports.cronJobSchema = zod_1.z.object({
72
+ name: zod_1.z.string(),
73
+ schedule: zod_1.z.string().optional(),
74
+ enabled: zod_1.z.boolean(),
75
+ lastRunAt: zod_1.z.number().optional().nullable(),
76
+ nextRunAt: zod_1.z.number().optional().nullable(),
77
+ lastStatus: zod_1.z.string().optional().nullable(),
78
+ agentId: zod_1.z.string().optional(),
79
+ model: zod_1.z.string().optional().nullable(),
80
+ task: zod_1.z.string().optional(),
81
+ });
82
+ // ── agents.list ──
83
+ exports.agentEntrySchema = zod_1.z.object({
84
+ id: zod_1.z.string(),
85
+ name: zod_1.z.string().optional(),
86
+ model: zod_1.z.string().optional(),
87
+ defaultModel: zod_1.z.string().optional(),
88
+ persona: zod_1.z.string().optional(),
89
+ });
90
+ // ── usage.cost ──
91
+ exports.usageCostSchema = zod_1.z.object({
92
+ totalCostUsd: zod_1.z.number().optional(),
93
+ periodStart: zod_1.z.string().optional(),
94
+ periodEnd: zod_1.z.string().optional(),
95
+ byModel: zod_1.z
96
+ .array(zod_1.z.object({
97
+ model: zod_1.z.string(),
98
+ inputTokens: zod_1.z.number(),
99
+ outputTokens: zod_1.z.number(),
100
+ costUsd: zod_1.z.number(),
101
+ }))
102
+ .optional(),
103
+ });