@myagentroam/protocol 0.11.39 → 0.11.40

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 CHANGED
@@ -18,6 +18,7 @@ export * from './git-identity.js';
18
18
  export * from './direct-transfer.js';
19
19
  export * from './terminal-direct.js';
20
20
  export * from './mail-notification.js';
21
+ export * from './marctl-execution-credential.js';
21
22
  export * from './notification-channels.js';
22
23
  export * from './web-push.js';
23
24
  export * from './workbench-notification.js';
@@ -291,6 +292,7 @@ export const nodeUpgradeStatusSchema = z.object({
291
292
  .regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/u)
292
293
  .optional(),
293
294
  activeRunCount: z.number().int().nonnegative().optional(),
295
+ attemptId: z.string().uuid().optional(),
294
296
  errorCode: z.string().trim().min(1).max(80).optional(),
295
297
  updatedAt: z.number().int().nonnegative()
296
298
  });
@@ -315,6 +317,11 @@ export const nodeMetadataSchema = z
315
317
  marAgent: runnerAvailabilitySchema.optional(),
316
318
  runtimeCommands: z.array(runtimeCommandSchema).max(16).optional(),
317
319
  supervisedUpgrade: z.boolean().optional(),
320
+ upgradeProgress: z
321
+ .object({ apiVersion: z.literal(1) })
322
+ .strict()
323
+ .optional(),
324
+ upgradeAttemptId: z.string().uuid().optional(),
318
325
  upgrade: nodeUpgradeStatusSchema.optional()
319
326
  })
320
327
  .partial()
@@ -768,6 +775,7 @@ const marAgentModelShape = {
768
775
  reasoningEfforts: z.array(marAgentReasoningEffortSchema).max(6),
769
776
  defaultReasoningEffort: marAgentReasoningEffortSchema.optional(),
770
777
  conversationModel: z.boolean().default(true),
778
+ subagentModel: z.boolean().default(false),
771
779
  titleGeneration: z.boolean().default(false),
772
780
  codeMode: z.boolean().default(false),
773
781
  serviceTier: marAgentResponsesServiceTierSchema.optional(),
@@ -1632,7 +1640,8 @@ export const runnerProfileSchema = z.object({
1632
1640
  label: z.string().min(1).max(128),
1633
1641
  supportedEfforts: z.array(z.string().min(1).max(64)).max(32),
1634
1642
  isDefault: z.boolean().optional(),
1635
- defaultEffort: z.string().min(1).max(64).optional()
1643
+ defaultEffort: z.string().min(1).max(64).optional(),
1644
+ subagentModel: z.boolean().optional()
1636
1645
  })),
