botanary 0.1.0 → 0.2.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 (73) hide show
  1. package/README.md +186 -9
  2. package/dist/bin/botanary.js +13 -3
  3. package/dist/bin/botanary.js.map +1 -1
  4. package/dist/package.json +2 -2
  5. package/dist/src/app-url.js +32 -0
  6. package/dist/src/app-url.js.map +1 -0
  7. package/dist/src/cli.js +113 -23
  8. package/dist/src/cli.js.map +1 -1
  9. package/dist/src/commands/agent.js +190 -49
  10. package/dist/src/commands/agent.js.map +1 -1
  11. package/dist/src/commands/mcp.js +136 -5
  12. package/dist/src/commands/mcp.js.map +1 -1
  13. package/dist/src/commands/system.js +109 -12
  14. package/dist/src/commands/system.js.map +1 -1
  15. package/dist/src/commands/utilities.js +44 -0
  16. package/dist/src/commands/utilities.js.map +1 -0
  17. package/dist/src/commands/wallet.js +332 -94
  18. package/dist/src/commands/wallet.js.map +1 -1
  19. package/dist/src/completion.js +69 -0
  20. package/dist/src/completion.js.map +1 -0
  21. package/dist/src/config-store.js +52 -0
  22. package/dist/src/config-store.js.map +1 -0
  23. package/dist/src/context.js +14 -4
  24. package/dist/src/context.js.map +1 -1
  25. package/dist/src/errors.js +116 -0
  26. package/dist/src/errors.js.map +1 -0
  27. package/dist/src/help/examples.js +357 -0
  28. package/dist/src/help/examples.js.map +1 -0
  29. package/dist/src/help/format.js +144 -0
  30. package/dist/src/help/format.js.map +1 -0
  31. package/dist/src/help/groups.js +39 -0
  32. package/dist/src/help/groups.js.map +1 -0
  33. package/dist/src/mcp-snippets.js +6 -0
  34. package/dist/src/mcp-snippets.js.map +1 -1
  35. package/dist/src/outcome.js +63 -0
  36. package/dist/src/outcome.js.map +1 -0
  37. package/dist/src/parser.js +18 -39
  38. package/dist/src/parser.js.map +1 -1
  39. package/dist/src/progress.js +37 -0
  40. package/dist/src/progress.js.map +1 -0
  41. package/dist/src/prompt-doc.js +92 -0
  42. package/dist/src/prompt-doc.js.map +1 -0
  43. package/dist/src/render/accounts.js +21 -0
  44. package/dist/src/render/accounts.js.map +1 -0
  45. package/dist/src/render/activity.js +34 -0
  46. package/dist/src/render/activity.js.map +1 -0
  47. package/dist/src/render/agents.js +42 -0
  48. package/dist/src/render/agents.js.map +1 -0
  49. package/dist/src/render/balance.js +68 -0
  50. package/dist/src/render/balance.js.map +1 -0
  51. package/dist/src/render/chains.js +52 -0
  52. package/dist/src/render/chains.js.map +1 -0
  53. package/dist/src/render/gas.js +34 -0
  54. package/dist/src/render/gas.js.map +1 -0
  55. package/dist/src/render/grant.js +34 -0
  56. package/dist/src/render/grant.js.map +1 -0
  57. package/dist/src/render/kv.js +60 -0
  58. package/dist/src/render/kv.js.map +1 -0
  59. package/dist/src/render/mandates.js +111 -0
  60. package/dist/src/render/mandates.js.map +1 -0
  61. package/dist/src/render/print.js +18 -0
  62. package/dist/src/render/print.js.map +1 -0
  63. package/dist/src/repl.js +114 -10
  64. package/dist/src/repl.js.map +1 -1
  65. package/dist/src/review.js +52 -0
  66. package/dist/src/review.js.map +1 -0
  67. package/dist/src/settings.js +88 -0
  68. package/dist/src/settings.js.map +1 -0
  69. package/dist/src/update-check.js +85 -0
  70. package/dist/src/update-check.js.map +1 -0
  71. package/dist/src/validate.js +92 -0
  72. package/dist/src/validate.js.map +1 -0
  73. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"examples.js","sourceRoot":"","sources":["../../../src/help/examples.ts"],"names":[],"mappings":"AAqBA,4GAA4G;AAC5G,MAAM,CAAC,MAAM,YAAY,GAAgC;IACvD,KAAK,EAAE;QACL,IAAI,EACF,oGAAoG;YACpG,uGAAuG;YACvG,gGAAgG;QAClG,QAAQ,EAAE,CAAC,gBAAgB,EAAE,uBAAuB,CAAC;QACrD,KAAK,EAAE,mGAAmG;QAC1G,OAAO,EAAE,uDAAuD;KACjE;IACD,MAAM,EAAE;QACN,IAAI,EAAE,gFAAgF;QACtF,QAAQ,EAAE,CA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AAiB,EAAE,+BAA+B,CAAC;QAC9D,OAAO,EAAE,0CAA0C;KACpD;CACF,CAAC;AAEF,yFAAyF;AACzF,MAAM,UAAU,WAAW,CAAC,GAAY;IACtC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,IAAI,CAAC,GAAmB,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;QAC9D,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,GAAY;IAClC,OAAO,YAAY,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;AACxC,CAAC"}
