@myagentroam/protocol 0.1.8 → 0.9.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.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  export * from './enterprise.js';
3
3
  export * from './skill.js';
4
+ export * from './mcp.js';
4
5
  export declare const healthStatusSchema: z.ZodObject<{
5
6
  status: z.ZodLiteral<"ok">;
6
7
  }, "strip", z.ZodTypeAny, {
@@ -23,6 +24,26 @@ export declare const runnerAvailabilitySchema: z.ZodObject<{
23
24
  available: boolean;
24
25
  version?: string | undefined;
25
26
  }>;
27
+ export declare const runtimeCommandSchema: z.ZodObject<{
28
+ id: z.ZodEnum<["npx", "git", "python", "pip"]>;
29
+ command: z.ZodString;
30
+ available: z.ZodBoolean;
31
+ version: z.ZodOptional<z.ZodString>;
32
+ path: z.ZodOptional<z.ZodString>;
33
+ }, "strict", z.ZodTypeAny, {
34
+ id: "npx" | "git" | "python" | "pip";
35
+ command: string;
36
+ available: boolean;
37
+ path?: string | undefined;
38
+ version?: string | undefined;
39
+ }, {
40
+ id: "npx" | "git" | "python" | "pip";
41
+ command: string;
42
+ available: boolean;
43
+ path?: string | undefined;
44
+ version?: string | undefined;
45
+ }>;
46
+ export type RuntimeCommand = z.infer<typeof runtimeCommandSchema>;
26
47
  export declare const nodeUpgradeStatusSchema: z.ZodObject<{
27
48
  state: z.ZodEnum<["IDLE", "WAITING_FOR_RUNS", "READY_TO_RESTART", "FAILED"]>;
28
49
  targetVersion: z.ZodOptional<z.ZodString>;
@@ -80,6 +101,25 @@ export declare const nodeMetadataSchema: z.ZodOptional<z.ZodObject<{
80
101
  available: boolean;
81
102
  version?: string | undefined;
82
103
  }>>>;
104
+ runtimeCommands: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
105
+ id: z.ZodEnum<["npx", "git", "python", "pip"]>;
106
+ command: z.ZodString;
107
+ available: z.ZodBoolean;
108
+ version: z.ZodOptional<z.ZodString>;
109
+ path: z.ZodOptional<z.ZodString>;
110
+ }, "strict", z.ZodTypeAny, {
111
+ id: "npx" | "git" | "python" | "pip";
112
+ command: string;
113
+ available: boolean;
114
+ path?: string | undefined;
115
+ version?: string | undefined;
116
+ }, {
117
+ id: "npx" | "git" | "python" | "pip";
118
+ command: string;
119
+ available: boolean;
120
+ path?: string | undefined;
121
+ version?: string | undefined;
122
+ }>, "many">>>;
83
123
  supervisedUpgrade: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
84
124
  upgrade: z.ZodOptional<z.ZodOptional<z.ZodObject<{
85
125
  state: z.ZodEnum<["IDLE", "WAITING_FOR_RUNS", "READY_TO_RESTART", "FAILED"]>;
@@ -119,6 +159,13 @@ export declare const nodeMetadataSchema: z.ZodOptional<z.ZodObject<{
119
159
  available: boolean;
120
160
  version?: string | undefined;
121
161
  } | undefined;
162
+ runtimeCommands?: {
163
+ id: "npx" | "git" | "python" | "pip";
164
+ command: string;
165
+ available: boolean;
166
+ path?: string | undefined;
167
+ version?: string | undefined;
168
+ }[] | undefined;
122
169
  supervisedUpgrade?: boolean | undefined;
123
170
  upgrade?: {
124
171
  updatedAt: number;
@@ -146,6 +193,13 @@ export declare const nodeMetadataSchema: z.ZodOptional<z.ZodObject<{
146
193
  available: boolean;
147
194
  version?: string | undefined;
148
195
  } | undefined;
196
+ runtimeCommands?: {
197
+ id: "npx" | "git" | "python" | "pip";
198
+ command: string;
199
+ available: boolean;
200
+ path?: string | undefined;
201
+ version?: string | undefined;
202
+ }[] | undefined;
149
203
  supervisedUpgrade?: boolean | undefined;
150
204
  upgrade?: {
151
205
  updatedAt: number;
@@ -197,6 +251,25 @@ export declare const nodeCapabilitiesSchema: z.ZodObject<{
197
251
  available: boolean;
198
252
  version?: string | undefined;
199
253
  }>>>;
254
+ runtimeCommands: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
255
+ id: z.ZodEnum<["npx", "git", "python", "pip"]>;
256
+ command: z.ZodString;
257
+ available: z.ZodBoolean;
258
+ version: z.ZodOptional<z.ZodString>;
259
+ path: z.ZodOptional<z.ZodString>;
260
+ }, "strict", z.ZodTypeAny, {
261
+ id: "npx" | "git" | "python" | "pip";
262
+ command: string;
263
+ available: boolean;
264
+ path?: string | undefined;
265
+ version?: string | undefined;
266
+ }, {
267
+ id: "npx" | "git" | "python" | "pip";
268
+ command: string;
269
+ available: boolean;
270
+ path?: string | undefined;
271
+ version?: string | undefined;
272
+ }>, "many">>>;
200
273
  supervisedUpgrade: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
201
274
  upgrade: z.ZodOptional<z.ZodOptional<z.ZodObject<{
202
275
  state: z.ZodEnum<["IDLE", "WAITING_FOR_RUNS", "READY_TO_RESTART", "FAILED"]>;
@@ -236,6 +309,13 @@ export declare const nodeCapabilitiesSchema: z.ZodObject<{
236
309
  available: boolean;
237
310
  version?: string | undefined;
238
311
  } | undefined;
312
+ runtimeCommands?: {
313
+ id: "npx" | "git" | "python" | "pip";
314
+ command: string;
315
+ available: boolean;
316
+ path?: string | undefined;
317
+ version?: string | undefined;
318
+ }[] | undefined;
239
319
  supervisedUpgrade?: boolean | undefined;
240
320
  upgrade?: {
241
321
  updatedAt: number;
@@ -263,6 +343,13 @@ export declare const nodeCapabilitiesSchema: z.ZodObject<{
263
343
  available: boolean;
264
344
  version?: string | undefined;
265
345
  } | undefined;
346
+ runtimeCommands?: {
347
+ id: "npx" | "git" | "python" | "pip";
348
+ command: string;
349
+ available: boolean;
350
+ path?: string | undefined;
351
+ version?: string | undefined;
352
+ }[] | undefined;
266
353
  supervisedUpgrade?: boolean | undefined;
267
354
  upgrade?: {
268
355
  updatedAt: number;
@@ -333,6 +420,13 @@ export declare const nodeCapabilitiesSchema: z.ZodObject<{
333
420
  available: boolean;
334
421
  version?: string | undefined;
335
422
  } | undefined;
423
+ runtimeCommands?: {
424
+ id: "npx" | "git" | "python" | "pip";
425
+ command: string;
426
+ available: boolean;
427
+ path?: string | undefined;
428
+ version?: string | undefined;
429
+ }[] | undefined;
336
430
  supervisedUpgrade?: boolean | undefined;
337
431
  upgrade?: {
338
432
  updatedAt: number;
@@ -378,6 +472,13 @@ export declare const nodeCapabilitiesSchema: z.ZodObject<{
378
472
  available: boolean;
379
473
  version?: string | undefined;
380
474
  } | undefined;
475
+ runtimeCommands?: {
476
+ id: "npx" | "git" | "python" | "pip";
477
+ command: string;
478
+ available: boolean;
479
+ path?: string | undefined;
480
+ version?: string | undefined;
481
+ }[] | undefined;
381
482
  supervisedUpgrade?: boolean | undefined;
382
483
  upgrade?: {
383
484
  updatedAt: number;
@@ -878,14 +979,20 @@ export declare const runnerProfileSchema: z.ZodObject<{
878
979
  id: z.ZodString;
879
980
  label: z.ZodString;
880
981
  supportedEfforts: z.ZodArray<z.ZodString, "many">;
982
+ isDefault: z.ZodOptional<z.ZodBoolean>;
983
+ defaultEffort: z.ZodOptional<z.ZodString>;
881
984
  }, "strip", z.ZodTypeAny, {
882
985
  id: string;
883
986
  label: string;
884
987
  supportedEfforts: string[];
988
+ isDefault?: boolean | undefined;
989
+ defaultEffort?: string | undefined;
885
990
  }, {
886
991
  id: string;
887
992
  label: string;
888
993
  supportedEfforts: string[];
994
+ isDefault?: boolean | undefined;
995
+ defaultEffort?: string | undefined;
889
996
  }>, "many">;
890
997
  accessOptions: z.ZodArray<z.ZodObject<{
891
998
  id: z.ZodString;
@@ -965,6 +1072,8 @@ export declare const runnerProfileSchema: z.ZodObject<{
965
1072
  id: string;
966
1073
  label: string;
967
1074
  supportedEfforts: string[];
1075
+ isDefault?: boolean | undefined;
1076
+ defaultEffort?: string | undefined;
968
1077
  }[];
969
1078
  accessOptions: {
970
1079
  id: string;
@@ -990,6 +1099,8 @@ export declare const runnerProfileSchema: z.ZodObject<{
990
1099
  id: string;
991
1100
  label: string;
992
1101
  supportedEfforts: string[];
1102
+ isDefault?: boolean | undefined;
1103
+ defaultEffort?: string | undefined;
993
1104
  }[];
994
1105
  accessOptions: {
995
1106
  id: string;
@@ -1118,14 +1229,20 @@ export declare const nodeWorkbenchCapabilitiesSchema: z.ZodObject<{
1118
1229
  id: z.ZodString;
1119
1230
  label: z.ZodString;
1120
1231
  supportedEfforts: z.ZodArray<z.ZodString, "many">;
1232
+ isDefault: z.ZodOptional<z.ZodBoolean>;
1233
+ defaultEffort: z.ZodOptional<z.ZodString>;
1121
1234
  }, "strip", z.ZodTypeAny, {
1122
1235
  id: string;
1123
1236
  label: string;
1124
1237
  supportedEfforts: string[];
1238
+ isDefault?: boolean | undefined;
1239
+ defaultEffort?: string | undefined;
1125
1240
  }, {
1126
1241
  id: string;
1127
1242
  label: string;
1128
1243
  supportedEfforts: string[];
1244
+ isDefault?: boolean | undefined;
1245
+ defaultEffort?: string | undefined;
1129
1246
  }>, "many">;
1130
1247
  accessOptions: z.ZodArray<z.ZodObject<{
1131
1248
  id: z.ZodString;
@@ -1205,6 +1322,8 @@ export declare const nodeWorkbenchCapabilitiesSchema: z.ZodObject<{
1205
1322
  id: string;
1206
1323
  label: string;
1207
1324
  supportedEfforts: string[];
1325
+ isDefault?: boolean | undefined;
1326
+ defaultEffort?: string | undefined;
1208
1327
  }[];
1209
1328
  accessOptions: {
1210
1329
  id: string;
@@ -1230,6 +1349,8 @@ export declare const nodeWorkbenchCapabilitiesSchema: z.ZodObject<{
1230
1349
  id: string;
1231
1350
  label: string;
1232
1351
  supportedEfforts: string[];
1352
+ isDefault?: boolean | undefined;
1353
+ defaultEffort?: string | undefined;
1233
1354
  }[];
1234
1355
  accessOptions: {
1235
1356
  id: string;
@@ -1372,6 +1493,9 @@ export declare const nodeWorkbenchCapabilitiesSchema: z.ZodObject<{
1372
1493
  [x: string]: any;
1373
1494
  }>;
1374
1495
  }, "strip", z.ZodTypeAny, {
1496
+ git: {
1497
+ [x: string]: any;
1498
+ };
1375
1499
  platform: "windows" | "linux";
1376
1500
  architecture: string;
1377
1501
  conversation: {
@@ -1387,6 +1511,8 @@ export declare const nodeWorkbenchCapabilitiesSchema: z.ZodObject<{
1387
1511
  id: string;
1388
1512
  label: string;
1389
1513
  supportedEfforts: string[];
1514
+ isDefault?: boolean | undefined;
1515
+ defaultEffort?: string | undefined;
1390
1516
  }[];
1391
1517
  accessOptions: {
1392
1518
  id: string;
@@ -1409,13 +1535,13 @@ export declare const nodeWorkbenchCapabilitiesSchema: z.ZodObject<{
1409
1535
  files: {
1410
1536
  [x: string]: any;
1411
1537
  };
1412
- git: {
1413
- [x: string]: any;
1414
- };
1415
1538
  terminal: {
1416
1539
  [x: string]: any;
1417
1540
  };
1418
1541
  }, {
1542
+ git: {
1543
+ [x: string]: any;
1544
+ };
1419
1545
  platform: "windows" | "linux";
1420
1546
  architecture: string;
1421
1547
  conversation: {
@@ -1431,6 +1557,8 @@ export declare const nodeWorkbenchCapabilitiesSchema: z.ZodObject<{
1431
1557
  id: string;
1432
1558
  label: string;
1433
1559
  supportedEfforts: string[];
1560
+ isDefault?: boolean | undefined;
1561
+ defaultEffort?: string | undefined;
1434
1562
  }[];
1435
1563
  accessOptions: {
1436
1564
  id: string;
@@ -1453,9 +1581,6 @@ export declare const nodeWorkbenchCapabilitiesSchema: z.ZodObject<{
1453
1581
  files: {
1454
1582
  [x: string]: any;
1455
1583
  };
1456
- git: {
1457
- [x: string]: any;
1458
- };
1459
1584
  terminal: {
1460
1585
  [x: string]: any;
1461
1586
  };
@@ -1950,17 +2075,17 @@ export declare const conversationItemSchema: z.ZodDiscriminatedUnion<"kind", [z.
1950
2075
  durationMs: z.ZodNullable<z.ZodNumber>;
1951
2076
  truncated: z.ZodBoolean;
1952
2077
  }, "strip", z.ZodTypeAny, {
2078
+ command: string;
1953
2079
  durationMs: number | null;
1954
2080
  truncated: boolean;
1955
- command: string;
1956
2081
  cwd: string | null;
1957
2082
  outputPreview: string;
1958
2083
  outputRef: string | null;
1959
2084
  exitCode: number | null;
1960
2085
  }, {
2086
+ command: string;
1961
2087
  durationMs: number | null;
1962
2088
  truncated: boolean;
1963
- command: string;
1964
2089
  cwd: string | null;
1965
2090
  outputPreview: string;
1966
2091
  outputRef: string | null;
@@ -1973,9 +2098,9 @@ export declare const conversationItemSchema: z.ZodDiscriminatedUnion<"kind", [z.
1973
2098
  kind: "command_execution";
1974
2099
  sessionId: string;
1975
2100
  payload: {
2101
+ command: string;
1976
2102
  durationMs: number | null;
1977
2103
  truncated: boolean;
1978
- command: string;
1979
2104
  cwd: string | null;
1980
2105
  outputPreview: string;
1981
2106
  outputRef: string | null;
@@ -1994,9 +2119,9 @@ export declare const conversationItemSchema: z.ZodDiscriminatedUnion<"kind", [z.
1994
2119
  kind: "command_execution";
1995
2120
  sessionId: string;
1996
2121
  payload: {
2122
+ command: string;
1997
2123
  durationMs: number | null;
1998
2124
  truncated: boolean;
1999
- command: string;
2000
2125
  cwd: string | null;
2001
2126
  outputPreview: string;
2002
2127
  outputRef: string | null;
@@ -3056,17 +3181,17 @@ export declare const conversationTurnSchema: z.ZodObject<{
3056
3181
  durationMs: z.ZodNullable<z.ZodNumber>;
3057
3182
  truncated: z.ZodBoolean;
3058
3183
  }, "strip", z.ZodTypeAny, {
3184
+ command: string;
3059
3185
  durationMs: number | null;
3060
3186
  truncated: boolean;
3061
- command: string;
3062
3187
  cwd: string | null;
3063
3188
  outputPreview: string;
3064
3189
  outputRef: string | null;
3065
3190
  exitCode: number | null;
3066
3191
  }, {
3192
+ command: string;
3067
3193
  durationMs: number | null;
3068
3194
  truncated: boolean;
3069
- command: string;
3070
3195
  cwd: string | null;
3071
3196
  outputPreview: string;
3072
3197
  outputRef: string | null;
@@ -3079,9 +3204,9 @@ export declare const conversationTurnSchema: z.ZodObject<{
3079
3204
  kind: "command_execution";
3080
3205
  sessionId: string;
3081
3206
  payload: {
3207
+ command: string;
3082
3208
  durationMs: number | null;
3083
3209
  truncated: boolean;
3084
- command: string;
3085
3210
  cwd: string | null;
3086
3211
  outputPreview: string;
3087
3212
  outputRef: string | null;
@@ -3100,9 +3225,9 @@ export declare const conversationTurnSchema: z.ZodObject<{
3100
3225
  kind: "command_execution";
3101
3226
  sessionId: string;
3102
3227
  payload: {
3228
+ command: string;
3103
3229
  durationMs: number | null;
3104
3230
  truncated: boolean;
3105
- command: string;
3106
3231
  cwd: string | null;
3107
3232
  outputPreview: string;
3108
3233
  outputRef: string | null;
@@ -3858,9 +3983,9 @@ export declare const conversationTurnSchema: z.ZodObject<{
3858
3983
  kind: "command_execution";
3859
3984
  sessionId: string;
3860
3985
  payload: {
3986
+ command: string;
3861
3987
  durationMs: number | null;
3862
3988
  truncated: boolean;
3863
- command: string;
3864
3989
  cwd: string | null;
3865
3990
  outputPreview: string;
3866
3991
  outputRef: string | null;
@@ -4147,9 +4272,9 @@ export declare const conversationTurnSchema: z.ZodObject<{
4147
4272
  kind: "command_execution";
4148
4273
  sessionId: string;
4149
4274
  payload: {
4275
+ command: string;
4150
4276
  durationMs: number | null;
4151
4277
  truncated: boolean;
4152
- command: string;
4153
4278
  cwd: string | null;
4154
4279
  outputPreview: string;
4155
4280
  outputRef: string | null;
@@ -4937,7 +5062,7 @@ export declare const gitHistoryFileSchema: z.ZodObject<{
4937
5062
  previousPath?: string | undefined;
4938
5063
  }>;
4939
5064
  export type GitHistoryFile = z.infer<typeof gitHistoryFileSchema>;
4940
- export declare const workbenchNodeOperationSchema: z.ZodEnum<["node.workbench.capabilities", "runner.usage.status", "runner.usage.read", "workspace.directories.list", "workspace.remove", "workspace.watch", "workspace.unwatch", "session.metadata.update", "session.pin.move", "session.rewind", "session.remove", "session.config.update", "session.turns.list", "session.events.read", "session.context.read", "session.command.execute", "runner.command.execute", "workspace.activity.read", "runner.profiles.list", "runner.defaults.save", "workspace.files.list", "workspace.file.read", "workspace.files.search", "workspace.files.mutate", "workspace.content.search", "workspace.files.upload.preflight", "workspace.files.upload.create", "workspace.files.upload.chunk", "workspace.files.upload.status", "workspace.files.upload.complete", "workspace.files.upload.cancel", "workspace.changes.current", "workspace.change.diff", "workspace.change.restore", "workspace.git.refs.list", "workspace.git.history.list", "workspace.git.commit.files", "workspace.git.commit.file.diff", "run.image.read", "terminal.open", "terminal.list", "terminal.close", "terminal.attach.authorize", "node.upgrade.request", "node.upgrade.cancel", "node.skills.inspect", "node.skills.install", "node.skills.remove", "workspace.skills.inspect", "workspace.skills.install", "workspace.skills.remove", "workspace.skills.git-exclude-repair", "skill.install.job.get"]>;
5065
+ export declare const workbenchNodeOperationSchema: z.ZodEnum<["node.workbench.capabilities", "runner.usage.status", "runner.usage.read", "workspace.directories.list", "workspace.remove", "workspace.watch", "workspace.unwatch", "session.metadata.update", "session.pin.move", "session.rewind", "session.remove", "session.config.update", "session.turns.list", "session.events.read", "session.context.read", "session.command.execute", "runner.command.execute", "workspace.activity.read", "runner.profiles.list", "runner.defaults.save", "workspace.files.list", "workspace.file.read", "workspace.files.search", "workspace.files.mutate", "workspace.content.search", "workspace.files.upload.preflight", "workspace.files.upload.create", "workspace.files.upload.chunk", "workspace.files.upload.status", "workspace.files.upload.complete", "workspace.files.upload.cancel", "workspace.changes.current", "workspace.change.diff", "workspace.change.restore", "workspace.git.refs.list", "workspace.git.history.list", "workspace.git.commit.files", "workspace.git.commit.file.diff", "run.image.read", "terminal.open", "terminal.list", "terminal.close", "terminal.attach.authorize", "node.upgrade.request", "node.upgrade.cancel", "node.skills.inspect", "node.skills.install", "node.skills.remove", "workspace.skills.inspect", "workspace.skills.install", "workspace.skills.remove", "workspace.skills.git-exclude-repair", "skill.install.job.get", "node.mcps.inspect", "node.mcps.install", "node.mcps.remove", "workspace.mcps.inspect", "workspace.mcps.install", "workspace.mcps.remove"]>;
4941
5066
  export type WorkbenchNodeOperation = z.infer<typeof workbenchNodeOperationSchema>;
4942
5067
  /**
4943
5068
  * A small, explicit envelope keeps WebSocket messages independently parseable
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  export * from './enterprise.js';
3
3
  export * from './skill.js';
4
+ export * from './mcp.js';
4
5
  export const healthStatusSchema = z.object({
5
6
  status: z.literal('ok')
6
7
  });
@@ -12,6 +13,15 @@ export const runnerAvailabilitySchema = z.object({
12
13
  available: z.boolean(),
13
14
  version: z.string().optional()
14
15
  });
16
+ export const runtimeCommandSchema = z
17
+ .object({
18
+ id: z.enum(['npx', 'git', 'python', 'pip']),
19
+ command: z.string().trim().min(1).max(128),
20
+ available: z.boolean(),
21
+ version: z.string().trim().min(1).max(512).optional(),
22
+ path: z.string().trim().min(1).max(2048).optional()
23
+ })
24
+ .strict();
15
25
  export const nodeUpgradeStatusSchema = z.object({
16
26
  state: z.enum(['IDLE', 'WAITING_FOR_RUNS', 'READY_TO_RESTART', 'FAILED']),
17
27
  targetVersion: z
@@ -33,6 +43,7 @@ export const nodeMetadataSchema = z
33
43
  codex: runnerAvailabilitySchema.optional(),
34
44
  claudeCode: runnerAvailabilitySchema.optional(),
35
45
  openCode: runnerAvailabilitySchema.optional(),
46
+ runtimeCommands: z.array(runtimeCommandSchema).max(16).optional(),
36
47
  supervisedUpgrade: z.boolean().optional(),
37
48
  upgrade: nodeUpgradeStatusSchema.optional()
38
49
  })
@@ -237,7 +248,9 @@ export const runnerProfileSchema = z.object({
237
248
  models: z.array(z.object({
238
249
  id: z.string().min(1).max(128),
239
250
  label: z.string().min(1).max(128),
240
- supportedEfforts: z.array(z.string().min(1).max(64)).max(32)
251
+ supportedEfforts: z.array(z.string().min(1).max(64)).max(32),
252
+ isDefault: z.boolean().optional(),
253
+ defaultEffort: z.string().min(1).max(64).optional()
241
254
  })),
242
255
  accessOptions: z.array(z.object({
243
256
  id: z.string().min(1).max(128),
@@ -763,7 +776,13 @@ export const workbenchNodeOperationSchema = z.enum([
763
776
  'workspace.skills.install',
764
777
  'workspace.skills.remove',
765
778
  'workspace.skills.git-exclude-repair',
766
- 'skill.install.job.get'
779
+ 'skill.install.job.get',
780
+ 'node.mcps.inspect',
781
+ 'node.mcps.install',
782
+ 'node.mcps.remove',
783
+ 'workspace.mcps.inspect',
784
+ 'workspace.mcps.install',
785
+ 'workspace.mcps.remove'
767
786
  ]);
768
787
  /**
769
788
  * A small, explicit envelope keeps WebSocket messages independently parseable
package/dist/mcp.d.ts ADDED
@@ -0,0 +1,438 @@
1
+ import { z } from 'zod';
2
+ export declare const mcpSourceInputSchema: z.ZodEffects<z.ZodObject<{
3
+ scope: z.ZodEnum<["ENTERPRISE", "ORGANIZATION", "PERSONAL"]>;
4
+ organizationId: z.ZodOptional<z.ZodNumber>;
5
+ name: z.ZodString;
6
+ locator: z.ZodEffects<z.ZodString, string, string>;
7
+ enabled: z.ZodOptional<z.ZodBoolean>;
8
+ }, "strict", z.ZodTypeAny, {
9
+ name: string;
10
+ scope: "PERSONAL" | "ENTERPRISE" | "ORGANIZATION";
11
+ locator: string;
12
+ organizationId?: number | undefined;
13
+ enabled?: boolean | undefined;
14
+ }, {
15
+ name: string;
16
+ scope: "PERSONAL" | "ENTERPRISE" | "ORGANIZATION";
17
+ locator: string;
18
+ organizationId?: number | undefined;
19
+ enabled?: boolean | undefined;
20
+ }>, {
21
+ name: string;
22
+ scope: "PERSONAL" | "ENTERPRISE" | "ORGANIZATION";
23
+ locator: string;
24
+ organizationId?: number | undefined;
25
+ enabled?: boolean | undefined;
26
+ }, {
27
+ name: string;
28
+ scope: "PERSONAL" | "ENTERPRISE" | "ORGANIZATION";
29
+ locator: string;
30
+ organizationId?: number | undefined;
31
+ enabled?: boolean | undefined;
32
+ }>;
33
+ export type McpSourceInput = z.infer<typeof mcpSourceInputSchema>;
34
+ export declare const mcpRuntimeDescriptorSchema: z.ZodDiscriminatedUnion<"transport", [z.ZodObject<{
35
+ transport: z.ZodLiteral<"STDIO">;
36
+ command: z.ZodString;
37
+ args: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
38
+ environment: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
39
+ secretName: z.ZodString;
40
+ }, "strict", z.ZodTypeAny, {
41
+ secretName: string;
42
+ }, {
43
+ secretName: string;
44
+ }>>>>;
45
+ }, "strict", z.ZodTypeAny, {
46
+ transport: "STDIO";
47
+ command: string;
48
+ args: string[];
49
+ environment?: Record<string, {
50
+ secretName: string;
51
+ }> | undefined;
52
+ }, {
53
+ transport: "STDIO";
54
+ command: string;
55
+ args?: string[] | undefined;
56
+ environment?: Record<string, {
57
+ secretName: string;
58
+ }> | undefined;
59
+ }>, z.ZodObject<{
60
+ transport: z.ZodLiteral<"HTTP">;
61
+ url: z.ZodEffects<z.ZodString, string, string>;
62
+ headers: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
63
+ secretName: z.ZodString;
64
+ }, "strict", z.ZodTypeAny, {
65
+ secretName: string;
66
+ }, {
67
+ secretName: string;
68
+ }>>>>;
69
+ }, "strict", z.ZodTypeAny, {
70
+ transport: "HTTP";
71
+ url: string;
72
+ headers?: Record<string, {
73
+ secretName: string;
74
+ }> | undefined;
75
+ }, {
76
+ transport: "HTTP";
77
+ url: string;
78
+ headers?: Record<string, {
79
+ secretName: string;
80
+ }> | undefined;
81
+ }>]>;
82
+ export type McpRuntimeDescriptor = z.infer<typeof mcpRuntimeDescriptorSchema>;
83
+ export declare const mcpCatalogEntrySchema: z.ZodEffects<z.ZodObject<{
84
+ id: z.ZodString;
85
+ sourceId: z.ZodString;
86
+ scope: z.ZodEnum<["ENTERPRISE", "ORGANIZATION", "PERSONAL"]>;
87
+ ownerOrganizationId: z.ZodOptional<z.ZodNumber>;
88
+ ownerUserId: z.ZodOptional<z.ZodNumber>;
89
+ serverName: z.ZodString;
90
+ displayName: z.ZodString;
91
+ description: z.ZodString;
92
+ version: z.ZodEffects<z.ZodString, string, string>;
93
+ featured: z.ZodBoolean;
94
+ tags: z.ZodArray<z.ZodString, "many">;
95
+ runtime: z.ZodDiscriminatedUnion<"transport", [z.ZodObject<{
96
+ transport: z.ZodLiteral<"STDIO">;
97
+ command: z.ZodString;
98
+ args: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
99
+ environment: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
100
+ secretName: z.ZodString;
101
+ }, "strict", z.ZodTypeAny, {
102
+ secretName: string;
103
+ }, {
104
+ secretName: string;
105
+ }>>>>;
106
+ }, "strict", z.ZodTypeAny, {
107
+ transport: "STDIO";
108
+ command: string;
109
+ args: string[];
110
+ environment?: Record<string, {
111
+ secretName: string;
112
+ }> | undefined;
113
+ }, {
114
+ transport: "STDIO";
115
+ command: string;
116
+ args?: string[] | undefined;
117
+ environment?: Record<string, {
118
+ secretName: string;
119
+ }> | undefined;
120
+ }>, z.ZodObject<{
121
+ transport: z.ZodLiteral<"HTTP">;
122
+ url: z.ZodEffects<z.ZodString, string, string>;
123
+ headers: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
124
+ secretName: z.ZodString;
125
+ }, "strict", z.ZodTypeAny, {
126
+ secretName: string;
127
+ }, {
128
+ secretName: string;
129
+ }>>>>;
130
+ }, "strict", z.ZodTypeAny, {
131
+ transport: "HTTP";
132
+ url: string;
133
+ headers?: Record<string, {
134
+ secretName: string;
135
+ }> | undefined;
136
+ }, {
137
+ transport: "HTTP";
138
+ url: string;
139
+ headers?: Record<string, {
140
+ secretName: string;
141
+ }> | undefined;
142
+ }>]>;
143
+ createdAt: z.ZodNumber;
144
+ updatedAt: z.ZodNumber;
145
+ }, "strict", z.ZodTypeAny, {
146
+ id: string;
147
+ createdAt: number;
148
+ updatedAt: number;
149
+ displayName: string;
150
+ scope: "PERSONAL" | "ENTERPRISE" | "ORGANIZATION";
151
+ sourceId: string;
152
+ featured: boolean;
153
+ tags: string[];
154
+ description: string;
155
+ serverName: string;
156
+ version: string;
157
+ runtime: {
158
+ transport: "STDIO";
159
+ command: string;
160
+ args: string[];
161
+ environment?: Record<string, {
162
+ secretName: string;
163
+ }> | undefined;
164
+ } | {
165
+ transport: "HTTP";
166
+ url: string;
167
+ headers?: Record<string, {
168
+ secretName: string;
169
+ }> | undefined;
170
+ };
171
+ ownerUserId?: number | undefined;
172
+ ownerOrganizationId?: number | undefined;
173
+ }, {
174
+ id: string;
175
+ createdAt: number;
176
+ updatedAt: number;
177
+ displayName: string;
178
+ scope: "PERSONAL" | "ENTERPRISE" | "ORGANIZATION";
179
+ sourceId: string;
180
+ featured: boolean;
181
+ tags: string[];
182
+ description: string;
183
+ serverName: string;
184
+ version: string;
185
+ runtime: {
186
+ transport: "STDIO";
187
+ command: string;
188
+ args?: string[] | undefined;
189
+ environment?: Record<string, {
190
+ secretName: string;
191
+ }> | undefined;
192
+ } | {
193
+ transport: "HTTP";
194
+ url: string;
195
+ headers?: Record<string, {
196
+ secretName: string;
197
+ }> | undefined;
198
+ };
199
+ ownerUserId?: number | undefined;
200
+ ownerOrganizationId?: number | undefined;
201
+ }>, {
202
+ id: string;
203
+ createdAt: number;
204
+ updatedAt: number;
205
+ displayName: string;
206
+ scope: "PERSONAL" | "ENTERPRISE" | "ORGANIZATION";
207
+ sourceId: string;
208
+ featured: boolean;
209
+ tags: string[];
210
+ description: string;
211
+ serverName: string;
212
+ version: string;
213
+ runtime: {
214
+ transport: "STDIO";
215
+ command: string;
216
+ args: string[];
217
+ environment?: Record<string, {
218
+ secretName: string;
219
+ }> | undefined;
220
+ } | {
221
+ transport: "HTTP";
222
+ url: string;
223
+ headers?: Record<string, {
224
+ secretName: string;
225
+ }> | undefined;
226
+ };
227
+ ownerUserId?: number | undefined;
228
+ ownerOrganizationId?: number | undefined;
229
+ }, {
230
+ id: string;
231
+ createdAt: number;
232
+ updatedAt: number;
233
+ displayName: string;
234
+ scope: "PERSONAL" | "ENTERPRISE" | "ORGANIZATION";
235
+ sourceId: string;
236
+ featured: boolean;
237
+ tags: string[];
238
+ description: string;
239
+ serverName: string;
240
+ version: string;
241
+ runtime: {
242
+ transport: "STDIO";
243
+ command: string;
244
+ args?: string[] | undefined;
245
+ environment?: Record<string, {
246
+ secretName: string;
247
+ }> | undefined;
248
+ } | {
249
+ transport: "HTTP";
250
+ url: string;
251
+ headers?: Record<string, {
252
+ secretName: string;
253
+ }> | undefined;
254
+ };
255
+ ownerUserId?: number | undefined;
256
+ ownerOrganizationId?: number | undefined;
257
+ }>;
258
+ export type McpCatalogEntry = z.infer<typeof mcpCatalogEntrySchema>;
259
+ export declare const mcpInstallationConfigurationSchema: z.ZodObject<{
260
+ arguments: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
261
+ environment: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
262
+ secretName: z.ZodString;
263
+ }, "strict", z.ZodTypeAny, {
264
+ secretName: string;
265
+ }, {
266
+ secretName: string;
267
+ }>>>>;
268
+ headers: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
269
+ secretName: z.ZodString;
270
+ }, "strict", z.ZodTypeAny, {
271
+ secretName: string;
272
+ }, {
273
+ secretName: string;
274
+ }>>>>;
275
+ }, "strict", z.ZodTypeAny, {
276
+ environment?: Record<string, {
277
+ secretName: string;
278
+ }> | undefined;
279
+ headers?: Record<string, {
280
+ secretName: string;
281
+ }> | undefined;
282
+ arguments?: string[] | undefined;
283
+ }, {
284
+ environment?: Record<string, {
285
+ secretName: string;
286
+ }> | undefined;
287
+ headers?: Record<string, {
288
+ secretName: string;
289
+ }> | undefined;
290
+ arguments?: string[] | undefined;
291
+ }>;
292
+ export type McpInstallationConfiguration = z.infer<typeof mcpInstallationConfigurationSchema>;
293
+ export declare const mcpInstallationInputSchema: z.ZodObject<{
294
+ catalogEntryId: z.ZodString;
295
+ enabled: z.ZodDefault<z.ZodBoolean>;
296
+ configuration: z.ZodDefault<z.ZodObject<{
297
+ arguments: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
298
+ environment: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
299
+ secretName: z.ZodString;
300
+ }, "strict", z.ZodTypeAny, {
301
+ secretName: string;
302
+ }, {
303
+ secretName: string;
304
+ }>>>>;
305
+ headers: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
306
+ secretName: z.ZodString;
307
+ }, "strict", z.ZodTypeAny, {
308
+ secretName: string;
309
+ }, {
310
+ secretName: string;
311
+ }>>>>;
312
+ }, "strict", z.ZodTypeAny, {
313
+ environment?: Record<string, {
314
+ secretName: string;
315
+ }> | undefined;
316
+ headers?: Record<string, {
317
+ secretName: string;
318
+ }> | undefined;
319
+ arguments?: string[] | undefined;
320
+ }, {
321
+ environment?: Record<string, {
322
+ secretName: string;
323
+ }> | undefined;
324
+ headers?: Record<string, {
325
+ secretName: string;
326
+ }> | undefined;
327
+ arguments?: string[] | undefined;
328
+ }>>;
329
+ }, "strict", z.ZodTypeAny, {
330
+ enabled: boolean;
331
+ catalogEntryId: string;
332
+ configuration: {
333
+ environment?: Record<string, {
334
+ secretName: string;
335
+ }> | undefined;
336
+ headers?: Record<string, {
337
+ secretName: string;
338
+ }> | undefined;
339
+ arguments?: string[] | undefined;
340
+ };
341
+ }, {
342
+ catalogEntryId: string;
343
+ enabled?: boolean | undefined;
344
+ configuration?: {
345
+ environment?: Record<string, {
346
+ secretName: string;
347
+ }> | undefined;
348
+ headers?: Record<string, {
349
+ secretName: string;
350
+ }> | undefined;
351
+ arguments?: string[] | undefined;
352
+ } | undefined;
353
+ }>;
354
+ export type McpInstallationInput = z.infer<typeof mcpInstallationInputSchema>;
355
+ export declare const installedMcpSchema: z.ZodObject<{
356
+ catalogEntryId: z.ZodString;
357
+ serverName: z.ZodString;
358
+ displayName: z.ZodString;
359
+ version: z.ZodString;
360
+ origin: z.ZodEnum<["NODE", "WORKSPACE"]>;
361
+ enabled: z.ZodBoolean;
362
+ status: z.ZodEnum<["CURRENT", "UPDATE_AVAILABLE", "INVALID", "UNAVAILABLE"]>;
363
+ installedAt: z.ZodNumber;
364
+ }, "strict", z.ZodTypeAny, {
365
+ status: "CURRENT" | "UPDATE_AVAILABLE" | "INVALID" | "UNAVAILABLE";
366
+ displayName: string;
367
+ enabled: boolean;
368
+ installedAt: number;
369
+ serverName: string;
370
+ version: string;
371
+ catalogEntryId: string;
372
+ origin: "NODE" | "WORKSPACE";
373
+ }, {
374
+ status: "CURRENT" | "UPDATE_AVAILABLE" | "INVALID" | "UNAVAILABLE";
375
+ displayName: string;
376
+ enabled: boolean;
377
+ installedAt: number;
378
+ serverName: string;
379
+ version: string;
380
+ catalogEntryId: string;
381
+ origin: "NODE" | "WORKSPACE";
382
+ }>;
383
+ export declare const mcpTargetInspectionSchema: z.ZodObject<{
384
+ targetKind: z.ZodEnum<["NODE", "WORKSPACE"]>;
385
+ installations: z.ZodArray<z.ZodObject<{
386
+ catalogEntryId: z.ZodString;
387
+ serverName: z.ZodString;
388
+ displayName: z.ZodString;
389
+ version: z.ZodString;
390
+ origin: z.ZodEnum<["NODE", "WORKSPACE"]>;
391
+ enabled: z.ZodBoolean;
392
+ status: z.ZodEnum<["CURRENT", "UPDATE_AVAILABLE", "INVALID", "UNAVAILABLE"]>;
393
+ installedAt: z.ZodNumber;
394
+ }, "strict", z.ZodTypeAny, {
395
+ status: "CURRENT" | "UPDATE_AVAILABLE" | "INVALID" | "UNAVAILABLE";
396
+ displayName: string;
397
+ enabled: boolean;
398
+ installedAt: number;
399
+ serverName: string;
400
+ version: string;
401
+ catalogEntryId: string;
402
+ origin: "NODE" | "WORKSPACE";
403
+ }, {
404
+ status: "CURRENT" | "UPDATE_AVAILABLE" | "INVALID" | "UNAVAILABLE";
405
+ displayName: string;
406
+ enabled: boolean;
407
+ installedAt: number;
408
+ serverName: string;
409
+ version: string;
410
+ catalogEntryId: string;
411
+ origin: "NODE" | "WORKSPACE";
412
+ }>, "many">;
413
+ }, "strict", z.ZodTypeAny, {
414
+ targetKind: "NODE" | "WORKSPACE";
415
+ installations: {
416
+ status: "CURRENT" | "UPDATE_AVAILABLE" | "INVALID" | "UNAVAILABLE";
417
+ displayName: string;
418
+ enabled: boolean;
419
+ installedAt: number;
420
+ serverName: string;
421
+ version: string;
422
+ catalogEntryId: string;
423
+ origin: "NODE" | "WORKSPACE";
424
+ }[];
425
+ }, {
426
+ targetKind: "NODE" | "WORKSPACE";
427
+ installations: {
428
+ status: "CURRENT" | "UPDATE_AVAILABLE" | "INVALID" | "UNAVAILABLE";
429
+ displayName: string;
430
+ enabled: boolean;
431
+ installedAt: number;
432
+ serverName: string;
433
+ version: string;
434
+ catalogEntryId: string;
435
+ origin: "NODE" | "WORKSPACE";
436
+ }[];
437
+ }>;
438
+ export type McpTargetInspection = z.infer<typeof mcpTargetInspectionSchema>;
package/dist/mcp.js ADDED
@@ -0,0 +1,141 @@
1
+ import { z } from 'zod';
2
+ import { skillScopeSchema } from './skill.js';
3
+ const httpsUrlSchema = z
4
+ .string()
5
+ .trim()
6
+ .min(1)
7
+ .max(2048)
8
+ .refine((value) => {
9
+ try {
10
+ const url = new URL(value);
11
+ return url.protocol === 'https:' && url.username === '' && url.password === '';
12
+ }
13
+ catch {
14
+ return false;
15
+ }
16
+ }, 'URL must use HTTPS without userinfo');
17
+ const mcpNameSchema = z
18
+ .string()
19
+ .trim()
20
+ .min(1)
21
+ .max(255)
22
+ .regex(/^[A-Za-z0-9._/-]+$/u);
23
+ const environmentNameSchema = z.string().regex(/^[A-Z_][A-Z0-9_]*$/u);
24
+ const secretReferenceSchema = z.object({ secretName: environmentNameSchema }).strict();
25
+ const referenceMapSchema = z.record(environmentNameSchema, secretReferenceSchema).default({});
26
+ const headerReferenceMapSchema = z
27
+ .record(z
28
+ .string()
29
+ .trim()
30
+ .min(1)
31
+ .max(128)
32
+ .regex(/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u), secretReferenceSchema)
33
+ .default({});
34
+ export const mcpSourceInputSchema = z
35
+ .object({
36
+ scope: skillScopeSchema,
37
+ organizationId: z.number().int().positive().optional(),
38
+ name: z.string().trim().min(1).max(128),
39
+ locator: httpsUrlSchema,
40
+ enabled: z.boolean().optional()
41
+ })
42
+ .strict()
43
+ .superRefine((source, context) => {
44
+ if ((source.scope === 'ORGANIZATION') !== (source.organizationId !== undefined))
45
+ context.addIssue({ code: 'custom', message: 'organizationId must match scope' });
46
+ });
47
+ export const mcpRuntimeDescriptorSchema = z.discriminatedUnion('transport', [
48
+ z
49
+ .object({
50
+ transport: z.literal('STDIO'),
51
+ command: z
52
+ .string()
53
+ .trim()
54
+ .min(1)
55
+ .max(512)
56
+ .regex(/^[^\r\n\0]+$/u),
57
+ args: z
58
+ .array(z
59
+ .string()
60
+ .max(2048)
61
+ .regex(/^[^\0]*$/u))
62
+ .max(64)
63
+ .default([]),
64
+ environment: referenceMapSchema.optional()
65
+ })
66
+ .strict(),
67
+ z
68
+ .object({
69
+ transport: z.literal('HTTP'),
70
+ url: httpsUrlSchema,
71
+ headers: headerReferenceMapSchema.optional()
72
+ })
73
+ .strict()
74
+ ]);
75
+ export const mcpCatalogEntrySchema = z
76
+ .object({
77
+ id: z.string().min(1).max(128),
78
+ sourceId: z.string().min(1).max(128),
79
+ scope: skillScopeSchema,
80
+ ownerOrganizationId: z.number().int().positive().optional(),
81
+ ownerUserId: z.number().int().positive().optional(),
82
+ serverName: mcpNameSchema,
83
+ displayName: z.string().trim().min(1).max(128),
84
+ description: z.string().max(4096),
85
+ version: z
86
+ .string()
87
+ .trim()
88
+ .min(1)
89
+ .max(255)
90
+ .refine((value) => value !== 'latest'),
91
+ featured: z.boolean(),
92
+ tags: z.array(z.string().trim().min(1).max(32)).max(10),
93
+ runtime: mcpRuntimeDescriptorSchema,
94
+ createdAt: z.number().int().nonnegative(),
95
+ updatedAt: z.number().int().nonnegative()
96
+ })
97
+ .strict()
98
+ .superRefine((entry, context) => {
99
+ if ((entry.scope === 'ORGANIZATION') !== (entry.ownerOrganizationId !== undefined))
100
+ context.addIssue({ code: 'custom', message: 'organization owner must match scope' });
101
+ if ((entry.scope === 'PERSONAL') !== (entry.ownerUserId !== undefined))
102
+ context.addIssue({ code: 'custom', message: 'user owner must match scope' });
103
+ });
104
+ export const mcpInstallationConfigurationSchema = z
105
+ .object({
106
+ arguments: z
107
+ .array(z
108
+ .string()
109
+ .max(2048)
110
+ .regex(/^[^\0]*$/u))
111
+ .max(32)
112
+ .optional(),
113
+ environment: referenceMapSchema.optional(),
114
+ headers: headerReferenceMapSchema.optional()
115
+ })
116
+ .strict();
117
+ export const mcpInstallationInputSchema = z
118
+ .object({
119
+ catalogEntryId: z.string().min(1).max(128),
120
+ enabled: z.boolean().default(true),
121
+ configuration: mcpInstallationConfigurationSchema.default({})
122
+ })
123
+ .strict();
124
+ export const installedMcpSchema = z
125
+ .object({
126
+ catalogEntryId: z.string().min(1).max(128),
127
+ serverName: mcpNameSchema,
128
+ displayName: z.string().trim().min(1).max(128),
129
+ version: z.string().trim().min(1).max(255),
130
+ origin: z.enum(['NODE', 'WORKSPACE']),
131
+ enabled: z.boolean(),
132
+ status: z.enum(['CURRENT', 'UPDATE_AVAILABLE', 'INVALID', 'UNAVAILABLE']),
133
+ installedAt: z.number().int().nonnegative()
134
+ })
135
+ .strict();
136
+ export const mcpTargetInspectionSchema = z
137
+ .object({
138
+ targetKind: z.enum(['NODE', 'WORKSPACE']),
139
+ installations: z.array(installedMcpSchema).max(500)
140
+ })
141
+ .strict();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/protocol",
3
- "version": "0.1.8",
3
+ "version": "0.9.0",
4
4
  "description": "Shared runtime protocol schemas for MyAgentRoam.",
5
5
  "type": "module",
6
6
  "files": [