@zackbart/connecta 0.6.1 → 0.7.1
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/CHANGELOG.md +294 -0
- package/README.md +24 -20
- package/dist/auth/bearer.d.ts +4 -3
- package/dist/auth/bearer.d.ts.map +1 -1
- package/dist/auth/bearer.js +10 -8
- package/dist/auth/bearer.js.map +1 -1
- package/dist/auth/clerk.d.ts +8 -7
- package/dist/auth/clerk.d.ts.map +1 -1
- package/dist/auth/clerk.js +27 -8
- package/dist/auth/clerk.js.map +1 -1
- package/dist/connector-scope.d.ts +13 -0
- package/dist/connector-scope.d.ts.map +1 -0
- package/dist/connector-scope.js +35 -0
- package/dist/connector-scope.js.map +1 -0
- package/dist/connectors/api.d.ts +5 -5
- package/dist/connectors/api.d.ts.map +1 -1
- package/dist/connectors/remote-mcp.d.ts +27 -4
- package/dist/connectors/remote-mcp.d.ts.map +1 -1
- package/dist/connectors/remote-mcp.js +400 -19
- package/dist/connectors/remote-mcp.js.map +1 -1
- package/dist/credential-health.d.ts +8 -5
- package/dist/credential-health.d.ts.map +1 -1
- package/dist/credential-health.js +99 -51
- package/dist/credential-health.js.map +1 -1
- package/dist/credentials.d.ts +51 -2
- package/dist/credentials.d.ts.map +1 -1
- package/dist/credentials.js +68 -3
- package/dist/credentials.js.map +1 -1
- package/dist/execute.d.ts.map +1 -1
- package/dist/execute.js +10 -8
- package/dist/execute.js.map +1 -1
- package/dist/index.d.ts +84 -83
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +74 -24
- package/dist/index.js.map +1 -1
- package/dist/meta-tools.d.ts +28 -3
- package/dist/meta-tools.d.ts.map +1 -1
- package/dist/meta-tools.js +131 -16
- package/dist/meta-tools.js.map +1 -1
- package/dist/registry.d.ts +3 -2
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +4 -3
- package/dist/registry.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +152 -52
- package/dist/server.js.map +1 -1
- package/dist/toolkits.js +1 -1
- package/dist/types.d.ts +41 -27
- package/dist/types.d.ts.map +1 -1
- package/dist/ui.d.ts +24 -10
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +594 -172
- package/dist/ui.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -2
- package/src/auth/bearer.ts +10 -8
- package/src/auth/clerk.ts +28 -9
- package/src/connector-scope.ts +41 -0
- package/src/connectors/api.ts +5 -5
- package/src/connectors/remote-mcp.ts +489 -35
- package/src/credential-health.ts +120 -57
- package/src/credentials.ts +96 -3
- package/src/execute.ts +18 -7
- package/src/index.ts +174 -107
- package/src/meta-tools.ts +173 -24
- package/src/registry.ts +4 -3
- package/src/server.ts +191 -70
- package/src/toolkits.ts +1 -1
- package/src/types.ts +41 -27
- package/src/ui.ts +631 -170
- package/src/version.ts +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ export interface ConnectorCredentialFieldConfig {
|
|
|
52
52
|
name: string;
|
|
53
53
|
/** Short field label, e.g. "Account email". */
|
|
54
54
|
label: string;
|
|
55
|
-
/** Plain-language guidance shown in /
|
|
55
|
+
/** Plain-language guidance shown in /credentials. Never include the credential itself. */
|
|
56
56
|
description?: string;
|
|
57
57
|
/** Input placeholder, e.g. "you@example.com". */
|
|
58
58
|
placeholder?: string;
|
|
@@ -63,7 +63,7 @@ export interface ConnectorCredentialFieldConfig {
|
|
|
63
63
|
export interface ConnectorCredentialConfig {
|
|
64
64
|
/** Short group or field label, e.g. "API token" or "Service credentials". */
|
|
65
65
|
label: string;
|
|
66
|
-
/** Plain-language guidance shown in /
|
|
66
|
+
/** Plain-language guidance shown in /credentials. Never include the credential itself. */
|
|
67
67
|
description?: string;
|
|
68
68
|
/** Password-field placeholder, e.g. "Paste API token". */
|
|
69
69
|
placeholder?: string;
|
|
@@ -86,13 +86,14 @@ export interface ConnectorContext {
|
|
|
86
86
|
/**
|
|
87
87
|
* Read-only access to this connector's operator-managed credential. Present
|
|
88
88
|
* only when the connector declares `credential` and the deployment configures
|
|
89
|
-
* `
|
|
89
|
+
* `credentials.encryptionKey`.
|
|
90
90
|
*/
|
|
91
91
|
credential?: ConnectorCredentialAccess;
|
|
92
92
|
/**
|
|
93
93
|
* Identity shared by connector calls that belong to one inbound request.
|
|
94
94
|
* Connectors may use it to reuse request-safe resources within that request,
|
|
95
|
-
* but must never retain I/O resources beyond the scope's lifetime.
|
|
95
|
+
* but must never retain I/O resources beyond the scope's lifetime. For
|
|
96
|
+
* probe-only scopes the core owns, `Connector.closeScope` signals that end.
|
|
96
97
|
*
|
|
97
98
|
* Optional for custom/test contexts; the context object itself is the scope
|
|
98
99
|
* when omitted.
|
|
@@ -121,7 +122,7 @@ export interface Connector {
|
|
|
121
122
|
/**
|
|
122
123
|
* Max inline result size (bytes) for this connector's tools before
|
|
123
124
|
* call_tool/batch_call truncate and stash the full text for get_result
|
|
124
|
-
* paging. Overrides
|
|
125
|
+
* paging. Overrides `ConnectaConfig.calls.maxResultBytes`;
|
|
125
126
|
* omit to inherit it (which itself defaults to 50_000). Must be a whole
|
|
126
127
|
* number of bytes >= 1; anything else warns at startup and is ignored, so
|
|
127
128
|
* the connector inherits the deployment-wide cap.
|
|
@@ -135,11 +136,11 @@ export interface Connector {
|
|
|
135
136
|
* and imperative; it is read by agents, not operators.
|
|
136
137
|
*/
|
|
137
138
|
usageGuide?: string;
|
|
138
|
-
/** Optional operator-managed credential slot rendered
|
|
139
|
+
/** Optional operator-managed credential slot rendered on /credentials. */
|
|
139
140
|
credential?: ConnectorCredentialConfig;
|
|
140
|
-
/** Optional server-side check used by /
|
|
141
|
+
/** Optional server-side check used by /credentials' Test action. */
|
|
141
142
|
testCredential?(value: string, ctx: ConnectorContext): Promise<CredentialTestResult>;
|
|
142
|
-
/** Optional multi-field credential check used by /
|
|
143
|
+
/** Optional multi-field credential check used by /credentials' Test action. */
|
|
143
144
|
testCredentials?(values: ConnectorCredentialValues, ctx: ConnectorContext): Promise<CredentialTestResult>;
|
|
144
145
|
/**
|
|
145
146
|
* Optional: whether this connector currently holds a stored downstream
|
|
@@ -162,6 +163,18 @@ export interface Connector {
|
|
|
162
163
|
staticTools?: ToolDef[];
|
|
163
164
|
listTools(ctx: ConnectorContext): Promise<ToolDef[]>;
|
|
164
165
|
callTool(name: string, args: unknown, ctx: ConnectorContext): Promise<unknown>;
|
|
166
|
+
/**
|
|
167
|
+
* Optional best-effort teardown for resources retained under
|
|
168
|
+
* `ctx.requestScope`. The core calls this at most once when a scope it created
|
|
169
|
+
* solely for probing ends, and never uses that scope again. Teardown gets a
|
|
170
|
+
* small, fixed best-effort completion window; a missing, rejected, or
|
|
171
|
+
* never-settling hook cannot change or hold open the operation's result
|
|
172
|
+
* beyond that bound.
|
|
173
|
+
*
|
|
174
|
+
* Per-request `/mcp` scopes are not closed through this hook: their
|
|
175
|
+
* request-local reuse remains in force until the request boundary.
|
|
176
|
+
*/
|
|
177
|
+
closeScope?(ctx: ConnectorContext): Promise<void>;
|
|
165
178
|
/** Optional connector-level health/auth status for list_connectors. */
|
|
166
179
|
status?(ctx: ConnectorContext): Promise<ConnectorStatus>;
|
|
167
180
|
/**
|
|
@@ -174,11 +187,11 @@ export interface Connector {
|
|
|
174
187
|
force?: boolean;
|
|
175
188
|
}): Promise<ConnectorStatus>;
|
|
176
189
|
/**
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
* complete consent with their own account.
|
|
190
|
+
* Verify the OAuth `state` returned to /oauth/callback/<id> against the value
|
|
191
|
+
* this connector generated when it started the flow. Required whenever
|
|
192
|
+
* `finishAuth` is present: the callback rejects before `finishAuth` when this
|
|
193
|
+
* hook is absent, throws, or returns false — otherwise anyone holding the
|
|
194
|
+
* pending URL could complete consent with their own account.
|
|
182
195
|
*/
|
|
183
196
|
verifyState?(state: string | null, ctx: ConnectorContext): Promise<boolean>;
|
|
184
197
|
/** Optional: complete a downstream OAuth flow (called by /oauth/callback/<id>). */
|
|
@@ -187,7 +200,8 @@ export interface Connector {
|
|
|
187
200
|
* Optional: serve a connector-owned HTTP route — for example a signed
|
|
188
201
|
* download link minted by one of the connector's tools. Called only after
|
|
189
202
|
* every built-in route misses, so a connector can never shadow `/mcp`,
|
|
190
|
-
* `/
|
|
203
|
+
* `/`, `/credentials`, `/activity`, `/health`, or the credential API. The
|
|
204
|
+
* first connector to return a
|
|
191
205
|
* Response wins, in registration order; return null to decline.
|
|
192
206
|
*
|
|
193
207
|
* These routes are PUBLIC: connecta applies no auth gate to them. A
|
|
@@ -219,9 +233,9 @@ export interface Executor {
|
|
|
219
233
|
}
|
|
220
234
|
/**
|
|
221
235
|
* Which toolkits one inbound identity may open — the membership half of the
|
|
222
|
-
* deployment=org / toolkit=team framing (
|
|
223
|
-
* engine: one identity → the toolkit names it may select, plus whether
|
|
224
|
-
* connect with no `?toolkit=` at all.
|
|
236
|
+
* deployment=org / toolkit=team framing (docs/toolkits.md). A mapping, never a
|
|
237
|
+
* policy engine: one identity → the toolkit names it may select, plus whether
|
|
238
|
+
* it may connect with no `?toolkit=` at all.
|
|
225
239
|
*
|
|
226
240
|
* An identity with NO binding is unbound and keeps the pre-binding behavior:
|
|
227
241
|
* any declared toolkit, or the full registry. A binding is enforced at connect
|
|
@@ -268,14 +282,14 @@ export type UiAuthConfig = {
|
|
|
268
282
|
kind: "clerk";
|
|
269
283
|
publishableKey: string;
|
|
270
284
|
/**
|
|
271
|
-
* Origin
|
|
285
|
+
* Origin the operator shell fetches its browser sign-in loader from. **Must be an absolute
|
|
272
286
|
* `https:` URL** — the value lands in a `<script src>`, so the gate is
|
|
273
287
|
* stricter than the branding href gate: no `http:`, no loopback exemption, and
|
|
274
288
|
* no root-relative form (a relative path is rejected, not resolved). The
|
|
275
289
|
* shipped `clerkAuth` adapter derives this from the publishable key and
|
|
276
290
|
* Clerk's Frontend API is always https, so nothing legitimate needs a
|
|
277
291
|
* carve-out. A value that fails the gate reaches neither the loader tag nor
|
|
278
|
-
* the page's inline auth config:
|
|
292
|
+
* the page's inline auth config: operator pages render without it and report
|
|
279
293
|
* that Clerk could not load, and `createConnecta` names the drop in a startup
|
|
280
294
|
* warning.
|
|
281
295
|
*/
|
|
@@ -286,7 +300,7 @@ export type UiAuthConfig = {
|
|
|
286
300
|
* this value is where Clerk *navigates* the operator's browser. An Account
|
|
287
301
|
* Portal address is always https, so the stricter gate costs nothing real: a
|
|
288
302
|
* value that fails it (a `javascript:`/`data:` payload, a cleartext `http:`
|
|
289
|
-
* address, a relative path) reaches no part of the page,
|
|
303
|
+
* address, a relative path) reaches no part of the page, the shell signs in
|
|
290
304
|
* through Clerk's default instead, and `createConnecta` names the drop in a
|
|
291
305
|
* startup warning.
|
|
292
306
|
*/
|
|
@@ -308,7 +322,7 @@ export interface ConnectaBranding {
|
|
|
308
322
|
ownerName?: string;
|
|
309
323
|
/** Optional link for the organization or owner label. */
|
|
310
324
|
ownerUrl?: string;
|
|
311
|
-
/**
|
|
325
|
+
/** Operator-page introduction and meta description. */
|
|
312
326
|
description?: string;
|
|
313
327
|
/**
|
|
314
328
|
* Browser tab title and page meta name. Defaults to
|
|
@@ -336,16 +350,16 @@ export interface ConnectaBranding {
|
|
|
336
350
|
export interface InboundAuth {
|
|
337
351
|
kind: string;
|
|
338
352
|
/**
|
|
339
|
-
* Optional browser sign-in configuration. When present,
|
|
353
|
+
* Optional browser sign-in configuration. When present, operator pages use it
|
|
340
354
|
* provider instead of asking the operator to paste a static bearer secret.
|
|
341
355
|
*/
|
|
342
356
|
uiAuth?: UiAuthConfig;
|
|
343
357
|
/**
|
|
344
|
-
* Optional toolkit binding for every identity this provider admits
|
|
345
|
-
* Declared statically so `createConnecta` can validate the
|
|
346
|
-
* `ConnectaConfig.toolkits` and throw on a typo — a binding
|
|
347
|
-
* not one an operator can reason about. An `authorize` result
|
|
348
|
-
* per identity with its own `toolkitBinding`.
|
|
358
|
+
* Optional toolkit binding for every identity this provider admits
|
|
359
|
+
* (docs/toolkits.md). Declared statically so `createConnecta` can validate the
|
|
360
|
+
* names against `ConnectaConfig.toolkits` and throw on a typo — a binding
|
|
361
|
+
* nobody wrote is not one an operator can reason about. An `authorize` result
|
|
362
|
+
* may narrow it per identity with its own `toolkitBinding`.
|
|
349
363
|
*/
|
|
350
364
|
toolkitBinding?: ToolkitBinding;
|
|
351
365
|
/** Serve/short-circuit .well-known + OPTIONS. Return null when not handled. */
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,sDAAsD;AACtD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD,+DAA+D;AAC/D,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACzC,GAAG,CACD,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,GAC7B,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChC,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC/B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC/B,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WA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,CAAC,EAAE,YAAY,CAAC;IACtB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,+EAA+E;IAC/E,cAAc,CAAC,CACb,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,GACd,QAAQ,GAAG,IAAI,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IAC9C,sCAAsC;IACtC,SAAS,CACP,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,GACd,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CACrC"}
|
package/dist/ui.d.ts
CHANGED
|
@@ -37,8 +37,8 @@ export declare function isSafeHttpUrl(url: unknown): boolean;
|
|
|
37
37
|
* default href is the relative `/favicon.svg`, which `isSafeHttpUrl` alone would
|
|
38
38
|
* reject — and it is kept narrow on both ends.
|
|
39
39
|
*
|
|
40
|
-
* Root-relative only, because
|
|
41
|
-
* depths and a document-relative path would resolve differently
|
|
40
|
+
* Root-relative only, because operator and OAuth callback pages sit at
|
|
41
|
+
* different depths and a document-relative path would resolve differently.
|
|
42
42
|
*
|
|
43
43
|
* "Root-relative" is enforced structurally: exactly one leading `/` followed by
|
|
44
44
|
* a character that is neither `/` nor `\`. Both of those would make the value an
|
|
@@ -52,7 +52,7 @@ export declare function isSafeHttpUrl(url: unknown): boolean;
|
|
|
52
52
|
export declare function isSafeIconHref(href: unknown): boolean;
|
|
53
53
|
/**
|
|
54
54
|
* True only for an absolute `https:` URL — the gate every `uiAuth` URL passes:
|
|
55
|
-
* `frontendApiUrl`, which becomes the
|
|
55
|
+
* `frontendApiUrl`, which becomes the operator shell's sign-in loader source,
|
|
56
56
|
* and `signInUrl`/`signUpUrl`, which ClerkJS uses as *navigation targets* when
|
|
57
57
|
* the operator signs in. With those three gated, no operator-config value
|
|
58
58
|
* reaches the browser in a URL position — attribute or navigation — without
|
|
@@ -61,7 +61,7 @@ export declare function isSafeIconHref(href: unknown): boolean;
|
|
|
61
61
|
* Stricter than `isSafeHttpUrl` on purpose: no `http:` carve-out, no loopback
|
|
62
62
|
* carve-out, and no relative form. Nobody types `frontendApiUrl` — the shipped
|
|
63
63
|
* Clerk adapter derives it from the publishable key, and Clerk's Frontend API is
|
|
64
|
-
* always https — and a cleartext script source on
|
|
64
|
+
* always https — and a cleartext script source on an operator page would be a
|
|
65
65
|
* downgrade even where a browser's mixed-content rules had not already blocked
|
|
66
66
|
* it. `signInUrl`/`signUpUrl` *are* typed by the operator, but what belongs
|
|
67
67
|
* there is a hosted Account Portal address (`https://accounts.<domain>` or
|
|
@@ -137,6 +137,12 @@ export interface UiConnector {
|
|
|
137
137
|
updatedAt?: string;
|
|
138
138
|
testable: boolean;
|
|
139
139
|
error?: string;
|
|
140
|
+
/**
|
|
141
|
+
* Something true and non-blocking about a working credential — today, that
|
|
142
|
+
* the vault still holds fields the connector has stopped declaring.
|
|
143
|
+
* Distinct from `error`, which means the credential cannot be used.
|
|
144
|
+
*/
|
|
145
|
+
notice?: string;
|
|
140
146
|
};
|
|
141
147
|
}
|
|
142
148
|
export interface UiData {
|
|
@@ -146,7 +152,17 @@ export interface UiData {
|
|
|
146
152
|
};
|
|
147
153
|
connectors: UiConnector[];
|
|
148
154
|
activityEnabled: boolean;
|
|
155
|
+
credentialManagement: CredentialManagementCapability;
|
|
149
156
|
}
|
|
157
|
+
export type CredentialManagementCapability = "available" | "requires_clerk" | "vault_not_configured" | "no_slots";
|
|
158
|
+
export type OperatorPage = "connections" | "credentials" | "activity";
|
|
159
|
+
export declare function operatorPageForPath(path: string): OperatorPage | undefined;
|
|
160
|
+
export declare function operatorPageTitle(page: OperatorPage, configuredTitle: string): string;
|
|
161
|
+
export declare function credentialManagementCapability(input: {
|
|
162
|
+
eligibleClerkOperator: boolean;
|
|
163
|
+
hasCredentialSlots: boolean;
|
|
164
|
+
hasCredentialVault: boolean;
|
|
165
|
+
}): CredentialManagementCapability;
|
|
150
166
|
export interface FilteredUiConnector {
|
|
151
167
|
connector: UiConnector;
|
|
152
168
|
tools: UiTool[];
|
|
@@ -165,13 +181,11 @@ export declare function filterUiConnectors(connectors: UiConnector[], query: str
|
|
|
165
181
|
export declare function buildUiData(registry: Registry, baseUrl: string, serverInfo: {
|
|
166
182
|
name: string;
|
|
167
183
|
version: string;
|
|
168
|
-
}, credentialVault?: CredentialVault, activityEnabled?: boolean): Promise<UiData>;
|
|
184
|
+
}, credentialVault?: CredentialVault, activityEnabled?: boolean, credentialManagement?: CredentialManagementCapability): Promise<UiData>;
|
|
169
185
|
/**
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
* normal sign-in flow and a short-lived session token; bearer-only deployments
|
|
173
|
-
* retain the manual-token fallback.
|
|
186
|
+
* Every operator page serves this same data-free shell. Connector, credential,
|
|
187
|
+
* and activity data arrives only through the authenticated `/ui/*` APIs.
|
|
174
188
|
*/
|
|
175
|
-
export declare function renderUiHtml(uiAuth?: UiAuthConfig, mcpUrl?: string, branding?: ConnectaBranding, nonce?: string): string;
|
|
189
|
+
export declare function renderUiHtml(uiAuth?: UiAuthConfig, mcpUrl?: string, branding?: ConnectaBranding, nonce?: string, page?: OperatorPage): string;
|
|
176
190
|
export {};
|
|
177
191
|
//# sourceMappingURL=ui.d.ts.map
|
package/dist/ui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEjE,8CAA8C;AAC9C,eAAO,MAAM,oBAAoB,gRAM1B,CAAC;AAER,UAAU,gBAAgB;IACxB,W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