brainfile 0.21.0 → 0.21.2

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 (38) hide show
  1. package/dist/{chunk-FOLBAGJS.mjs → chunk-7KU2R7QC.mjs} +245 -101
  2. package/dist/cli.mjs +324 -207
  3. package/dist/commands/brief.js +1 -1
  4. package/dist/commands/brief.js.map +1 -1
  5. package/dist/commands/log.d.ts.map +1 -1
  6. package/dist/commands/log.js +4 -1
  7. package/dist/commands/log.js.map +1 -1
  8. package/dist/commands/sync.d.ts +3 -1
  9. package/dist/commands/sync.d.ts.map +1 -1
  10. package/dist/commands/sync.js +23 -14
  11. package/dist/commands/sync.js.map +1 -1
  12. package/dist/commands/where.d.ts +4 -1
  13. package/dist/commands/where.d.ts.map +1 -1
  14. package/dist/commands/where.js +9 -3
  15. package/dist/commands/where.js.map +1 -1
  16. package/dist/mcp/helpers.d.ts +3 -2
  17. package/dist/mcp/helpers.d.ts.map +1 -1
  18. package/dist/mcp/helpers.js +5 -6
  19. package/dist/mcp/helpers.js.map +1 -1
  20. package/dist/mcp/tools/brief_tool.js +1 -1
  21. package/dist/mcp/tools/brief_tool.js.map +1 -1
  22. package/dist/{tui-M2KWIG2E.mjs → tui-3Z7ZJV7M.mjs} +1 -1
  23. package/dist/utils/actor.d.ts +22 -0
  24. package/dist/utils/actor.d.ts.map +1 -0
  25. package/dist/utils/actor.js +200 -0
  26. package/dist/utils/actor.js.map +1 -0
  27. package/dist/utils/board-commit-hooks.d.ts.map +1 -1
  28. package/dist/utils/board-commit-hooks.js +3 -2
  29. package/dist/utils/board-commit-hooks.js.map +1 -1
  30. package/dist/utils/board-repo.d.ts +33 -9
  31. package/dist/utils/board-repo.d.ts.map +1 -1
  32. package/dist/utils/board-repo.js +162 -61
  33. package/dist/utils/board-repo.js.map +1 -1
  34. package/dist/utils/board-sync.d.ts +26 -11
  35. package/dist/utils/board-sync.d.ts.map +1 -1
  36. package/dist/utils/board-sync.js +141 -56
  37. package/dist/utils/board-sync.js.map +1 -1
  38. package/package.json +2 -2
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.agentFromProcessTree = agentFromProcessTree;
37
+ exports.agentFromEnvironment = agentFromEnvironment;
38
+ exports.detectAgent = detectAgent;
39
+ exports.resolveActor = resolveActor;
40
+ exports.resetActorCache = resetActorCache;
41
+ /**
42
+ * Who is acting on the board. Board commits are always authored by the git
43
+ * user; the actor is what the board itself records: the `[name]` on a note
44
+ * and the `[name]` suffix on a board commit message.
45
+ *
46
+ * 1. `--agent <name>` or `BRAINFILE_AGENT`, when the agent says who it is
47
+ * 2. the nearest agent CLI among this process's ancestors (claude, codex, …)
48
+ * 3. an agent's environment fingerprint (for sandboxes that hide the
49
+ * process tree, like Codex's)
50
+ * 4. the git user
51
+ *
52
+ * `BRAINFILE_DETECT_AGENT=off` turns off 2 and 3.
53
+ *
54
+ * Only agent command-line tools count. Desktop apps and editors (the Claude
55
+ * app, Cursor, VS Code) also host the person's own terminals, so a command
56
+ * under them is the person's.
57
+ */
58
+ const fs = __importStar(require("fs"));
59
+ const child_process_1 = require("child_process");
60
+ const board_repo_1 = require("./board-repo");
61
+ /** Executable name → the name recorded on the board. */
62
+ const AGENT_BINARIES = {
63
+ claude: 'claude',
64
+ codex: 'codex',
65
+ 'cursor-agent': 'cursor',
66
+ gemini: 'gemini',
67
+ opencode: 'opencode',
68
+ goose: 'goose',
69
+ droid: 'droid',
70
+ crush: 'crush',
71
+ aider: 'aider',
72
+ cline: 'cline',
73
+ amp: 'amp',
74
+ qwen: 'qwen',
75
+ copilot: 'copilot',
76
+ };
77
+ const MAX_DEPTH = 32;
78
+ function sanitize(name) {
79
+ return name.replace(/[[\]<>\r\n]/g, '').trim();
80
+ }
81
+ function agentFromCommand(words) {
82
+ // A native binary shows as argv[0]; a node/python-wrapped CLI as argv[1].
83
+ for (const word of words.slice(0, 2)) {
84
+ const base = word.split('/').pop()?.replace(/\.(c|m)?js$/, '') ?? '';
85
+ if (AGENT_BINARIES[base])
86
+ return AGENT_BINARIES[base];
87
+ }
88
+ return null;
89
+ }
90
+ function linuxProc(pid) {
91
+ try {
92
+ const stat = fs.readFileSync(`/proc/${pid}/stat`, 'utf-8');
93
+ // The command name is in parentheses and may contain spaces.
94
+ const ppid = Number.parseInt(stat.slice(stat.lastIndexOf(')') + 2).split(' ')[1], 10);
95
+ const comm = stat.slice(stat.indexOf('(') + 1, stat.lastIndexOf(')'));
96
+ const cmdline = fs.readFileSync(`/proc/${pid}/cmdline`, 'utf-8').split('\0').filter(Boolean);
97
+ return { ppid, words: [comm, ...cmdline] };
98
+ }
99
+ catch {
100
+ return null;
101
+ }
102
+ }
103
+ function psTable() {
104
+ const r = (0, child_process_1.spawnSync)('ps', ['-A', '-o', 'pid=,ppid=,args='], { encoding: 'utf-8', timeout: 2000 });
105
+ if (r.status !== 0 || !r.stdout)
106
+ return null;
107
+ const table = new Map();
108
+ for (const line of r.stdout.split('\n')) {
109
+ const m = /^\s*(\d+)\s+(\d+)\s+(.*)$/.exec(line);
110
+ if (m)
111
+ table.set(Number(m[1]), { ppid: Number(m[2]), words: m[3].split(/\s+/) });
112
+ }
113
+ return table;
114
+ }
115
+ /** The nearest agent CLI among this process's ancestors, or null. */
116
+ function agentFromProcessTree(startPid = process.ppid) {
117
+ const useProc = process.platform === 'linux' && fs.existsSync('/proc/self/stat');
118
+ const table = useProc ? null : process.platform === 'win32' ? null : psTable();
119
+ if (!useProc && !table)
120
+ return null;
121
+ let pid = startPid;
122
+ for (let depth = 0; depth < MAX_DEPTH && pid > 1; depth++) {
123
+ const info = useProc ? linuxProc(pid) : table?.get(pid) ?? null;
124
+ if (!info)
125
+ return null;
126
+ const agent = agentFromCommand(info.words);
127
+ if (agent)
128
+ return agent;
129
+ pid = info.ppid;
130
+ }
131
+ return null;
132
+ }
133
+ /**
134
+ * Environment variables agents set for the commands they run. Specific
135
+ * markers only: a Claude session can carry `CODEX_COMPANION_*` from a plugin,
136
+ * so a loose `CODEX_` prefix would misattribute it. Codex comes first because
137
+ * its sandbox hides the process tree while inheriting a parent Claude's
138
+ * variables when it was started from one.
139
+ */
140
+ function agentFromEnvironment(env = process.env) {
141
+ if (env.CODEX_THREAD_ID || env.CODEX_SESSION_ID)
142
+ return 'codex';
143
+ if (env.GEMINI_CLI === '1')
144
+ return 'gemini';
145
+ if (env.CLAUDECODE === '1')
146
+ return 'claude';
147
+ // A shared convention some agents follow, e.g. `claude-code_2-1-280_agent`.
148
+ const generic = env.AI_AGENT?.split('_')[0];
149
+ if (generic)
150
+ return generic === 'claude-code' ? 'claude' : sanitize(generic) || null;
151
+ return null;
152
+ }
153
+ function flagValue(argv) {
154
+ const at = argv.indexOf('--agent');
155
+ if (at >= 0 && argv[at + 1] && !argv[at + 1].startsWith('-'))
156
+ return argv[at + 1];
157
+ const inline = argv.find((a) => a.startsWith('--agent='));
158
+ return inline ? inline.slice('--agent='.length) : null;
159
+ }
160
+ let detected = null;
161
+ /** The agent running this process, when one can be told; never the git user. */
162
+ function detectAgent(argv = process.argv, env = process.env) {
163
+ const flag = sanitize(flagValue(argv) ?? '');
164
+ if (flag)
165
+ return { name: flag, source: 'flag' };
166
+ const named = sanitize(env.BRAINFILE_AGENT ?? '');
167
+ if (named)
168
+ return { name: named, source: 'env' };
169
+ // `BRAINFILE_DETECT_AGENT=off` keeps only explicit names (the test runner
170
+ // sets it, so running the suite inside an agent does not change results).
171
+ if (env.BRAINFILE_DETECT_AGENT === 'off')
172
+ return null;
173
+ if (!detected) {
174
+ let value = null;
175
+ try {
176
+ value = agentFromProcessTree();
177
+ }
178
+ catch {
179
+ value = null;
180
+ }
181
+ detected = { value };
182
+ }
183
+ if (detected.value)
184
+ return { name: detected.value, source: 'process' };
185
+ const fingerprint = agentFromEnvironment(env);
186
+ return fingerprint ? { name: fingerprint, source: 'fingerprint' } : null;
187
+ }
188
+ /** The agent, else the git user (`user.name`) for `cwd`, else null. */
189
+ function resolveActor(cwd = process.cwd(), argv = process.argv) {
190
+ const agent = detectAgent(argv);
191
+ if (agent)
192
+ return agent;
193
+ const user = sanitize((0, board_repo_1.git)(['config', '--get', 'user.name'], cwd).stdout);
194
+ return user ? { name: user, source: 'git' } : null;
195
+ }
196
+ /** For tests: forget the cached process-tree answer. */
197
+ function resetActorCache() {
198
+ detected = null;
199
+ }
200
+ //# sourceMappingURL=actor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actor.js","sourceRoot":"","sources":["../../src/utils/actor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0FA,oDAaC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AE,WAAW,CAAC,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;IACzE,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACrD,CAAC;AAED,wDAAwD;AACxD,SAAgB,eAAe;IAC7B,QAAQ,GAAG,IAAI,CAAC;AAClB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"board-commit-hooks.d.ts","sourceRoot":"","sources":["../../src/utils/board-commit-hooks.ts"],"names":[],"mappings":"AAWA,UAAU,WAAW;IACnB,IAAI,IAAI,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CAC7B;AAKD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAQhE;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAItE;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAQ3D;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAI1D"}
1
+ {"version":3,"file":"board-commit-hooks.d.ts","sourceRoot":"","sources":["../../src/utils/board-commit-hooks.ts"],"names":[],"mappings":"AAYA,UAAU,WAAW;IACnB,IAAI,IAAI,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CAC7B;AAKD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAQhE;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAItE;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAQ3D;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAI1D"}
@@ -8,9 +8,10 @@ exports.afterCommand = afterCommand;
8
8
  * Commander hooks that turn every CLI mutation into one commit on a tracked
