hyperclaw 4.0.1 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/README.md +7 -4
  2. package/dist/a2ui-protocol-CT_jDEU9.js +75 -0
  3. package/dist/agents-routing-683Q2JGp.js +129 -0
  4. package/dist/agents-routing-BpZBswBH.js +4 -0
  5. package/dist/api-keys-guide-Dq5Obbp4.js +149 -0
  6. package/dist/audit-BYxPlnTQ.js +248 -0
  7. package/dist/bounty-tools-C6LyzxM-.js +211 -0
  8. package/dist/browser-tools-CQBSbIuO.js +5 -0
  9. package/dist/browser-tools-YQmwRLLM.js +179 -0
  10. package/dist/claw-tasks-BRLUvFRD.js +80 -0
  11. package/dist/connector-3HnyH8fn.js +167 -0
  12. package/dist/connector-6PMZo5Ky.js +189 -0
  13. package/dist/connector-B6eoF3DD.js +181 -0
  14. package/dist/connector-B9tLG8UZ.js +196 -0
  15. package/dist/connector-BOlqjXWP.js +182 -0
  16. package/dist/connector-BP8zsbP8.js +189 -0
  17. package/dist/connector-BPoSevxp.js +286 -0
  18. package/dist/connector-BRHj773i.js +163 -0
  19. package/dist/connector-BToxU-jV.js +267 -0
  20. package/dist/connector-BliDVsJQ.js +239 -0
  21. package/dist/connector-Bv6s9oP7.js +88 -0
  22. package/dist/connector-By5wWGTR.js +343 -0
  23. package/dist/connector-C1BaFFgN.js +213 -0
  24. package/dist/connector-CRRWY5Wv.js +167 -0
  25. package/dist/connector-CXPQVGyI.js +85 -0
  26. package/dist/connector-Cdk1CXKi.js +194 -0
  27. package/dist/connector-CwlgFgjx.js +181 -0
  28. package/dist/connector-DFchk6l7.js +178 -0
  29. package/dist/connector-DKw7tRAy.js +192 -0
  30. package/dist/connector-DRv1ahC_.js +2 -2
  31. package/dist/connector-DU63KW94.js +165 -0
  32. package/dist/connector-Dbvb1Cj9.js +280 -0
  33. package/dist/connector-DcZdQcgR.js +173 -0
  34. package/dist/connector-DxKL8VvZ.js +182 -0
  35. package/dist/connector-T_YdZtzv.js +162 -0
  36. package/dist/connector-i4gOS9xL.js +154 -0
  37. package/dist/connector-rHXE1ZD2.js +167 -0
  38. package/dist/connector-wdUXChwa.js +172 -0
  39. package/dist/cost-tracker-pVE15Yq4.js +103 -0
  40. package/dist/credentials-store-BvnMPJwi.js +4 -0
  41. package/dist/credentials-store-sb-TRLwR.js +77 -0
  42. package/dist/cron-tasks-BvDFNyiE.js +82 -0
  43. package/dist/delivery-D5Z98EVq.js +95 -0
  44. package/dist/delivery-DCOXhXEO.js +5 -0
  45. package/dist/destructive-gate-m-dWqUFg.js +101 -0
  46. package/dist/developer-keys-JaJK3T27.js +127 -0
  47. package/dist/developer-keys-kyqmtWK3.js +8 -0
  48. package/dist/doctor-3oi89QIc.js +175 -0
  49. package/dist/doctor-Cf1XSfp9.js +4 -0
  50. package/dist/engine-B4eMiTgl.js +7 -0
  51. package/dist/engine-B8M7dYul.js +7 -0
  52. package/dist/engine-BhT-1M9W.js +256 -0
  53. package/dist/engine-D49jnSd_.js +256 -0
  54. package/dist/env-resolve-DWOQ45jG.js +9 -0
  55. package/dist/env-resolve-szSWl0UF.js +94 -0
  56. package/dist/extraction-tools-D3qDFBJ1.js +91 -0
  57. package/dist/extraction-tools-DLr_AEwq.js +5 -0
  58. package/dist/form_data-B_hIUrxU.js +8657 -0
  59. package/dist/gmail-watch-setup-Czt8rXaX.js +40 -0
  60. package/dist/heartbeat-engine-CRqfPcFM.js +83 -0
  61. package/dist/hub-DTsqe5Bt.js +6 -0
  62. package/dist/hub-FrPTA33j.js +515 -0
  63. package/dist/hyperclawbot-D9KCtc4P.js +480 -0
  64. package/dist/hyperclawbot-Dw27pJo4.js +480 -0
  65. package/dist/inference-CTWJeX9Q.js +922 -0
  66. package/dist/inference-ix607p7k.js +6 -0
  67. package/dist/knowledge-graph-DqA-Fztl.js +131 -0
  68. package/dist/loader-CISCqBto.js +400 -0
  69. package/dist/loader-CYMQ8VOS.js +4 -0
  70. package/dist/logger-8tEtAd3y.js +83 -0
  71. package/dist/manager-CPjeRe-6.js +4 -0
  72. package/dist/manager-Cwzj7w5R.js +105 -0
  73. package/dist/manager-DLmZI-9R.js +6 -0
  74. package/dist/manager-DSGhn5i3.js +117 -0
  75. package/dist/manager-DgyF52mg.js +218 -0
  76. package/dist/manager-Dm8nrMFx.js +40 -0
  77. package/dist/mcp-B_9Ber63.js +139 -0
  78. package/dist/mcp-loader-DSM5UiFG.js +94 -0
  79. package/dist/mcp-loader-j5ZLLw5O.js +94 -0
  80. package/dist/memory-BI1kPkAN.js +4 -0
  81. package/dist/memory-BVFGkxxK.js +270 -0
  82. package/dist/memory-auto-Bc7euou4.js +306 -0
  83. package/dist/memory-auto-DPfbkMVt.js +5 -0
  84. package/dist/memory-integration-DZExqWr4.js +91 -0
  85. package/dist/moltbook-B6ZeGN5_.js +81 -0
  86. package/dist/node-pwL6O_KX.js +222 -0
  87. package/dist/nodes-registry-CsPm_-CJ.js +52 -0
  88. package/dist/oauth-flow-CpWlgvNB.js +150 -0
  89. package/dist/oauth-provider-BZb6qOw5.js +110 -0
  90. package/dist/observability-B43YvNQV.js +89 -0
  91. package/dist/onboard-Bd_wsYdi.js +4086 -0
  92. package/dist/onboard-CAN7x3me.js +3026 -0
  93. package/dist/onboard-DnegOHMh.js +4 -4
  94. package/dist/onboard-RYtDlYBw.js +9 -0
  95. package/dist/onboard-aTwlQs-4.js +9 -0
  96. package/dist/orchestrator-BSp2M5EU.js +189 -0
  97. package/dist/orchestrator-C7ko5tWa.js +6 -0
  98. package/dist/orchestrator-DfPkIx2Z.js +6 -0
  99. package/dist/orchestrator-NJQsmiBE.js +189 -0
  100. package/dist/pairing-DU0_J28n.js +87 -0
  101. package/dist/pairing-DWllbSbO.js +4 -0
  102. package/dist/pc-access-Ly-uA8mn.js +8 -0
  103. package/dist/pc-access-NxBvTrRj.js +819 -0
  104. package/dist/pending-approval-DIHvwwWS.js +22 -0
  105. package/dist/puppeteer-2o3QOwAy.js +2 -2
  106. package/dist/puppeteer-BYTMp3BI.js +2 -2
  107. package/dist/puppeteer-DQ45qwWk.js +2 -2
  108. package/dist/reminders-store-D79qdfN0.js +58 -0
  109. package/dist/renderer-pqlDRKbH.js +225 -0
  110. package/dist/rules-BooT_qFP.js +103 -0
  111. package/dist/run-main.js +289 -1031
  112. package/dist/runner-D1rjuMTJ.js +810 -0
  113. package/dist/sdk/index.js +2 -2
  114. package/dist/sdk/index.mjs +2 -2
  115. package/dist/security-C-5URby1.js +73 -0
  116. package/dist/security-_xve79aq.js +4 -0
  117. package/dist/server-0kgyELx4.js +1047 -0
  118. package/dist/server-BIuTobTC.js +4 -0
  119. package/dist/server-BRlCEjyT.js +1047 -0
  120. package/dist/server-CCI1hv45.js +2 -2
  121. package/dist/server-DU9POoWc.js +4 -0
  122. package/dist/session-store-CujxByI6.js +113 -0
  123. package/dist/session-store-qpJUg2M1.js +5 -0
  124. package/dist/sessions-tools-CB2qbwIk.js +5 -0
  125. package/dist/sessions-tools-DHMaTZIs.js +95 -0
  126. package/dist/skill-loader-BkceKkIg.js +7 -0
  127. package/dist/skill-loader-DhgIwK4J.js +159 -0
  128. package/dist/skill-runtime--LqxWrp5.js +102 -0
  129. package/dist/skill-runtime-C5l0Tgt-.js +5 -0
  130. package/dist/skill-runtime-DsXK_HYG.js +102 -0
  131. package/dist/skill-runtime-IVTiqrMR.js +5 -0
  132. package/dist/src-BEVLgaF1.js +63 -0
  133. package/dist/src-Bgu_OxTQ.js +458 -0
  134. package/dist/src-Bq-oKt7Z.js +458 -0
  135. package/dist/src-DWCUhnD4.js +20 -0
  136. package/dist/src-cfRTjFef.js +63 -0
  137. package/dist/sub-agent-tools-BD9DF8_g.js +39 -0
  138. package/dist/sub-agent-tools-V7b3T9_s.js +39 -0
  139. package/dist/tool-policy-DNvNRnve.js +189 -0
  140. package/dist/tts-elevenlabs-BUOGKL-k.js +61 -0
  141. package/dist/update-check-BD4qH7Am.js +81 -0
  142. package/dist/vision-DRq-f-Dj.js +121 -0
  143. package/dist/vision-tools-CFZEpQKm.js +5 -0
  144. package/dist/vision-tools-CQnBI9aa.js +51 -0
  145. package/dist/voice-transcription-CgWq54hn.js +138 -0
  146. package/dist/website-watch-tools-Bk_TnwuE.js +5 -0
  147. package/dist/website-watch-tools-DraMPxdl.js +139 -0
  148. package/package.json +1 -1
package/dist/run-main.js CHANGED
@@ -1,17 +1,20 @@
1
1
  const require_chunk = require('./chunk-jS-bbMI5.js');
2
- const require_paths = require('./paths-AIyBxIzm.js');
3
- const require_paths$1 = require('./paths-DPovhojT.js');
4
- require('./env-resolve-BzDlV2CS.js');
5
- const require_onboard = require('./onboard-DnegOHMh.js');
6
- require('./server-CCI1hv45.js');
2
+ require('./paths-AIyBxIzm.js');
3
+ require('./paths-DPovhojT.js');
4
+ require('./env-resolve-szSWl0UF.js');
5
+ const require_onboard = require('./onboard-Bd_wsYdi.js');
6
+ require('./server-BRlCEjyT.js');
7
7
  require('./theme-LUTKWUWd.js');
8
- const require_manager = require('./manager-DWQSp1oL.js');
9
- const require_manager$1 = require('./manager-C4ZdCiPx.js');
10
- const require_memory = require('./memory-DvsoY6nv.js');
11
- const require_loader = require('./loader-BR-QFJOm.js');
12
- const require_pairing = require('./pairing-tNnYsLWG.js');
13
- const require_security = require('./security-CVzgwvDN.js');
14
- const require_developer_keys = require('./developer-keys-BNo6wlFV.js');
8
+ const require_hub = require('./hub-FrPTA33j.js');
9
+ const require_manager = require('./manager-Dm8nrMFx.js');
10
+ const require_manager$1 = require('./manager-Cwzj7w5R.js');
11
+ const require_memory = require('./memory-BVFGkxxK.js');
12
+ const require_loader = require('./loader-CISCqBto.js');
13
+ const require_agents_routing = require('./agents-routing-683Q2JGp.js');
14
+ const require_pairing = require('./pairing-DU0_J28n.js');
15
+ const require_doctor = require('./doctor-3oi89QIc.js');
16
+ const require_security = require('./security-C-5URby1.js');
17
+ const require_developer_keys = require('./developer-keys-JaJK3T27.js');
15
18
  const commander = require_chunk.__toESM(require("commander"));
16
19
  const chalk = require_chunk.__toESM(require("chalk"));
17
20
  const inquirer = require_chunk.__toESM(require("inquirer"));
@@ -21,505 +24,9 @@ const path = require_chunk.__toESM(require("path"));
21
24
  const os = require_chunk.__toESM(require("os"));
22
25
  const child_process = require_chunk.__toESM(require("child_process"));
23
26
  const util = require_chunk.__toESM(require("util"));
24
- const http = require_chunk.__toESM(require("http"));
25
- const https = require_chunk.__toESM(require("https"));
26
- const readline = require_chunk.__toESM(require("readline"));
27
- const tar = require_chunk.__toESM(require("tar"));
28
27
  const fs = require_chunk.__toESM(require("fs"));