@@ -0,0 +1,144 @@
1
+ import { colors } from '../render/colors.js';
2
+ import { DOCS_URL, GROUP_ORDER, OPTION_SECTIONS, QUICK_START, groupOf } from './groups.js';
3
+ import { helpFor } from './examples.js';
4
+ import { EXIT_CODES } from '../errors.js';
5
+ /** Column at which a description starts. Long terms simply push their description one space right. */
6
+ const TERM_WIDTH = 22;
7
+ function heading(title) {
8
+ return colors.brand(colors.bold(`◆ ${title}`));
9
+ }
10
+ function subheading(title) {
11
+ return colors.bold(` ${title}`);
12
+ }
13
+ function entry(term, description, indent = ' ') {
14
+ return `${indent}${term.padEnd(TERM_WIDTH)} ${description}`.trimEnd();
15
+ }
16
+ function indentBlock(text, indent) {
17
+ return text
18
+ .split('\n')
19
+ .map((line) => (line ? `${indent}${line}` : ''))
20
+ .join('\n');
21
+ }
22
+ /**
23
+ * commander synthesizes a placeholder Command for the implicit `help` subcommand, so there is no
24
+ * registration site to tag it at. This is the ONE place a name match is unavoidable; everything else
25
+ * groups by the tag recorded on the Command object itself.
26
+ */
27
+ function groupOfVisible(cmd) {
28
+ return cmd.name() === 'help' ? 'Utilities' : groupOf(cmd);
29
+ }
30
+ /** Assign every option to exactly one section, with anything unlisted falling into the last one. */
31
+ function sectionize(options) {
32
+ const buckets = OPTION_SECTIONS.map((s) => ({ title: s.title, options: [] }));
33
+ const fallback = buckets[buckets.length - 1];
34
+ for (const option of options) {
35
+ const index = OPTION_SECTIONS.findIndex((s) => s.flags.includes(option.long ?? ''));
36
+ (index >= 0 ? buckets[index] : fallback).options.push(option);
37
+ }
38
+ return buckets.filter((bucket) => bucket.options.length > 0);
39
+ }
40
+ function optionLines(options, helper) {
41
+ const lines = [];
42
+ for (const bucket of sectionize(options)) {
43
+ lines.push(subheading(bucket.title));
44
+ for (const option of bucket.options) {
45
+ lines.push(entry(helper.optionTerm(option), helper.optionDescription(option), ' '));
46
+ }
47
+ }
48
+ return lines;
49
+ }
50
+ export function formatRootHelp(cmd, helper) {
51
+ const lines = [];
52
+ lines.push(`${colors.bold('Usage:')} ${helper.commandUsage(cmd)}`);
53
+ lines.push('');
54
+ lines.push(cmd.description());
55
+ lines.push('');
56
+ const visible = helper.visibleCommands(cmd);
57
+ for (const title of GROUP_ORDER) {
58
+ const group = visible.filter((c) => groupOfVisible(c) === title);
59
+ if (!group.length)
60
+ continue;
61
+ lines.push(heading(title));
62
+ for (const sub of group) {
63
+ lines.push(entry(helper.subcommandTerm(sub), helper.subcommandDescription(sub)));
64
+ }
65
+ lines.push('');
66
+ }
67
+ const options = helper.visibleOptions(cmd);
68
+ if (options.length) {
69
+ lines.push(heading('Global options'));
70
+ lines.push(...optionLines(options, helper));
71
+ lines.push('');
72
+ }
73
+ lines.push(heading('Quick Start'));
74
+ for (const line of QUICK_START)
75
+ lines.push(` ${line}`);
76
+ lines.push('');
77
+ lines.push(heading('Exit Codes'));
78
+ for (const { code, meaning } of EXIT_CODES)
79
+ lines.push(` ${String(code).padEnd(5)}${meaning}`);
80
+ lines.push('');
81
+ lines.push(heading('Resources'));
82
+ lines.push(` Docs: ${DOCS_URL}`);
83
+ return `${lines.join('\n')}\n`;
84
+ }
85
+ export function formatCommandHelp(cmd, helper) {
86
+ const meta = helpFor(cmd);
87
+ const lines = [];
88
+ lines.push(`${colors.bold('Usage:')} ${helper.commandUsage(cmd)}`);
89
+ lines.push('');
90
+ lines.push(helper.commandDescription(cmd));
91
+ if (meta?.body) {
92
+ lines.push('');
93
+ lines.push(meta.body);
94
+ }
95
+ const subcommands = helper.visibleCommands(cmd);
96
+ if (subcommands.length) {
97
+ lines.push('');
98
+ lines.push(heading('Commands'));
99
+ for (const sub of subcommands) {
100
+ lines.push(entry(helper.subcommandTerm(sub), helper.subcommandDescription(sub)));
101
+ }
102
+ }
103
+ const own = helper.visibleOptions(cmd);
104
+ if (own.length) {
105
+ lines.push('');
106
+ lines.push(heading('Options'));
107
+ for (const option of own) {
108
+ lines.push(entry(helper.optionTerm(option), helper.optionDescription(option)));
109
+ }
110
+ }
111
+ const globals = helper.visibleGlobalOptions(cmd);
112
+ if (globals.length) {
113
+ lines.push('');
114
+ lines.push(heading('Global options'));
115
+ lines.push(...optionLines(globals, helper));
116
+ }
117
+ if (meta?.examples.length) {
118
+ lines.push('');
119
+ lines.push(heading('Examples'));
120
+ for (const example of meta.examples)
121
+ lines.push(` ${example}`);
122
+ }
123
+ if (meta?.notes) {
124
+ lines.push('');
125
+ lines.push(heading('Notes'));
126
+ lines.push(indentBlock(meta.notes, ' '));
127
+ }
128
+ if (meta?.seeAlso) {
129
+ lines.push('');
130
+ lines.push(heading('See also'));
131
+ lines.push(colors.dim(` ${meta.seeAlso}`));
132
+ }
133
+ return `${lines.join('\n')}\n`;
134
+ }
135
+ /**
136
+ * One formatter registered on the root, dispatching on whether it was handed the root or a subcommand.
137
+ * commander inherits `configureHelp` into every subcommand, which is what made 0.1.0's root-shaped
138
+ * formatter mislabel and silently drop subcommand help - inheritance is fine, a formatter that ignores
139
+ * which command it is rendering is not.
140
+ */
141
+ export function formatHelp(cmd, helper) {
142
+ return cmd.parent === null ? formatRootHelp(cmd, helper) : formatCommandHelp(cmd, helper);
143
+ }
144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,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAC5F,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Group titles, in the order root help prints them.
3
+ *
4
+ * `Other` is the catch-all, and it is load-bearing: `botanary@0.1.0` grouped commands by matching a flat
5
+ * allowlist of names, so any command nobody remembered to list vanished from help entirely (`agent --help`
6
+ * showed one of twelve subcommands). Tagging at registration plus an always-visible catch-all means the
7
+ * worst case is a command in the wrong section, never a command nobody can find - and
8
+ * test/help-format.spec.ts asserts `Other` is empty, which turns a forgotten tag into a failing test.
9
+ */
10
+ export const GROUP_ORDER = ['Wallet', 'Agent', 'Connect', 'System', 'Utilities', 'Other'];
11
+ /** Keyed by the Command object itself, so nothing depends on a name matching a list. */
12
+ const TAGS = new WeakMap();
13
+ /** Tag `cmd` for root help. Returns `cmd`, so it wraps a `.command(...)` chain in place. */
14
+ export function group(cmd, title) {
15
+ TAGS.set(cmd, title);
16
+ return cmd;
17
+ }
18
+ export function groupOf(cmd) {
19
+ return TAGS.get(cmd) ?? 'Other';
20
+ }
21
+ /**
22
+ * Global-option sections, in help order, keyed by commander's own `option.long` (so `--no-color`, not
23
+ * `--color`). A long flag missing from every section is printed under the last one rather than dropped.
24
+ */
25
+ export const OPTION_SECTIONS = [
26
+ { title: 'General', flags: ['--version', '--help'] },
27
+ { title: 'Auth and Network', flags: ['--chain', '--chain-id', '--account', '--api-url', '--home'] },
28
+ { title: 'Output and Formatting', flags: ['--json', '--raw', '--quiet', '--verbose', '--no-color', '--reveal'] },
29
+ { title: 'Runtime and Behavior', flags: ['--timeout', '--debug', '--no-interactive', '--yes', '--dry-run'] },
30
+ ];
31
+ /** The four lines root help prints under Quick Start. Deliberately the shortest useful path in. */
32
+ export const QUICK_START = [
33
+ 'botanary login Log in as the owner, in your browser',
34
+ 'botanary balance What you hold, across every chain',
35
+ 'botanary chains Which chains work, and what each can do',
36
+ 'botanary send --dry-run Preflight a payment without sending it',
37
+ ];
38
+ export const DOCS_URL = 'https://docs.botanary.xyz';
39
+ //# sourceMappingURL=groups.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groups.js","sourceRoot":"","sources":["../../../src/help/groups.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,CAAU,CAAC;AAInG,wFAAwF;AACxF,MAAM,IAAI,GAAG,IAAI,OAAO,EAAuB,CAAC;AAEhD,4FAA4F;AAC5F,MAAM,UAAU,KAAK,CAAoB,GAAM,EAAE,KAAiB;IAChE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACrB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,GAAY;IAClC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC;AAClC,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAA8C;IACxE,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE;IACpD,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE;IACnG,EAAE,KAAK,EAAE,uBAAuB,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE;IAChH,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,kBAAkB,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;CAC7G,CAAC;AAEF,mGAAmG;AACnG,MAAM,CAAC,MAAM,WAAW,GAAa;IACnC,0EAA0E;IAC1E,uEAAuE;IACvE,6EAA6E;IAC7E,4EAA4E;CAC7E,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,2BAA2B,CAAC"}
@@ -4,18 +4,24 @@ export const MCP_SNIPPETS = {
4
4
  claude: {
5
5
  label: 'Claude Code',
6
6
  snippet: 'claude mcp add --transport stdio botanary -- npx -y botanary-mcp',
7
+ // Its own CLI owns its config. Running the client's documented command is a far smaller blast radius
8
+ // than us editing a config file we do not own.
9
+ installCommand: ['claude', 'mcp', 'add', '--transport', 'stdio', 'botanary', '--', 'npx', '-y', 'botanary-mcp'],
7
10
  },
8
11
  codex: {
9
12
  label: 'Codex',
10
13
  snippet: 'codex mcp add botanary -- npx -y botanary-mcp',
14
+ installCommand: ['codex', 'mcp', 'add', 'botanary', '--', 'npx', '-y', 'botanary-mcp'],
11
15
  },
12
16
  cursor: {
13
17
  label: 'Cursor (.cursor/mcp.json)',
14
18
  snippet: JSON.stringify({ mcpServers: { botanary: { command: 'npx', args: ['-y', 'botanary-mcp'] } } }, null, 2),
19
+ configPath: '.cursor/mcp.json',
15
20
  },
16
21
  'claude-desktop': {
17
22
  label: 'Claude Desktop (claude_desktop_config.json)',
18
23
  snippet: JSON.stringify({ mcpServers: { botanary: { command: 'npx', args: ['-y', 'botanary-mcp'], env: { BOTANARY_API_URL: 'https://api.app.botanary.xyz' } } } }, null, 2),
24
+ configPath: 'claude_desktop_config.json',
19
25
  },
20
26
  };
