supercolony 0.0.0-stage → 0.1.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 (63) hide show
  1. package/README.md +428 -3
  2. package/dist/cli.mjs +2 -0
  3. package/dist/commands/model.mjs +1 -0
  4. package/dist/commands/my-tasks.mjs +1 -0
  5. package/dist/commands/order.mjs +1 -0
  6. package/dist/commands/task.mjs +1 -0
  7. package/dist/commands/wallet.mjs +1 -0
  8. package/dist/lib/concurrent.mjs +1 -0
  9. package/dist/lib/funding-state.mjs +1 -0
  10. package/dist/lib/funding.mjs +1 -0
  11. package/dist/lib/local-wallet.mjs +1 -0
  12. package/dist/lib/my-tasks.mjs +1 -0
  13. package/dist/lib/network-workers.mjs +1 -0
  14. package/dist/lib/onchain-payment.mjs +1 -0
  15. package/dist/lib/orders.mjs +1 -0
  16. package/dist/lib/password.mjs +1 -0
  17. package/dist/lib/payment-coins.mjs +1 -0
  18. package/dist/lib/payment-networks.mjs +1 -0
  19. package/dist/lib/payments.mjs +1 -0
  20. package/dist/lib/publish.mjs +1 -0
  21. package/dist/lib/query-retry.mjs +1 -0
  22. package/dist/lib/support-recipient.mjs +1 -0
  23. package/dist/lib/support.mjs +1 -0
  24. package/dist/lib/swaps.mjs +1 -0
  25. package/dist/lib/task-input.mjs +1 -0
  26. package/dist/lib/task-result.mjs +1 -0
  27. package/dist/lib/terminal-text.mjs +1 -0
  28. package/dist/lib/transactions.mjs +1 -0
  29. package/dist/lib/wallet-balances.mjs +1 -0
  30. package/dist/lib/wallet-receive.mjs +1 -0
  31. package/dist/lib/wallet-status.mjs +1 -0
  32. package/dist/planner/flow.mjs +1 -0
  33. package/dist/planner/intent.mjs +1 -0
  34. package/dist/planner/local.mjs +1 -0
  35. package/dist/planner/model-download.mjs +1 -0
  36. package/dist/planner/progress.mjs +1 -0
  37. package/dist/program.mjs +1 -0
  38. package/dist/shared.mjs +1 -0
  39. package/dist/tui/app.mjs +1 -0
  40. package/dist/tui/controller.mjs +1 -0
  41. package/dist/tui/index.mjs +1 -0
  42. package/dist/tui/native.mjs +1 -0
  43. package/dist/tui/presentation.mjs +1 -0
  44. package/dist/tui/services.mjs +1 -0
  45. package/dist/tui/session.mjs +1 -0
  46. package/dist/worker/config.mjs +1 -0
  47. package/dist/worker/context.mjs +1 -0
  48. package/dist/worker/deploy.mjs +1 -0
  49. package/dist/worker/index.mjs +1 -0
  50. package/dist/worker/install.mjs +1 -0
  51. package/dist/worker/manage.mjs +1 -0
  52. package/dist/worker/pair.mjs +1 -0
  53. package/dist/worker/pairing.mjs +1 -0
  54. package/dist/worker/preflight.mjs +1 -0
  55. package/dist/worker/process.mjs +1 -0
  56. package/dist/worker/register.mjs +1 -0
  57. package/dist/worker/release.mjs +1 -0
  58. package/dist/worker/remote/config-patch.cjs +2 -0
  59. package/dist/worker/remote/config-summary.cjs +2 -0
  60. package/dist/worker/remote/install.cjs +2 -0
  61. package/dist/worker/service.mjs +1 -0
  62. package/dist/worker/ssh.mjs +1 -0
  63. package/package.json +49 -6