29
- const net = require_chunk.__toESM(require("net"));
30
-
31
- //#region src/skills/clawhub.ts
32
- require_paths$1.init_paths();
33
- const CLAWHUB_API = process.env.CLAWHUB_API_URL || "https://clawhub.com";
34
- const WORKSPACE_SKILLS$1 = path.default.join(require_paths.getHyperClawDir(), "workspace", "skills");
35
- async function searchSkills(query, category) {
36
- const q = new URLSearchParams({ q: query });
37
- if (category) q.set("category", category);
38
- const url = `${CLAWHUB_API}/api/skills/search?${q}`;
39
- try {
40
- const body = await fetchJson(url);
41
- return Array.isArray(body.skills) ? body.skills : Array.isArray(body) ? body : [];
42
- } catch (e) {
43
- return [];
44
- }
45
- }
46
- async function installSkill(skillId, version) {
47
- const ver = version ? `@${version}` : "";
48
- const url = `${CLAWHUB_API}/api/skills/${encodeURIComponent(skillId)}/download${ver}`;
49
- try {
50
- const body = await fetchJson(url);
51
- const tarballUrl = body.url || body.tarball;
52
- if (!tarballUrl) throw new Error("No download URL in registry response");
53
- await fs_extra.default.ensureDir(WORKSPACE_SKILLS$1);
54
- const destDir = path.default.join(WORKSPACE_SKILLS$1, skillId);
55
- await fs_extra.default.ensureDir(destDir);
56
- if (body.content || body.skillMarkdown) {
57
- const content = body.content || body.skillMarkdown;
58
- await fs_extra.default.writeFile(path.default.join(destDir, "SKILL.md"), content, "utf8");
59
- return destDir;
60
- }
61
- const tarballBuffer = await fetchBuffer(tarballUrl);
62
- const extractDir = path.default.join(path.default.dirname(destDir), `.skill-extract-${skillId}-${Date.now()}`);
63
- await fs_extra.default.ensureDir(extractDir);
64
- try {
65
- const tarPath = path.default.join(extractDir, "skill.tar.gz");
66
- await fs_extra.default.writeFile(tarPath, tarballBuffer);
67
- await tar.default.x({
68
- file: tarPath,
69
- cwd: extractDir
70
- });
71
- await fs_extra.default.remove(tarPath);
72
- const entries = await fs_extra.default.readdir(extractDir);
73
- let skillDir = extractDir;
74
- const topSkill = path.default.join(extractDir, "SKILL.md");
75
- if (!await fs_extra.default.pathExists(topSkill)) {
76
- const sub = entries.find((e) => e !== "package.json" && !e.startsWith("."));
77
- if (sub) {
78
- const subPath = path.default.join(extractDir, sub);
79
- if ((await fs_extra.default.stat(subPath)).isDirectory() && await fs_extra.default.pathExists(path.default.join(subPath, "SKILL.md"))) skillDir = subPath;
80
- }
81
- }
82
- await fs_extra.default.copy(skillDir, destDir, { filter: (src) => !src.includes("node_modules") });
83
- if (!await fs_extra.default.pathExists(path.default.join(destDir, "SKILL.md"))) throw new Error("Tarball did not contain SKILL.md");
84
- return destDir;
85
- } finally {
86
- await fs_extra.default.remove(extractDir).catch(() => {});
87
- }
88
- } catch (e) {
89
- if (e.message?.includes("ENOTFOUND") || e.code === "ENOTFOUND") throw new Error(`ClawHub registry unavailable. Install manually: mkdir -p ~/.hyperclaw/workspace/skills/${skillId} && add SKILL.md`);
90
- throw e;
91
- }
92
- }
93
- async function listInstalledFromClawHub() {
94
- if (!await fs_extra.default.pathExists(WORKSPACE_SKILLS$1)) return [];
95
- const dirs = await fs_extra.default.readdir(WORKSPACE_SKILLS$1);
96
- const out = [];
97
- for (const id of dirs) {
98
- const p = path.default.join(WORKSPACE_SKILLS$1, id, "SKILL.md");
99
- if (await fs_extra.default.pathExists(p)) out.push(id);
100
- }
101
- return out;
102
- }
103
- function fetchBuffer(url) {
104
- return new Promise((resolve, reject) => {
105
- const parsed = new URL(url);
106
- const mod = parsed.protocol === "https:" ? https.default : http.default;
107
- const req = mod.request({
108
- hostname: parsed.hostname,
109
- port: parsed.port || (parsed.protocol === "https:" ? 443 : 80),
110
- path: parsed.pathname + parsed.search,
111
- method: "GET",
112
- headers: { "User-Agent": "HyperClaw/4.0.1" }
113
- }, (res) => {
114
- const chunks = [];
115
- res.on("data", (c) => chunks.push(c));
116
- res.on("end", () => resolve(Buffer.concat(chunks)));
117
- });
118
- req.on("error", reject);
119
- req.setTimeout(3e4, () => {
120
- req.destroy();
121
- reject(new Error("Tarball download timeout"));
122
- });
123
- req.end();
124
- });
125
- }
126
- function fetchJson(url) {
127
- return new Promise((resolve, reject) => {
128
- const parsed = new URL(url);
129
- const req = https.default.request({
130
- hostname: parsed.hostname,
131
- port: 443,
132
- path: parsed.pathname + parsed.search,
133
- method: "GET",
134
- headers: { "User-Agent": "HyperClaw/4.0.1" }
135
- }, (res) => {
136
- let data = "";
137
- res.on("data", (c) => data += c);
138
- res.on("end", () => {
139
- try {
140
- resolve(JSON.parse(data));
141
- } catch {
142
- reject(new Error("Invalid JSON from registry"));
143
- }
144
- });
145
- });
146
- req.on("error", reject);
147
- req.setTimeout(15e3, () => {
148
- req.destroy();
149
- reject(new Error("Timeout"));
150
- });
151
- req.end();
152
- });
153
- }
154
-
155
- //#endregion
156
- //#region src/plugins/hub.ts
157
- require_paths$1.init_paths();
158
- const SKILL_REGISTRY = [
159
- {
160
- id: "web-search",
161
- name: "Web Search (Tavily)",
162
- version: "2.1.0",
163
- description: "Real-time web search via Tavily API. Powers research and news queries.",
164
- author: "hyperclaw-team",
165
- category: "utility",
166
- downloads: 48200,
167
- rating: 4.8,
168
- risk: "clean",
169
- requiresKeys: ["TAVILY_API_KEY"],
170
- tags: [
171
- "search",
172
- "internet",
173
- "tavily"
174
- ]
175
- },
176
- {
177
- id: "calendar",
178
- name: "Google Calendar",
179
- version: "1.4.0",
180
- description: "Read and create Google Calendar events via OAuth.",
181
- author: "hyperclaw-team",
182
- category: "productivity",
183
- downloads: 32100,
184
- rating: 4.6,
185
- risk: "clean",
186
- requiresKeys: ["GOOGLE_CALENDAR_CREDS"],
187
- tags: [
188
- "calendar",
189
- "schedule",
190
- "google"
191
- ],
192
- npmPackage: "googleapis"
193
- },
194
- {
195
- id: "github",
196
- name: "GitHub Integration",
197
- version: "1.2.0",
198
- description: "Create issues, PRs, read repos. Requires GitHub PAT.",
199
- author: "hyperclaw-team",
200
- category: "integration",
201
- downloads: 27800,
202
- rating: 4.7,
203
- risk: "clean",
204
- requiresKeys: ["GITHUB_TOKEN"],
205
- tags: [
206
- "github",
207
- "git",
208
- "code"
209
- ],
210
- npmPackage: "@octokit/rest"
211
- },
212
- {
213
- id: "home-assistant",
214
- name: "Home Assistant",
215
- version: "1.5.0",
216
- description: "Control smart home devices via Home Assistant REST API.",
217
- author: "hyperclaw-team",
218
- category: "automation",
219
- downloads: 19400,
220
- rating: 4.5,
221
- risk: "clean",
222
- requiresKeys: ["HA_URL", "HA_TOKEN"],
223
- tags: [
224
- "smart-home",
225
- "iot",
226
- "automation"
227
- ]
228
- },
229
- {
230
- id: "code-executor",
231
- name: "Code Executor (Sandbox)",
232
- version: "3.0.1",
233
- description: "Execute Python/JS/Bash code in a sandboxed Docker container.",
234
- author: "hyperclaw-team",
235
- category: "utility",
236
- downloads: 41e3,
237
- rating: 4.9,
238
- risk: "clean",
239
- tags: [
240
- "code",
241
- "sandbox",
242
- "python",
243
- "bash"
244
- ],
245
- npmPackage: "dockerode"
246
- },
247
- {
248
- id: "translator",
249
- name: "Real-time Translator",
250
- version: "2.0.0",
251
- description: "DeepL + Google Translate integration for 90+ languages.",
252
- author: "hyperclaw-team",
253
- category: "utility",
254
- downloads: 38500,
255
- rating: 4.7,
256
- risk: "clean",
257
- requiresKeys: ["DEEPL_API_KEY"],
258
- tags: [
259
- "translate",
260
- "language",
261
- "deepl"
262
- ],
263
- installed: true
264
- },
265
- {
266
- id: "reminders",
267
- name: "Smart Reminders",
268
- version: "2.1.0",
269
- description: "Natural language reminders with cron scheduling.",
270
- author: "hyperclaw-team",
271
- category: "productivity",
272
- downloads: 29e3,
273
- rating: 4.6,
274
- risk: "clean",
275
- tags: [
276
- "reminders",
277
- "cron",
278
- "schedule"
279
- ],
280
- installed: true
281
- },
282
- {
283
- id: "weather",
284
- name: "Weather Forecast",
285
- version: "1.3.0",
286
- description: "OpenWeatherMap integration. Current + 7-day forecast.",
287
- author: "hyperclaw-team",
288
- category: "utility",
289
- downloads: 22100,
290
- rating: 4.4,
291
- risk: "clean",
292
- requiresKeys: ["OPENWEATHER_API_KEY"],
293
- tags: ["weather", "forecast"]
294
- },
295
- {
296
- id: "stealth-browser",
297
- name: "Stealth Browser",
298
- version: "1.0.3",
299
- description: "Headless browser with fingerprint evasion. Can bypass bot detection.",
300
- author: "unknown-dev",
301
- category: "utility",
302
- downloads: 3200,
303
- rating: 3.1,
304
- risk: "suspicious",
305
- riskReason: "Fingerprint evasion may violate ToS on some sites. VirusTotal: 2/72 engines flagged.",
306
- tags: [
307
- "browser",
308
- "puppeteer",
309
- "stealth"
310
- ],
311
- npmPackage: "puppeteer-extra-plugin-stealth"
312
- },
313
- {
314
- id: "db-reader",
315
- name: "Database Reader",
316
- version: "1.1.0",
317
- description: "Read from PostgreSQL/MySQL/SQLite databases.",
318
- author: "hyperclaw-team",
319
- category: "integration",
320
- downloads: 15600,
321
- rating: 4.5,
322
- risk: "clean",
323
- requiresKeys: ["DATABASE_URL"],
324
- tags: [
325
- "database",
326
- "sql",
327
- "postgres"
328
- ],
329
- npmPackage: "pg"
330
- },
331
- {
332
- id: "keylogger-util",
333
- name: "Input Monitor Pro",
334
- version: "0.9.1",
335
- description: "Monitors keyboard events for automation triggers.",
336
- author: "shadowy-scripts",
337
- category: "automation",
338
- downloads: 890,
339
- rating: 1.8,
340
- risk: "dangerous",
341
- riskReason: "Detected keylogging behavior. VirusTotal: 31/72 engines flagged as malware.",
342
- tags: ["keyboard", "monitor"]
343
- }
344
- ];
345
- const WORKSPACE_SKILLS = () => path.default.join(require_paths.getHyperClawDir(), "workspace", "skills");
346
- var SkillHub = class {
347
- installed = /* @__PURE__ */ new Set();
348
- /** Sync installed set from workspace disk (persisted installs). */
349
- async refreshInstalledFromDisk() {
350
- const ids = await listInstalledFromClawHub();
351
- this.installed = new Set(ids);
352
- }
353
- /** Persist bundled skill to workspace so it survives restarts and is loaded by skill-loader. */
354
- async persistBundledSkill(skill) {
355
- const destDir = path.default.join(WORKSPACE_SKILLS(), skill.id);
356
- await fs_extra.default.ensureDir(destDir);
357
- const skillPath = path.default.join(destDir, "SKILL.md");
358
- const repoSkillPath = path.default.join(process.cwd(), "skills", skill.id, "SKILL.md");
359
- const altRepoPath = path.default.join(__dirname, "..", "..", "skills", skill.id, "SKILL.md");
360
- if (await fs_extra.default.pathExists(repoSkillPath)) await fs_extra.default.copy(repoSkillPath, skillPath);
361
- else if (await fs_extra.default.pathExists(altRepoPath)) await fs_extra.default.copy(altRepoPath, skillPath);
362
- else {
363
- const content = `# ${skill.name}\n\n${skill.description}\n\n## Usage\n\nWhen the user needs ${skill.description.toLowerCase()}, use this skill.${skill.requiresKeys?.length ? `\n\nRequires: ${skill.requiresKeys.join(", ")}` : ""}\n`;
364
- await fs_extra.default.writeFile(skillPath, content, "utf8");
365
- }
366
- this.installed.add(skill.id);
367
- }
368
- async showHub(hideSuspicious = false) {
369
- await this.refreshInstalledFromDisk();
370
- console.log(chalk.default.bold.cyan("\n╔═══════════════════════════════════════════╗"));
371
- console.log(chalk.default.bold.cyan("║ 🧩 HYPERCLAW SKILL HUB ║"));
372
- console.log(chalk.default.bold.cyan("╚═══════════════════════════════════════════╝\n"));
373
- const skills = hideSuspicious ? SKILL_REGISTRY.filter((s) => s.risk === "clean") : SKILL_REGISTRY;
374
- for (const skill of skills) this.printSkillCard(skill);
375
- }
376
- printSkillCard(skill) {
377
- const riskBadge = {
378
- "clean": chalk.default.green("✔ CLEAN"),
379
- "suspicious": chalk.default.yellow("⚠ SUSPICIOUS"),
380
- "dangerous": chalk.default.red("✖ DANGEROUS")
381
- }[skill.risk];
382
- const instBadge = this.installed.has(skill.id) ? chalk.default.green("[installed]") : chalk.default.gray("[available]");
383
- const stars = "★".repeat(Math.round(skill.rating)) + "☆".repeat(5 - Math.round(skill.rating));
384
- console.log(` ${chalk.default.bold(skill.name)} ${chalk.default.gray(`v${skill.version}`)} ${instBadge}`);
385
- console.log(` ${chalk.default.gray(skill.description)}`);
386
- console.log(` ${riskBadge} ${chalk.default.yellow(stars)} ${chalk.default.gray(`${(skill.downloads / 1e3).toFixed(1)}k downloads`)}`);
387
- if (skill.riskReason) console.log(` ${chalk.default.yellow("⚠")} ${chalk.default.yellow(skill.riskReason)}`);
388
- if (skill.requiresKeys?.length) console.log(` 🔑 Requires: ${chalk.default.cyan(skill.requiresKeys.join(", "))}`);
389
- console.log();
390
- }
391
- async install(skillId, force = false) {
392
- const skill = SKILL_REGISTRY.find((s) => s.id === skillId);
393
- if (!skill) {
394
- console.log(chalk.default.red(`❌ Skill not found: ${skillId}`));
395
- return;
396
- }
397
- if (skill.risk === "dangerous" && !force) {
398
- console.log(chalk.default.red(`\n🚨 DANGEROUS SKILL BLOCKED: ${skill.name}`));
399
- console.log(chalk.default.red(` ${skill.riskReason}`));
400
- console.log(chalk.default.gray(" Use --force to override (NOT RECOMMENDED)\n"));
401
- return;
402
- }
403
- if (skill.risk === "suspicious" && !force) {
404
- console.log(chalk.default.yellow(`\n⚠️ SUSPICIOUS SKILL: ${skill.name}`));
405
- console.log(chalk.default.yellow(` ${skill.riskReason}`));
406
- console.log(chalk.default.gray(" Use --force to install anyway\n"));
407
- return;
408
- }
409
- const spinner = (0, ora.default)(`Installing ${skill.name}...`).start();
410
- if (skill.npmPackage) {
411
- spinner.text = `Installing npm package: ${skill.npmPackage}`;
412
- await new Promise((r) => setTimeout(r, 800));
413
- }
414
- await this.persistBundledSkill(skill);
415
- spinner.succeed(`${skill.name} installed ✓`);
416
- if (skill.requiresKeys?.length) {
417
- console.log(chalk.default.yellow(`\n📋 Required API keys to activate:`));
418
- skill.requiresKeys.forEach((k) => {
419
- console.log(chalk.default.cyan(` hyperclaw config set-key ${k}`));
420
- });
421
- }
422
- console.log();
423
- }
424
- async scan(skillId) {
425
- const skill = SKILL_REGISTRY.find((s) => s.id === skillId);
426
- if (!skill) return;
427
- const spinner = (0, ora.default)(`Scanning ${skill.name}...`).start();
428
- const stages = [
429
- "Checking manifest...",
430
- "Scanning for malicious patterns...",
431
- "Checking VirusTotal...",
432
- "Verifying author..."
433
- ];
434
- for (const stage of stages) {
435
- spinner.text = stage;
436
- await new Promise((r) => setTimeout(r, 600));
437
- }
438
- const result = {
439
- "clean": chalk.default.green("✅ All green — safe to install"),
440
- "suspicious": chalk.default.yellow("⚠️ Suspicious patterns detected — proceed with caution"),
441
- "dangerous": chalk.default.red("🚨 Malicious patterns detected — do NOT install")
442
- }[skill.risk];
443
- spinner.stop();
444
- console.log(`\n🔬 Scan results for ${chalk.default.bold(skill.name)}:`);
445
- console.log(` ${result}`);
446
- if (skill.riskReason) console.log(chalk.default.gray(` Detail: ${skill.riskReason}`));
447
- console.log();
448
- }
449
- async checkEligibility() {
450
- const spinner = (0, ora.default)("Checking system eligibility...").start();
451
- await new Promise((r) => setTimeout(r, 1e3));
452
- spinner.succeed("Eligibility check complete");
453
- console.log(chalk.default.green("\n✅ All installed skills are eligible on this system\n"));
454
- }
455
- async getInstalled() {
456
- await this.refreshInstalledFromDisk();
457
- const ids = this.installed;
458
- const fromRegistry = SKILL_REGISTRY.filter((s) => ids.has(s.id));
459
- const fromWorkspace = (await listInstalledFromClawHub()).filter((id) => !SKILL_REGISTRY.some((s) => s.id === id));
460
- return [...fromRegistry, ...fromWorkspace.map((id) => ({
461
- id,
462
- name: id,
463
- version: "0",
464
- description: "",
465
- author: "",
466
- category: "utility",
467
- downloads: 0,
468
- rating: 0,
469
- risk: "clean",
470
- tags: []
471
- }))];
472
- }
473
- /** ClawHub integration: search remote registry, fallback to bundled when remote unavailable */
474
- async searchClawHub(query, category) {
475
- let remote = await searchSkills(query, category);
476
- if (remote.length === 0) {
477
- const q = (query || "").toLowerCase();
478
- const filtered = SKILL_REGISTRY.filter((s) => !q || s.id.includes(q) || s.name.toLowerCase().includes(q) || s.tags.some((t) => t.includes(q))).filter((s) => !category || s.category === category);
479
- remote = filtered.map((s) => ({
480
- id: s.id,
481
- name: s.name,
482
- author: s.author,
483
- description: s.description,
484
- rating: s.rating,
485
- downloads: s.downloads,
486
- version: s.version,
487
- categories: [s.category]
488
- }));
489
- }
490
- return remote;
491
- }
492
- /** ClawHub integration: install from remote registry */
493
- async installFromClawHub(skillId, version) {
494
- return installSkill(skillId, version);
495
- }
496
- /** ClawHub marketplace UX: unified browse (bundled + remote) */
497
- async showMarketplace(opts) {
498
- await this.refreshInstalledFromDisk();
499
- const installedClawHub = await listInstalledFromClawHub();
500
- const bundled = (opts?.hideSuspicious ? SKILL_REGISTRY.filter((s) => s.risk === "clean") : SKILL_REGISTRY).filter((s) => !opts?.category || s.category === opts.category);
501
- console.log(chalk.default.bold.cyan("\n╔══════════════════════════════════════════════════════════╗"));
502
- console.log(chalk.default.bold.cyan("║ 🧩 CLAWHUB MARKETPLACE ║"));
503
- console.log(chalk.default.bold.cyan("╚══════════════════════════════════════════════════════════╝\n"));
504
- if (installedClawHub.length > 0) {
505
- console.log(chalk.default.bold.green(" Installed (ClawHub):"));
506
- installedClawHub.forEach((id) => console.log(chalk.default.gray(` • ${id}`)));
507
- console.log();
508
- }
509
- console.log(chalk.default.bold(" Bundled skills:"));
510
- for (const skill of bundled) {
511
- const inst = this.installed.has(skill.id) || installedClawHub.includes(skill.id);
512
- const badge = inst ? chalk.default.green("✓ installed") : chalk.default.cyan("hyperclaw skill install " + skill.id);
513
- const risk = skill.risk === "clean" ? "" : chalk.default.yellow(` [${skill.risk}]`);
514
- console.log(` ${chalk.default.bold(skill.name)} ${chalk.default.gray(`v${skill.version}`)} ${badge}${risk}`);
515
- console.log(chalk.default.gray(` ${skill.description}`));
516
- }
517
- console.log(chalk.default.gray("\n Search remote: hyperclaw skill search <query>"));
518
- console.log(chalk.default.gray(" Install: hyperclaw skill install <id>\n"));
519
- }
520
- };
28
+ const readline = require_chunk.__toESM(require("readline"));
521
29
 