1637
1646
  accessOptions: z.array(z.object({
1638
1647
  id: z.string().min(1).max(128),
@@ -1823,7 +1832,8 @@ const assistantMessageItemSchema = conversationItemBaseSchema.extend({
1823
1832
  payload: z.object({
1824
1833
  text: z.string(),
1825
1834
  format: z.literal('markdown'),
1826
- model: z.string().max(128).nullable()
1835
+ model: z.string().max(128).nullable(),
1836
+ phase: z.enum(['commentary', 'final_answer']).optional()
1827
1837
  })
1828
1838
  });
1829
1839
  const userMessageItemSchema = conversationItemBaseSchema.extend({
@@ -1893,7 +1903,46 @@ export const subagentLatestMessageSchema = z.object({
1893
1903
  timestamp: z.string().datetime(),
1894
1904
  truncated: z.boolean().optional()
1895
1905
  });
1896
- export const toolPresentationSchema = z.discriminatedUnion('kind', [
1906
+ const executionOutputSchema = z
1907
+ .array(z
1908
+ .object({
1909
+ channel: z.enum(['STDOUT', 'STDERR', 'COMBINED', 'TEXT']),
1910
+ text: z.string().max(10000)
1911
+ })
1912
+ .strict())
1913
+ .max(4)
1914
+ .superRefine((blocks, ctx) => {
1915
+ const channels = blocks.map((block) => block.channel);
1916
+ if (new Set(channels).size !== channels.length ||
1917
+ (channels.includes('COMBINED') &&
1918
+ (channels.includes('STDOUT') || channels.includes('STDERR')))) {
1919
+ ctx.addIssue({ code: z.ZodIssueCode.custom, message: 'Conflicting output channels' });
1920
+ }
1921
+ });
1922
+ const executionErrorSchema = z
1923
+ .object({ code: z.string().min(1).max(80), message: z.string().max(1000) })
1924
+ .strict();
1925
+ const executionTruncationSchema = z
1926
+ .object({
1927
+ input: z.boolean().optional(),
1928
+ output: z.enum(['HEAD', 'SOURCE']).optional()
1929
+ })
1930
+ .strict();
1931
+ export const executionPresentationSchema = z
1932
+ .object({
1933
+ kind: z.literal('EXECUTION'),
1934
+ execution: z
1935
+ .object({
1936
+ kind: z.enum(['SHELL', 'CODE', 'CONTROL']),
1937
+ output: executionOutputSchema.optional(),
1938
+ error: executionErrorSchema.optional(),
1939
+ truncation: executionTruncationSchema.optional()
1940
+ })
1941
+ .strict()
1942
+ })
1943
+ .strict()
1944
+ .refine((value) => new TextEncoder().encode(JSON.stringify(value)).length <= 128 * 1024, 'Execution presentation exceeds 128 KiB');
1945
+ const toolCallPresentationSchema = z.discriminatedUnion('kind', [
1897
1946
  z.object({
1898
1947
  kind: z.literal('READ'),
1899
1948
  paths: z.array(z.string().min(1).max(4096)).max(16).optional()
@@ -1934,6 +1983,13 @@ export const toolPresentationSchema = z.discriminatedUnion('kind', [
1934
1983
  wakeReason: z.enum(['elapsed', 'steer', 'subagent_message']).optional()
1935
1984
  })
1936
1985
  ]);
1986
+ export const toolPresentationSchema = z.union([
1987
+ toolCallPresentationSchema,
1988
+ executionPresentationSchema
1989
+ ]);
1990
+ const toolOutputSnapshotSchema = z
1991
+ .object({ text: z.string().max(10000), truncated: z.boolean() })
1992
+ .strict();
1937
1993
  const toolCallItemSchema = conversationItemBaseSchema.extend({
1938
1994
  kind: z.literal('tool_call'),
1939
1995
  payload: z.object({
@@ -1945,11 +2001,13 @@ const toolCallItemSchema = conversationItemBaseSchema.extend({
1945
2001
  progressLabel: z.string().max(500).nullable(),
1946
2002
  errorCode: z.string().max(80).nullable(),
1947
2003
  truncated: z.boolean(),
2004
+ output: toolOutputSnapshotSchema.optional(),
1948
2005
  toolCategory: z.enum(['IMAGE_GENERATION']).optional(),
1949
- toolPresentation: toolPresentationSchema.optional(),
2006
+ toolPresentation: toolCallPresentationSchema.optional(),
1950
2007
  subagentOperation: subagentOperationSchema.optional(),
1951
2008
  subagentWait: z.boolean().optional(),
1952
2009
  subagentId: z.string().min(1).max(128).nullable().optional(),
2010
+ subagentSessionId: z.string().min(1).max(128).optional(),
1953
2011
  subagentModelId: z.string().min(1).max(128).optional(),
1954
2012
  subagentModelName: z.string().min(1).max(128).optional(),
1955
2013
  subagentReasoningEffort: z.enum(['low', 'medium', 'high', 'xhigh', 'max', 'ultra']).optional(),
@@ -1967,7 +2025,9 @@ const commandExecutionItemSchema = conversationItemBaseSchema.extend({
1967
2025
  outputRef: z.string().min(1).max(128).nullable(),
1968
2026
  exitCode: z.number().int().nullable(),
1969
2027
  durationMs: z.number().int().nonnegative().nullable(),
1970
- truncated: z.boolean()
2028
+ truncated: z.boolean(),
2029
+ output: toolOutputSnapshotSchema.optional(),
2030
+ toolPresentation: executionPresentationSchema.optional()
1971
2031
  })
1972
2032
  });
1973
2033
  const fileChangeItemSchema = conversationItemBaseSchema.extend({
@@ -3079,6 +3139,7 @@ export const gitHistoryFileSchema = z.object({
3079
3139
  change: z.enum(['ADDED', 'MODIFIED', 'DELETED', 'RENAMED', 'COPIED', 'TYPE_CHANGED'])
3080
3140
  });
3081
3141
  export const workbenchNodeOperationSchema = z.enum([
3142
+ 'agent.network',
3082
3143
  'workspace.git.settings.get',
3083
3144
  'workspace.git.settings.update',
3084
3145
  'node.workbench.capabilities',
@@ -0,0 +1,50 @@
1
+ import { z } from 'zod';
2
+ /** Private authenticated Node control-channel exchange; never exposed as a public receipt. */
3
+ export declare const marctlExecutionCredentialRequestSchema: z.ZodObject<{
4
+ parentToken: z.ZodString;
5
+ workspaceId: z.ZodString;
6
+ sessionId: z.ZodString;
7
+ executionId: z.ZodString;
8
+ userId: z.ZodNumber;
9
+ }, "strict", z.ZodTypeAny, {
10
+ sessionId: string;
11
+ workspaceId: string;
12
+ userId: number;
13
+ executionId: string;
14
+ parentToken: string;
15
+ }, {
16
+ sessionId: string;
17
+ workspaceId: string;
18
+ userId: number;
19
+ executionId: string;
20
+ parentToken: string;
21
+ }>;
22
+ export declare const marctlExecutionCredentialResponseSchema: z.ZodUnion<[z.ZodObject<{
23
+ token: z.ZodString;
24
+ }, "strict", z.ZodTypeAny, {
25
+ token: string;
26
+ }, {
27
+ token: string;
28
+ }>, z.ZodObject<{
29
+ error: z.ZodObject<{
30
+ code: z.ZodString;
31
+ message: z.ZodString;
32
+ }, "strict", z.ZodTypeAny, {
33
+ code: string;
34
+ message: string;
35
+ }, {
36
+ code: string;
37
+ message: string;
38
+ }>;
39
+ }, "strict", z.ZodTypeAny, {
40
+ error: {
41
+ code: string;
42
+ message: string;
43
+ };
44
+ }, {
45
+ error: {
46
+ code: string;
47
+ message: string;
48
+ };
49
+ }>]>;
50
+ export type MarctlExecutionCredentialRequest = z.infer<typeof marctlExecutionCredentialRequestSchema>;
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ const id = z.string().min(1).max(256);
3
+ const token = z.string().regex(/^marctl_user_[A-Za-z0-9_-]{43}$/u);
4
+ /** Private authenticated Node control-channel exchange; never exposed as a public receipt. */
5
+ export const marctlExecutionCredentialRequestSchema = z
6
+ .object({
7
+ parentToken: token,
8
+ workspaceId: id,
9
+ sessionId: id,
10
+ executionId: id,
11
+ userId: z.number().int().positive().safe()
12
+ })
13
+ .strict();
14
+ export const marctlExecutionCredentialResponseSchema = z.union([
15
+ z.object({ token }).strict(),
16
+ z
17
+ .object({
18
+ error: z
19
+ .object({
20
+ code: z.string().regex(/^[A-Z][A-Z0-9_]{0,127}$/u),
21
+ message: z.string().min(1).max(1000)
22
+ })
23
+ .strict()
24
+ })
25
+ .strict()
26
+ ]);
@@ -82,7 +82,7 @@ export declare const modelUsageRecordSchema: z.ZodEffects<z.ZodObject<{
82
82
  sessionId: string;
83
83
  revision: number;
84
84
  requestId: string;
85
- purpose: "conversation" | "compact" | "title" | "prompt_completion" | "other";
85
+ purpose: "other" | "conversation" | "compact" | "title" | "prompt_completion";
86
86
  runId: string;
87
87
  scopeId: string;
88
88
  schemaVersion: 1;
@@ -108,7 +108,7 @@ export declare const modelUsageRecordSchema: z.ZodEffects<z.ZodObject<{
108
108
  sessionId: string;
109
109
  revision: number;
110
110
  requestId: string;
111
- purpose: "conversation" | "compact" | "title" | "prompt_completion" | "other";
111
+ purpose: "other" | "conversation" | "compact" | "title" | "prompt_completion";
112
112
  runId: string;
113
113
  scopeId: string;
114
114
  schemaVersion: 1;
@@ -134,7 +134,7 @@ export declare const modelUsageRecordSchema: z.ZodEffects<z.ZodObject<{
134
134
  sessionId: string;
135
135
  revision: number;
136
136
  requestId: string;
137
- purpose: "conversation" | "compact" | "title" | "prompt_completion" | "other";
137
+ purpose: "other" | "conversation" | "compact" | "title" | "prompt_completion";
138
138
  runId: string;
139
139
  scopeId: string;
140
140
  schemaVersion: 1;
@@ -160,7 +160,7 @@ export declare const modelUsageRecordSchema: z.ZodEffects<z.ZodObject<{
160
160
  sessionId: string;
161
161
  revision: number;
162
162
  requestId: string;
163
- purpose: "conversation" | "compact" | "title" | "prompt_completion" | "other";
163
+ purpose: "other" | "conversation" | "compact" | "title" | "prompt_completion";
164
164
  runId: string;
165
165
  scopeId: string;
166
166
  schemaVersion: 1;
@@ -227,7 +227,7 @@ export declare const modelUsageBatchSchema: z.ZodObject<{
227
227
  sessionId: string;
228
228
  revision: number;
229
229
  requestId: string;
230
- purpose: "conversation" | "compact" | "title" | "prompt_completion" | "other";
230
+ purpose: "other" | "conversation" | "compact" | "title" | "prompt_completion";
231
231
  runId: string;
232
232
  scopeId: string;
233
233
  schemaVersion: 1;
@@ -253,7 +253,7 @@ export declare const modelUsageBatchSchema: z.ZodObject<{
253
253
  sessionId: string;
254
254
  revision: number;
255
255
  requestId: string;
256
- purpose: "conversation" | "compact" | "title" | "prompt_completion" | "other";
256
+ purpose: "other" | "conversation" | "compact" | "title" | "prompt_completion";
257
257
  runId: string;
258
258
  scopeId: string;
259
259
  schemaVersion: 1;
@@ -279,7 +279,7 @@ export declare const modelUsageBatchSchema: z.ZodObject<{
279
279
  sessionId: string;
280
280
  revision: number;
281
281
  requestId: string;
282
- purpose: "conversation" | "compact" | "title" | "prompt_completion" | "other";
282
+ purpose: "other" | "conversation" | "compact" | "title" | "prompt_completion";
283
283
  runId: string;
284
284
  scopeId: string;
285
285
  schemaVersion: 1;
@@ -305,7 +305,7 @@ export declare const modelUsageBatchSchema: z.ZodObject<{
305
305
  sessionId: string;
306
306
  revision: number;
307
307
  requestId: string;
308
- purpose: "conversation" | "compact" | "title" | "prompt_completion" | "other";
308
+ purpose: "other" | "conversation" | "compact" | "title" | "prompt_completion";
309
309
  runId: string;
310
310
  scopeId: string;
311
311
  schemaVersion: 1;
@@ -337,7 +337,7 @@ export declare const modelUsageBatchSchema: z.ZodObject<{
337
337
  sessionId: string;
338
338
  revision: number;
339
339
  requestId: string;
340
- purpose: "conversation" | "compact" | "title" | "prompt_completion" | "other";
340
+ purpose: "other" | "conversation" | "compact" | "title" | "prompt_completion";
341
341
  runId: string;
342
342
  scopeId: string;
343
343
  schemaVersion: 1;
@@ -369,7 +369,7 @@ export declare const modelUsageBatchSchema: z.ZodObject<{
369
369
  sessionId: string;
370
370
  revision: number;
371
371
  requestId: string;
372
- purpose: "conversation" | "compact" | "title" | "prompt_completion" | "other";
372
+ purpose: "other" | "conversation" | "compact" | "title" | "prompt_completion";
373
373
  runId: string;
374
374
  scopeId: string;
375
375
  schemaVersion: 1;
@@ -403,7 +403,7 @@ export declare const modelUsageBatchSchema: z.ZodObject<{
403
403
  sessionId: string;
404
404
  revision: number;
405
405
  requestId: string;
406
- purpose: "conversation" | "compact" | "title" | "prompt_completion" | "other";
406
+ purpose: "other" | "conversation" | "compact" | "title" | "prompt_completion";
407
407
  runId: string;
408
408
  scopeId: string;
409
409
  schemaVersion: 1;
@@ -438,7 +438,7 @@ export declare const modelUsageBatchSchema: z.ZodObject<{
438
438
  sessionId: string;
439
439
  revision: number;
440
440
  requestId: string;
441
- purpose: "conversation" | "compact" | "title" | "prompt_completion" | "other";
441
+ purpose: "other" | "conversation" | "compact" | "title" | "prompt_completion";
442
442
  runId: string;
443
443
  scopeId: string;
444
444
  schemaVersion: 1;
@@ -513,7 +513,7 @@ export declare const personalUsageQuerySchema: z.ZodEffects<z.ZodObject<{
513
513
  from: number;
514
514
  to: number;
515
515
  timeZone: string;
516
- purpose?: "conversation" | "compact" | "title" | "prompt_completion" | "other" | undefined;
516
+ purpose?: "other" | "conversation" | "compact" | "title" | "prompt_completion" | undefined;
517
517
  mode?: "conversation" | "work" | undefined;
518
518
  runner?: "mar-agent" | "codex" | "claude-code" | "opencode" | undefined;
519
519
  model?: string | undefined;
@@ -521,7 +521,7 @@ export declare const personalUsageQuerySchema: z.ZodEffects<z.ZodObject<{
521
521
  from: number;
522
522
  to: number;
523
523
  timeZone: string;
524
- purpose?: "conversation" | "compact" | "title" | "prompt_completion" | "other" | undefined;
524
+ purpose?: "other" | "conversation" | "compact" | "title" | "prompt_completion" | undefined;
525
525
  mode?: "conversation" | "work" | undefined;
526
526
  runner?: "mar-agent" | "codex" | "claude-code" | "opencode" | undefined;
527
527
  model?: string | undefined;
@@ -529,7 +529,7 @@ export declare const personalUsageQuerySchema: z.ZodEffects<z.ZodObject<{
529
529
  from: number;
530
530
  to: number;
531
531
  timeZone: string;
532
- purpose?: "conversation" | "compact" | "title" | "prompt_completion" | "other" | undefined;
532
+ purpose?: "other" | "conversation" | "compact" | "title" | "prompt_completion" | undefined;
533
533
  mode?: "conversation" | "work" | undefined;
534
534
  runner?: "mar-agent" | "codex" | "claude-code" | "opencode" | undefined;
535
535
  model?: string | undefined;
@@ -537,7 +537,7 @@ export declare const personalUsageQuerySchema: z.ZodEffects<z.ZodObject<{
537
537
  from: number;
538
538
  to: number;
539
539
  timeZone: string;
540
- purpose?: "conversation" | "compact" | "title" | "prompt_completion" | "other" | undefined;
540
+ purpose?: "other" | "conversation" | "compact" | "title" | "prompt_completion" | undefined;
541
541
  mode?: "conversation" | "work" | undefined;
542
542
  runner?: "mar-agent" | "codex" | "claude-code" | "opencode" | undefined;
543
543
  model?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/protocol",
3
- "version": "0.11.39",
3
+ "version": "0.11.40",
4
4
  "description": "Shared runtime protocol schemas for MyAgentRoam.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",