hyperclaw 5.2.2 → 5.2.4
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 +11 -0
- package/dist/chat-Bgyq3-wI.js +324 -0
- package/dist/chat-ChYGHacA.js +324 -0
- package/dist/daemon-BhAitpVR.js +404 -0
- package/dist/daemon-DD7qc2LI.js +7 -0
- package/dist/daemon-DY73xDpS.js +7 -0
- package/dist/daemon-jRZ0qvfS.js +404 -0
- package/dist/engine-CJtV0X2-.js +7 -0
- package/dist/engine-COYE-fVt.js +323 -0
- package/dist/engine-CSX8AcAZ.js +7 -0
- package/dist/engine-CkGhm_WF.js +323 -0
- package/dist/hyperclawbot-BFRUbPK-.js +508 -0
- package/dist/hyperclawbot-sfzAMwh-.js +508 -0
- package/dist/mcp-loader-D_NWYUqh.js +93 -0
- package/dist/mcp-loader-SiJk_kV8.js +93 -0
- package/dist/onboard-D4O-orEF.js +13 -0
- package/dist/onboard-DMTgAKzs.js +3865 -0
- package/dist/onboard-DN3bnyoq.js +3865 -0
- package/dist/onboard-I3AirQv9.js +13 -0
- package/dist/orchestrator-6ljWiZWu.js +189 -0
- package/dist/orchestrator-Baz5cuUr.js +189 -0
- package/dist/orchestrator-DfyK-2bP.js +6 -0
- package/dist/orchestrator-mdElwt2i.js +6 -0
- package/dist/run-main.js +25 -25
- package/dist/server-Buqn3qvG.js +1294 -0
- package/dist/server-D03HVwtV.js +4 -0
- package/dist/server-DG804qOP.js +4 -0
- package/dist/server-jaMeUOfM.js +1294 -0
- package/dist/skill-runtime-CZ8uTBra.js +102 -0
- package/dist/skill-runtime-D-vgx1zp.js +5 -0
- package/dist/skill-runtime-Dt3Zoj8M.js +102 -0
- package/dist/skill-runtime-DwNX3pnp.js +5 -0
- package/dist/src-BncJl7wS.js +458 -0
- package/dist/src-D0vSZWOd.js +458 -0
- package/dist/src-ij58SST0.js +63 -0
- package/dist/src-prH27XOV.js +63 -0
- package/dist/sub-agent-tools-DYKPR3aI.js +39 -0
- package/dist/sub-agent-tools-DrSkn7Ns.js +39 -0
- package/package.json +2 -1
- package/static/chat.html +340 -0
- package/static/dashboard.html +146 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-jS-bbMI5.js');
|
|
2
|
+
require('./paths-AIyBxIzm.js');
|
|
3
|
+
require('./paths-DPovhojT.js');
|
|
4
|
+
require('./env-resolve-DS92g2fk.js');
|
|
5
|
+
require('./config-Br73VMLb.js');
|
|
6
|
+
require('./server-jaMeUOfM.js');
|
|
7
|
+
require('./daemon-jRZ0qvfS.js');
|
|
8
|
+
require('./gateway-CzI8dnlS.js');
|
|
9
|
+
require('./providers-DP8T0QCR.js');
|
|
10
|
+
const require_onboard = require('./onboard-DMTgAKzs.js');
|
|
11
|
+
require('./theme-CLXvI6Hr.js');
|
|
12
|
+
|
|
13
|
+
exports.HyperClawWizard = require_onboard.HyperClawWizard;
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-jS-bbMI5.js');
|
|
2
|
+
|
|
3
|
+
//#region packages/core/src/agent/orchestrator.ts
|
|
4
|
+
/** Parse parallel plan into waves: [['A'], ['B','C'], ['D']] = A then B||C then D. */
|
|
5
|
+
function parseParallelWaves(text) {
|
|
6
|
+
const waves = [];
|
|
7
|
+
const lines = (text || "").trim().split(/\n/);
|
|
8
|
+
for (const line of lines) {
|
|
9
|
+
const m = line.match(/^\s*\d+\.\s*(.+)$/);
|
|
10
|
+
if (!m) continue;
|
|
11
|
+
const parts = m[1].split(/\|/).map((s) => s.trim()).filter(Boolean);
|
|
12
|
+
if (parts.length > 0) waves.push(parts);
|
|
13
|
+
}
|
|
14
|
+
return waves;
|
|
15
|
+
}
|
|
16
|
+
/** Parse "1. X\n2. Y" into step strings. */
|
|
17
|
+
function parseSteps(text) {
|
|
18
|
+
const steps = [];
|
|
19
|
+
const lines = (text || "").trim().split(/\n/);
|
|
20
|
+
for (const line of lines) {
|
|
21
|
+
const m = line.match(/^\s*\d+\.\s*(.+)$/);
|
|
22
|
+
if (m) steps.push(m[1].trim());
|
|
23
|
+
}
|
|
24
|
+
return steps.length > 0 ? steps : [];
|
|
25
|
+
}
|
|
26
|
+
/** Multi-step with retry, session context, checkpointing, error recovery. */
|
|
27
|
+
async function runMultiStep(goal, opts) {
|
|
28
|
+
const { runAgentEngine } = await Promise.resolve().then(() => require("./engine-CJtV0X2-.js"));
|
|
29
|
+
const maxRetries = opts.maxStepRetries ?? 2;
|
|
30
|
+
const checkpointable = opts.checkpointable ?? false;
|
|
31
|
+
let steps;
|
|
32
|
+
let results = [];
|
|
33
|
+
let startIndex = 0;
|
|
34
|
+
if (opts.checkpoint && opts.checkpoint.goal === goal && opts.checkpoint.steps.length > 0) {
|
|
35
|
+
steps = opts.checkpoint.steps;
|
|
36
|
+
results = [...opts.checkpoint.results ?? []];
|
|
37
|
+
startIndex = results.length;
|
|
38
|
+
} else {
|
|
39
|
+
const planOpts = opts.sessionId && opts.appendTranscript ? opts : {
|
|
40
|
+
...opts,
|
|
41
|
+
sessionId: opts.sessionId,
|
|
42
|
+
appendTranscript: opts.appendTranscript
|
|
43
|
+
};
|
|
44
|
+
const planResult = await runAgentEngine(`${PLAN_PROMPT}\n\nGoal: ${goal}`, planOpts);
|
|
45
|
+
steps = parseSteps(planResult.text);
|
|
46
|
+
if (steps.length === 0) return runAgentEngine(goal, opts);
|
|
47
|
+
}
|
|
48
|
+
let lastUsage;
|
|
49
|
+
for (let i = startIndex; i < steps.length; i++) {
|
|
50
|
+
const step = steps[i];
|
|
51
|
+
const ctx = results.length > 0 ? `Previous results:\n${results.map((r, j) => `Step ${j + 1}: ${r.slice(0, 400)}${r.length > 400 ? "..." : ""}`).join("\n")}\n\n` : "";
|
|
52
|
+
const message = `${ctx}Step ${i + 1}: ${step}`;
|
|
53
|
+
let lastErr;
|
|
54
|
+
let stepResult;
|
|
55
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
56
|
+
stepResult = await runAgentEngine(message, opts);
|
|
57
|
+
if (stepResult.usage) lastUsage = stepResult.usage;
|
|
58
|
+
if (!stepResult.error) {
|
|
59
|
+
results.push(stepResult.text);
|
|
60
|
+
if (checkpointable && opts.onCheckpoint) await Promise.resolve(opts.onCheckpoint({
|
|
61
|
+
goal,
|
|
62
|
+
steps,
|
|
63
|
+
completedIndices: [...Array(results.length)].map((_, k) => k),
|
|
64
|
+
results: [...results]
|
|
65
|
+
}));
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
lastErr = stepResult.error;
|
|
69
|
+
if (attempt < maxRetries && opts.onToken) opts.onToken(`[Retry ${attempt + 1}/${maxRetries} for step ${i + 1}…]\n`);
|
|
70
|
+
}
|
|
71
|
+
if (lastErr) {
|
|
72
|
+
const summary$1 = results.length > 0 ? results.map((r, j) => `**Step ${j + 1}**\n${r}`).join("\n\n---\n\n") + `\n\n**Step ${i + 1}** (failed): ${lastErr}` : `Step ${i + 1} failed: ${lastErr}`;
|
|
73
|
+
opts.onDone?.(summary$1);
|
|
74
|
+
return {
|
|
75
|
+
text: summary$1,
|
|
76
|
+
error: lastErr,
|
|
77
|
+
usage: lastUsage
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const summary = results.map((r, i) => `**Step ${i + 1}**\n${r}`).join("\n\n---\n\n");
|
|
82
|
+
opts.onDone?.(summary);
|
|
83
|
+
return {
|
|
84
|
+
text: summary,
|
|
85
|
+
usage: lastUsage
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/** Parallel sub-agents: plan waves → run each wave in parallel (Promise.all) → aggregate. */
|
|
89
|
+
async function runMultiStepParallel(goal, opts) {
|
|
90
|
+
const { runAgentEngine } = await Promise.resolve().then(() => require("./engine-CJtV0X2-.js"));
|
|
91
|
+
const planOpts = {
|
|
92
|
+
...opts,
|
|
93
|
+
sessionId: void 0,
|
|
94
|
+
appendTranscript: void 0
|
|
95
|
+
};
|
|
96
|
+
const planResult = await runAgentEngine(`${PARALLEL_PLAN_PROMPT}\n\nGoal: ${goal}`, planOpts);
|
|
97
|
+
const waves = parseParallelWaves(planResult.text);
|
|
98
|
+
if (waves.length === 0) return runAgentEngine(goal, opts);
|
|
99
|
+
const allResults = [];
|
|
100
|
+
let lastUsage = planResult.usage;
|
|
101
|
+
for (let w = 0; w < waves.length; w++) {
|
|
102
|
+
const wave = waves[w];
|
|
103
|
+
const ctx = allResults.length > 0 ? `Previous results:\n${allResults.map((r, j) => `Result ${j + 1}: ${r.slice(0, 300)}${r.length > 300 ? "..." : ""}`).join("\n")}\n\n` : "";
|
|
104
|
+
const messages = wave.map((step, i) => `${ctx}Sub-task ${w + 1}.${i + 1}: ${step}`);
|
|
105
|
+
const runOpts = {
|
|
106
|
+
...opts,
|
|
107
|
+
onToken: void 0,
|
|
108
|
+
onDone: void 0
|
|
109
|
+
};
|
|
110
|
+
const results = await Promise.all(messages.map((msg) => runAgentEngine(msg, runOpts)));
|
|
111
|
+
for (const r of results) {
|
|
112
|
+
if (r.usage) lastUsage = r.usage;
|
|
113
|
+
if (r.error) {
|
|
114
|
+
const summary$1 = allResults.map((r0, j) => `**Sub-agent ${j + 1}**\n${r0}`).join("\n\n---\n\n") + `\n\n**Failed**\n${r.text}`;
|
|
115
|
+
opts.onDone?.(summary$1);
|
|
116
|
+
return {
|
|
117
|
+
text: summary$1,
|
|
118
|
+
error: r.error,
|
|
119
|
+
usage: lastUsage
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
allResults.push(r.text);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
const summary = allResults.map((r, i) => `**Sub-agent ${i + 1}**\n${r}`).join("\n\n---\n\n");
|
|
126
|
+
opts.onDone?.(summary);
|
|
127
|
+
return {
|
|
128
|
+
text: summary,
|
|
129
|
+
usage: lastUsage
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/** Single-run passthrough (unchanged). */
|
|
133
|
+
async function runWithPlan(message, opts) {
|
|
134
|
+
const { runAgentEngine } = await Promise.resolve().then(() => require("./engine-CJtV0X2-.js"));
|
|
135
|
+
return runAgentEngine(message, opts);
|
|
136
|
+
}
|
|
137
|
+
async function planSteps(goal) {
|
|
138
|
+
const { runAgentEngine } = await Promise.resolve().then(() => require("./engine-CJtV0X2-.js"));
|
|
139
|
+
const r = await runAgentEngine(`${PLAN_PROMPT}\n\nGoal: ${goal}`, {});
|
|
140
|
+
return parseSteps(r.text).map((g) => ({ goal: g }));
|
|
141
|
+
}
|
|
142
|
+
var PLAN_PROMPT, PARALLEL_PLAN_PROMPT;
|
|
143
|
+
var init_orchestrator = require_chunk.__esm({ "packages/core/src/agent/orchestrator.ts"() {
|
|
144
|
+
PLAN_PROMPT = `Break this goal into 1-4 concrete, executable steps. Output ONLY numbered lines.
|
|
145
|
+
Format: 1. step one
|
|
146
|
+
2. step two
|
|
147
|
+
...
|
|
148
|
+
No other text.`;
|
|
149
|
+
PARALLEL_PLAN_PROMPT = `Break this goal into 2-6 steps. Steps that can run IN PARALLEL (independent) put on the SAME line with | between them.
|
|
150
|
+
Format:
|
|
151
|
+
1. step one
|
|
152
|
+
2. step A | step B
|
|
153
|
+
3. step three
|
|
154
|
+
Example: "Compare Python vs Node for APIs" → 1. research Python for APIs | research Node for APIs
|
|
155
|
+
2. summarize comparison
|
|
156
|
+
Output ONLY numbered lines. No other text.`;
|
|
157
|
+
} });
|
|
158
|
+
|
|
159
|
+
//#endregion
|
|
160
|
+
Object.defineProperty(exports, 'init_orchestrator', {
|
|
161
|
+
enumerable: true,
|
|
162
|
+
get: function () {
|
|
163
|
+
return init_orchestrator;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
Object.defineProperty(exports, 'planSteps', {
|
|
167
|
+
enumerable: true,
|
|
168
|
+
get: function () {
|
|
169
|
+
return planSteps;
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
Object.defineProperty(exports, 'runMultiStep', {
|
|
173
|
+
enumerable: true,
|
|
174
|
+
get: function () {
|
|
175
|
+
return runMultiStep;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
Object.defineProperty(exports, 'runMultiStepParallel', {
|
|
179
|
+
enumerable: true,
|
|
180
|
+
get: function () {
|
|
181
|
+
return runMultiStepParallel;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
Object.defineProperty(exports, 'runWithPlan', {
|
|
185
|
+
enumerable: true,
|
|
186
|
+
get: function () {
|
|
187
|
+
return runWithPlan;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-jS-bbMI5.js');
|
|
2
|
+
|
|
3
|
+
//#region packages/core/src/agent/orchestrator.ts
|
|
4
|
+
/** Parse parallel plan into waves: [['A'], ['B','C'], ['D']] = A then B||C then D. */
|
|
5
|
+
function parseParallelWaves(text) {
|
|
6
|
+
const waves = [];
|
|
7
|
+
const lines = (text || "").trim().split(/\n/);
|
|
8
|
+
for (const line of lines) {
|
|
9
|
+
const m = line.match(/^\s*\d+\.\s*(.+)$/);
|
|
10
|
+
if (!m) continue;
|
|
11
|
+
const parts = m[1].split(/\|/).map((s) => s.trim()).filter(Boolean);
|
|
12
|
+
if (parts.length > 0) waves.push(parts);
|
|
13
|
+
}
|
|
14
|
+
return waves;
|
|
15
|
+
}
|
|
16
|
+
/** Parse "1. X\n2. Y" into step strings. */
|
|
17
|
+
function parseSteps(text) {
|
|
18
|
+
const steps = [];
|
|
19
|
+
const lines = (text || "").trim().split(/\n/);
|
|
20
|
+
for (const line of lines) {
|
|
21
|
+
const m = line.match(/^\s*\d+\.\s*(.+)$/);
|
|
22
|
+
if (m) steps.push(m[1].trim());
|
|
23
|
+
}
|
|
24
|
+
return steps.length > 0 ? steps : [];
|
|
25
|
+
}
|
|
26
|
+
/** Multi-step with retry, session context, checkpointing, error recovery. */
|
|
27
|
+
async function runMultiStep(goal, opts) {
|
|
28
|
+
const { runAgentEngine } = await Promise.resolve().then(() => require("./engine-CSX8AcAZ.js"));
|
|
29
|
+
const maxRetries = opts.maxStepRetries ?? 2;
|
|
30
|
+
const checkpointable = opts.checkpointable ?? false;
|
|
31
|
+
let steps;
|
|
32
|
+
let results = [];
|
|
33
|
+
let startIndex = 0;
|
|
34
|
+
if (opts.checkpoint && opts.checkpoint.goal === goal && opts.checkpoint.steps.length > 0) {
|
|
35
|
+
steps = opts.checkpoint.steps;
|
|
36
|
+
results = [...opts.checkpoint.results ?? []];
|
|
37
|
+
startIndex = results.length;
|
|
38
|
+
} else {
|
|
39
|
+
const planOpts = opts.sessionId && opts.appendTranscript ? opts : {
|
|
40
|
+
...opts,
|
|
41
|
+
sessionId: opts.sessionId,
|
|
42
|
+
appendTranscript: opts.appendTranscript
|
|
43
|
+
};
|
|
44
|
+
const planResult = await runAgentEngine(`${PLAN_PROMPT}\n\nGoal: ${goal}`, planOpts);
|
|
45
|
+
steps = parseSteps(planResult.text);
|
|
46
|
+
if (steps.length === 0) return runAgentEngine(goal, opts);
|
|
47
|
+
}
|
|
48
|
+
let lastUsage;
|
|
49
|
+
for (let i = startIndex; i < steps.length; i++) {
|
|
50
|
+
const step = steps[i];
|
|
51
|
+
const ctx = results.length > 0 ? `Previous results:\n${results.map((r, j) => `Step ${j + 1}: ${r.slice(0, 400)}${r.length > 400 ? "..." : ""}`).join("\n")}\n\n` : "";
|
|
52
|
+
const message = `${ctx}Step ${i + 1}: ${step}`;
|
|
53
|
+
let lastErr;
|
|
54
|
+
let stepResult;
|
|
55
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
56
|
+
stepResult = await runAgentEngine(message, opts);
|
|
57
|
+
if (stepResult.usage) lastUsage = stepResult.usage;
|
|
58
|
+
if (!stepResult.error) {
|
|
59
|
+
results.push(stepResult.text);
|
|
60
|
+
if (checkpointable && opts.onCheckpoint) await Promise.resolve(opts.onCheckpoint({
|
|
61
|
+
goal,
|
|
62
|
+
steps,
|
|
63
|
+
completedIndices: [...Array(results.length)].map((_, k) => k),
|
|
64
|
+
results: [...results]
|
|
65
|
+
}));
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
lastErr = stepResult.error;
|
|
69
|
+
if (attempt < maxRetries && opts.onToken) opts.onToken(`[Retry ${attempt + 1}/${maxRetries} for step ${i + 1}…]\n`);
|
|
70
|
+
}
|
|
71
|
+
if (lastErr) {
|
|
72
|
+
const summary$1 = results.length > 0 ? results.map((r, j) => `**Step ${j + 1}**\n${r}`).join("\n\n---\n\n") + `\n\n**Step ${i + 1}** (failed): ${lastErr}` : `Step ${i + 1} failed: ${lastErr}`;
|
|
73
|
+
opts.onDone?.(summary$1);
|
|
74
|
+
return {
|
|
75
|
+
text: summary$1,
|
|
76
|
+
error: lastErr,
|
|
77
|
+
usage: lastUsage
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const summary = results.map((r, i) => `**Step ${i + 1}**\n${r}`).join("\n\n---\n\n");
|
|
82
|
+
opts.onDone?.(summary);
|
|
83
|
+
return {
|
|
84
|
+
text: summary,
|
|
85
|
+
usage: lastUsage
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/** Parallel sub-agents: plan waves → run each wave in parallel (Promise.all) → aggregate. */
|
|
89
|
+
async function runMultiStepParallel(goal, opts) {
|
|
90
|
+
const { runAgentEngine } = await Promise.resolve().then(() => require("./engine-CSX8AcAZ.js"));
|
|
91
|
+
const planOpts = {
|
|
92
|
+
...opts,
|
|
93
|
+
sessionId: void 0,
|
|
94
|
+
appendTranscript: void 0
|
|
95
|
+
};
|
|
96
|
+
const planResult = await runAgentEngine(`${PARALLEL_PLAN_PROMPT}\n\nGoal: ${goal}`, planOpts);
|
|
97
|
+
const waves = parseParallelWaves(planResult.text);
|
|
98
|
+
if (waves.length === 0) return runAgentEngine(goal, opts);
|
|
99
|
+
const allResults = [];
|
|
100
|
+
let lastUsage = planResult.usage;
|
|
101
|
+
for (let w = 0; w < waves.length; w++) {
|
|
102
|
+
const wave = waves[w];
|
|
103
|
+
const ctx = allResults.length > 0 ? `Previous results:\n${allResults.map((r, j) => `Result ${j + 1}: ${r.slice(0, 300)}${r.length > 300 ? "..." : ""}`).join("\n")}\n\n` : "";
|
|
104
|
+
const messages = wave.map((step, i) => `${ctx}Sub-task ${w + 1}.${i + 1}: ${step}`);
|
|
105
|
+
const runOpts = {
|
|
106
|
+
...opts,
|
|
107
|
+
onToken: void 0,
|
|
108
|
+
onDone: void 0
|
|
109
|
+
};
|
|
110
|
+
const results = await Promise.all(messages.map((msg) => runAgentEngine(msg, runOpts)));
|
|
111
|
+
for (const r of results) {
|
|
112
|
+
if (r.usage) lastUsage = r.usage;
|
|
113
|
+
if (r.error) {
|
|
114
|
+
const summary$1 = allResults.map((r0, j) => `**Sub-agent ${j + 1}**\n${r0}`).join("\n\n---\n\n") + `\n\n**Failed**\n${r.text}`;
|
|
115
|
+
opts.onDone?.(summary$1);
|
|
116
|
+
return {
|
|
117
|
+
text: summary$1,
|
|
118
|
+
error: r.error,
|
|
119
|
+
usage: lastUsage
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
allResults.push(r.text);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
const summary = allResults.map((r, i) => `**Sub-agent ${i + 1}**\n${r}`).join("\n\n---\n\n");
|
|
126
|
+
opts.onDone?.(summary);
|
|
127
|
+
return {
|
|
128
|
+
text: summary,
|
|
129
|
+
usage: lastUsage
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/** Single-run passthrough (unchanged). */
|
|
133
|
+
async function runWithPlan(message, opts) {
|
|
134
|
+
const { runAgentEngine } = await Promise.resolve().then(() => require("./engine-CSX8AcAZ.js"));
|
|
135
|
+
return runAgentEngine(message, opts);
|
|
136
|
+
}
|
|
137
|
+
async function planSteps(goal) {
|
|
138
|
+
const { runAgentEngine } = await Promise.resolve().then(() => require("./engine-CSX8AcAZ.js"));
|
|
139
|
+
const r = await runAgentEngine(`${PLAN_PROMPT}\n\nGoal: ${goal}`, {});
|
|
140
|
+
return parseSteps(r.text).map((g) => ({ goal: g }));
|
|
141
|
+
}
|
|
142
|
+
var PLAN_PROMPT, PARALLEL_PLAN_PROMPT;
|
|
143
|
+
var init_orchestrator = require_chunk.__esm({ "packages/core/src/agent/orchestrator.ts"() {
|
|
144
|
+
PLAN_PROMPT = `Break this goal into 1-4 concrete, executable steps. Output ONLY numbered lines.
|
|
145
|
+
Format: 1. step one
|
|
146
|
+
2. step two
|
|
147
|
+
...
|
|
148
|
+
No other text.`;
|
|
149
|
+
PARALLEL_PLAN_PROMPT = `Break this goal into 2-6 steps. Steps that can run IN PARALLEL (independent) put on the SAME line with | between them.
|
|
150
|
+
Format:
|
|
151
|
+
1. step one
|
|
152
|
+
2. step A | step B
|
|
153
|
+
3. step three
|
|
154
|
+
Example: "Compare Python vs Node for APIs" → 1. research Python for APIs | research Node for APIs
|
|
155
|
+
2. summarize comparison
|
|
156
|
+
Output ONLY numbered lines. No other text.`;
|
|
157
|
+
} });
|
|
158
|
+
|
|
159
|
+
//#endregion
|
|
160
|
+
Object.defineProperty(exports, 'init_orchestrator', {
|
|
161
|
+
enumerable: true,
|
|
162
|
+
get: function () {
|
|
163
|
+
return init_orchestrator;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
Object.defineProperty(exports, 'planSteps', {
|
|
167
|
+
enumerable: true,
|
|
168
|
+
get: function () {
|
|
169
|
+
return planSteps;
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
Object.defineProperty(exports, 'runMultiStep', {
|
|
173
|
+
enumerable: true,
|
|
174
|
+
get: function () {
|
|
175
|
+
return runMultiStep;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
Object.defineProperty(exports, 'runMultiStepParallel', {
|
|
179
|
+
enumerable: true,
|
|
180
|
+
get: function () {
|
|
181
|
+
return runMultiStepParallel;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
Object.defineProperty(exports, 'runWithPlan', {
|
|
185
|
+
enumerable: true,
|
|
186
|
+
get: function () {
|
|
187
|
+
return runWithPlan;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-jS-bbMI5.js');
|
|
2
|
+
const require_orchestrator = require('./orchestrator-Baz5cuUr.js');
|
|
3
|
+
|
|
4
|
+
require_orchestrator.init_orchestrator();
|
|
5
|
+
exports.runMultiStep = require_orchestrator.runMultiStep;
|
|
6
|
+
exports.runMultiStepParallel = require_orchestrator.runMultiStepParallel;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-jS-bbMI5.js');
|
|
2
|
+
const require_orchestrator = require('./orchestrator-6ljWiZWu.js');
|
|
3
|
+
|
|
4
|
+
require_orchestrator.init_orchestrator();
|
|
5
|
+
exports.runMultiStep = require_orchestrator.runMultiStep;
|
|
6
|
+
exports.runMultiStepParallel = require_orchestrator.runMultiStepParallel;
|
package/dist/run-main.js
CHANGED
|
@@ -3,11 +3,11 @@ const require_paths = require('./paths-AIyBxIzm.js');
|
|
|
3
3
|
const require_paths$1 = require('./paths-DPovhojT.js');
|
|
4
4
|
require('./env-resolve-DS92g2fk.js');
|
|
5
5
|
const require_config = require('./config-Br73VMLb.js');
|
|
6
|
-
require('./server-
|
|
7
|
-
const require_daemon = require('./daemon-
|
|
6
|
+
require('./server-jaMeUOfM.js');
|
|
7
|
+
const require_daemon = require('./daemon-jRZ0qvfS.js');
|
|
8
8
|
const require_gateway = require('./gateway-CzI8dnlS.js');
|
|
9
9
|
require('./providers-DP8T0QCR.js');
|
|
10
|
-
const require_onboard = require('./onboard-
|
|
10
|
+
const require_onboard = require('./onboard-DMTgAKzs.js');
|
|
11
11
|
require('./theme-CLXvI6Hr.js');
|
|
12
12
|
const require_hub = require('./hub-CI4qcd1b.js');
|
|
13
13
|
const require_update_check = require('./update-check-BeAPt4-f.js');
|
|
@@ -2533,7 +2533,7 @@ process.on("uncaughtException", (err) => {
|
|
|
2533
2533
|
process.exit(1);
|
|
2534
2534
|
});
|
|
2535
2535
|
const program = new commander.Command();
|
|
2536
|
-
program.name("hyperclaw").description("⚡ HyperClaw — AI Gateway Platform. The Lobster Evolution 🦅").version("5.2.
|
|
2536
|
+
program.name("hyperclaw").description("⚡ HyperClaw — AI Gateway Platform. The Lobster Evolution 🦅").version("5.2.4").option("--profile <name>", "Use an isolated gateway profile. Auto-scopes HYPERCLAW_STATE_DIR and HYPERCLAW_CONFIG_PATH. Required for multi-gateway setups (rescue bot, staging, etc.). Example: hyperclaw --profile rescue gateway --port 19001").hook("preAction", (thisCommand) => {
|
|
2537
2537
|
const profile = thisCommand.opts().profile;
|
|
2538
2538
|
if (profile) {
|
|
2539
2539
|
const os$2 = require("os");
|
|
@@ -2678,7 +2678,7 @@ sandboxCmd.command("explain").description("Show effective sandbox mode, tool pol
|
|
|
2678
2678
|
const sandboxMode = cfg?.agents?.defaults?.sandbox?.mode ?? "non-main";
|
|
2679
2679
|
const toolsCfg = cfg?.tools ?? {};
|
|
2680
2680
|
const { describeToolPolicy, applyToolPolicy } = await Promise.resolve().then(() => require("./tool-policy-TmXx_fpp.js"));
|
|
2681
|
-
const { getBuiltinTools, getSessionsTools, getPCAccessTools, getBrowserTools, getExtractionTools, getWebsiteWatchTools, getVisionTools } = await Promise.resolve().then(() => require("./src-
|
|
2681
|
+
const { getBuiltinTools, getSessionsTools, getPCAccessTools, getBrowserTools, getExtractionTools, getWebsiteWatchTools, getVisionTools } = await Promise.resolve().then(() => require("./src-ij58SST0.js"));
|
|
2682
2682
|
const allTools = [
|
|
2683
2683
|
...getBuiltinTools(),
|
|
2684
2684
|
...getSessionsTools(() => null),
|
|
@@ -3079,7 +3079,7 @@ cfgCmd.command("set-service-key <serviceId> [apiKey]").description("Set API key
|
|
|
3079
3079
|
cfgCmd.command("schema").description("Show configuration schema").action(() => {
|
|
3080
3080
|
console.log(chalk.default.bold.hex("#06b6d4")("\n Config schema: ~/.hyperclaw/hyperclaw.json\n"));
|
|
3081
3081
|
const schema = {
|
|
3082
|
-
version: "string (e.g. \"5.2.
|
|
3082
|
+
version: "string (e.g. \"5.2.4\")",
|
|
3083
3083
|
workspaceName: "string",
|
|
3084
3084
|
provider: {
|
|
3085
3085
|
providerId: "string",
|
|
@@ -3409,7 +3409,7 @@ program.command("osint").description("OSINT / Ethical Hacking mode — configure
|
|
|
3409
3409
|
process.exit(0);
|
|
3410
3410
|
});
|
|
3411
3411
|
program.command("chat").description("Interactive terminal chat with the agent").option("--session <id>", "Resume a named session").option("--model <model>", "Override model").option("--thinking <level>", "Thinking level: high|medium|low|none", "none").option("--workspace <dir>", "Override workspace directory").action(async (opts) => {
|
|
3412
|
-
const { runChat } = await Promise.resolve().then(() => require("./chat-
|
|
3412
|
+
const { runChat } = await Promise.resolve().then(() => require("./chat-ChYGHacA.js"));
|
|
3413
3413
|
await runChat({
|
|
3414
3414
|
sessionId: opts.session,
|
|
3415
3415
|
model: opts.model,
|
|
@@ -3419,7 +3419,7 @@ program.command("chat").description("Interactive terminal chat with the agent").
|
|
|
3419
3419
|
});
|
|
3420
3420
|
const agentRunCmd = program.command("agent").description("Run agent with thinking control");
|
|
3421
3421
|
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) => {
|
|
3422
|
-
const { runAgent } = await Promise.resolve().then(() => require("./src-
|
|
3422
|
+
const { runAgent } = await Promise.resolve().then(() => require("./src-ij58SST0.js"));
|
|
3423
3423
|
await runAgent({
|
|
3424
3424
|
message: opts.message,
|
|
3425
3425
|
thinking: opts.thinking,
|
|
@@ -3435,7 +3435,7 @@ agentRunCmd.requiredOption("-m, --message <text>", "Message to send to the agent
|
|
|
3435
3435
|
});
|
|
3436
3436
|
const threadsCmd = program.command("threads").description("ACP thread-bound agent sessions");
|
|
3437
3437
|
threadsCmd.command("list").description("List agent threads").option("--channel <id>", "Filter by channel").option("--active", "Show only active threads").action(async (opts) => {
|
|
3438
|
-
const { ACPThreadManager } = await Promise.resolve().then(() => require("./src-
|
|
3438
|
+
const { ACPThreadManager } = await Promise.resolve().then(() => require("./src-ij58SST0.js"));
|
|
3439
3439
|
const mgr = new ACPThreadManager();
|
|
3440
3440
|
const threads = await mgr.list({
|
|
3441
3441
|
channelId: opts.channel,
|
|
@@ -3445,7 +3445,7 @@ threadsCmd.command("list").description("List agent threads").option("--channel <
|
|
|
3445
3445
|
process.exit(0);
|
|
3446
3446
|
});
|
|
3447
3447
|
threadsCmd.command("terminate <id>").description("Terminate a thread").action(async (id) => {
|
|
3448
|
-
const { ACPThreadManager } = await Promise.resolve().then(() => require("./src-
|
|
3448
|
+
const { ACPThreadManager } = await Promise.resolve().then(() => require("./src-ij58SST0.js"));
|
|
3449
3449
|
await new ACPThreadManager().terminate(id);
|
|
3450
3450
|
console.log(require("chalk").green(`\n ✔ Thread terminated: ${id}\n`));
|
|
3451
3451
|
process.exit(0);
|
|
@@ -3693,7 +3693,7 @@ logsCmd.action(async (opts) => {
|
|
|
3693
3693
|
}
|
|
3694
3694
|
});
|
|
3695
3695
|
program.command("gateway:serve").description("Start the gateway server in the foreground (used by daemon)").action(async () => {
|
|
3696
|
-
const { startGateway } = await Promise.resolve().then(() => require("./server-
|
|
3696
|
+
const { startGateway } = await Promise.resolve().then(() => require("./server-DG804qOP.js"));
|
|
3697
3697
|
await startGateway();
|
|
3698
3698
|
process.on("SIGINT", () => process.exit(0));
|
|
3699
3699
|
process.on("SIGTERM", () => process.exit(0));
|
|
@@ -3945,13 +3945,13 @@ workspaceCmd.command("show [dir]").description("Show workspace files summary").a
|
|
|
3945
3945
|
});
|
|
3946
3946
|
const botCmd = program.command("bot").description("HyperClaw Bot — companion bot for remote gateway control");
|
|
3947
3947
|
botCmd.command("status").action(async () => {
|
|
3948
|
-
const { showBotStatus } = await Promise.resolve().then(() => require("./hyperclawbot-
|
|
3948
|
+
const { showBotStatus } = await Promise.resolve().then(() => require("./hyperclawbot-sfzAMwh-.js"));
|
|
3949
3949
|
await showBotStatus();
|
|
3950
3950
|
process.exit(0);
|
|
3951
3951
|
});
|
|
3952
3952
|
botCmd.command("setup").description("Configure HyperClaw Bot (Telegram token, allowed users)").action(async () => {
|
|
3953
3953
|
const inquirer$2 = require("inquirer");
|
|
3954
|
-
const { saveBotConfig } = await Promise.resolve().then(() => require("./hyperclawbot-
|
|
3954
|
+
const { saveBotConfig } = await Promise.resolve().then(() => require("./hyperclawbot-sfzAMwh-.js"));
|
|
3955
3955
|
const chalk$11 = require("chalk");
|
|
3956
3956
|
console.log(chalk$11.bold.hex("#06b6d4")("\n 🦅 HYPERCLAW BOT SETUP\n"));
|
|
3957
3957
|
console.log(chalk$11.gray(" Create a bot at t.me/BotFather, then paste the token below.\n"));
|
|
@@ -4013,14 +4013,14 @@ botCmd.command("start").description("Start HyperClaw Bot (foreground or backgrou
|
|
|
4013
4013
|
cwd: process.cwd()
|
|
4014
4014
|
});
|
|
4015
4015
|
child.unref();
|
|
4016
|
-
const { writeBotPid } = await Promise.resolve().then(() => require("./hyperclawbot-
|
|
4016
|
+
const { writeBotPid } = await Promise.resolve().then(() => require("./hyperclawbot-sfzAMwh-.js"));
|
|
4017
4017
|
await writeBotPid(child.pid);
|
|
4018
4018
|
console.log(require("chalk").green(`\n ✔ HyperClaw Bot started in background (PID ${child.pid})`));
|
|
4019
4019
|
console.log(require("chalk").gray(" Stop with: hyperclaw bot stop\n"));
|
|
4020
4020
|
process.exit(0);
|
|
4021
4021
|
return;
|
|
4022
4022
|
}
|
|
4023
|
-
const { loadBotConfig, TelegramHyperClawBot, DiscordHyperClawBot } = await Promise.resolve().then(() => require("./hyperclawbot-
|
|
4023
|
+
const { loadBotConfig, TelegramHyperClawBot, DiscordHyperClawBot } = await Promise.resolve().then(() => require("./hyperclawbot-sfzAMwh-.js"));
|
|
4024
4024
|
const cfg = await loadBotConfig();
|
|
4025
4025
|
if (!cfg) {
|
|
4026
4026
|
console.log(require("chalk").red("\n ✖ HyperClaw Bot not configured. Run: hyperclaw bot setup\n"));
|
|
@@ -4047,41 +4047,41 @@ botCmd.command("start").description("Start HyperClaw Bot (foreground or backgrou
|
|
|
4047
4047
|
});
|
|
4048
4048
|
botCmd.command("stop").description("Stop HyperClaw Bot (when running in background)").action(async () => {
|
|
4049
4049
|
const chalk$11 = require("chalk");
|
|
4050
|
-
const { stopBotProcess } = await Promise.resolve().then(() => require("./hyperclawbot-
|
|
4050
|
+
const { stopBotProcess } = await Promise.resolve().then(() => require("./hyperclawbot-sfzAMwh-.js"));
|
|
4051
4051
|
const stopped = await stopBotProcess();
|
|
4052
4052
|
if (stopped) console.log(chalk$11.green("\n ✔ HyperClaw Bot stopped\n"));
|
|
4053
4053
|
else console.log(chalk$11.gray("\n Bot not running in background (no PID file). Use Ctrl+C to stop foreground bot.\n"));
|
|
4054
4054
|
process.exit(stopped ? 0 : 1);
|
|
4055
4055
|
});
|
|
4056
4056
|
memCmd.command("search <query>").description("Search MEMORY.md").action(async (query) => {
|
|
4057
|
-
const { searchMemory } = await Promise.resolve().then(() => require("./src-
|
|
4057
|
+
const { searchMemory } = await Promise.resolve().then(() => require("./src-ij58SST0.js"));
|
|
4058
4058
|
await searchMemory(query);
|
|
4059
4059
|
process.exit(0);
|
|
4060
4060
|
});
|
|
4061
4061
|
memCmd.command("auto-show").description("Show auto-extracted memories from MEMORY.md").action(async () => {
|
|
4062
|
-
const { showMemory } = await Promise.resolve().then(() => require("./src-
|
|
4062
|
+
const { showMemory } = await Promise.resolve().then(() => require("./src-ij58SST0.js"));
|
|
4063
4063
|
await showMemory();
|
|
4064
4064
|
process.exit(0);
|
|
4065
4065
|
});
|
|
4066
4066
|
memCmd.command("clear").description("Clear all auto-extracted memories").action(async () => {
|
|
4067
|
-
const { clearMemory } = await Promise.resolve().then(() => require("./src-
|
|
4067
|
+
const { clearMemory } = await Promise.resolve().then(() => require("./src-ij58SST0.js"));
|
|
4068
4068
|
await clearMemory();
|
|
4069
4069
|
process.exit(0);
|
|
4070
4070
|
});
|
|
4071
4071
|
memCmd.command("save <text>").description("Manually save a fact to MEMORY.md").action(async (text) => {
|
|
4072
|
-
const { saveMemoryDirect } = await Promise.resolve().then(() => require("./src-
|
|
4072
|
+
const { saveMemoryDirect } = await Promise.resolve().then(() => require("./src-ij58SST0.js"));
|
|
4073
4073
|
await saveMemoryDirect(text);
|
|
4074
4074
|
console.log(chalk.default.hex("#06b6d4")(` ✅ Saved: ${text}\n`));
|
|
4075
4075
|
process.exit(0);
|
|
4076
4076
|
});
|
|
4077
4077
|
const pcCmd = program.command("pc").description("PC access — give the AI access to your computer");
|
|
4078
4078
|
pcCmd.command("status").description("Show PC access status and config").action(async () => {
|
|
4079
|
-
const { showPCAccessStatus } = await Promise.resolve().then(() => require("./src-
|
|
4079
|
+
const { showPCAccessStatus } = await Promise.resolve().then(() => require("./src-ij58SST0.js"));
|
|
4080
4080
|
await showPCAccessStatus();
|
|
4081
4081
|
process.exit(0);
|
|
4082
4082
|
});
|
|
4083
4083
|
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) => {
|
|
4084
|
-
const { savePCAccessConfig } = await Promise.resolve().then(() => require("./src-
|
|
4084
|
+
const { savePCAccessConfig } = await Promise.resolve().then(() => require("./src-ij58SST0.js"));
|
|
4085
4085
|
const level = opts.level;
|
|
4086
4086
|
const allowed = [
|
|
4087
4087
|
"read-only",
|
|
@@ -4108,7 +4108,7 @@ pcCmd.command("enable").description("Enable PC access for the AI").option("--lev
|
|
|
4108
4108
|
process.exit(0);
|
|
4109
4109
|
});
|
|
4110
4110
|
pcCmd.command("disable").description("Disable PC access").action(async () => {
|
|
4111
|
-
const { savePCAccessConfig } = await Promise.resolve().then(() => require("./src-
|
|
4111
|
+
const { savePCAccessConfig } = await Promise.resolve().then(() => require("./src-ij58SST0.js"));
|
|
4112
4112
|
await savePCAccessConfig({ enabled: false });
|
|
4113
4113
|
console.log(chalk.default.hex("#06b6d4")("\n ✅ PC access disabled\n"));
|
|
4114
4114
|
process.exit(0);
|
|
@@ -4133,7 +4133,7 @@ pcCmd.command("log").description("Show PC access audit log").option("-n, --lines
|
|
|
4133
4133
|
process.exit(0);
|
|
4134
4134
|
});
|
|
4135
4135
|
pcCmd.command("run <command>").description("Run a shell command via PC access (must be enabled)").action(async (command) => {
|
|
4136
|
-
const { loadPCAccessConfig, getPCAccessTools } = await Promise.resolve().then(() => require("./src-
|
|
4136
|
+
const { loadPCAccessConfig, getPCAccessTools } = await Promise.resolve().then(() => require("./src-ij58SST0.js"));
|
|
4137
4137
|
const cfg = await loadPCAccessConfig();
|
|
4138
4138
|
if (!cfg.enabled) {
|
|
4139
4139
|
console.log(chalk.default.red("\n ✖ PC access disabled. Run: hyperclaw pc enable\n"));
|
|
@@ -4191,7 +4191,7 @@ if (process.argv.length === 2) (async () => {
|
|
|
4191
4191
|
console.log(` ${t.c("hyperclaw --help")} — all commands\n`);
|
|
4192
4192
|
} else {
|
|
4193
4193
|
await new require_onboard.Banner().showNeonBanner(false);
|
|
4194
|
-
const { HyperClawWizard: HyperClawWizard$1 } = await Promise.resolve().then(() => require("./onboard-
|
|
4194
|
+
const { HyperClawWizard: HyperClawWizard$1 } = await Promise.resolve().then(() => require("./onboard-I3AirQv9.js"));
|
|
4195
4195
|
await new HyperClawWizard$1().run({ wizard: true });
|
|
4196
4196
|
}
|
|
4197
4197
|
await runUpdateCheck();
|