hyperclaw 4.0.0 → 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.
- package/README.md +53 -18
- package/dist/a2ui-protocol-CT_jDEU9.js +75 -0
- package/dist/agents-routing-683Q2JGp.js +129 -0
- package/dist/agents-routing-BpZBswBH.js +4 -0
- package/dist/api-keys-guide-Bzig1R5W.js +149 -0
- package/dist/api-keys-guide-Dq5Obbp4.js +149 -0
- package/dist/audit-BYxPlnTQ.js +248 -0
- package/dist/bounty-tools-C6LyzxM-.js +211 -0
- package/dist/browser-tools-CQBSbIuO.js +5 -0
- package/dist/browser-tools-YQmwRLLM.js +179 -0
- package/dist/claw-tasks-BRLUvFRD.js +80 -0
- package/dist/connector-3HnyH8fn.js +167 -0
- package/dist/connector-6PMZo5Ky.js +189 -0
- package/dist/connector-B6eoF3DD.js +181 -0
- package/dist/connector-B9tLG8UZ.js +196 -0
- package/dist/connector-BOlqjXWP.js +182 -0
- package/dist/connector-BP8zsbP8.js +189 -0
- package/dist/connector-BPoSevxp.js +286 -0
- package/dist/connector-BRHj773i.js +163 -0
- package/dist/connector-BToxU-jV.js +267 -0
- package/dist/connector-BliDVsJQ.js +239 -0
- package/dist/connector-Bv6s9oP7.js +88 -0
- package/dist/connector-By5wWGTR.js +343 -0
- package/dist/connector-C1BaFFgN.js +213 -0
- package/dist/connector-CRRWY5Wv.js +167 -0
- package/dist/connector-CXPQVGyI.js +85 -0
- package/dist/connector-Cdk1CXKi.js +194 -0
- package/dist/connector-CwlgFgjx.js +181 -0
- package/dist/connector-DFchk6l7.js +178 -0
- package/dist/connector-DKw7tRAy.js +192 -0
- package/dist/connector-DRv1ahC_.js +343 -0
- package/dist/connector-DU63KW94.js +165 -0
- package/dist/connector-Dbvb1Cj9.js +280 -0
- package/dist/connector-DcZdQcgR.js +173 -0
- package/dist/connector-DxKL8VvZ.js +182 -0
- package/dist/connector-T_YdZtzv.js +162 -0
- package/dist/connector-i4gOS9xL.js +154 -0
- package/dist/connector-rHXE1ZD2.js +167 -0
- package/dist/connector-wdUXChwa.js +172 -0
- package/dist/cost-tracker-pVE15Yq4.js +103 -0
- package/dist/credentials-store-BvnMPJwi.js +4 -0
- package/dist/credentials-store-sb-TRLwR.js +77 -0
- package/dist/cron-tasks-BvDFNyiE.js +82 -0
- package/dist/delivery-B-SJqXLn.js +95 -0
- package/dist/delivery-D5Z98EVq.js +95 -0
- package/dist/delivery-DCOXhXEO.js +5 -0
- package/dist/delivery-VgFeuu2J.js +5 -0
- package/dist/destructive-gate-m-dWqUFg.js +101 -0
- package/dist/developer-keys-JaJK3T27.js +127 -0
- package/dist/developer-keys-kyqmtWK3.js +8 -0
- package/dist/doctor-3oi89QIc.js +175 -0
- package/dist/doctor-Cf1XSfp9.js +4 -0
- package/dist/engine-B4eMiTgl.js +7 -0
- package/dist/engine-B8M7dYul.js +7 -0
- package/dist/engine-BhT-1M9W.js +256 -0
- package/dist/engine-D49jnSd_.js +256 -0
- package/dist/env-resolve-DWOQ45jG.js +9 -0
- package/dist/env-resolve-szSWl0UF.js +94 -0
- package/dist/extraction-tools-D3qDFBJ1.js +91 -0
- package/dist/extraction-tools-DLr_AEwq.js +5 -0
- package/dist/form_data-B_hIUrxU.js +8657 -0
- package/dist/gmail-watch-setup-Czt8rXaX.js +40 -0
- package/dist/heartbeat-engine-CRqfPcFM.js +83 -0
- package/dist/hub-DTsqe5Bt.js +6 -0
- package/dist/hub-FrPTA33j.js +515 -0
- package/dist/hyperclawbot-D9KCtc4P.js +480 -0
- package/dist/hyperclawbot-DfMGowZC.js +480 -0
- package/dist/hyperclawbot-Dw27pJo4.js +480 -0
- package/dist/inference-CTWJeX9Q.js +922 -0
- package/dist/inference-ix607p7k.js +6 -0
- package/dist/knowledge-graph-DqA-Fztl.js +131 -0
- package/dist/loader-CISCqBto.js +400 -0
- package/dist/loader-CYMQ8VOS.js +4 -0
- package/dist/logger-8tEtAd3y.js +83 -0
- package/dist/manager-CPjeRe-6.js +4 -0
- package/dist/manager-Cwzj7w5R.js +105 -0
- package/dist/manager-DLmZI-9R.js +6 -0
- package/dist/manager-DSGhn5i3.js +117 -0
- package/dist/manager-DgyF52mg.js +218 -0
- package/dist/manager-Dm8nrMFx.js +40 -0
- package/dist/mcp-B_9Ber63.js +139 -0
- package/dist/mcp-loader-DSM5UiFG.js +94 -0
- package/dist/mcp-loader-j5ZLLw5O.js +94 -0
- package/dist/memory-BI1kPkAN.js +4 -0
- package/dist/memory-BVFGkxxK.js +270 -0
- package/dist/memory-auto-Bc7euou4.js +306 -0
- package/dist/memory-auto-DPfbkMVt.js +5 -0
- package/dist/memory-integration-DZExqWr4.js +91 -0
- package/dist/moltbook-B6ZeGN5_.js +81 -0
- package/dist/node-pwL6O_KX.js +222 -0
- package/dist/nodes-registry-CsPm_-CJ.js +52 -0
- package/dist/oauth-flow-CpWlgvNB.js +150 -0
- package/dist/oauth-provider-BZb6qOw5.js +110 -0
- package/dist/observability-B43YvNQV.js +89 -0
- package/dist/onboard-3q20ZyHj.js +9 -0
- package/dist/onboard-Bd_wsYdi.js +4086 -0
- package/dist/onboard-CAN7x3me.js +3026 -0
- package/dist/onboard-DnegOHMh.js +3026 -0
- package/dist/onboard-RYtDlYBw.js +9 -0
- package/dist/onboard-aTwlQs-4.js +9 -0
- package/dist/orchestrator-BSp2M5EU.js +189 -0
- package/dist/orchestrator-C7ko5tWa.js +6 -0
- package/dist/orchestrator-DfPkIx2Z.js +6 -0
- package/dist/orchestrator-NJQsmiBE.js +189 -0
- package/dist/pairing-DU0_J28n.js +87 -0
- package/dist/pairing-DWllbSbO.js +4 -0
- package/dist/pc-access-Ly-uA8mn.js +8 -0
- package/dist/pc-access-NxBvTrRj.js +819 -0
- package/dist/pending-approval-DIHvwwWS.js +22 -0
- package/dist/puppeteer-2o3QOwAy.js +2 -2
- package/dist/puppeteer-BYTMp3BI.js +2 -2
- package/dist/puppeteer-DQ45qwWk.js +2 -2
- package/dist/reminders-store-D79qdfN0.js +58 -0
- package/dist/renderer-pqlDRKbH.js +225 -0
- package/dist/rules-BooT_qFP.js +103 -0
- package/dist/run-main.js +366 -1109
- package/dist/runner-Bu--_RXw.js +810 -0
- package/dist/runner-D1rjuMTJ.js +810 -0
- package/dist/sdk/index.js +2 -2
- package/dist/sdk/index.mjs +2 -2
- package/dist/security-C-5URby1.js +73 -0
- package/dist/security-_xve79aq.js +4 -0
- package/dist/server-0kgyELx4.js +1047 -0
- package/dist/server-BIuTobTC.js +4 -0
- package/dist/server-BRlCEjyT.js +1047 -0
- package/dist/server-CCI1hv45.js +1047 -0
- package/dist/server-DU9POoWc.js +4 -0
- package/dist/server-RBqwE_GN.js +4 -0
- package/dist/session-store-CujxByI6.js +113 -0
- package/dist/session-store-qpJUg2M1.js +5 -0
- package/dist/sessions-tools-CB2qbwIk.js +5 -0
- package/dist/sessions-tools-DHMaTZIs.js +95 -0
- package/dist/skill-loader-BkceKkIg.js +7 -0
- package/dist/skill-loader-DhgIwK4J.js +159 -0
- package/dist/skill-runtime--LqxWrp5.js +102 -0
- package/dist/skill-runtime-C5l0Tgt-.js +5 -0
- package/dist/skill-runtime-DsXK_HYG.js +102 -0
- package/dist/skill-runtime-IVTiqrMR.js +5 -0
- package/dist/src-BEVLgaF1.js +63 -0
- package/dist/src-Bgu_OxTQ.js +458 -0
- package/dist/src-Bq-oKt7Z.js +458 -0
- package/dist/src-DWCUhnD4.js +20 -0
- package/dist/src-cfRTjFef.js +63 -0
- package/dist/sub-agent-tools-BD9DF8_g.js +39 -0
- package/dist/sub-agent-tools-V7b3T9_s.js +39 -0
- package/dist/tool-policy-DNvNRnve.js +189 -0
- package/dist/tts-elevenlabs-BUOGKL-k.js +61 -0
- package/dist/update-check-BD4qH7Am.js +81 -0
- package/dist/vision-DRq-f-Dj.js +121 -0
- package/dist/vision-tools-CFZEpQKm.js +5 -0
- package/dist/vision-tools-CQnBI9aa.js +51 -0
- package/dist/voice-transcription-CbQBToY0.js +138 -0
- package/dist/voice-transcription-CgWq54hn.js +138 -0
- package/dist/website-watch-tools-Bk_TnwuE.js +5 -0
- package/dist/website-watch-tools-DraMPxdl.js +139 -0
- package/package.json +1 -1
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-jS-bbMI5.js');
|
|
2
|
+
const require_paths = require('./paths-AIyBxIzm.js');
|
|
3
|
+
const require_browser_tools = require('./browser-tools-YQmwRLLM.js');
|
|
4
|
+
const require_src = require('./src-DWCUhnD4.js');
|
|
5
|
+
const require_engine = require('./engine-BhT-1M9W.js');
|
|
6
|
+
const require_extraction_tools = require('./extraction-tools-D3qDFBJ1.js');
|
|
7
|
+
const require_inference = require('./inference-CTWJeX9Q.js');
|
|
8
|
+
const require_memory_auto = require('./memory-auto-Bc7euou4.js');
|
|
9
|
+
const require_orchestrator = require('./orchestrator-BSp2M5EU.js');
|
|
10
|
+
const require_pc_access = require('./pc-access-NxBvTrRj.js');
|
|
11
|
+
const require_session_store = require('./session-store-CujxByI6.js');
|
|
12
|
+
const require_sessions_tools = require('./sessions-tools-DHMaTZIs.js');
|
|
13
|
+
const require_skill_loader = require('./skill-loader-DhgIwK4J.js');
|
|
14
|
+
const require_skill_runtime = require('./skill-runtime--LqxWrp5.js');
|
|
15
|
+
const require_vision_tools = require('./vision-tools-CQnBI9aa.js');
|
|
16
|
+
const require_website_watch_tools = require('./website-watch-tools-DraMPxdl.js');
|
|
17
|
+
const chalk = require_chunk.__toESM(require("chalk"));
|
|
18
|
+
const ora = require_chunk.__toESM(require("ora"));
|
|
19
|
+
const fs_extra = require_chunk.__toESM(require("fs-extra"));
|
|
20
|
+
const path = require_chunk.__toESM(require("path"));
|
|
21
|
+
const os = require_chunk.__toESM(require("os"));
|
|
22
|
+
const crypto = require_chunk.__toESM(require("crypto"));
|
|
23
|
+
const events = require_chunk.__toESM(require("events"));
|
|
24
|
+
|
|
25
|
+
//#region packages/core/src/agent/pi-rpc.ts
|
|
26
|
+
function createPiRPCHandler(callAgent, getSessions) {
|
|
27
|
+
return async (req) => {
|
|
28
|
+
const { id, method, params } = req;
|
|
29
|
+
try {
|
|
30
|
+
let result;
|
|
31
|
+
switch (method) {
|
|
32
|
+
case "send":
|
|
33
|
+
result = await handleSend(params, callAgent);
|
|
34
|
+
break;
|
|
35
|
+
case "chats.list":
|
|
36
|
+
result = handleChatsList(getSessions);
|
|
37
|
+
break;
|
|
38
|
+
case "ping":
|
|
39
|
+
result = { pong: Date.now() };
|
|
40
|
+
break;
|
|
41
|
+
default: return {
|
|
42
|
+
jsonrpc: "2.0",
|
|
43
|
+
id,
|
|
44
|
+
error: {
|
|
45
|
+
code: -32601,
|
|
46
|
+
message: `Method not found: ${method}`
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
jsonrpc: "2.0",
|
|
52
|
+
id,
|
|
53
|
+
result
|
|
54
|
+
};
|
|
55
|
+
} catch (e) {
|
|
56
|
+
return {
|
|
57
|
+
jsonrpc: "2.0",
|
|
58
|
+
id,
|
|
59
|
+
error: {
|
|
60
|
+
code: -32603,
|
|
61
|
+
message: e.message || "Internal error"
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
async function handleSend(params, callAgent) {
|
|
68
|
+
const message = params?.message;
|
|
69
|
+
if (!message || typeof message !== "string") throw new Error("params.message is required");
|
|
70
|
+
const sessionId = params?.sessionId;
|
|
71
|
+
const response = await callAgent(message, {
|
|
72
|
+
sessionId,
|
|
73
|
+
source: "pi-rpc"
|
|
74
|
+
});
|
|
75
|
+
return {
|
|
76
|
+
response,
|
|
77
|
+
sessionId: sessionId || "default"
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function handleChatsList(getSessions) {
|
|
81
|
+
const chats = getSessions ? getSessions() : [];
|
|
82
|
+
return { chats };
|
|
83
|
+
}
|
|
84
|
+
var init_pi_rpc = require_chunk.__esm({ "packages/core/src/agent/pi-rpc.ts"() {} });
|
|
85
|
+
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region packages/core/src/agent/runner.ts
|
|
88
|
+
async function runAgent(opts) {
|
|
89
|
+
const cfg = await fs_extra.default.readJson(require_paths.getConfigPath()).catch(() => null);
|
|
90
|
+
if (!cfg) {
|
|
91
|
+
console.log(chalk.default.red("\n ✖ No configuration found. Run: hyperclaw init\n"));
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const thinkingBudget = THINKING_BUDGET[opts.thinking];
|
|
95
|
+
const model = opts.model || cfg.provider?.modelId || "openrouter/auto";
|
|
96
|
+
console.log(chalk.default.bold.cyan("\n ⚡ HYPERCLAW AGENT RUN\n"));
|
|
97
|
+
console.log(` ${chalk.default.gray("Model:")} ${model}`);
|
|
98
|
+
console.log(` ${chalk.default.gray("Thinking:")} ${opts.thinking} (budget: ${thinkingBudget} tokens)`);
|
|
99
|
+
console.log(` ${chalk.default.gray("Session:")} ${opts.sessionId || "ephemeral"}`);
|
|
100
|
+
console.log();
|
|
101
|
+
const spinner = (0, ora.default)(opts.parallel ? "Planning & running sub-agents in parallel..." : opts.multiStep ? "Planning & running steps..." : "Thinking...").start();
|
|
102
|
+
const thinkingLines = [];
|
|
103
|
+
const engineOpts = {
|
|
104
|
+
sessionId: opts.sessionId,
|
|
105
|
+
source: "cli",
|
|
106
|
+
elevated: true,
|
|
107
|
+
modelOverride: opts.model,
|
|
108
|
+
workspace: opts.workspace,
|
|
109
|
+
thinkingBudget,
|
|
110
|
+
onToken: () => {},
|
|
111
|
+
onThinking: opts.verbose ? (t) => thinkingLines.push(t) : void 0
|
|
112
|
+
};
|
|
113
|
+
const result = opts.parallel ? await (await Promise.resolve().then(() => require("./orchestrator-DfPkIx2Z.js"))).runMultiStepParallel(opts.message, engineOpts) : opts.multiStep ? await (await Promise.resolve().then(() => require("./orchestrator-DfPkIx2Z.js"))).runMultiStep(opts.message, engineOpts) : await require_engine.runAgentEngine(opts.message, engineOpts);
|
|
114
|
+
spinner.stop();
|
|
115
|
+
if (result.error && result.error !== "no_api_key") {
|
|
116
|
+
console.log(chalk.default.red(`\n ✖ Error: ${result.text}\n`));
|
|
117
|
+
if (result.error === "no_api_key") console.log(chalk.default.gray(" Run: hyperclaw config set-key"));
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (thinkingLines.length > 0 && opts.verbose) {
|
|
121
|
+
console.log(chalk.default.dim("\n ── Thinking ──\n"));
|
|
122
|
+
for (const line of thinkingLines) console.log(chalk.default.dim(" " + line.split("\n").join("\n ")));
|
|
123
|
+
console.log();
|
|
124
|
+
}
|
|
125
|
+
console.log(chalk.default.bold("\n Response:\n"));
|
|
126
|
+
console.log(" " + (result.text || "(empty)").split("\n").join("\n "));
|
|
127
|
+
if (result.usage) {
|
|
128
|
+
console.log(chalk.default.gray(`\n Tokens — input: ${result.usage.input} output: ${result.usage.output}`));
|
|
129
|
+
if (result.usage.cacheRead) console.log(chalk.default.gray(` Cache read: ${result.usage.cacheRead} tokens`));
|
|
130
|
+
}
|
|
131
|
+
console.log();
|
|
132
|
+
}
|
|
133
|
+
var THINKING_BUDGET;
|
|
134
|
+
var init_runner = require_chunk.__esm({ "packages/core/src/agent/runner.ts"() {
|
|
135
|
+
require_src.init_src();
|
|
136
|
+
require_engine.init_engine();
|
|
137
|
+
THINKING_BUDGET = {
|
|
138
|
+
high: 1e4,
|
|
139
|
+
medium: 4e3,
|
|
140
|
+
low: 1e3,
|
|
141
|
+
none: 0
|
|
142
|
+
};
|
|
143
|
+
} });
|
|
144
|
+
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region packages/core/src/agent/acp.ts
|
|
147
|
+
var ACPThreadManager;
|
|
148
|
+
var init_acp = require_chunk.__esm({ "packages/core/src/agent/acp.ts"() {
|
|
149
|
+
ACPThreadManager = class extends events.EventEmitter {
|
|
150
|
+
threadsDir;
|
|
151
|
+
constructor() {
|
|
152
|
+
super();
|
|
153
|
+
this.threadsDir = path.default.join(os.default.homedir(), ".hyperclaw", "threads");
|
|
154
|
+
fs_extra.default.ensureDirSync(this.threadsDir);
|
|
155
|
+
}
|
|
156
|
+
threadPath(id) {
|
|
157
|
+
return path.default.join(this.threadsDir, `${id}.json`);
|
|
158
|
+
}
|
|
159
|
+
async create(options) {
|
|
160
|
+
const id = crypto.default.randomBytes(8).toString("hex");
|
|
161
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
162
|
+
const thread = {
|
|
163
|
+
id,
|
|
164
|
+
name: options.name || `Thread ${id.slice(0, 6)}`,
|
|
165
|
+
channelId: options.channelId,
|
|
166
|
+
agentRole: options.agentRole || "subagent",
|
|
167
|
+
workspace: path.default.join(os.default.homedir(), ".hyperclaw"),
|
|
168
|
+
status: "active",
|
|
169
|
+
model: options.model || "openrouter/auto",
|
|
170
|
+
messages: options.systemPrompt ? [{
|
|
171
|
+
id: "sys-0",
|
|
172
|
+
threadId: id,
|
|
173
|
+
role: "system",
|
|
174
|
+
content: options.systemPrompt,
|
|
175
|
+
timestamp: now
|
|
176
|
+
}] : [],
|
|
177
|
+
createdAt: now,
|
|
178
|
+
lastActiveAt: now,
|
|
179
|
+
metadata: options.metadata || {}
|
|
180
|
+
};
|
|
181
|
+
await this.save(thread);
|
|
182
|
+
this.emit("thread:created", thread);
|
|
183
|
+
return thread;
|
|
184
|
+
}
|
|
185
|
+
async get(id) {
|
|
186
|
+
try {
|
|
187
|
+
return await fs_extra.default.readJson(this.threadPath(id));
|
|
188
|
+
} catch {
|
|
189
|
+
return null;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
async save(thread) {
|
|
193
|
+
await fs_extra.default.writeJson(this.threadPath(thread.id), thread, { spaces: 2 });
|
|
194
|
+
}
|
|
195
|
+
async append(threadId, message) {
|
|
196
|
+
const thread = await this.get(threadId);
|
|
197
|
+
if (!thread) throw new Error(`Thread not found: ${threadId}`);
|
|
198
|
+
const msg = {
|
|
199
|
+
...message,
|
|
200
|
+
id: crypto.default.randomBytes(4).toString("hex"),
|
|
201
|
+
threadId,
|
|
202
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
203
|
+
};
|
|
204
|
+
thread.messages.push(msg);
|
|
205
|
+
thread.lastActiveAt = msg.timestamp;
|
|
206
|
+
await this.save(thread);
|
|
207
|
+
this.emit("message:appended", {
|
|
208
|
+
thread,
|
|
209
|
+
message: msg
|
|
210
|
+
});
|
|
211
|
+
return msg;
|
|
212
|
+
}
|
|
213
|
+
async list(filter) {
|
|
214
|
+
const files = await fs_extra.default.readdir(this.threadsDir);
|
|
215
|
+
const threads = [];
|
|
216
|
+
for (const f of files.filter((f$1) => f$1.endsWith(".json"))) try {
|
|
217
|
+
const t = await fs_extra.default.readJson(path.default.join(this.threadsDir, f));
|
|
218
|
+
if (filter?.channelId && t.channelId !== filter.channelId) continue;
|
|
219
|
+
if (filter?.status && t.status !== filter.status) continue;
|
|
220
|
+
threads.push(t);
|
|
221
|
+
} catch {}
|
|
222
|
+
return threads.sort((a, b) => new Date(b.lastActiveAt).getTime() - new Date(a.lastActiveAt).getTime());
|
|
223
|
+
}
|
|
224
|
+
async terminate(threadId) {
|
|
225
|
+
const thread = await this.get(threadId);
|
|
226
|
+
if (!thread) return;
|
|
227
|
+
thread.status = "terminated";
|
|
228
|
+
await this.save(thread);
|
|
229
|
+
this.emit("thread:terminated", thread);
|
|
230
|
+
}
|
|
231
|
+
async pause(threadId) {
|
|
232
|
+
const thread = await this.get(threadId);
|
|
233
|
+
if (!thread) return;
|
|
234
|
+
thread.status = "paused";
|
|
235
|
+
await this.save(thread);
|
|
236
|
+
}
|
|
237
|
+
async resume(threadId) {
|
|
238
|
+
const thread = await this.get(threadId);
|
|
239
|
+
if (!thread) return;
|
|
240
|
+
thread.status = "active";
|
|
241
|
+
await this.save(thread);
|
|
242
|
+
}
|
|
243
|
+
showList(threads) {
|
|
244
|
+
console.log(chalk.default.bold.cyan("\n 🧵 ACP THREADS\n"));
|
|
245
|
+
if (threads.length === 0) {
|
|
246
|
+
console.log(chalk.default.gray(" No threads. Create with: hyperclaw agent --message \"...\" --new-thread\n"));
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
for (const t of threads) {
|
|
250
|
+
const statusColor = {
|
|
251
|
+
active: chalk.default.green,
|
|
252
|
+
idle: chalk.default.cyan,
|
|
253
|
+
paused: chalk.default.yellow,
|
|
254
|
+
terminated: chalk.default.gray
|
|
255
|
+
}[t.status];
|
|
256
|
+
const roleLabel = {
|
|
257
|
+
orchestrator: chalk.default.magenta("[orchestrator]"),
|
|
258
|
+
subagent: chalk.default.cyan("[subagent]"),
|
|
259
|
+
specialist: chalk.default.blue("[specialist]")
|
|
260
|
+
}[t.agentRole];
|
|
261
|
+
const age = Math.round((Date.now() - new Date(t.lastActiveAt).getTime()) / 1e3 / 60);
|
|
262
|
+
const ageLabel = age < 60 ? `${age}m ago` : `${Math.round(age / 60)}h ago`;
|
|
263
|
+
console.log(` ${statusColor("●")} ${chalk.default.white(t.name)} ${chalk.default.gray(t.id)}`);
|
|
264
|
+
console.log(` ${roleLabel} ${chalk.default.gray(`model: ${t.model}`)} ${chalk.default.gray(`${t.messages.length} messages`)} ${chalk.default.gray(ageLabel)}`);
|
|
265
|
+
if (t.channelId) console.log(` ${chalk.default.gray(`channel: ${t.channelId}`)}`);
|
|
266
|
+
console.log();
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
} });
|
|
271
|
+
|
|
272
|
+
//#endregion
|
|
273
|
+
//#region packages/core/src/agent/surface-parity.ts
|
|
274
|
+
/** Single source of truth for bot/CLI help. */
|
|
275
|
+
function getAgentHelp(surface) {
|
|
276
|
+
const lines = COMMANDS.map((c) => `${c.cmd} — ${c.desc}`);
|
|
277
|
+
if (surface === "telegram") return `🦅 *HyperClaw Commands*\n\n${lines.join("\n")}\n\nGroups: @mention or reply to bot to activate.`;
|
|
278
|
+
if (surface === "discord") return `🦅 **HyperClaw Commands**\n\n${lines.join("\n")}\n\nGroups: mention or reply to activate.`;
|
|
279
|
+
return `🦅 HyperClaw Commands\n\n${lines.join("\n")}`;
|
|
280
|
+
}
|
|
281
|
+
/** Format agent response for display (optional header). */
|
|
282
|
+
function formatAgentResponse(text, surface) {
|
|
283
|
+
if (!text || text.startsWith("Error:")) return text;
|
|
284
|
+
if (surface === "telegram") return `🦅 *Agent*\n\n${text}`;
|
|
285
|
+
if (surface === "discord") return `🦅 **Agent**\n\n${text}`;
|
|
286
|
+
return text;
|
|
287
|
+
}
|
|
288
|
+
var COMMANDS;
|
|
289
|
+
var init_surface_parity = require_chunk.__esm({ "packages/core/src/agent/surface-parity.ts"() {
|
|
290
|
+
COMMANDS = [
|
|
291
|
+
{
|
|
292
|
+
cmd: "/status",
|
|
293
|
+
desc: "Gateway status"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
cmd: "/restart",
|
|
297
|
+
desc: "Restart gateway"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
cmd: "/logs [n]",
|
|
301
|
+
desc: "Last N log lines (default 20)"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
cmd: "/approve <channel> <code>",
|
|
305
|
+
desc: "Approve DM pairing"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
cmd: "/channels",
|
|
309
|
+
desc: "List active channels"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
cmd: "/hook list",
|
|
313
|
+
desc: "List hooks"
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
cmd: "/hook on <id>",
|
|
317
|
+
desc: "Enable hook"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
cmd: "/hook off <id>",
|
|
321
|
+
desc: "Disable hook"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
cmd: "/agent <message>",
|
|
325
|
+
desc: "Talk to your AI"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
cmd: "Voice note",
|
|
329
|
+
desc: "Transcribe + send to AI"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
cmd: "/secrets",
|
|
333
|
+
desc: "Secrets audit summary"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
cmd: "/security",
|
|
337
|
+
desc: "Security audit summary"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
cmd: "/help",
|
|
341
|
+
desc: "This help message"
|
|
342
|
+
}
|
|
343
|
+
];
|
|
344
|
+
} });
|
|
345
|
+
|
|
346
|
+
//#endregion
|
|
347
|
+
//#region packages/core/src/index.ts
|
|
348
|
+
var src_exports = {};
|
|
349
|
+
require_chunk.__export(src_exports, {
|
|
350
|
+
ACPThreadManager: () => ACPThreadManager,
|
|
351
|
+
AutoMemory: () => require_memory_auto.AutoMemory,
|
|
352
|
+
InferenceEngine: () => require_inference.InferenceEngine,
|
|
353
|
+
appendMemory: () => require_memory_auto.appendMemory,
|
|
354
|
+
buildSkillsContext: () => require_skill_loader.buildSkillsContext,
|
|
355
|
+
clearMemory: () => require_memory_auto.clearMemory,
|
|
356
|
+
createFileSessionStore: () => require_session_store.createFileSessionStore,
|
|
357
|
+
createPiRPCHandler: () => createPiRPCHandler,
|
|
358
|
+
extractExecutionContract: () => require_skill_runtime.extractExecutionContract,
|
|
359
|
+
extractFactsLocally: () => require_memory_auto.extractFactsLocally,
|
|
360
|
+
formatAgentResponse: () => formatAgentResponse,
|
|
361
|
+
getAgentHelp: () => getAgentHelp,
|
|
362
|
+
getBrowserTools: () => require_browser_tools.getBrowserTools,
|
|
363
|
+
getBuiltinTools: () => require_inference.getBuiltinTools,
|
|
364
|
+
getConfigPath: () => require_paths.getConfigPath,
|
|
365
|
+
getEnvFilePath: () => require_paths.getEnvFilePath,
|
|
366
|
+
getExtractionTools: () => require_extraction_tools.getExtractionTools,
|
|
367
|
+
getHyperClawDir: () => require_paths.getHyperClawDir,
|
|
368
|
+
getPCAccessTools: () => require_pc_access.getPCAccessTools,
|
|
369
|
+
getSessionsTools: () => require_sessions_tools.getSessionsTools,
|
|
370
|
+
getSkillCapabilities: () => require_skill_loader.getSkillCapabilities,
|
|
371
|
+
getSkillInvokeTools: () => require_skill_runtime.getSkillInvokeTools,
|
|
372
|
+
getVisionTools: () => require_vision_tools.getVisionTools,
|
|
373
|
+
getWebsiteWatchTools: () => require_website_watch_tools.getWebsiteWatchTools,
|
|
374
|
+
invokeSkill: () => require_skill_runtime.invokeSkill,
|
|
375
|
+
loadPCAccessConfig: () => require_pc_access.loadPCAccessConfig,
|
|
376
|
+
loadSkills: () => require_skill_loader.loadSkills,
|
|
377
|
+
loadSkillsContext: () => require_engine.loadSkillsContext,
|
|
378
|
+
loadWorkspaceContext: () => require_engine.loadWorkspaceContext,
|
|
379
|
+
planSteps: () => require_orchestrator.planSteps,
|
|
380
|
+
readMemory: () => require_memory_auto.readMemory,
|
|
381
|
+
reloadSkills: () => require_skill_loader.reloadSkills,
|
|
382
|
+
resolveTools: () => require_engine.resolveTools,
|
|
383
|
+
runAgent: () => runAgent,
|
|
384
|
+
runAgentEngine: () => require_engine.runAgentEngine,
|
|
385
|
+
runMultiStep: () => require_orchestrator.runMultiStep,
|
|
386
|
+
runMultiStepParallel: () => require_orchestrator.runMultiStepParallel,
|
|
387
|
+
runWithPlan: () => require_orchestrator.runWithPlan,
|
|
388
|
+
saveMemoryDirect: () => require_memory_auto.saveMemoryDirect,
|
|
389
|
+
savePCAccessConfig: () => require_pc_access.savePCAccessConfig,
|
|
390
|
+
searchMemory: () => require_memory_auto.searchMemory,
|
|
391
|
+
showMemory: () => require_memory_auto.showMemory,
|
|
392
|
+
showPCAccessStatus: () => require_pc_access.showPCAccessStatus,
|
|
393
|
+
validateSkill: () => require_skill_loader.validateSkill
|
|
394
|
+
});
|
|
395
|
+
var init_src$1 = require_chunk.__esm({ "packages/core/src/index.ts"() {
|
|
396
|
+
require_src.init_src();
|
|
397
|
+
require_engine.init_engine();
|
|
398
|
+
require_inference.init_inference();
|
|
399
|
+
require_session_store.init_session_store();
|
|
400
|
+
require_orchestrator.init_orchestrator();
|
|
401
|
+
require_skill_runtime.init_skill_runtime();
|
|
402
|
+
require_memory_auto.init_memory_auto();
|
|
403
|
+
require_skill_loader.init_skill_loader();
|
|
404
|
+
init_pi_rpc();
|
|
405
|
+
require_sessions_tools.init_sessions_tools();
|
|
406
|
+
require_pc_access.init_pc_access();
|
|
407
|
+
require_browser_tools.init_browser_tools();
|
|
408
|
+
require_extraction_tools.init_extraction_tools();
|
|
409
|
+
require_website_watch_tools.init_website_watch_tools();
|
|
410
|
+
require_vision_tools.init_vision_tools();
|
|
411
|
+
init_runner();
|
|
412
|
+
init_acp();
|
|
413
|
+
init_surface_parity();
|
|
414
|
+
} });
|
|
415
|
+
|
|
416
|
+
//#endregion
|
|
417
|
+
Object.defineProperty(exports, 'ACPThreadManager', {
|
|
418
|
+
enumerable: true,
|
|
419
|
+
get: function () {
|
|
420
|
+
return ACPThreadManager;
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
Object.defineProperty(exports, 'createPiRPCHandler', {
|
|
424
|
+
enumerable: true,
|
|
425
|
+
get: function () {
|
|
426
|
+
return createPiRPCHandler;
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
Object.defineProperty(exports, 'formatAgentResponse', {
|
|
430
|
+
enumerable: true,
|
|
431
|
+
get: function () {
|
|
432
|
+
return formatAgentResponse;
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
Object.defineProperty(exports, 'getAgentHelp', {
|
|
436
|
+
enumerable: true,
|
|
437
|
+
get: function () {
|
|
438
|
+
return getAgentHelp;
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
Object.defineProperty(exports, 'init_src', {
|
|
442
|
+
enumerable: true,
|
|
443
|
+
get: function () {
|
|
444
|
+
return init_src$1;
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
Object.defineProperty(exports, 'runAgent', {
|
|
448
|
+
enumerable: true,
|
|
449
|
+
get: function () {
|
|
450
|
+
return runAgent;
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
Object.defineProperty(exports, 'src_exports', {
|
|
454
|
+
enumerable: true,
|
|
455
|
+
get: function () {
|
|
456
|
+
return src_exports;
|
|
457
|
+
}
|
|
458
|
+
});
|