@agentworkforce/persona-kit 0.19.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.
Files changed (90) hide show
  1. package/README.md +93 -0
  2. package/dist/config-files.d.ts +21 -0
  3. package/dist/config-files.d.ts.map +1 -0
  4. package/dist/config-files.js +81 -0
  5. package/dist/config-files.js.map +1 -0
  6. package/dist/constants.d.ts +20 -0
  7. package/dist/constants.d.ts.map +1 -0
  8. package/dist/constants.js +78 -0
  9. package/dist/constants.js.map +1 -0
  10. package/dist/detect.d.ts +28 -0
  11. package/dist/detect.d.ts.map +1 -0
  12. package/dist/detect.js +63 -0
  13. package/dist/detect.js.map +1 -0
  14. package/dist/env-refs.d.ts +56 -0
  15. package/dist/env-refs.d.ts.map +1 -0
  16. package/dist/env-refs.js +105 -0
  17. package/dist/env-refs.js.map +1 -0
  18. package/dist/env-refs.test.d.ts +2 -0
  19. package/dist/env-refs.test.d.ts.map +1 -0
  20. package/dist/env-refs.test.js +84 -0
  21. package/dist/env-refs.test.js.map +1 -0
  22. package/dist/execute.d.ts +47 -0
  23. package/dist/execute.d.ts.map +1 -0
  24. package/dist/execute.js +68 -0
  25. package/dist/execute.js.map +1 -0
  26. package/dist/execute.test.d.ts +2 -0
  27. package/dist/execute.test.d.ts.map +1 -0
  28. package/dist/execute.test.js +255 -0
  29. package/dist/execute.test.js.map +1 -0
  30. package/dist/index.d.ts +16 -0
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/index.js +26 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/index.test.d.ts +2 -0
  35. package/dist/index.test.d.ts.map +1 -0
  36. package/dist/index.test.js +234 -0
  37. package/dist/index.test.js.map +1 -0
  38. package/dist/inputs.d.ts +13 -0
  39. package/dist/inputs.d.ts.map +1 -0
  40. package/dist/inputs.js +57 -0
  41. package/dist/inputs.js.map +1 -0
  42. package/dist/inputs.test.d.ts +2 -0
  43. package/dist/inputs.test.d.ts.map +1 -0
  44. package/dist/inputs.test.js +51 -0
  45. package/dist/inputs.test.js.map +1 -0
  46. package/dist/interactive-spec.d.ts +117 -0
  47. package/dist/interactive-spec.d.ts.map +1 -0
  48. package/dist/interactive-spec.js +260 -0
  49. package/dist/interactive-spec.js.map +1 -0
  50. package/dist/interactive-spec.test.d.ts +2 -0
  51. package/dist/interactive-spec.test.d.ts.map +1 -0
  52. package/dist/interactive-spec.test.js +308 -0
  53. package/dist/interactive-spec.test.js.map +1 -0
  54. package/dist/mcp.d.ts +35 -0
  55. package/dist/mcp.d.ts.map +1 -0
  56. package/dist/mcp.js +86 -0
  57. package/dist/mcp.js.map +1 -0
  58. package/dist/mount.d.ts +44 -0
  59. package/dist/mount.d.ts.map +1 -0
  60. package/dist/mount.js +51 -0
  61. package/dist/mount.js.map +1 -0
  62. package/dist/parse.d.ts +47 -0
  63. package/dist/parse.d.ts.map +1 -0
  64. package/dist/parse.js +475 -0
  65. package/dist/parse.js.map +1 -0
  66. package/dist/plan.d.ts +118 -0
  67. package/dist/plan.d.ts.map +1 -0
  68. package/dist/plan.js +150 -0
  69. package/dist/plan.js.map +1 -0
  70. package/dist/plan.test.d.ts +2 -0
  71. package/dist/plan.test.d.ts.map +1 -0
  72. package/dist/plan.test.js +191 -0
  73. package/dist/plan.test.js.map +1 -0
  74. package/dist/sidecars.d.ts +17 -0
  75. package/dist/sidecars.d.ts.map +1 -0
  76. package/dist/sidecars.js +101 -0
  77. package/dist/sidecars.js.map +1 -0
  78. package/dist/skill-runner.d.ts +30 -0
  79. package/dist/skill-runner.d.ts.map +1 -0
  80. package/dist/skill-runner.js +94 -0
  81. package/dist/skill-runner.js.map +1 -0
  82. package/dist/skills.d.ts +41 -0
  83. package/dist/skills.d.ts.map +1 -0
  84. package/dist/skills.js +322 -0
  85. package/dist/skills.js.map +1 -0
  86. package/dist/types.d.ts +321 -0
  87. package/dist/types.d.ts.map +1 -0
  88. package/dist/types.js +2 -0
  89. package/dist/types.js.map +1 -0
  90. package/package.json +37 -0