21
27
  //# sourceMappingURL=mcp-snippets.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-snippets.js","sourceRoot":"","sources":["../../src/mcp-snippets.ts"],"names":[],"mappings":"AAAA;iGACiG;AACjG,MAAM,CAAC,MAAM,YAAY,GAAuD;IAC9E,MAAM,EAAE;QACN,KAAK,EAAE,aAAa;QACpB,OAAO,EAAE,kEAAkE;KAC5E;IACD,KAAK,EAAE;QACL,KAAK,EAAE,OAAO;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,SAAS,CACrB,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE,EAAE,EAAE,EAC9E,IAAI,EACJ,CAAC,CACF;QACD,UAAU,EAAE,kBAAkB;KAC/B;IACD,gBAAgB,EAAE;QAChB,KAAK,EAAE,6CAA6C;QACpD,OAAO,EAAE,IAAI,CAAC,SAAS,CACrB,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE,GAAG,EAAE,EAAE,gBAAgB,EAAE,8BAA8B,EAAE,EAAE,EAAE,EAAE,EACzI,IAAI,EACJ,CAAC,CACF;QACD,UAAU,EAAE,4BAA4B;KACzC;CACF,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { EXIT } from './errors.js';
2
+ /**
3
+ * Turn a send result into an exit code WITHOUT inventing a verdict.
4
+ *
5
+ * The one that matters is `pending`: the op is live, the backend has it, and the receipt has not arrived.
6
+ * That is neither a success (nothing is confirmed) nor a failure (a resend would move money twice), and it
7
+ * is exactly what exit 5 exists for. An unrecognised shape is treated as pending for the same reason:
8
+ * claiming success for a result we cannot read is the one unrecoverable mistake here.
9
+ *
10
+ * When settled is true but status is missing, that is relayed-and-unreadable, not a decline - it maps to
11
+ * exit 5 with code 'unknown' to avoid inventing a decline reason the backend never stated.
12
+ */
13
+ export function classifyWalletSend(result) {
14
+ const root = (result ?? {});
15
+ if (root.lane === 'agent') {
16
+ const relay = root.relay ?? {};
17
+ if (relay.settled === true) {
18
+ if (relay.status === 'included') {
19
+ return { exit: EXIT.ok, code: 'included', note: null };
20
+ }
21
+ if (relay.status === undefined) {
22
+ return { exit: EXIT.pending, code: 'unknown', note: relay.note ?? null };
23
+ }
24
+ return { exit: EXIT.declined, code: relay.status, note: relay.note ?? null };
25
+ }
26
+ return { exit: EXIT.pending, code: String(relay.status ?? 'pending'), note: relay.note ?? null };
27
+ }
28
+ switch (root.status) {
29
+ case 'relayed':
30
+ return { exit: EXIT.ok, code: 'relayed', note: null };
31
+ case 'failed':
32
+ return { exit: EXIT.declined, code: String(root.declineReason ?? 'failed'), note: root.note ?? null };
33
+ case 'rejected':
34
+ return { exit: EXIT.error, code: 'rejected', note: 'You rejected it in the browser. Nothing was sent.' };
35
+ case 'expired':
36
+ return { exit: EXIT.error, code: 'expired', note: 'The request expired before it was signed. Nothing was sent.' };
37
+ default:
38
+ return { exit: EXIT.pending, code: String(root.status ?? 'pending'), note: root.note ?? null };
39
+ }
40
+ }
41
+ /**
42
+ * The same job for the agent lane's own `{ proposed, settled, status, reason }` envelope.
43
+ *
44
+ * When settled is true but status is missing, that is relayed-and-unreadable, not a decline - it maps to
45
+ * exit 5 with code 'unknown' to avoid inventing a status the backend never stated.
46
+ */
47
+ export function classifyAgentAction(result) {
48
+ const root = (result ?? {});
49
+ if (root.proposed === false) {
50
+ return { exit: EXIT.declined, code: String(root.reason ?? 'declined'), note: root.note ?? null };
51
+ }
52
+ if (root.settled === true) {
53
+ if (root.status === 'included') {
54
+ return { exit: EXIT.ok, code: 'included', note: null };
55
+ }
56
+ if (root.status === undefined) {
57
+ return { exit: EXIT.pending, code: 'unknown', note: root.note ?? null };
58
+ }
59
+ return { exit: EXIT.declined, code: root.status, note: root.note ?? null };
60
+ }
61
+ return { exit: EXIT.pending, code: String(root.status ?? 'pending'), note: root.note ?? null };
62
+ }
63
+ //# sourceMappingURL=outcome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outcome.js","sourceRoot":"","sources":["../../src/outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAQnC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAe;IAChD,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,EAAE,CAMzB,CAAC;IAEF,IAAI,I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AAE,CAAC;QAC1E,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;IAC7E,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;AACjG,CAAC"}
@@ -1,51 +1,30 @@
1
- import { Command } from 'commander';
2
- import { colors } from './render/colors.js';
3
- /** Alchemy-style grouped help: commander's default help lists commands flat, so this overrides the
4
- * formatter to print grouped section headers instead. Groups match the design spec's command table. */
5
- const GROUPS = [
6
- { title: 'Wallet', commands: ['login', 'logout', 'status', 'balance', 'send', 'activity', 'markets', 'yield', 'mandates', 'agents', 'accounts', 'api'] },
7
- { title: 'Agent', commands: ['agent'] },
8
- { title: 'Connect', commands: ['mcp'] },
9
- { title: 'System', commands: ['diagnose', 'config'] },
10
- ];
1
+ import { Command, Option } from 'commander';
2
+ import { formatHelp } from './help/format.js';
11
3
  export function createProgram() {
12
4
  const program = new Command();
13
5
  program
14
6
  .name('botanary')
15
7
  .description('Botanary from your terminal.')
16
8
  .option('--json', 'Force JSON output (auto-enabled when piped)')
9
+ .option('--raw', 'Print the full raw JSON payload instead of a table')
10
+ .option('-q, --quiet', 'Suppress non-essential output')
11
+ .option('--verbose', 'Show detail an ordinary run leaves out')
17
12
  .option('--no-interactive', 'Disable prompts and the REPL')
18
13
  .option('--no-color', 'Disable color output')
19
14
  .option('--reveal', 'Show redacted values in plain text')
20
- .configureHelp({
21
- formatHelp: (cmd, helper) => {
22
- const lines = [];
23
- lines.push(`${colors.bold('Usage:')} ${helper.commandUsage(cmd)}`);
24
- lines.push('');
25
- lines.push(cmd.description());
26
- lines.push('');
27
- for (const group of GROUPS) {
28
- const subcommands = helper
29
- .visibleCommands(cmd)
30
- .filter((c) => group.commands.includes(c.name()));
31
- if (!subcommands.length)
32
- continue;
33
- lines.push(colors.brand(colors.bold(`◆ ${group.title}`)));
34
- for (const sub of subcommands) {
35
- lines.push(` ${sub.name().padEnd(20)} ${sub.description()}`);
36
- }
37
- lines.push('');
38
- }
39
- const options = helper.visibleOptions(cmd);
40
- if (options.length) {
41
- lines.push(colors.brand(colors.bold('◆ Global options')));
42
- for (const opt of options) {
43
- lines.push(` ${helper.optionTerm(opt).padEnd(20)} ${helper.optionDescription(opt)}`);
44
- }
45
- }
46
- return lines.join('\n');
47
- },
48
- });
15
+ .option('--chain <id|key>', 'Default chain: an EVM chain id (8453) or a chain key (solana)')
16
+ .option('--account <accountId>', 'Owner account to act as')
17
+ .option('--api-url <url>', 'Botanary API base URL')
18
+ .option('--home <dir>', 'Directory holding identity, session and CLI config')
19
+ .option('--timeout <ms>', 'Abort any single request after this many milliseconds')
20
+ .option('--debug', 'Log one redacted line per HTTP request to stderr')
21
+ .option('-y, --yes', 'Skip the review step on a command that moves funds')
22
+ .option('--dry-run', 'Preflight only: never create a sign request, never relay')
23
+ // `-V` was 0.1.0's only version flag. `-v` is the spelling every comparable CLI uses, so it becomes
24
+ // the documented one and `-V` stays as a hidden alias - commander allows one short flag per option,
25
+ // so the alias is a separate hidden option that runCli handles before dispatch.
26
+ .addOption(new Option('-V', 'Alias of -v').hideHelp())
27
+ .configureHelp({ showGlobalOptions: true, formatHelp });
49
28
  program.exitOverride();
50
29
  return program;
51
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C;wGACwG;AACxG,MAAM,MAAM,GAAiD;IAC3D,EAAE,KAAK,EAAE,QAAQ,EAAE,QAA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AAE,uBAAuB,CAAC;SAClD,MAAM,CAAC,cAAc,EAAE,oDAAoD,CAAC;SAC5E,MAAM,CAAC,gBAAgB,EAAE,uDAAuD,CAAC;SACjF,MAAM,CAAC,SAAS,EAAE,kDAAkD,CAAC;SACrE,MAAM,CAAC,WAAW,EAAE,oDAAoD,CAAC;SACzE,MAAM,CAAC,WAAW,EAAE,0DAA0D,CAAC;QAChF,oGAAoG;QACpG,oGAAoG;QACpG,gFAAgF;SAC/E,SAAS,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,QAAQ,EAAE,CAAC;SACrD,aAAa,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;IAC1D,OAAO,CAAC,YAAY,EAAE,CAAC;IACvB,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;cAGc;AACd,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,EAAE,GAAG,kBAAkB,CAAC;IAC9B,IAAI,KAA6B,CAAC;IAClC,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QACxC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,37 @@
1
+ import * as clack from '@clack/prompts';
2
+ /** True whenever nothing decorative may be written. */
3
+ export function isQuietMode(ctx) {
4
+ return !ctx.interactive || ctx.json || ctx.quiet;
5
+ }
6
+ /**
7
+ * Run `fn` behind a spinner. Completely inert - no ANSI, no stdin touch, no output at all - when the
8
+ * output is machine-bound (`--json`), suppressed (`--quiet`), or the terminal is not interactive. 0.1.0
9
+ * had no spinner anywhere, so every network call looked like a hang.
10
+ */
11
+ export async function step(ctx, label, fn) {
12
+ if (isQuietMode(ctx))
13
+ return fn();
14
+ const spinner = clack.spinner();
15
+ spinner.start(label);
16
+ try {
17
+ const result = await fn();
18
+ spinner.stop(label);
19
+ return result;
20
+ }
21
+ catch (e) {
22
+ spinner.stop(label, 1);
23
+ throw e;
24
+ }
25
+ }
26
+ /**
27
+ * Print one line of human-facing progress to stderr. Unlike `step`, this DOES print in a non-interactive
28
+ * terminal: its callers carry the login code and the approval URL, which is exactly what a headless or
29
+ * piped run still needs a human to act on. Printed to stderr (never stdout) so it cannot corrupt a piped
30
+ * payload. Silenced only by `--json` or `--quiet`.
31
+ */
32
+ export function notify(ctx, line) {
33
+ if (ctx.json || ctx.quiet)
34
+ return;
35
+ process.stderr.write(`${line}\n`);
36
+ }
37
+ //# sourceMappingURL=progress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.js","sourceRoot":"","sources":["../../src/progress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AASxC,uDAAuD;AACvD,MAAM,UAAU,WAAW,CAAC,GAAgB;IAC1C,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAI,GAAgB,EAAE,KAAa,EAAE,EAAoB;IACjF,IAAI,WAAW,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,EAAE,CAAC;IAClC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,EAAE,EAAE,CAAC;QAC1B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpB,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACvB,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,GAAgB,EAAE,IAAY;IACnD,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,KAAK;QAAE,OAAO;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;AACpC,CAAC"}
@@ -0,0 +1,92 @@
1
+ import { EXIT_CODES } from './errors.js';
2
+ import { COMMAND_HELP, commandPath } from './help/examples.js';
3
+ import { DOCS_URL, GROUP_ORDER, groupOf } from './help/groups.js';
4
+ /**
5
+ * The whole operating manual for a non-human driver, generated from the same metadata `--help` renders, so
6
+ * a new command appears in both or in neither. Deliberately plain text with no ANSI: its destination is a
7
+ * file, a prompt, or another program's context window.
8
+ */
9
+ export function promptDoc(program, cliVersion) {
10
+ const lines = [];
11
+ lines.push(`# botanary CLI ${cliVersion} - operating manual for an automation`);
12
+ lines.push('');
13
+ lines.push('You are driving the `botanary` CLI non-interactively. Botanary never holds a signing key: the');
14
+ lines.push('CLI builds unsigned operations and either an on-chain mandate signs them locally or the human');
15
+ lines.push('owner approves them in a browser. Nothing you do here can sign as the owner.');
16
+ lines.push('');
17
+ lines.push('## Two lanes, never confuse them');
18
+ lines.push('');
19
+ lines.push('- OWNER lane (`login`, `balance`, `send`, ...): acts as the human account owner, using a session');
20
+ lines.push(' token stored on this machine. A `send` that no mandate covers needs the human in a browser.');
21
+ lines.push('- AGENT lane (`agent ...`): acts as this machine\'s own paired agent, spending unattended within');
22
+ lines.push(' whatever the owner granted it. `agent spend` refuses out-of-bounds amounts; `agent request`');
23
+ lines.push(' asks the owner instead.');
24
+ lines.push('');
25
+ lines.push('## Invocation rules');
26
+ lines.push('');
27
+ lines.push('- Always pass `--json`. Output is then a single compact JSON line on stdout (except `completion`,');
28
+ lines.push(' which prints a shell script regardless).');
29
+ lines.push('- Always pass `--yes` on a command that moves funds, or it exits 2 rather than prompting.');
30
+ lines.push('- Use `--dry-run` first on anything that moves funds: same checks, same review, nothing sent.');
31
+ lines.push('- `--chain-id` is required by money commands. Run `botanary chains --json` to learn valid ids.');
32
+ lines.push('- Never retry a `send` that returned exit 5. The operation is live; poll');
33
+ lines.push(' `botanary api /userops/<opId> --json` to check its status. A retry moves funds twice.');
34
+ lines.push('- Never retry an `agent spend` that returned exit 5 either; poll `botanary agent status');
35
+ lines.push(' <opId> --json` instead.');
36
+ lines.push('');
37
+ lines.push('## Failure contract');
38
+ lines.push('');
39
+ lines.push('On failure with `--json`, stdout carries a single JSON line. The error object always has');
40
+ lines.push('`code` and `message`. The `hint` field is optional and must not be assumed to exist.');
41
+ lines.push('Example:');
42
+ lines.push('');
43
+ lines.push(' {"ok":false,"error":{"code":"declined","message":"...","hint":"..."}}');
44
+ lines.push('');
45
+ lines.push('A successful command prints its payload bare, with no wrapper. Branch on the exit code first');
46
+ lines.push('and on `error.code` second. Never string-match a message.');
47
+ lines.push('');
48
+ lines.push('## Exit codes');
49
+ lines.push('');
50
+ for (const { code, meaning } of EXIT_CODES)
51
+ lines.push(`- exit ${code}: ${meaning}`);
52
+ lines.push('');
53
+ lines.push('## Commands');
54
+ lines.push('');
55
+ const visible = program.commands.filter((cmd) => !cmd.name().startsWith('help'));
56
+ for (const title of GROUP_ORDER) {
57
+ const groupCommands = visible.filter((cmd) => groupOf(cmd) === title);
58
+ if (!groupCommands.length)
59
+ continue;
60
+ lines.push(`### ${title}`);
61
+ lines.push('');
62
+ for (const cmd of groupCommands) {
63
+ const describe = (target) => {
64
+ const path = commandPath(target);
65
+ lines.push(`- \`botanary ${path}\` - ${target.description()}`);
66
+ const meta = COMMAND_HELP[path];
67
+ for (const example of meta?.examples ?? [])
68
+ lines.push(` ${example}`);
69
+ if (meta?.notes) {
70
+ for (const note of meta.notes.split('\n'))
71
+ lines.push(` note: ${note}`);
72
+ }
73
+ for (const sub of target.commands)
74
+ describe(sub);
75
+ };
76
+ describe(cmd);
77
+ }
78
+ lines.push('');
79
+ }
80
+ lines.push('## What still needs a human');
81
+ lines.push('');
82
+ lines.push('- `login`: the owner approves in a browser. The CLI prints the code and URL to stderr');
83
+ lines.push(' immediately (never silenced by `--json`); relay them to the human and wait.');
84
+ lines.push('- `send` without a covering mandate: the same, via an approval URL.');
85
+ lines.push('- Granting or widening a mandate: only ever in Botanary itself. `mandates suggest` proposes,');
86
+ lines.push(' it does not grant.');
87
+ lines.push('');
88
+ lines.push(`Docs: ${DOCS_URL}`);
89
+ lines.push('');
90
+ return lines.join('\n');
91
+ }
92
+ //# sourceMappingURL=prompt-doc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-doc.js","sourceRoot":"","sources":["../../src/prompt-doc.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAmB,MAAM,kBAAkB,CAAC;AAEnF;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,OAAgB,EAAE,UAAkB;IAC5D,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,CAAC,IAAI,CAAC,kBAAkB,UAAU,uCAAuC,CAAC,CAAC;IAChF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,+FAA+F,CAAC,CAAC;IAC5G,KAAK,CAAC,IAAI,CAAC,+FAA+F,CAAC,CAAC;IAC5G,KAAK,CAAC,IAAI,CAAC,8EAA8E,CAAC,CAAC;IAC3F,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,kCAAkC,CAAC,C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AC,EAAE,CAAC,CAAC;IACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { colors } from './colors.js';
2
+ import { columns, dash, section, shortAddress } from './kv.js';
3
+ const HEADERS = ['', 'ID', 'LABEL', 'ADDRESS'];
4
+ export function accountRows(list, activeId) {
5
+ const accounts = Array.isArray(list) ? list : [];
6
+ return accounts
7
+ .filter((account) => account !== null && typeof account === 'object')
8
+ .map((account) => [
9
+ account.id && account.id === activeId ? '*' : '',
10
+ dash(account.id),
11
+ dash(account.label ?? account.name),
12
+ shortAddress(account.address),
13
+ ]);
14
+ }
15
+ export function renderAccounts(list, activeId) {
16
+ const rows = accountRows(list, activeId);
17
+ if (!rows.length)
18
+ return `${section('Accounts')}\n${colors.muted(' No accounts on this login.')}`;
19
+ return `${section('Accounts')}\n${columns(HEADERS, rows)}\n${colors.dim(' * is the active account. Switch with `botanary accounts use <id>`.')}`;
20
+ }
21
+ //# sourceMappingURL=accounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../../src/render/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAS/D,MAAM,OAAO,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;AAE/C,MAAM,UAAU,WAAW,CAAC,IAAa,EAAE,QAAuB;IAChE,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,IAAqB,CAAC,CAAC,CAAC,EAAE,CAAC;IACnE,OAAO,QAAQ;SACZ,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC;SACpE,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;QAChB,OAAO,CAAC,EAAE,IAAI,OAAO,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;QAChD,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAChB,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;QACnC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC;KAC9B,CAAC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAa,EAAE,QAAuB;IACnE,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACzC,IAAI,CAAC,IAAI,CAAC,MAAM;QAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,MAAM,CAAC,KAAK,CAAC,8BAA8B,CAAC,EAAE,CAAC;IACnG,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,sEAAsE,CAAC,EAAE,CAAC;AACpJ,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { colors } from './colors.js';
2
+ import { amount, columns, dash, section, shortTime } from './kv.js';
3
+ const HEADERS = ['WHEN', 'WHAT', 'AMOUNT', 'CHAIN', 'STATUS'];
4
+ function statusCell(item) {
5
+ if (item.declineReason)
6
+ return colors.danger(`declined: ${item.declineReason}`);
7
+ if (item.status === 'executed')
8
+ return colors.success('executed');
9
+ if (item.status === 'pending')
10
+ return colors.warning('pending');
11
+ return dash(item.status);
12
+ }
13
+ export function activityRows(payload) {
14
+ const items = payload?.history?.items;
15
+ const list = Array.isArray(items) ? items : [];
16
+ return list
17
+ .filter((item) => item !== null && typeof item === 'object')
18
+ .map((item) => [
19
+ shortTime(item.timestamp),
20
+ dash(item.title),
21
+ item.amount?.value === undefined
22
+ ? '-'
23
+ : `${amount(item.amount.value)} ${dash(item.amount.token?.symbol)}`.trim(),
24
+ dash(item.chain),
25
+ statusCell(item),
26
+ ]);
27
+ }
28
+ export function renderActivity(payload) {
29
+ const rows = activityRows(payload);
30
+ if (!rows.length)
31
+ return `${section('Activity')}\n${colors.muted(' No activity yet.')}`;
32
+ return `${section('Activity')}\n${columns(HEADERS, rows)}`;
33
+ }
34
+ //# sourceMappingURL=activity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity.js","sourceRoot":"","sources":["../../../src/render/activity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAWpE,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAE9D,SAAS,UAAU,CAAC,IAAiB;IACnC,IAAI,IAAI,CAAC,aAAa;QAAE,OAAO,MAAM,CAAC,MAAM,CAAC,aAAa,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;IAChF,IAAI,IAAI,CAAC,MAAM,KAAK,UAAU;QAAE,OAAO,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAClE,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChE,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAAgB;IAC3C,MAAM,KAAK,GAAI,OAAyD,EAAE,OAAO,EAAE,KAAK,CAAC;IACzF,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,KAAuB,CAAC,CAAC,CAAC,EAAE,CAAC;IAClE,O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