hyperclaw 5.4.1 → 5.4.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 (135) hide show
  1. package/dist/a2ui-protocol-CUqdJGh7.js +75 -0
  2. package/dist/agents-routing-B0D0vcp5.js +424 -0
  3. package/dist/agents-routing-BC6GndVe.js +7 -0
  4. package/dist/agents-routing-CyFBHvyk.js +424 -0
  5. package/dist/agents-routing-DdpszaMx.js +7 -0
  6. package/dist/api-key-validation-DrMrLEa0.js +66 -0
  7. package/dist/api-keys-guide-DmKF7tB-.js +149 -0
  8. package/dist/audit-Q-Uy5nem.js +445 -0
  9. package/dist/backup-CtHJEqGr.js +86 -0
  10. package/dist/banner-DYzQ8cCb.js +143 -0
  11. package/dist/banner-jW84OrYg.js +7 -0
  12. package/dist/bounty-tools-CCwY61YO.js +211 -0
  13. package/dist/chat-CJa0ph8c.js +528 -0
  14. package/dist/chat-CKnfxa1-.js +528 -0
  15. package/dist/chat-CQKCIrIY.js +528 -0
  16. package/dist/chat-npW_ZOmo.js +528 -0
  17. package/dist/claw-tasks-Dq38PrL5.js +80 -0
  18. package/dist/config-BzK_Xl4Y.js +261 -0
  19. package/dist/config-ClsdlpXc.js +261 -0
  20. package/dist/config-Dm394B6X.js +7 -0
  21. package/dist/config-SiLqEezw.js +7 -0
  22. package/dist/connector-BYPxgmsD.js +312 -0
  23. package/dist/cost-tracker-x9E8VKtk.js +103 -0
  24. package/dist/credentials-store-Ddhgmbpz.js +7 -0
  25. package/dist/credentials-store-onL1tYct.js +89 -0
  26. package/dist/cron-tasks-CF4MJoIU.js +89 -0
  27. package/dist/daemon-ApB1nMs2.js +421 -0
  28. package/dist/daemon-B2ghXB-I.js +7 -0
  29. package/dist/daemon-BldYSrDj.js +421 -0
  30. package/dist/daemon-BqTcxMZe.js +7 -0
  31. package/dist/daemon-CivMFYkD.js +7 -0
  32. package/dist/daemon-DBXFUMue.js +421 -0
  33. package/dist/delivery-BURWi8wu.js +4 -0
  34. package/dist/delivery-kZ2mVkU5.js +95 -0
  35. package/dist/destructive-gate-C1ny9ek2.js +116 -0
  36. package/dist/engine-B-JvIt_Y.js +7 -0
  37. package/dist/engine-BGZnBZ4m.js +7 -0
  38. package/dist/engine-BTSXJNba.js +346 -0
  39. package/dist/engine-C7LyH310.js +353 -0
  40. package/dist/engine-C_nC_Ioe.js +351 -0
  41. package/dist/engine-DCtJSbKU.js +7 -0
  42. package/dist/env-resolve-C0R8R7pb.js +167 -0
  43. package/dist/env-resolve-Dr-KfTtw.js +11 -0
  44. package/dist/gmail-watch-setup-BzbG0ICM.js +42 -0
  45. package/dist/heartbeat-engine-B9bhAHNi.js +89 -0
  46. package/dist/hyperclawbot-BEm8_87h.js +516 -0
  47. package/dist/hyperclawbot-DR6BgI_d.js +516 -0
  48. package/dist/hyperclawbot-hZv4pde0.js +516 -0
  49. package/dist/inference-C874-2MI.js +8 -0
  50. package/dist/inference-DCSz6Sb1.js +2880 -0
  51. package/dist/knowledge-graph-BiIvoxPt.js +134 -0
  52. package/dist/loader-DMMb9emn.js +410 -0
  53. package/dist/loader-JktrmJOG.js +6 -0
  54. package/dist/logger-Oty9sC13.js +86 -0
  55. package/dist/manager-BIc6zzZV.js +250 -0
  56. package/dist/manager-BwobWy0l.js +120 -0
  57. package/dist/mcp-CI2F3m8G.js +142 -0
  58. package/dist/mcp-loader-C-21ynRH.js +93 -0
  59. package/dist/mcp-loader-Di7n__ta.js +93 -0
  60. package/dist/memory-auto-BVCJeTwd.js +306 -0
  61. package/dist/memory-auto-DXKe2ayf.js +5 -0
  62. package/dist/memory-integration-D2RvZ-MB.js +91 -0
  63. package/dist/moltbook-DvV6GFFL.js +81 -0
  64. package/dist/node-DFKhz7Zn.js +251 -0
  65. package/dist/node-pending-queue-CIMXPU6K.js +32 -0
  66. package/dist/nodes-registry-BeiEjd9U.js +52 -0
  67. package/dist/oauth-flow-CZOsvU1v.js +148 -0
  68. package/dist/oauth-provider-Dk-6BmGL.js +111 -0
  69. package/dist/observability-B3dDQSdI.js +89 -0
  70. package/dist/onboard-BnyHie0K.js +14 -0
  71. package/dist/onboard-D-5gWzH0.js +3854 -0
  72. package/dist/onboard-D9pjgaVR.js +3854 -0
  73. package/dist/onboard-UhWVcTap.js +14 -0
  74. package/dist/onboard-W5DsxVf2.js +3854 -0
  75. package/dist/onboard-YszvVNgS.js +14 -0
  76. package/dist/onboard-pLDBUBpO.js +14 -0
  77. package/dist/onboard-zISipu-l.js +3854 -0
  78. package/dist/orchestrator-C0t11xj7.js +189 -0
  79. package/dist/orchestrator-CA4eKeGn.js +189 -0
  80. package/dist/orchestrator-CNxTIlOK.js +189 -0
  81. package/dist/orchestrator-Cg1vgEHb.js +6 -0
  82. package/dist/orchestrator-DV5t6wQ0.js +6 -0
  83. package/dist/orchestrator-eT0ZL4yl.js +6 -0
  84. package/dist/osint-47yIek6w.js +283 -0
  85. package/dist/osint-c-xDjLb-.js +283 -0
  86. package/dist/osint-chat-BJgnkFDm.js +789 -0
  87. package/dist/osint-chat-C09BvbGy.js +789 -0
  88. package/dist/osint-chat-zdeaaw7a.js +789 -0
  89. package/dist/osint-e6oBrtlj.js +283 -0
  90. package/dist/pending-approval-CEu_-DGQ.js +22 -0
  91. package/dist/providers-BfW-fgpw.js +5 -0
  92. package/dist/providers-Cs1h_TJA.js +1137 -0
  93. package/dist/renderer-B_ew6jRs.js +228 -0
  94. package/dist/rules-BAYXiKiJ.js +106 -0
  95. package/dist/run-main.js +112 -77
  96. package/dist/runner-B5uo6C5q.js +1310 -0
  97. package/dist/search-tools-DXVuVXW_.js +107 -0
  98. package/dist/server-BJkDIs8Z.js +1467 -0
  99. package/dist/server-CtFoXM88.js +4 -0
  100. package/dist/server-DVxVLu_G.js +1467 -0
  101. package/dist/server-DZj6Nobr.js +1467 -0
  102. package/dist/server-Diu80smx.js +4 -0
  103. package/dist/server-DszV63tu.js +4 -0
  104. package/dist/skill-runtime-BLkXA1mO.js +104 -0
  105. package/dist/skill-runtime-BMk-h6Dl.js +5 -0
  106. package/dist/skill-runtime-BaTX-RGy.js +5 -0
  107. package/dist/skill-runtime-CB9tnc-P.js +104 -0
  108. package/dist/skill-runtime-D6-rGzX1.js +104 -0
  109. package/dist/skill-runtime-Dej1Yr5V.js +5 -0
  110. package/dist/src-6dmkVQGq.js +63 -0
  111. package/dist/src-7yBXPAs6.js +315 -0
  112. package/dist/src-BOnuFlI4.js +23 -0
  113. package/dist/src-BkEtHLLy.js +462 -0
  114. package/dist/src-CDeWGebw.js +315 -0
  115. package/dist/src-CNAVUFC6.js +462 -0
  116. package/dist/src-DB6dPsbY.js +63 -0
  117. package/dist/src-DE4mH0BB.js +63 -0
  118. package/dist/src-krHV0uVj.js +315 -0
  119. package/dist/src-tF0sBtr3.js +462 -0
  120. package/dist/sub-agent-tools-BwOxHu6f.js +39 -0
  121. package/dist/sub-agent-tools-CJVEIF1F.js +39 -0
  122. package/dist/sub-agent-tools-f4X1M-li.js +39 -0
  123. package/dist/tool-policy-CfWEnRxy.js +190 -0
  124. package/dist/tts-elevenlabs-CCeOqqrh.js +64 -0
  125. package/dist/vision-BMRKyu3c.js +167 -0
  126. package/dist/vision-tools-DVYx9-Jw.js +5 -0
  127. package/dist/vision-tools-kYb3effk.js +51 -0
  128. package/dist/voice-transcription-B1D1rpca.js +170 -0
  129. package/package.json +1 -1
  130. package/static/chat.html +18 -4
  131. package/static/web/assets/index-D2ekZ-uM.js +75 -0
  132. package/static/web/assets/index-D_9lvvup.css +1 -0
  133. package/static/web/index.html +2 -2
  134. package/static/web/assets/index-8bDizzaq.js +0 -75
  135. package/static/web/assets/index-B5N1LHGR.css +0 -1
