hyperclaw 5.0.1 → 5.0.3

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 (157) hide show
  1. package/LICENSE +2 -1
  2. package/README.md +373 -32
  3. package/bin/hyperclaw.js +3 -0
  4. package/dist/a2ui-protocol-Gzm29Gaw.js +75 -0
  5. package/dist/agents-routing-Biy5ew4a.js +4 -0
  6. package/dist/agents-routing-CL3HQNoM.js +327 -0
  7. package/dist/api-keys-guide-ChbThbPj.js +149 -0
  8. package/dist/audit-NPIMmOSq.js +441 -0
  9. package/dist/bounty-tools-BUqUKjt0.js +211 -0
  10. package/dist/browser-tools-CxJY6pAn.js +5 -0
  11. package/dist/browser-tools-JZ9ji6AW.js +179 -0
  12. package/dist/chat-GGvIJUVJ.js +258 -0
  13. package/dist/chat-qVuqhlPu.js +258 -0
  14. package/dist/claw-tasks-B-8RRMdq.js +80 -0
  15. package/dist/connector-1x1rCBHz.js +162 -0
  16. package/dist/connector-B4jeCULG.js +305 -0
  17. package/dist/connector-B7qngfkT.js +286 -0
  18. package/dist/connector-B8BK0GBo.js +531 -0
  19. package/dist/connector-BE9eJs8-.js +182 -0
  20. package/dist/connector-BEe-DTGQ.js +189 -0
  21. package/dist/connector-BU7p5ZgB.js +167 -0
  22. package/dist/connector-BUzzq7Ij.js +568 -0
  23. package/dist/connector-BpDqLgnW.js +419 -0
  24. package/dist/connector-BpW88ut2.js +189 -0
  25. package/dist/connector-Bxv-gy8U.js +167 -0
  26. package/dist/connector-Bz14zcJv.js +213 -0
  27. package/dist/connector-C1zP5-5q.js +85 -0
  28. package/dist/connector-CAcpcovF.js +498 -0
  29. package/dist/connector-CJgVjS58.js +181 -0
  30. package/dist/connector-Cf53D6qV.js +425 -0
  31. package/dist/connector-CyHmlbNz.js +508 -0
  32. package/dist/connector-D22mJGVu.js +340 -0
  33. package/dist/connector-D6RtMmlL.js +225 -0
  34. package/dist/connector-D9EnT8A4.js +280 -0
  35. package/dist/connector-DNDwIh37.js +239 -0
  36. package/dist/connector-Di27MeO4.js +350 -0
  37. package/dist/connector-Do0BPiHt.js +194 -0
  38. package/dist/connector-DvLwOfJy.js +192 -0
  39. package/dist/connector-DvU83NSq.js +181 -0
  40. package/dist/connector-DxskpDc_.js +173 -0
  41. package/dist/connector-byy3eISx.js +552 -0
  42. package/dist/connector-vV89hsyd.js +218 -0
  43. package/dist/cost-tracker-fnaj_6M9.js +103 -0
  44. package/dist/credentials-store-BxijEirw.js +77 -0
  45. package/dist/credentials-store-CPkVO6-z.js +4 -0
  46. package/dist/cron-tasks-L0mz1yyU.js +82 -0
  47. package/dist/daemon-BpKOVkT1.js +5 -0
  48. package/dist/daemon-CNyunwkR.js +5 -0
  49. package/dist/daemon-CindY8OK.js +318 -0
  50. package/dist/daemon-MtT2Tqkp.js +318 -0
  51. package/dist/delivery-DgiZcJBp.js +4 -0
  52. package/dist/delivery-otAU4alM.js +95 -0
  53. package/dist/destructive-gate-CA0DtA5K.js +101 -0
  54. package/dist/developer-keys-Cnd1kswV.js +127 -0
  55. package/dist/developer-keys-DENo3ZA6.js +8 -0
  56. package/dist/doctor-Dgjoc3DG.js +230 -0
  57. package/dist/doctor-RwsOhtAl.js +6 -0
  58. package/dist/engine-DAS8lres.js +305 -0
  59. package/dist/engine-D_VeoZHw.js +305 -0
  60. package/dist/engine-JjRnhlsE.js +7 -0
  61. package/dist/engine-R0howgUa.js +7 -0
  62. package/dist/env-resolve-BFJXWl94.js +115 -0
  63. package/dist/env-resolve-bDYssfih.js +10 -0
  64. package/dist/extraction-tools-DbxnxIco.js +5 -0
  65. package/dist/extraction-tools-Dg7AHS35.js +91 -0
  66. package/dist/form_data-CGAy4HE0.js +8657 -0
  67. package/dist/gmail-watch-setup-C3uSWznp.js +40 -0
  68. package/dist/health-DUjluWHQ.js +6 -0
  69. package/dist/health-DVfkpUQW.js +152 -0
  70. package/dist/heartbeat-engine-CrgL4mrP.js +83 -0
  71. package/dist/hub-BO6bj8Yj.js +515 -0
  72. package/dist/hub-Bu52YZqW.js +6 -0
  73. package/dist/hyperclawbot-BrcoYLOp.js +505 -0
  74. package/dist/hyperclawbot-CnNeGJ-M.js +505 -0
  75. package/dist/inference-DHR82Gh7.js +6 -0
  76. package/dist/inference-DhA8jpfH.js +2692 -0
  77. package/dist/knowledge-graph-BrYpSgxW.js +131 -0
  78. package/dist/loader-9JqY6Nlq.js +4 -0
  79. package/dist/loader-Cjdd1kw4.js +400 -0
  80. package/dist/logger-DCT2l9GV.js +83 -0
  81. package/dist/manager-3cq3DydI.js +4 -0
  82. package/dist/manager-BUrFrPuq.js +117 -0
  83. package/dist/manager-Bi9UYyVR.js +105 -0
  84. package/dist/manager-Biz9ixWJ.js +40 -0
  85. package/dist/manager-CBUHJiY7.js +6 -0
  86. package/dist/manager-CVLLaKmq.js +218 -0
  87. package/dist/mcp-CUoTCMw-.js +139 -0
  88. package/dist/mcp-loader-BIz-450x.js +94 -0
  89. package/dist/mcp-loader-nkCSFwxV.js +94 -0
  90. package/dist/memory-OL77OMOr.js +270 -0
  91. package/dist/memory-auto-D-L2q21G.js +306 -0
  92. package/dist/memory-auto-DTcy5VBy.js +5 -0
  93. package/dist/memory-gUi4VaIf.js +4 -0
  94. package/dist/memory-integration-B8RSN4pr.js +91 -0
  95. package/dist/moltbook-B-40gQOL.js +81 -0
  96. package/dist/node-TWxRm84k.js +222 -0
  97. package/dist/nodes-registry-DKRtsbNg.js +52 -0
  98. package/dist/oauth-flow-JCfporKq.js +150 -0
  99. package/dist/oauth-provider-4R0EJlsT.js +110 -0
  100. package/dist/observability-CDZmeHfa.js +89 -0
  101. package/dist/onboard-B2V24zkc.js +11 -0
  102. package/dist/onboard-BVOtKQdh.js +3641 -0
  103. package/dist/onboard-CGNIw27w.js +11 -0
  104. package/dist/onboard-CdJCHc1l.js +3959 -0
  105. package/dist/orchestrator-CcKx1Ovk.js +189 -0
  106. package/dist/orchestrator-DZKfDwbu.js +189 -0
  107. package/dist/orchestrator-DcFfDLTX.js +6 -0
  108. package/dist/orchestrator-JMJXUA6c.js +6 -0
  109. package/dist/osint-B6BZKQAD.js +277 -0
  110. package/dist/pairing-B6RArWhD.js +196 -0
  111. package/dist/pairing-BsQ08DLq.js +4 -0
  112. package/dist/pc-access-B0KocJNe.js +819 -0
  113. package/dist/pc-access-DkzmugZ7.js +8 -0
  114. package/dist/pending-approval-C_HkX1QL.js +22 -0
  115. package/dist/providers-DxiamZSL.js +5 -0
  116. package/dist/providers-Dy15rDb7.js +657 -0
  117. package/dist/reminders-store-CzUY0zYx.js +58 -0
  118. package/dist/renderer-ANNfXsHn.js +225 -0
  119. package/dist/rules-BSQwwAYC.js +103 -0
  120. package/dist/run-main.js +112 -117
  121. package/dist/runner-BHRSOPEU.js +1271 -0
  122. package/dist/security--oQObeJO.js +4 -0
  123. package/dist/security-wBOg0TA8.js +73 -0
  124. package/dist/server-B31aM6eh.js +1255 -0
  125. package/dist/server-CbTTpB5m.js +1255 -0
  126. package/dist/server-D2KyJXOC.js +4 -0
  127. package/dist/server-DP_bPzvI.js +4 -0
  128. package/dist/session-store-B09r5HgB.js +5 -0
  129. package/dist/session-store-DCTQIVur.js +113 -0
  130. package/dist/sessions-tools-BdlN6Pb6.js +95 -0
  131. package/dist/sessions-tools-JVLDKSJ_.js +5 -0
  132. package/dist/skill-loader-B5oeliGu.js +7 -0
  133. package/dist/skill-loader-Wf3brNOj.js +160 -0
  134. package/dist/skill-runtime-BGlvly2s.js +102 -0
  135. package/dist/skill-runtime-C-TGLn1X.js +102 -0
  136. package/dist/skill-runtime-Cgo0CKKU.js +5 -0
  137. package/dist/skill-runtime-DhL2T76p.js +5 -0
  138. package/dist/src-BbPa6Q8p.js +63 -0
  139. package/dist/src-BeXtfkK2.js +458 -0
  140. package/dist/src-Bnw5V6w0.js +63 -0
  141. package/dist/src-C5enhnSg.js +458 -0
  142. package/dist/src-CGQjRI4N.js +20 -0
  143. package/dist/sub-agent-tools-B7Z6MP8P.js +39 -0
  144. package/dist/sub-agent-tools-CmE345s_.js +39 -0
  145. package/dist/theme-D0smfC_l.js +8 -0
  146. package/dist/theme-DajRRZbA.js +180 -0
  147. package/dist/tool-policy-DgNqFWYn.js +189 -0
  148. package/dist/tts-elevenlabs-JeFaGNJU.js +61 -0
  149. package/dist/update-check-BVEqHhFY.js +83 -0
  150. package/dist/vision-fky3elEo.js +121 -0
  151. package/dist/vision-tools-C8B3776g.js +5 -0
  152. package/dist/vision-tools-dwn9p4el.js +51 -0
  153. package/dist/voice-transcription-B6RtplmN.js +138 -0
  154. package/dist/website-watch-tools-B-jRAeTe.js +139 -0
  155. package/dist/website-watch-tools-BC9xAL67.js +5 -0
  156. package/package.json +4 -3
  157. package/scripts/postinstall.js +43 -32
