@myagentroam/protocol 0.10.35 → 0.10.36
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/composer-tags.d.ts +35 -0
- package/dist/composer-tags.js +17 -1
- package/dist/direct-transfer.d.ts +26 -0
- package/dist/direct-transfer.js +1 -0
- package/dist/index.d.ts +884 -769
- package/dist/index.js +8 -0
- package/dist/session-shares.d.ts +128 -0
- package/dist/session-shares.js +35 -0
- package/dist/tool-result-resource.d.ts +4 -4
- package/package.json +1 -1
package/dist/composer-tags.d.ts
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const channelDisplayNameSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
3
|
+
export declare const channelOriginSchema: z.ZodObject<{
|
|
4
|
+
source: z.ZodLiteral<"WEB_SHARE">;
|
|
5
|
+
channelId: z.ZodString;
|
|
6
|
+
senderId: z.ZodString;
|
|
7
|
+
name: z.ZodEffects<z.ZodString, string, string>;
|
|
8
|
+
}, "strict", z.ZodTypeAny, {
|
|
9
|
+
name: string;
|
|
10
|
+
source: "WEB_SHARE";
|
|
11
|
+
channelId: string;
|
|
12
|
+
senderId: string;
|
|
13
|
+
}, {
|
|
14
|
+
name: string;
|
|
15
|
+
source: "WEB_SHARE";
|
|
16
|
+
channelId: string;
|
|
17
|
+
senderId: string;
|
|
18
|
+
}>;
|
|
19
|
+
export type ChannelOrigin = z.infer<typeof channelOriginSchema>;
|
|
2
20
|
export declare function isComposerAttachmentResourcePath(value: string): boolean;
|
|
3
21
|
export declare const composerTagSchemas: {
|
|
22
|
+
readonly mar_channel: z.ZodObject<{
|
|
23
|
+
source: z.ZodLiteral<"WEB_SHARE">;
|
|
24
|
+
channelId: z.ZodString;
|
|
25
|
+
senderId: z.ZodString;
|
|
26
|
+
name: z.ZodEffects<z.ZodString, string, string>;
|
|
27
|
+
}, "strict", z.ZodTypeAny, {
|
|
28
|
+
name: string;
|
|
29
|
+
source: "WEB_SHARE";
|
|
30
|
+
channelId: string;
|
|
31
|
+
senderId: string;
|
|
32
|
+
}, {
|
|
33
|
+
name: string;
|
|
34
|
+
source: "WEB_SHARE";
|
|
35
|
+
channelId: string;
|
|
36
|
+
senderId: string;
|
|
37
|
+
}>;
|
|
4
38
|
readonly mar_goal_start: z.ZodObject<{
|
|
5
39
|
objective: z.ZodString;
|
|
6
40
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -9,6 +43,7 @@ export declare const composerTagSchemas: {
|
|
|
9
43
|
objective: string;
|
|
10
44
|
}>;
|
|
11
45
|
readonly mar_goal_continue: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
46
|
+
readonly mar_restart: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
12
47
|
readonly mar_attachments: z.ZodObject<{
|
|
13
48
|
files: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
14
49
|
name: z.ZodString;
|
package/dist/composer-tags.js
CHANGED
|
@@ -2,6 +2,20 @@ import { z } from 'zod';
|
|
|
2
2
|
const path = z.string().min(1).max(4096);
|
|
3
3
|
const name = z.string().min(1).max(512);
|
|
4
4
|
const MAX_COMPOSER_TAG_BYTES = 128 * 1024;
|
|
5
|
+
export const channelDisplayNameSchema = z
|
|
6
|
+
.string()
|
|
7
|
+
.trim()
|
|
8
|
+
.min(1)
|
|
9
|
+
.max(80)
|
|
10
|
+
.refine((value) => Array.from(value).every((character) => character.charCodeAt(0) >= 32 && character.charCodeAt(0) !== 127));
|
|
11
|
+
export const channelOriginSchema = z
|
|
12
|
+
.object({
|
|
13
|
+
source: z.literal('WEB_SHARE'),
|
|
14
|
+
channelId: z.string().min(1).max(128),
|
|
15
|
+
senderId: z.string().min(1).max(128),
|
|
16
|
+
name: channelDisplayNameSchema
|
|
17
|
+
})
|
|
18
|
+
.strict();
|
|
5
19
|
const relativePath = path.refine((value) => !/^(?:[\\/]|[A-Za-z]:)/u.test(value));
|
|
6
20
|
const workspacePath = relativePath.refine((value) => !value.split(/[\\/]/u).includes('..'));
|
|
7
21
|
export function isComposerAttachmentResourcePath(value) {
|
|
@@ -23,8 +37,10 @@ const attachment = z
|
|
|
23
37
|
target.startsWith('.mar/temp-files/')));
|
|
24
38
|
});
|
|
25
39
|
export const composerTagSchemas = {
|
|
40
|
+
mar_channel: channelOriginSchema,
|
|
26
41
|
mar_goal_start: z.object({ objective: z.string().max(100_000) }).strict(),
|
|
27
42
|
mar_goal_continue: z.object({}).strict(),
|
|
43
|
+
mar_restart: z.object({}).strict(),
|
|
28
44
|
mar_attachments: z.object({ files: z.array(attachment).min(1).max(5) }).strict(),
|
|
29
45
|
mar_schedule: z.object({ objective: z.string().min(1).max(100_000) }).strict(),
|
|
30
46
|
mar_skills: z
|
|
@@ -65,7 +81,7 @@ export function serializeComposerTag(kind, payload) {
|
|
|
65
81
|
}
|
|
66
82
|
export function parseComposerTags(text) {
|
|
67
83
|
const parts = [];
|
|
68
|
-
const pattern = /<(mar_goal_start|mar_goal_continue|mar_attachments|mar_schedule|mar_skills|mar_references)>([\s\S]*?)<\/\1>/gu;
|
|
84
|
+
const pattern = /<(mar_goal_start|mar_goal_continue|mar_restart|mar_attachments|mar_schedule|mar_skills|mar_references|mar_channel)>([\s\S]*?)<\/\1>/gu;
|
|
69
85
|
let offset = 0;
|
|
70
86
|
for (const match of text.matchAll(pattern)) {
|
|
71
87
|
const kind = match[1];
|
|
@@ -107,6 +107,7 @@ export declare const directTransferDescriptorSchema: z.ZodUnion<[z.ZodEffects<z.
|
|
|
107
107
|
size: z.ZodNumber;
|
|
108
108
|
} & {
|
|
109
109
|
direction: z.ZodLiteral<"UPLOAD">;
|
|
110
|
+
sha256: z.ZodString;
|
|
110
111
|
overwrite: z.ZodOptional<z.ZodBoolean>;
|
|
111
112
|
resumeOffset: z.ZodOptional<z.ZodNumber>;
|
|
112
113
|
composerAttachment: z.ZodOptional<z.ZodObject<{
|
|
@@ -136,6 +137,7 @@ export declare const directTransferDescriptorSchema: z.ZodUnion<[z.ZodEffects<z.
|
|
|
136
137
|
fileName: string;
|
|
137
138
|
size: number;
|
|
138
139
|
direction: "UPLOAD";
|
|
140
|
+
sha256: string;
|
|
139
141
|
overwrite?: boolean | undefined;
|
|
140
142
|
resumeOffset?: number | undefined;
|
|
141
143
|
composerAttachment?: {
|
|
@@ -159,6 +161,7 @@ export declare const directTransferDescriptorSchema: z.ZodUnion<[z.ZodEffects<z.
|
|
|
159
161
|
fileName: string;
|
|
160
162
|
size: number;
|
|
161
163
|
direction: "UPLOAD";
|
|
164
|
+
sha256: string;
|
|
162
165
|
overwrite?: boolean | undefined;
|
|
163
166
|
resumeOffset?: number | undefined;
|
|
164
167
|
composerAttachment?: {
|
|
@@ -182,6 +185,7 @@ export declare const directTransferDescriptorSchema: z.ZodUnion<[z.ZodEffects<z.
|
|
|
182
185
|
fileName: string;
|
|
183
186
|
size: number;
|
|
184
187
|
direction: "UPLOAD";
|
|
188
|
+
sha256: string;
|
|
185
189
|
overwrite?: boolean | undefined;
|
|
186
190
|
resumeOffset?: number | undefined;
|
|
187
191
|
composerAttachment?: {
|
|
@@ -205,6 +209,7 @@ export declare const directTransferDescriptorSchema: z.ZodUnion<[z.ZodEffects<z.
|
|
|
205
209
|
fileName: string;
|
|
206
210
|
size: number;
|
|
207
211
|
direction: "UPLOAD";
|
|
212
|
+
sha256: string;
|
|
208
213
|
overwrite?: boolean | undefined;
|
|
209
214
|
resumeOffset?: number | undefined;
|
|
210
215
|
composerAttachment?: {
|
|
@@ -423,6 +428,7 @@ export declare const directPrepareRequestSchema: z.ZodDiscriminatedUnion<"purpos
|
|
|
423
428
|
size: z.ZodNumber;
|
|
424
429
|
} & {
|
|
425
430
|
direction: z.ZodLiteral<"UPLOAD">;
|
|
431
|
+
sha256: z.ZodString;
|
|
426
432
|
overwrite: z.ZodOptional<z.ZodBoolean>;
|
|
427
433
|
resumeOffset: z.ZodOptional<z.ZodNumber>;
|
|
428
434
|
composerAttachment: z.ZodOptional<z.ZodObject<{
|
|
@@ -452,6 +458,7 @@ export declare const directPrepareRequestSchema: z.ZodDiscriminatedUnion<"purpos
|
|
|
452
458
|
fileName: string;
|
|
453
459
|
size: number;
|
|
454
460
|
direction: "UPLOAD";
|
|
461
|
+
sha256: string;
|
|
455
462
|
overwrite?: boolean | undefined;
|
|
456
463
|
resumeOffset?: number | undefined;
|
|
457
464
|
composerAttachment?: {
|
|
@@ -475,6 +482,7 @@ export declare const directPrepareRequestSchema: z.ZodDiscriminatedUnion<"purpos
|
|
|
475
482
|
fileName: string;
|
|
476
483
|
size: number;
|
|
477
484
|
direction: "UPLOAD";
|
|
485
|
+
sha256: string;
|
|
478
486
|
overwrite?: boolean | undefined;
|
|
479
487
|
resumeOffset?: number | undefined;
|
|
480
488
|
composerAttachment?: {
|
|
@@ -498,6 +506,7 @@ export declare const directPrepareRequestSchema: z.ZodDiscriminatedUnion<"purpos
|
|
|
498
506
|
fileName: string;
|
|
499
507
|
size: number;
|
|
500
508
|
direction: "UPLOAD";
|
|
509
|
+
sha256: string;
|
|
501
510
|
overwrite?: boolean | undefined;
|
|
502
511
|
resumeOffset?: number | undefined;
|
|
503
512
|
composerAttachment?: {
|
|
@@ -521,6 +530,7 @@ export declare const directPrepareRequestSchema: z.ZodDiscriminatedUnion<"purpos
|
|
|
521
530
|
fileName: string;
|
|
522
531
|
size: number;
|
|
523
532
|
direction: "UPLOAD";
|
|
533
|
+
sha256: string;
|
|
524
534
|
overwrite?: boolean | undefined;
|
|
525
535
|
resumeOffset?: number | undefined;
|
|
526
536
|
composerAttachment?: {
|
|
@@ -693,6 +703,7 @@ export declare const directPrepareRequestSchema: z.ZodDiscriminatedUnion<"purpos
|
|
|
693
703
|
fileName: string;
|
|
694
704
|
size: number;
|
|
695
705
|
direction: "UPLOAD";
|
|
706
|
+
sha256: string;
|
|
696
707
|
overwrite?: boolean | undefined;
|
|
697
708
|
resumeOffset?: number | undefined;
|
|
698
709
|
composerAttachment?: {
|
|
@@ -746,6 +757,7 @@ export declare const directPrepareRequestSchema: z.ZodDiscriminatedUnion<"purpos
|
|
|
746
757
|
fileName: string;
|
|
747
758
|
size: number;
|
|
748
759
|
direction: "UPLOAD";
|
|
760
|
+
sha256: string;
|
|
749
761
|
overwrite?: boolean | undefined;
|
|
750
762
|
resumeOffset?: number | undefined;
|
|
751
763
|
composerAttachment?: {
|
|
@@ -921,6 +933,7 @@ export declare const directBrowserMessageSchema: z.ZodUnion<[z.ZodDiscriminatedU
|
|
|
921
933
|
size: z.ZodNumber;
|
|
922
934
|
} & {
|
|
923
935
|
direction: z.ZodLiteral<"UPLOAD">;
|
|
936
|
+
sha256: z.ZodString;
|
|
924
937
|
overwrite: z.ZodOptional<z.ZodBoolean>;
|
|
925
938
|
resumeOffset: z.ZodOptional<z.ZodNumber>;
|
|
926
939
|
composerAttachment: z.ZodOptional<z.ZodObject<{
|
|
@@ -950,6 +963,7 @@ export declare const directBrowserMessageSchema: z.ZodUnion<[z.ZodDiscriminatedU
|
|
|
950
963
|
fileName: string;
|
|
951
964
|
size: number;
|
|
952
965
|
direction: "UPLOAD";
|
|
966
|
+
sha256: string;
|
|
953
967
|
overwrite?: boolean | undefined;
|
|
954
968
|
resumeOffset?: number | undefined;
|
|
955
969
|
composerAttachment?: {
|
|
@@ -973,6 +987,7 @@ export declare const directBrowserMessageSchema: z.ZodUnion<[z.ZodDiscriminatedU
|
|
|
973
987
|
fileName: string;
|
|
974
988
|
size: number;
|
|
975
989
|
direction: "UPLOAD";
|
|
990
|
+
sha256: string;
|
|
976
991
|
overwrite?: boolean | undefined;
|
|
977
992
|
resumeOffset?: number | undefined;
|
|
978
993
|
composerAttachment?: {
|
|
@@ -996,6 +1011,7 @@ export declare const directBrowserMessageSchema: z.ZodUnion<[z.ZodDiscriminatedU
|
|
|
996
1011
|
fileName: string;
|
|
997
1012
|
size: number;
|
|
998
1013
|
direction: "UPLOAD";
|
|
1014
|
+
sha256: string;
|
|
999
1015
|
overwrite?: boolean | undefined;
|
|
1000
1016
|
resumeOffset?: number | undefined;
|
|
1001
1017
|
composerAttachment?: {
|
|
@@ -1019,6 +1035,7 @@ export declare const directBrowserMessageSchema: z.ZodUnion<[z.ZodDiscriminatedU
|
|
|
1019
1035
|
fileName: string;
|
|
1020
1036
|
size: number;
|
|
1021
1037
|
direction: "UPLOAD";
|
|
1038
|
+
sha256: string;
|
|
1022
1039
|
overwrite?: boolean | undefined;
|
|
1023
1040
|
resumeOffset?: number | undefined;
|
|
1024
1041
|
composerAttachment?: {
|
|
@@ -1191,6 +1208,7 @@ export declare const directBrowserMessageSchema: z.ZodUnion<[z.ZodDiscriminatedU
|
|
|
1191
1208
|
fileName: string;
|
|
1192
1209
|
size: number;
|
|
1193
1210
|
direction: "UPLOAD";
|
|
1211
|
+
sha256: string;
|
|
1194
1212
|
overwrite?: boolean | undefined;
|
|
1195
1213
|
resumeOffset?: number | undefined;
|
|
1196
1214
|
composerAttachment?: {
|
|
@@ -1244,6 +1262,7 @@ export declare const directBrowserMessageSchema: z.ZodUnion<[z.ZodDiscriminatedU
|
|
|
1244
1262
|
fileName: string;
|
|
1245
1263
|
size: number;
|
|
1246
1264
|
direction: "UPLOAD";
|
|
1265
|
+
sha256: string;
|
|
1247
1266
|
overwrite?: boolean | undefined;
|
|
1248
1267
|
resumeOffset?: number | undefined;
|
|
1249
1268
|
composerAttachment?: {
|
|
@@ -1731,6 +1750,7 @@ export declare const directNodeCommandSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1731
1750
|
size: z.ZodNumber;
|
|
1732
1751
|
} & {
|
|
1733
1752
|
direction: z.ZodLiteral<"UPLOAD">;
|
|
1753
|
+
sha256: z.ZodString;
|
|
1734
1754
|
overwrite: z.ZodOptional<z.ZodBoolean>;
|
|
1735
1755
|
resumeOffset: z.ZodOptional<z.ZodNumber>;
|
|
1736
1756
|
composerAttachment: z.ZodOptional<z.ZodObject<{
|
|
@@ -1760,6 +1780,7 @@ export declare const directNodeCommandSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1760
1780
|
fileName: string;
|
|
1761
1781
|
size: number;
|
|
1762
1782
|
direction: "UPLOAD";
|
|
1783
|
+
sha256: string;
|
|
1763
1784
|
overwrite?: boolean | undefined;
|
|
1764
1785
|
resumeOffset?: number | undefined;
|
|
1765
1786
|
composerAttachment?: {
|
|
@@ -1783,6 +1804,7 @@ export declare const directNodeCommandSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1783
1804
|
fileName: string;
|
|
1784
1805
|
size: number;
|
|
1785
1806
|
direction: "UPLOAD";
|
|
1807
|
+
sha256: string;
|
|
1786
1808
|
overwrite?: boolean | undefined;
|
|
1787
1809
|
resumeOffset?: number | undefined;
|
|
1788
1810
|
composerAttachment?: {
|
|
@@ -1806,6 +1828,7 @@ export declare const directNodeCommandSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1806
1828
|
fileName: string;
|
|
1807
1829
|
size: number;
|
|
1808
1830
|
direction: "UPLOAD";
|
|
1831
|
+
sha256: string;
|
|
1809
1832
|
overwrite?: boolean | undefined;
|
|
1810
1833
|
resumeOffset?: number | undefined;
|
|
1811
1834
|
composerAttachment?: {
|
|
@@ -1829,6 +1852,7 @@ export declare const directNodeCommandSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1829
1852
|
fileName: string;
|
|
1830
1853
|
size: number;
|
|
1831
1854
|
direction: "UPLOAD";
|
|
1855
|
+
sha256: string;
|
|
1832
1856
|
overwrite?: boolean | undefined;
|
|
1833
1857
|
resumeOffset?: number | undefined;
|
|
1834
1858
|
composerAttachment?: {
|
|
@@ -2001,6 +2025,7 @@ export declare const directNodeCommandSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2001
2025
|
fileName: string;
|
|
2002
2026
|
size: number;
|
|
2003
2027
|
direction: "UPLOAD";
|
|
2028
|
+
sha256: string;
|
|
2004
2029
|
overwrite?: boolean | undefined;
|
|
2005
2030
|
resumeOffset?: number | undefined;
|
|
2006
2031
|
composerAttachment?: {
|
|
@@ -2056,6 +2081,7 @@ export declare const directNodeCommandSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2056
2081
|
fileName: string;
|
|
2057
2082
|
size: number;
|
|
2058
2083
|
direction: "UPLOAD";
|
|
2084
|
+
sha256: string;
|
|
2059
2085
|
overwrite?: boolean | undefined;
|
|
2060
2086
|
resumeOffset?: number | undefined;
|
|
2061
2087
|
composerAttachment?: {
|
package/dist/direct-transfer.js
CHANGED
|
@@ -64,6 +64,7 @@ const directTransferDescriptorBaseSchema = z
|
|
|
64
64
|
const directUploadDescriptorSchema = directTransferDescriptorBaseSchema
|
|
65
65
|
.extend({
|
|
66
66
|
direction: z.literal('UPLOAD'),
|
|
67
|
+
sha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
67
68
|
overwrite: z.boolean().optional(),
|
|
68
69
|
resumeOffset: safeIntegerSchema.optional(),
|
|
69
70
|
composerAttachment: z
|