@plurnk/plurnk-execs 0.4.15 → 0.4.16
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/SPEC.md +20 -0
- package/dist/discover.d.ts.map +1 -1
- package/dist/discover.js +95 -28
- package/dist/discover.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/SPEC.md
CHANGED
|
@@ -118,6 +118,26 @@ Each entry's optional **`example`** is a one-line, self-documenting usage exampl
|
|
|
118
118
|
|
|
119
119
|
Each entry's optional **`documentation`** is full markdown — the flags, modes, and gotchas the one-liner can't carry. It is the depth a consumer can serve on demand, separate from the always-on `example` (progressive disclosure). The **source of truth is a `docs/<tag>.md` file** in the package (the docs convention; ship it via `files`), which `discover()` reads into `documentation`; the inline `documentation` manifest field is the fallback when no file ships. Defaults to `""`. The execs contract is the two fields; **how** the consumer surfaces them to the model — an in-context one-liner, the full doc fetched when the model wants it — is the consumer's (plurnk-service's) concern, not specified here.
|
|
120
120
|
|
|
121
|
+
### §3.1 Dynamic runtimes (per-deployment tags)
|
|
122
|
+
|
|
123
|
+
A package whose tags are not known at publish time — the MCP bridge is the motivating case, where each tag is a per-deployment MCP **server** an operator configures in the environment (plurnk-execs#10) — declares **`plurnk.runtimesModule`** (a path, relative to the package dir) **instead of** a static `plurnk.runtimes[]`:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"name": "@plurnk/plurnk-execs-mcp",
|
|
128
|
+
"plurnk": { "kind": "exec", "runtimesModule": "./dist/runtimes.js" }
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
The module's **`runtimes`** export (or its default export) is a hook `() => RuntimeDecl[] | Promise<RuntimeDecl[]>` returning the same decls a static manifest would (`{ name, glyph?, example?, documentation? }`). `discover()` imports and calls it at scan time and registers the result exactly as if the decls were static (a `docs/<tag>.md` file still wins over an inline `documentation`, though dynamic tags rarely ship one). The hook reads its own config from the environment — it must be cheap and **must not** depend on network reachability (that is `probe()`'s job, per server, at boot).
|
|
133
|
+
|
|
134
|
+
Two guarantees frame the hook:
|
|
135
|
+
|
|
136
|
+
- **Trust-gated execution.** The hook is imported **only for trusted packages** — the `PLURNK_PLUGINS_TRUSTED_ONLY` gate (below) runs *before* the import, so an untrusted package's code is never executed. This is the same in-process-trust posture executors already carry (their `run()` is trusted host code); dynamic discovery just extends it to scan time.
|
|
137
|
+
- **Fail-hard on a broken hook.** An unloadable module, a missing/non-function export, or a non-array return is a **contract violation by a trusted package** (its own packaging or config) and throws with the cause attached — surfaced, not swallowed. This is deliberately stricter than a malformed third-party `package.json`, which `discover()` silently skips: a package that *declares* a hook owns making it work.
|
|
138
|
+
|
|
139
|
+
`runtimes[]` and `runtimesModule` are mutually exclusive; if both are present the **static array wins** and the hook is never loaded.
|
|
140
|
+
|
|
121
141
|
**Trust gate.** `discover()` honors the host's **`PLURNK_PLUGINS_TRUSTED_ONLY`** env var (plurnk-service#229) — the one posture decided once and enforced across every scope-agnostic discovery surface (schemes/mimetypes/providers/execs). Unset/`""`/`0` → off: every installed package registers (no regression). Any value → on: `@plurnk/*` is always trusted, plus a comma-separated allowlist of additionally-trusted package names (`1` = on with zero third-party). An untrusted package is **discovered but not registered** — never a crash — and returned in **`Discovery.skipped`** (package names) so the consumer can emit a telemetry note (`discover()` has no sink of its own). The policy mirrors plurnk-service's `PluginTrust.isTrusted`; it's duplicated, not shared, since it can't cross the package boundary.
|
|
122
142
|
|
|
123
143
|
Each runtime package's **default export** is its `BaseExecutor` subclass (also a named export — `export { default as Sh }` / `export { default }`); the consumer instantiates it per matched tag with the tag + glyph from the registry.
|
package/dist/discover.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../src/discover.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../src/discover.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAyB,MAAM,YAAY,CAAC;AAwCpF,wBAAsB,QAAQ,CAAC,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,SAAS,CAAC,CA8BhF"}
|
package/dist/discover.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
1
9
|
import fs from "node:fs/promises";
|
|
2
10
|
import path from "node:path";
|
|
11
|
+
import { pathToFileURL } from "node:url";
|
|
3
12
|
// Scan installed executor packages and build the runtime-tag registry the
|
|
4
13
|
// consuming scheme dispatches on. Parallel to plurnk-mimetypes' discover().
|
|
5
14
|
//
|
|
@@ -14,9 +23,17 @@ import path from "node:path";
|
|
|
14
23
|
// consumer to note. Off by default — no regression.
|
|
15
24
|
//
|
|
16
25
|
// A package is recognized as an executor when its `package.json` declares
|
|
17
|
-
// `plurnk.kind === "exec"` and exposes one or more runtime tags
|
|
18
|
-
//
|
|
19
|
-
//
|
|
26
|
+
// `plurnk.kind === "exec"` and exposes one or more runtime tags. Tags come from
|
|
27
|
+
// one of two sources (SPEC §3):
|
|
28
|
+
// - STATIC: `plurnk.runtimes: { name, glyph?, example?, documentation? }[]` —
|
|
29
|
+
// the tags are known at publish time (sh, search, sqlite, …).
|
|
30
|
+
// - DYNAMIC: `plurnk.runtimesModule: "<rel-path>"` — for a package whose tags
|
|
31
|
+
// are per-deployment (the MCP bridge: one tag per configured server). The
|
|
32
|
+
// module's `runtimes` (or default) export is a hook discover() imports and
|
|
33
|
+
// calls at scan time to materialize the decls. Executed only for TRUSTED
|
|
34
|
+
// packages — the trust gate runs first, so an untrusted package's hook is
|
|
35
|
+
// never imported (plurnk-execs#10). A declared-but-broken hook is fail-hard.
|
|
36
|
+
// Each decl registers its tag separately; one package can claim many tags
|
|
20
37
|
// backed by the same handler (e.g. the search sibling claims `search`, `news`,
|
|
21
38
|
// `images`, …). `example` is a one-line self-documenting usage example
|
|
22
39
|
// (plurnk-execs#7); `documentation` is the fuller markdown a consumer can serve
|
|
@@ -35,14 +52,19 @@ export async function discover(options = {}) {
|
|
|
35
52
|
const registry = new Map();
|
|
36
53
|
const skipped = new Set();
|
|
37
54
|
for (const dir of dirs) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
55
|
+
const manifest = await readExecManifest(dir);
|
|
56
|
+
if (manifest === null)
|
|
57
|
+
continue; // not an exec package
|
|
58
|
+
// Host plugin-trust gate (plurnk-service#229), enforced BEFORE any tag
|
|
59
|
+
// is read or — critically — any dynamic runtimes hook is imported: an
|
|
60
|
+
// untrusted third-party package is discovered but not registered, and
|
|
61
|
+
// its code is never executed. Recorded for the consumer's telemetry
|
|
62
|
+
// note, never crashed on.
|
|
63
|
+
if (!isTrusted(manifest.packageName)) {
|
|
64
|
+
skipped.add(manifest.packageName);
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
for (const info of await readExecInfos(dir, manifest)) {
|
|
46
68
|
const existing = registry.get(info.runtime);
|
|
47
69
|
if (existing !== undefined) {
|
|
48
70
|
throw new Error(`exec runtime collision: '${info.runtime}' claimed by both `
|
|
@@ -104,45 +126,48 @@ async function defaultPackageDirs(cwd) {
|
|
|
104
126
|
}
|
|
105
127
|
return dirs;
|
|
106
128
|
}
|
|
107
|
-
//
|
|
108
|
-
// packages
|
|
109
|
-
|
|
110
|
-
|
|
129
|
+
// Read a package's `package.json` and return its manifest iff it declares
|
|
130
|
+
// `plurnk.kind === "exec"`. Returns null for non-executor packages, a missing
|
|
131
|
+
// or malformed `package.json` — discover() silently skips those (they are not
|
|
132
|
+
// "skipped by trust", just not exec packages).
|
|
133
|
+
async function readExecManifest(dir) {
|
|
111
134
|
let raw;
|
|
112
135
|
try {
|
|
113
|
-
raw = await fs.readFile(
|
|
136
|
+
raw = await fs.readFile(path.join(dir, "package.json"), "utf-8");
|
|
114
137
|
}
|
|
115
138
|
catch {
|
|
116
|
-
return
|
|
139
|
+
return null;
|
|
117
140
|
}
|
|
118
141
|
let pkg;
|
|
119
142
|
try {
|
|
120
143
|
pkg = JSON.parse(raw);
|
|
121
144
|
}
|
|
122
145
|
catch {
|
|
123
|
-
return
|
|
146
|
+
return null;
|
|
124
147
|
}
|
|
125
148
|
if (typeof pkg !== "object" || pkg === null)
|
|
126
|
-
return
|
|
149
|
+
return null;
|
|
127
150
|
const record = pkg;
|
|
128
151
|
const plurnk = record.plurnk;
|
|
129
152
|
if (typeof plurnk !== "object" || plurnk === null)
|
|
130
|
-
return
|
|
153
|
+
return null;
|
|
131
154
|
const plurnkRec = plurnk;
|
|
132
155
|
if (plurnkRec.kind !== "exec")
|
|
133
|
-
return
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
156
|
+
return null;
|
|
157
|
+
return { packageName: typeof record.name === "string" ? record.name : "", plurnk: plurnkRec };
|
|
158
|
+
}
|
|
159
|
+
// Produce one ExecInfo per declared runtime tag — static `plurnk.runtimes[]` or
|
|
160
|
+
// a dynamic `plurnk.runtimesModule` hook. Returns [] when neither is declared.
|
|
161
|
+
async function readExecInfos(dir, { packageName, plurnk }) {
|
|
137
162
|
// Package-level attribution, surfaced raw (plurnk-service#249); every tag of
|
|
138
163
|
// the package carries the same value. The consumer owns the policy.
|
|
139
|
-
const rawAttr =
|
|
164
|
+
const rawAttr = plurnk.attribution;
|
|
140
165
|
const attribution = typeof rawAttr === "string" || Array.isArray(rawAttr) ? rawAttr : undefined;
|
|
141
166
|
const infos = [];
|
|
142
|
-
for (const
|
|
143
|
-
if (typeof
|
|
167
|
+
for (const decl of await runtimeDecls(dir, packageName, plurnk)) {
|
|
168
|
+
if (typeof decl !== "object" || decl === null)
|
|
144
169
|
continue;
|
|
145
|
-
const e =
|
|
170
|
+
const e = decl;
|
|
146
171
|
if (typeof e.name !== "string" || e.name === "")
|
|
147
172
|
continue;
|
|
148
173
|
// `docs/<tag>.md` is the documentation source of truth (the docs
|
|
@@ -160,6 +185,48 @@ async function readExecInfos(dir) {
|
|
|
160
185
|
}
|
|
161
186
|
return infos;
|
|
162
187
|
}
|
|
188
|
+
// Resolve a package's runtime decls. Static `plurnk.runtimes[]` is the common
|
|
189
|
+
// case; `plurnk.runtimesModule` (a relative path) is the dynamic hook for
|
|
190
|
+
// per-deployment tags. Static wins if both are declared. Returns [] when
|
|
191
|
+
// neither is present.
|
|
192
|
+
async function runtimeDecls(dir, packageName, plurnk) {
|
|
193
|
+
if (Array.isArray(plurnk.runtimes))
|
|
194
|
+
return plurnk.runtimes;
|
|
195
|
+
const mod = plurnk.runtimesModule;
|
|
196
|
+
if (typeof mod === "string" && mod !== "")
|
|
197
|
+
return loadDynamicRuntimes(dir, packageName, mod);
|
|
198
|
+
return [];
|
|
199
|
+
}
|
|
200
|
+
// Import a trusted package's runtimes hook and call it. Fail-hard on every
|
|
201
|
+
// failure — an unloadable module, a missing/non-function export, or a
|
|
202
|
+
// non-array return is a contract violation by a trusted package (its own
|
|
203
|
+
// packaging or config), surfaced with the cause, never swallowed. The trust
|
|
204
|
+
// gate in discover() guarantees this only runs for trusted packages.
|
|
205
|
+
async function loadDynamicRuntimes(dir, packageName, rel) {
|
|
206
|
+
const href = pathToFileURL(path.join(dir, rel)).href;
|
|
207
|
+
let mod;
|
|
208
|
+
try {
|
|
209
|
+
mod = await import(__rewriteRelativeImportExtension(href));
|
|
210
|
+
}
|
|
211
|
+
catch (cause) {
|
|
212
|
+
throw new Error(`exec runtimes hook unloadable: ${packageName} -> ${rel}`, { cause });
|
|
213
|
+
}
|
|
214
|
+
const hook = mod.runtimes ?? mod.default;
|
|
215
|
+
if (typeof hook !== "function") {
|
|
216
|
+
throw new Error(`exec runtimes hook invalid: ${packageName} -> ${rel} must export 'runtimes' (or default) as a function`);
|
|
217
|
+
}
|
|
218
|
+
let decls;
|
|
219
|
+
try {
|
|
220
|
+
decls = await hook();
|
|
221
|
+
}
|
|
222
|
+
catch (cause) {
|
|
223
|
+
throw new Error(`exec runtimes hook threw: ${packageName} -> ${rel}`, { cause });
|
|
224
|
+
}
|
|
225
|
+
if (!Array.isArray(decls)) {
|
|
226
|
+
throw new Error(`exec runtimes hook returned a non-array: ${packageName} -> ${rel}`);
|
|
227
|
+
}
|
|
228
|
+
return decls;
|
|
229
|
+
}
|
|
163
230
|
// A tag's documentation file under the package's `docs/` folder — the docs
|
|
164
231
|
// convention's source of truth. Returns null when the package ships none.
|
|
165
232
|
async function readDocFile(dir, tag) {
|
package/dist/discover.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../src/discover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../src/discover.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,0EAA0E;AAC1E,4EAA4E;AAC5E,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,yEAAyE;AACzE,+BAA+B;AAC/B,EAAE;AAC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AC,CAAC;IACrF,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,4CAA4C,WAAW,OAAO,GAAG,EAAE,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,KAAsB,CAAC;AAClC,CAAC;AAED,2EAA2E;AAC3E,0EAA0E;AAC1E,KAAK,UAAU,WAAW,CAAC,GAAW,EAAE,GAAW;IAC/C,IAAI,CAAC;QACD,OAAO,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ export { default as BaseExecutor } from "./BaseExecutor.ts";
|
|
|
2
2
|
export { default as SubprocessExecutor } from "./SubprocessExecutor.ts";
|
|
3
3
|
export { discover } from "./discover.ts";
|
|
4
4
|
export { KNOWN_RUNTIMES, isKnownRuntime, resolveRuntime } from "./runtime.ts";
|
|
5
|
-
export type { ChannelState, ChannelDecl, ExecutorMetadata, ExecArgs, ExecResult, Effect, RuntimeAvailability, ExecInfo, ExecRegistry, Discovery, DiscoverOptions, SpawnArgs, RuntimeResolver, } from "./types.ts";
|
|
5
|
+
export type { ChannelState, ChannelDecl, ExecutorMetadata, ExecArgs, ExecResult, Effect, RuntimeAvailability, RuntimeDecl, RuntimesHook, ExecInfo, ExecRegistry, Discovery, DiscoverOptions, SpawnArgs, RuntimeResolver, } from "./types.ts";
|
|
6
6
|
export type { TelemetryEvent, ContentOffset, LogCoordinate } from "./TelemetryEvent.ts";
|
|
7
7
|
//# 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":"AACA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG9E,YAAY,EACR,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,MAAM,EACN,mBAAmB,EACnB,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,eAAe,EACf,SAAS,EACT,eAAe,GAClB,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG9E,YAAY,EACR,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,MAAM,EACN,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,eAAe,EACf,SAAS,EACT,eAAe,GAClB,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -35,6 +35,13 @@ export interface ExecInfo {
|
|
|
35
35
|
packageName: string;
|
|
36
36
|
attribution?: string | string[];
|
|
37
37
|
}
|
|
38
|
+
export interface RuntimeDecl {
|
|
39
|
+
name: string;
|
|
40
|
+
glyph?: string;
|
|
41
|
+
example?: string;
|
|
42
|
+
documentation?: string;
|
|
43
|
+
}
|
|
44
|
+
export type RuntimesHook = () => RuntimeDecl[] | Promise<RuntimeDecl[]>;
|
|
38
45
|
export type ExecRegistry = ReadonlyMap<string, ExecInfo>;
|
|
39
46
|
export interface Discovery {
|
|
40
47
|
registry: ExecRegistry;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAM3D,MAAM,WAAW,WAAW;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAKD,MAAM,WAAW,gBAAgB;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACjB;AAOD,MAAM,WAAW,QAAQ;IAGrB,OAAO,EAAE,MAAM,CAAC;IAEhB,OAAO,EAAE,MAAM,CAAC;IAGhB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAMnB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IAExB,MAAM,EAAE,WAAW,CAAC;IASpB,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAEnE,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAGzD,IAAI,EAAE,CAAC,KAAK,EAA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