@layernorm/overlay-agent-bridge-protocol 0.4.2 → 0.6.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/README.md +6 -7
- package/dist/index.d.ts +91 -8927
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -729
- package/dist/index.js.map +1 -1
- package/dist/local-tools.d.ts +540 -0
- package/dist/local-tools.d.ts.map +1 -0
- package/dist/local-tools.js +73 -0
- package/dist/local-tools.js.map +1 -0
- package/package.json +3 -3
- package/dist/drive-path.d.ts +0 -4
- package/dist/drive-path.d.ts.map +0 -1
- package/dist/drive-path.js +0 -16
- package/dist/drive-path.js.map +0 -1
- package/dist/drive-recovery.d.ts +0 -189
- package/dist/drive-recovery.d.ts.map +0 -1
- package/dist/drive-recovery.js +0 -14
- package/dist/drive-recovery.js.map +0 -1
- package/dist/drive.d.ts +0 -775
- package/dist/drive.d.ts.map +0 -1
- package/dist/drive.js +0 -81
- package/dist/drive.js.map +0 -1
- package/dist/mcp-approval-bridge.d.ts +0 -18
- package/dist/mcp-approval-bridge.d.ts.map +0 -1
- package/dist/mcp-approval-bridge.js +0 -43
- package/dist/mcp-approval-bridge.js.map +0 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z } from 'zod/v3';
|
|
2
|
+
/**
|
|
3
|
+
* Local tools: request/response tool calls Overlay sends to a host so the
|
|
4
|
+
* native Overlay harness can act on the machine the host runs on. This channel
|
|
5
|
+
* is independent of runs, adapters and ACP; a host with zero adapters can serve it.
|
|
6
|
+
*/
|
|
7
|
+
export const LOCAL_TOOLS_VERSION = 1;
|
|
8
|
+
export const MAX_LOCAL_TOOL_CALLS_PER_POLL = 10;
|
|
9
|
+
/** Results are stored in Convex documents; keep them well below the 1 MiB document limit. */
|
|
10
|
+
export const MAX_LOCAL_TOOL_RESULT_BYTES = 768 * 1024;
|
|
11
|
+
export const MAX_LOCAL_TOOL_REQUEST_BYTES = 640 * 1024;
|
|
12
|
+
export const LOCAL_TOOL_POLL_WAIT_MAX_MS = 20_000;
|
|
13
|
+
export const LOCAL_TOOL_FEATURES = ['exec', 'files', 'terminal', 'screenshot', 'input', 'browser'];
|
|
14
|
+
export const localToolsCapabilitySchema = z.object({
|
|
15
|
+
version: z.literal(LOCAL_TOOLS_VERSION),
|
|
16
|
+
os: z.enum(['darwin', 'linux', 'win32']),
|
|
17
|
+
features: z.array(z.enum(LOCAL_TOOL_FEATURES)).max(LOCAL_TOOL_FEATURES.length),
|
|
18
|
+
/** Real home directory, so the model can resolve `~` and default listings. */
|
|
19
|
+
homeDirectory: z.string().trim().min(1).max(4096),
|
|
20
|
+
}).strict();
|
|
21
|
+
const localPath = z.string().trim().min(1).max(4096).refine((value) => !value.includes('\0'), 'path must not contain NUL');
|
|
22
|
+
/** The driver commands mirror the cloud Computer driver so the same tools work on both targets. */
|
|
23
|
+
export const LOCAL_DRIVER_COMMANDS = [
|
|
24
|
+
'capabilities', 'screenshot', 'wait', 'click', 'move', 'drag', 'type', 'key', 'scroll',
|
|
25
|
+
'browser_ensure', 'browser', 'open_url',
|
|
26
|
+
'terminal_start', 'terminal_read', 'terminal_cancel', 'terminal_list',
|
|
27
|
+
];
|
|
28
|
+
export const localToolRequestSchema = z.discriminatedUnion('kind', [
|
|
29
|
+
z.object({
|
|
30
|
+
kind: z.literal('exec'),
|
|
31
|
+
command: z.string().min(1).max(100_000),
|
|
32
|
+
cwd: localPath.optional(),
|
|
33
|
+
timeoutMs: z.number().int().min(1_000).max(300_000),
|
|
34
|
+
}).strict(),
|
|
35
|
+
z.object({ kind: z.literal('read_file'), path: localPath, maxBytes: z.number().int().positive().max(512 * 1024) }).strict(),
|
|
36
|
+
z.object({ kind: z.literal('write_file'), path: localPath, contentsBase64: z.string().max(MAX_LOCAL_TOOL_REQUEST_BYTES) }).strict(),
|
|
37
|
+
z.object({ kind: z.literal('list_files'), path: localPath }).strict(),
|
|
38
|
+
z.object({
|
|
39
|
+
kind: z.literal('driver'),
|
|
40
|
+
command: z.enum(LOCAL_DRIVER_COMMANDS),
|
|
41
|
+
args: z.record(z.string(), z.unknown()),
|
|
42
|
+
}).strict(),
|
|
43
|
+
]);
|
|
44
|
+
const identifier = z.string().trim().min(1).max(200);
|
|
45
|
+
export const localToolCallSchema = z.object({
|
|
46
|
+
protocolVersion: z.literal(1),
|
|
47
|
+
callId: identifier,
|
|
48
|
+
environmentId: identifier,
|
|
49
|
+
workspaceId: identifier,
|
|
50
|
+
issuedAt: z.number().int().positive(),
|
|
51
|
+
/** The server stops waiting at this time; a host must not start a call after it. */
|
|
52
|
+
deadlineAt: z.number().int().positive(),
|
|
53
|
+
request: localToolRequestSchema,
|
|
54
|
+
}).strict();
|
|
55
|
+
export const localToolPollResponseSchema = z.object({
|
|
56
|
+
protocolVersion: z.literal(1),
|
|
57
|
+
calls: z.array(localToolCallSchema).max(MAX_LOCAL_TOOL_CALLS_PER_POLL),
|
|
58
|
+
}).strict();
|
|
59
|
+
export const localToolErrorSchema = z.object({
|
|
60
|
+
code: z.string().trim().min(1).max(100),
|
|
61
|
+
message: z.string().trim().min(1).max(2_000),
|
|
62
|
+
missing: z.array(z.string().trim().min(1).max(100)).max(20).optional(),
|
|
63
|
+
detail: z.record(z.string(), z.unknown()).optional(),
|
|
64
|
+
}).strict();
|
|
65
|
+
export const localToolResultSchema = z.object({
|
|
66
|
+
protocolVersion: z.literal(1),
|
|
67
|
+
callId: identifier,
|
|
68
|
+
outcome: z.discriminatedUnion('ok', [
|
|
69
|
+
z.object({ ok: z.literal(true), result: z.record(z.string(), z.unknown()) }).strict(),
|
|
70
|
+
z.object({ ok: z.literal(false), error: localToolErrorSchema }).strict(),
|
|
71
|
+
]),
|
|
72
|
+
}).strict();
|
|
73
|
+
//# sourceMappingURL=local-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-tools.js","sourceRoot":"","sources":["../src/local-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,C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|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layernorm/overlay-agent-bridge-protocol",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"description": "Enrollment, signed host request and local tool contracts for the Overlay Agent Host.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"typecheck": "tsc --noEmit"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"zod": "^
|
|
40
|
+
"zod": "^4.6.7"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"tsx": "^4.8.1",
|
package/dist/drive-path.d.ts
DELETED
package/dist/drive-path.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"drive-path.d.ts","sourceRoot":"","sources":["../src/drive-path.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAOxD;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGzD"}
|
package/dist/drive-path.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/** Portable wire paths. Reject aliases rather than silently normalizing file identity. */
|
|
2
|
-
export function drivePathSegments(path) {
|
|
3
|
-
if (!path || path.length > 4096 || path.includes('\\') || path.includes('\0') || path.startsWith('/'))
|
|
4
|
-
throw Error('DRIVE_UNSAFE_PATH');
|
|
5
|
-
const segments = path.split('/');
|
|
6
|
-
if (segments.some(segment => !segment || segment === '.' || segment === '..' || segment.length > 255
|
|
7
|
-
|| /[\u0000-\u001f\u007f<>:"|?*]/u.test(segment) || /[. ]$/.test(segment)
|
|
8
|
-
|| /^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(segment)))
|
|
9
|
-
throw Error('DRIVE_UNSAFE_PATH');
|
|
10
|
-
return segments;
|
|
11
|
-
}
|
|
12
|
-
export function portableDrivePathKey(path) {
|
|
13
|
-
drivePathSegments(path);
|
|
14
|
-
return path.normalize('NFC').toLowerCase();
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=drive-path.js.map
|
package/dist/drive-path.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"drive-path.js","sourceRoot":"","sources":["../src/drive-path.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,MAAM,KAAK,CAAC,mBAAmB,CAAC,CAAA;IACvI,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAChC,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,IAAI,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,CAAC,MAAM,GAAG,GAAG;WAC/F,+BAA+B,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;WACtE,+CAA+C,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAAE,MAAM,KAAK,CAAC,mBAAmB,CAAC,CAAA;IACrG,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,iBAAiB,CAAC,IAAI,CAAC,CAAA;IACvB,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAA;AAC5C,CAAC"}
|
package/dist/drive-recovery.d.ts
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/** Receipt lookup only: this request never grants authority to repeat an old write. */
|
|
3
|
-
export declare const driveRecoveryRequestSchema: z.ZodObject<{
|
|
4
|
-
kind: z.ZodEnum<["content", "metadata"]>;
|
|
5
|
-
fingerprint: z.ZodString;
|
|
6
|
-
requestId: z.ZodString;
|
|
7
|
-
previousExecution: z.ZodObject<{
|
|
8
|
-
attemptId: z.ZodString;
|
|
9
|
-
generation: z.ZodNumber;
|
|
10
|
-
}, "strict", z.ZodTypeAny, {
|
|
11
|
-
attemptId: string;
|
|
12
|
-
generation: number;
|
|
13
|
-
}, {
|
|
14
|
-
attemptId: string;
|
|
15
|
-
generation: number;
|
|
16
|
-
}>;
|
|
17
|
-
action: z.ZodLiteral<"recover">;
|
|
18
|
-
}, "strict", z.ZodTypeAny, {
|
|
19
|
-
kind: "metadata" | "content";
|
|
20
|
-
action: "recover";
|
|
21
|
-
requestId: string;
|
|
22
|
-
fingerprint: string;
|
|
23
|
-
previousExecution: {
|
|
24
|
-
attemptId: string;
|
|
25
|
-
generation: number;
|
|
26
|
-
};
|
|
27
|
-
}, {
|
|
28
|
-
kind: "metadata" | "content";
|
|
29
|
-
action: "recover";
|
|
30
|
-
requestId: string;
|
|
31
|
-
fingerprint: string;
|
|
32
|
-
previousExecution: {
|
|
33
|
-
attemptId: string;
|
|
34
|
-
generation: number;
|
|
35
|
-
};
|
|
36
|
-
}>;
|
|
37
|
-
export declare const driveRecoveryResultSchema: z.ZodObject<{
|
|
38
|
-
resolution: z.ZodDiscriminatedUnion<"state", [z.ZodObject<{
|
|
39
|
-
state: z.ZodLiteral<"uncommitted">;
|
|
40
|
-
}, "strict", z.ZodTypeAny, {
|
|
41
|
-
state: "uncommitted";
|
|
42
|
-
}, {
|
|
43
|
-
state: "uncommitted";
|
|
44
|
-
}>, z.ZodObject<{
|
|
45
|
-
state: z.ZodLiteral<"content_committed">;
|
|
46
|
-
uploadId: z.ZodString;
|
|
47
|
-
result: z.ZodObject<{
|
|
48
|
-
fileId: z.ZodString;
|
|
49
|
-
updatedAt: z.ZodNumber;
|
|
50
|
-
name: z.ZodString;
|
|
51
|
-
conflict: z.ZodBoolean;
|
|
52
|
-
objectStored: z.ZodBoolean;
|
|
53
|
-
sha256: z.ZodString;
|
|
54
|
-
sizeBytes: z.ZodNumber;
|
|
55
|
-
}, "strict", z.ZodTypeAny, {
|
|
56
|
-
fileId: string;
|
|
57
|
-
updatedAt: number;
|
|
58
|
-
name: string;
|
|
59
|
-
sha256: string;
|
|
60
|
-
sizeBytes: number;
|
|
61
|
-
conflict: boolean;
|
|
62
|
-
objectStored: boolean;
|
|
63
|
-
}, {
|
|
64
|
-
fileId: string;
|
|
65
|
-
updatedAt: number;
|
|
66
|
-
name: string;
|
|
67
|
-
sha256: string;
|
|
68
|
-
sizeBytes: number;
|
|
69
|
-
conflict: boolean;
|
|
70
|
-
objectStored: boolean;
|
|
71
|
-
}>;
|
|
72
|
-
}, "strict", z.ZodTypeAny, {
|
|
73
|
-
state: "content_committed";
|
|
74
|
-
uploadId: string;
|
|
75
|
-
result: {
|
|
76
|
-
fileId: string;
|
|
77
|
-
updatedAt: number;
|
|
78
|
-
name: string;
|
|
79
|
-
sha256: string;
|
|
80
|
-
sizeBytes: number;
|
|
81
|
-
conflict: boolean;
|
|
82
|
-
objectStored: boolean;
|
|
83
|
-
};
|
|
84
|
-
}, {
|
|
85
|
-
state: "content_committed";
|
|
86
|
-
uploadId: string;
|
|
87
|
-
result: {
|
|
88
|
-
fileId: string;
|
|
89
|
-
updatedAt: number;
|
|
90
|
-
name: string;
|
|
91
|
-
sha256: string;
|
|
92
|
-
sizeBytes: number;
|
|
93
|
-
conflict: boolean;
|
|
94
|
-
objectStored: boolean;
|
|
95
|
-
};
|
|
96
|
-
}>, z.ZodObject<{
|
|
97
|
-
state: z.ZodLiteral<"metadata_committed">;
|
|
98
|
-
result: z.ZodObject<{
|
|
99
|
-
fileId: z.ZodString;
|
|
100
|
-
updatedAt: z.ZodNumber;
|
|
101
|
-
}, "strict", z.ZodTypeAny, {
|
|
102
|
-
fileId: string;
|
|
103
|
-
updatedAt: number;
|
|
104
|
-
}, {
|
|
105
|
-
fileId: string;
|
|
106
|
-
updatedAt: number;
|
|
107
|
-
}>;
|
|
108
|
-
}, "strict", z.ZodTypeAny, {
|
|
109
|
-
state: "metadata_committed";
|
|
110
|
-
result: {
|
|
111
|
-
fileId: string;
|
|
112
|
-
updatedAt: number;
|
|
113
|
-
};
|
|
114
|
-
}, {
|
|
115
|
-
state: "metadata_committed";
|
|
116
|
-
result: {
|
|
117
|
-
fileId: string;
|
|
118
|
-
updatedAt: number;
|
|
119
|
-
};
|
|
120
|
-
}>]>;
|
|
121
|
-
requestId: z.ZodString;
|
|
122
|
-
previousExecution: z.ZodObject<{
|
|
123
|
-
attemptId: z.ZodString;
|
|
124
|
-
generation: z.ZodNumber;
|
|
125
|
-
}, "strict", z.ZodTypeAny, {
|
|
126
|
-
attemptId: string;
|
|
127
|
-
generation: number;
|
|
128
|
-
}, {
|
|
129
|
-
attemptId: string;
|
|
130
|
-
generation: number;
|
|
131
|
-
}>;
|
|
132
|
-
}, "strict", z.ZodTypeAny, {
|
|
133
|
-
requestId: string;
|
|
134
|
-
previousExecution: {
|
|
135
|
-
attemptId: string;
|
|
136
|
-
generation: number;
|
|
137
|
-
};
|
|
138
|
-
resolution: {
|
|
139
|
-
state: "uncommitted";
|
|
140
|
-
} | {
|
|
141
|
-
state: "content_committed";
|
|
142
|
-
uploadId: string;
|
|
143
|
-
result: {
|
|
144
|
-
fileId: string;
|
|
145
|
-
updatedAt: number;
|
|
146
|
-
name: string;
|
|
147
|
-
sha256: string;
|
|
148
|
-
sizeBytes: number;
|
|
149
|
-
conflict: boolean;
|
|
150
|
-
objectStored: boolean;
|
|
151
|
-
};
|
|
152
|
-
} | {
|
|
153
|
-
state: "metadata_committed";
|
|
154
|
-
result: {
|
|
155
|
-
fileId: string;
|
|
156
|
-
updatedAt: number;
|
|
157
|
-
};
|
|
158
|
-
};
|
|
159
|
-
}, {
|
|
160
|
-
requestId: string;
|
|
161
|
-
previousExecution: {
|
|
162
|
-
attemptId: string;
|
|
163
|
-
generation: number;
|
|
164
|
-
};
|
|
165
|
-
resolution: {
|
|
166
|
-
state: "uncommitted";
|
|
167
|
-
} | {
|
|
168
|
-
state: "content_committed";
|
|
169
|
-
uploadId: string;
|
|
170
|
-
result: {
|
|
171
|
-
fileId: string;
|
|
172
|
-
updatedAt: number;
|
|
173
|
-
name: string;
|
|
174
|
-
sha256: string;
|
|
175
|
-
sizeBytes: number;
|
|
176
|
-
conflict: boolean;
|
|
177
|
-
objectStored: boolean;
|
|
178
|
-
};
|
|
179
|
-
} | {
|
|
180
|
-
state: "metadata_committed";
|
|
181
|
-
result: {
|
|
182
|
-
fileId: string;
|
|
183
|
-
updatedAt: number;
|
|
184
|
-
};
|
|
185
|
-
};
|
|
186
|
-
}>;
|
|
187
|
-
export type DriveRecoveryRequest = z.infer<typeof driveRecoveryRequestSchema>;
|
|
188
|
-
export type DriveRecoveryResult = z.infer<typeof driveRecoveryResultSchema>;
|
|
189
|
-
//# sourceMappingURL=drive-recovery.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"drive-recovery.d.ts","sourceRoot":"","sources":["../src/drive-recovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAMrB,uFAAuF;AACvF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE5B,CAAA;AACX,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIzB,CAAA;AACb,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAC7E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA"}
|
package/dist/drive-recovery.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { driveContentResultSchema, driveMetadataResultSchema } from './drive.js';
|
|
3
|
-
const previousExecution = z.object({ attemptId: z.string().min(1).max(200), generation: z.number().int().positive() }).strict();
|
|
4
|
-
const identity = { requestId: z.string().regex(/^[A-Za-z0-9_-]{16,128}$/), previousExecution };
|
|
5
|
-
/** Receipt lookup only: this request never grants authority to repeat an old write. */
|
|
6
|
-
export const driveRecoveryRequestSchema = z.object({ action: z.literal('recover'), ...identity,
|
|
7
|
-
kind: z.enum(['content', 'metadata']), fingerprint: z.string().min(1).max(16384),
|
|
8
|
-
}).strict();
|
|
9
|
-
export const driveRecoveryResultSchema = z.object({ ...identity, resolution: z.discriminatedUnion('state', [
|
|
10
|
-
z.object({ state: z.literal('uncommitted') }).strict(),
|
|
11
|
-
z.object({ state: z.literal('content_committed'), uploadId: z.string().uuid(), result: driveContentResultSchema }).strict(),
|
|
12
|
-
z.object({ state: z.literal('metadata_committed'), result: driveMetadataResultSchema }).strict(),
|
|
13
|
-
]) }).strict();
|
|
14
|
-
//# sourceMappingURL=drive-recovery.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"drive-recovery.js","sourceRoot":"","sources":["../src/drive-recovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AACrB,OAAO,EAAC,wBAAwB,EAAE,yBAAyB,EAAC,MAAM,YAAY,CAAA;AAE9E,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAC,SA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