@@ -0,0 +1,138 @@
1
+ const require_chunk = require('./chunk-jS-bbMI5.js');
2
+ const fs_extra = require_chunk.__toESM(require("fs-extra"));
3
+ const path = require_chunk.__toESM(require("path"));
4
+ const os = require_chunk.__toESM(require("os"));
5
+ const https = require_chunk.__toESM(require("https"));
6
+
7
+ //#region src/services/voice-transcription.ts
8
+ const HC_DIR = path.default.join(os.default.homedir(), ".hyperclaw");
9
+ async function getConfig() {
10
+ try {
11
+ const cfg = await fs_extra.default.readJson(path.default.join(HC_DIR, "hyperclaw.json"));
12
+ const providerId = cfg?.provider?.providerId;
13
+ const apiKey = cfg?.provider?.apiKey;
14
+ return {
15
+ providerId,
16
+ apiKey
17
+ };
18
+ } catch {
19
+ return {};
20
+ }
21
+ }
22
+ async function transcribeWithWhisper(buffer, apiKey) {
23
+ return new Promise((resolve, reject) => {
24
+ const boundary = "----HyperClaw" + Date.now();
25
+ const header = [
26
+ `--${boundary}`,
27
+ "Content-Disposition: form-data; name=\"file\"; filename=\"audio.ogg\"",
28
+ "Content-Type: application/octet-stream",
29
+ "",
30
+ ""
31
+ ].join("\r\n");
32
+ const footer = `\r\n--${boundary}\r\nContent-Disposition: form-data; name="model"\r\n\r\nwhisper-1\r\n--${boundary}--\r\n`;
33
+ const body = Buffer.concat([
34
+ Buffer.from(header, "utf8"),
35
+ buffer,
36
+ Buffer.from(footer, "utf8")
37
+ ]);
38
+ const req = https.default.request({
39
+ hostname: "api.openai.com",
40
+ port: 443,
41
+ path: "/v1/audio/transcriptions",
42
+ method: "POST",
43
+ headers: {
44
+ "Authorization": `Bearer ${apiKey}`,
45
+ "Content-Type": `multipart/form-data; boundary=${boundary}`,
46
+ "Content-Length": body.length
47
+ }
48
+ }, (res) => {
49
+ let data = "";
50
+ res.on("data", (c) => data += c);
51
+ res.on("end", () => {
52
+ try {
53
+ const j = JSON.parse(data);
54
+ resolve(j.text?.trim() || "[No transcription]");
55
+ } catch {
56
+ resolve(`[Transcription error: ${data.slice(0, 100)}]`);
57
+ }
58
+ });
59
+ });
60
+ req.on("error", reject);
61
+ req.write(body);
62
+ req.end();
63
+ });
64
+ }
65
+ async function transcribeWithGemini(buffer, apiKey) {
66
+ const base64 = buffer.toString("base64");
67
+ const payload = JSON.stringify({
68
+ contents: [{ parts: [{ text: "Transcribe this audio to text. Output only the transcription, no other text." }, { inlineData: {
69
+ mimeType: "audio/ogg",
70
+ data: base64
71
+ } }] }],
72
+ generationConfig: { maxOutputTokens: 1024 }
73
+ });
74
+ return new Promise((resolve, reject) => {
75
+ const req = https.default.request({
76
+ hostname: "generativelanguage.googleapis.com",
77
+ port: 443,
78
+ path: "/v1beta/models/gemini-2.0-flash:generateContent?key=" + encodeURIComponent(apiKey),
79
+ method: "POST",
80
+ headers: {
81
+ "Content-Type": "application/json",
82
+ "Content-Length": Buffer.byteLength(payload)
83
+ }
84
+ }, (res) => {
85
+ let data = "";
86
+ res.on("data", (c) => data += c);
87
+ res.on("end", () => {
88
+ try {
89
+ const j = JSON.parse(data);
90
+ const text = j.candidates?.[0]?.content?.parts?.[0]?.text?.trim();
91
+ resolve(text || "[No transcription]");
92
+ } catch {
93
+ resolve(`[Transcription error: ${data.slice(0, 100)}]`);
94
+ }
95
+ });
96
+ });
97
+ req.on("error", reject);
98
+ req.write(payload);
99
+ req.end();
100
+ });
101
+ }
102
+ /**
103
+
104
+ * Transcribe audio using configured provider or fallbacks.
105
+
106
+ * Providers: OpenAI (Whisper), Google (Gemini), OpenRouter.
107
+
108
+ * Env: OPENAI_API_KEY, WHISPER_API_KEY, GOOGLE_AI_API_KEY.
109
+
110
+ */
111
+ async function transcribeVoiceNote(audioPathOrBuffer, apiKey) {
112
+ let buffer;
113
+ if (typeof audioPathOrBuffer === "string") buffer = await fs_extra.default.readFile(audioPathOrBuffer);
114
+ else buffer = audioPathOrBuffer;
115
+ const cfg = await getConfig();
116
+ const openaiKey = apiKey || process.env.OPENAI_API_KEY || process.env.WHISPER_API_KEY || (cfg.providerId === "openai" || cfg.providerId === "openrouter" ? cfg.apiKey : "");
117
+ const googleKey = process.env.GOOGLE_AI_API_KEY || (cfg.providerId === "google" ? cfg.apiKey : "");
118
+ if (cfg.providerId === "google" && googleKey) try {
119
+ return await transcribeWithGemini(buffer, googleKey);
120
+ } catch {}
121
+ if ((cfg.providerId === "openrouter" || cfg.providerId === "openai") && openaiKey) try {
122
+ return await transcribeWithWhisper(buffer, openaiKey);
123
+ } catch {}
124
+ if (openaiKey) try {
125
+ return await transcribeWithWhisper(buffer, openaiKey);
126
+ } catch (e) {
127
+ return `[Transcription failed: ${e.message}]`;
128
+ }
129
+ if (googleKey) try {
130
+ return await transcribeWithGemini(buffer, googleKey);
131
+ } catch (e) {
132
+ return `[Transcription failed: ${e.message}]`;
133
+ }
134
+ return "[Voice note — add OPENAI_API_KEY or GOOGLE_AI_API_KEY (or select OpenAI/Google provider in the wizard) for transcription]";
135
+ }
136
+
137
+ //#endregion
138
+ exports.transcribeVoiceNote = transcribeVoiceNote;
@@ -0,0 +1,139 @@
1
+ const require_chunk = require('./chunk-jS-bbMI5.js');
2
+ const fs_extra = require_chunk.__toESM(require("fs-extra"));
3
+ const path = require_chunk.__toESM(require("path"));
4
+ const os = require_chunk.__toESM(require("os"));
5
+ const crypto = require_chunk.__toESM(require("crypto"));
6
+ const http = require_chunk.__toESM(require("http"));
7
+ const https = require_chunk.__toESM(require("https"));
8
+
9
+ //#region packages/core/src/agent/website-watch-tools.ts
10
+ async function fetchUrl(url) {
11
+ return new Promise((resolve, reject) => {
12
+ const client = url.startsWith("https") ? https.default : http.default;
13
+ const req = client.get(url, { timeout: 15e3 }, (res) => {
14
+ let data = "";
15
+ res.on("data", (c) => data += c);
16
+ res.on("end", () => resolve(data));
17
+ });
18
+ req.on("error", reject);
19
+ req.on("timeout", () => {
20
+ req.destroy();
21
+ reject(new Error("Timeout"));
22
+ });
23
+ });
24
+ }
25
+ function hashContent(html) {
26
+ const cleaned = html.replace(/\s+/g, " ").replace(/<script[^>]*>[\s\S]*?<\/script>/gi, "").slice(0, 5e4);
27
+ return crypto.default.createHash("sha256").update(cleaned).digest("hex").slice(0, 16);
28
+ }
29
+ async function loadWatches() {
30
+ try {
31
+ return await fs_extra.default.readJson(WATCH_FILE);
32
+ } catch {
33
+ return {};
34
+ }
35
+ }
36
+ async function saveWatches(watches) {
37
+ await fs_extra.default.ensureDir(path.default.dirname(WATCH_FILE));
38
+ await fs_extra.default.writeJson(WATCH_FILE, watches, { spaces: 2 });
39
+ }
40
+ function getWebsiteWatchTools() {
41
+ return [
42
+ {
43
+ name: "watch_website_add",
44
+ description: "Add a URL to the website change watch list. Use with watch_website_check to detect changes.",
45
+ input_schema: {
46
+ type: "object",
47
+ properties: { url: {
48
+ type: "string",
49
+ description: "URL to watch (e.g. https://example.com)"
50
+ } },
51
+ required: ["url"]
52
+ },
53
+ handler: async (input) => {
54
+ const url = input.url.trim();
55
+ if (!url.startsWith("http")) return "Error: URL must start with http:// or https://";
56
+ const watches = await loadWatches();
57
+ const content = await fetchUrl(url).catch((e) => `[fetch error: ${e.message}]`);
58
+ const hash = hashContent(content);
59
+ watches[url] = {
60
+ url,
61
+ lastHash: hash,
62
+ lastCheck: (/* @__PURE__ */ new Date()).toISOString(),
63
+ lastSnippet: content.slice(0, 200)
64
+ };
65
+ await saveWatches(watches);
66
+ return `Added: ${url}. Initial hash: ${hash}`;
67
+ }
68
+ },
69
+ {
70
+ name: "watch_website_check",
71
+ description: "Check watched URLs for changes. Returns list of URLs that changed since last check.",
72
+ input_schema: {
73
+ type: "object",
74
+ properties: { url: {
75
+ type: "string",
76
+ description: "Specific URL to check (optional — checks all if omitted)"
77
+ } }
78
+ },
79
+ handler: async (input) => {
80
+ const watches = await loadWatches();
81
+ const filterUrl = input.url;
82
+ const toCheck = filterUrl ? [filterUrl] : Object.keys(watches);
83
+ const changed = [];
84
+ for (const url of toCheck) {
85
+ const ent = watches[url];
86
+ if (!ent) continue;
87
+ try {
88
+ const content = await fetchUrl(url);
89
+ const hash = hashContent(content);
90
+ ent.lastCheck = (/* @__PURE__ */ new Date()).toISOString();
91
+ if (hash !== ent.lastHash) {
92
+ ent.lastHash = hash;
93
+ ent.lastSnippet = content.slice(0, 300);
94
+ changed.push(url);
95
+ }
96
+ watches[url] = ent;
97
+ } catch (e) {
98
+ changed.push(`${url} [error: ${e.message}]`);
99
+ }
100
+ }
101
+ await saveWatches(watches);
102
+ if (changed.length === 0) return "No changes detected.";
103
+ return `Changed: ${changed.join(", ")}`;
104
+ }
105
+ },
106
+ {
107
+ name: "watch_website_list",
108
+ description: "List all watched URLs.",
109
+ input_schema: {
110
+ type: "object",
111
+ properties: {}
112
+ },
113
+ handler: async () => {
114
+ const watches = await loadWatches();
115
+ const urls = Object.keys(watches);
116
+ if (urls.length === 0) return "No watched URLs. Add with watch_website_add.";
117
+ return urls.map((u) => `- ${u} (last: ${watches[u].lastCheck})`).join("\n");
118
+ }
119
+ }
120
+ ];
121
+ }
122
+ var WATCH_FILE;
123
+ var init_website_watch_tools = require_chunk.__esm({ "packages/core/src/agent/website-watch-tools.ts"() {
124
+ WATCH_FILE = path.default.join(os.default.homedir(), ".hyperclaw", "website-watches.json");
125
+ } });
126
+
127
+ //#endregion
128
+ Object.defineProperty(exports, 'getWebsiteWatchTools', {
129
+ enumerable: true,
130
+ get: function () {
131
+ return getWebsiteWatchTools;
132
+ }
133
+ });
134
+ Object.defineProperty(exports, 'init_website_watch_tools', {
135
+ enumerable: true,
136
+ get: function () {
137
+ return init_website_watch_tools;
138
+ }
139
+ });
@@ -0,0 +1,5 @@
1
+ const require_chunk = require('./chunk-jS-bbMI5.js');
2
+ const require_website_watch_tools = require('./website-watch-tools-B-jRAeTe.js');
3
+
4
+ require_website_watch_tools.init_website_watch_tools();
5
+ exports.getWebsiteWatchTools = require_website_watch_tools.getWebsiteWatchTools;
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "hyperclaw",
3
- "version": "5.0.1",
3
+ "version": "5.0.3",
4
4
  "description": "⚡ HyperClaw — AI Gateway Platform. The Lobster Evolution 🦅",
