@forumone/throughline-plugin-contract 0.2.1 → 0.4.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/LICENSE +21 -0
- package/README.md +3 -3
- package/dist/index.d.ts +9 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp.d.ts +19 -0
- package/dist/mcp.d.ts.map +1 -1
- package/package.json +12 -12
- package/dist/auth.d.ts +0 -19
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js +0 -2
- package/dist/auth.js.map +0 -1
- package/dist/example-plugin-pattern.d.ts +0 -12
- package/dist/example-plugin-pattern.d.ts.map +0 -1
- package/dist/example-plugin-pattern.js +0 -58
- package/dist/example-plugin-pattern.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Forum One Communications Corporation
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -5,9 +5,9 @@ Shared type contracts every Throughline core plugin satisfies, plus the cross-pl
|
|
|
5
5
|
## What's in here
|
|
6
6
|
|
|
7
7
|
- `CorePlugin<Options>` — the Payload plugin signature every core package exports
|
|
8
|
-
- `BaseCorePluginOptions` — options every plugin accepts (`enabled`, `
|
|
9
|
-
- `McpToolDefinition`, `McpToolContext`, `McpMeta` — the MCP
|
|
10
|
-
- `
|
|
8
|
+
- `BaseCorePluginOptions` — options every plugin accepts (`enabled`, `logger`, and `routePrefix` for a plugin that serves HTTP endpoints of its own)
|
|
9
|
+
- `McpToolDefinition`, `McpToolContext`, `McpMeta` — the MCP tool surface
|
|
10
|
+
- `AuthenticatedUser` — the actor a tool handler receives
|
|
11
11
|
- `getPluginRegistry` — the runtime registry plugins use to announce themselves and check for sibling plugins
|
|
12
12
|
- `examplePlugin` — a reference implementation showing the exact shape every future plugin follows
|
|
13
13
|
|
package/dist/index.d.ts
CHANGED
|
@@ -7,9 +7,15 @@ export interface BaseCorePluginOptions {
|
|
|
7
7
|
/** Enable or disable the plugin without removing it from the config. Defaults to `true`. */
|
|
8
8
|
enabled?: boolean;
|
|
9
9
|
/**
|
|
10
|
-
* Route prefix the plugin mounts its
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* Route prefix the plugin mounts its HTTP endpoints under. Defaults to a
|
|
11
|
+
* plugin-specific value (e.g. `/api/publishing`). Override to avoid
|
|
12
|
+
* collisions or to expose under a different path.
|
|
13
|
+
*
|
|
14
|
+
* MCP is not among those endpoints any more: tools reach a client through
|
|
15
|
+
* the host's `@payloadcms/plugin-mcp`, on one `/api/mcp`. A plugin serving
|
|
16
|
+
* no HTTP endpoints of its own omits this option rather than accepting one
|
|
17
|
+
* it cannot honour — see `auditQueryPlugin`, `componentsPlugin` and
|
|
18
|
+
* `integrationsPlugin`.
|
|
13
19
|
*/
|
|
14
20
|
routePrefix?: string;
|
|
15
21
|
/** Logger used for plugin diagnostics. Falls back to a console logger if omitted. */
|
|
@@ -27,7 +33,5 @@ export interface Logger {
|
|
|
27
33
|
*/
|
|
28
34
|
export type CorePlugin<Options extends BaseCorePluginOptions = BaseCorePluginOptions> = (options: Options) => Plugin;
|
|
29
35
|
export * from './mcp.js';
|
|
30
|
-
export * from './auth.js';
|
|
31
36
|
export * from './registry.js';
|
|
32
|
-
export * from './example-plugin-pattern.js';
|
|
33
37
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,4FAA4F;IAC5F,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,4FAA4F;IAC5F,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qFAAqF;IACrF,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IACnE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IAClE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IAClE,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;CACpE;AAED;;;GAGG;AACH,MAAM,MAAM,UAAU,CAAC,OAAO,SAAS,qBAAqB,GAAG,qBAAqB,IAAI,CACtF,OAAO,EAAE,OAAO,KACb,MAAM,CAAA;AAEX,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAwCA,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA"}
|
package/dist/mcp.d.ts
CHANGED
|
@@ -10,6 +10,25 @@ export interface McpToolDefinition<Input extends z.ZodType = z.ZodType, Output =
|
|
|
10
10
|
description: string;
|
|
11
11
|
/** Zod schema for the input; used for validation and for generating the MCP tool schema. */
|
|
12
12
|
inputSchema: Input;
|
|
13
|
+
/**
|
|
14
|
+
* The API-key scope a caller must hold, e.g. `'publishing.execute'`.
|
|
15
|
+
*
|
|
16
|
+
* Declared on the consequential tools — the ones that write, publish or
|
|
17
|
+
* decide. A tool with no `requiredScope` is callable by any authenticated
|
|
18
|
+
* key, which is the right default for a read.
|
|
19
|
+
*
|
|
20
|
+
* **Nothing enforces this today.** The per-server JSON-RPC handler that read
|
|
21
|
+
* it is gone, and `@payloadcms/plugin-mcp` gates on per-key checkboxes it
|
|
22
|
+
* generates at config time instead — which this suite cannot fill, because
|
|
23
|
+
* every tool is built at `onInit`. So a key that authenticates reaches every
|
|
24
|
+
* collected tool.
|
|
25
|
+
*
|
|
26
|
+
* Kept, rather than deleted with its enforcer, because this is the tool → scope
|
|
27
|
+
* mapping those checkboxes need: it is the input to restoring gating, not a
|
|
28
|
+
* leftover. Deleting it would mean re-deriving eleven declarations by hand.
|
|
29
|
+
* Tracked as #78.
|
|
30
|
+
*/
|
|
31
|
+
requiredScope?: string;
|
|
13
32
|
/** Handler invoked with validated input plus per-request context. */
|
|
14
33
|
handler: (input: z.infer<Input>, context: McpToolContext) => Promise<Output>;
|
|
15
34
|
}
|
package/dist/mcp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAExC;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,KAAK,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IACtF,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAA;IACZ,uFAAuF;IACvF,WAAW,EAAE,MAAM,CAAA;IACnB,4FAA4F;IAC5F,WAAW,EAAE,KAAK,CAAA;IAClB,qEAAqE;IACrE,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CAC7E;AAED,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAC9B,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAA;IAClB,uDA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ClB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forumone/throughline-plugin-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Shared plugin and MCP contract types and the cross-plugin registry for @forumone/throughline core packages.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -24,22 +24,22 @@
|
|
|
24
24
|
"files": [
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
|
-
"scripts": {
|
|
28
|
-
"build": "tsc -b",
|
|
29
|
-
"dev": "tsc -b -w",
|
|
30
|
-
"clean": "rm -rf dist .turbo *.tsbuildinfo",
|
|
31
|
-
"typecheck": "tsc --noEmit",
|
|
32
|
-
"lint": "eslint src"
|
|
33
|
-
},
|
|
34
27
|
"dependencies": {
|
|
35
28
|
"payload": "^3.0.0",
|
|
36
29
|
"zod": "^3.23.0"
|
|
37
30
|
},
|
|
38
31
|
"devDependencies": {
|
|
39
|
-
"@forumone/throughline-eslint-config": "workspace:*",
|
|
40
|
-
"@forumone/throughline-tsconfig": "workspace:*",
|
|
41
32
|
"@types/node": "^20.17.0",
|
|
42
33
|
"eslint": "^9.15.0",
|
|
43
|
-
"typescript": "^5.6.0"
|
|
34
|
+
"typescript": "^5.6.0",
|
|
35
|
+
"@forumone/throughline-eslint-config": "0.0.0",
|
|
36
|
+
"@forumone/throughline-tsconfig": "0.0.0"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsc -b",
|
|
40
|
+
"dev": "tsc -b -w",
|
|
41
|
+
"clean": "rm -rf dist .turbo *.tsbuildinfo",
|
|
42
|
+
"typecheck": "tsc --noEmit",
|
|
43
|
+
"lint": "eslint src"
|
|
44
44
|
}
|
|
45
|
-
}
|
|
45
|
+
}
|
package/dist/auth.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { AuthenticatedUser } from './mcp.js';
|
|
2
|
-
/**
|
|
3
|
-
* Validates an incoming MCP request and resolves the caller's identity.
|
|
4
|
-
* Plugins accept an optional `authenticator` option; if omitted they fall
|
|
5
|
-
* back to the default Payload bearer-token authenticator.
|
|
6
|
-
*/
|
|
7
|
-
export interface McpAuthenticator {
|
|
8
|
-
/**
|
|
9
|
-
* Inspects the `Authorization` header on the request and returns an
|
|
10
|
-
* {@link McpAuthResult} if the token is valid, or `null` otherwise.
|
|
11
|
-
*/
|
|
12
|
-
authenticate(request: Request): Promise<McpAuthResult | null>;
|
|
13
|
-
}
|
|
14
|
-
export interface McpAuthResult {
|
|
15
|
-
user: AuthenticatedUser;
|
|
16
|
-
apiKeyName: string;
|
|
17
|
-
apiKeyId: string;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=auth.d.ts.map
|
package/dist/auth.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAEjD;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAA;CAC9D;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,iBAAiB,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;CACjB"}
|
package/dist/auth.js
DELETED
package/dist/auth.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":""}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { BaseCorePluginOptions, CorePlugin } from './index.js';
|
|
2
|
-
/**
|
|
3
|
-
* EXAMPLE ONLY — not a real plugin. Reference implementation showing the
|
|
4
|
-
* shape every Throughline core plugin follows. Every future plugin should
|
|
5
|
-
* lift this structure and fill in the feature-specific parts.
|
|
6
|
-
*/
|
|
7
|
-
export interface ExamplePluginOptions extends BaseCorePluginOptions {
|
|
8
|
-
/** A plugin-specific option. */
|
|
9
|
-
greeting?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare const examplePlugin: CorePlugin<ExamplePluginOptions>;
|
|
12
|
-
//# sourceMappingURL=example-plugin-pattern.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"example-plugin-pattern.d.ts","sourceRoot":"","sources":["../src/example-plugin-pattern.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAGnE;;;;GAIG;AAEH,MAAM,WAAW,oBAAqB,SAAQ,qBAAqB;IACjE,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAKD,eAAO,MAAM,aAAa,EAAE,UAAU,CAAC,oBAAoB,CAuD1D,CAAA"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { getPluginRegistry } from './registry.js';
|
|
2
|
-
const EXAMPLE_PLUGIN_ID = '@forumone/throughline-example';
|
|
3
|
-
const EXAMPLE_PLUGIN_VERSION = '0.0.0';
|
|
4
|
-
export const examplePlugin = (options) => {
|
|
5
|
-
return (incomingConfig) => {
|
|
6
|
-
// Step 1 — honour the disabled flag before doing any work.
|
|
7
|
-
if (options.enabled === false)
|
|
8
|
-
return incomingConfig;
|
|
9
|
-
// Step 2 — apply defaults. Note: route prefixes here MUST NOT include
|
|
10
|
-
// `/api` — Payload mounts top-level endpoints under its API base
|
|
11
|
-
// (default `/api`), so the user-facing URL becomes `/api/example/mcp`.
|
|
12
|
-
const greeting = options.greeting ?? 'Hello';
|
|
13
|
-
const routePrefix = options.routePrefix ?? '/example';
|
|
14
|
-
// Step 3 — extend the incoming config by spreading and appending.
|
|
15
|
-
// Never replace existing arrays; always concatenate.
|
|
16
|
-
return {
|
|
17
|
-
...incomingConfig,
|
|
18
|
-
collections: [
|
|
19
|
-
...(incomingConfig.collections ?? []),
|
|
20
|
-
// Plugin's own collections go here.
|
|
21
|
-
],
|
|
22
|
-
endpoints: [
|
|
23
|
-
...(incomingConfig.endpoints ?? []),
|
|
24
|
-
{
|
|
25
|
-
path: `${routePrefix}/mcp`,
|
|
26
|
-
method: 'post',
|
|
27
|
-
handler: async () => {
|
|
28
|
-
// Real plugins delegate this to an MCP server implementation.
|
|
29
|
-
return new Response(JSON.stringify({ greeting }), {
|
|
30
|
-
headers: { 'content-type': 'application/json' },
|
|
31
|
-
});
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
hooks: {
|
|
36
|
-
...(incomingConfig.hooks ?? {}),
|
|
37
|
-
afterError: [
|
|
38
|
-
...(incomingConfig.hooks?.afterError ?? []),
|
|
39
|
-
// Plugin's global error hooks go here.
|
|
40
|
-
],
|
|
41
|
-
},
|
|
42
|
-
onInit: async (payload) => {
|
|
43
|
-
// Always run any pre-existing onInit first so plugins compose cleanly.
|
|
44
|
-
if (incomingConfig.onInit) {
|
|
45
|
-
await incomingConfig.onInit(payload);
|
|
46
|
-
}
|
|
47
|
-
// Announce presence and assert required capabilities from siblings.
|
|
48
|
-
const registry = getPluginRegistry(payload);
|
|
49
|
-
registry.register({
|
|
50
|
-
id: EXAMPLE_PLUGIN_ID,
|
|
51
|
-
version: EXAMPLE_PLUGIN_VERSION,
|
|
52
|
-
capabilities: ['example'],
|
|
53
|
-
});
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
//# sourceMappingURL=example-plugin-pattern.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"example-plugin-pattern.js","sourceRoot":"","sources":["../src/example-plugin-pattern.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAajD,MAAM,iBAAiB,GAAG,+BAA+B,CAAA;AACzD,MAAM,sBAAsB,GAAG,OAAO,CAAA;AAEtC,MAAM,CAAC,MAAM,aAAa,GAAqC,CAAC,OAAO,EAAE,EAAE;IACzE,OAAO,CAAC,cAAsB,EAAU,EAAE;QACxC,2DAA2D;QAC3D,IAAI,OAAO,CAAC,OAAO,KAAK,KAAK;YAAE,OAAO,cAAc,CAAA;QAEpD,sEAAsE;QACtE,iEAAiE;QACjE,uEAAuE;QACvE,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAA;QAC5C,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,UAAU,CAAA;QAErD,kEAAkE;QAClE,8DAA8D;QAC9D,OAAO;YACL,GAAG,cAAc;YACjB,WAAW,EAAE;gBACX,GAAG,CAAC,cAAc,CAAC,WAAW,IAAI,EAAE,CAAC;gBACrC,oCAAoC;aACrC;YACD,SAAS,EAAE;gBACT,GAAG,CAAC,cAAc,CAAC,SAAS,IAAI,EAAE,CAAC;gBACnC;oBACE,IAAI,EAAE,GAAG,WAAW,MAAM;oBAC1B,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,KAAK,IAAI,EAAE;wBAClB,8DAA8D;wBAC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