522
- //#endregion
523
30
  //#region src/cli/dashboard.ts
524
31
  var Dashboard = class {
525
32
  async launch(live) {
@@ -533,7 +40,7 @@ var Dashboard = class {
533
40
  async drawDashboard() {
534
41
  const cfg = await new require_onboard.ConfigStore().load();
535
42
  const gm = new require_onboard.GatewayManager();
536
- const hub = new SkillHub();
43
+ const hub = new require_hub.SkillHub();
537
44
  const installed = await hub.getInstalled();
538
45
  const port = cfg?.gateway?.port || 1515;
539
46
  const agent = cfg?.identity?.agentName || "Hyper";
@@ -552,7 +59,7 @@ var Dashboard = class {
552
59
  return c(`║ `) + content + " ".repeat(pad) + c(`║`);
553
60
  };
554
61
  console.log(c(`╔${line}╗`));
555
- console.log(c(`║`) + chalk.default.bold.hex("#06b6d4")(`${"🦅 HYPERCLAW v4.0.1 — GATEWAY DASHBOARD".padStart(45).padEnd(w)}`) + c(`║`));
62
+ console.log(c(`║`) + chalk.default.bold.hex("#06b6d4")(`${"🦅 HYPERCLAW v4.0.2 — GATEWAY DASHBOARD".padStart(45).padEnd(w)}`) + c(`║`));
556
63
  console.log(c(`╠${line}╣`));
557
64
  console.log(row(`${statusDot} Gateway ${statusText} ${chalk.default.gray("│")} ws://localhost:${port} ${chalk.default.gray("│")} Agent: ${c(agent)}`));
558
65
  console.log(row(`${c("◆")} Model ${chalk.default.gray(model.slice(0, 30))} ${chalk.default.gray("│")} User: ${c(user)}`));
@@ -633,7 +140,7 @@ async function recordAudio(outFile, seconds) {
633
140
  async function transcribeWhisper(filePath, lang) {
634
141
  const apiKey = process.env.OPENAI_API_KEY || process.env.ANTHROPIC_API_KEY;
635
142
  if (!apiKey) throw new Error("No OPENAI_API_KEY set");
636
- const FormData = (await Promise.resolve().then(() => require_chunk.__toDynamicImportESM()(require("./form_data-fpopMWNo.js"))).catch(() => null))?.default;
143
+ const FormData = (await Promise.resolve().then(() => require_chunk.__toDynamicImportESM()(require("./form_data-B_hIUrxU.js"))).catch(() => null))?.default;
637
144
  if (!FormData) throw new Error("form-data not installed");
638
145
  const form = new FormData();
639
146
  form.append("file", fs.createReadStream(filePath), {
@@ -777,283 +284,6 @@ var VoiceEngine = class {
777
284
  }
778
285
  };
779
286
 
780
- //#endregion
781
- //#region src/routing/agents-routing.ts
782
- var AgentRouter = class {
783
- stateFile;
784
- agents = [];
785
- constructor() {
786
- this.stateFile = path.default.join(os.default.homedir(), ".hyperclaw", "agents.json");
787
- this.load();
788
- }
789
- load() {
790
- try {
791
- this.agents = fs_extra.default.readJsonSync(this.stateFile);
792
- } catch {
793
- this.agents = [{
794
- workspace: path.default.join(os.default.homedir(), ".hyperclaw", "workspace"),
795
- name: "default",
796
- model: void 0,
797
- bindings: []
798
- }];
799
- }
800
- }
801
- save() {
802
- fs_extra.default.ensureDirSync(path.default.dirname(this.stateFile));
803
- fs_extra.default.writeJsonSync(this.stateFile, this.agents, { spaces: 2 });
804
- }
805
- listBindings() {
806
- console.log(chalk.default.bold.cyan("\n 🦅 AGENT BINDINGS\n"));
807
- if (this.agents.length === 0) {
808
- console.log(chalk.default.gray(" No agents configured."));
809
- return;
810
- }
811
- for (const agent of this.agents) {
812
- console.log(` ${chalk.default.bold(agent.name)} ${chalk.default.gray(agent.workspace)}`);
813
- if (agent.bindings.length === 0) console.log(` ${chalk.default.gray("No channel bindings — receives from all channels")}`);
814
- else for (const b of agent.bindings) {
815
- const acct = b.accountId ? chalk.default.gray(`@${b.accountId}`) : chalk.default.gray("(all accounts)");
816
- const role = b.role === "primary" ? chalk.default.green("[primary]") : chalk.default.gray("[secondary]");
817
- console.log(` ${chalk.default.cyan(b.channelId)} ${acct} ${role}`);
818
- }
819
- console.log();
820
- }
821
- }
822
- async bind() {
823
- console.log(chalk.default.cyan("\n Bind a channel to an agent workspace\n"));
824
- const { channel, workspace, role } = await inquirer.default.prompt([
825
- {
826
- type: "input",
827
- name: "channel",
828
- message: "Channel ID (e.g. telegram, discord, slack):",
829
- validate: (v) => v.trim().length > 0 || "Required"
830
- },
831
- {
832
- type: "input",
833
- name: "workspace",
834
- message: "Agent workspace (directory or name):",
835
- default: "default"
836
- },
837
- {
838
- type: "list",
839
- name: "role",
840
- message: "Binding role:",
841
- choices: [{
842
- name: "primary — routes all traffic from this channel",
843
- value: "primary"
844
- }, {
845
- name: "secondary — fallback if primary is busy",
846
- value: "secondary"
847
- }]
848
- }
849
- ]);
850
- let agent = this.agents.find((a) => a.name === workspace || a.workspace === workspace);
851
- if (!agent) {
852
- agent = {
853
- workspace,
854
- name: workspace,
855
- bindings: []
856
- };
857
- this.agents.push(agent);
858
- }
859
- agent.bindings.push({
860
- channelId: channel,
861
- agentWorkspace: agent.workspace,
862
- role,
863
- createdAt: (/* @__PURE__ */ new Date()).toISOString()
864
- });
865
- this.save();
866
- console.log(chalk.default.green(`\n ✔ Bound ${channel} → ${workspace} (${role})\n`));
867
- }
868
- async unbind() {
869
- const allBindings = [];
870
- for (const agent of this.agents) for (const b of agent.bindings) allBindings.push({
871
- agent: agent.name,
872
- channel: b.channelId
873
- });
874
- if (allBindings.length === 0) {
875
- console.log(chalk.default.gray("\n No bindings to remove.\n"));
876
- return;
877
- }
878
- const { toRemove } = await inquirer.default.prompt([{
879
- type: "checkbox",
880
- name: "toRemove",
881
- message: "Select bindings to remove:",
882
- choices: allBindings.map((b) => ({
883
- name: `${b.channel} → ${b.agent}`,
884
- value: b
885
- }))
886
- }]);
887
- for (const { agent: agentName, channel } of toRemove) {
888
- const agent = this.agents.find((a) => a.name === agentName);
889
- if (agent) agent.bindings = agent.bindings.filter((b) => b.channelId !== channel);
890
- }
891
- this.save();
892
- console.log(chalk.default.green(`\n ✔ Removed ${toRemove.length} binding(s)\n`));
893
- }
894
- };
895
-
896
- //#endregion
897
- //#region src/commands/doctor.ts
898
- async function isPortOpen(port) {
899
- return new Promise((resolve) => {
900
- const s = new net.default.Socket();
901
- s.setTimeout(500);
902
- s.on("connect", () => {
903
- s.destroy();
904
- resolve(true);
905
- });
906
- s.on("error", () => resolve(false));
907
- s.on("timeout", () => resolve(false));
908
- try {
909
- s.connect(port, "127.0.0.1");
910
- } catch {
911
- resolve(false);
912
- }
913
- });
914
- }
915
- async function runDoctor(fix = false) {
916
- const spinner = (0, ora.default)("Running health checks...").start();
917
- await new Promise((r) => setTimeout(r, 800));
918
- spinner.stop();
919
- const configDir = path.default.join(os.default.homedir(), ".hyperclaw");
920
- const configFile = path.default.join(configDir, "config.json");
921
- const agentsFile = path.default.join(configDir, "AGENTS.md");
922
- const authFile = path.default.join(configDir, "auth.json");
923
- const pairingFile = path.default.join(configDir, "pairing-store.json");
924
- let cfg = null;
925
- try {
926
- cfg = fs_extra.default.readJsonSync(configFile);
927
- } catch {}
928
- const issues = [];
929
- if (!cfg) issues.push({
930
- id: "no-config",
931
- severity: "error",
932
- title: "No configuration found",
933
- detail: "Run: hyperclaw init",
934
- fixable: false
935
- });
936
- else {
937
- const hasToken = !!cfg.gateway?.authToken;
938
- issues.push({
939
- id: "gateway-token",
940
- severity: hasToken ? "ok" : "warn",
941
- title: hasToken ? "Gateway auth token set" : "Gateway auth token missing",
942
- detail: hasToken ? "Token is configured" : "Set a strong token in gateway config",
943
- fixable: !hasToken,
944
- fix: async () => {
945
- const crypto = await import("crypto");
946
- cfg.gateway = cfg.gateway || {};
947
- cfg.gateway.authToken = crypto.randomBytes(32).toString("hex");
948
- fs_extra.default.writeJsonSync(configFile, cfg, { spaces: 2 });
949
- console.log(chalk.default.green(" ✔ Generated and saved gateway auth token"));
950
- }
951
- });
952
- const channels = cfg.channels || [];
953
- const channelConfigs = cfg.channelConfigs || {};
954
- for (const ch of channels) {
955
- const dmPolicy = channelConfigs[ch]?.dmPolicy?.policy;
956
- if (dmPolicy === "open") issues.push({
957
- id: `dm-open-${ch}`,
958
- severity: "warn",
959
- title: `DM policy is "open" on ${ch}`,
960
- detail: `Anyone can DM your agent on ${ch}. Consider using "pairing" or "allowlist".`,
961
- fixable: false
962
- });
963
- if (dmPolicy === "allowlist") {
964
- const allowFrom = channelConfigs[ch]?.dmPolicy?.allowFrom || [];
965
- if (allowFrom.length === 0) issues.push({
966
- id: `dm-empty-allowlist-${ch}`,
967
- severity: "error",
968
- title: `Empty allowlist on ${ch} — DMs will be silently dropped`,
969
- detail: `channel.${ch}.dmPolicy.allowFrom is empty. Add users or change policy.`,
970
- fixable: true,
971
- fix: async () => {
972
- try {
973
- const pairingEntries = fs_extra.default.readJsonSync(pairingFile);
974
- const approved = pairingEntries.filter((e) => e.channelId === ch && e.status === "approved" && e.userId);
975
- if (approved.length > 0) {
976
- channelConfigs[ch].dmPolicy.allowFrom = approved.map((e) => e.userId);
977
- cfg.channelConfigs = channelConfigs;
978
- fs_extra.default.writeJsonSync(configFile, cfg, { spaces: 2 });
979
- console.log(chalk.default.green(` ✔ Restored ${approved.length} user(s) from pairing store to ${ch} allowlist`));
980
- }
981
- } catch {}
982
- }
983
- });
984
- }
985
- }
986
- const hasApiKey = !!cfg.provider?.apiKey;
987
- const isLocal = cfg.provider?.providerId === "local";
988
- if (!hasApiKey && !isLocal) issues.push({
989
- id: "no-api-key",
990
- severity: "error",
991
- title: "No AI provider API key configured",
992
- detail: "Run: hyperclaw config set-key",
993
- fixable: false
994
- });
995
- else issues.push({
996
- id: "api-key",
997
- severity: "ok",
998
- title: "AI provider key configured",
999
- detail: `Provider: ${cfg.provider?.providerId}`,
1000
- fixable: false
1001
- });
1002
- issues.push({
1003
- id: "agents-md",
1004
- severity: await fs_extra.default.pathExists(agentsFile) ? "ok" : "warn",
1005
- title: await fs_extra.default.pathExists(agentsFile) ? "AGENTS.md exists" : "AGENTS.md missing",
1006
- detail: await fs_extra.default.pathExists(agentsFile) ? agentsFile : "Run: hyperclaw memory init to generate",
1007
- fixable: false
1008
- });
1009
- const port = cfg.gateway?.port || 1515;
1010
- const running = await isPortOpen(port);
1011
- issues.push({
1012
- id: "gateway-running",
1013
- severity: running ? "ok" : "warn",
1014
- title: running ? `Gateway running on port ${port}` : `Gateway not running on port ${port}`,
1015
- detail: running ? `ws://127.0.0.1:${port}` : "Run: hyperclaw daemon start",
1016
- fixable: false
1017
- });
1018
- if (await fs_extra.default.pathExists(authFile)) {
1019
- const stat = await fs_extra.default.stat(authFile);
1020
- const unsafe = (stat.mode & 63) !== 0;
1021
- issues.push({
1022
- id: "auth-permissions",
1023
- severity: unsafe ? "warn" : "ok",
1024
- title: unsafe ? "Auth store has unsafe permissions" : "Auth store permissions OK",
1025
- detail: unsafe ? `chmod 600 ${authFile}` : `Mode: 600`,
1026
- fixable: unsafe,
1027
- fix: async () => {
1028
- await fs_extra.default.chmod(authFile, 384);
1029
- console.log(chalk.default.green(` ✔ Fixed permissions on ${authFile}`));
1030
- }
1031
- });
1032
- }
1033
- }
1034
- console.log(chalk.default.bold.cyan("\n 🩺 HYPERCLAW DOCTOR\n"));
1035
- let errorCount = 0, warnCount = 0;
1036
- for (const issue of issues) {
1037
- const icon = {
1038
- error: chalk.default.red("✖"),
1039
- warn: chalk.default.yellow("⚠"),
1040
- ok: chalk.default.green("✔")
1041
- }[issue.severity];
1042
- console.log(` ${icon} ${chalk.default.white(issue.title)}`);
1043
- console.log(` ${chalk.default.gray(issue.detail)}`);
1044
- if (issue.fixable && fix && issue.fix) await issue.fix();
1045
- else if (issue.fixable && !fix) console.log(chalk.default.gray(" Run with --fix to auto-repair"));
1046
- if (issue.severity === "error") errorCount++;
1047
- if (issue.severity === "warn") warnCount++;
1048
- console.log();
1049
- }
1050
- const total = issues.length;
1051
- const okCount = total - errorCount - warnCount;
1052
- console.log(` ${chalk.default.bold("Summary:")} ${chalk.default.green(`${okCount} ok`)} ${chalk.default.yellow(`${warnCount} warnings`)} ${chalk.default.red(`${errorCount} errors`)}`);
1053
- if (errorCount > 0 || warnCount > 0) console.log(chalk.default.gray("\n Run: hyperclaw doctor --fix to auto-repair fixable issues\n"));
1054
- else console.log(chalk.default.green("\n ✔ All checks passed!\n"));
1055
- }
1056
-
1057
287
  //#endregion
1058
288
  //#region src/commands/message-send.ts
1059
289
  async function sendMessage(opts) {
@@ -2266,7 +1496,7 @@ var init_queue = require_chunk.__esm({ "src/delivery/queue.ts"() {
2266
1496
  //#endregion
2267
1497
  //#region src/cli/run-main.ts
2268
1498
  const program = new commander.Command();
2269
- program.name("hyperclaw").description("⚡ HyperClaw — AI Gateway Platform. The Lobster Evolution 🦅").version("4.0.1");
1499
+ program.name("hyperclaw").description("⚡ HyperClaw — AI Gateway Platform. The Lobster Evolution 🦅").version("4.0.2");
2270
1500
  program.command("init").description("Initialize HyperClaw with interactive wizard").option("-a, --auto-config", "Auto-configure with defaults").option("-d, --daemon", "Install as system daemon").option("-s, --start-now", "Start gateway after setup").action(async (opts) => {
2271
1501
  await new require_onboard.Banner().showNeonBanner(false);
2272
1502
  await new require_onboard.HyperClawWizard().run(opts);
@@ -2275,22 +1505,22 @@ program.command("init").description("Initialize HyperClaw with interactive wizar
2275
1505
  program.command("onboard").description("Full onboarding wizard — preferred setup path").option("--install-daemon", "Auto-install system daemon (starts on boot, grants full PC access)").option("--quick", "Use QuickStart mode (skip advanced options)").action(async (opts) => {
2276
1506
  await new require_onboard.Banner().showNeonBanner(false);
2277
1507
  if (opts.installDaemon) {
2278
- const chalk$13 = require("chalk");
2279
- console.log(chalk$13.yellow("\n ⚠ --install-daemon mode\n"));
2280
- console.log(chalk$13.gray(" The daemon will run as a background system service and will have:\n"));
2281
- console.log(chalk$13.white(" • Full shell / command execution on this machine"));
2282
- console.log(chalk$13.white(" • File system read & write access"));
2283
- console.log(chalk$13.white(" • Network access (gateway WebSocket)"));
2284
- console.log(chalk$13.white(" • Auto-start on every system boot\n"));
2285
- const inquirer$3 = require("inquirer");
2286
- const { confirmed } = await inquirer$3.prompt([{
1508
+ const chalk$10 = require("chalk");
1509
+ console.log(chalk$10.yellow("\n ⚠ --install-daemon mode\n"));
1510
+ console.log(chalk$10.gray(" The daemon will run as a background system service and will have:\n"));
1511
+ console.log(chalk$10.white(" • Full shell / command execution on this machine"));
1512
+ console.log(chalk$10.white(" • File system read & write access"));
1513
+ console.log(chalk$10.white(" • Network access (gateway WebSocket)"));
1514
+ console.log(chalk$10.white(" • Auto-start on every system boot\n"));
1515
+ const inquirer$2 = require("inquirer");
1516
+ const { confirmed } = await inquirer$2.prompt([{
2287
1517
  type: "confirm",
2288
1518
  name: "confirmed",
2289
1519
  message: "I understand and want to continue with full PC access:",
2290
1520
  default: false
2291
1521
  }]);
2292
1522
  if (!confirmed) {
2293
- console.log(chalk$13.gray("\n Cancelled. Run without --install-daemon to choose during setup.\n"));
1523
+ console.log(chalk$10.gray("\n Cancelled. Run without --install-daemon to choose during setup.\n"));
2294
1524
  process.exit(0);
2295
1525
  }
2296
1526
  }
@@ -2332,7 +1562,7 @@ gatewayCmd.command("restart").description("Restart the gateway service").action(
2332
1562
  const dm = new require_onboard.DaemonManager();
2333
1563
  await dm.restart();
2334
1564
  });
2335
- program.command("daemon").description("Manage HyperClaw system service (alias: gateway)").argument("<action>", "start|stop|restart|status|logs").action(async (action) => {
1565
+ program.command("daemon").description("Manage HyperClaw system service (alias: gateway)").argument("<action>", "start|stop|restart|status|logs|install|uninstall").action(async (action) => {
2336
1566
  const dm = new require_onboard.DaemonManager();
2337
1567
  if (action === "start") await new require_onboard.Banner().showNeonBanner(true);
2338
1568
  await dm.handle(action);
@@ -2341,20 +1571,20 @@ program.command("daemon").description("Manage HyperClaw system service (alias: g
2341
1571
  });
2342
1572
  const sandboxCmd = program.command("sandbox").description("Debug sandbox and tool policy");
2343
1573
  sandboxCmd.command("explain").description("Show effective sandbox mode, tool policy, and allowed tools").option("--json", "Output as JSON").action(async (opts) => {
2344
- const chalk$13 = require("chalk");
2345
- const fs$10 = require("fs-extra");
2346
- const path$10 = require("path");
2347
- const os$9 = require("os");
1574
+ const chalk$10 = require("chalk");
1575
+ const fs$6 = require("fs-extra");
1576
+ const path$6 = require("path");
1577
+ const os$7 = require("os");
2348
1578
  const { getConfigPath } = await Promise.resolve().then(() => require("./paths-D-QecARF.js"));
2349
1579
  const cfgPath = getConfigPath();
2350
1580
  let cfg = {};
2351
1581
  try {
2352
- cfg = await fs$10.readJson(cfgPath);
1582
+ cfg = await fs$6.readJson(cfgPath);
2353
1583
  } catch {}
2354
1584
  const sandboxMode = cfg?.agents?.defaults?.sandbox?.mode ?? "non-main";
2355
1585
  const toolsCfg = cfg?.tools ?? {};
2356
- const { describeToolPolicy, applyToolPolicy } = await Promise.resolve().then(() => require("./tool-policy-CFF-d5fs.js"));
2357
- const { getBuiltinTools, getSessionsTools, getPCAccessTools, getBrowserTools, getExtractionTools, getWebsiteWatchTools, getVisionTools } = await Promise.resolve().then(() => require("./src-BptR-54a.js"));
1586
+ const { describeToolPolicy, applyToolPolicy } = await Promise.resolve().then(() => require("./tool-policy-DNvNRnve.js"));
1587
+ const { getBuiltinTools, getSessionsTools, getPCAccessTools, getBrowserTools, getExtractionTools, getWebsiteWatchTools, getVisionTools } = await Promise.resolve().then(() => require("./src-BEVLgaF1.js"));
2358
1588
  const allTools = [
2359
1589
  ...getBuiltinTools(),
2360
1590
  ...getSessionsTools(() => null),
@@ -2382,15 +1612,15 @@ sandboxCmd.command("explain").description("Show effective sandbox mode, tool pol
2382
1612
  }, null, 2));
2383
1613
  process.exit(0);
2384
1614
  }
2385
- console.log(chalk$13.bold.hex("#06b6d4")("\n 🔒 SANDBOX EXPLAIN\n"));
1615
+ console.log(chalk$10.bold.hex("#06b6d4")("\n 🔒 SANDBOX EXPLAIN\n"));
2386
1616
  console.log(` Sandbox mode: ${sandboxMode} (non-main sessions get restricted pcTools)`);
2387
1617
  console.log(` Tool profile: ${policy.profile}`);
2388
1618
  console.log(` Policy source: ${policy.source}`);
2389
1619
  if (policy.allow?.length) console.log(` Allow: ${policy.allow.join(", ")}`);
2390
1620
  if (policy.deny?.length) console.log(` Deny: ${policy.deny.join(", ")}`);
2391
1621
  console.log(` Tools: ${filtered.length} / ${allTools.length} allowed`);
2392
- console.log(chalk$13.gray("\n Allowed: " + filtered.map((t) => t.name).join(", ")));
2393
- console.log(chalk$13.gray("\n Elevated: " + ((cfg?.tools?.elevated)?.enabled ? "enabled" : "disabled")));
1622
+ console.log(chalk$10.gray("\n Allowed: " + filtered.map((t) => t.name).join(", ")));
1623
+ console.log(chalk$10.gray("\n Elevated: " + ((cfg?.tools?.elevated)?.enabled ? "enabled" : "disabled")));
2394
1624
  console.log();
2395
1625
  process.exit(0);
2396
1626
  });
@@ -2430,15 +1660,15 @@ hooksCmd.command("install <pack>").description("Install a hook pack").action(asy
2430
1660
  });
2431
1661
  const agentsCmd = program.command("agents").description("Multi-agent routing");
2432
1662
  agentsCmd.command("bindings").description("List agent ↔ channel bindings").action(() => {
2433
- new AgentRouter().listBindings();
1663
+ new require_agents_routing.AgentRouter().listBindings();
2434
1664
  process.exit(0);
2435
1665
  });
2436
1666
  agentsCmd.command("bind").description("Bind a channel to an agent workspace").action(async () => {
2437
- await new AgentRouter().bind();
1667
+ await new require_agents_routing.AgentRouter().bind();
2438
1668
  process.exit(0);
2439
1669
  });
2440
1670
  agentsCmd.command("unbind").description("Remove channel ↔ agent bindings").action(async () => {
2441
- await new AgentRouter().unbind();
1671
+ await new require_agents_routing.AgentRouter().unbind();
2442
1672
  process.exit(0);
2443
1673
  });
2444
1674
  const pairingCmd = program.command("pairing").description("DM pairing codes");
@@ -2456,7 +1686,7 @@ msgCmd.command("send").description("Send a message via a configured channel").op
2456
1686
  process.exit(0);
2457
1687
  });
2458
1688
  program.command("hub").description("Skill hub — browse marketplace, install, scan skills").option("-i, --install <id>", "Install skill").option("-s, --scan <id>", "Security scan a skill").option("-m, --marketplace", "ClawHub-style marketplace view (installed + bundled)").option("--force", "Force install (bypass risk block)").option("--hide-suspicious", "Hide suspicious/dangerous skills").action(async (opts) => {
2459
- const hub = new SkillHub();
1689
+ const hub = new require_hub.SkillHub();
2460
1690
  if (opts.scan) await hub.scan(opts.scan);
2461
1691
  else if (opts.install) await hub.install(opts.install, opts.force);
2462
1692
  else if (opts.marketplace) await hub.showMarketplace({ hideSuspicious: opts.hideSuspicious });
@@ -2465,7 +1695,7 @@ program.command("hub").description("Skill hub — browse marketplace, install, s
2465
1695
  });
2466
1696
  const skillCmd = program.command("skill").description("ClawHub — search and install skills from registry");
2467
1697
  skillCmd.command("search [query]").description("Search ClawHub for skills").option("-c, --category <cat>", "Filter by category").action(async (query, opts) => {
2468
- const hub = new SkillHub();
1698
+ const hub = new require_hub.SkillHub();
2469
1699
  const q = query || "";
2470
1700
  const skills = await hub.searchClawHub(q, opts.category);
2471
1701
  if (skills.length === 0) {
@@ -2483,11 +1713,11 @@ skillCmd.command("search [query]").description("Search ClawHub for skills").opti
2483
1713
  process.exit(0);
2484
1714
  });
2485
1715
  skillCmd.command("list").description("List installed skills (bundled + ClawHub)").action(async () => {
2486
- const hub = new SkillHub();
1716
+ const hub = new require_hub.SkillHub();
2487
1717
  const installed = await hub.getInstalled();
2488
1718
  console.log(chalk.default.bold.hex("#06b6d4")("\n Installed skills:\n"));
2489
1719
  for (const s of installed) {
2490
- const src = SKILL_REGISTRY.some((r) => r.id === s.id) ? "" : " (ClawHub)";
1720
+ const src = require_hub.SKILL_REGISTRY.some((r) => r.id === s.id) ? "" : " (ClawHub)";
2491
1721
  console.log(` ${chalk.default.hex("#06b6d4")("✓")} ${s.name} ${chalk.default.gray(`(${s.id})${src}`)}`);
2492
1722
  }
2493
1723
  if (installed.length === 0) console.log(chalk.default.gray(" No skills installed. Run: hyperclaw hub or hyperclaw skill search <query>\n"));
@@ -2495,14 +1725,14 @@ skillCmd.command("list").description("List installed skills (bundled + ClawHub)"
2495
1725
  process.exit(0);
2496
1726
  });
2497
1727
  skillCmd.command("install <id>").description("Install skill from ClawHub (or bundled when registry unavailable)").option("-v, --version <ver>", "Pin version (e.g. 2.0.0)").option("--force", "Force install (bypass risk block for bundled)").action(async (id, opts) => {
2498
- const hub = new SkillHub();
2499
- const ora$6 = (await import("ora")).default;
2500
- const s = ora$6(`Installing ${id}...`).start();
1728
+ const hub = new require_hub.SkillHub();
1729
+ const ora$4 = (await import("ora")).default;
1730
+ const s = ora$4(`Installing ${id}...`).start();
2501
1731
  try {
2502
1732
  const dest = await hub.installFromClawHub(id, opts.version);
2503
1733
  s.succeed(`Installed to ${dest}`);
2504
1734
  } catch (e) {
2505
- const match = SKILL_REGISTRY.find((x) => x.id === id);
1735
+ const match = require_hub.SKILL_REGISTRY.find((x) => x.id === id);
2506
1736
  if (match) {
2507
1737
  await hub.install(id, !!opts?.force);
2508
1738
  s.succeed(`Installed bundled skill: ${match.name}`);
@@ -2511,13 +1741,13 @@ skillCmd.command("install <id>").description("Install skill from ClawHub (or bun
2511
1741
  process.exit(0);
2512
1742
  });
2513
1743
  program.command("menu-bar").description("Launch macOS menu bar companion (Electron tray app)").action(async () => {
2514
- const path$10 = await import("path");
1744
+ const path$6 = await import("path");
2515
1745
  const { spawn } = await import("child_process");
2516
- const fs$10 = await import("fs-extra");
2517
- const root = path$10.join(process.cwd(), "apps", "macos");
2518
- const altRoot = path$10.join(__dirname, "..", "..", "apps", "macos");
2519
- const macosDir = await fs$10.pathExists(root) ? root : await fs$10.pathExists(altRoot) ? altRoot : null;
2520
- if (!macosDir || !await fs$10.pathExists(path$10.join(macosDir, "package.json"))) {
1746
+ const fs$6 = await import("fs-extra");
1747
+ const root = path$6.join(process.cwd(), "apps", "macos");
1748
+ const altRoot = path$6.join(__dirname, "..", "..", "apps", "macos");
1749
+ const macosDir = await fs$6.pathExists(root) ? root : await fs$6.pathExists(altRoot) ? altRoot : null;
1750
+ if (!macosDir || !await fs$6.pathExists(path$6.join(macosDir, "package.json"))) {
2521
1751
  console.log(chalk.default.gray("\n macOS menu bar app not found."));
2522
1752
  console.log(chalk.default.gray(" Run from HyperClaw repo root, or: cd apps/macos && npm start\n"));
2523
1753
  process.exit(1);
@@ -2545,7 +1775,7 @@ program.command("update").description("Update HyperClaw").option("-c, --channel
2545
1775
  process.exit(0);
2546
1776
  });
2547
1777
  program.command("doctor").description("Health check — surfaces misconfigs and risky DM policies").option("--fix", "Auto-repair fixable issues").action(async (opts) => {
2548
- await runDoctor(opts.fix);
1778
+ await require_doctor.runDoctor(opts.fix);
2549
1779
  process.exit(0);
2550
1780
  });
2551
1781
  const memCmd = program.command("memory").description("Agent memory management");
@@ -2591,12 +1821,12 @@ cfgCmd.command("set-key <KEY=value>").description("Set an API key or config valu
2591
1821
  process.exit(0);
2592
1822
  });
2593
1823
  cfgCmd.command("set-service-key <serviceId> [apiKey]").description("Set API key for a service (hackerone, bugcrowd, synack, or custom). Prompts if apiKey omitted.").action(async (serviceId, apiKey) => {
2594
- const inquirer$3 = (await import("inquirer")).default;
1824
+ const inquirer$2 = (await import("inquirer")).default;
2595
1825
  const config = new require_manager.ConfigManager();
2596
1826
  const cfg = await config.load();
2597
1827
  let key = apiKey;
2598
1828
  if (!key || key.trim().length === 0) {
2599
- const r = await inquirer$3.prompt([{
1829
+ const r = await inquirer$2.prompt([{
2600
1830
  type: "password",
2601
1831
  name: "k",
2602
1832
  message: `API key for ${serviceId}:`,
@@ -2627,7 +1857,7 @@ cfgCmd.command("set-service-key <serviceId> [apiKey]").description("Set API key
2627
1857
  cfgCmd.command("schema").description("Show configuration schema").action(() => {
2628
1858
  console.log(chalk.default.bold.hex("#06b6d4")("\n Config schema: ~/.hyperclaw/config.json\n"));
2629
1859
  const schema = {
2630
- version: "string (e.g. \"4.0.1\")",
1860
+ version: "string (e.g. \"4.0.2\")",
2631
1861
  workspaceName: "string",
2632
1862
  provider: {
2633
1863
  providerId: "string",
@@ -2720,17 +1950,17 @@ program.command("deploy").description("Deploy gateway to cloud (Fly.io or Render
2720
1950
  program.command("voice-call").description("Start voice call session — terminal mode, talks to gateway").option("-u, --gateway-url <url>", "Gateway URL", "http://localhost:18789").action(async (opts) => {
2721
1951
  const axios = (await import("axios")).default;
2722
1952
  const readline$2 = await import("readline");
2723
- const chalk$13 = require("chalk");
1953
+ const chalk$10 = require("chalk");
2724
1954
  const url = opts.gatewayUrl || "http://localhost:18789";
2725
- console.log(chalk$13.bold.cyan("\n 🎙️ HYPERCLAW VOICE CALL\n"));
2726
- console.log(chalk$13.gray(` Gateway: ${url}`));
2727
- console.log(chalk$13.gray(" Type a message and press Enter. Ctrl+C to exit.\n"));
1955
+ console.log(chalk$10.bold.cyan("\n 🎙️ HYPERCLAW VOICE CALL\n"));
1956
+ console.log(chalk$10.gray(` Gateway: ${url}`));
1957
+ console.log(chalk$10.gray(" Type a message and press Enter. Ctrl+C to exit.\n"));
2728
1958
  const rl = readline$2.createInterface({
2729
1959
  input: process.stdin,
2730
1960
  output: process.stdout
2731
1961
  });
2732
1962
  const ask = () => {
2733
- rl.question(chalk$13.cyan(" You: "), async (input) => {
1963
+ rl.question(chalk$10.cyan(" You: "), async (input) => {
2734
1964
  if (!input?.trim()) {
2735
1965
  ask();
2736
1966
  return;
@@ -2740,9 +1970,9 @@ program.command("voice-call").description("Start voice call session — terminal
2740
1970
  message: input.trim(),
2741
1971
  thinking: "none"
2742
1972
  }, { timeout: 6e4 });
2743
- console.log(chalk$13.green(` 🦅 Agent: ${(res.data?.response || "").slice(0, 500)}\n`));
1973
+ console.log(chalk$10.green(` 🦅 Agent: ${(res.data?.response || "").slice(0, 500)}\n`));
2744
1974
  } catch (e) {
2745
- console.log(chalk$13.red(` Error: ${e.response?.data?.error || e.message}\n`));
1975
+ console.log(chalk$10.red(` Error: ${e.response?.data?.error || e.message}\n`));
2746
1976
  }
2747
1977
  ask();
2748
1978
  });
@@ -2809,45 +2039,45 @@ themeCmd.command("preview").description("Preview all themes side-by-side").actio
2809
2039
  });
2810
2040
  const secretsCmd = program.command("secrets").description("External secrets management");
2811
2041
  secretsCmd.command("audit").description("Audit all required secrets").option("--required-by <ids>", "Filter by skill/provider IDs (comma-separated)").action(async (opts) => {
2812
- const { SecretsManager } = await Promise.resolve().then(() => require("./manager-DOWs9lLX.js"));
2042
+ const { SecretsManager } = await Promise.resolve().then(() => require("./manager-DgyF52mg.js"));
2813
2043
  const filter = opts.requiredBy?.split(",");
2814
2044
  await new SecretsManager().audit(filter);
2815
2045
  process.exit(0);
2816
2046
  });
2817
2047
  secretsCmd.command("set <KEY=value>").description("Set a secret in .env file").action(async (kv) => {
2818
- const { SecretsManager } = await Promise.resolve().then(() => require("./manager-DOWs9lLX.js"));
2048
+ const { SecretsManager } = await Promise.resolve().then(() => require("./manager-DgyF52mg.js"));
2819
2049
  await new SecretsManager().set(kv);
2820
2050
  process.exit(0);
2821
2051
  });
2822
2052
  secretsCmd.command("apply").description("Write secrets from .env to shell config (~/.bashrc, ~/.zshrc)").action(async () => {
2823
- const { SecretsManager } = await Promise.resolve().then(() => require("./manager-DOWs9lLX.js"));
2053
+ const { SecretsManager } = await Promise.resolve().then(() => require("./manager-DgyF52mg.js"));
2824
2054
  await new SecretsManager().apply();
2825
2055
  process.exit(0);
2826
2056
  });
2827
2057
  secretsCmd.command("reload").description("Reload secrets into running gateway").action(async () => {
2828
- const { SecretsManager } = await Promise.resolve().then(() => require("./manager-DOWs9lLX.js"));
2058
+ const { SecretsManager } = await Promise.resolve().then(() => require("./manager-DgyF52mg.js"));
2829
2059
  await new SecretsManager().reload();
2830
2060
  process.exit(0);
2831
2061
  });
2832
2062
  secretsCmd.command("remove <key>").description("Remove a secret from .env").action(async (key) => {
2833
- const { SecretsManager } = await Promise.resolve().then(() => require("./manager-DOWs9lLX.js"));
2063
+ const { SecretsManager } = await Promise.resolve().then(() => require("./manager-DgyF52mg.js"));
2834
2064
  await new SecretsManager().remove(key);
2835
2065
  process.exit(0);
2836
2066
  });
2837
2067
  secretsCmd.command("credentials").description("List provider credential files (credentials/*.json)").action(async () => {
2838
- const { CredentialsStore } = await Promise.resolve().then(() => require("./credentials-store-B3anVuZD.js"));
2068
+ const { CredentialsStore } = await Promise.resolve().then(() => require("./credentials-store-BvnMPJwi.js"));
2839
2069
  await new CredentialsStore().showList();
2840
2070
  process.exit(0);
2841
2071
  });
2842
2072
  const securityCmd = program.command("security").description("Security tools");
2843
2073
  securityCmd.command("audit").description("Security audit — file permissions, DM policies, embedded secrets").option("--deep", "Full deep scan including token entropy and installed skill risks").action(async (opts) => {
2844
- const { runSecurityAudit } = await Promise.resolve().then(() => require("./audit-BTLzQBk-.js"));
2074
+ const { runSecurityAudit } = await Promise.resolve().then(() => require("./audit-BYxPlnTQ.js"));
2845
2075
  await runSecurityAudit(opts.deep);
2846
2076
  process.exit(0);
2847
2077
  });
2848
2078
  const agentRunCmd = program.command("agent").description("Run agent with thinking control");
2849
2079
  agentRunCmd.requiredOption("-m, --message <text>", "Message to send to the agent").option("--thinking <level>", "Thinking level: high|medium|low|none", "none").option("--model <model>", "Override model").option("--session <id>", "Session/thread ID").option("--multi-step", "Decompose into steps and run each (sequential)").option("--parallel", "Run sub-agents in parallel for independent subtasks").option("--verbose", "Show thinking blocks and request details").option("--workspace <dir>", "Override workspace directory").action(async (opts) => {
2850
- const { runAgent } = await Promise.resolve().then(() => require("./src-BptR-54a.js"));
2080
+ const { runAgent } = await Promise.resolve().then(() => require("./src-BEVLgaF1.js"));
2851
2081
  await runAgent({
2852
2082
  message: opts.message,
2853
2083
  thinking: opts.thinking,
@@ -2863,7 +2093,7 @@ agentRunCmd.requiredOption("-m, --message <text>", "Message to send to the agent
2863
2093
  });
2864
2094
  const threadsCmd = program.command("threads").description("ACP thread-bound agent sessions");
2865
2095
  threadsCmd.command("list").description("List agent threads").option("--channel <id>", "Filter by channel").option("--active", "Show only active threads").action(async (opts) => {
2866
- const { ACPThreadManager } = await Promise.resolve().then(() => require("./src-BptR-54a.js"));
2096
+ const { ACPThreadManager } = await Promise.resolve().then(() => require("./src-BEVLgaF1.js"));
2867
2097
  const mgr = new ACPThreadManager();
2868
2098
  const threads = await mgr.list({
2869
2099
  channelId: opts.channel,
@@ -2873,33 +2103,33 @@ threadsCmd.command("list").description("List agent threads").option("--channel <
2873
2103
  process.exit(0);
2874
2104
  });
2875
2105
  threadsCmd.command("terminate <id>").description("Terminate a thread").action(async (id) => {
2876
- const { ACPThreadManager } = await Promise.resolve().then(() => require("./src-BptR-54a.js"));
2106
+ const { ACPThreadManager } = await Promise.resolve().then(() => require("./src-BEVLgaF1.js"));
2877
2107
  await new ACPThreadManager().terminate(id);
2878
2108
  console.log(require("chalk").green(`\n ✔ Thread terminated: ${id}\n`));
2879
2109
  process.exit(0);
2880
2110
  });
2881
2111
  const canvasCmd = program.command("canvas").description("Live AI-driven UI canvas");
2882
2112
  canvasCmd.command("show").description("Show current canvas components").action(async () => {
2883
- const { CanvasRenderer } = await Promise.resolve().then(() => require("./renderer-CN8ePGog.js"));
2113
+ const { CanvasRenderer } = await Promise.resolve().then(() => require("./renderer-pqlDRKbH.js"));
2884
2114
  await new CanvasRenderer().show();
2885
2115
  process.exit(0);
2886
2116
  });
2887
2117
  canvasCmd.command("add <type> <title>").description("Add a canvas component (type: chart|table|form|markdown|image|custom)").action(async (type, title) => {
2888
- const { CanvasRenderer } = await Promise.resolve().then(() => require("./renderer-CN8ePGog.js"));
2118
+ const { CanvasRenderer } = await Promise.resolve().then(() => require("./renderer-pqlDRKbH.js"));
2889
2119
  await new CanvasRenderer().addComponent(type, title);
2890
2120
  process.exit(0);
2891
2121
  });
2892
2122
  canvasCmd.command("clear").description("Clear all canvas components").action(async () => {
2893
- const { CanvasRenderer } = await Promise.resolve().then(() => require("./renderer-CN8ePGog.js"));
2123
+ const { CanvasRenderer } = await Promise.resolve().then(() => require("./renderer-pqlDRKbH.js"));
2894
2124
  await new CanvasRenderer().clear();
2895
2125
  process.exit(0);
2896
2126
  });
2897
2127
  canvasCmd.command("export").description("Export canvas as HTML file").action(async () => {
2898
- const { CanvasRenderer } = await Promise.resolve().then(() => require("./renderer-CN8ePGog.js"));
2899
- const fs$10 = require("fs-extra");
2128
+ const { CanvasRenderer } = await Promise.resolve().then(() => require("./renderer-pqlDRKbH.js"));
2129
+ const fs$6 = require("fs-extra");
2900
2130
  const html = await new CanvasRenderer().exportHtml();
2901
2131
  const outFile = require("path").join(require("os").homedir(), ".hyperclaw", "canvas", "export.html");
2902
- await fs$10.writeFile(outFile, html);
2132
+ await fs$6.writeFile(outFile, html);
2903
2133
  console.log(require("chalk").green(`\n ✔ Canvas exported to ${outFile}\n`));
2904
2134
  process.exit(0);
2905
2135
  });
@@ -2916,167 +2146,167 @@ deliveryCmd.command("retry <id>").description("Retry a dead-lettered delivery it
2916
2146
  });
2917
2147
  const mcpCmd = program.command("mcp").description("MCP (Model Context Protocol) server management");
2918
2148
  mcpCmd.command("list").action(async () => {
2919
- const { mcpList } = await Promise.resolve().then(() => require("./mcp-D0qVYL4A.js"));
2149
+ const { mcpList } = await Promise.resolve().then(() => require("./mcp-B_9Ber63.js"));
2920
2150
  await mcpList();
2921
2151
  process.exit(0);
2922
2152
  });
2923
2153
  mcpCmd.command("add").action(async () => {
2924
- const { mcpAdd } = await Promise.resolve().then(() => require("./mcp-D0qVYL4A.js"));
2154
+ const { mcpAdd } = await Promise.resolve().then(() => require("./mcp-B_9Ber63.js"));
2925
2155
  await mcpAdd();
2926
2156
  process.exit(0);
2927
2157
  });
2928
2158
  mcpCmd.command("remove <id>").action(async (id) => {
2929
- const { mcpRemove } = await Promise.resolve().then(() => require("./mcp-D0qVYL4A.js"));
2159
+ const { mcpRemove } = await Promise.resolve().then(() => require("./mcp-B_9Ber63.js"));
2930
2160
  await mcpRemove(id);
2931
2161
  process.exit(0);
2932
2162
  });
2933
2163
  mcpCmd.command("probe [id]").action(async (id) => {
2934
- const { mcpProbe } = await Promise.resolve().then(() => require("./mcp-D0qVYL4A.js"));
2164
+ const { mcpProbe } = await Promise.resolve().then(() => require("./mcp-B_9Ber63.js"));
2935
2165
  await mcpProbe(id);
2936
2166
  process.exit(0);
2937
2167
  });
2938
2168
  const nodeCmd = program.command("node").description("HyperClaw node management (local, remote, android)");
2939
2169
  nodeCmd.command("list").action(async () => {
2940
- const { nodeList } = await Promise.resolve().then(() => require("./node-CHBOeMvu.js"));
2170
+ const { nodeList } = await Promise.resolve().then(() => require("./node-pwL6O_KX.js"));
2941
2171
  await nodeList();
2942
2172
  process.exit(0);
2943
2173
  });
2944
2174
  nodeCmd.command("add").action(async () => {
2945
- const { nodeAdd } = await Promise.resolve().then(() => require("./node-CHBOeMvu.js"));
2175
+ const { nodeAdd } = await Promise.resolve().then(() => require("./node-pwL6O_KX.js"));
2946
2176
  await nodeAdd();
2947
2177
  process.exit(0);
2948
2178
  });
2949
2179
  nodeCmd.command("probe [id]").action(async (id) => {
2950
- const { nodeProbe } = await Promise.resolve().then(() => require("./node-CHBOeMvu.js"));
2180
+ const { nodeProbe } = await Promise.resolve().then(() => require("./node-pwL6O_KX.js"));
2951
2181
  await nodeProbe(id);
2952
2182
  process.exit(0);
2953
2183
  });
2954
2184
  nodeCmd.command("remove <id>").action(async (id) => {
2955
- const { nodeRemove } = await Promise.resolve().then(() => require("./node-CHBOeMvu.js"));
2185
+ const { nodeRemove } = await Promise.resolve().then(() => require("./node-pwL6O_KX.js"));
2956
2186
  await nodeRemove(id);
2957
2187
  process.exit(0);
2958
2188
  });
2959
2189
  const arCmd = program.command("auto-reply").description("Auto-reply rule engine");
2960
2190
  arCmd.command("list").action(async () => {
2961
- const { AutoReplyEngine } = await Promise.resolve().then(() => require("./rules-Dp4iYVQ4.js"));
2191
+ const { AutoReplyEngine } = await Promise.resolve().then(() => require("./rules-BooT_qFP.js"));
2962
2192
  const e = new AutoReplyEngine();
2963
2193
  await e.load();
2964
2194
  e.showList();
2965
2195
  process.exit(0);
2966
2196
  });
2967
2197
  arCmd.command("toggle <id>").action(async (id) => {
2968
- const { AutoReplyEngine } = await Promise.resolve().then(() => require("./rules-Dp4iYVQ4.js"));
2198
+ const { AutoReplyEngine } = await Promise.resolve().then(() => require("./rules-BooT_qFP.js"));
2969
2199
  const e = new AutoReplyEngine();
2970
2200
  await e.toggle(id);
2971
2201
  process.exit(0);
2972
2202
  });
2973
2203
  arCmd.command("remove <id>").action(async (id) => {
2974
- const { AutoReplyEngine } = await Promise.resolve().then(() => require("./rules-Dp4iYVQ4.js"));
2204
+ const { AutoReplyEngine } = await Promise.resolve().then(() => require("./rules-BooT_qFP.js"));
2975
2205
  const e = new AutoReplyEngine();
2976
2206
  await e.remove(id);
2977
2207
  process.exit(0);
2978
2208
  });
2979
2209
  const gmailCmd = program.command("gmail").description("Gmail Pub/Sub real-time notifications");
2980
2210
  gmailCmd.command("watch-setup").description("Register Gmail watch for push notifications. Requires: hyperclaw auth oauth google-gmail").requiredOption("-t, --topic <name>", "Pub/Sub topic (e.g. projects/myproject/topics/gmail-push)").option("-l, --labels <ids>", "Label IDs to watch (comma-separated)", "INBOX").action(async (opts) => {
2981
- const chalk$13 = require("chalk");
2211
+ const chalk$10 = require("chalk");
2982
2212
  try {
2983
- const { setupGmailWatch } = await Promise.resolve().then(() => require("./gmail-watch-setup-C6_zNpp1.js"));
2213
+ const { setupGmailWatch } = await Promise.resolve().then(() => require("./gmail-watch-setup-Czt8rXaX.js"));
2984
2214
  const labelIds = opts.labels.split(",").map((s) => s.trim()).filter(Boolean);
2985
2215
  const result = await setupGmailWatch({
2986
2216
  topicName: opts.topic,
2987
2217
  labelIds
2988
2218
  });
2989
- console.log(chalk$13.hex("#06b6d4")("\n ✔ Gmail watch registered"));
2990
- console.log(chalk$13.gray(` historyId: ${result.historyId}`));
2991
- console.log(chalk$13.gray(` expiration: ${new Date(parseInt(result.expiration, 10)).toISOString()}`));
2992
- console.log(chalk$13.gray("\n Push endpoint: https://<your-server>/webhook/gmail-pubsub"));
2993
- console.log(chalk$13.gray(" Ensure email channel is enabled and gateway is publicly accessible.\n"));
2219
+ console.log(chalk$10.hex("#06b6d4")("\n ✔ Gmail watch registered"));
2220
+ console.log(chalk$10.gray(` historyId: ${result.historyId}`));
2221
+ console.log(chalk$10.gray(` expiration: ${new Date(parseInt(result.expiration, 10)).toISOString()}`));
2222
+ console.log(chalk$10.gray("\n Push endpoint: https://<your-server>/webhook/gmail-pubsub"));
2223
+ console.log(chalk$10.gray(" Ensure email channel is enabled and gateway is publicly accessible.\n"));
2994
2224
  } catch (e) {
2995
- console.error(chalk$13.red("\n ✖ " + e.message + "\n"));
2225
+ console.error(chalk$10.red("\n ✖ " + e.message + "\n"));
2996
2226
  process.exit(1);
2997
2227
  }
2998
2228
  process.exit(0);
2999
2229
  });
3000
2230
  const cronCmd = program.command("cron").description("Scheduled tasks (cron → agent prompt)");
3001
2231
  cronCmd.command("list").action(async () => {
3002
- const chalk$13 = require("chalk");
3003
- const { loadCronTasks } = await Promise.resolve().then(() => require("./cron-tasks-Bl9yuyCa.js"));
2232
+ const chalk$10 = require("chalk");
2233
+ const { loadCronTasks } = await Promise.resolve().then(() => require("./cron-tasks-BvDFNyiE.js"));
3004
2234
  const tasks = await loadCronTasks();
3005
- console.log(chalk$13.bold.cyan("\n ⏰ CRON TASKS\n"));
2235
+ console.log(chalk$10.bold.cyan("\n ⏰ CRON TASKS\n"));
3006
2236
  if (tasks.length === 0) {
3007
- console.log(chalk$13.gray(" No tasks. Add: hyperclaw cron add \"0 9 * * 1-5\" \"Check calendar\"\n"));
2237
+ console.log(chalk$10.gray(" No tasks. Add: hyperclaw cron add \"0 9 * * 1-5\" \"Check calendar\"\n"));
3008
2238
  process.exit(0);
3009
2239
  return;
3010
2240
  }
3011
2241
  for (const t of tasks) {
3012
- const dot = t.enabled ? chalk$13.green("●") : chalk$13.gray("○");
3013
- console.log(` ${dot} ${chalk$13.white(t.name || t.id)}`);
3014
- console.log(` ${chalk$13.gray("Schedule:")} ${t.schedule}`);
3015
- console.log(` ${chalk$13.gray("Prompt:")} ${t.prompt.slice(0, 60)}${t.prompt.length > 60 ? "..." : ""}`);
3016
- if (t.lastRunAt) console.log(` ${chalk$13.gray("Last run:")} ${t.lastRunAt}`);
2242
+ const dot = t.enabled ? chalk$10.green("●") : chalk$10.gray("○");
2243
+ console.log(` ${dot} ${chalk$10.white(t.name || t.id)}`);
2244
+ console.log(` ${chalk$10.gray("Schedule:")} ${t.schedule}`);
2245
+ console.log(` ${chalk$10.gray("Prompt:")} ${t.prompt.slice(0, 60)}${t.prompt.length > 60 ? "..." : ""}`);
2246
+ if (t.lastRunAt) console.log(` ${chalk$10.gray("Last run:")} ${t.lastRunAt}`);
3017
2247
  console.log();
3018
2248
  }
3019
2249
  process.exit(0);
3020
2250
  });
3021
2251
  cronCmd.command("add").arguments("<schedule> <prompt>").option("-n, --name <name>", "Task name").action(async (schedule, prompt, opts) => {
3022
- const chalk$13 = require("chalk");
3023
- const { loadCronTasks, addCronTask, saveCronTasks } = await Promise.resolve().then(() => require("./cron-tasks-Bl9yuyCa.js"));
2252
+ const chalk$10 = require("chalk");
2253
+ const { loadCronTasks, addCronTask, saveCronTasks } = await Promise.resolve().then(() => require("./cron-tasks-BvDFNyiE.js"));
3024
2254
  await loadCronTasks();
3025
2255
  addCronTask(schedule, prompt, opts.name);
3026
2256
  await saveCronTasks();
3027
- console.log(chalk$13.green(`\n ✔ Cron task added: ${schedule} → "${prompt.slice(0, 40)}..."\n`));
3028
- console.log(chalk$13.gray(" Restart gateway to apply.\n"));
2257
+ console.log(chalk$10.green(`\n ✔ Cron task added: ${schedule} → "${prompt.slice(0, 40)}..."\n`));
2258
+ console.log(chalk$10.gray(" Restart gateway to apply.\n"));
3029
2259
  process.exit(0);
3030
2260
  });
3031
2261
  cronCmd.command("remove <id>").action(async (id) => {
3032
- const chalk$13 = require("chalk");
3033
- const { loadCronTasks, removeCronTask, saveCronTasks } = await Promise.resolve().then(() => require("./cron-tasks-Bl9yuyCa.js"));
2262
+ const chalk$10 = require("chalk");
2263
+ const { loadCronTasks, removeCronTask, saveCronTasks } = await Promise.resolve().then(() => require("./cron-tasks-BvDFNyiE.js"));
3034
2264
  await loadCronTasks();
3035
2265
  if (removeCronTask(id)) {
3036
2266
  await saveCronTasks();
3037
- console.log(chalk$13.green(`\n ✔ Task removed\n`));
3038
- } else console.log(chalk$13.red(`\n ✖ Task not found: ${id}\n`));
2267
+ console.log(chalk$10.green(`\n ✔ Task removed\n`));
2268
+ } else console.log(chalk$10.red(`\n ✖ Task not found: ${id}\n`));
3039
2269
  process.exit(0);
3040
2270
  });
3041
2271
  program.command("nodes").description("List connected mobile nodes (iOS/Android Connect tab)").action(async () => {
3042
- const chalk$13 = require("chalk");
3043
- const http$2 = await import("http");
3044
- const fs$10 = await import("fs-extra");
3045
- const path$10 = await import("path");
3046
- const os$9 = await import("os");
2272
+ const chalk$10 = require("chalk");
2273
+ const http = await import("http");
2274
+ const fs$6 = await import("fs-extra");
2275
+ const path$6 = await import("path");
2276
+ const os$7 = await import("os");
3047
2277
  let port = 18789;
3048
2278
  try {
3049
- const cfg = await fs$10.readJson(path$10.join(os$9.homedir(), ".hyperclaw", "hyperclaw.json"));
2279
+ const cfg = await fs$6.readJson(path$6.join(os$7.homedir(), ".hyperclaw", "hyperclaw.json"));
3050
2280
  port = cfg?.gateway?.port ?? 18789;
3051
2281
  } catch {}
3052
2282
  return new Promise((resolve, reject) => {
3053
- const req = http$2.get(`http://127.0.0.1:${port}/api/nodes`, (res) => {
2283
+ const req = http.get(`http://127.0.0.1:${port}/api/nodes`, (res) => {
3054
2284
  let data = "";
3055
2285
  res.on("data", (c) => data += c);
3056
2286
  res.on("end", () => {
3057
2287
  try {
3058
2288
  const j = JSON.parse(data);
3059
2289
  const nodes = j.nodes || [];
3060
- console.log(chalk$13.bold.cyan("\n 📱 CONNECTED NODES\n"));
2290
+ console.log(chalk$10.bold.cyan("\n 📱 CONNECTED NODES\n"));
3061
2291
  if (nodes.length === 0) {
3062
- console.log(chalk$13.gray(" No mobile nodes. Open iOS/Android app → Connect tab → pair with gateway."));
3063
- console.log(chalk$13.gray(` Gateway: ws://localhost:${port}\n`));
2292
+ console.log(chalk$10.gray(" No mobile nodes. Open iOS/Android app → Connect tab → pair with gateway."));
2293
+ console.log(chalk$10.gray(` Gateway: ws://localhost:${port}\n`));
3064
2294
  } else {
3065
2295
  for (const n of nodes) {
3066
- console.log(` ${chalk$13.green("●")} ${n.nodeId} ${chalk$13.gray(`(${n.platform || "?"})`)}`);
3067
- console.log(` ${chalk$13.gray("Device:")} ${n.deviceName || "—"}`);
3068
- console.log(` ${chalk$13.gray("Capabilities:")} ${Object.entries(n.capabilities || {}).filter(([, v]) => v).map(([k]) => k).join(", ") || "—"}`);
2296
+ console.log(` ${chalk$10.green("●")} ${n.nodeId} ${chalk$10.gray(`(${n.platform || "?"})`)}`);
2297
+ console.log(` ${chalk$10.gray("Device:")} ${n.deviceName || "—"}`);
2298
+ console.log(` ${chalk$10.gray("Capabilities:")} ${Object.entries(n.capabilities || {}).filter(([, v]) => v).map(([k]) => k).join(", ") || "—"}`);
3069
2299
  }
3070
2300
  console.log();
3071
2301
  }
3072
2302
  } catch {
3073
- console.log(chalk$13.red(" Could not reach gateway. Start with: hyperclaw daemon start\n"));
2303
+ console.log(chalk$10.red(" Could not reach gateway. Start with: hyperclaw daemon start\n"));
3074
2304
  }
3075
2305
  resolve();
3076
2306
  });
3077
2307
  });
3078
2308
  req.on("error", () => {
3079
- console.log(chalk$13.red(" Gateway offline. Start with: hyperclaw daemon start\n"));
2309
+ console.log(chalk$10.red(" Gateway offline. Start with: hyperclaw daemon start\n"));
3080
2310
  resolve();
3081
2311
  });
3082
2312
  req.setTimeout(3e3, () => {
@@ -3087,20 +2317,20 @@ program.command("nodes").description("List connected mobile nodes (iOS/Android C
3087
2317
  });
3088
2318
  const whCmd = program.command("webhooks").description("Webhook endpoint management");
3089
2319
  whCmd.command("list").action(async () => {
3090
- const { WebhookManager } = await Promise.resolve().then(() => require("./manager-DyEeuP9g.js"));
2320
+ const { WebhookManager } = await Promise.resolve().then(() => require("./manager-DSGhn5i3.js"));
3091
2321
  const m = new WebhookManager();
3092
2322
  await m.load();
3093
2323
  m.showList();
3094
2324
  process.exit(0);
3095
2325
  });
3096
2326
  whCmd.command("remove <id>").action(async (id) => {
3097
- const { WebhookManager } = await Promise.resolve().then(() => require("./manager-DyEeuP9g.js"));
2327
+ const { WebhookManager } = await Promise.resolve().then(() => require("./manager-DSGhn5i3.js"));
3098
2328
  const m = new WebhookManager();
3099
2329
  await m.remove(id);
3100
2330
  process.exit(0);
3101
2331
  });
3102
2332
  whCmd.command("toggle <id>").action(async (id) => {
3103
- const { WebhookManager } = await Promise.resolve().then(() => require("./manager-DyEeuP9g.js"));
2333
+ const { WebhookManager } = await Promise.resolve().then(() => require("./manager-DSGhn5i3.js"));
3104
2334
  const m = new WebhookManager();
3105
2335
  await m.toggle(id);
3106
2336
  process.exit(0);
@@ -3109,7 +2339,7 @@ const logsCmd = program.command("logs").description("View gateway logs");
3109
2339
  logsCmd.option("-n, --lines <n>", "Number of lines to show", "50");
3110
2340
  logsCmd.option("-f, --follow", "Stream logs in real time");
3111
2341
  logsCmd.action(async (opts) => {
3112
- const { tailLog, streamLog } = await Promise.resolve().then(() => require("./logger-CWyS7qAp.js"));
2342
+ const { tailLog, streamLog } = await Promise.resolve().then(() => require("./logger-8tEtAd3y.js"));
3113
2343
  if (opts.follow) await streamLog();
3114
2344
  else {
3115
2345
  await tailLog(parseInt(opts.lines));
@@ -3117,7 +2347,7 @@ logsCmd.action(async (opts) => {
3117
2347
  }
3118
2348
  });
3119
2349
  program.command("gateway:serve").description("Start the gateway server in the foreground (used by daemon)").action(async () => {
3120
- const { startGateway } = await Promise.resolve().then(() => require("./server-RBqwE_GN.js"));
2350
+ const { startGateway } = await Promise.resolve().then(() => require("./server-DU9POoWc.js"));
3121
2351
  await startGateway();
3122
2352
  process.on("SIGINT", () => process.exit(0));
3123
2353
  process.on("SIGTERM", () => process.exit(0));
@@ -3125,15 +2355,15 @@ program.command("gateway:serve").description("Start the gateway server in the fo
3125
2355
  });
3126
2356
  const gatewayCfgCmd = gatewayCmd.command("config").description("Configure gateway settings");
3127
2357
  gatewayCfgCmd.option("--set-token <token>", "Set gateway auth token").option("--regenerate-token", "Generate a new random token").option("--set-port <port>", "Set gateway port").option("--set-bind <addr>", "Set gateway bind address").action(async (opts) => {
3128
- const chalk$13 = require("chalk");
3129
- const fs$10 = require("fs-extra");
3130
- const path$10 = require("path");
3131
- const os$9 = require("os");
2358
+ const chalk$10 = require("chalk");
2359
+ const fs$6 = require("fs-extra");
2360
+ const path$6 = require("path");
2361
+ const os$7 = require("os");
3132
2362
  const crypto = require("crypto");
3133
- const cfgFile = path$10.join(os$9.homedir(), ".hyperclaw", "hyperclaw.json");
2363
+ const cfgFile = path$6.join(os$7.homedir(), ".hyperclaw", "hyperclaw.json");
3134
2364
  let cfg = {};
3135
2365
  try {
3136
- cfg = await fs$10.readJson(cfgFile);
2366
+ cfg = await fs$6.readJson(cfgFile);
3137
2367
  } catch {}
3138
2368
  if (!cfg.gateway) cfg.gateway = {
3139
2369
  port: 18789,
@@ -3145,52 +2375,52 @@ gatewayCfgCmd.option("--set-token <token>", "Set gateway auth token").option("--
3145
2375
  };
3146
2376
  if (opts.regenerateToken) {
3147
2377
  cfg.gateway.authToken = crypto.randomBytes(32).toString("hex");
3148
- console.log(chalk$13.hex("#06b6d4")("\n ✔ New gateway token generated"));
3149
- console.log(chalk$13.gray(` Token: ${cfg.gateway.authToken}`));
2378
+ console.log(chalk$10.hex("#06b6d4")("\n ✔ New gateway token generated"));
2379
+ console.log(chalk$10.gray(` Token: ${cfg.gateway.authToken}`));
3150
2380
  }
3151
2381
  if (opts.setToken) {
3152
2382
  cfg.gateway.authToken = opts.setToken;
3153
- console.log(chalk$13.hex("#06b6d4")(`\n ✔ Gateway token set`));
2383
+ console.log(chalk$10.hex("#06b6d4")(`\n ✔ Gateway token set`));
3154
2384
  }
3155
2385
  if (opts.setPort) {
3156
2386
  cfg.gateway.port = parseInt(opts.setPort);
3157
- console.log(chalk$13.hex("#06b6d4")(`\n ✔ Port set to ${cfg.gateway.port}`));
2387
+ console.log(chalk$10.hex("#06b6d4")(`\n ✔ Port set to ${cfg.gateway.port}`));
3158
2388
  }
3159
2389
  if (opts.setBind) {
3160
2390
  cfg.gateway.bind = opts.setBind;
3161
- console.log(chalk$13.hex("#06b6d4")(`\n ✔ Bind set to ${cfg.gateway.bind}`));
2391
+ console.log(chalk$10.hex("#06b6d4")(`\n ✔ Bind set to ${cfg.gateway.bind}`));
3162
2392
  }
3163
- await fs$10.ensureDir(path$10.dirname(cfgFile));
3164
- await fs$10.writeJson(cfgFile, cfg, { spaces: 2 });
3165
- await fs$10.chmod(cfgFile, 384);
3166
- console.log(chalk$13.gray(` Saved to ${cfgFile}\n`));
2393
+ await fs$6.ensureDir(path$6.dirname(cfgFile));
2394
+ await fs$6.writeJson(cfgFile, cfg, { spaces: 2 });
2395
+ await fs$6.chmod(cfgFile, 384);
2396
+ console.log(chalk$10.gray(` Saved to ${cfgFile}\n`));
3167
2397
  process.exit(0);
3168
2398
  });
3169
2399
  const authCmd = program.command("auth").description("OAuth and provider credentials");
3170
2400
  authCmd.command("add <service_id>").description("Add API key for a service (any provider we do not ship). Stored in credentials/ and .env.").option("--key <api_key>", "API key (prompts if omitted)").option("--base-url <url>", "Base URL (optional, e.g. https://api.example.com)").option("--env-var <name>", "Env var name (default: <SERVICE_ID>_API_KEY)").action(async (serviceId, opts) => {
3171
- const chalk$13 = require("chalk");
3172
- const inquirer$3 = require("inquirer");
3173
- const { CredentialsStore } = await Promise.resolve().then(() => require("./credentials-store-B3anVuZD.js"));
3174
- const { getHyperClawDir: getHyperClawDir$1, getEnvFilePath } = await Promise.resolve().then(() => require("./paths-D-QecARF.js"));
3175
- const { getApiKeyGuide, GENERIC_API_KEY_STEPS } = await Promise.resolve().then(() => require("./api-keys-guide-Bzig1R5W.js"));
3176
- const fs$10 = await import("fs-extra");
3177
- const path$10 = await import("path");
2401
+ const chalk$10 = require("chalk");
2402
+ const inquirer$2 = require("inquirer");
2403
+ const { CredentialsStore } = await Promise.resolve().then(() => require("./credentials-store-BvnMPJwi.js"));
2404
+ const { getHyperClawDir, getEnvFilePath } = await Promise.resolve().then(() => require("./paths-D-QecARF.js"));
2405
+ const { getApiKeyGuide, GENERIC_API_KEY_STEPS } = await Promise.resolve().then(() => require("./api-keys-guide-Dq5Obbp4.js"));
2406
+ const fs$6 = await import("fs-extra");
2407
+ const path$6 = await import("path");
3178
2408
  const guide = getApiKeyGuide(serviceId);
3179
2409
  const steps = guide?.setupSteps ?? GENERIC_API_KEY_STEPS;
3180
- console.log(chalk$13.bold.hex("#06b6d4")(`\n 🔑 Add API key: ${guide?.name ?? serviceId}\n`));
3181
- console.log(chalk$13.bold(" Steps:\n"));
3182
- for (const step of steps) if (step.startsWith(" 🔗")) console.log(chalk$13.hex("#06b6d4")(step));
3183
- else if (step.startsWith(" 💡")) console.log(chalk$13.gray(step));
3184
- else console.log(chalk$13.gray(` ${step}`));
2410
+ console.log(chalk$10.bold.hex("#06b6d4")(`\n 🔑 Add API key: ${guide?.name ?? serviceId}\n`));
2411
+ console.log(chalk$10.bold(" Steps:\n"));
2412
+ for (const step of steps) if (step.startsWith(" 🔗")) console.log(chalk$10.hex("#06b6d4")(step));
2413
+ else if (step.startsWith(" 💡")) console.log(chalk$10.gray(step));
2414
+ else console.log(chalk$10.gray(` ${step}`));
3185
2415
  console.log();
3186
2416
  const safeId = serviceId.replace(/[^a-zA-Z0-9_-]/g, "_").toLowerCase();
3187
2417
  if (!safeId) {
3188
- console.log(chalk$13.red("\n ✖ Invalid service ID\n"));
2418
+ console.log(chalk$10.red("\n ✖ Invalid service ID\n"));
3189
2419
  process.exit(1);
3190
2420
  }
3191
2421
  let apiKey = opts.key || process.env[`${safeId.toUpperCase().replace(/-/g, "_")}_API_KEY`];
3192
2422
  if (!apiKey) {
3193
- const { key } = await inquirer$3.prompt([{
2423
+ const { key } = await inquirer$2.prompt([{
3194
2424
  type: "password",
3195
2425
  name: "key",
3196
2426
  message: `API key for ${serviceId}:`,
@@ -3199,7 +2429,7 @@ authCmd.command("add <service_id>").description("Add API key for a service (any
3199
2429
  }]);
3200
2430
  apiKey = key.trim();
3201
2431
  }
3202
- const creds = new CredentialsStore(getHyperClawDir$1());
2432
+ const creds = new CredentialsStore(getHyperClawDir());
3203
2433
  await creds.set(safeId, {
3204
2434
  apiKey,
3205
2435
  ...opts.baseUrl ? { baseUrl: opts.baseUrl } : {},
@@ -3207,52 +2437,52 @@ authCmd.command("add <service_id>").description("Add API key for a service (any
3207
2437
  });
3208
2438
  const envVar = opts.envVar || `${safeId.toUpperCase().replace(/-/g, "_")}_API_KEY`;
3209
2439
  const envPath = getEnvFilePath();
3210
- await fs$10.ensureDir(path$10.dirname(envPath));
2440
+ await fs$6.ensureDir(path$6.dirname(envPath));
3211
2441
  let envContent = "";
3212
- if (await fs$10.pathExists(envPath)) envContent = await fs$10.readFile(envPath, "utf8");
2442
+ if (await fs$6.pathExists(envPath)) envContent = await fs$6.readFile(envPath, "utf8");
3213
2443
  const envLine = `${envVar}=${apiKey}`;
3214
2444
  const re = new RegExp(`^${envVar}=.*$`, "m");
3215
2445
  if (re.test(envContent)) envContent = envContent.replace(re, envLine);
3216
2446
  else envContent = envContent.trimEnd() + (envContent ? "\n" : "") + envLine + "\n";
3217
- await fs$10.writeFile(envPath, envContent, { mode: 384 });
3218
- console.log(chalk$13.hex("#06b6d4")(`\n ✔ Added: ${safeId}`));
3219
- console.log(chalk$13.gray(` Credentials: ~/.hyperclaw/credentials/${safeId}.json`));
3220
- console.log(chalk$13.gray(` Env: ${envVar} (in .env — use in skills via process.env.${envVar.replace(/-/g, "_")})`));
3221
- console.log(chalk$13.gray("\n Run: hyperclaw secrets apply to add to shell"));
3222
- console.log(chalk$13.gray(" Run: hyperclaw secrets reload to inject into running gateway\n"));
2447
+ await fs$6.writeFile(envPath, envContent, { mode: 384 });
2448
+ console.log(chalk$10.hex("#06b6d4")(`\n ✔ Added: ${safeId}`));
2449
+ console.log(chalk$10.gray(` Credentials: ~/.hyperclaw/credentials/${safeId}.json`));
2450
+ console.log(chalk$10.gray(` Env: ${envVar} (in .env — use in skills via process.env.${envVar.replace(/-/g, "_")})`));
2451
+ console.log(chalk$10.gray("\n Run: hyperclaw secrets apply to add to shell"));
2452
+ console.log(chalk$10.gray(" Run: hyperclaw secrets reload to inject into running gateway\n"));
3223
2453
  process.exit(0);
3224
2454
  });
3225
2455
  authCmd.command("remove <service_id>").description("Remove API key for a service from credentials and .env").action(async (serviceId) => {
3226
- const chalk$13 = require("chalk");
3227
- const { CredentialsStore } = await Promise.resolve().then(() => require("./credentials-store-B3anVuZD.js"));
3228
- const { getHyperClawDir: getHyperClawDir$1, getEnvFilePath } = await Promise.resolve().then(() => require("./paths-D-QecARF.js"));
3229
- const fs$10 = await import("fs-extra");
2456
+ const chalk$10 = require("chalk");
2457
+ const { CredentialsStore } = await Promise.resolve().then(() => require("./credentials-store-BvnMPJwi.js"));
2458
+ const { getHyperClawDir, getEnvFilePath } = await Promise.resolve().then(() => require("./paths-D-QecARF.js"));
2459
+ const fs$6 = await import("fs-extra");
3230
2460
  const safeId = serviceId.replace(/[^a-zA-Z0-9_-]/g, "_").toLowerCase();
3231
- const creds = new CredentialsStore(getHyperClawDir$1());
2461
+ const creds = new CredentialsStore(getHyperClawDir());
3232
2462
  await creds.remove(safeId);
3233
2463
  const envVar = `${safeId.toUpperCase().replace(/-/g, "_")}_API_KEY`;
3234
2464
  const envPath = getEnvFilePath();
3235
- if (await fs$10.pathExists(envPath)) {
3236
- let c = await fs$10.readFile(envPath, "utf8");
2465
+ if (await fs$6.pathExists(envPath)) {
2466
+ let c = await fs$6.readFile(envPath, "utf8");
3237
2467
  c = c.replace(new RegExp(`^${envVar}=.*\n?`, "gm"), "");
3238
- await fs$10.writeFile(envPath, c);
2468
+ await fs$6.writeFile(envPath, c);
3239
2469
  }
3240
- console.log(chalk$13.hex("#06b6d4")(`\n ✔ Removed: ${safeId}\n`));
2470
+ console.log(chalk$10.hex("#06b6d4")(`\n ✔ Removed: ${safeId}\n`));
3241
2471
  process.exit(0);
3242
2472
  });
3243
2473
  authCmd.command("oauth <provider>").description("Run full OAuth flow. Providers: google, google-gmail (Gmail Pub/Sub), microsoft").option("--client-id <id>", "OAuth client ID (or GOOGLE_OAUTH_CLIENT_ID)").option("--client-secret <secret>", "OAuth client secret (optional for PKCE)").action(async (provider, opts) => {
3244
- const chalk$13 = require("chalk");
3245
- const ora$6 = (await import("ora")).default;
2474
+ const chalk$10 = require("chalk");
2475
+ const ora$4 = (await import("ora")).default;
3246
2476
  try {
3247
- const { runOAuthFlow } = await Promise.resolve().then(() => require("./oauth-flow-HdvMxKmZ.js"));
3248
- const spinner = ora$6("Starting OAuth flow...").start();
2477
+ const { runOAuthFlow } = await Promise.resolve().then(() => require("./oauth-flow-CpWlgvNB.js"));
2478
+ const spinner = ora$4("Starting OAuth flow...").start();
3249
2479
  spinner.text = "Opening browser — complete the consent and return here.";
3250
2480
  const tokens = await runOAuthFlow(provider, {
3251
2481
  clientId: opts.clientId,
3252
2482
  clientSecret: opts.clientSecret
3253
2483
  });
3254
2484
  spinner.stop();
3255
- const { writeOAuthToken } = await Promise.resolve().then(() => require("./oauth-provider-DfEgSucI.js"));
2485
+ const { writeOAuthToken } = await Promise.resolve().then(() => require("./oauth-provider-BZb6qOw5.js"));
3256
2486
  const now = Math.floor(Date.now() / 1e3);
3257
2487
  const expires_at = tokens.expires_in ? now + tokens.expires_in : void 0;
3258
2488
  const tokenUrl = provider === "google" || provider === "google-gmail" ? "https://oauth2.googleapis.com/token" : provider === "microsoft" ? "https://login.microsoftonline.com/common/oauth2/v2.0/token" : void 0;
@@ -3262,46 +2492,46 @@ authCmd.command("oauth <provider>").description("Run full OAuth flow. Providers:
3262
2492
  expires_at,
3263
2493
  token_url: tokenUrl
3264
2494
  });
3265
- console.log(chalk$13.hex("#06b6d4")(`\n ✔ OAuth tokens saved for: ${provider}`));
3266
- console.log(chalk$13.gray(" Set in hyperclaw.json: \"provider\": { \"authType\": \"oauth\", \"providerId\": \"" + provider + "\" }\n"));
2495
+ console.log(chalk$10.hex("#06b6d4")(`\n ✔ OAuth tokens saved for: ${provider}`));
2496
+ console.log(chalk$10.gray(" Set in hyperclaw.json: \"provider\": { \"authType\": \"oauth\", \"providerId\": \"" + provider + "\" }\n"));
3267
2497
  } catch (e) {
3268
- console.error(chalk$13.red("\n ✖ OAuth failed: " + e.message + "\n"));
2498
+ console.error(chalk$10.red("\n ✖ OAuth failed: " + e.message + "\n"));
3269
2499
  process.exit(1);
3270
2500
  }
3271
2501
  process.exit(0);
3272
2502
  });
3273
2503
  authCmd.command("setup-token <provider>").description("Save setup token (Anthropic Claude Pro/Max). Run: claude setup-token, paste result here.").action(async (provider) => {
3274
- const chalk$13 = require("chalk");
3275
- const inquirer$3 = await import("inquirer");
2504
+ const chalk$10 = require("chalk");
2505
+ const inquirer$2 = await import("inquirer");
3276
2506
  if (provider !== "anthropic") {
3277
- console.log(chalk$13.yellow(`\n Provider "${provider}" may not support setup-token. Use "hyperclaw auth add" for API keys.\n`));
2507
+ console.log(chalk$10.yellow(`\n Provider "${provider}" may not support setup-token. Use "hyperclaw auth add" for API keys.\n`));
3278
2508
  process.exit(1);
3279
2509
  }
3280
- const { token } = await inquirer$3.default.prompt([{
2510
+ const { token } = await inquirer$2.default.prompt([{
3281
2511
  type: "password",
3282
2512
  name: "token",
3283
2513
  message: "Paste setup token from `claude setup-token`:",
3284
2514
  mask: "●"
3285
2515
  }]);
3286
2516
  if (!token?.trim()) {
3287
- console.log(chalk$13.red("\n ✖ No token provided.\n"));
2517
+ console.log(chalk$10.red("\n ✖ No token provided.\n"));
3288
2518
  process.exit(1);
3289
2519
  }
3290
- const { writeOAuthToken } = await Promise.resolve().then(() => require("./oauth-provider-DfEgSucI.js"));
2520
+ const { writeOAuthToken } = await Promise.resolve().then(() => require("./oauth-provider-BZb6qOw5.js"));
3291
2521
  await writeOAuthToken("anthropic-setup", {
3292
2522
  access_token: token.trim(),
3293
2523
  token_url: "https://api.anthropic.com"
3294
2524
  });
3295
- console.log(chalk$13.hex("#06b6d4")("\n ✔ Anthropic setup token saved to ~/.hyperclaw/oauth-anthropic-setup.json"));
3296
- console.log(chalk$13.gray(" Use providerId: anthropic with authType: oauth and oauthTokenPath for Claude Pro/Max.\n"));
2525
+ console.log(chalk$10.hex("#06b6d4")("\n ✔ Anthropic setup token saved to ~/.hyperclaw/oauth-anthropic-setup.json"));
2526
+ console.log(chalk$10.gray(" Use providerId: anthropic with authType: oauth and oauthTokenPath for Claude Pro/Max.\n"));
3297
2527
  process.exit(0);
3298
2528
  });
3299
2529
  authCmd.command("oauth-set <provider>").description("Save OAuth tokens manually (access_token, refresh_token, etc.) to ~/.hyperclaw/oauth-<provider>.json").option("--token <access_token>", "Access token").option("--refresh <refresh_token>", "Refresh token (optional)").option("--expires-in <seconds>", "Token lifetime in seconds (optional)").option("--token-url <url>", "Refresh endpoint URL (optional)").action(async (provider, opts) => {
3300
- const chalk$13 = require("chalk");
3301
- const { writeOAuthToken } = await Promise.resolve().then(() => require("./oauth-provider-DfEgSucI.js"));
2530
+ const chalk$10 = require("chalk");
2531
+ const { writeOAuthToken } = await Promise.resolve().then(() => require("./oauth-provider-BZb6qOw5.js"));
3302
2532
  const access_token = opts.token || process.env.OAUTH_ACCESS_TOKEN;
3303
2533
  if (!access_token) {
3304
- console.log(chalk$13.red("\n ✖ Provide --token <access_token> or set OAUTH_ACCESS_TOKEN\n"));
2534
+ console.log(chalk$10.red("\n ✖ Provide --token <access_token> or set OAUTH_ACCESS_TOKEN\n"));
3305
2535
  process.exit(1);
3306
2536
  }
3307
2537
  const expires_at = opts.expiresIn ? Math.floor(Date.now() / 1e3) + parseInt(opts.expiresIn, 10) : void 0;
@@ -3311,22 +2541,22 @@ authCmd.command("oauth-set <provider>").description("Save OAuth tokens manually
3311
2541
  expires_at,
3312
2542
  token_url: opts.tokenUrl || void 0
3313
2543
  });
3314
- console.log(chalk$13.hex("#06b6d4")(`\n ✔ OAuth tokens saved for provider: ${provider}`));
3315
- console.log(chalk$13.gray(" Set in hyperclaw.json: \"provider\": { \"authType\": \"oauth\", \"providerId\": \"" + provider + "\" }\n"));
2544
+ console.log(chalk$10.hex("#06b6d4")(`\n ✔ OAuth tokens saved for provider: ${provider}`));
2545
+ console.log(chalk$10.gray(" Set in hyperclaw.json: \"provider\": { \"authType\": \"oauth\", \"providerId\": \"" + provider + "\" }\n"));
3316
2546
  process.exit(0);
3317
2547
  });
3318
2548
  const workspaceCmd = program.command("workspace").description("Manage agent workspace files");
3319
2549
  workspaceCmd.command("init [dir]").description("Initialize workspace files (SOUL.md, USER.md, TOOLS.md, HEARTBEAT.md, BOOTSTRAP.md) in a directory").action(async (dir) => {
3320
- const chalk$13 = require("chalk");
3321
- const fs$10 = require("fs-extra");
3322
- const path$10 = require("path");
3323
- const os$9 = require("os");
3324
- const targetDir = dir || path$10.join(os$9.homedir(), ".hyperclaw");
2550
+ const chalk$10 = require("chalk");
2551
+ const fs$6 = require("fs-extra");
2552
+ const path$6 = require("path");
2553
+ const os$7 = require("os");
2554
+ const targetDir = dir || path$6.join(os$7.homedir(), ".hyperclaw");
3325
2555
  let cfg = {};
3326
2556
  try {
3327
- cfg = await fs$10.readJson(path$10.join(os$9.homedir(), ".hyperclaw", "hyperclaw.json"));
2557
+ cfg = await fs$6.readJson(path$6.join(os$7.homedir(), ".hyperclaw", "hyperclaw.json"));
3328
2558
  } catch {}
3329
- const { initWorkspaceFiles } = await Promise.resolve().then(() => require("./memory-DIZLpg-p.js"));
2559
+ const { initWorkspaceFiles } = await Promise.resolve().then(() => require("./memory-BI1kPkAN.js"));
3330
2560
  await initWorkspaceFiles({
3331
2561
  agentName: cfg.identity?.agentName || "Hyper",
3332
2562
  personality: cfg.identity?.personality || "helpful and concise",
@@ -3334,17 +2564,17 @@ workspaceCmd.command("init [dir]").description("Initialize workspace files (SOUL
3334
2564
  userName: cfg.identity?.userName || "User",
3335
2565
  rules: cfg.identity?.rules ?? []
3336
2566
  }, targetDir);
3337
- console.log(chalk$13.hex("#06b6d4")(`\n ✔ Workspace files initialized in ${targetDir}`));
3338
- console.log(chalk$13.gray(" Files: SOUL.md USER.md TOOLS.md HEARTBEAT.md BOOTSTRAP.md\n"));
2567
+ console.log(chalk$10.hex("#06b6d4")(`\n ✔ Workspace files initialized in ${targetDir}`));
2568
+ console.log(chalk$10.gray(" Files: SOUL.md USER.md TOOLS.md HEARTBEAT.md BOOTSTRAP.md\n"));
3339
2569
  process.exit(0);
3340
2570
  });
3341
2571
  workspaceCmd.command("show [dir]").description("Show workspace files summary").action(async (dir) => {
3342
- const chalk$13 = require("chalk");
3343
- const fs$10 = require("fs-extra");
3344
- const path$10 = require("path");
3345
- const os$9 = require("os");
3346
- const targetDir = dir || path$10.join(os$9.homedir(), ".hyperclaw");
3347
- console.log(chalk$13.bold.hex("#06b6d4")("\n 📁 WORKSPACE\n"));
2572
+ const chalk$10 = require("chalk");
2573
+ const fs$6 = require("fs-extra");
2574
+ const path$6 = require("path");
2575
+ const os$7 = require("os");
2576
+ const targetDir = dir || path$6.join(os$7.homedir(), ".hyperclaw");
2577
+ console.log(chalk$10.bold.hex("#06b6d4")("\n 📁 WORKSPACE\n"));
3348
2578
  for (const fname of [
3349
2579
  "SOUL.md",
3350
2580
  "USER.md",
@@ -3354,45 +2584,45 @@ workspaceCmd.command("show [dir]").description("Show workspace files summary").a
3354
2584
  "AGENTS.md",
3355
2585
  "MEMORY.md"
3356
2586
  ]) {
3357
- const fpath = path$10.join(targetDir, fname);
3358
- const exists = await fs$10.pathExists(fpath);
3359
- const size = exists ? (await fs$10.stat(fpath)).size : 0;
3360
- const dot = exists ? chalk$13.hex("#06b6d4")("✔") : chalk$13.gray("○");
3361
- console.log(` ${dot} ${fname.padEnd(14)} ${exists ? chalk$13.gray(`${size} bytes`) : chalk$13.gray("(missing)")}`);
2587
+ const fpath = path$6.join(targetDir, fname);
2588
+ const exists = await fs$6.pathExists(fpath);
2589
+ const size = exists ? (await fs$6.stat(fpath)).size : 0;
2590
+ const dot = exists ? chalk$10.hex("#06b6d4")("✔") : chalk$10.gray("○");
2591
+ console.log(` ${dot} ${fname.padEnd(14)} ${exists ? chalk$10.gray(`${size} bytes`) : chalk$10.gray("(missing)")}`);
3362
2592
  }
3363
2593
  console.log();
3364
2594
  process.exit(0);
3365
2595
  });
3366
2596
  const botCmd = program.command("bot").description("HyperClaw Bot — companion bot for remote gateway control");
3367
2597
  botCmd.command("status").action(async () => {
3368
- const { showBotStatus } = await Promise.resolve().then(() => require("./hyperclawbot-DfMGowZC.js"));
2598
+ const { showBotStatus } = await Promise.resolve().then(() => require("./hyperclawbot-D9KCtc4P.js"));
3369
2599
  await showBotStatus();
3370
2600
  process.exit(0);
3371
2601
  });
3372
2602
  botCmd.command("setup").description("Configure HyperClaw Bot (Telegram token, allowed users)").action(async () => {
3373
- const inquirer$3 = require("inquirer");
3374
- const { saveBotConfig } = await Promise.resolve().then(() => require("./hyperclawbot-DfMGowZC.js"));
3375
- const chalk$13 = require("chalk");
3376
- console.log(chalk$13.bold.hex("#06b6d4")("\n 🦅 HYPERCLAW BOT SETUP\n"));
3377
- console.log(chalk$13.gray(" Create a bot at t.me/BotFather, then paste the token below.\n"));
3378
- const { platform } = await inquirer$3.prompt([{
2603
+ const inquirer$2 = require("inquirer");
2604
+ const { saveBotConfig } = await Promise.resolve().then(() => require("./hyperclawbot-D9KCtc4P.js"));
2605
+ const chalk$10 = require("chalk");
2606
+ console.log(chalk$10.bold.hex("#06b6d4")("\n 🦅 HYPERCLAW BOT SETUP\n"));
2607
+ console.log(chalk$10.gray(" Create a bot at t.me/BotFather, then paste the token below.\n"));
2608
+ const { platform } = await inquirer$2.prompt([{
3379
2609
  type: "list",
3380
2610
  name: "platform",
3381
2611
  message: "Platform:",
3382
2612
  choices: ["telegram", "discord"]
3383
2613
  }]);
3384
- const { token } = await inquirer$3.prompt([{
2614
+ const { token } = await inquirer$2.prompt([{
3385
2615
  type: "input",
3386
2616
  name: "token",
3387
2617
  message: platform === "telegram" ? "Bot token (from @BotFather):" : "Discord bot token:",
3388
2618
  validate: (v) => v.trim().length > 10 || "Required"
3389
2619
  }]);
3390
- const { userIds } = await inquirer$3.prompt([{
2620
+ const { userIds } = await inquirer$2.prompt([{
3391
2621
  type: "input",
3392
2622
  name: "userIds",
3393
2623
  message: "Allowed user IDs (comma-separated, leave empty for unrestricted):"
3394
2624
  }]);
3395
- const { gatewayUrl } = await inquirer$3.prompt([{
2625
+ const { gatewayUrl } = await inquirer$2.prompt([{
3396
2626
  type: "input",
3397
2627
  name: "gatewayUrl",
3398
2628
  message: "Gateway URL:",
@@ -3408,20 +2638,20 @@ botCmd.command("setup").description("Configure HyperClaw Bot (Telegram token, al
3408
2638
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
3409
2639
  };
3410
2640
  await saveBotConfig(cfg);
3411
- console.log(chalk$13.hex("#06b6d4")("\n ✔ HyperClaw Bot configured"));
2641
+ console.log(chalk$10.hex("#06b6d4")("\n ✔ HyperClaw Bot configured"));
3412
2642
  if (platform === "discord") try {
3413
2643
  require.resolve("discord.js");
3414
2644
  } catch {
3415
- console.log(chalk$13.yellow(" ⚠ For Discord: run: npm install discord.js"));
2645
+ console.log(chalk$10.yellow(" ⚠ For Discord: run: npm install discord.js"));
3416
2646
  }
3417
- console.log(chalk$13.gray(" Start with: hyperclaw bot start\n"));
2647
+ console.log(chalk$10.gray(" Start with: hyperclaw bot start\n"));
3418
2648
  process.exit(0);
3419
2649
  });
3420
2650
  botCmd.command("start").description("Start HyperClaw Bot (foreground or background)").option("--background", "Run bot in background (use hyperclaw bot stop to stop)").action(async (opts) => {
3421
2651
  const { spawn } = await import("child_process");
3422
- const path$10 = await import("path");
2652
+ const path$6 = await import("path");
3423
2653
  if (opts?.background) {
3424
- const entry = process.argv[1] || path$10.join(__dirname, "run-main.js");
2654
+ const entry = process.argv[1] || path$6.join(__dirname, "run-main.js");
3425
2655
  const child = spawn(process.execPath, [
3426
2656
  entry,
3427
2657
  "bot",
@@ -3433,14 +2663,14 @@ botCmd.command("start").description("Start HyperClaw Bot (foreground or backgrou
3433
2663
  cwd: process.cwd()
3434
2664
  });
3435
2665
  child.unref();
3436
- const { writeBotPid } = await Promise.resolve().then(() => require("./hyperclawbot-DfMGowZC.js"));
2666
+ const { writeBotPid } = await Promise.resolve().then(() => require("./hyperclawbot-D9KCtc4P.js"));
3437
2667
  await writeBotPid(child.pid);
3438
2668
  console.log(require("chalk").green(`\n ✔ HyperClaw Bot started in background (PID ${child.pid})`));
3439
2669
  console.log(require("chalk").gray(" Stop with: hyperclaw bot stop\n"));
3440
2670
  process.exit(0);
3441
2671
  return;
3442
2672
  }
3443
- const { loadBotConfig, TelegramHyperClawBot, DiscordHyperClawBot } = await Promise.resolve().then(() => require("./hyperclawbot-DfMGowZC.js"));
2673
+ const { loadBotConfig, TelegramHyperClawBot, DiscordHyperClawBot } = await Promise.resolve().then(() => require("./hyperclawbot-D9KCtc4P.js"));
3444
2674
  const cfg = await loadBotConfig();
3445
2675
  if (!cfg) {
3446
2676
  console.log(require("chalk").red("\n ✖ HyperClaw Bot not configured. Run: hyperclaw bot setup\n"));
@@ -3466,42 +2696,42 @@ botCmd.command("start").description("Start HyperClaw Bot (foreground or backgrou
3466
2696
  }
3467
2697
  });
3468
2698
  botCmd.command("stop").description("Stop HyperClaw Bot (when running in background)").action(async () => {
3469
- const chalk$13 = require("chalk");
3470
- const { stopBotProcess } = await Promise.resolve().then(() => require("./hyperclawbot-DfMGowZC.js"));
2699
+ const chalk$10 = require("chalk");
2700
+ const { stopBotProcess } = await Promise.resolve().then(() => require("./hyperclawbot-D9KCtc4P.js"));
3471
2701
  const stopped = await stopBotProcess();
3472
- if (stopped) console.log(chalk$13.green("\n ✔ HyperClaw Bot stopped\n"));
3473
- else console.log(chalk$13.gray("\n Bot not running in background (no PID file). Use Ctrl+C to stop foreground bot.\n"));
2702
+ if (stopped) console.log(chalk$10.green("\n ✔ HyperClaw Bot stopped\n"));
2703
+ else console.log(chalk$10.gray("\n Bot not running in background (no PID file). Use Ctrl+C to stop foreground bot.\n"));
3474
2704
  process.exit(stopped ? 0 : 0);
3475
2705
  });
3476
2706
  memCmd.command("search <query>").description("Search MEMORY.md").action(async (query) => {
3477
- const { searchMemory } = await Promise.resolve().then(() => require("./src-BptR-54a.js"));
2707
+ const { searchMemory } = await Promise.resolve().then(() => require("./src-BEVLgaF1.js"));
3478
2708
  await searchMemory(query);
3479
2709
  process.exit(0);
3480
2710
  });
3481
2711
  memCmd.command("auto-show").description("Show auto-extracted memories from MEMORY.md").action(async () => {
3482
- const { showMemory } = await Promise.resolve().then(() => require("./src-BptR-54a.js"));
2712
+ const { showMemory } = await Promise.resolve().then(() => require("./src-BEVLgaF1.js"));
3483
2713
  await showMemory();
3484
2714
  process.exit(0);
3485
2715
  });
3486
2716
  memCmd.command("clear").description("Clear all auto-extracted memories").action(async () => {
3487
- const { clearMemory } = await Promise.resolve().then(() => require("./src-BptR-54a.js"));
2717
+ const { clearMemory } = await Promise.resolve().then(() => require("./src-BEVLgaF1.js"));
3488
2718
  await clearMemory();
3489
2719
  process.exit(0);
3490
2720
  });
3491
2721
  memCmd.command("save <text>").description("Manually save a fact to MEMORY.md").action(async (text) => {
3492
- const { saveMemoryDirect } = await Promise.resolve().then(() => require("./src-BptR-54a.js"));
2722
+ const { saveMemoryDirect } = await Promise.resolve().then(() => require("./src-BEVLgaF1.js"));
3493
2723
  await saveMemoryDirect(text);
3494
2724
  console.log(chalk.default.hex("#06b6d4")(` ✅ Saved: ${text}\n`));
3495
2725
  process.exit(0);
3496
2726
  });
3497
2727
  const pcCmd = program.command("pc").description("PC access — give the AI access to your computer");
3498
2728
  pcCmd.command("status").description("Show PC access status and config").action(async () => {
3499
- const { showPCAccessStatus } = await Promise.resolve().then(() => require("./src-BptR-54a.js"));
2729
+ const { showPCAccessStatus } = await Promise.resolve().then(() => require("./src-BEVLgaF1.js"));
3500
2730
  await showPCAccessStatus();
3501
2731
  process.exit(0);
3502
2732
  });
3503
2733
  pcCmd.command("enable").description("Enable PC access for the AI").option("--level <level>", "Access level: read-only | sandboxed | full", "full").option("--paths <paths>", "Comma-separated allowed paths (sandboxed mode)").action(async (opts) => {
3504
- const { savePCAccessConfig } = await Promise.resolve().then(() => require("./src-BptR-54a.js"));
2734
+ const { savePCAccessConfig } = await Promise.resolve().then(() => require("./src-BEVLgaF1.js"));
3505
2735
  const level = opts.level;
3506
2736
  const allowed = [
3507
2737
  "read-only",
@@ -3528,7 +2758,7 @@ pcCmd.command("enable").description("Enable PC access for the AI").option("--lev
3528
2758
  process.exit(0);
3529
2759
  });
3530
2760
  pcCmd.command("disable").description("Disable PC access").action(async () => {
3531
- const { savePCAccessConfig } = await Promise.resolve().then(() => require("./src-BptR-54a.js"));
2761
+ const { savePCAccessConfig } = await Promise.resolve().then(() => require("./src-BEVLgaF1.js"));
3532
2762
  await savePCAccessConfig({ enabled: false });
3533
2763
  console.log(chalk.default.hex("#06b6d4")("\n ✅ PC access disabled\n"));
3534
2764
  process.exit(0);
@@ -3552,7 +2782,7 @@ pcCmd.command("log").description("Show PC access audit log").option("-n, --lines
3552
2782
  process.exit(0);
3553
2783
  });
3554
2784
  pcCmd.command("run <command>").description("Run a shell command via PC access (must be enabled)").action(async (command) => {
3555
- const { loadPCAccessConfig, getPCAccessTools } = await Promise.resolve().then(() => require("./src-BptR-54a.js"));
2785
+ const { loadPCAccessConfig, getPCAccessTools } = await Promise.resolve().then(() => require("./src-BEVLgaF1.js"));
3556
2786
  const cfg = await loadPCAccessConfig();
3557
2787
  if (!cfg.enabled) {
3558
2788
  console.log(chalk.default.red("\n ✖ PC access disabled. Run: hyperclaw pc enable\n"));
@@ -3565,14 +2795,42 @@ pcCmd.command("run <command>").description("Run a shell command via PC access (m
3565
2795
  console.log(result);
3566
2796
  process.exit(0);
3567
2797
  });
2798
+ function checkForUpdate() {
2799
+ const { execFile: execFile$1 } = require("child_process");
2800
+ const { readFileSync } = require("fs");
2801
+ const path$6 = require("path");
2802
+ try {
2803
+ const pkgPath = path$6.resolve(__dirname, "../../package.json");
2804
+ const current = JSON.parse(readFileSync(pkgPath, "utf8")).version;
2805
+ execFile$1("npm", [
2806
+ "view",
2807
+ "hyperclaw",
2808
+ "version",
2809
+ "--json"
2810
+ ], { timeout: 5e3 }, (_err, stdout) => {
2811
+ if (_err || !stdout) return;
2812
+ try {
2813
+ const latest = JSON.parse(stdout.trim());
2814
+ if (latest && latest !== current) {
2815
+ const semver = (v) => v.split(".").map(Number);
2816
+ const [lMaj, lMin, lPat] = semver(latest);
2817
+ const [cMaj, cMin, cPat] = semver(current);
2818
+ const isNewer = lMaj > cMaj || lMaj === cMaj && lMin > cMin || lMaj === cMaj && lMin === cMin && lPat > cPat;
2819
+ if (isNewer) process.stdout.write(chalk.default.yellow(`\n ⬆ Update available: ${chalk.default.dim(current)} → ${chalk.default.green(latest)}\n`) + chalk.default.gray(` npm install -g hyperclaw@latest\n\n`));
2820
+ }
2821
+ } catch {}
2822
+ });
2823
+ } catch {}
2824
+ }
2825
+ checkForUpdate();
3568
2826
  if (process.argv.length === 2) (async () => {
3569
- const { ConfigManager: ConfigManager$1 } = await Promise.resolve().then(() => require("./manager-BX2lIsmk.js"));
2827
+ const { ConfigManager: ConfigManager$1 } = await Promise.resolve().then(() => require("./manager-DLmZI-9R.js"));
3570
2828
  const cfg = await new ConfigManager$1().load().catch(() => null);
3571
2829
  if (cfg?.provider?.apiKey || cfg?.provider?.providerId) {
3572
2830
  await new require_onboard.Banner().showNeonBanner(false);
3573
2831
  const { getTheme } = await Promise.resolve().then(() => require("./theme-Iefa3L63.js"));
3574
2832
  const t = getTheme(false);
3575
- const chalk$13 = require("chalk");
2833
+ const chalk$10 = require("chalk");
3576
2834
  console.log(t.bold(" Quick actions:\n"));
3577
2835
  console.log(` ${t.c("hyperclaw onboard")} — re-run setup wizard`);
3578
2836
  console.log(` ${t.c("hyperclaw onboard --install-daemon")} — wizard + daemon (full PC access)`);
@@ -3584,7 +2842,7 @@ if (process.argv.length === 2) (async () => {
3584
2842
  console.log(` ${t.c("hyperclaw --help")} — all commands\n`);
3585
2843
  } else {
3586
2844
  await new require_onboard.Banner().showNeonBanner(false);
3587
- const { HyperClawWizard: HyperClawWizard$1 } = await Promise.resolve().then(() => require("./onboard-3q20ZyHj.js"));
2845
+ const { HyperClawWizard: HyperClawWizard$1 } = await Promise.resolve().then(() => require("./onboard-aTwlQs-4.js"));
3588
2846
  await new HyperClawWizard$1().run({ wizard: true });
3589
2847
  }
3590
2848
  process.exit(0);