package/README.md CHANGED
@@ -1,3 +1,428 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # colony
2
+
3
+ Interactive payments offer two choices: **official fee + 10% optional support** (highlighted first), or **Original price**. The message is “Help us make Colony better.” Final payment confirmation still defaults to Cancel. For a 0.5 IMD task, the support option totals 0.55 IMD before network fees. The payment card shows the official fee and, for currency conversion, the actual price, maximum debit and network fee cap. Swap slippage is calculated automatically: 0.75%–5% on Ethereum and 0.75% on Robinhood. Authorization covers only the reviewed maximum; slippage is never increased after confirmation.
4
+
5
+ Support goes to the public address in `src/lib/support-recipient.mjs` on the selected payment network. The private key is never distributed with Colony. Support is a separate IMD transfer sent before task payment; it is not refunded if task admission fails. The review shows the support amount, total and recipient. Signed transfers are saved before broadcast and reused on recovery. Non-interactive commands and `--yes` use the original price without adding support.
6
+
7
+ 面向 IMD 使用者的 CLI:创建任务、查看自己的任务、获取结果并继续修改,也能直接部署和管理自己的 worker。
8
+
9
+ - Node.js **22+**,ESM JavaScript;开发使用 `src/`,npm 发布压缩并混淆后的 `dist/`。
10
+ - `supercolony` 和 `colony` 是等价命令,所有子命令和参数相同,避免与官方 worker 的 `imd` 冲突。
11
+ - 读取任务不需要钱包;发布任务支持 Ethereum 的 x402 签名付款及 Robinhood Chain 的链上报价付款。Wallet 页面支持创建和导入钱包,私钥以密码加密后保存在本机。
12
+ - worker 命令复用官方 `imd`,详见 [docs/plan.md](docs/plan.md) 和 [docs/research.md](docs/research.md)。
13
+
14
+ ## Quick start (English)
15
+
16
+ ### Interactive dashboard
17
+
18
+ After local installation, run `colony` with no arguments, or `colony ui`, to open the terminal workspace. From this repository, use `node src/cli.mjs`. The dashboard uses real task, order and worker data; no demo data is included.
19
+
20
+ ```sh
21
+ colony
22
+ colony ui
23
+ colony --ascii
24
+ ```
25
+
26
+ The dashboard has **My tasks**, **Explore**, **Workers** and **Wallets** at the top. Wide terminals show a list and details side by side; below 100 columns, Enter opens details and Esc returns to the list. Use an interactive terminal at least 40 columns by 20 rows. `--ascii` uses ordinary ASCII borders. Special fonts, WSL and a browser are not required.
27
+
28
+ | Key | Action |
29
+ | --- | --- |
30
+ | `1`–`4` | Switch workspace |
31
+ | `n` | Describe a task, then review its official fee |
32
+ | Up / Down in the task form | Switch payment coin |
33
+ | Up / Down, Enter, Esc | Select, open, return |
34
+ | `/`, `f`, `r` | Search, cycle My tasks filters, refresh |
35
+ | Tab, `[` / `]`, Page Up / Down | Focus list/details, switch detail tab, scroll |
36
+ | `d`, `s`, `c` | Fetch result files, save verified files, request project changes |
37
+ | `o` | Inspect/resume a saved local order |
38
+ | `x`, `m` in My tasks | Cancel an unsigned request; open available task actions |
39
+ | `a`, `m`, `l`, `g` in Workers | Add an SSH target, actions, logs, diagnostics |
40
+ | `n`, `i`, `m` in Wallets | Create wallet, import a private key or backup, selected wallet actions |
41
+ | `u`, `g` in Wallets | Use the selected wallet, manage all wallets |
42
+ | `d`, `b` in Wallets | Receive funds / QR code, back up encrypted wallet |
43
+ | `p` in Wallets | Choose Ethereum or Robinhood Chain for new payments |
44
+ | Down at the end of Explore, `l` | Automatically load older tasks; `l` also loads/retries manually |
45
+ | `e`, `?`, `q` | Full error, keyboard help, quit |
46
+
47
+ Form fields use Enter to advance/submit and Tab to switch fields. A new task asks only for your request, then uses the local planner and the existing IMD payment/order workflow. The payment card shows the official admission fee; confirmation defaults to **Cancel**. Currency conversion also shows the maximum debit and network fee cap. Tab selects the payment action, Enter confirms, and Esc returns to editing without signing. `--yes` never bypasses this dashboard confirmation. `i` reveals the payment network, asset, recipient and server-prepared input. Task admission does not guarantee completion. Wallet authorization transactions can incur separate gas fees.
48
+
49
+ Explore shows the server's actual task total and refreshes in the background every 30 seconds. New tasks appear at the top, changed states update in place, and the selected task, loaded history and detail scroll position are preserved. Refreshing pauses during forms, payment confirmation and worker operations. Read errors are visible and the next scheduled refresh retries. Reaching the end of the loaded list automatically appends older tasks. Loading, errors and the end of history are visible; search results show the loaded count until all matches have been fetched because the API does not provide a search total. `r` reloads the latest list and resets loaded history.
50
+
51
+ The selected active task refreshes every five seconds while its workspace is idle. Only real server states are shown; the UI does not invent progress percentages or completion times. Completed tasks expose delivery files and a paid continuation flow. My tasks keeps local orders that have not produced a job, including recoverable interrupted payments.
52
+
53
+ Select an unpaid request and press `x`, or `m` → **Cancel request**. Confirmation defaults to **Keep request**. Cancellation is local and prevents Colony from signing or resuming that request; no wallet or network is needed. The record remains visible as **Cancelled**, with a separate filter. Use `m` → **Delete local record** to remove it permanently. Signed payments and published jobs cannot be cancelled through IMD's public API, and their recovery records are retained. The footer only shows actions available for the selected item.
54
+
55
+ Worker deployment, pairing, registration, service installation and hidden credential prompts temporarily take over the terminal and return to the dashboard after Enter. They use the existing official-worker commands and their confirmations. SSH targets are read from the existing worker state; a new target is remembered for the current session and recorded by the existing deployment flow. Wallet supports creating or importing a password-encrypted local wallet.
56
+
57
+ Workers lists your **Mine** management targets first, followed by the public **Network** directory from IMD. Public workers are sorted by Available → Busy → Paused → Connection unconfirmed, then by free concurrency slots (descending), then device ID for stable ties. This is an availability order, not a quality ranking. Press `/` to search by worker ID, runtime or skill, and `r` to refresh while keeping the selected worker. Public entries show capacity, runtime/model, skills, platform and heartbeat; management actions apply only to your saved targets. If the public directory fails, its error remains visible and your management targets stay accessible.
58
+
59
+ Read queries automatically retry temporary network failures, rate limits and server errors, with at most **three total attempts**. API and Worker release queries default to 3 seconds between attempts; RPC queries use the SDK's 3-second then 6-second backoff. Queries honor the server's Retry-After when provided. Cancelling interrupts the wait when the caller supplies an abort signal. Missing resources and permission errors are reported immediately. Task validation is a read-only query; order creation, payment submissions and Worker mutations are not automatically repeated by this policy. Model/artifact downloads retain their separate download handling.
60
+
61
+ Ordinary commands and `--json` keep their existing behavior. When stdin/stdout are redirected, the bare `colony` command prints help; `colony ui` requires a TTY and rejects `--json`. Windows native ConPTY and Linux PTY validation are covered by `test/tui-pty.test.mjs`; macOS is in the platform CI matrix and still requires a real Mac run before claiming hardware acceptance.
62
+
63
+ ```sh
64
+ git clone <repository>
65
+ cd super_colony
66
+ npm install
67
+ node src/cli.mjs --help
68
+ node src/cli.mjs task create "Build a landing page for my bakery" --dry-run
69
+ ```
70
+
71
+ Natural-language planning uses Qwen3.5-0.8B Q4_K_M (about 533 MB) locally: CPU on Windows, Linux and Intel Macs, and Metal on Apple Silicon. Windows and Linux have passed actual model and CLI checks; macOS still needs execution on a Mac. See [validation details](docs/local-planner-validation.md).
72
+
73
+ Model downloads try Hugging Face first and automatically switch to [HF-Mirror](https://hf-mirror.com/) if the network request fails. Both sources use the same pinned model and SHA-256 verification. After setup, inference runs from the local cache.
74
+
75
+ First-time preparation shows **Local LLM** with separate download, verification and loading steps. The download bar shows percentage, transferred MB and speed; switching to the backup source resets the bar. TUI and ordinary terminal commands share this progress display. A verified cache skips downloading. Redirected output uses plain milestones on stderr, and `--json` keeps stdout as one JSON document. Technical model metadata remains available with `colony model status --json`.
76
+
77
+ ## 安装
78
+
79
+ 需要 Node.js 22+,Windows、Linux 和 macOS 使用相同安装命令。npm 包名为 `supercolony`:
80
+
81
+ ```sh
82
+ npm install -g supercolony
83
+ ```
84
+
85
+ 安装后 `supercolony` 和 `colony` 都能启动程序,以下示例使用 `colony`,均可替换为 `supercolony`。
86
+
87
+ 从源码或本地打包安装:
88
+
89
+ ```sh
90
+ npm install
91
+ npm pack
92
+ npm install --prefix /path/to/prefix ./supercolony-0.1.0.tgz
93
+ /path/to/prefix/node_modules/.bin/colony --help
94
+ ```
95
+
96
+ 也可以直接在仓库里运行:
97
+
98
+ ```sh
99
+ node src/cli.mjs --help
100
+ ```
101
+
102
+ 依赖会安装到项目本地。不要把钱包私钥写进 `.env`、脚本参数或仓库。
103
+
104
+ ### 发布到 npm
105
+
106
+ 在项目目录执行(CMD、PowerShell、Bash 都可):
107
+
108
+ ```sh
109
+ npm ci
110
+ npm run check:package
111
+ npm run test:dist
112
+ npm login --registry=https://registry.npmjs.org
113
+ npm publish
114
+ ```
115
+
116
+ `npm pack` 和 `npm publish` 都会自动构建并混淆。发布包只包含混淆后的 `dist/`、`package.json` 和 README;不包含 `src/`、测试、研发脚本、内部文档、模型权重或 source map。混淆在本地通过 [javascript-obfuscator](https://github.com/javascript-obfuscator/javascript-obfuscator) 完成,重命名内部标识符并提取字符串;保留模块接口和属性名,不启用控制流平坦化、死代码注入或反调试。固定种子使同一份源码和依赖生成相同产物。混淆只能提高阅读成本,不能彻底隐藏代码,也不能用于保护内置密钥。原生依赖由 npm 根据用户平台安装,模型首次使用时另行下载;混淆器仅是开发依赖。
117
+
118
+ 发布成功后,用户使用 `npm install -g supercolony` 安装,再运行 `supercolony` 或 `colony`。两个命令指向同一个程序入口,所有子命令和参数相同。后续发布前需要提高 `package.json` 的版本号;已发布的同名版本不能覆盖。
119
+
120
+ ## 全局参数
121
+
122
+ ```text
123
+ --api <url> IMD API,默认 COLONY_API_URL 或 https://api.imd.fun
124
+ --home <dir> 本地状态目录,默认 COLONY_HOME 或 ~/.super-colony
125
+ --rpc <url> 可选自定义 RPC,也可用 COLONY_RPC_URL;两条付款链已内置默认节点
126
+ --payment-chain <network> 可选单次指定 ethereum 或 robinhood;默认使用钱包中保存的选择
127
+ --pay-with <coin> 付款币种 IMD / ETH / USDT / USDC / USDG,默认 IMD
128
+ --key-env <name> 可选脚本用私钥环境变量;没有本地钱包时使用,默认 COLONY_PRIVATE_KEY
129
+ --json 只向 stdout 输出一份 JSON;提示/日志走 stderr
130
+ --yes 跳过交互确认(脚本用)
131
+ ```
132
+
133
+ 全局参数可以放在子命令前或后。成功退出码为 0;HTTP、确认、校验错误为非 0。
134
+
135
+ ## 浏览任务
136
+
137
+ ```sh
138
+ colony task list --limit 20
139
+ colony task list --q report --before 2026-10-17T10:00:00Z --exclude-oracle --json
140
+ colony task show <jobId>
141
+ colony task result <jobId>
142
+ ```
143
+
144
+ `task list` 直接透传服务端 `GET /jobs`,没有本地状态。服务端只支持 `q/before/limit/since/exclude=oracle`,没有 state/template/wallet 过滤;`count` 是页大小,不是总数。`task result` 会打印产物 hash 和公开下载 URL。
145
+
146
+ ### 等待完成与下载产物
147
+
148
+ ```sh
149
+ colony task wait <jobId> --timeout 600 --interval 5
150
+ colony task download <jobId> --out ./output
151
+ ```
152
+
153
+ `task wait` 默认每 5 秒查询一次,最多等待 600 秒;完成后输出结果。任务 blocked/cancelled 或等待超时退出码为非 0,Ctrl+C 停止等待。等待本身不改变服务端任务,也不创建订单。`--json` 的结果写入 stdout,查询进度写入 stderr。
154
+
155
+ `task download` 下载已完成任务的 `files`,保留产物的相对目录,逐文件校验字节数和 SHA-256 后保存。它不覆盖已有文件、不解压 source bundle;下载失败保留已经校验保存的文件并清理临时文件。输出目录应由这次下载独占,避免其他程序同时修改其目录结构。
156
+
157
+ ### 我的任务
158
+
159
+ ```sh
160
+ colony task mine # 合并本机记录和当前钱包的远端任务
161
+ colony task mine --address 0x... # 查看指定钱包,无需私钥
162
+ colony task mine --local # 只看本机记录,不联网
163
+ colony task mine --limit 10 --json
164
+ ```
165
+
166
+ 列表区分任务执行状态、订单状态和付款状态,保留尚未产生任务的本机订单。没有配置钱包时只显示本机记录,并说明数据来源。服务端 `GET /requests/paid-by/:address` 仅提供最近最多 100 条订单;完整恢复依赖 `--home` 下的订单文件。`order list/show/submit` 用于检查和恢复支付订单。
167
+
168
+ ## 创建任务
169
+
170
+ 直接用一句话描述需求即可,不需要选择 skill、template 或 preset:
171
+
172
+ ```sh
173
+ colony task create "Build a landing page for my bakery"
174
+ colony task create "比较三种 EVM 测试方案,给出来源" --dry-run
175
+ ```
176
+
177
+ 自然语言路径先用本机模型做一次有限结构化决策:模型只从 runnable route criteria 中选一个最终交付物(报告、网站、图片、音频、视频、新合约项目等),再由代码组装固定的输出路径和 IMD job body;模型不生成自由文本计划,也不决定付款、parent 或落地参数。默认模型为 Qwen3.5-0.8B **Q4_K_M**,约 533 MB,首次使用下载到 `$COLONY_HOME/models/`,之后在本地运行,不调用付费推理服务:Windows、Linux 和 Intel Mac 使用 CPU,Apple Silicon 使用 Metal。目标原文保持不变,计划完成后展示简要 summary 和 deliverables。
178
+
179
+ Windows 和 Linux 容器均已执行真实模型及 CLI 验证;macOS 已配置对应后端和 CI,尚未真机运行。实测范围和复现命令见 [本地模型验证记录](docs/local-planner-validation.md)。
180
+
181
+ 首次下载优先使用 Hugging Face,网络访问失败时自动切换 [HF-Mirror](https://hf-mirror.com/),无需用户设置镜像变量。两个下载源使用同一固定版本并校验文件大小及 SHA-256。已下载并校验通过的模型直接使用本地缓存。
182
+
183
+ `--dry-run` 只做免费检查,纯文本展示 summary、deliverables 和 check 阻塞原因;`--json` 模式才包含实际 input 和 check。dry-run 不创建订单、不需要钱包。正式发布和继续修改任务只获取官方报价,展示实际价格、最高扣款和网络费上限后确认付款。非交互付款仍需显式 `--yes`。`--save job.json` 可保存输入;保存不会覆盖已有文件。
184
+
185
+ 模型当前只输出一个 route choice,不生成自由文本计划或 parent,也不承诺预计完成时间。真实链上部署、发币或交易不会伪装成普通 `job.open`。`--answer` 会把补充信息加入决策上下文,并以 `Clarifications:` 块追加到原始 objective 之后;原始 objective 保持为完整前缀,worker 会收到这些补充信息。
186
+
187
+ 显式路径保持兼容,且不会加载本机模型:
188
+
189
+ ```sh
190
+ colony task create "比较三种 EVM 测试方案,给出来源" --preset report --dry-run
191
+ colony task create "比较三种 EVM 测试方案,给出来源" --preset report
192
+ colony task create --file examples/research-job.json
193
+ ```
194
+
195
+ 可以用 `--skill <id>` 或 `--template <name>` 明确选择执行方式;复杂任务仍可使用 JSON 文件。显式 `--file`、`--preset`、`--skill`、`--template` 不使用模型。报告预设使用 `research-report`,输出 `artifacts/report.md`,默认不发布到 GitHub;需要时加 `--github`。
196
+
197
+ 先检查,不产生订单、不付费:
198
+
199
+ ```sh
200
+ colony task check --file examples/research-job.json
201
+ ```
202
+
203
+ 发布:
204
+
205
+ ```sh
206
+ colony wallet create # 或 colony wallet import,私钥输入隐藏
207
+ colony task create --file examples/research-job.json
208
+ ```
209
+
210
+ 流程:
211
+
212
+ 1. `POST /requests/check`,有 blocker 立即停止;
213
+ 2. 生成并保存 `requestToken` 和 `requestKey`,再 `POST /requests/quote`;
214
+ 3. `POST /requests/:id/submit` 取得真实 402 challenge;
215
+ 4. 在 stderr 展示 network、金额、资产、收款方、有效期,以及**服务端 prepared input**;确认后才签名;
216
+ 5. 同一钱包签 Permit2 支付和 `QuoteApproval`;
217
+ 6. 先保存 payment header 与 quoteSignature,再提交;轮询到 `admitted`。
218
+
219
+ `--yes` 供脚本跳过确认。没有 `--yes` 且不是 TTY 时,命令会失败而不是静默付款。
220
+
221
+ 原来的 `task publish --file ...` 保留;与 `task create --file ...` 使用同一套支付和订单恢复流程,也接受 `--pay-with <coin>`。
222
+
223
+ ### 在已有任务上继续修改
224
+
225
+ ```sh
226
+ colony task continue <jobId> "补充性能对比和复现步骤" --dry-run
227
+ colony task continue <jobId> "补充性能对比和复现步骤"
228
+ colony task continue <jobId> --file changes.json
229
+ ```
230
+
231
+ 自然语言续作同样使用本机模型选择 `same` 或其他支持的路线,但 `parentJobId` 始终由代码绑定为真实 parent,模型不能修改;续作输入不会重新带 `repoUrl` 或 `baseCommit`。显式 `--file`、`--skill`、`--template` 路径不加载模型。指定 `--request-key` 恢复已保存订单时直接复用原输入,不重新生成。
232
+
233
+ 续作产生项目的下一版任务,使用 `job.continue`,也需要支付。指定的任务必须是项目最新版本,满足服务端续作条件;CLI 不会自动换成另一个版本。付费前检查原项目所有者与当前钱包是否一致。旧版本、运行中或尚未交付等问题会在检查阶段给出原因。
234
+
235
+ 金额、资产、收款方、网络只取自真实 quote/challenge;不会硬编码。Permit2 deadline 会被收紧到 quote 过期时间之前;quote 太接近过期时明确失败,不自动重新报价。
236
+
237
+ ### 恢复订单
238
+
239
+ 网络错误后不要重新签 payment,也不要新建订单:
240
+
241
+ ```sh
242
+ colony order list
243
+ colony order show <orderId 或 requestKey> # 只读本地
244
+ colony order show <orderId> --refresh # 显式查询服务端并更新本地
245
+ colony order submit <orderId>
246
+ colony order cancel <orderId 或 requestKey> # 取消未签名、未提交的本地请求
247
+ colony order delete <orderId 或 requestKey> # 永久删除已取消的未付款记录
248
+ ```
249
+
250
+ `order show` 默认只显示本地保存的状态,不联网;`--refresh` 才会用已保存的 requestToken 调 `GET /requests/:id`,并更新本地状态。恢复前可以先 `--refresh`,已经 admitted 的订单不会再提交。
251
+
252
+ `order cancel` 和 `order delete` 都默认要求确认,脚本可显式传 `--yes`。取消不调用服务端取消接口,也不承诺退款;它仅适用于从未签名、提交的本地请求。已签名或已发布的订单保留恢复信息,不能用本地删除冒充停止执行。取消标记与服务端状态分开保存,刷新服务端状态不会使请求重新变为可付款。
253
+
254
+ `order submit` 会重发保存的同一份 `PAYMENT-SIGNATURE` 和 `quoteSignature`。如果 quote 响应丢失(本地还没有 orderId),用错误提示中的同一 `requestKey` 重试:
255
+
256
+ ```sh
257
+ colony task publish --file examples/research-job.json --request-key <requestKey>
258
+ colony task create --request-key <requestKey>
259
+ colony task continue <jobId> --request-key <requestKey>
260
+ ```
261
+
262
+ `create` / `continue` 只传 `--request-key` 时会使用已保存的输入,不需要重新填写需求;指定其他输入时仍核对其与原订单是否一致。
263
+
264
+ 所有阶段错误都会给出已保存的 `requestKey`、`--home` 和 `--api` 恢复命令。只有**尚未签名**且明确 `quote_expired` 时才建议新订单;已经签过 payment 的 410 会先查询原订单状态,不会建议重新付款或新建订单。
265
+
266
+ 如果服务端 `status=admitted` 但 `admission.result.kind=refused`,命令以非 0 退出,明确报告“已付费但任务被拒”,输出/保存拒绝原因和付款交易,不把它当作发布成功。用 `colony order show <id> --refresh` 查看。
267
+
268
+ 订单文件在 `$COLONY_HOME/orders/`,权限 `0600`;包含 requestToken、payment header、签名,不应提交到 git 或贴到日志。
269
+
270
+ ## 钱包
271
+
272
+ 运行 `colony`,按 `4` 进入 Wallets。页面分为三个区块:左栏列出钱包并标记 Current,右上显示所选钱包的余额和操作,右下 Wallet management 管理所有钱包。`m` 打开所选钱包的操作;`g` 打开整体管理,`n` 新建、`i` 导入钱包(私钥或加密备份)、`p` 选择所有钱包共用的付款网络。上下键浏览不会切换付款钱包,按 `u` 设为当前钱包;Enter/Tab 切换列表与详情,窄屏 Esc 返回列表,整体管理区始终可见。新增或导入钱包后自动选中它,原钱包仍保留;切换选择会保存到本机,重启后继续使用。所有本地钱包共用首次设置的密码,解锁后新增钱包无需再设置密码。付款使用当前钱包;余额、收款和备份使用所选钱包,已付款任务按当前钱包地址查询。钱包页不再提供单独的授权操作;必要时使用 CLI 的 `wallet approve` 命令。
273
+
274
+ 私钥和密码均隐藏输入,不必配置环境变量。钱包采用标准 Ethereum V3 JSON Keystore:首个钱包保存在 `$COLONY_HOME/wallet.json`,其他钱包保存在 `$COLONY_HOME/wallets/<address>.json`;已有首个钱包无需移动或改写,其密码就是本地统一密码。`wallet-selection.json` 仅记录当前公开地址。界面不显示锁定状态,也无需手动解锁。只有付款、授权、新增或导入等需要使用密码的操作才会询问;本次运行中已输入的密码可复用,付款仍需确认金额。浏览、查余额、收款和加密备份不需要密码。退出仪表盘清除当前进程内的密码和签名账户缓存,密码不以明文保存在磁盘。
275
+
276
+ `d` 展示充值地址和二维码,`s` 可保存 SVG。请在发送方选择页面显示的 Ethereum 或 Robinhood Chain,并留一些 ETH 支付网络费。二维码只含公开地址、不包含私钥或密码,也不会替发送方自动选择网络。余额查询、充值和加密备份不需要解锁。终端太小时会提示扩大窗口或导出二维码,不显示被裁剪的二维码。
277
+
278
+ 首次充值前按 `b` 备份所选钱包,并单独保管本地统一密码。每个钱包需要分别备份。恢复需要备份文件和它原来的密码;恢复到已有钱包库时,使用本地统一密码重新加密。恢复到空目录时,备份密码成为本地密码。Colony 无法找回丢失的密码。创建、导入和恢复会添加钱包,不覆盖已有钱包;重复地址提示切换到已保存的钱包。备份和二维码导出也不会覆盖已有文件。
279
+
280
+ 查看私钥:选中本地钱包,按 `m` → `View private key`。每次查看必须重新输入密码,即使本次运行已输入过密码;验证通过后在独立页面显示所选钱包的私钥,不切换当前付款钱包。按 Esc 隐藏并返回,退出时也清除展示状态。
281
+
282
+ ```sh
283
+ colony wallet create
284
+ colony wallet import # 隐藏输入私钥,然后设置加密密码
285
+ colony wallet list # 列出本地钱包,* 表示当前钱包
286
+ colony wallet use <address> # 切换当前钱包
287
+ colony wallet receive
288
+ colony wallet receive --out colony-receive.svg
289
+ colony wallet backup --out colony-wallet-backup.json
290
+ colony wallet restore --file colony-wallet-backup.json # 添加并选中恢复的钱包
291
+ colony wallet address
292
+ colony wallet network # 查看当前付款网络
293
+ colony wallet network robinhood # 保存为 Robinhood Chain
294
+ colony wallet status
295
+ colony wallet approve --amount 0.5
296
+ colony task create "Build a website for my coffee shop"
297
+
298
+ colony wallet network ethereum # 切回 Ethereum
299
+ colony task create "Write a research report" --payment-chain robinhood
300
+ ```
301
+
302
+ - 本地钱包优先使用,私钥只以加密形式写盘,不上传。`--key-env` 仅保留给没有本地钱包的脚本用法,普通用户无需使用它。密码不接受命令行参数,也不写入订单、日志或终端交接消息。
303
+ - `wallet approve` 是显式链上交易,只授权指定数量;Ethereum 授权 Permit2,Robinhood 授权真实报价对应的 Intake,**不会默认无限授权**。
304
+ - CLI 可用 `wallet approve --amount 0.5 --wallet <address>` 明确指定预期地址。确认时显示该地址,签名前若当前钱包已经改变则停止。任务付款也绑定本次流程开始时的钱包,避免另一终端切换钱包后从不同账户付款。
305
+ - 支持 Ethereum 与 Robinhood Chain 两条正式付款链,公共 RPC 均已内置。普通用户无需设置 RPC;仪表盘按 `4` → `p` 选择网络,选择会保存在本机,供后续新任务使用。默认 Ethereum,不提供 Sepolia 测试币付款。
306
+ - Ethereum 沿用 x402 签名付款;Robinhood 使用同一份 HTTP 订单返回的签名报价,通过 Intake `pay` 结算。任务和续作仍进入同一个“我的任务”列表,恢复原订单时使用其原付款网络。
307
+ - 直接用 IMD 支付时,两条链都会检查余额和授权额度;额度不足会在付款确认后自动授权本次所需数量,无需另外运行命令。原价、可选支持和自动换币使用同一付款准备流程。确认卡显示实际网络、价格、最高扣款及 ETH 手续费上限。
308
+ - Robinhood 的签名交易及其哈希在广播前保存。中断后 `order submit` 先查原订单和交易;需要重发时只广播原字节,不创建新订单、不重新签付款。签过的记录不能本地取消或删除。
309
+ - `wallet status` 从 capabilities 读取资产/价格,查询所选网络的付款币种余额及 IMD 支付额度,并校验节点链 id。
310
+ - `--rpc` / `COLONY_RPC_URL` 仅用于显式覆盖默认节点。自定义节点失败或链 id 不符时直接报错;不自动切换到其他节点。付款只支持这两条主网;其他网络的 worker 链上操作需要显式提供 RPC。
311
+ - 开发/CI 不应执行真实 approve 或 register 交易。
312
+
313
+ ### 自动换币付款
314
+
315
+ Ethereum 支持 **IMD、ETH、USDT、USDC**;Robinhood Chain 支持 **IMD、ETH、USDG**。创建任务或继续修改时,用 `--pay-with` 选择币种;仪表盘创建表单用上/下方向键切换。
316
+
317
+ ```sh
318
+ colony task create "Build a website for my coffee shop" --pay-with USDC
319
+ colony task create "Write a research report" --payment-chain robinhood --pay-with USDG
320
+ colony task continue <jobId> "Add a contact form" --pay-with ETH
321
+ ```
322
+
323
+ 默认直接展示报价计算出的实际价格、最高扣款和网络费上限,确认后才执行换币。付款边界来自报价本身:ETH 最高扣款包含本轮授权、换币及链上付款的网络费上限,稳定币最高扣款限制该币扣款,另需 ETH 支付确认页列出的有上限网络费。
324
+
325
+ Colony 直接调用 [Uniswap v3](https://developers.uniswap.org/deployments) 合约,通过已配置的 RPC 获取报价,无需聚合器或兑换 API Key。程序比较少量候选路径的兑换额和预计网络费,自动选择其中总成本最低的方案。网络费比较采用保守的 Gas 上限,并按链上报价换算为付款币;稳定币付款的 Gas 仍另用 ETH 支付。已有授权、USDT 必要的授权重置和任务付款费用也计入比较。
326
+
327
+ 每次精确购买订单所需的 IMD,不兑换用户全部余额。确认页显示预计付款、最高扣款和网络费上限。Ethereum 自动滑点为「兑换 Gas 成本 ÷ 兑换报价金额 × 1.25」,范围 0.75%–5%;Robinhood 为 0.75%。算法参考 [Uniswap 历史自动滑点实现](https://github.com/Uniswap/interface/blob/682215a574d9b3164bc7ce0587f84de080edf8ed/src/hooks/useAutoSlippageTolerance.ts),适度放宽成交容忍度。两项成本都用付款币种计价,以精确输出的输入报价代表兑换金额;Gas 成本采用兑换 Gas 额度乘当前每 Gas 费用上限,不含授权、任务付款或支持费用,无需新增网络查询。这是成本比例的经验算法,不是价格预测或防夹保护。最高输入向上取整到付款币的最小单位,确认后不会自动扩大。没有额外的价格影响门槛。授权仅覆盖本次最高兑换金额,不设无限额度。兑换交易由 Colony 本地构造,固定本人收款地址、到账 IMD、最高输入金额和截止时间,ETH 余款在同一笔交易内退回。没有可用路径、超过最高输入或报价无法执行时停止,不自动加价。这里比较的是内置候选路径,网络费是估算,不保证全市场最低价。
328
+
329
+ 兑换、授权与任务付款是独立交易,不能整体回滚。若兑换完成但任务提交中断,IMD 留在本人钱包;多余 IMD 也保留在钱包。用 My tasks 的 `o` 或 `colony order submit <orderId>` 恢复同一订单。每笔已签交易在广播前保存,恢复只查询或重发原字节,不重复购买;`order show` 和 Activity 可查看兑换进度和交易哈希。已签过交易的恢复记录不能删除。服务限流、无有效路径或报价超过上限时会明确停止,不自动更换服务、提高最高输入或跨链兑换。
330
+
331
+ ## worker
332
+
333
+ worker 命令复用官方 `imd`,本机默认,远程只支持 Linux SSH。目标机前置:Node.js 22+、npm、git、curl;Claude Code 或 Codex 已安装并完成登录;合约工作还需要 Foundry v1.8.3;钱包已持有 IMD NFT。`deploy` 只安装并校验官方 release,不配对、不启动;`service install` 要求已经配对、注册并有可用 runtime。
334
+
335
+ 远程 Linux 的完整顺序:
336
+
337
+ ```sh
338
+ # 1. 安装官方 worker release(校验 SHA-256,写入 colony 管理的 prefix)
339
+ colony worker deploy --ssh user@host
340
+
341
+ # 2. 在 Wallet 导入 NFT owner 钱包;私钥只在本地解密签名,不传到 worker
342
+ colony wallet import
343
+ colony worker pair --ssh user@host --token-id 42
344
+
345
+ # 3. 显式链上注册 ERC-8004 agent(需要 RPC 和 gas)
346
+ colony --rpc https://... worker register --ssh user@host --token-id 42 --yes
347
+
348
+ # 4. 安装并启动后台服务;远程 Linux 用 --boot 保持 SSH 退出/重启后运行
349
+ colony worker service install --ssh user@host --boot --auto-update --runtime claude --concurrency 2
350
+
351
+ # 5. 运维
352
+ colony worker status --ssh user@host
353
+ colony worker logs --ssh user@host --follow
354
+ colony worker doctor --ssh user@host
355
+ ```
356
+
357
+ 本机 Windows 去掉 `--ssh`,并且不要使用 `--boot`;Windows 服务随登录启动,机器需要保持登录和唤醒。Windows 上官方 runtime sandbox 不能对读取做 jail,完整任务能力应使用 Linux/WSL/VPS。
358
+
359
+ 其它命令:
360
+
361
+ ```sh
362
+ colony worker run [--runtime claude|codex] # 前台 imd start,Ctrl+C 停止
363
+ colony worker start|stop|restart # 官方 imd service 命令
364
+ colony worker service install|start|stop|restart|status|logs|uninstall
365
+ colony worker update [--version <tag>] # 同一 prefix 重新校验安装
366
+ ```
367
+
368
+ ### 身份、技能、工具与 RPC
369
+
370
+ 这些都是日常 worker 管理命令,同样支持本机和 `--ssh user@host`:
371
+
372
+ ```sh
373
+ colony worker whoami
374
+ colony worker skills list
375
+ colony worker skills add <skillId>
376
+ colony worker skills remove <skillId>
377
+ colony worker tools list
378
+ colony worker tools add # 交互添加工具
379
+ colony worker tools key <name> # 隐藏输入凭证
380
+ colony worker tools forget <name>
381
+ colony worker tools remove <toolId>
382
+ colony worker rpc list
383
+ colony worker rpc add <chainId> # 隐藏输入 RPC URL
384
+ colony worker rpc remove <chainId>
385
+ colony worker unlink # 解除官方 worker 配对
386
+ ```
387
+
388
+ `tools add <toolId>` 也支持官方 `--command`、重复的 `--arg` / `--env` / `--probe` / `--enable` 参数,详见 `colony worker tools add --help`。`--env` 指定环境变量名,凭证通过 `tools key` 输入。
389
+
390
+ 需要隐藏输入的命令要求交互终端,不接受 `--json`;SSH 会为这些命令分配终端。非交互命令的 `--json` 包含官方输出和退出码。`worker rpc` 管理 worker 使用的链端点;全局 `--rpc` 用于钱包授权和注册交易。
391
+
392
+ 远程目标还支持 `--identity <path>`、`--port <port>`、`--worker-home <dir>`、`--prefix <dir>`。`worker status` 返回官方 service 原始输出加控制面 standing;`logs --follow` 是原始流,`--json` 不适用。
393
+
394
+ `deploy`/`service install` 分开是刻意的:deploy 不启动;没有配对、注册和已登录 runtime 时,service install 会明确失败。`--auto-update` 是官方 worker 对其**当前 cli 安装目录**做原地更新,不会切换 colony 的 prefix;使用自定义 `--prefix` 时,更新仍留在该 prefix。
395
+
396
+ ### Linux 容器验证
397
+
398
+ 仓库提供独立 Docker Compose 测试环境,不挂载宿主钱包、runtime 登录信息或 Docker socket,也不开放端口:
399
+
400
+ ```sh
401
+ docker compose -f container/compose.yml up -d --build
402
+ docker exec colony-worker-test colony worker deploy --json
403
+ docker exec colony-worker-test colony worker doctor --json
404
+ docker compose -f container/compose.yml stop
405
+ ```
406
+
407
+ 该测试容器默认保持空闲,供 `docker exec` 执行 CLI;它不会自动接单。容器中的安装与状态保存在专用 volume,停止容器后保留。普通容器没有 systemd,官方 `worker service` 和真实接单还需要单独验证;容器重启不能证明 worker 后台服务已运行。完整验收步骤与实际结果见 [docs/container-validation.md](docs/container-validation.md)。
408
+
409
+ ## 测试
410
+
411
+ ```sh
412
+ npm test
413
+ ```
414
+
415
+ `npm test` 只运行 `test/*.test.mjs`,覆盖主 CLI 与 worker 模块。测试使用本地 HTTP mock/process stub,不发送真实 quote、支付、配对、部署或链上交易。
416
+
417
+ ## 限制
418
+
419
+ - 发布只走 x402;没有链上 Intake 备用路径。
420
+ - 读取端点受公共限流影响,遇到 429 请按 `Retry-After` 退避。
421
+ - 服务端 `/jobs` 无状态过滤,`paid-by` 最多 100 条。
422
+ - 官方 `imd` 没有 JSON 输出;worker 状态需要控制面 API 或 OS 命令补齐。
423
+ - `wallet approve`/`register` 是真实交易命令,本仓库的自动化测试不执行它们。
424
+
425
+ ## 相关文档
426
+
427
+ - [docs/plan.md](docs/plan.md):设计、模块边界、状态机与验收
428
+ - [docs/research.md](docs/research.md):端点、签名与 worker 事实来源
package/dist/cli.mjs ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ function _0x3aba(_0x1e220d,_0x43632f){_0x1e220d=_0x1e220d-0x1eb;var _0x3abae6=_0x4363();var _0x322b01=_0x3abae6[_0x1e220d];return _0x322b01;}var _0x1ce2ef=_0x3aba;import{registerWorkerCommands as _0x5ad082}from'./worker/index.mjs';import{run as _0x4b3371}from'./program.mjs';await _0x4b3371(process[_0x1ce2ef(0x1ec)][_0x1ce2ef(0x1eb)](0x2),{'registerWorkerCommands':_0x5ad082});function _0x4363(){var _0xbd3a24=['slice','argv'];_0x4363=function(){return _0xbd3a24;};return _0x4363();}
@@ -0,0 +1 @@
1
+ function _0x4e33(_0x1dcc76,_0x30d318){_0x1dcc76=_0x1dcc76-0x78;const _0x4e330c=_0x30d3();let _0x13179a=_0x4e330c[_0x1dcc76];return _0x13179a;}import{print as _0x6c1a06}from'../shared.mjs';import{ensureLocalModel as _0x43dc80,modelInfo as _0x176427}from'../planner/local.mjs';function d(_0x24c3de){const _0x3299a1=_0x4e33;return[_0x3299a1(0x80),_0x3299a1(0x8e)+(_0x24c3de[_0x3299a1(0x81)]===_0x3299a1(0x85)?_0x3299a1(0x8f):_0x24c3de['status']===_0x3299a1(0x7d)?_0x3299a1(0x7b):_0x3299a1(0x82)),_0x3299a1(0x8c)+(_0x24c3de[_0x3299a1(0x8a)]/0xf4240)[_0x3299a1(0x84)](0x1)+_0x3299a1(0x90),_0x24c3de[_0x3299a1(0x81)]===_0x3299a1(0x85)?_0x3299a1(0x88):'Run\x20colony\x20model\x20setup\x20to\x20prepare\x20it.'][_0x3299a1(0x89)]('\x0a');}function p(_0x4bae95){const _0x12187e=_0x4e33,_0x322560=_0x4bae95['command'](_0x12187e(0x8d))[_0x12187e(0x7e)](_0x12187e(0x7c));_0x322560[_0x12187e(0x83)](_0x12187e(0x79))[_0x12187e(0x7e)](_0x12187e(0x87))[_0x12187e(0x78)](async(_0x3b70bb,_0x425664)=>{const _0x12607f=_0x12187e,_0x332a98=_0x425664[_0x12607f(0x86)](),_0x4bba32=await _0x43dc80({'home':_0x332a98[_0x12607f(0x8b)]});_0x6c1a06(_0x332a98['json']?_0x4bba32:d(_0x4bba32),_0x332a98);}),_0x322560[_0x12187e(0x83)](_0x12187e(0x81))[_0x12187e(0x7e)](_0x12187e(0x7f))[_0x12187e(0x78)](async(_0x549daa,_0x4f5249)=>{const _0x546c79=_0x12187e,_0x161260=_0x4f5249[_0x546c79(0x86)](),_0x57e797=await _0x176427({'home':_0x161260[_0x546c79(0x8b)]});_0x6c1a06(_0x161260[_0x546c79(0x7a)]?_0x57e797:d(_0x57e797),_0x161260);});}function _0x30d3(){const _0x6daf=['action','setup','json','Not\x20downloaded','manage\x20the\x20local\x20LLM','missing','description','show\x20local\x20LLM\x20cache\x20status','Local\x20LLM','status','Needs\x20download','command','toFixed','ready','optsWithGlobals','download\x20and\x20verify\x20the\x20local\x20LLM','Saved\x20on\x20this\x20computer\x20for\x20future\x20tasks.','join','size','home','Download\x20size:\x20','model','Status:\x20','Ready','\x20MB'];_0x30d3=function(){return _0x6daf;};return _0x30d3();}export{p as registerModelCommands};
@@ -0,0 +1 @@
1
+ import{print as _0x1ab298}from'../shared.mjs';function _0x49b2(){const _0x364465=['action','mine','function','local','option','address','--local','--limit\x20<n>','optsWithGlobals','json','maximum\x20items\x20to\x20show\x20(1-100)','registerMyTaskCommands\x20requires\x20the\x20task\x20command','home','public\x20payer\x20address\x20to\x20read\x20from\x20GET\x20/requests/paid-by','--address\x20<address>'];_0x49b2=function(){return _0x364465;};return _0x49b2();}import{collectMyTasks as _0x37802a,formatMyTasksText as _0x4dd929}from'../lib/my-tasks.mjs';function l(_0x13dc1e){const _0x4e535a=_0x1ef3;if(!_0x13dc1e||typeof _0x13dc1e['command']!=_0x4e535a(0xba))throw new Error(_0x4e535a(0xc3));_0x13dc1e['command'](_0x4e535a(0xb9))['description']('unify\x20local\x20orders\x20and\x20wallet\x20paid-by\x20tasks')['option'](_0x4e535a(0xc6),_0x4e535a(0xc5))[_0x4e535a(0xbc)](_0x4e535a(0xbe),'read\x20local\x20orders\x20only;\x20do\x20not\x20use\x20the\x20wallet\x20or\x20network',!0x1)[_0x4e535a(0xbc)](_0x4e535a(0xbf),_0x4e535a(0xc2),'20')[_0x4e535a(0xb8)](async(_0x3e47a5,_0x34b5a4)=>{const _0x5b3417=_0x4e535a,_0xe330e4=_0x34b5a4[_0x5b3417(0xc0)](),_0x24eb8d=await _0x37802a({'api':_0xe330e4['api'],'home':_0xe330e4[_0x5b3417(0xc4)],'address':_0xe330e4[_0x5b3417(0xbd)],'local':!!_0xe330e4[_0x5b3417(0xbb)],'limit':_0xe330e4['limit'],'keyEnv':_0xe330e4['keyEnv']});_0x1ab298(_0xe330e4[_0x5b3417(0xc1)]?_0x24eb8d:_0x4dd929(_0x24eb8d),_0xe330e4);});}function _0x1ef3(_0x2a12a5,_0x49b2f0){_0x2a12a5=_0x2a12a5-0xb8;const _0x1ef3af=_0x49b2();let _0x1f6a41=_0x1ef3af[_0x2a12a5];return _0x1f6a41;}export{l as registerMyTaskCommands};
@@ -0,0 +1 @@
1
+ import{writeDiagnostic as _0x2bdc02}from'../lib/terminal-text.mjs';import{confirmAction as _0x574ddd,print as _0x41288f}from'../shared.mjs';function _0x281d(){const _0x3d45a6=['canCancel','job:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Local\x20record\x20deleted.','jobId','\x0aThis\x20removes\x20its\x20saved\x20details\x20permanently.','cancel\x20an\x20unsigned,\x20unsubmitted\x20request\x20locally;\x20no\x20wallet\x20or\x20network\x20needed','order\x20ended\x20with\x20status:\x20','amount','refresh','input','tx:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','submit\x20<id>','refusalProblems','unknown','server:\x20\x20\x20\x20\x20\x20','status\x20URL:\x20\x20','This\x20request\x20cannot\x20be\x20cancelled\x20locally.\x20Only\x20unsigned,\x20unsubmitted\x20requests\x20can\x20be\x20cancelled.','funding','hash','length','home','stringify','delete\x20the\x20local\x20record\x20of\x20a\x20cancelled\x20unsigned\x20request','created:\x20\x20\x20\x20\x20','payWith','job:\x20\x20\x20\x20','action:\x20\x20\x20\x20\x20\x20','result:\x20','createdAt','orderId','option','\x0aNo\x20payment\x20will\x20be\x20signed\x20or\x20submitted\x20by\x20this\x20request.','transactionHash','status:\x20\x20\x20\x20\x20\x20','tx:\x20\x20\x20\x20\x20','order:\x20\x20','conversion:\x20\x20','list\x20locally\x20saved\x20orders','read\x20GET\x20/requests/:id\x20with\x20the\x20saved\x20token\x20and\x20update\x20local\x20state','padEnd','Cancel\x20this\x20unsigned\x20request\x20first.\x20Signed\x20payment\x20recovery\x20records\x20cannot\x20be\x20deleted.','asset:\x20\x20\x20\x20\x20\x20\x20','show\x20local\x20order\x20state;\x20--refresh\x20also\x20reads\x20the\x20server','description','\x20--refresh','exitCode','\x20(locally;\x20no\x20payment\x20signed\x20or\x20submitted)','cancelledAt','resubmit\x20the\x20saved\x20payment\x20bytes\x20and\x20poll\x20the\x20order','command','kind','\x20was\x20admitted,\x20but\x20IMD\x20refused\x20the\x20job.','pay\x20to:\x20\x20\x20\x20\x20\x20','join','payTo','order\x20','action','optsWithGlobals','api','push','pay\x20with:\x20\x20\x20\x20','requestKey','inspect:\x20colony\x20order\x20show\x20','\x20\x20-\x20','objective','maximumDebit','order','network:\x20\x20\x20\x20\x20','Cancel\x20this\x20unpaid\x20request?\x0a','cancelled:\x20\x20\x20','lastError','Delete\x20this\x20cancelled\x20request\x20from\x20local\x20history?\x0a','statusUrl',';\x20inspect\x20it\x20with\x20colony\x20order\x20show\x20','delete\x20<id>','Request\x20cancelled\x20locally.\x20No\x20payment\x20was\x20signed\x20or\x20submitted.','canDelete','paymentStatus','max\x20debit:\x20\x20\x20','--refresh','detail','\x20tx\x20','order:\x20\x20\x20\x20\x20\x20\x20','resultUrl','updatedAt','not\x20started','admitted','json','payment:\x20','refused','code','status'];_0x281d=function(){return _0x3d45a6;};return _0x281d();}import{cancelOrder as _0x14b8cf,deleteOrder as _0x5a27ba,findOrder as _0x939340,listOrders as _0x2fa632,orderActions as _0x535f82,orderSummary as _0x161c5f}from'../lib/orders.mjs';import{refreshOrder as _0x4bd306,submitOrder as _0x279b02}from'../lib/publish.mjs';function w(_0x23a9ac){const _0x941254=_0x5800;if(_0x23a9ac[_0x941254(0x107)]===0x0)return'no\x20orders';const _0x2d72a7=['ORDER\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20STATUS\x20\x20\x20\x20\x20\x20\x20JOB\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ACTION'];for(const _0x12463b of _0x23a9ac)_0x2d72a7[_0x941254(0x12f)](String(_0x12463b[_0x941254(0x111)]??_0x12463b[_0x941254(0x131)])[_0x941254(0x11b)](0x24)+'\x20\x20'+String(_0x161c5f(_0x12463b)[_0x941254(0x14f)])[_0x941254(0x11b)](0xa)+'\x20\x20'+String(_0x12463b['jobId']??'')[_0x941254(0x11b)](0x24)+'\x20\x20'+_0x12463b['action']);return _0x2d72a7[_0x941254(0x129)]('\x0a');}function g(_0x48eeb9){const _0xa68975=_0x5800,_0x4fddec=_0x161c5f(_0x48eeb9),_0x46f294=['request\x20key:\x20'+_0x4fddec[_0xa68975(0x131)],_0xa68975(0x146)+(_0x4fddec[_0xa68975(0x111)]??''),_0xa68975(0x115)+_0x4fddec[_0xa68975(0x14f)],_0xa68975(0x102)+(_0x4fddec['remoteStatus']??''),_0xa68975(0x10e)+_0x4fddec['action'],_0xa68975(0x137)+_0x4fddec['paymentChain'],_0xa68975(0x130)+_0x4fddec[_0xa68975(0x10c)],_0xa68975(0x10b)+_0x4fddec[_0xa68975(0x110)],'updated:\x20\x20\x20\x20\x20'+_0x4fddec[_0xa68975(0x148)],'amount:\x20\x20\x20\x20\x20\x20'+(_0x4fddec[_0xa68975(0xfb)]??''),_0xa68975(0x11d)+(_0x4fddec['asset']??''),_0xa68975(0x128)+(_0x4fddec[_0xa68975(0x12a)]??''),'quote\x20ends:\x20\x20'+(_0x4fddec['quoteExpiresAt']?new Date(Number(_0x4fddec['quoteExpiresAt'])*0x3e8)['toISOString']():''),'signed:\x20\x20\x20\x20\x20\x20'+_0x4fddec['paymentSigned'],'payment:\x20\x20\x20\x20\x20'+(_0x4fddec[_0xa68975(0x141)]??''),_0xa68975(0xfe)+(_0x4fddec[_0xa68975(0x114)]??''),_0xa68975(0xf5)+(_0x4fddec[_0xa68975(0xf7)]??''),_0xa68975(0x103)+(_0x4fddec[_0xa68975(0x13c)]??''),'result\x20URL:\x20\x20'+(_0x4fddec['resultUrl']??'')];if(_0x4fddec[_0xa68975(0x13a)]&&_0x46f294['push']('last\x20error:\x20\x20'+_0x4fddec[_0xa68975(0x13a)]),_0x4fddec[_0xa68975(0x105)]){_0x46f294[_0xa68975(0x12f)](_0xa68975(0x118)+_0x4fddec[_0xa68975(0x105)]['amount'],_0xa68975(0x142)+_0x4fddec[_0xa68975(0x105)][_0xa68975(0x135)]);for(const _0xe96e3c of _0x4fddec[_0xa68975(0x105)]['steps'])_0x46f294[_0xa68975(0x12f)]('\x20\x20'+_0xe96e3c[_0xa68975(0x126)]+':\x20'+(_0xe96e3c[_0xa68975(0x14f)]??_0xa68975(0x149))+(_0xe96e3c[_0xa68975(0x106)]?'\x20'+_0xe96e3c[_0xa68975(0x106)]:''));}return _0x4fddec[_0xa68975(0x123)]&&_0x46f294[_0xa68975(0x12f)](_0xa68975(0x139)+_0x4fddec['cancelledAt']+_0xa68975(0x122)),_0x46f294[_0xa68975(0x129)]('\x0a');}function j(_0x473644){const _0x54ae17=_0x5800,_0x27220c=['status:\x20'+_0x473644[_0x54ae17(0x14f)],_0x54ae17(0x117)+_0x473644[_0x54ae17(0x111)]];return _0x473644[_0x54ae17(0xf7)]&&_0x27220c['push'](_0x54ae17(0x10d)+_0x473644[_0x54ae17(0xf7)]),_0x473644['statusUrl']&&_0x27220c[_0x54ae17(0x12f)]('status:\x20'+_0x473644[_0x54ae17(0x13c)]),_0x473644[_0x54ae17(0x147)]&&_0x27220c[_0x54ae17(0x12f)](_0x54ae17(0x10f)+_0x473644[_0x54ae17(0x147)]),_0x473644[_0x54ae17(0x114)]&&_0x27220c[_0x54ae17(0x12f)](_0x54ae17(0x116)+_0x473644[_0x54ae17(0x114)]),_0x27220c[_0x54ae17(0x129)]('\x0a');}function q(_0x2285b3){const _0x24171c=_0x5800,_0x108a99=[_0x24171c(0x12b)+_0x2285b3[_0x24171c(0x111)]+_0x24171c(0x127),_0x24171c(0x14c)+(_0x2285b3['paymentStatus']??_0x24171c(0x101))+(_0x2285b3[_0x24171c(0x114)]?_0x24171c(0x145)+_0x2285b3['transactionHash']:'')];for(const _0x314033 of _0x2285b3[_0x24171c(0x100)]??[])_0x108a99['push'](_0x24171c(0x133)+(_0x314033[_0x24171c(0x14e)]??_0x24171c(0x14d))+':\x20'+(_0x314033[_0x24171c(0x144)]??JSON[_0x24171c(0x109)](_0x314033)));return _0x108a99[_0x24171c(0x12f)](_0x24171c(0x132)+_0x2285b3[_0x24171c(0x111)]+_0x24171c(0x120)),_0x108a99[_0x24171c(0x129)]('\x0a')+'\x0a';}function _0x5800(_0x113a16,_0x281d4c){_0x113a16=_0x113a16-0xf4;const _0x580041=_0x281d();let _0x5b042f=_0x580041[_0x113a16];return _0x5b042f;}function O(_0xc2aef1){const _0x3afd7a=_0x5800,_0x3ece36=_0xc2aef1[_0x3afd7a(0x125)](_0x3afd7a(0x136))['description']('inspect,\x20recover\x20and\x20cancel\x20saved\x20orders');_0x3ece36[_0x3afd7a(0x125)]('list')[_0x3afd7a(0x11f)](_0x3afd7a(0x119))[_0x3afd7a(0x12c)](async(_0x43db22,_0x2aa564)=>{const _0x17088a=_0x3afd7a,_0x35faf6=_0x2aa564['optsWithGlobals'](),_0x4ce50a=await _0x2fa632(_0x35faf6[_0x17088a(0x108)]);_0x41288f(_0x35faf6[_0x17088a(0x14b)]?_0x4ce50a['map'](_0x161c5f):w(_0x4ce50a),_0x35faf6);}),_0x3ece36['command']('show\x20<id>')[_0x3afd7a(0x11f)](_0x3afd7a(0x11e))[_0x3afd7a(0x112)](_0x3afd7a(0x143),_0x3afd7a(0x11a))[_0x3afd7a(0x12c)](async(_0x5525f3,_0x2ce889,_0x610074)=>{const _0x2fd337=_0x3afd7a,_0x500471=_0x610074[_0x2fd337(0x12d)](),_0x475f4a=_0x500471[_0x2fd337(0xfc)]?await _0x4bd306({'home':_0x500471[_0x2fd337(0x108)],'id':_0x5525f3}):await _0x939340(_0x500471[_0x2fd337(0x108)],_0x5525f3);_0x41288f(_0x500471['json']?_0x161c5f(_0x475f4a):g(_0x475f4a),_0x500471);}),_0x3ece36[_0x3afd7a(0x125)]('cancel\x20<id>')[_0x3afd7a(0x11f)](_0x3afd7a(0xf9))[_0x3afd7a(0x12c)](async(_0xc426f,_0x599639,_0x5cb94b)=>{const _0x1dcd0c=_0x3afd7a,_0x8d5da6=_0x5cb94b[_0x1dcd0c(0x12d)](),_0x411a2c=await _0x939340(_0x8d5da6[_0x1dcd0c(0x108)],_0xc426f);if(!_0x535f82(_0x411a2c)[_0x1dcd0c(0xf4)])throw new Error(_0x1dcd0c(0x104));await _0x574ddd(_0x1dcd0c(0x138)+_0x411a2c['input']['objective']+_0x1dcd0c(0x113),_0x8d5da6);const _0x165cfe=await _0x14b8cf(_0x8d5da6['home'],_0xc426f);_0x41288f(_0x8d5da6[_0x1dcd0c(0x14b)]?_0x161c5f(_0x165cfe):_0x1dcd0c(0x13f),_0x8d5da6);}),_0x3ece36[_0x3afd7a(0x125)](_0x3afd7a(0x13e))[_0x3afd7a(0x11f)](_0x3afd7a(0x10a))[_0x3afd7a(0x12c)](async(_0x57c923,_0x48a5f8,_0x3df9a2)=>{const _0x329088=_0x3afd7a,_0x449664=_0x3df9a2[_0x329088(0x12d)](),_0x3f172e=await _0x939340(_0x449664[_0x329088(0x108)],_0x57c923);if(!_0x535f82(_0x3f172e)[_0x329088(0x140)])throw new Error(_0x329088(0x11c));await _0x574ddd(_0x329088(0x13b)+_0x3f172e[_0x329088(0xfd)][_0x329088(0x134)]+_0x329088(0xf8),_0x449664);const _0xfb7c80=await _0x5a27ba(_0x449664[_0x329088(0x108)],_0x57c923);_0x41288f(_0x449664[_0x329088(0x14b)]?{'deleted':!0x0,'requestKey':_0xfb7c80[_0x329088(0x131)],'orderId':_0xfb7c80['orderId']??null}:_0x329088(0xf6),_0x449664);}),_0x3ece36[_0x3afd7a(0x125)](_0x3afd7a(0xff))[_0x3afd7a(0x11f)](_0x3afd7a(0x124))[_0x3afd7a(0x12c)](async(_0x42ac4b,_0x1e5ac9,_0x4f87ac)=>{const _0x5c5e2c=_0x3afd7a,_0x35afc0=_0x4f87ac[_0x5c5e2c(0x12d)](),_0xee74af=await _0x279b02({..._0x35afc0,'api':_0x35afc0[_0x5c5e2c(0x12e)],'home':_0x35afc0['home'],'id':_0x42ac4b});if(_0xee74af[_0x5c5e2c(0x14f)]===_0x5c5e2c(0x14d)){_0x35afc0[_0x5c5e2c(0x14b)]?_0x41288f({..._0x161c5f(_0xee74af),'status':_0x5c5e2c(0x14d)},_0x35afc0):_0x2bdc02(q(_0xee74af)),process[_0x5c5e2c(0x121)]=0x1;return;}if(_0xee74af[_0x5c5e2c(0x14f)]!==_0x5c5e2c(0x14a))throw new Error(_0x5c5e2c(0xfa)+_0xee74af[_0x5c5e2c(0x14f)]+_0x5c5e2c(0x13d)+_0xee74af[_0x5c5e2c(0x111)]+_0x5c5e2c(0x120));_0x41288f(_0x35afc0[_0x5c5e2c(0x14b)]?_0x161c5f(_0xee74af):j(_0xee74af),_0x35afc0);});}export{O as registerOrderCommands};
@@ -0,0 +1 @@
1
+ function _0x4e8c(){const _0xd6a314=['s)\x0a','padEnd','destination\x20directory','stringify','\x20\x20\x20\x20url:\x20\x20','count','option','check:\x20\x20\x20\x20\x20','job\x20response\x20is\x20missing\x20id','resultUrl','poll\x20a\x20job\x20result\x20until\x20it\x20completes,\x20fails\x20or\x20times\x20out','action:\x20\x20\x20\x20','order:\x20\x20\x20\x20\x20','\x0aquestions:\x0a','\x20complete=','launch','continue\x20the\x20project\x20of\x20a\x20job\x20you\x20paid\x20for','title','repository\x20path\x20the\x20job\x20may\x20write\x20(repeatable)','job.open','objective\x20or\x20job\x20id\x20prefix','detail','map','jobs\x20that\x20moved\x20after\x20this\x20time','continue\x20<id>\x20[objective]','validate\x20a\x20job\x20body\x20without\x20creating\x20an\x20order','project','trim','template','page\x20size\x20(1-500)','type','\x20attempt=','hash','questions','complete:\x20\x20','orderId','wait:\x20','admitted','blockers','\x20has\x20no\x20saved\x20input','--request-key\x20<uuid>','createdAt','--skill\x20<id>','api','stdin','payment:\x20','toFixed','inspect:\x20colony\x20order\x20show\x20','action\x20to\x20check\x20(defaults\x20from\x20parentJobId)','create\x20a\x20job\x20from\x20a\x20clear\x20objective\x20or\x20a\x20JSON\x20file','url','creation-time\x20cursor\x20(exclusive)','\x20versions=','named\x20input\x20preset\x20(report)','\x20was\x20created\x20for\x20action\x20','transactionHash','state','wait:\x20interrupted\x0a','<none>','\x20tx\x20','jobs','retries','interval','--preset\x20<name>','requestKey','unknown',';\x20retrying\x20in\x20','exitCode','workflow:\x20\x20','length','reviews','\x20job(s)','download:\x20','interrupted','bytes','deliverables','home','rpc','description','summary','job.continue','out','json','job\x20body\x20JSON\x20file','status','payWith','paymentStatus','\x20->\x20','complete\x20continuation\x20body\x20JSON\x20file','push','submissionHash','elapsedMs','challenge','tx:\x20\x20\x20\x20\x20\x20\x20\x20','order\x20','replace','refusalProblems','repo','delayMs','base\x20commit\x20for\x20--repo','plan','check:\x20','data','--before\x20<time>','\x20--refresh','--action\x20<action>','statusUrl','exclude\x20oracle\x20panel\x20jobs','public\x20GitHub\x20repository\x20URL','template:\x20\x20','source','\x20belongs\x20to\x20','files','colony\x20--api\x20','delivery','--file\x20<path>','answer\x20a\x20business\x20clarification\x20(repeatable)','workflow','state:\x20\x20\x20\x20\x20','parent','project:\x20\x20\x20','/jobs/','\x20--home\x20','ethereum','head','--path\x20<path>','refused','wait\x20<id>','save','download\x20<id>','quote','blocked',';\x20inspect\x20it\x20with\x20colony\x20order\x20show\x20','IMD','\x20head=','--exclude-oracle','parentJobId','string','timeout','limit','outcome','resultUrl:\x20','--timeout\x20<seconds>','input:',',\x20not\x20','excludeOracle','reuse\x20a\x20saved\x20order\x20request\x20key','--out\x20<dir>','job:\x20\x20\x20\x20\x20\x20\x20','optsWithGlobals','path','attempt','isArray','--since\x20<time>','statusUrl:\x20','message','action','\x20\x20\x20\x20hash:\x20','--answer\x20<text>','complete\x20job\x20body\x20JSON\x20file','versions','keyEnv','payTo','answer','saved','github','complete','completed','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20500','exclude','requiredOption','--dry-run','prepared\x20input:','s\x20(retry\x20','nodes','result\x20<id>','input','updatedAt','\x20bytes)','set','expiresAt','\x20\x20-\x20none','updated:\x20\x20\x20','poll','object','\x20was\x20created\x20for\x20a\x20different\x20objective;\x20omit\x20the\x20new\x20objective\x20to\x20resume\x20it','order\x20ended\x20with\x20status:\x20','saved\x20input:\x20','\x20\x20-\x20','paidBy','objective','plan:\x20','isTTY','jobs\x20response\x20is\x20missing\x20jobs','source:\x20\x20\x20\x20','before','dryRun','download\x20a\x20completed\x20job\x27s\x20files\x20under\x20--out','list','preset','yes','save\x20the\x20input\x20JSON\x20without\x20overwriting','runnable\x20skill\x20id','code','commit','browse\x20and\x20publish\x20IMD\x20tasks','oracle','\x20belongs\x20to\x20parent\x20job\x20','key','slice','delivery:\x20\x20','total\x20timeout\x20in\x20seconds','result','since','verdict','jobId','paid\x20by:\x20\x20\x20','objective:\x20','none','--commit\x20<sha>','only\x20run\x20the\x20free\x20check\x20and\x20print\x20the\x20input','paymentChain','file','toString','--save\x20<path>','parent:\x20\x20\x20\x20','\x0anot\x20paid:\x20blockers\x20must\x20be\x20resolved\x20first\x0a','--repo\x20<url>','command','check','blockers:\x20','skill','HTTP\x20','created:\x20\x20\x20','nodes:\x20\x20\x20\x20\x20','deliverables:','project\x20ready','join','launch:\x20\x20\x20\x20','result\x20response\x20is\x20missing\x20jobId','request\x20key\x20','check,\x20quote,\x20sign\x20and\x20submit\x20a\x20job\x20file'];_0x4e8c=function(){return _0xd6a314;};return _0x4e8c();}import{writeDiagnostic as _0x5b5425}from'../lib/terminal-text.mjs';import{request as _0x441870,print as _0xeb68e2}from'../shared.mjs';import{checkJob as _0x2e2f7e,publishJob as _0x15f3b4,readJobFile as _0x580a8f}from'../lib/publish.mjs';import{loadOrder as _0x1b8dc6}from'../lib/orders.mjs';import{buildContinueInput as _0x484cea,buildCreateInput as _0x627aec,parentSummary as _0x289c69,resolveAction as _0x534e8e,saveInputFile as _0x5695ff}from'../lib/task-input.mjs';import{DEFAULT_INTERVAL_SECONDS as _0x15770c,DEFAULT_TIMEOUT_SECONDS as _0x4ccd1a,downloadTaskFiles as _0x2f0a1e,waitForResult as _0x437e0d}from'../lib/task-result.mjs';import{askQuestions as _0x1eecd5,loadLocalPlanner as _0x3b31e8,planTask as _0x4a7831}from'../planner/flow.mjs';import{registerMyTaskCommands as _0x2fb2a0}from'./my-tasks.mjs';import{orderPayment as _0x4212c4}from'../lib/payments.mjs';function z(_0x18eeac){const _0x390792=_0x3f96,_0x3c9035=new URLSearchParams();if(_0x18eeac['q']!==void 0x0&&_0x3c9035[_0x390792(0x192)]('q',_0x18eeac['q']),_0x18eeac[_0x390792(0x1a2)]!==void 0x0&&_0x3c9035[_0x390792(0x192)](_0x390792(0x1a2),_0x18eeac[_0x390792(0x1a2)]),_0x18eeac[_0x390792(0x1b4)]!==void 0x0&&_0x3c9035[_0x390792(0x192)](_0x390792(0x1b4),_0x18eeac['since']),_0x18eeac[_0x390792(0x16a)]!==void 0x0){const _0x535424=Number(_0x18eeac[_0x390792(0x16a)]);if(!Number['isInteger'](_0x535424)||_0x535424<0x1||_0x535424>0x1f4)throw new Error(_0x390792(0x187));_0x3c9035['set']('limit',String(_0x535424));}_0x18eeac[_0x390792(0x170)]&&_0x3c9035[_0x390792(0x192)](_0x390792(0x188),_0x390792(0x1ad));const _0x3e53b0=_0x3c9035[_0x390792(0x1be)]();return _0x3e53b0?'/jobs?'+_0x3e53b0:'/jobs';}function y(_0x375490,_0x32be77=0x5a){const _0x9496dc=_0x3f96,_0x235ba9=String(_0x375490??'')[_0x9496dc(0x13e)](/\s+/g,'\x20')[_0x9496dc(0xfa)]();return _0x235ba9['length']>_0x32be77?_0x235ba9[_0x9496dc(0x1b0)](0x0,_0x32be77-0x1)+'…':_0x235ba9;}function V(_0x284ee1){const _0x2329a8=_0x3f96;if(!Array['isArray'](_0x284ee1?.[_0x2329a8(0x11b)]))throw new Error(_0x2329a8(0x1a0));const _0x639bf4=[_0x284ee1[_0x2329a8(0xe4)]+_0x2329a8(0x126)];for(const _0x5d2e1b of _0x284ee1[_0x2329a8(0x11b)])_0x639bf4['push'](_0x5d2e1b['id']+'\x20\x20'+_0x5d2e1b['state'][_0x2329a8(0xe0)](0xa)+'\x20\x20'+String(_0x5d2e1b[_0x2329a8(0xfb)]??'')[_0x2329a8(0xe0)](0x16)+'\x20\x20'+(_0x5d2e1b['updatedAt']??'')+'\x20\x20'+y(_0x5d2e1b[_0x2329a8(0x19d)]));return _0x639bf4[_0x2329a8(0x1cc)]('\x0a');}function Y(_0x391e5e){const _0x2bc6b6=_0x3f96;if(!_0x391e5e?.['id'])throw new Error(_0x2bc6b6(0xe7));const _0x5678b4=[_0x2bc6b6(0x173)+_0x391e5e['id'],_0x2bc6b6(0x155)+_0x391e5e['state'],_0x2bc6b6(0x14c)+(_0x391e5e[_0x2bc6b6(0xfb)]??''),_0x2bc6b6(0x1b8)+y(_0x391e5e['objective'],0x1f4),_0x2bc6b6(0x1c8)+(_0x391e5e[_0x2bc6b6(0x108)]??''),_0x2bc6b6(0x195)+(_0x391e5e[_0x2bc6b6(0x190)]??''),'paid\x20by:\x20\x20\x20'+(_0x391e5e[_0x2bc6b6(0x19c)]??''),_0x2bc6b6(0x157)+(_0x391e5e[_0x2bc6b6(0xf9)]?_0x391e5e['project']['id']+'\x20('+(_0x391e5e[_0x2bc6b6(0xf9)][_0x2bc6b6(0x17f)]?.[_0x2bc6b6(0x124)]??0x0)+'\x20version(s))':_0x2bc6b6(0x1b9)),_0x2bc6b6(0x1b1)+(_0x391e5e[_0x2bc6b6(0x151)]?JSON[_0x2bc6b6(0xe2)](_0x391e5e[_0x2bc6b6(0x151)]):_0x2bc6b6(0x1b9)),'launch:\x20\x20\x20\x20'+(_0x391e5e[_0x2bc6b6(0xee)]?JSON['stringify'](_0x391e5e[_0x2bc6b6(0xee)]):_0x2bc6b6(0x1b9))];if(Array[_0x2bc6b6(0x177)](_0x391e5e[_0x2bc6b6(0x18d)])){_0x5678b4[_0x2bc6b6(0x138)](_0x2bc6b6(0x1c9)+_0x391e5e['nodes'][_0x2bc6b6(0x124)]);for(const _0x2d266f of _0x391e5e[_0x2bc6b6(0x18d)])_0x5678b4[_0x2bc6b6(0x138)]('\x20\x20-\x20'+_0x2d266f[_0x2bc6b6(0x1af)]+':\x20'+_0x2d266f['state']+_0x2bc6b6(0xfe)+_0x2d266f[_0x2bc6b6(0x176)]+'\x20verdict='+(_0x2d266f[_0x2bc6b6(0x1b5)]?.[_0x2bc6b6(0x133)]??_0x2bc6b6(0x1b9)));}return Array[_0x2bc6b6(0x177)](_0x391e5e[_0x2bc6b6(0x125)])&&_0x5678b4['push']('reviews:\x20\x20\x20'+_0x391e5e[_0x2bc6b6(0x125)][_0x2bc6b6(0x124)]),_0x391e5e[_0x2bc6b6(0x154)]?.['id']&&_0x5678b4['push']((_0x2bc6b6(0x123)+_0x391e5e[_0x2bc6b6(0x154)]['id']+'\x20'+(_0x391e5e[_0x2bc6b6(0x154)]['status']??''))[_0x2bc6b6(0xfa)]()),_0x5678b4[_0x2bc6b6(0x1cc)]('\x0a');}function C(_0x316ae4){const _0x4b9754=_0x3f96;if(!_0x316ae4?.[_0x4b9754(0x1b6)])throw new Error(_0x4b9754(0x1ce));const _0xfedc2a=['job:\x20\x20\x20\x20\x20\x20\x20'+_0x316ae4['jobId'],'state:\x20\x20\x20\x20\x20'+_0x316ae4[_0x4b9754(0x117)],_0x4b9754(0x101)+_0x316ae4[_0x4b9754(0x185)]],_0x2d38ab=Array['isArray'](_0x316ae4[_0x4b9754(0x14f)])?_0x316ae4[_0x4b9754(0x14f)]:[];_0xfedc2a[_0x4b9754(0x138)]('files:\x20\x20\x20\x20\x20'+_0x2d38ab[_0x4b9754(0x124)]);for(const _0x282d0d of _0x2d38ab)_0xfedc2a['push']('\x20\x20-\x20'+_0x282d0d[_0x4b9754(0x175)]+'\x20('+_0x282d0d[_0x4b9754(0x129)]+'\x20bytes,\x20'+_0x282d0d['mediaType']+')'),_0xfedc2a['push']('\x20\x20\x20\x20hash:\x20'+_0x282d0d[_0x4b9754(0xff)]),_0xfedc2a[_0x4b9754(0x138)](_0x4b9754(0xe3)+_0x282d0d[_0x4b9754(0x111)]);const _0x15799d=Array[_0x4b9754(0x177)](_0x316ae4[_0x4b9754(0x14d)])?_0x316ae4[_0x4b9754(0x14d)]:[];_0xfedc2a[_0x4b9754(0x138)](_0x4b9754(0x1a1)+_0x15799d[_0x4b9754(0x124)]);for(const _0x5991ba of _0x15799d)_0xfedc2a[_0x4b9754(0x138)]('\x20\x20-\x20'+(_0x5991ba['node']??_0x5991ba[_0x4b9754(0x139)])+':\x20'+_0x5991ba['url']);return _0x316ae4[_0x4b9754(0x151)]&&_0xfedc2a[_0x4b9754(0x138)]('delivery:\x20\x20'+JSON['stringify'](_0x316ae4['delivery'])),_0x316ae4[_0x4b9754(0xee)]&&_0xfedc2a[_0x4b9754(0x138)](_0x4b9754(0x1cd)+JSON[_0x4b9754(0xe2)](_0x316ae4[_0x4b9754(0xee)])),_0xfedc2a['join']('\x0a');}function X(_0x445858){const _0x5e4cfe=_0x3f96,_0x4c5845=['job:\x20\x20\x20\x20\x20\x20\x20'+_0x445858['jobId'],_0x5e4cfe(0x155)+_0x445858[_0x5e4cfe(0x117)],'files:\x20\x20\x20\x20\x20'+_0x445858[_0x5e4cfe(0x14f)][_0x5e4cfe(0x124)]];for(const _0x2e59ee of _0x445858[_0x5e4cfe(0x14f)])_0x4c5845['push']('\x20\x20-\x20'+_0x2e59ee['path']+_0x5e4cfe(0x136)+_0x2e59ee[_0x5e4cfe(0x1bd)]+'\x20('+_0x2e59ee[_0x5e4cfe(0x129)]+_0x5e4cfe(0x191)),_0x4c5845[_0x5e4cfe(0x138)](_0x5e4cfe(0x17c)+_0x2e59ee[_0x5e4cfe(0xff)]);return _0x4c5845[_0x5e4cfe(0x1cc)]('\x0a');}function v(_0x485fbf){const _0x3c5c7e=_0x3f96,_0x51c835=[_0x3c5c7e(0x1c5)+_0x485fbf[_0x3c5c7e(0x105)][_0x3c5c7e(0x124)]];for(const _0xb0f0e of _0x485fbf[_0x3c5c7e(0x105)])_0x51c835['push']('\x20\x20-\x20'+_0xb0f0e[_0x3c5c7e(0x1aa)]+':\x20'+_0xb0f0e['detail']);const _0x2cc3fd=Array[_0x3c5c7e(0x177)](_0x485fbf['plan'])?_0x485fbf[_0x3c5c7e(0x143)]:[];_0x51c835['push'](_0x3c5c7e(0x19e)+_0x2cc3fd['length']);for(const _0x2ff093 of _0x2cc3fd)_0x51c835[_0x3c5c7e(0x138)](_0x3c5c7e(0x19b)+(_0x2ff093[_0x3c5c7e(0xf0)]??_0x2ff093['short']??_0x2ff093[_0x3c5c7e(0x1c6)])+(_0x2ff093['skill']?'\x20('+_0x2ff093[_0x3c5c7e(0x1c6)]+')':''));return _0x51c835[_0x3c5c7e(0x1cc)]('\x0a');}function E(_0x3e875f){const _0x14d9d3=_0x3f96,_0x39f030=_0x3e875f[_0x14d9d3(0x161)]?_0x4212c4(_0x3e875f):null;return{'status':_0x3e875f[_0x14d9d3(0x133)],'action':_0x3e875f[_0x14d9d3(0x17b)],'requestKey':_0x3e875f[_0x14d9d3(0x11f)],'orderId':_0x3e875f['orderId'],'jobId':_0x3e875f[_0x14d9d3(0x1b6)]??null,'statusUrl':_0x3e875f[_0x14d9d3(0x149)]??null,'resultUrl':_0x3e875f[_0x14d9d3(0xe8)]??null,'transactionHash':_0x3e875f['transactionHash']??null,'problems':_0x3e875f[_0x14d9d3(0x13f)]??null,'parentJobId':_0x3e875f[_0x14d9d3(0x18f)]?.[_0x14d9d3(0x167)]??null,'parent':_0x3e875f[_0x14d9d3(0x156)]??null,'project':_0x3e875f[_0x14d9d3(0x1c4)]?.[_0x14d9d3(0xf9)]??null,'payer':_0x3e875f['payer']??null,'paymentChain':_0x3e875f[_0x14d9d3(0x1bc)]??_0x14d9d3(0x15a),'payWith':_0x3e875f[_0x14d9d3(0x134)]??_0x14d9d3(0x164),'prepared':_0x3e875f['challenge']?.['input']??null,'quote':_0x3e875f[_0x14d9d3(0x161)]?{'amount':_0x39f030['amount'],'asset':_0x39f030['asset'],'payTo':_0x39f030[_0x14d9d3(0x181)],'expiresAt':_0x3e875f[_0x14d9d3(0x161)][_0x14d9d3(0x193)]}:null};}function _0x3f96(_0x2fd783,_0x4e8c36){_0x2fd783=_0x2fd783-0xdf;const _0x3f9662=_0x4e8c();let _0x21a942=_0x3f9662[_0x2fd783];return _0x21a942;}function Z(_0xac10e5){const _0x51c021=_0x3f96,_0x3e4142=['status:\x20\x20\x20\x20'+_0xac10e5[_0x51c021(0x133)],'action:\x20\x20\x20\x20'+_0xac10e5[_0x51c021(0x17b)],_0x51c021(0xeb)+_0xac10e5[_0x51c021(0x102)],'job:\x20\x20\x20\x20\x20\x20\x20'+(_0xac10e5[_0x51c021(0x1b6)]??'')];if(_0xac10e5[_0x51c021(0x149)]&&_0x3e4142['push'](_0x51c021(0x179)+_0xac10e5[_0x51c021(0x149)]),_0xac10e5[_0x51c021(0xe8)]&&_0x3e4142[_0x51c021(0x138)](_0x51c021(0x16c)+_0xac10e5[_0x51c021(0xe8)]),_0xac10e5[_0x51c021(0x116)]&&_0x3e4142[_0x51c021(0x138)](_0x51c021(0x13c)+_0xac10e5[_0x51c021(0x116)]),_0xac10e5[_0x51c021(0x156)]&&(_0x3e4142['push'](_0x51c021(0x1c0)+_0xac10e5[_0x51c021(0x156)]['id']+'\x20('+(_0xac10e5[_0x51c021(0x156)][_0x51c021(0x117)]??_0x51c021(0x120))+')'),_0xac10e5[_0x51c021(0x156)]['project']&&_0x3e4142[_0x51c021(0x138)](_0x51c021(0x157)+_0xac10e5[_0x51c021(0x156)][_0x51c021(0xf9)]['id']+_0x51c021(0x165)+(_0xac10e5[_0x51c021(0x156)][_0x51c021(0xf9)][_0x51c021(0x15b)]??''))),_0xac10e5['check']?.[_0x51c021(0xf9)]){const _0x30cea9=_0xac10e5['check']['project'];_0x3e4142[_0x51c021(0x138)](_0x51c021(0xe6)+(_0x30cea9['summary']??_0x30cea9['id']??_0x51c021(0x1cb)));}return!_0xac10e5[_0x51c021(0x143)]&&_0xac10e5[_0x51c021(0x17b)]===_0x51c021(0x12f)&&_0xac10e5['challenge']?.['input']&&(_0x3e4142[_0x51c021(0x138)](_0x51c021(0x18b)),_0x3e4142[_0x51c021(0x138)](JSON[_0x51c021(0xe2)](_0xac10e5[_0x51c021(0x13b)][_0x51c021(0x18f)],null,0x2))),_0x3e4142[_0x51c021(0x1cc)]('\x0a');}function q(_0x570f70,_0x3e9e61){const _0xff169f=_0x3f96;if(_0x570f70[_0xff169f(0x133)]===_0xff169f(0x162)){_0x3e9e61[_0xff169f(0x131)]?_0xeb68e2({'status':_0xff169f(0x162),'action':_0x570f70['state']['action'],'requestKey':_0x570f70[_0xff169f(0x117)][_0xff169f(0x11f)],'parent':_0x570f70[_0xff169f(0x117)]['parent']??null,'check':_0x570f70['check']},_0x3e9e61):(_0x570f70['state'][_0xff169f(0x156)]&&_0x5b5425(S(_0x570f70['state'][_0xff169f(0x156)])+'\x0a'),_0x5b5425(v(_0x570f70[_0xff169f(0x1c4)])+_0xff169f(0x1c1))),process[_0xff169f(0x122)]=0x1;return;}if(_0x570f70[_0xff169f(0x133)]===_0xff169f(0x15d)){const _0x54cdd7=E(_0x570f70[_0xff169f(0x117)]);if(_0x3e9e61[_0xff169f(0x131)])_0xeb68e2({..._0x54cdd7,'status':'refused'},_0x3e9e61);else{const _0x598185=[_0xff169f(0x13d)+_0x570f70[_0xff169f(0x117)]['orderId']+'\x20was\x20admitted,\x20but\x20IMD\x20refused\x20the\x20job.',_0xff169f(0x10c)+(_0x570f70['state'][_0xff169f(0x135)]??'unknown')+(_0x570f70[_0xff169f(0x117)]['transactionHash']?_0xff169f(0x11a)+_0x570f70[_0xff169f(0x117)][_0xff169f(0x116)]:'')];for(const _0x17bf31 of _0x570f70[_0xff169f(0x117)][_0xff169f(0x13f)]??[])_0x598185[_0xff169f(0x138)](_0xff169f(0x19b)+(_0x17bf31['code']??'refused')+':\x20'+(_0x17bf31[_0xff169f(0xf4)]??JSON[_0xff169f(0xe2)](_0x17bf31)));_0x598185[_0xff169f(0x138)](_0xff169f(0x10e)+_0x570f70[_0xff169f(0x117)][_0xff169f(0x102)]+'\x20--refresh'),_0x5b5425(_0x598185['join']('\x0a')+'\x0a');}process[_0xff169f(0x122)]=0x1;return;}if(_0x570f70['status']!==_0xff169f(0x104))throw new Error(_0xff169f(0x199)+_0x570f70[_0xff169f(0x133)]+_0xff169f(0x163)+_0x570f70[_0xff169f(0x117)][_0xff169f(0x102)]+_0xff169f(0x147));_0xeb68e2(_0x3e9e61['json']?E(_0x570f70[_0xff169f(0x117)]):Z(_0x570f70['state']),_0x3e9e61);}function S(_0x126085){const _0x22a133=_0x3f96,_0x157e81=_0x289c69(_0x126085),_0xfe4c3=[_0x22a133(0x1c0)+_0x157e81['id'],'state:\x20\x20\x20\x20\x20'+(_0x157e81['state']??''),_0x22a133(0x14c)+(_0x157e81[_0x22a133(0xfb)]??''),_0x22a133(0x1b8)+y(_0x157e81[_0x22a133(0x19d)],0x1f4),_0x22a133(0x1b7)+(_0x157e81[_0x22a133(0x19c)]??'')];return _0x157e81[_0x22a133(0xf9)]&&_0xfe4c3['push']('project:\x20\x20\x20'+_0x157e81['project']['id']+_0x22a133(0x165)+(_0x157e81[_0x22a133(0xf9)]['head']??'')+_0x22a133(0x113)+_0x157e81[_0x22a133(0xf9)][_0x22a133(0x17f)][_0x22a133(0x124)]),_0xfe4c3[_0x22a133(0x1cc)]('\x0a');}function ee(_0x1d503d){const _0xab6ea9=_0x3f96;return _0x1d503d?_0x1d503d[_0xab6ea9(0x12e)]?'project:\x20\x20\x20'+y(_0x1d503d['summary'],0x1f4):_0x1d503d['id']?'project:\x20\x20\x20'+_0x1d503d['id']:null:null;}function A(_0x53522a,_0x157d6a,_0x5dd10f,_0x32f379){const _0xbc3aba=_0x3f96,_0x1fce33=[];_0x32f379&&_0x1fce33[_0xbc3aba(0x138)](S(_0x32f379)),_0x1fce33['push'](_0xbc3aba(0xea)+_0x53522a),_0x1fce33[_0xbc3aba(0x138)](_0xbc3aba(0x16e)),_0x1fce33['push'](JSON['stringify'](_0x157d6a,null,0x2)),_0x1fce33[_0xbc3aba(0x138)](v(_0x5dd10f));const _0x75a446=ee(_0x5dd10f[_0xbc3aba(0xf9)]);return _0x75a446&&_0x1fce33[_0xbc3aba(0x138)](_0x75a446),_0x1fce33[_0xbc3aba(0x1cc)]('\x0a');}function T(_0x255dde){const _0x2bbeb8=_0x3f96;return _0x255dde[_0x2bbeb8(0x1bd)]!==void 0x0||_0x255dde[_0x2bbeb8(0x1a6)]!==void 0x0||_0x255dde[_0x2bbeb8(0x1c6)]!==void 0x0||_0x255dde[_0x2bbeb8(0xfb)]!==void 0x0||Array[_0x2bbeb8(0x177)](_0x255dde[_0x2bbeb8(0x175)])&&_0x255dde[_0x2bbeb8(0x175)][_0x2bbeb8(0x124)]>0x0;}function J(_0x5024bf){const _0x13d59f=_0x3f96;return _0x5024bf[_0x13d59f(0x1bd)]!==void 0x0||_0x5024bf[_0x13d59f(0x1c6)]!==void 0x0||_0x5024bf[_0x13d59f(0xfb)]!==void 0x0||Array['isArray'](_0x5024bf[_0x13d59f(0x175)])&&_0x5024bf[_0x13d59f(0x175)][_0x13d59f(0x124)]>0x0;}function te(_0x30993e,_0x2fc497){const _0x5bc351=_0x3f96;return typeof _0x30993e==_0x5bc351(0x168)&&_0x30993e[_0x5bc351(0xfa)]()!==''&&!T(_0x2fc497);}function ne(_0x204b31,_0x52a8a4){const _0x2852d2=_0x3f96;return typeof _0x204b31=='string'&&_0x204b31[_0x2852d2(0xfa)]()!==''&&!J(_0x52a8a4);}function b(_0x48ad45){const _0x1e88ed=_0x3f96,_0x1913e4=['summary:\x20'+_0x48ad45['summary'],_0x1e88ed(0x1ca)];_0x48ad45['deliverables'][_0x1e88ed(0x124)]===0x0&&_0x1913e4[_0x1e88ed(0x138)](_0x1e88ed(0x194));for(const _0x548566 of _0x48ad45[_0x1e88ed(0x12a)])_0x1913e4[_0x1e88ed(0x138)]('\x20\x20-\x20'+_0x548566);return _0x1913e4[_0x1e88ed(0x1cc)]('\x0a');}function O(_0x292d31,_0x24b56d){const _0x12221f=_0x3f96,_0x4b65d2=[b(_0x292d31),_0x12221f(0x144)+_0x24b56d[_0x12221f(0x105)][_0x12221f(0x124)]+'\x20blocker(s)'];for(const _0x10f72a of _0x24b56d['blockers'])_0x4b65d2[_0x12221f(0x138)](_0x12221f(0x19b)+_0x10f72a[_0x12221f(0x1aa)]+':\x20'+_0x10f72a[_0x12221f(0xf4)]);return _0x4b65d2[_0x12221f(0x1cc)]('\x0a');}function K(_0x9fe5f2,_0x178ec9,_0x95b406){const _0x121bd5=_0x3f96;if(_0x95b406[_0x121bd5(0x131)])_0xeb68e2({'action':_0x178ec9,'summary':_0x9fe5f2[_0x121bd5(0x12e)],'deliverables':_0x9fe5f2['deliverables'],'questions':_0x9fe5f2[_0x121bd5(0x100)],'input':null},_0x95b406);else{const _0x21f947=_0x9fe5f2['questions'][_0x121bd5(0xf5)](_0x1fc822=>_0x121bd5(0x19b)+_0x1fc822)['join']('\x0a');_0xeb68e2(b(_0x9fe5f2)+_0x121bd5(0xec)+_0x21f947,_0x95b406);}process['exitCode']=0x1;}function oe(_0x54b700){const _0x327a5=_0x3f96;return _0x54b700[_0x327a5(0x140)]===void 0x0&&_0x54b700['commit']===void 0x0?null:{'repoUrl':_0x54b700[_0x327a5(0x140)],'baseCommit':_0x54b700[_0x327a5(0x1ab)]};}async function N({api:_0x7724a0,home:_0x50fb86,objective:_0x2ffa90,answers:_0x120a4b,parent:_0x109108=null,source:_0x585fef=null,github:_0x3045d0=!0x1,opts:_0x219337,loadPlanner:_0x2f3546}){const _0x2d3ff4=_0x3f96;return _0x4a7831({'api':_0x7724a0,'home':_0x50fb86,'loadPlanner':_0x2f3546,'objective':_0x2ffa90,'answers':_0x120a4b,'parent':_0x109108,'source':_0x585fef,'github':_0x3045d0,'ask':!_0x219337[_0x2d3ff4(0x131)]&&process[_0x2d3ff4(0x10b)][_0x2d3ff4(0x19f)]?_0x1eecd5:null});}function U(_0x2e2d19,_0x1e8bb6,{api:_0xf88f2d,action:_0x29a7b4}){const _0x3318f1=_0x3f96;if(!_0x2e2d19)throw new Error('unknown\x20request\x20key:\x20'+_0x1e8bb6);if(_0x2e2d19[_0x3318f1(0x10a)]!==_0xf88f2d)throw new Error(_0x3318f1(0x13d)+_0x2e2d19[_0x3318f1(0x11f)]+_0x3318f1(0x14e)+_0x2e2d19[_0x3318f1(0x10a)]+';\x20rerun\x20with\x20--api\x20'+_0x2e2d19['api']);if(_0x2e2d19[_0x3318f1(0x17b)]!==_0x29a7b4)throw new Error(_0x3318f1(0x1cf)+_0x2e2d19[_0x3318f1(0x11f)]+_0x3318f1(0x115)+_0x2e2d19[_0x3318f1(0x17b)]+_0x3318f1(0x16f)+_0x29a7b4);if(!_0x2e2d19[_0x3318f1(0x18f)]||typeof _0x2e2d19[_0x3318f1(0x18f)]!=_0x3318f1(0x197)||Array[_0x3318f1(0x177)](_0x2e2d19['input']))throw new Error(_0x3318f1(0x1cf)+_0x2e2d19[_0x3318f1(0x11f)]+_0x3318f1(0x106));return _0x2e2d19[_0x3318f1(0x18f)];}function ie(_0x3c258d,_0x4ad94e){const _0x2d63c2=_0x3f96;return'colony\x20--api\x20'+_0x3c258d[_0x2d63c2(0x10a)]+_0x2d63c2(0x159)+_0x4ad94e[_0x2d63c2(0x12b)]+'\x20task\x20create\x20--request-key\x20'+_0x3c258d[_0x2d63c2(0x11f)];}function re(_0x1ad90c,_0x27807b){const _0x42b0f7=_0x3f96;return _0x42b0f7(0x150)+_0x1ad90c[_0x42b0f7(0x10a)]+_0x42b0f7(0x159)+_0x27807b[_0x42b0f7(0x12b)]+'\x20task\x20continue\x20'+_0x1ad90c[_0x42b0f7(0x18f)][_0x42b0f7(0x167)]+'\x20--request-key\x20'+_0x1ad90c[_0x42b0f7(0x11f)];}function me(_0x42bafa,{loadPlanner:_0x5d4939=_0x3b31e8}={}){const _0x1054a3=_0x3f96,_0x58a91c=_0x42bafa[_0x1054a3(0x1c3)]('task')[_0x1054a3(0x12d)](_0x1054a3(0x1ac));_0x2fb2a0(_0x58a91c),_0x58a91c[_0x1054a3(0x1c3)](_0x1054a3(0x1a5))[_0x1054a3(0x12d)]('list\x20jobs')[_0x1054a3(0xe5)]('--q\x20<text>',_0x1054a3(0xf3))['option'](_0x1054a3(0x146),_0x1054a3(0x112))[_0x1054a3(0xe5)](_0x1054a3(0x178),_0x1054a3(0xf6))['option']('--limit\x20<n>',_0x1054a3(0xfc))[_0x1054a3(0xe5)](_0x1054a3(0x166),_0x1054a3(0x14a))[_0x1054a3(0x17b)](async(_0x101dde,_0x41bca4)=>{const _0x125693=_0x1054a3,_0x351b7d=_0x41bca4[_0x125693(0x174)](),_0x4b72ee=await _0x441870(_0x351b7d[_0x125693(0x10a)],z(_0x351b7d));_0xeb68e2(_0x351b7d[_0x125693(0x131)]?_0x4b72ee[_0x125693(0x145)]:V(_0x4b72ee[_0x125693(0x145)]),_0x351b7d);}),_0x58a91c['command']('show\x20<id>')['description']('show\x20one\x20job')[_0x1054a3(0x17b)](async(_0x10fdeb,_0xee5925,_0x5d8445)=>{const _0x596ef5=_0x1054a3,_0x171be0=_0x5d8445['optsWithGlobals'](),_0x164269=await _0x441870(_0x171be0['api'],_0x596ef5(0x158)+encodeURIComponent(_0x10fdeb));_0xeb68e2(_0x171be0[_0x596ef5(0x131)]?_0x164269[_0x596ef5(0x145)]:Y(_0x164269[_0x596ef5(0x145)]),_0x171be0);}),_0x58a91c[_0x1054a3(0x1c3)](_0x1054a3(0x18e))[_0x1054a3(0x12d)]('show\x20a\x20job\x20result\x20and\x20artifact\x20URLs')[_0x1054a3(0x17b)](async(_0x36eefc,_0xe1819e,_0x41bd46)=>{const _0xf3a019=_0x1054a3,_0x209885=_0x41bd46['optsWithGlobals'](),_0xdecbd=await _0x441870(_0x209885[_0xf3a019(0x10a)],_0xf3a019(0x158)+encodeURIComponent(_0x36eefc)+'/result');_0xeb68e2(_0x209885['json']?_0xdecbd['data']:C(_0xdecbd[_0xf3a019(0x145)]),_0x209885);}),_0x58a91c[_0x1054a3(0x1c3)](_0x1054a3(0x15e))[_0x1054a3(0x12d)](_0x1054a3(0xe9))['option']('--interval\x20<seconds>','poll\x20interval\x20in\x20seconds',String(_0x15770c))[_0x1054a3(0xe5)](_0x1054a3(0x16d),_0x1054a3(0x1b2),String(_0x4ccd1a))['action'](async(_0x211038,_0xe908de,_0x205555)=>{const _0x5316ba=_0x1054a3,_0x2ee235=_0x205555[_0x5316ba(0x174)](),_0x1a9a3e=await _0x437e0d({'api':_0x2ee235['api'],'id':_0x211038,'interval':_0x2ee235[_0x5316ba(0x11d)],'timeout':_0x2ee235[_0x5316ba(0x169)],'onProgress':_0x284a63=>{const _0x35ee81=_0x5316ba;_0x284a63['type']===_0x35ee81(0x196)?_0x5b5425('wait:\x20'+_0x284a63[_0x35ee81(0x117)]+_0x35ee81(0xed)+_0x284a63[_0x35ee81(0x185)]+'\x20(poll\x20'+_0x284a63[_0x35ee81(0x176)]+',\x20'+(_0x284a63[_0x35ee81(0x13a)]/0x3e8)[_0x35ee81(0x10d)](0x1)+_0x35ee81(0xdf)):_0x284a63[_0x35ee81(0xfd)]==='retry'&&_0x5b5425(_0x35ee81(0x103)+(_0x284a63['status']?_0x35ee81(0x1c7)+_0x284a63[_0x35ee81(0x133)]:'Network\x20error')+_0x35ee81(0x121)+(_0x284a63[_0x35ee81(0x141)]/0x3e8)[_0x35ee81(0x10d)](0x1)+_0x35ee81(0x18c)+_0x284a63[_0x35ee81(0x11c)]+')\x0a');}});if(_0x1a9a3e[_0x5316ba(0x16b)]===_0x5316ba(0x128)){_0x5b5425(_0x5316ba(0x118)),process[_0x5316ba(0x122)]=0x82;return;}_0x1a9a3e[_0x5316ba(0x1b3)]&&_0xeb68e2(_0x2ee235[_0x5316ba(0x131)]?_0x1a9a3e[_0x5316ba(0x1b3)]:C(_0x1a9a3e[_0x5316ba(0x1b3)]),_0x2ee235),_0x1a9a3e['outcome']!==_0x5316ba(0x186)&&(_0x5b5425(_0x5316ba(0x103)+_0x1a9a3e[_0x5316ba(0x17a)]+'\x0a'),process[_0x5316ba(0x122)]=0x1);}),_0x58a91c[_0x1054a3(0x1c3)](_0x1054a3(0x160))[_0x1054a3(0x12d)](_0x1054a3(0x1a4))['requiredOption'](_0x1054a3(0x172),_0x1054a3(0xe1))['action'](async(_0x11b640,_0x58a3dd,_0x5067e3)=>{const _0xb7ed44=_0x1054a3,_0xb74804=_0x5067e3[_0xb7ed44(0x174)](),_0x2bf0c7=await _0x2f0a1e({'api':_0xb74804[_0xb7ed44(0x10a)],'id':_0x11b640,'out':_0xb74804[_0xb7ed44(0x130)],'onProgress':_0x576b6a=>{const _0xf36fdf=_0xb7ed44;_0x576b6a[_0xf36fdf(0xfd)]===_0xf36fdf(0x183)&&_0x5b5425(_0xf36fdf(0x127)+_0x576b6a[_0xf36fdf(0x175)]+_0xf36fdf(0x136)+_0x576b6a[_0xf36fdf(0x1bd)]+'\x0a');}});_0xeb68e2(_0xb74804[_0xb7ed44(0x131)]?_0x2bf0c7:X(_0x2bf0c7),_0xb74804);}),_0x58a91c[_0x1054a3(0x1c3)](_0x1054a3(0x1c4))[_0x1054a3(0x12d)](_0x1054a3(0xf8))['requiredOption']('--file\x20<path>',_0x1054a3(0x132))[_0x1054a3(0xe5)](_0x1054a3(0x148),_0x1054a3(0x10f))[_0x1054a3(0x17b)](async(_0x23debc,_0x2e40e1)=>{const _0x576c21=_0x1054a3,_0x223373=_0x2e40e1[_0x576c21(0x174)](),_0x2324fd=await _0x580a8f(_0x223373[_0x576c21(0x1bd)]),_0x1f1f4f=_0x223373[_0x576c21(0x17b)]??_0x534e8e(_0x2324fd),_0x3c8376=await _0x2e2f7e(_0x223373[_0x576c21(0x10a)],_0x2324fd,_0x1f1f4f);_0xeb68e2(_0x223373[_0x576c21(0x131)]?_0x3c8376:v(_0x3c8376),_0x223373);}),_0x58a91c[_0x1054a3(0x1c3)]('publish')[_0x1054a3(0x12d)](_0x1054a3(0x1d0))[_0x1054a3(0x189)](_0x1054a3(0x152),_0x1054a3(0x132))[_0x1054a3(0xe5)](_0x1054a3(0x107),'reuse\x20a\x20saved\x20order\x20request\x20key')['action'](async(_0x214e34,_0x66e2d6)=>{const _0x727fea=_0x1054a3,_0x13a629=_0x66e2d6['optsWithGlobals'](),_0x31a981=await _0x15f3b4({'api':_0x13a629[_0x727fea(0x10a)],'home':_0x13a629[_0x727fea(0x12b)],'file':_0x13a629[_0x727fea(0x1bd)],'action':_0x727fea(0xf2),'requestKey':_0x13a629[_0x727fea(0x11f)],'yes':_0x13a629['yes'],'keyEnv':_0x13a629[_0x727fea(0x180)],'rpc':_0x13a629['rpc'],'paymentChain':_0x13a629[_0x727fea(0x1bc)],'payWith':_0x13a629[_0x727fea(0x134)]});q(_0x31a981,_0x13a629);}),_0x58a91c[_0x1054a3(0x1c3)]('create\x20[objective]')[_0x1054a3(0x12d)](_0x1054a3(0x110))[_0x1054a3(0xe5)](_0x1054a3(0x152),_0x1054a3(0x17e))[_0x1054a3(0xe5)](_0x1054a3(0x11e),_0x1054a3(0x114))[_0x1054a3(0xe5)](_0x1054a3(0x109),_0x1054a3(0x1a9))[_0x1054a3(0xe5)]('--template\x20<name>','job\x20template')[_0x1054a3(0xe5)]('--path\x20<path>',_0x1054a3(0xf1),(_0x127525,_0x494a50)=>[..._0x494a50,_0x127525],[])[_0x1054a3(0xe5)](_0x1054a3(0x1c2),_0x1054a3(0x14b))[_0x1054a3(0xe5)](_0x1054a3(0x1ba),_0x1054a3(0x142))[_0x1054a3(0xe5)]('--github','publish\x20the\x20result\x20to\x20GitHub')[_0x1054a3(0xe5)](_0x1054a3(0x17d),_0x1054a3(0x153),(_0x34f264,_0x366ed6)=>[..._0x366ed6,_0x34f264],[])[_0x1054a3(0xe5)]('--dry-run',_0x1054a3(0x1bb))['option'](_0x1054a3(0x1bf),_0x1054a3(0x1a8))[_0x1054a3(0xe5)](_0x1054a3(0x107),_0x1054a3(0x171))[_0x1054a3(0x17b)](async(_0x3ee255,_0x1acada,_0x2443f5)=>{const _0x34abc1=_0x1054a3,_0x5359b5=_0x2443f5[_0x34abc1(0x174)](),_0x175358=te(_0x3ee255,_0x5359b5);let _0x3c592b,_0xb97236=null;if(_0x5359b5[_0x34abc1(0x11f)]&&!T(_0x5359b5)&&(_0x3ee255===void 0x0||_0x175358)){const _0x2954bb=await _0x1b8dc6(_0x5359b5['home'],_0x5359b5['requestKey']);if(_0x3c592b=U(_0x2954bb,_0x5359b5[_0x34abc1(0x11f)],{'api':_0x5359b5[_0x34abc1(0x10a)],'action':'job.open'}),_0x3ee255!==void 0x0&&_0x3ee255!==_0x3c592b[_0x34abc1(0x19d)])throw new Error(_0x34abc1(0x1cf)+_0x5359b5[_0x34abc1(0x11f)]+_0x34abc1(0x198));}else{if(_0x175358){if(_0xb97236=await N({'api':_0x5359b5[_0x34abc1(0x10a)],'home':_0x5359b5[_0x34abc1(0x12b)],'objective':_0x3ee255,'answers':_0x5359b5[_0x34abc1(0x182)],'source':oe(_0x5359b5),'github':_0x5359b5['github']===!0x0,'opts':_0x5359b5,'loadPlanner':_0x5d4939}),_0xb97236[_0x34abc1(0x18f)]===null){K(_0xb97236,_0x34abc1(0xf2),_0x5359b5);return;}_0x3c592b=_0xb97236[_0x34abc1(0x18f)];}else{const _0x33e7fb=_0x5359b5['file']?await _0x580a8f(_0x5359b5['file']):void 0x0;_0x3c592b=await _0x627aec({'fileInput':_0x33e7fb,'objective':_0x3ee255,'preset':_0x5359b5[_0x34abc1(0x1a6)],'skill':_0x5359b5['skill'],'template':_0x5359b5[_0x34abc1(0xfb)],'paths':_0x5359b5[_0x34abc1(0x175)],'repo':_0x5359b5['repo'],'commit':_0x5359b5[_0x34abc1(0x1ab)],'github':_0x5359b5[_0x34abc1(0x184)]});}}if(_0x5359b5['save']&&(await _0x5695ff(_0x5359b5[_0x34abc1(0x15f)],_0x3c592b),_0x5359b5[_0x34abc1(0x131)]||_0x5b5425(_0x34abc1(0x19a)+_0x5359b5['save']+'\x0a')),_0x5359b5[_0x34abc1(0x1a3)]){const _0xb10fe6=await _0x2e2f7e(_0x5359b5[_0x34abc1(0x10a)],_0x3c592b,_0x34abc1(0xf2));_0x5359b5['json']?_0xeb68e2({'action':_0x34abc1(0xf2),..._0xb97236?{'summary':_0xb97236[_0x34abc1(0x12e)],'deliverables':_0xb97236[_0x34abc1(0x12a)]}:{},'input':_0x3c592b,'check':_0xb10fe6},_0x5359b5):_0xeb68e2(_0xb97236?O(_0xb97236,_0xb10fe6):A('job.open',_0x3c592b,_0xb10fe6),_0x5359b5),_0xb10fe6[_0x34abc1(0x105)][_0x34abc1(0x124)]>0x0&&(process[_0x34abc1(0x122)]=0x1);return;}_0xb97236&&!_0x5359b5[_0x34abc1(0x131)]&&_0x5b5425(b(_0xb97236)+'\x0a');const _0x352b50=await _0x15f3b4({'api':_0x5359b5['api'],'home':_0x5359b5['home'],'input':_0x3c592b,'action':_0x34abc1(0xf2),'requestKey':_0x5359b5[_0x34abc1(0x11f)],'plan':_0xb97236?{'summary':_0xb97236[_0x34abc1(0x12e)],'deliverables':_0xb97236[_0x34abc1(0x12a)]}:void 0x0,'yes':_0x5359b5[_0x34abc1(0x1a7)],'keyEnv':_0x5359b5[_0x34abc1(0x180)],'rpc':_0x5359b5[_0x34abc1(0x12c)],'paymentChain':_0x5359b5[_0x34abc1(0x1bc)],'payWith':_0x5359b5[_0x34abc1(0x134)],'retryCommand':_0x2e8f06=>ie(_0x2e8f06,_0x5359b5)});q(_0x352b50,_0x5359b5);}),_0x58a91c['command'](_0x1054a3(0xf7))['description'](_0x1054a3(0xef))[_0x1054a3(0xe5)](_0x1054a3(0x152),_0x1054a3(0x137))[_0x1054a3(0xe5)](_0x1054a3(0x109),_0x1054a3(0x1a9))[_0x1054a3(0xe5)]('--template\x20<name>','job\x20template')[_0x1054a3(0xe5)](_0x1054a3(0x15c),'repository\x20path\x20the\x20job\x20may\x20write\x20(repeatable)',(_0x2a32c3,_0x38050e)=>[..._0x38050e,_0x2a32c3],[])['option'](_0x1054a3(0x17d),_0x1054a3(0x153),(_0x24f892,_0x3a850c)=>[..._0x3a850c,_0x24f892],[])[_0x1054a3(0xe5)](_0x1054a3(0x18a),_0x1054a3(0x1bb))[_0x1054a3(0xe5)]('--save\x20<path>',_0x1054a3(0x1a8))[_0x1054a3(0xe5)](_0x1054a3(0x107),_0x1054a3(0x171))[_0x1054a3(0x17b)](async(_0x33211e,_0x3897de,_0x3b2b67,_0xf97c59)=>{const _0x525abd=_0x1054a3,_0x4eaf39=_0xf97c59['optsWithGlobals'](),_0x416f71=ne(_0x3897de,_0x4eaf39);let _0xe1eaa7,_0x589820,_0xec5522=null;if(_0x4eaf39[_0x525abd(0x11f)]&&!J(_0x4eaf39)&&(_0x3897de===void 0x0||_0x416f71)){const _0x2b7a26=await _0x1b8dc6(_0x4eaf39['home'],_0x4eaf39[_0x525abd(0x11f)]);if(_0xe1eaa7=U(_0x2b7a26,_0x4eaf39['requestKey'],{'api':_0x4eaf39[_0x525abd(0x10a)],'action':_0x525abd(0x12f)}),_0xe1eaa7['parentJobId']!==_0x33211e)throw new Error(_0x525abd(0x1cf)+_0x4eaf39[_0x525abd(0x11f)]+_0x525abd(0x1ae)+(_0xe1eaa7[_0x525abd(0x167)]??_0x525abd(0x119))+_0x525abd(0x16f)+_0x33211e);if(_0x3897de!==void 0x0&&_0x3897de!==_0xe1eaa7[_0x525abd(0x19d)])throw new Error(_0x525abd(0x1cf)+_0x4eaf39['requestKey']+_0x525abd(0x198));_0x589820=(await _0x441870(_0x4eaf39[_0x525abd(0x10a)],_0x525abd(0x158)+encodeURIComponent(_0x33211e)))[_0x525abd(0x145)];}else{if(_0x416f71){if(_0x589820=(await _0x441870(_0x4eaf39[_0x525abd(0x10a)],_0x525abd(0x158)+encodeURIComponent(_0x33211e)))['data'],_0xec5522=await N({'api':_0x4eaf39[_0x525abd(0x10a)],'home':_0x4eaf39[_0x525abd(0x12b)],'objective':_0x3897de,'answers':_0x4eaf39['answer'],'parent':_0x589820,'opts':_0x4eaf39,'loadPlanner':_0x5d4939}),_0xec5522[_0x525abd(0x18f)]===null){K(_0xec5522,_0x525abd(0x12f),_0x4eaf39);return;}_0xe1eaa7=_0xec5522['input'],_0xe1eaa7[_0x525abd(0x167)]!==_0x33211e&&(_0xe1eaa7={..._0xe1eaa7,'parentJobId':_0x33211e});}else{const _0x2ae2d8=_0x4eaf39[_0x525abd(0x1bd)]?await _0x580a8f(_0x4eaf39[_0x525abd(0x1bd)]):void 0x0;_0xe1eaa7=await _0x484cea({'id':_0x33211e,'fileInput':_0x2ae2d8,'objective':_0x3897de,'skill':_0x4eaf39[_0x525abd(0x1c6)],'template':_0x4eaf39['template'],'paths':_0x4eaf39[_0x525abd(0x175)]}),_0x589820=(await _0x441870(_0x4eaf39[_0x525abd(0x10a)],'/jobs/'+encodeURIComponent(_0x33211e)))[_0x525abd(0x145)];}}if(_0x4eaf39[_0x525abd(0x15f)]&&(await _0x5695ff(_0x4eaf39['save'],_0xe1eaa7),_0x4eaf39[_0x525abd(0x131)]||_0x5b5425(_0x525abd(0x19a)+_0x4eaf39[_0x525abd(0x15f)]+'\x0a')),_0x4eaf39[_0x525abd(0x1a3)]){const _0x1ff3bd=await _0x2e2f7e(_0x4eaf39[_0x525abd(0x10a)],_0xe1eaa7,_0x525abd(0x12f));_0x4eaf39[_0x525abd(0x131)]?_0xeb68e2({'action':_0x525abd(0x12f),..._0xec5522?{'summary':_0xec5522[_0x525abd(0x12e)],'deliverables':_0xec5522[_0x525abd(0x12a)]}:{},'parent':_0x289c69(_0x589820),'input':_0xe1eaa7,'check':_0x1ff3bd},_0x4eaf39):_0xeb68e2(_0xec5522?O(_0xec5522,_0x1ff3bd):A(_0x525abd(0x12f),_0xe1eaa7,_0x1ff3bd,_0x589820),_0x4eaf39),_0x1ff3bd[_0x525abd(0x105)][_0x525abd(0x124)]>0x0&&(process[_0x525abd(0x122)]=0x1);return;}_0xec5522&&!_0x4eaf39[_0x525abd(0x131)]&&_0x5b5425(b(_0xec5522)+'\x0a');const _0x38b164=await _0x15f3b4({'api':_0x4eaf39['api'],'home':_0x4eaf39[_0x525abd(0x12b)],'input':_0xe1eaa7,'action':_0x525abd(0x12f),'requestKey':_0x4eaf39['requestKey'],'plan':_0xec5522?{'summary':_0xec5522[_0x525abd(0x12e)],'deliverables':_0xec5522['deliverables']}:void 0x0,'yes':_0x4eaf39[_0x525abd(0x1a7)],'keyEnv':_0x4eaf39['keyEnv'],'rpc':_0x4eaf39[_0x525abd(0x12c)],'paymentChain':_0x4eaf39['paymentChain'],'payWith':_0x4eaf39['payWith'],'retryCommand':_0x1d1ee3=>re(_0x1d1ee3,_0x4eaf39)});_0x38b164[_0x525abd(0x117)]&&(_0x38b164[_0x525abd(0x117)][_0x525abd(0x156)]=_0x289c69(_0x589820)),q(_0x38b164,_0x4eaf39);});}export{me as registerTaskCommands};
@@ -0,0 +1 @@
1
+ import{erc20Abi as _0x7f37dd,parseUnits as _0xfbd0c0}from'viem';import{confirmAction as _0x38bf9c,getRpcClients as _0xb1d9e3,print as _0xe47798}from'../shared.mjs';import{loadPaymentConfig as _0x468388}from'../lib/payments.mjs';import{selectedPaymentNetwork as _0x4c0b9e,savePaymentNetwork as _0x98571a}from'../lib/payment-networks.mjs';import{walletInfo as _0x2d5ca3,saveLocalWallet as _0x11d0d2,backupWallet as _0x19da7d,restoreWallet as _0x48a6c5,walletFile as _0x54d3b9,listWallets as _0x5733fa,selectWallet as _0x30481f}from'../lib/local-wallet.mjs';function _0x8e65(){const _0x18bce6=['copy\x20the\x20encrypted\x20wallet\x20file;\x20never\x20export\x20a\x20plaintext\x20key','Confirm\x20password','length','--amount\x20<amount>','description','writeContract','Receive\x20on\x20','Passwords\x20do\x20not\x20match.','require\x20this\x20wallet\x20address\x20for\x20the\x20authorization','key','api','--amount\x20must\x20be\x20greater\x20than\x20zero','decimals','job.open','\x20(current)','payment\x20allowance:\x20\x20','map','symbol','\x0aAsset:\x20','approve\x20transaction\x20failed:\x20','priceAtomic','\x0aEncrypted\x20file:\x20','asset','allowance','requiredOption','action','list','show\x20IMD\x20balance\x20and\x20payment\x20allowance\x20on\x20the\x20selected\x20network','list\x20saved\x20local\x20wallets\x20and\x20the\x20current\x20selection','address','\x0aSpender:\x20','\x0aBack\x20up\x20this\x20file\x20and\x20keep\x20your\x20password.\x20Both\x20are\x20needed\x20to\x20restore\x20your\x20wallet.\x0aRun\x20colony\x20wallet\x20receive\x20to\x20deposit\x20funds.','authorized\x20','\x20atomic)','balance:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','address:\x20','encrypted\x20JSON\x20keystore\x20backup','optsWithGlobals','Local\x20wallet\x20password\x20(at\x20least\x208\x20characters)','chainName','payment\x20coins:','Active\x20wallet:\x20','quote\x20price:\x20\x20\x20\x20\x20\x20\x20\x20','\x20in\x20the\x20sending\x20wallet.\x20Include\x20ETH\x20for\x20network\x20fees.','path','\x20IMD\x20on\x20','Backup\x20password','asset:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','create\x20a\x20new\x20password-encrypted\x20local\x20wallet','\x0aCoins:\x20','qrFile','token\x20amount\x20to\x20approve,\x20in\x20whole\x20tokens','chain','select\x20a\x20saved\x20wallet','waitForTransactionReceipt','balanceAtomic','write','option','network\x20[name]','\x0aThis\x20transaction\x20also\x20uses\x20ETH\x20for\x20network\x20fees.','coins','--file\x20<file>','use\x20<address>','new\x20backup\x20file\x20path','wallet','active','\x0atx:\x20','amount','authorize\x20an\x20exact\x20IMD\x20amount\x20on\x20the\x20selected\x20payment\x20network','Private\x20key\x20(hidden)','join','out','receive','backup','import\x20a\x20private\x20key\x20using\x20hidden\x20terminal\x20input','approve','address:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','balance','status','--wallet\x20<address>','--out\x20<file>','name','command','home','\x0aSelect\x20','json','configured','allowanceAtomic','file','save\x20an\x20SVG\x20QR\x20code\x20to\x20a\x20new\x20file','network:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','show\x20the\x20deposit\x20address\x20and\x20QR\x20code\x20on\x20the\x20selected\x20network'];_0x8e65=function(){return _0x18bce6;};return _0x8e65();}import{readPassword as _0x2dfd36}from'../lib/password.mjs';import{walletStatus as _0x3459c5}from'../lib/wallet-status.mjs';import{receiveWallet as _0x5b9acb,receiveQr as _0x189770,saveReceiveQr as _0x3e2962}from'../lib/wallet-receive.mjs';async function k(){const _0x5e3aba=_0x1d0b,_0x35a49d=await _0x2dfd36(_0x5e3aba(0x167));if(_0x35a49d!==await _0x2dfd36(_0x5e3aba(0x142)))throw new Error(_0x5e3aba(0x148));return _0x35a49d;}function h(_0x2ddb8c,_0x2c8420){const _0x40f5ff=_0x1d0b;return'Wallet\x20ready:\x20'+_0x2ddb8c[_0x40f5ff(0x15e)]+_0x40f5ff(0x156)+_0x54d3b9(_0x2c8420)+_0x40f5ff(0x160);}function S(_0x5bcb70){const _0x25dc52=_0x1d0b;return _0x25dc52(0x164)+_0x5bcb70;}function _0x1d0b(_0x460f16,_0x8e65e7){_0x460f16=_0x460f16-0x141;const _0x1d0be5=_0x8e65();let _0x5a3a56=_0x1d0be5[_0x460f16];return _0x5a3a56;}function z(_0x247b7e){const _0x486155=_0x1d0b;return[_0x486155(0x18d)+_0x247b7e['address'],_0x486155(0x19b)+_0x247b7e[_0x486155(0x168)]+'\x20('+_0x247b7e['chainId']+')',_0x486155(0x170)+_0x247b7e[_0x486155(0x157)],_0x486155(0x163)+_0x247b7e[_0x486155(0x18e)]+'\x20('+_0x247b7e[_0x486155(0x178)]+_0x486155(0x162),_0x486155(0x150)+_0x247b7e[_0x486155(0x158)]+'\x20('+_0x247b7e[_0x486155(0x198)]+_0x486155(0x162),_0x486155(0x16b)+_0x247b7e['price']+'\x20('+_0x247b7e[_0x486155(0x155)]+_0x486155(0x162),_0x486155(0x169),..._0x247b7e[_0x486155(0x17d)][_0x486155(0x151)](_0x4ffe1a=>'\x20\x20'+_0x4ffe1a[_0x486155(0x152)]+':\x20'+_0x4ffe1a[_0x486155(0x18e)])][_0x486155(0x187)]('\x0a');}function J(_0x3edd11){const _0x550236=_0x1d0b,_0x1d5b11=_0x3edd11[_0x550236(0x193)](_0x550236(0x181))[_0x550236(0x145)]('create,\x20import,\x20back\x20up\x20and\x20fund\x20your\x20local\x20wallet');_0x1d5b11['command'](_0x550236(0x15b))[_0x550236(0x145)](_0x550236(0x15d))[_0x550236(0x15a)]((_0x387749,_0x404aed)=>{const _0x143e75=_0x550236,_0x5ac33f=_0x404aed[_0x143e75(0x166)](),_0x11b0a0=_0x5733fa(_0x5ac33f[_0x143e75(0x194)]);_0xe47798(_0x5ac33f[_0x143e75(0x196)]?_0x11b0a0:_0x11b0a0[_0x143e75(0x143)]?_0x11b0a0[_0x143e75(0x151)](_0x4d1471=>(_0x4d1471[_0x143e75(0x182)]?'*':'\x20')+'\x20'+_0x4d1471[_0x143e75(0x15e)]+(_0x4d1471[_0x143e75(0x182)]?_0x143e75(0x14f):''))[_0x143e75(0x187)]('\x0a'):'No\x20saved\x20wallets.\x20Create,\x20import\x20or\x20restore\x20one.',_0x5ac33f);}),_0x1d5b11[_0x550236(0x193)](_0x550236(0x17f))[_0x550236(0x145)](_0x550236(0x176))['action'](async(_0x30c896,_0x33c5c8,_0x5c91ad)=>{const _0x13c08b=_0x550236,_0x410058=_0x5c91ad['optsWithGlobals'](),_0x378629=await _0x30481f(_0x410058[_0x13c08b(0x194)],_0x30c896);_0xe47798(_0x410058[_0x13c08b(0x196)]?_0x378629:_0x13c08b(0x16a)+_0x378629[_0x13c08b(0x15e)],_0x410058);}),_0x1d5b11[_0x550236(0x193)]('create')[_0x550236(0x145)](_0x550236(0x171))['action'](async(_0xde360b,_0x4d9a11)=>{const _0x60abdd=_0x550236,_0x4e8c60=_0x4d9a11['optsWithGlobals'](),_0x5e256f=await _0x11d0d2(_0x4e8c60[_0x60abdd(0x194)],_0x5733fa(_0x4e8c60['home'])[_0x60abdd(0x143)]?void 0x0:await k());_0xe47798(_0x4e8c60[_0x60abdd(0x196)]?_0x5e256f:h(_0x5e256f,_0x4e8c60['home']),_0x4e8c60);}),_0x1d5b11['command']('import')['description'](_0x550236(0x18b))[_0x550236(0x15a)](async(_0x2c868d,_0x536729)=>{const _0x4c7735=_0x550236,_0x430dfc=_0x536729['optsWithGlobals'](),_0x4e97a8=await _0x2dfd36(_0x4c7735(0x186)),_0x229c8d=await _0x11d0d2(_0x430dfc['home'],_0x5733fa(_0x430dfc[_0x4c7735(0x194)])[_0x4c7735(0x143)]?void 0x0:await k(),_0x4e97a8);_0xe47798(_0x430dfc[_0x4c7735(0x196)]?_0x229c8d:h(_0x229c8d,_0x430dfc[_0x4c7735(0x194)]),_0x430dfc);}),_0x1d5b11[_0x550236(0x193)](_0x550236(0x18a))['description'](_0x550236(0x141))[_0x550236(0x159)](_0x550236(0x191),_0x550236(0x180))[_0x550236(0x15a)](async(_0x3d19bc,_0x4fef4b)=>{const _0x431d8b=_0x550236,_0x92b02b=_0x4fef4b['optsWithGlobals'](),_0x99fb7=await _0x19da7d(_0x92b02b[_0x431d8b(0x194)],_0x92b02b[_0x431d8b(0x188)]);_0xe47798(_0x92b02b[_0x431d8b(0x196)]?_0x99fb7:'Encrypted\x20backup\x20saved:\x20'+_0x99fb7[_0x431d8b(0x16d)]+'\x0aKeep\x20your\x20wallet\x20password\x20separately.',_0x92b02b);}),_0x1d5b11[_0x550236(0x193)]('restore')[_0x550236(0x145)]('add\x20a\x20wallet\x20from\x20an\x20encrypted\x20backup\x20and\x20select\x20it')[_0x550236(0x159)](_0x550236(0x17e),_0x550236(0x165))[_0x550236(0x15a)](async(_0x2830bf,_0x4a9adc)=>{const _0x4e61fa=_0x550236,_0x535771=_0x4a9adc[_0x4e61fa(0x166)](),_0x27fa7c=await _0x48a6c5(_0x535771['home'],_0x535771[_0x4e61fa(0x199)],await _0x2dfd36(_0x4e61fa(0x16f)));_0xe47798(_0x535771[_0x4e61fa(0x196)]?_0x27fa7c:h(_0x27fa7c,_0x535771['home']),_0x535771);}),_0x1d5b11[_0x550236(0x193)](_0x550236(0x189))[_0x550236(0x145)](_0x550236(0x19c))['option'](_0x550236(0x191),_0x550236(0x19a))['action'](async(_0x22a67c,_0x4e5f18)=>{const _0xc0d80d=_0x550236,_0x16913e=_0x4e5f18['optsWithGlobals'](),_0x1eb4a4=await _0x5b9acb(_0x16913e);if(_0x16913e[_0xc0d80d(0x188)]&&(_0x1eb4a4[_0xc0d80d(0x173)]=(await _0x3e2962(_0x1eb4a4[_0xc0d80d(0x15e)],_0x16913e[_0xc0d80d(0x188)]))[_0xc0d80d(0x16d)]),_0x16913e[_0xc0d80d(0x196)])return _0xe47798(_0x1eb4a4,_0x16913e);_0xe47798(_0xc0d80d(0x147)+_0x1eb4a4[_0xc0d80d(0x168)]+'\x0a'+_0x1eb4a4['address']+_0xc0d80d(0x172)+_0x1eb4a4['coins'][_0xc0d80d(0x187)](',\x20')+_0xc0d80d(0x195)+_0x1eb4a4[_0xc0d80d(0x168)]+_0xc0d80d(0x16c),_0x16913e),_0x1eb4a4[_0xc0d80d(0x173)]?_0xe47798('QR\x20saved:\x20'+_0x1eb4a4[_0xc0d80d(0x173)],_0x16913e):process['stdout'][_0xc0d80d(0x179)](await _0x189770(_0x1eb4a4[_0xc0d80d(0x15e)]));}),_0x1d5b11['command'](_0x550236(0x17b))[_0x550236(0x145)]('show\x20or\x20save\x20the\x20payment\x20network:\x20ethereum\x20or\x20robinhood')[_0x550236(0x15a)](async(_0x24816d,_0xc1d836,_0x2bc091)=>{const _0x37c9ab=_0x550236,_0xc14fbc=_0x2bc091[_0x37c9ab(0x166)](),_0x2ed18d=_0x24816d?await _0x98571a(_0xc14fbc['home'],_0x24816d):await _0x4c0b9e(_0xc14fbc),_0x46c10b={'network':_0x2ed18d[_0x37c9ab(0x14a)],'name':_0x2ed18d[_0x37c9ab(0x175)][_0x37c9ab(0x192)],'chainId':_0x2ed18d[_0x37c9ab(0x175)]['id']};_0xe47798(_0xc14fbc[_0x37c9ab(0x196)]?_0x46c10b:'Payment\x20network:\x20'+_0x46c10b[_0x37c9ab(0x192)]+'\x20('+_0x46c10b['network']+')',_0xc14fbc);}),_0x1d5b11[_0x550236(0x193)](_0x550236(0x15e))[_0x550236(0x145)]('print\x20your\x20public\x20wallet\x20address\x20without\x20unlocking')[_0x550236(0x15a)]((_0x25f766,_0x44e1dd)=>{const _0x2d148b=_0x550236,_0x1a4cb4=_0x44e1dd[_0x2d148b(0x166)](),_0x4d7573=_0x2d5ca3(_0x1a4cb4);if(!_0x4d7573[_0x2d148b(0x197)])throw new Error('Create\x20or\x20import\x20a\x20wallet\x20first.');_0xe47798(_0x1a4cb4[_0x2d148b(0x196)]?{'address':_0x4d7573[_0x2d148b(0x15e)]}:S(_0x4d7573[_0x2d148b(0x15e)]),_0x1a4cb4);}),_0x1d5b11[_0x550236(0x193)](_0x550236(0x18f))[_0x550236(0x145)](_0x550236(0x15c))['action'](async(_0x19a1eb,_0x46bbe9)=>{const _0x456882=_0x550236,_0x687490=_0x46bbe9[_0x456882(0x166)](),_0x3396b4=await _0x3459c5(_0x687490);_0xe47798(_0x687490[_0x456882(0x196)]?_0x3396b4:z(_0x3396b4),_0x687490);}),_0x1d5b11[_0x550236(0x193)](_0x550236(0x18c))[_0x550236(0x145)](_0x550236(0x185))[_0x550236(0x159)](_0x550236(0x144),_0x550236(0x174))[_0x550236(0x17a)](_0x550236(0x190),_0x550236(0x149))[_0x550236(0x15a)](async(_0xfa4bb8,_0x347dea)=>{const _0x182760=_0x550236,_0x38377e=_0x347dea['optsWithGlobals'](),_0x21f37d=_0x38377e[_0x182760(0x181)]??_0x2d5ca3(_0x38377e)[_0x182760(0x15e)],_0x92310a=await _0x4c0b9e(_0x38377e),{payment:_0x32757d,chainId:_0x188b36,spender:_0x36edb0}=await _0x468388(_0x38377e[_0x182760(0x14b)],_0x182760(0x14e),_0x92310a[_0x182760(0x14a)]),_0x43d46a=_0xfbd0c0(_0x38377e[_0x182760(0x184)],_0x32757d[_0x182760(0x14d)]);if(_0x43d46a<=0x0n)throw new Error(_0x182760(0x14c));await _0x38bf9c('Authorize\x20'+_0x38377e[_0x182760(0x184)]+'\x20IMD\x20for\x20payment\x20on\x20'+_0x92310a[_0x182760(0x175)]['name']+'?\x0aWallet:\x20'+_0x21f37d+_0x182760(0x153)+_0x32757d[_0x182760(0x157)]+_0x182760(0x15f)+_0x36edb0+_0x182760(0x17c),_0x38377e);const {publicClient:_0x582d4a,walletClient:_0x12c50f}=await _0xb1d9e3({..._0x38377e,'expectedWallet':_0x21f37d},_0x188b36),_0x8b2e16=await _0x12c50f[_0x182760(0x146)]({'address':_0x32757d[_0x182760(0x157)],'abi':_0x7f37dd,'functionName':_0x182760(0x18c),'args':[_0x36edb0,_0x43d46a]});if((await _0x582d4a[_0x182760(0x177)]({'hash':_0x8b2e16}))[_0x182760(0x18f)]!=='success')throw new Error(_0x182760(0x154)+_0x8b2e16);const _0x3b26c7={'transactionHash':_0x8b2e16,'chainId':_0x188b36,'asset':_0x32757d['asset'],'spender':_0x36edb0,'amount':_0x38377e[_0x182760(0x184)],'amountAtomic':String(_0x43d46a)};_0xe47798(_0x38377e[_0x182760(0x196)]?_0x3b26c7:_0x182760(0x161)+_0x38377e[_0x182760(0x184)]+_0x182760(0x16e)+_0x92310a[_0x182760(0x175)][_0x182760(0x192)]+_0x182760(0x183)+_0x8b2e16,_0x38377e);});}export{J as registerWalletCommands};