package/dist/mcp.js ADDED
@@ -0,0 +1,86 @@
1
+ import { makeLenientResolver, resolveStringMapLenient } from './env-refs.js';
2
+ /**
3
+ * Resolve env-var references inside an `mcpServers` block, policy: lenient.
4
+ *
5
+ * - Headers / env / args entries with an unresolved ref are **dropped** from
6
+ * the result; they surface in `dropped`.
7
+ * - A server whose `url`, `command`, or any `arg` references an unresolved
8
+ * ref is dropped **entirely**; it surfaces in `droppedServers`. Structural
9
+ * fields can't be silently skipped — the server wouldn't launch without
10
+ * them.
11
+ *
12
+ * Literal strings pass through untouched.
13
+ */
14
+ export function resolveMcpServersLenient(servers, processEnv) {
15
+ if (!servers)
16
+ return { servers: undefined, dropped: [], droppedServers: [] };
17
+ const resolve = makeLenientResolver(processEnv);
18
+ const out = {};
19
+ const dropped = [];
20
+ const droppedServers = [];
21
+ for (const [name, spec] of Object.entries(servers)) {
22
+ const field = `mcpServers.${name}`;
23
+ const fatalRefs = [];
24
+ const resolveFatal = (value, subfield) => {
25
+ const r = resolve(value, subfield);
26
+ if (r.ok)
27
+ return r.value;
28
+ fatalRefs.push(r.ref);
29
+ return undefined;
30
+ };
31
+ if (spec.type === 'stdio') {
32
+ const command = resolveFatal(spec.command, `${field}.command`);
33
+ const args = spec.args?.map((a, i) => resolveFatal(a, `${field}.args[${i}]`));
34
+ if (!command || (args && args.some((a) => a === undefined))) {
35
+ droppedServers.push({ name, refs: fatalRefs });
36
+ continue;
37
+ }
38
+ const envResolution = resolveStringMapLenient(spec.env, processEnv, `${field}.env`);
39
+ dropped.push(...envResolution.dropped);
40
+ out[name] = {
41
+ type: 'stdio',
42
+ command,
43
+ ...(args ? { args: args } : {}),
44
+ ...(envResolution.value ? { env: envResolution.value } : {})
45
+ };
46
+ }
47
+ else {
48
+ const url = resolveFatal(spec.url, `${field}.url`);
49
+ if (!url) {
50
+ droppedServers.push({ name, refs: fatalRefs });
51
+ continue;
52
+ }
53
+ const headersResolution = resolveStringMapLenient(spec.headers, processEnv, `${field}.headers`);
54
+ dropped.push(...headersResolution.dropped);
55
+ out[name] = {
56
+ type: spec.type,
57
+ url,
58
+ ...(headersResolution.value ? { headers: headersResolution.value } : {})
59
+ };
60
+ }
61
+ }
62
+ return {
63
+ servers: Object.keys(out).length > 0 ? out : undefined,
64
+ dropped,
65
+ droppedServers
66
+ };
67
+ }
68
+ /**
69
+ * Format the dropped-ref tracking from env + MCP resolution into flat,
70
+ * human-readable lines. Callers print them wherever they want — stderr,
71
+ * a logger, a UI toast — the helper itself has no I/O.
72
+ */
73
+ export function formatDropWarnings(envDrops, mcpDrops, mcpServerDrops) {
74
+ const lines = [];
75
+ for (const d of envDrops) {
76
+ lines.push(`${d.field} dropped (env var ${d.ref} is not set).`);
77
+ }
78
+ for (const d of mcpDrops) {
79
+ lines.push(`${d.field} dropped (env var ${d.ref} is not set).`);
80
+ }
81
+ for (const d of mcpServerDrops) {
82
+ lines.push(`mcpServers.${d.name} dropped entirely (required fields referenced unset env vars: ${d.refs.join(', ')}).`);
83
+ }
84
+ return lines;
85
+ }
86
+ //# sourceMappingURL=mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.js","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAiB9F;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,wBAAwB,CACtC,OAAkD,EAClD,UAA6B;IAE7B,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC;IAC7E,MAAM,OAAO,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAChD,MAAM,GAAG,GAAkC,EAAE,CAAC;IAC9C,MAAM,OAAO,GAAiB,EAAE,CAAC;IACjC,MAAM,cAAc,GAAuB,EAAE,CAAC;IAE9C,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAA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,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,qBAAqB,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC;IAClE,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,qBAAqB,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC;IAClE,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,cAAc,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CACR,cAAc,CAAC,CAAC,IAAI,iEAAiE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAC3G,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,44 @@
1
+ import type { ResolvedMountPolicy } from './plan.js';
2
+ export interface PersonaMountHandle {
3
+ /**
4
+ * Working directory the harness should be spawned in. When the mount is
5
+ * undefined this is the caller-supplied cwd unchanged; when a mount is
6
+ * applied, this is the per-session mount directory.
7
+ */
8
+ readonly cwd: string;
9
+ /** Tear down the mount. Idempotent; safe to call twice. */
10
+ dispose(): Promise<void>;
11
+ }
12
+ export interface ApplyPersonaMountOptions {
13
+ /** Directory the harness would otherwise be spawned in. */
14
+ cwd: string;
15
+ /**
16
+ * Absolute path the mount should be created under. Required when a mount
17
+ * policy is supplied. Ignored when `mount` is undefined.
18
+ */
19
+ mountDir?: string;
20
+ /**
21
+ * Persona id used to label the mount's per-session `.git` worktree (when
22
+ * `includeGit` is true). Required when a mount policy is supplied.
23
+ */
24
+ personaId?: string;
25
+ /**
26
+ * Whether to mirror the project's `.git` into the mount. Defaults to true
27
+ * so git commands work inside the sandbox; set false when callers want a
28
+ * pure file overlay.
29
+ */
30
+ includeGit?: boolean;
31
+ }
32
+ /**
33
+ * Apply the persona's mount policy. When `mount` is undefined, returns a
34
+ * no-op handle whose `cwd` is the caller-supplied directory — the harness
35
+ * runs in-place. When `mount` is defined, opens an `@relayfile/local-mount`
36
+ * sandbox under `options.mountDir` and returns a handle whose `cwd` is the
37
+ * mount root. `dispose()` tears the mount down.
38
+ *
39
+ * The caller is responsible for picking the mountDir (typically a
40
+ * per-session scratch directory) and for any auto-sync orchestration outside
41
+ * of mount lifecycle. Persona-kit's mount handle covers open/close only.
42
+ */
43
+ export declare function applyPersonaMount(mount: ResolvedMountPolicy | undefined, options: ApplyPersonaMountOptions): Promise<PersonaMountHandle>;
44
+ //# sourceMappingURL=mount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../src/mount.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAErD,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED,MAAM,WAAW,wBAAwB;IACvC,2DAA2D;IAC3D,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,mBAAmB,GAAG,SAAS,EACtC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,kBAAkB,CAAC,CAyC7B"}
package/dist/mount.js ADDED
@@ -0,0 +1,51 @@
1
+ import { createMount } from '@relayfile/local-mount';
2
+ /**
3
+ * Apply the persona's mount policy. When `mount` is undefined, returns a
4
+ * no-op handle whose `cwd` is the caller-supplied directory — the harness
5
+ * runs in-place. When `mount` is defined, opens an `@relayfile/local-mount`
6
+ * sandbox under `options.mountDir` and returns a handle whose `cwd` is the
7
+ * mount root. `dispose()` tears the mount down.
8
+ *
9
+ * The caller is responsible for picking the mountDir (typically a
10
+ * per-session scratch directory) and for any auto-sync orchestration outside
11
+ * of mount lifecycle. Persona-kit's mount handle covers open/close only.
12
+ */
13
+ export async function applyPersonaMount(mount, options) {
14
+ if (!mount) {
15
+ let disposed = false;
16
+ return {
17
+ cwd: options.cwd,
18
+ async dispose() {
19
+ disposed = true;
20
+ return;
21
+ }
22
+ };
23
+ }
24
+ if (!options.mountDir) {
25
+ throw new Error('applyPersonaMount: options.mountDir is required when a mount policy is supplied');
26
+ }
27
+ if (!options.personaId) {
28
+ throw new Error('applyPersonaMount: options.personaId is required when a mount policy is supplied');
29
+ }
30
+ const handle = await createMount(options.cwd, options.mountDir, {
31
+ ignoredPatterns: [...mount.ignoredPatterns],
32
+ readonlyPatterns: [...mount.readonlyPatterns],
33
+ excludeDirs: [],
34
+ agentName: options.personaId,
35
+ includeGit: options.includeGit ?? true
36
+ });
37
+ let disposed = false;
38
+ return {
39
+ cwd: handle.mountDir,
40
+ async dispose() {
41
+ if (disposed)
42
+ return;
43
+ disposed = true;
44
+ // Defensive await — relayfile's typed signature is void today, but
45
+ // future versions may return a promise; awaiting a non-promise is a
46
+ // no-op and protects the dispose contract executors rely on.
47
+ await handle.cleanup();
48
+ }
49
+ };
50
+ }
51
+ //# sourceMappingURL=mount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mount.js","sourceRoot":"","sources":["../src/mount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAmCrD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,KAAsC,EACtC,OAAiC;IAEjC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,OAAO;YACL,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,KAAK,CAAC,OAAO;gBACX,QAAQ,GAAG,IAAI,CAAC;gBAChB,OAAO;YACT,CAAC;SACF,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,iFAAiF,CAClF,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,kFAAkF,CACnF,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,QAAQ,EAAE;QAC9D,eAAe,EAAE,CAAC,GAAG,KAAK,CAAC,eAAe,CAAC;QAC3C,gBAAgB,EAAE,CAAC,GAAG,KAAK,CAAC,gBAAgB,CAAC;QAC7C,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,IAAI;KACvC,CAAC,CAAC;IAEH,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,OAAO;QACL,GAAG,EAAE,MAAM,CAAC,QAAQ;QACpB,KAAK,CAAC,OAAO;YACX,IAAI,QAAQ;gBAAE,OAAO;YACrB,QAAQ,GAAG,IAAI,CAAC;YAChB,mEAAmE;YACnE,oEAAoE;YACpE,6DAA6D;YAC7D,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;QACzB,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,47 @@
1
+ import type { Harness, HarnessSettings, McpServerSpec, PersonaInputSpec, PersonaIntent, PersonaMount, PersonaPermissions, PersonaRuntime, PersonaSelection, PersonaSkill, PersonaSpec, PersonaTag, PersonaTier, SidecarMdMode } from './types.js';
2
+ export declare function isObject(value: unknown): value is Record<string, unknown>;
3
+ export declare function isHarness(value: unknown): value is Harness;
4
+ export declare function isTier(value: unknown): value is PersonaTier;
5
+ export declare function isIntent(value: unknown): value is PersonaIntent;
6
+ export declare function isTag(value: unknown): value is PersonaTag;
7
+ export declare function isSidecarMode(value: unknown): value is SidecarMdMode;
8
+ export declare function parseTags(value: unknown, context: string): PersonaTag[];
9
+ export declare function assertSidecarPath(value: unknown, context: string): void;
10
+ export declare function parseHarnessSettings(value: unknown, context: string): HarnessSettings;
11
+ export declare function parseRuntime(value: unknown, context: string): PersonaRuntime;
12
+ export declare function parseSkills(value: unknown, context: string): PersonaSkill[];
13
+ export declare function parseStringList(value: unknown, context: string): string[] | undefined;
14
+ export declare function parseMount(value: unknown, context: string): PersonaMount | undefined;
15
+ export declare const INPUT_NAME_RE: RegExp;
16
+ export declare function assertInputName(name: string, context: string): void;
17
+ export declare function parseInputs(value: unknown, context: string): Record<string, PersonaInputSpec> | undefined;
18
+ export declare function parsePermissions(value: unknown, context: string): PersonaPermissions | undefined;
19
+ export declare function parseStringMap(value: unknown, context: string): Record<string, string> | undefined;
20
+ export declare function parseMcpServers(value: unknown, context: string): Record<string, McpServerSpec> | undefined;
21
+ export declare function parsePersonaSpec(value: unknown, expectedIntent: PersonaIntent): PersonaSpec;
22
+ /**
23
+ * Resolve the effective sidecar config for a (spec, tier) pair.
24
+ *
25
+ * Path-or-content resolution: each sidecar (`claude*`, `agents*`) is a
26
+ * single "channel" — its `*Md` and `*MdContent` fields are tied together
27
+ * and travel as a unit through the cascade. If the tier-level runtime
28
+ * declares EITHER `claudeMd` or `claudeMdContent`, the tier owns the
29
+ * channel and the top-level path/content is ignored (otherwise a tier
30
+ * path override would silently lose to inherited inlined content, since
31
+ * downstream consumers prefer Content over a path).
32
+ *
33
+ * Mode resolution: independent — a tier can set just `claudeMdMode` and
34
+ * inherit the top-level path. Defaults to `overwrite` if neither layer
35
+ * sets a mode. Modes are only meaningful when a path/content is present.
36
+ */
37
+ export declare function resolveSidecar(spec: PersonaSpec, tier: PersonaTier): {
38
+ claudeMd?: string;
39
+ claudeMdContent?: string;
40
+ claudeMdMode: SidecarMdMode;
41
+ agentsMd?: string;
42
+ agentsMdContent?: string;
43
+ agentsMdMode: SidecarMdMode;
44
+ };
45
+ export declare function sidecarSelectionFields(sidecar: ReturnType<typeof resolveSidecar>): Pick<PersonaSelection, 'claudeMd' | 'claudeMdContent' | 'claudeMdMode' | 'agentsMd' | 'agentsMdContent' | 'agentsMdMode'>;
46
+ export declare function deepFreeze<T>(value: T): T;
47
+ //# sourceMappingURL=parse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAGV,OAAO,EACP,eAAe,EACf,aAAa,EAEb,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,WAAW,EACX,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAE1D;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAE3D;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAE/D;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEzD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAEpE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,EAAE,CAcvE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EA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