9
9
  * board (spec-9). `beforeCommand` commits hand edits on their own so they are
10
10
  * never folded into the command's commit; `afterCommand` commits whatever the
11
- * command changed, authored as the acting agent.
11
+ * command changed, authored by the git user and tagged with the agent, if any.
12
12
  */
13
13
  const board_repo_1 = require("./board-repo");
14
+ const actor_1 = require("./actor");
14
15
  const brainfile_path_1 = require("./brainfile-path");
15
16
  const board_autosync_1 = require("./board-autosync");
16
17
  const board_sync_1 = require("./board-sync");
@@ -46,6 +47,6 @@ function afterCommand(command) {
46
47
  const dotDir = boardDirForCommand(command);
47
48
  if (!dotDir)
48
49
  return false;
49
- return (0, board_repo_1.commitBoard)(dotDir, { message: (0, board_repo_1.describeCommandForCommit)(command), agent: (0, board_repo_1.resolveAgentName)() });
50
+ return (0, board_repo_1.commitBoard)(dotDir, { message: (0, board_repo_1.describeCommandForCommit)(command), agent: (0, actor_1.detectAgent)()?.name });
50
51
  }
51
52
  //# sourceMappingURL=board-commit-hooks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"board-commit-hooks.js","sourceRoot":"","sources":["../../src/utils/board-commit-hooks.ts"],"names":[],"mappings":";;AAqBA,kDAQC;AAED,gDAIC;AAED,sCAQC;AAED,oCAIC;AAnDD;;;;;GAKG;AACH,6CAAwG;AACxG,qDAAsD;AACtD,qDAAmD;AACnD,6CAA2C;AAS3C,uFAAuF;AACvF,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC;AAEhG,SAAgB,mBA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zE,CAAC;AAED,SAAgB,aAAa,CAAC,OAAoB;IAChD,MAAM,MAAM,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC3C,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,MAAM,SAAS,GAAG,IAAA,4BAAe,EAAC,MAAM,CAAC,CAAC;IAC1C,6EAA6E;IAC7E,MAAM,OAAO,GAAG,IAAA,gCAAe,EAAC,MAAM,CAAC,CAAC;IACxC,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAA,wBAAW,EAAC,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC;IACnF,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAgB,YAAY,CAAC,OAAoB;IAC/C,MAAM,MAAM,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC3C,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,OAAO,IAAA,wBAAW,EAAC,MAAM,EAAE,EAAE,OAAO,EAAE,IAAA,qCAAwB,EAAC,OAAO,CAAC,EAAE,KAAK,EAAE,IAAA,mBAAW,GAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AACzG,CAAC"}