5
5
  "main": "dist/run-main.js",
6
6
  "bin": {
7
- "hyperclaw": "dist/run-main.js"
7
+ "hyperclaw": "bin/hyperclaw.js"
8
8
  },
9
9
  "files": [
10
+ "bin/",
10
11
  "dist/",
11
12
  "scripts/",
12
13
  "README.md",
@@ -37,7 +38,7 @@
37
38
  "core:build": "tsc --noEmit -p packages/core/tsconfig.json",
38
39
  "prepare": "npm run build",
39
40
  "prepublishOnly": "npm run build && npm run sdk:build && npm run core:build",
40
- "postinstall": "node scripts/postinstall.js 2>/dev/null || true",
41
+ "postinstall": "node scripts/postinstall.js",
41
42
  "test": "vitest run",
42
43
  "test:watch": "vitest",
43
44
  "test:coverage": "vitest run --coverage",
@@ -1,42 +1,53 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
  // scripts/postinstall.js
3
3
  // Shown after `npm install -g hyperclaw` — guides user to onboard.
4
4
  // Kept dependency-free (plain Node.js) so it works before npm install completes.
5
+ // Wrapped in try-catch so a failure here never breaks the install.
5
6
 
6
7
  'use strict';
7
8
 
8
- // Skip in CI or when installed as a dependency (not globally)
9
- if (process.env.CI || process.env.npm_config_global !== 'true') {
10
- process.exit(0);
11
- }
9
+ try {
10
+ // Skip in CI or when installed as a dependency (not globally)
11
+ if (process.env.CI || process.env.npm_config_global !== 'true') {
12
+ process.exit(0);
13
+ }
12
14
 
13
- const isWin = process.platform === 'win32';
15
+ const cyan = (s) => `\x1b[36m${s}\x1b[0m`;
16
+ const bold = (s) => `\x1b[1m${s}\x1b[0m`;
17
+ const gray = (s) => `\x1b[90m${s}\x1b[0m`;
18
+ const green = (s) => `\x1b[32m${s}\x1b[0m`;
14
19
 
15
- const cyan = (s) => `\x1b[36m${s}\x1b[0m`;
16
- const bold = (s) => `\x1b[1m${s}\x1b[0m`;
17
- const gray = (s) => `\x1b[90m${s}\x1b[0m`;
18
- const green = (s) => `\x1b[32m${s}\x1b[0m`;
19
- const dim = (s) => `\x1b[2m${s}\x1b[0m`;
20
+ let version = '5.0.3';
21
+ try {
22
+ const path = require('path');
23
+ const fs = require('fs');
24
+ const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'));
25
+ version = pkg.version || version;
26
+ } catch (_) {}
20
27
 
21
- const line = gray('─'.repeat(56));
28
+ const line = gray('─'.repeat(56));
22
29
 
23
- console.log('');
24
- console.log(line);
25
- console.log('');
26
- console.log(` ${bold(' HyperClaw')} ${cyan('v' + require('../package.json').version)} ${gray('installed successfully')}`);
27
- console.log('');
28
- console.log(` Run the setup wizard to get started:`);
29
- console.log('');
30
- console.log(` ${cyan('hyperclaw onboard')}`);
31
- console.log('');
32
- console.log(` Or start with daemon auto-install:`);
33
- console.log('');
34
- console.log(` ${cyan('hyperclaw onboard --install-daemon')}`);
35
- console.log('');
36
- console.log(line);
37
- console.log('');
38
- console.log(` ${gray('Docs:')} https://hyperclaw.ai/docs`);
39
- console.log(` ${gray('GitHub:')} https://github.com/hyperclaw-ai/hyperclaw`);
40
- console.log('');
41
- console.log(line);
42
- console.log('');
30
+ console.log('');
31
+ console.log(line);
32
+ console.log('');
33
+ console.log(` ${bold('\u26a1 HyperClaw')} ${cyan('v' + version)} ${gray('installed successfully')}`);
34
+ console.log('');
35
+ console.log(` Run the setup wizard to get started:`);
36
+ console.log('');
37
+ console.log(` ${cyan('hyperclaw onboard')}`);
38
+ console.log('');
39
+ console.log(` Or start with daemon auto-install:`);
40
+ console.log('');
41
+ console.log(` ${cyan('hyperclaw onboard --install-daemon')}`);
42
+ console.log('');
43
+ console.log(line);
44
+ console.log('');
45
+ console.log(` ${gray('Docs:')} https://github.com/mylo-2001/hyperclaw#readme`);
46
+ console.log(` ${gray('GitHub:')} https://github.com/mylo-2001/hyperclaw`);
47
+ console.log('');
48
+ console.log(line);
49
+ console.log('');
50
+ } catch (_) {
51
+ // Never fail the install due to postinstall script errors
52
+ process.exit(0);
53
+ }