@myagentroam/protocol 0.10.44 → 0.10.46

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.
@@ -17,6 +17,23 @@ export declare const channelOriginSchema: z.ZodObject<{
17
17
  senderId: string;
18
18
  }>;
19
19
  export type ChannelOrigin = z.infer<typeof channelOriginSchema>;
20
+ export declare const sessionMessageOriginSchema: z.ZodEffects<z.ZodObject<{
21
+ sessionId: z.ZodOptional<z.ZodString>;
22
+ name: z.ZodOptional<z.ZodString>;
23
+ }, "strict", z.ZodTypeAny, {
24
+ name?: string | undefined;
25
+ sessionId?: string | undefined;
26
+ }, {
27
+ name?: string | undefined;
28
+ sessionId?: string | undefined;
29
+ }>, {
30
+ name?: string | undefined;
31
+ sessionId?: string | undefined;
32
+ }, {
33
+ name?: string | undefined;
34
+ sessionId?: string | undefined;
35
+ }>;
36
+ export type SessionMessageOrigin = z.infer<typeof sessionMessageOriginSchema>;
20
37
  export declare function isComposerAttachmentResourcePath(value: string): boolean;
21
38
  export declare const composerTagSchemas: {
22
39
  readonly mar_steer: z.ZodObject<{
@@ -42,6 +59,22 @@ export declare const composerTagSchemas: {
42
59
  channelId: string;
43
60
  senderId: string;
44
61
  }>;
62
+ readonly mar_session_origin: z.ZodEffects<z.ZodObject<{
63
+ sessionId: z.ZodOptional<z.ZodString>;
64
+ name: z.ZodOptional<z.ZodString>;
65
+ }, "strict", z.ZodTypeAny, {
66
+ name?: string | undefined;
67
+ sessionId?: string | undefined;
68
+ }, {
69
+ name?: string | undefined;
70
+ sessionId?: string | undefined;
71
+ }>, {
72
+ name?: string | undefined;
73
+ sessionId?: string | undefined;
74
+ }, {
75
+ name?: string | undefined;
76
+ sessionId?: string | undefined;
77
+ }>;
45
78
  readonly mar_goal_start: z.ZodObject<{
46
79
  objective: z.ZodString;
47
80
  instruction: z.ZodOptional<z.ZodString>;
@@ -17,6 +17,10 @@ export const channelOriginSchema = z
17
17
  name: channelDisplayNameSchema
18
18
  })
19
19
  .strict();
20
+ export const sessionMessageOriginSchema = z
21
+ .object({ sessionId: z.string().min(1).max(512).optional(), name: name.optional() })
22
+ .strict()
23
+ .refine((value) => (value.sessionId === undefined) === (value.name === undefined));
20
24
  const relativePath = path.refine((value) => !/^(?:[\\/]|[A-Za-z]:)/u.test(value));
21
25
  const workspacePath = relativePath.refine((value) => !value.split(/[\\/]/u).includes('..'));
22
26
  export function isComposerAttachmentResourcePath(value) {
@@ -40,6 +44,7 @@ const attachment = z
40
44
  export const composerTagSchemas = {
41
45
  mar_steer: z.object({ message: z.string().max(100_000) }).strict(),
42
46
  mar_channel: channelOriginSchema,
47
+ mar_session_origin: sessionMessageOriginSchema,
43
48
  mar_goal_start: z
44
49
  .object({ objective: z.string().max(100_000), instruction: z.string().max(100_000).optional() })
45
50
  .strict(),
@@ -101,7 +106,7 @@ export function serializeComposerTag(kind, payload) {
101
106
  for (const [key, item] of Object.entries(value)) {
102
107
  if (item === undefined)
103
108
  continue;
104
- if (kind === 'mar_channel' || key === 'action')
109
+ if (kind === 'mar_channel' || kind === 'mar_session_origin' || key === 'action')
105
110
  attributes[key] = item;
106
111
  else if (Array.isArray(item)) {
107
112
  const leaf = key === 'files' ? 'file' : key === 'skills' ? 'skill' : 'reference';
@@ -113,6 +118,8 @@ export function serializeComposerTag(kind, payload) {
113
118
  }
114
119
  if (kind === 'mar_steer')
115
120
  children.unshift(` <instruction>${STEER_INSTRUCTION}</instruction>`);
121
+ if (kind === 'mar_session_origin')
122
+ children.push(` <instruction>${value.sessionId === undefined ? 'Message sent via marctl.' : 'Message from another session, not directly from the user.'}</instruction>`);
116
123
  const opening = `<${kind}${markupAttributes(attributes)}`;
117
124
  const encoded = children.length
118
125
  ? `${opening}>
@@ -145,7 +152,7 @@ function parseComposerPayload(raw) {
145
152
  ? ['objective', 'instruction']
146
153
  : kind === 'mar_schedule'
147
154
  ? ['objective']
148
- : kind === 'mar_skills'
155
+ : kind === 'mar_skills' || kind === 'mar_session_origin'
149
156
  ? ['instruction']
150
157
  : [];
151
158
  for (const field of root.fields) {
@@ -166,10 +173,12 @@ function parseComposerPayload(raw) {
166
173
  }
167
174
  }
168
175
  if (kind !== 'mar_channel' &&
176
+ kind !== 'mar_session_origin' &&
169
177
  Object.keys(root.attributes).some((key) => kind !== 'mar_skills' || key !== 'action'))
170
178
  return undefined;
171
- if (kind === 'mar_steer') {
172
- if (typeof payload.instruction !== 'string' ||
179
+ if (kind === 'mar_steer' || kind === 'mar_session_origin') {
180
+ if (Object.hasOwn(root.attributes, 'instruction') ||
181
+ typeof payload.instruction !== 'string' ||
173
182
  payload.instruction.length === 0 ||
174
183
  payload.instruction.length > 512)
175
184
  return undefined;
@@ -282,14 +282,14 @@ export declare const auditConversationReceiptSchema: z.ZodObject<{
282
282
  queueItemId: z.ZodOptional<z.ZodString>;
283
283
  inputMode: z.ZodEnum<["NEW_SESSION", "SEND", "CONTINUE", "STEER", "QUEUE", "REPLACE_CURRENT", "RUN_NOW", "USER_INPUT_RESPONSE", "EDIT_QUEUE", "DELETE_QUEUE", "REORDER_QUEUE", "EXECUTE_QUEUE", "PAUSE_QUEUE", "RESUME_QUEUE"]>;
284
284
  }, "strict", z.ZodTypeAny, {
285
- inputMode: "NEW_SESSION" | "SEND" | "CONTINUE" | "STEER" | "QUEUE" | "REPLACE_CURRENT" | "RUN_NOW" | "USER_INPUT_RESPONSE" | "EDIT_QUEUE" | "DELETE_QUEUE" | "REORDER_QUEUE" | "EXECUTE_QUEUE" | "PAUSE_QUEUE" | "RESUME_QUEUE";
286
285
  sessionId: string;
286
+ inputMode: "NEW_SESSION" | "SEND" | "CONTINUE" | "STEER" | "QUEUE" | "REPLACE_CURRENT" | "RUN_NOW" | "USER_INPUT_RESPONSE" | "EDIT_QUEUE" | "DELETE_QUEUE" | "REORDER_QUEUE" | "EXECUTE_QUEUE" | "PAUSE_QUEUE" | "RESUME_QUEUE";
287
287
  runId?: string | undefined;
288
288
  queueItemId?: string | undefined;
289
289
  conversationTitle?: string | undefined;
290
290
  }, {
291
- inputMode: "NEW_SESSION" | "SEND" | "CONTINUE" | "STEER" | "QUEUE" | "REPLACE_CURRENT" | "RUN_NOW" | "USER_INPUT_RESPONSE" | "EDIT_QUEUE" | "DELETE_QUEUE" | "REORDER_QUEUE" | "EXECUTE_QUEUE" | "PAUSE_QUEUE" | "RESUME_QUEUE";
292
291
  sessionId: string;
292
+ inputMode: "NEW_SESSION" | "SEND" | "CONTINUE" | "STEER" | "QUEUE" | "REPLACE_CURRENT" | "RUN_NOW" | "USER_INPUT_RESPONSE" | "EDIT_QUEUE" | "DELETE_QUEUE" | "REORDER_QUEUE" | "EXECUTE_QUEUE" | "PAUSE_QUEUE" | "RESUME_QUEUE";
293
293
  runId?: string | undefined;
294
294
  queueItemId?: string | undefined;
295
295
  conversationTitle?: string | undefined;