@@ -1,5 +1,22 @@
1
1
  export declare const DEFAULT_BOARD_BRANCH = "brainfile";
2
2
  export declare const BOARD_BRANCH_CONFIG_KEY = "brainfile.branch";
3
+ /**
4
+ * On a remote, a board is stored under `refs/brainfile/<name>` rather than as
5
+ * a branch: hosts list, badge and offer pull requests for branches only, so
6
+ * the board stays out of the project's branch list while still being pushed,
7
+ * fetched and kept like any other ref. Locally the last-known remote position
8
+ * lives under `refs/brainfile/remotes/<remote>/<name>`, outside `refs/remotes/`
9
+ * so a user's `git fetch --prune` never deletes it.
10
+ */
11
+ export declare const BOARD_REF_NAMESPACE = "refs/brainfile";
12
+ export declare const BOARD_NAME_CONFIG_KEY = "brainfile.boardName";
13
+ /** 0.21.0 key: the branch the board was pushed to. Still read as the name. */
14
+ export declare const LEGACY_REMOTE_BRANCH_CONFIG_KEY = "brainfile.remoteBranch";
15
+ /** Default name for a board that lives in a code repository. */
16
+ export declare const DEFAULT_BOARD_NAME = "board";
17
+ export declare function remoteBoardRef(name: string): string;
18
+ export declare function boardTrackingRef(remote: string, name: string): string;
19
+ export declare function gitNetwork(args: string[], cwd: string): GitResult;
3
20
  export interface GitResult {
4
21
  ok: boolean;
5
22
  status: number | null;
@@ -7,7 +24,7 @@ export interface GitResult {
7
24
  stderr: string;
8
25
  }
9
26
  /** Run git synchronously. Never throws; a missing git binary is `ok: false`. */
10
- export declare function git(args: string[], cwd: string, env?: NodeJS.ProcessEnv): GitResult;
27
+ export declare function git(args: string[], cwd: string, env?: NodeJS.ProcessEnv, timeoutMs?: number): GitResult;
11
28
  /** Toplevel of the working tree containing `cwd`, or null outside any repo. */
12
29
  export declare function gitToplevel(cwd: string): string | null;
13
30
  /** The git directory shared by every worktree of the repo containing `cwd`. */
@@ -39,13 +56,22 @@ export declare function isTrackedBoard(dotDir: string): boolean;
39
56
  */
40
57
  export declare function findTrackedBoardDir(cwd: string): string | null;
41
58
  /**
42
- * Resolution step 4: the board branch exists locally but no worktree has it
43
- * checked out (a fresh clone, or the directory was removed). Create the
44
- * worktree at `<main worktree>/.brainfile` — or inside the common git dir for
45
- * bare layouts — and hide it from the code branch. Returns the new board
59
+ * Board names published on `remote` (`refs/brainfile/<name>`), or null when
60
+ * the remote could not be asked. One network round trip.
61
+ */
62
+ export declare function listRemoteBoards(cwd: string, remote: string): string[] | null;
63
+ export interface MaterializeOptions {
64
+ /** Ask the remote even if a recent lookup found nothing (after `--set-remote`). */
65
+ fresh?: boolean;
66
+ }
67
+ /**
68
+ * Resolution step 4: the board is not checked out anywhere (a fresh clone,
69
+ * or the directory was removed). Create the worktree at
70
+ * `<main worktree>/.brainfile` — or inside the common git dir for bare
71
+ * layouts — and hide it from the code branch. Returns the new board
46
72
  * directory, or null when there is nothing to materialize.
47
73
  */
48
- export declare function materializeBoardWorktree(cwd: string): string | null;
74
+ export declare function materializeBoardWorktree(cwd: string, options?: MaterializeOptions): string | null;
49
75
  /** Hide `.brainfile/` from the code branch without touching `.gitignore`. Returns true when an entry was added. */
50
76
  export declare function ensureExcludeEntry(cwd: string): boolean;
51
77
  /** Remove the exclude entry, but only the one we wrote (identified by its marker). */
@@ -65,7 +91,7 @@ type CommitListener = (dotDir: string) => void;
65
91
  export declare function onBoardCommitted(listener: CommitListener): void;
66
92
  export interface CommitBoardOptions {
67
93
  message: string;
68
- /** Acting agent; becomes the commit author. The committer stays the git user. */
94
+ /** The agent acting, recorded as a `[name]` suffix; the author stays the git user. */
69
95
  agent?: string | null;
70
96
  }
71
97
  /**
@@ -84,8 +110,6 @@ export declare function commitBoard(dotDir: string, options: CommitBoardOptions)
84
110
  * command mutates, so they are never folded into that command's commit.
85
111
  */
86
112
  export declare function commitHandEdits(dotDir: string): boolean;
87
- /** The acting agent: `BRAINFILE_AGENT`, else `--agent <name>` on the command line. */
88
- export declare function resolveAgentName(argv?: string[]): string | null;
89
113
  /** The home board: `~/.brainfile`, addressed with `-g` / `--global` or `BRAINFILE_GLOBAL=1`. */
90
114
  export declare function homeBoardDir(): string;
91
115
  export declare function isGlobalBoardRequested(argv?: string[]): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"board-repo.d.ts","sourceRoot":"","sources":["../../src/utils/board-repo.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,oBAAoB,cAAc,CAAC;AAChD,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAQ1D,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gFAAgF;AAChF,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAA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