@agent-deck/cli 1.10.6 → 1.11.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/dist/agent-harness.d.ts.map +1 -1
- package/dist/agent-harness.js +28 -17
- package/dist/agent-harness.js.map +1 -1
- package/dist/codex-plugin.d.ts +65 -0
- package/dist/codex-plugin.d.ts.map +1 -0
- package/dist/codex-plugin.js +508 -0
- package/dist/codex-plugin.js.map +1 -0
- package/dist/dashboard-open.d.ts +20 -0
- package/dist/dashboard-open.d.ts.map +1 -1
- package/dist/dashboard-open.js +71 -0
- package/dist/dashboard-open.js.map +1 -1
- package/dist/mcp-bridge.d.ts +4 -4
- package/dist/mcp-bridge.d.ts.map +1 -1
- package/dist/mcp-bridge.js +6 -4
- package/dist/mcp-bridge.js.map +1 -1
- package/dist/mcp-launcher.d.ts +20 -0
- package/dist/mcp-launcher.d.ts.map +1 -1
- package/dist/mcp-launcher.js +55 -4
- package/dist/mcp-launcher.js.map +1 -1
- package/dist/menubar.d.ts +6 -2
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +38 -4
- package/dist/menubar.js.map +1 -1
- package/dist/playbook-stubs.d.ts +22 -0
- package/dist/playbook-stubs.d.ts.map +1 -1
- package/dist/playbook-stubs.js +24 -1
- package/dist/playbook-stubs.js.map +1 -1
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +16 -0
- package/dist/setup.js.map +1 -1
- package/dist/start.d.ts.map +1 -1
- package/dist/start.js +8 -0
- package/dist/start.js.map +1 -1
- package/dist/upgrade.d.ts +11 -1
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +31 -13
- package/dist/upgrade.js.map +1 -1
- package/dist/use.d.ts.map +1 -1
- package/dist/use.js +46 -2
- package/dist/use.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-harness.d.ts","sourceRoot":"","sources":["../src/agent-harness.ts"],"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MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,WAAW,GAAE,MAAiC,GAC7C;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CA0BvC;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEhE;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,GACnB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAoBvC;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAoB1F;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;IAC7C,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAiBF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,GAAG,oBAAoB,CA6ClG"}
|
package/dist/agent-harness.js
CHANGED
|
@@ -23,15 +23,15 @@ const GLOBAL_BODY = `**Connect first:** Connection has three layers: host transp
|
|
|
23
23
|
|
|
24
24
|
**Agent Deck hard gate:** When Agent Deck MCP is configured for the current session, or \`.agent-deck/use.json\` indicates that it is expected, bootstrap is mandatory. This includes launch-selected sessions that deliberately have no assignment file. Before reading repo files, running task commands, or answering the task, require \`get_session_binding\` and \`get_bound_deck\` to succeed. If the tools are unavailable, disconnected, return \`GRANT_REQUIRED\`, or otherwise fail, stop and report the connection problem — do not improvise without the deck. Checking for the optional assignment signal, checking whether Agent Deck is configured, and other read-only connection diagnostics are allowed before the gate passes.
|
|
25
25
|
|
|
26
|
-
**Session opener (first turn only):** These calls verify an existing connection; they do not create it. The folder's deck comes from \`.agent-deck/use.json\`, which \`agent-deck use <deck>\` writes — the connection carries it; the agent does **not** pick a deck and must **not** call \`get_decks\`. When Agent Deck MCP is configured for the session, call \`get_session_binding\` then \`get_bound_deck\`, and tell the user **exactly one line** using \`display_summary\` (e.g. \`◆ dev · 2 MCP · 0 keys · 1 playbooks\`). Match the task against the returned playbook triggers and call \`get_playbook\` for every match before taking task action. If tools are unavailable, repair the host transport first. On \`GRANT_REQUIRED\` ("No deck selected for this connection"), tell the user to run \`agent-deck use <deck>\` in the folder and reload MCP, then stop. For an unattended session, fix \`x-agent-deck-deck-id\` / the launch config instead. If \`.agent-deck/use.json\` already assigns the deck and only the project MCP pin is missing, that \`use\` can succeed from a host agent sandbox; creating a new assignment
|
|
26
|
+
**Session opener (first turn only):** These calls verify an existing connection; they do not create it. The folder's deck comes from \`.agent-deck/use.json\`, which \`agent-deck use <deck>\` writes — the connection carries it; the agent does **not** pick a deck and must **not** call \`get_decks\`. When Agent Deck MCP is configured for the session, call \`get_session_binding\` then \`get_bound_deck\`, and tell the user **exactly one line** using \`display_summary\` (e.g. \`◆ dev · 2 MCP · 0 keys · 1 playbooks\`). Match the task against the returned playbook triggers and call \`get_playbook\` for every match before taking task action. If tools are unavailable, repair the host transport first. On \`GRANT_REQUIRED\` ("No deck selected for this connection"), tell the user to run \`agent-deck use <deck>\` in the folder and reload MCP, then stop. For an unattended session, fix \`x-agent-deck-deck-id\` / the launch config instead. If \`.agent-deck/use.json\` already assigns the deck and only the project MCP pin is missing, that \`use\` can succeed from a host agent sandbox; creating a new assignment needs an unsandboxed terminal (home store write). Do **not** repeat the status line every turn unless the user asks or the bind changes.
|
|
27
27
|
|
|
28
|
-
**Later turns:** Deck scope comes from the launch-selected connection (folder assignment or launch header). Do not re-bind unless the user asks for deck administration.
|
|
28
|
+
**Later turns:** Deck scope comes from the launch-selected connection (folder assignment or launch header). Do not re-bind unless the user asks for deck administration. To move to another deck, call \`switch_deck\` and wait — the user approves it as This session only or This workspace by default; the active deck is unchanged until approval and no reload is needed. A rejected move (\`DECK_FIXED\` / \`ADMIN_REQUIRED\`) means the agent cannot change the connection itself — tell the user instead of retrying.
|
|
29
29
|
|
|
30
30
|
Before declining for missing tools (Slack, Linear, GitHub, etc.), use agent-deck MCP: \`get_bound_deck\`, \`call_service_tool\`. Don't hardcode deck IDs.
|
|
31
31
|
|
|
32
|
-
**Deck admin (create/
|
|
32
|
+
**Deck admin (create/edit deck):** Normal agents get \`ADMIN_REQUIRED\`. Call \`request_admin_elevation\`; user approves in the dashboard/menubar. After approval, \`mode\` is \`agent-admin\` until lease expiry or \`exit_admin_mode\`. Surface shared-deck workspace counts before mutating a deck used elsewhere. Deck switches never use elevation — request them with \`switch_deck\` and wait for human approval.
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
**Playbooks — runtime discovery (no generated stubs):** Playbook triggers and bodies live only on the bound deck — \`agent-deck use\` and bind/switch write no per-playbook files, so switching decks never requires regenerating workspace files for discovery. On every task, match the task against the playbook \`triggers\` returned by \`get_bound_deck\` and call \`get_playbook\` for every match before acting. A playbook that exists only on the newly active deck is discovered the same way (\`get_bound_deck\` lists its triggers; \`get_playbook\` fetches its body) — never rely on checked-in stub or skill files, which may belong to a previously bound deck. **Never** mirror playbook bodies into \`.cursor/skills/\`, rules, or Claude skills — one source of truth on the deck.
|
|
35
35
|
|
|
36
36
|
### When user asks for a playbook task
|
|
37
37
|
|
|
@@ -64,10 +64,10 @@ Tell the user in one line that a proposal was filed (or a signal was logged for
|
|
|
64
64
|
| Replace one list line | \`amend_item\` | \`anchor\`: exact line including \`-\` prefix — **not prose** |
|
|
65
65
|
| Delete one list line | \`remove_item\` | Same anchor rules as amend |
|
|
66
66
|
| Edit prose or a whole section | \`rewrite_body\` | Not amend_item on paragraphs |
|
|
67
|
-
| Change trigger phrases | \`set_triggers\` |
|
|
67
|
+
| Change trigger phrases | \`set_triggers\` | Effective on the next \`get_bound_deck\` call — no workspace refresh step |
|
|
68
68
|
|
|
69
69
|
Wrong: \`amend_item\` with a prose sentence as anchor → **409** at propose. Right: \`rewrite_body\` for prose edits.`;
|
|
70
|
-
const PROJECT_BODY_EXTRA = 'In this repo: \`agent-deck use <deck>\` is the optional persistent folder-assignment path (writes MCP
|
|
70
|
+
const PROJECT_BODY_EXTRA = 'In this repo: \`agent-deck use <deck>\` is the optional persistent folder-assignment path (writes MCP config + \`.agent-deck/use.json\`); launch-selected sessions can be bound without that file. When a task matches deck \`triggers\` from \`get_bound_deck\`, \`get_playbook\` before improvising — no stub refresh step; trigger changes take effect on the next \`get_bound_deck\` call.';
|
|
71
71
|
function buildClaudeHarnessBlock(scope) {
|
|
72
72
|
const lines = ['## Agent Deck', '', GLOBAL_BODY];
|
|
73
73
|
if (scope === 'project') {
|
|
@@ -92,21 +92,24 @@ function mergeCursorHarnessFile(existing, harnessInner, description = exports.HA
|
|
|
92
92
|
const body = frontmatterMatch ? existing.slice(frontmatter.length) : existing;
|
|
93
93
|
const start = body.indexOf(exports.HARNESS_MARKER_START);
|
|
94
94
|
const end = body.indexOf(exports.HARNESS_MARKER_END);
|
|
95
|
+
// Splice only the managed range: user bytes before/after the markers are
|
|
96
|
+
// preserved byte-for-byte (no newline collapsing, no trimming). Newline
|
|
97
|
+
// separation is added, never taken from existing content.
|
|
95
98
|
let nextBody;
|
|
96
99
|
if (start !== -1 && end !== -1 && end > start) {
|
|
97
100
|
const before = body.slice(0, start);
|
|
98
101
|
const after = body.slice(end + exports.HARNESS_MARKER_END.length);
|
|
99
102
|
nextBody = `${before}${wrapped}${after}`;
|
|
100
103
|
}
|
|
101
|
-
else if (body
|
|
102
|
-
|
|
104
|
+
else if (body) {
|
|
105
|
+
const separator = body.endsWith('\n\n') ? '' : body.endsWith('\n') ? '\n' : '\n\n';
|
|
106
|
+
nextBody = `${body}${separator}${wrapped}\n`;
|
|
103
107
|
}
|
|
104
108
|
else {
|
|
105
109
|
nextBody = `${wrapped}\n`;
|
|
106
110
|
}
|
|
107
|
-
const content = `${frontmatter}${nextBody}
|
|
108
|
-
|
|
109
|
-
return { content: normalized, changed: normalized !== existing };
|
|
111
|
+
const content = `${frontmatter}${nextBody}`;
|
|
112
|
+
return { content, changed: content !== existing };
|
|
110
113
|
}
|
|
111
114
|
function buildCursorHarnessFile(scope) {
|
|
112
115
|
return mergeCursorHarnessFile('', buildCursorHarnessInner(scope)).content;
|
|
@@ -115,15 +118,20 @@ function mergeClaudeHarness(existing, harnessBlock) {
|
|
|
115
118
|
const wrapped = `${exports.HARNESS_MARKER_START}\n${harnessBlock}\n${exports.HARNESS_MARKER_END}`;
|
|
116
119
|
const start = existing.indexOf(exports.HARNESS_MARKER_START);
|
|
117
120
|
const end = existing.indexOf(exports.HARNESS_MARKER_END);
|
|
121
|
+
// Splice only the managed range: user bytes before/after the markers are
|
|
122
|
+
// preserved byte-for-byte (no newline collapsing, no trimming). Newline
|
|
123
|
+
// separation is added, never taken from existing content.
|
|
118
124
|
if (start !== -1 && end !== -1 && end > start) {
|
|
119
125
|
const before = existing.slice(0, start);
|
|
120
126
|
const after = existing.slice(end + exports.HARNESS_MARKER_END.length);
|
|
121
|
-
const content = `${before}${wrapped}${after}
|
|
122
|
-
return { content
|
|
127
|
+
const content = `${before}${wrapped}${after}`;
|
|
128
|
+
return { content, changed: content !== existing };
|
|
123
129
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
130
|
+
if (!existing) {
|
|
131
|
+
return { content: `${wrapped}\n`, changed: true };
|
|
132
|
+
}
|
|
133
|
+
const separator = existing.endsWith('\n\n') ? '' : existing.endsWith('\n') ? '\n' : '\n\n';
|
|
134
|
+
return { content: `${existing}${separator}${wrapped}\n`, changed: true };
|
|
127
135
|
}
|
|
128
136
|
function resolveHarnessPath(client, scope) {
|
|
129
137
|
const home = node_os_1.default.homedir();
|
|
@@ -149,7 +157,10 @@ function readTextFile(filePath) {
|
|
|
149
157
|
}
|
|
150
158
|
function writeTextFile(filePath, content) {
|
|
151
159
|
node_fs_1.default.mkdirSync(node_path_1.default.dirname(filePath), { recursive: true });
|
|
152
|
-
|
|
160
|
+
// Write merged content verbatim: the merge functions already append a
|
|
161
|
+
// trailing newline when they add the block, and user bytes after the end
|
|
162
|
+
// marker must be preserved byte-for-byte (even without a final newline).
|
|
163
|
+
node_fs_1.default.writeFileSync(filePath, content, 'utf8');
|
|
153
164
|
}
|
|
154
165
|
function installAgentHarness(client, scope) {
|
|
155
166
|
const harnessPath = resolveHarnessPath(client, scope);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-harness.js","sourceRoot":"","sources":["../src/agent-harness.ts"],"names":[],"mappings":";;;;;;AAoEA,0DAMC;AAGD,wDAEC;AAWD,
|
|
1
|
+
{"version":3,"file":"agent-harness.js","sourceRoot":"","sources":["../src/agent-harness.ts"],"names":[],"mappings":";;;;;;AAoEA,0DAMC;AAGD,wDAEC;AAWD,wDA8BC;AAED,wDAEC;AAED,gDAuBC;AAED,gDAoBC;AAwBD,kDA6CC;AAhPD,sDAAyB;AACzB,sDAAyB;AACzB,0DAA6B;AAMhB,QAAA,oBAAoB,GAAG,mCAAmC,CAAC;AAC3D,QAAA,kBAAkB,GAAG,iCAAiC,CAAC;AACvD,QAAA,oBAAoB,GAAG,gBAAgB,CAAC;AAErD,oFAAoF;AACvE,QAAA,wBAAwB,GACnC,2GAA2G,CAAC;AAE9G,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qHA+CiG,CAAC;AAEtH,MAAM,kBAAkB,GACtB,gYAAgY,CAAC;AAEnY,SAAgB,uBAAuB,CAAC,KAAiB;IACvD,MAAM,KAAK,GAAG,CAAC,eAAe,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;IACjD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,kBAAkB,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,C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CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC;IAChF,IAAI,MAAM,KAAK,WAAW,EAAE,CAAC;QAC3B,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,OAAO;QACL,SAAS,EAAE,IAAI;QACf,IAAI,EAAE,WAAW;QACjB,MAAM;QACN,OAAO,EACL,MAAM,KAAK,WAAW;YACpB,CAAC,CAAC,mCAAmC,WAAW,EAAE;YAClD,CAAC,CAAC,6BAA6B,WAAW,aAAa,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,aAAa;KACvH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export type CodexClassification = 'missing' | 'disabled' | 'compatible' | 'version-mismatch' | 'legacy-http' | 'unknown-transport' | 'ambiguous-source';
|
|
2
|
+
export type CodexTransport = 'mcp-launch' | 'direct-http' | 'unknown';
|
|
3
|
+
export type CodexRunResult = {
|
|
4
|
+
code: number;
|
|
5
|
+
stdout: string;
|
|
6
|
+
stderr: string;
|
|
7
|
+
};
|
|
8
|
+
export type CodexRunner = (args: string[]) => Promise<CodexRunResult>;
|
|
9
|
+
export declare const AGENT_DECK_PLUGIN_NAME = "agent-deck";
|
|
10
|
+
export declare const DEFAULT_PLUGIN_SELECTOR = "agent-deck@agent-deck";
|
|
11
|
+
export declare function runCodexCommand(args: string[]): Promise<CodexRunResult>;
|
|
12
|
+
export interface CodexInstalledPlugin {
|
|
13
|
+
name: string;
|
|
14
|
+
version?: string;
|
|
15
|
+
selector: string;
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
marketplace?: string;
|
|
18
|
+
root?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface CodexMarketplace {
|
|
21
|
+
name: string;
|
|
22
|
+
root?: string;
|
|
23
|
+
source: 'local' | 'git' | 'unknown';
|
|
24
|
+
}
|
|
25
|
+
export interface CodexPluginState {
|
|
26
|
+
available: boolean;
|
|
27
|
+
error?: string;
|
|
28
|
+
marketplaceListError?: string;
|
|
29
|
+
cliVersion: string;
|
|
30
|
+
installed: CodexInstalledPlugin[];
|
|
31
|
+
marketplaces: CodexMarketplace[];
|
|
32
|
+
classification?: CodexClassification;
|
|
33
|
+
installedVersion?: string;
|
|
34
|
+
selector?: string;
|
|
35
|
+
root?: string;
|
|
36
|
+
marketplaceName?: string;
|
|
37
|
+
sourceKind?: 'local' | 'git' | 'unknown';
|
|
38
|
+
transport: CodexTransport;
|
|
39
|
+
}
|
|
40
|
+
export declare function inspectCodexPlugin(cliVersion: string, runner?: CodexRunner): Promise<CodexPluginState>;
|
|
41
|
+
export declare function manualCodexCommands(selector: string): string[];
|
|
42
|
+
export declare function remediationLine(selector: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Reconcile the installed Agent Deck plugin after a successful CLI upgrade.
|
|
45
|
+
*
|
|
46
|
+
* Only acts when exactly one installed selector and one source root resolve
|
|
47
|
+
* from a successful marketplace listing. For a Git marketplace the
|
|
48
|
+
* marketplace is refreshed first. Reinstalls through supported
|
|
49
|
+
* `codex plugin remove` / `codex plugin add` commands, then re-reads plugin
|
|
50
|
+
* state (which must verify `mcp-launch` before reporting OK). Never edits
|
|
51
|
+
* Codex files directly: every failure path prints whether the CLI upgrade
|
|
52
|
+
* succeeded and whether the plugin was left unchanged or was removed, plus
|
|
53
|
+
* the exact manual Codex commands, and returns 1.
|
|
54
|
+
*/
|
|
55
|
+
export declare function reconcileCodexPluginAfterUpgrade(expectedVersion: string, runner?: CodexRunner): Promise<number>;
|
|
56
|
+
/**
|
|
57
|
+
* Read-only `doctor` section for the Codex plugin. Never mutates Codex state:
|
|
58
|
+
* it only runs `codex plugin list` / `codex plugin marketplace list` and reads
|
|
59
|
+
* the installed plugin's bundled `.mcp.json`. Returns 0 when the plugin is
|
|
60
|
+
* compatible (or Codex is entirely absent / no plugin installed — those are
|
|
61
|
+
* warnings for non-Codex users), 1 when the installed plugin is stale,
|
|
62
|
+
* disabled, ambiguous, or unreadable.
|
|
63
|
+
*/
|
|
64
|
+
export declare function runCodexPluginDoctor(cliVersion: string, runner?: CodexRunner): Promise<number>;
|
|
65
|
+
//# sourceMappingURL=codex-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-plugin.d.ts","sourceRoot":"","sources":["../src/codex-plugin.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,mBAAmB,GAC3B,SAAS,GACT,UAAU,GACV,YAAY,GACZ,kBAAkB,GAClB,aAAa,GACb,mBAAmB,GACnB,kBAAkB,CAAC;AAEvB,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,aAAa,GAAG,SAAS,CAAC;AAEtE,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAC9E,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;AAEtE,eAAO,MAAM,sBAAsB,eAAe,CAAC;AACnD,eAAO,MAAM,uBAAuB,0BAA0B,CAAC;AAM/D,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAmBvE;AAqCD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EA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