@@ -0,0 +1,315 @@
1
+ const require_chunk = require('./chunk-jS-bbMI5.js');
2
+ const path = require_chunk.__toESM(require("path"));
3
+ const crypto = require_chunk.__toESM(require("crypto"));
4
+
5
+ //#region packages/acp/src/server.ts
6
+ var ACPServer = class {
7
+ sessions = /* @__PURE__ */ new Map();
8
+ initialized = false;
9
+ sendUpdate;
10
+ cancelCurrent = null;
11
+ constructor(sendUpdate) {
12
+ this.sendUpdate = sendUpdate;
13
+ }
14
+ sendResponse(id, result, error) {
15
+ const msg = {
16
+ jsonrpc: "2.0",
17
+ id,
18
+ ...error ? { error } : { result: result ?? null }
19
+ };
20
+ this.write(JSON.stringify(msg));
21
+ }
22
+ write(raw) {
23
+ const buf = Buffer.from(raw, "utf8");
24
+ process.stdout.write(`Content-Length: ${buf.length}\r\n\r\n`, "utf8");
25
+ process.stdout.write(buf, "utf8");
26
+ }
27
+ async handleInitialize(params) {
28
+ this.initialized = true;
29
+ return {
30
+ protocolVersion: params.protocolVersion ?? 1,
31
+ agentCapabilities: {
32
+ loadSession: true,
33
+ promptCapabilities: {
34
+ image: true,
35
+ audio: false,
36
+ embeddedContext: true
37
+ },
38
+ mcp: {
39
+ http: true,
40
+ sse: false
41
+ }
42
+ },
43
+ agentInfo: {
44
+ name: "hyperclaw",
45
+ title: "HyperClaw",
46
+ version: "5.4.1"
47
+ },
48
+ authMethods: []
49
+ };
50
+ }
51
+ async handleSessionNew(params) {
52
+ const id = `sess_${crypto.default.randomBytes(8).toString("hex")}`;
53
+ const cwd = params.cwd ? path.default.resolve(params.cwd) : process.cwd();
54
+ const now = (/* @__PURE__ */ new Date()).toISOString();
55
+ this.sessions.set(id, {
56
+ id,
57
+ cwd,
58
+ transcript: [],
59
+ created: now,
60
+ lastActive: now
61
+ });
62
+ return { sessionId: id };
63
+ }
64
+ async handleSessionLoad(params) {
65
+ const sess = this.sessions.get(params.sessionId);
66
+ if (!sess) {
67
+ const { ACPThreadManager } = await Promise.resolve().then(() => require("./src-DB6dPsbY.js"));
68
+ const mgr = new ACPThreadManager();
69
+ const threadId = params.sessionId.startsWith("sess_") ? params.sessionId.slice(5) : params.sessionId;
70
+ const thread = await mgr.get(threadId);
71
+ if (!thread) throw new Error(`Session not found: ${params.sessionId}`);
72
+ const cwd = params.cwd ? path.default.resolve(params.cwd) : thread.workspace || process.cwd();
73
+ const transcript = thread.messages.filter((m) => m.role === "user" || m.role === "assistant").map((m) => ({
74
+ role: m.role,
75
+ content: m.content
76
+ }));
77
+ const sess2 = {
78
+ id: params.sessionId,
79
+ cwd,
80
+ transcript,
81
+ created: thread.createdAt,
82
+ lastActive: thread.lastActiveAt
83
+ };
84
+ this.sessions.set(params.sessionId, sess2);
85
+ for (const t of transcript) this.sendUpdate({
86
+ sessionId: params.sessionId,
87
+ update: {
88
+ sessionUpdate: t.role === "user" ? "user_message_chunk" : "agent_message_chunk",
89
+ content: {
90
+ type: "text",
91
+ text: t.content
92
+ }
93
+ }
94
+ });
95
+ return;
96
+ }
97
+ for (const t of sess.transcript) this.sendUpdate({
98
+ sessionId: params.sessionId,
99
+ update: {
100
+ sessionUpdate: t.role === "user" ? "user_message_chunk" : "agent_message_chunk",
101
+ content: {
102
+ type: "text",
103
+ text: t.content
104
+ }
105
+ }
106
+ });
107
+ }
108
+ async handleSessionPrompt(params) {
109
+ const sess = this.sessions.get(params.sessionId);
110
+ if (!sess) throw new Error(`Session not found: ${params.sessionId}`);
111
+ const parts = [];
112
+ const images = [];
113
+ for (const p of params.prompt) if (p.type === "text") parts.push(p.text);
114
+ else if (p.type === "resource") parts.push(p.resource.text ?? "");
115
+ else if (p.type === "image" && p.image?.data) {
116
+ const mime = p.image.mimeType || "image/png";
117
+ images.push({
118
+ data: p.image.data,
119
+ mimeType: mime
120
+ });
121
+ }
122
+ const userText = parts.filter(Boolean).join("\n");
123
+ const imageRefs = images.map((img, i) => `[Attached image ${i + 1} — use analyze_image with data URI: data:${img.mimeType || "image/png"};base64,${img.data}]`).join("\n");
124
+ const fullMessage = [userText, imageRefs].filter(Boolean).join("\n\n") || userText;
125
+ if (!fullMessage.trim() && images.length === 0) throw new Error("Empty prompt");
126
+ sess.transcript.push({
127
+ role: "user",
128
+ content: fullMessage
129
+ });
130
+ sess.lastActive = (/* @__PURE__ */ new Date()).toISOString();
131
+ const abortController = new AbortController();
132
+ this.cancelCurrent = () => abortController.abort();
133
+ let stopReason = "end_turn";
134
+ try {
135
+ const { runAgentEngine } = await Promise.resolve().then(() => require("./src-DB6dPsbY.js"));
136
+ const toolCallIds = /* @__PURE__ */ new Map();
137
+ const result = await runAgentEngine(userText || fullMessage, {
138
+ sessionId: params.sessionId,
139
+ imageBlocks: images.length ? images : void 0,
140
+ source: "acp",
141
+ elevated: true,
142
+ transcript: sess.transcript.slice(0, -1),
143
+ workspace: sess.cwd,
144
+ modelOverride: void 0,
145
+ getTranscript: async () => sess.transcript.slice(0, -1),
146
+ appendTranscript: (key, role, content) => {
147
+ sess.transcript.push({
148
+ role,
149
+ content
150
+ });
151
+ sess.lastActive = (/* @__PURE__ */ new Date()).toISOString();
152
+ },
153
+ onToken: (token) => {
154
+ this.sendUpdate({
155
+ sessionId: params.sessionId,
156
+ update: {
157
+ sessionUpdate: "agent_message_chunk",
158
+ content: {
159
+ type: "text",
160
+ text: token
161
+ }
162
+ }
163
+ });
164
+ },
165
+ onThinking: (thought) => {
166
+ this.sendUpdate({
167
+ sessionId: params.sessionId,
168
+ update: {
169
+ sessionUpdate: "thought_chunk",
170
+ content: {
171
+ type: "text",
172
+ text: thought
173
+ }
174
+ }
175
+ });
176
+ },
177
+ onToolCall: (name, input) => {
178
+ const id = `call_${crypto.default.randomBytes(4).toString("hex")}`;
179
+ toolCallIds.set(name, id);
180
+ this.sendUpdate({
181
+ sessionId: params.sessionId,
182
+ update: {
183
+ sessionUpdate: "tool_call",
184
+ toolCallId: id,
185
+ title: name,
186
+ kind: "other",
187
+ status: "pending"
188
+ }
189
+ });
190
+ },
191
+ onToolResult: (name) => {
192
+ const id = toolCallIds.get(name);
193
+ if (id) this.sendUpdate({
194
+ sessionId: params.sessionId,
195
+ update: {
196
+ sessionUpdate: "tool_call_update",
197
+ toolCallId: id,
198
+ status: "completed"
199
+ }
200
+ });
201
+ }
202
+ });
203
+ if (result.error === "cancelled") stopReason = "cancelled";
204
+ sess.transcript.push({
205
+ role: "assistant",
206
+ content: result.text || ""
207
+ });
208
+ sess.lastActive = (/* @__PURE__ */ new Date()).toISOString();
209
+ } catch (e) {
210
+ const err = e;
211
+ if (err?.name === "AbortError" || err?.message?.includes("abort")) stopReason = "cancelled";
212
+ else throw e;
213
+ } finally {
214
+ this.cancelCurrent = null;
215
+ }
216
+ return { stopReason };
217
+ }
218
+ handleSessionCancel(params) {
219
+ if (this.cancelCurrent) this.cancelCurrent();
220
+ }
221
+ getSession(sessionId) {
222
+ return this.sessions.get(sessionId);
223
+ }
224
+ async dispatch(req) {
225
+ const { id, method, params = {} } = req;
226
+ if (!this.initialized && method !== "initialize") {
227
+ this.sendResponse(id, void 0, {
228
+ code: -32002,
229
+ message: "Not initialized"
230
+ });
231
+ return;
232
+ }
233
+ try {
234
+ let result;
235
+ switch (method) {
236
+ case "initialize":
237
+ result = await this.handleInitialize(params);
238
+ break;
239
+ case "session/new":
240
+ result = await this.handleSessionNew(params);
241
+ break;
242
+ case "session/load":
243
+ result = await this.handleSessionLoad(params);
244
+ break;
245
+ case "session/prompt":
246
+ result = await this.handleSessionPrompt(params);
247
+ break;
248
+ case "session/cancel":
249
+ this.handleSessionCancel(params);
250
+ result = null;
251
+ break;
252
+ default:
253
+ this.sendResponse(id, void 0, {
254
+ code: -32601,
255
+ message: `Method not found: ${method}`
256
+ });
257
+ return;
258
+ }
259
+ if (method !== "session/cancel") this.sendResponse(id, result);
260
+ } catch (e) {
261
+ const err = e;
262
+ this.sendResponse(id, void 0, {
263
+ code: -32603,
264
+ message: err?.message ?? "Internal error",
265
+ data: { stack: err?.stack }
266
+ });
267
+ }
268
+ }
269
+ };
270
+ /**
271
+
272
+ * Run ACP server on stdio (Content-Length delimited JSON-RPC).
273
+
274
+ */
275
+ async function runACPStdio() {
276
+ const sendUpdate = (params) => {
277
+ const msg = {
278
+ jsonrpc: "2.0",
279
+ method: "session/update",
280
+ params
281
+ };
282
+ const raw = JSON.stringify(msg);
283
+ const buf = Buffer.from(raw, "utf8");
284
+ process.stdout.write(`Content-Length: ${buf.length}\r\n\r\n`, "utf8");
285
+ process.stdout.write(buf, "utf8");
286
+ };
287
+ const server = new ACPServer(sendUpdate);
288
+ let buffer = "";
289
+ process.stdin.setEncoding("utf8");
290
+ process.stdin.on("data", (chunk) => {
291
+ buffer += chunk;
292
+ for (;;) {
293
+ const headerEnd = buffer.indexOf("\r\n\r\n");
294
+ if (headerEnd === -1) break;
295
+ const headers = buffer.slice(0, headerEnd);
296
+ const bodyStart = headerEnd + 4;
297
+ const contentLen = /Content-Length:\s*(\d+)/i.exec(headers)?.[1];
298
+ if (!contentLen) {
299
+ buffer = buffer.slice(bodyStart);
300
+ continue;
301
+ }
302
+ const len = parseInt(contentLen, 10);
303
+ if (buffer.length < bodyStart + len) break;
304
+ const body = buffer.slice(bodyStart, bodyStart + len);
305
+ buffer = buffer.slice(bodyStart + len);
306
+ try {
307
+ const req = JSON.parse(body);
308
+ server.dispatch(req);
309
+ } catch {}
310
+ }
311
+ });
312
+ }
313
+
314
+ //#endregion
315
+ exports.runACPStdio = runACPStdio;
@@ -0,0 +1,23 @@
1
+ const require_chunk = require('./chunk-jS-bbMI5.js');
2
+
3
+ //#region packages/rag/src/index.ts
4
+ /**
5
+
6
+ * Chunk text into overlapping segments for embedding.
7
+
8
+ */
9
+ function chunkText(text, opts = {}) {
10
+ const size = opts.size ?? 1e3;
11
+ const overlap = opts.overlap ?? 200;
12
+ const chunks = [];
13
+ let start = 0;
14
+ while (start < text.length) {
15
+ const end = Math.min(start + size, text.length);
16
+ chunks.push(text.slice(start, end));
17
+ start += size - overlap;
18
+ }
19
+ return chunks.filter((c) => c.trim().length > 0);
20
+ }
21
+
22
+ //#endregion
23
+ exports.chunkText = chunkText;