hyperclaw 5.0.2 → 5.0.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 +126 -0
- package/bin/hyperclaw.js +3 -0
- package/dist/chat-BweTUpH2.js +258 -0
- package/dist/chat-GGvIJUVJ.js +258 -0
- package/dist/daemon-BpKOVkT1.js +5 -0
- package/dist/daemon-CIlECXTb.js +318 -0
- package/dist/daemon-DwrkIl5o.js +5 -0
- package/dist/daemon-MtT2Tqkp.js +318 -0
- package/dist/engine-C713U1K_.js +7 -0
- package/dist/engine-DAS8lres.js +305 -0
- package/dist/engine-DxVqkali.js +305 -0
- package/dist/engine-R0howgUa.js +7 -0
- package/dist/hyperclawbot-BHrzgnRc.js +505 -0
- package/dist/hyperclawbot-CnNeGJ-M.js +505 -0
- package/dist/mcp-loader-C5ruuDlw.js +94 -0
- package/dist/mcp-loader-nkCSFwxV.js +94 -0
- package/dist/onboard-B2V24zkc.js +11 -0
- package/dist/onboard-B963fZXV.js +3959 -0
- package/dist/onboard-CdJCHc1l.js +3959 -0
- package/dist/onboard-CrZK-8Lu.js +11 -0
- package/dist/orchestrator-D5spLJYq.js +189 -0
- package/dist/orchestrator-DZKfDwbu.js +189 -0
- package/dist/orchestrator-JMJXUA6c.js +6 -0
- package/dist/orchestrator-dpAJPGSS.js +6 -0
- package/dist/run-main.js +26 -26
- package/dist/server-B31aM6eh.js +1255 -0
- package/dist/server-Bt_lNoj3.js +4 -0
- package/dist/server-D2KyJXOC.js +4 -0
- package/dist/server-T3J_d1Cu.js +1255 -0
- package/dist/skill-runtime-BEtVm4Hl.js +5 -0
- package/dist/skill-runtime-B_PxIyXb.js +102 -0
- package/dist/skill-runtime-C-TGLn1X.js +102 -0
- package/dist/skill-runtime-Cgo0CKKU.js +5 -0
- package/dist/src-Bnw5V6w0.js +63 -0
- package/dist/src-C5enhnSg.js +458 -0
- package/dist/src-CTL-8bjt.js +63 -0
- package/dist/src-z9Dgzg9L.js +458 -0
- package/dist/sub-agent-tools-B7Z6MP8P.js +39 -0
- package/dist/sub-agent-tools-BRH2D_AO.js +39 -0
- package/package.json +4 -3
- package/scripts/postinstall.js +50 -42
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-jS-bbMI5.js');
|
|
2
|
+
require('./paths-AIyBxIzm.js');
|
|
3
|
+
require('./paths-DPovhojT.js');
|
|
4
|
+
require('./env-resolve-BFJXWl94.js');
|
|
5
|
+
const require_onboard = require('./onboard-B963fZXV.js');
|
|
6
|
+
require('./server-T3J_d1Cu.js');
|
|
7
|
+
require('./daemon-CIlECXTb.js');
|
|
8
|
+
require('./providers-Dy15rDb7.js');
|
|
9
|
+
require('./theme-DajRRZbA.js');
|
|
10
|
+
|
|
11
|
+
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-C713U1K_.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-C713U1K_.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-C713U1K_.js"));
|
|
135
|
+
return runAgentEngine(message, opts);
|
|
136
|
+
}
|
|
137
|
+
async function planSteps(goal) {
|
|
138
|
+
const { runAgentEngine } = await Promise.resolve().then(() => require("./engine-C713U1K_.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-R0howgUa.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-R0howgUa.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-R0howgUa.js"));
|
|
135
|
+
return runAgentEngine(message, opts);
|
|
136
|
+
}
|
|
137
|
+
async function planSteps(goal) {
|
|
138
|
+
const { runAgentEngine } = await Promise.resolve().then(() => require("./engine-R0howgUa.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-DZKfDwbu.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-D5spLJYq.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
|
@@ -2,9 +2,9 @@ const require_chunk = require('./chunk-jS-bbMI5.js');
|
|
|
2
2
|
require('./paths-AIyBxIzm.js');
|
|
3
3
|
require('./paths-DPovhojT.js');
|
|
4
4
|
require('./env-resolve-BFJXWl94.js');
|
|
5
|
-
const require_onboard = require('./onboard-
|
|
6
|
-
require('./server-
|
|
7
|
-
const require_daemon = require('./daemon-
|
|
5
|
+
const require_onboard = require('./onboard-B963fZXV.js');
|
|
6
|
+
require('./server-T3J_d1Cu.js');
|
|
7
|
+
const require_daemon = require('./daemon-CIlECXTb.js');
|
|
8
8
|
require('./providers-Dy15rDb7.js');
|
|
9
9
|
require('./theme-DajRRZbA.js');
|
|
10
10
|
const require_hub = require('./hub-BO6bj8Yj.js');
|
|
@@ -65,7 +65,7 @@ var Dashboard = class {
|
|
|
65
65
|
return c(`� `) + content + " ".repeat(pad) + c(`�`);
|
|
66
66
|
};
|
|
67
67
|
console.log(c(`-${line}�`));
|
|
68
|
-
console.log(c(`�`) + chalk.default.bold.hex("#06b6d4")(`${"?? HYPERCLAW v5.0.
|
|
68
|
+
console.log(c(`�`) + chalk.default.bold.hex("#06b6d4")(`${"?? HYPERCLAW v5.0.4 � GATEWAY DASHBOARD".padStart(45).padEnd(w)}`) + c(`�`));
|
|
69
69
|
console.log(c(`�${line}�`));
|
|
70
70
|
console.log(row(`${statusDot} Gateway ${statusText} ${chalk.default.gray("�")} ws://localhost:${port} ${chalk.default.gray("�")} Agent: ${c(agent)}`));
|
|
71
71
|
console.log(row(`${c("?")} Model ${chalk.default.gray(model.slice(0, 30))} ${chalk.default.gray("�")} User: ${c(user)}`));
|
|
@@ -2427,7 +2427,7 @@ var init_queue = require_chunk.__esm({ "src/delivery/queue.ts"() {
|
|
|
2427
2427
|
//#endregion
|
|
2428
2428
|
//#region src/cli/run-main.ts
|
|
2429
2429
|
const program = new commander.Command();
|
|
2430
|
-
program.name("hyperclaw").description("⚡ HyperClaw — AI Gateway Platform. The Lobster Evolution 🦅").version("5.0.
|
|
2430
|
+
program.name("hyperclaw").description("⚡ HyperClaw — AI Gateway Platform. The Lobster Evolution 🦅").version("5.0.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) => {
|
|
2431
2431
|
const profile = thisCommand.opts().profile;
|
|
2432
2432
|
if (profile) {
|
|
2433
2433
|
const os$8 = require("os");
|
|
@@ -2570,7 +2570,7 @@ sandboxCmd.command("explain").description("Show effective sandbox mode, tool pol
|
|
|
2570
2570
|
const sandboxMode = cfg?.agents?.defaults?.sandbox?.mode ?? "non-main";
|
|
2571
2571
|
const toolsCfg = cfg?.tools ?? {};
|
|
2572
2572
|
const { describeToolPolicy, applyToolPolicy } = await Promise.resolve().then(() => require("./tool-policy-DgNqFWYn.js"));
|
|
2573
|
-
const { getBuiltinTools, getSessionsTools, getPCAccessTools, getBrowserTools, getExtractionTools, getWebsiteWatchTools, getVisionTools } = await Promise.resolve().then(() => require("./src-
|
|
2573
|
+
const { getBuiltinTools, getSessionsTools, getPCAccessTools, getBrowserTools, getExtractionTools, getWebsiteWatchTools, getVisionTools } = await Promise.resolve().then(() => require("./src-CTL-8bjt.js"));
|
|
2574
2574
|
const allTools = [
|
|
2575
2575
|
...getBuiltinTools(),
|
|
2576
2576
|
...getSessionsTools(() => null),
|
|
@@ -2913,7 +2913,7 @@ cfgCmd.command("set-service-key <serviceId> [apiKey]").description("Set API key
|
|
|
2913
2913
|
cfgCmd.command("schema").description("Show configuration schema").action(() => {
|
|
2914
2914
|
console.log(chalk.default.bold.hex("#06b6d4")("\n Config schema: ~/.hyperclaw/config.json\n"));
|
|
2915
2915
|
const schema = {
|
|
2916
|
-
version: "string (e.g. \"5.0.
|
|
2916
|
+
version: "string (e.g. \"5.0.4\")",
|
|
2917
2917
|
workspaceName: "string",
|
|
2918
2918
|
provider: {
|
|
2919
2919
|
providerId: "string",
|
|
@@ -3240,7 +3240,7 @@ program.command("osint setup").description("Interactive OSINT session setup wiza
|
|
|
3240
3240
|
process.exit(0);
|
|
3241
3241
|
});
|
|
3242
3242
|
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) => {
|
|
3243
|
-
const { runChat } = await Promise.resolve().then(() => require("./chat-
|
|
3243
|
+
const { runChat } = await Promise.resolve().then(() => require("./chat-BweTUpH2.js"));
|
|
3244
3244
|
await runChat({
|
|
3245
3245
|
sessionId: opts.session,
|
|
3246
3246
|
model: opts.model,
|
|
@@ -3250,7 +3250,7 @@ program.command("chat").description("Interactive terminal chat with the agent").
|
|
|
3250
3250
|
});
|
|
3251
3251
|
const agentRunCmd = program.command("agent").description("Run agent with thinking control");
|
|
3252
3252
|
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) => {
|
|
3253
|
-
const { runAgent } = await Promise.resolve().then(() => require("./src-
|
|
3253
|
+
const { runAgent } = await Promise.resolve().then(() => require("./src-CTL-8bjt.js"));
|
|
3254
3254
|
await runAgent({
|
|
3255
3255
|
message: opts.message,
|
|
3256
3256
|
thinking: opts.thinking,
|
|
@@ -3266,7 +3266,7 @@ agentRunCmd.requiredOption("-m, --message <text>", "Message to send to the agent
|
|
|
3266
3266
|
});
|
|
3267
3267
|
const threadsCmd = program.command("threads").description("ACP thread-bound agent sessions");
|
|
3268
3268
|
threadsCmd.command("list").description("List agent threads").option("--channel <id>", "Filter by channel").option("--active", "Show only active threads").action(async (opts) => {
|
|
3269
|
-
const { ACPThreadManager } = await Promise.resolve().then(() => require("./src-
|
|
3269
|
+
const { ACPThreadManager } = await Promise.resolve().then(() => require("./src-CTL-8bjt.js"));
|
|
3270
3270
|
const mgr = new ACPThreadManager();
|
|
3271
3271
|
const threads = await mgr.list({
|
|
3272
3272
|
channelId: opts.channel,
|
|
@@ -3276,7 +3276,7 @@ threadsCmd.command("list").description("List agent threads").option("--channel <
|
|
|
3276
3276
|
process.exit(0);
|
|
3277
3277
|
});
|
|
3278
3278
|
threadsCmd.command("terminate <id>").description("Terminate a thread").action(async (id) => {
|
|
3279
|
-
const { ACPThreadManager } = await Promise.resolve().then(() => require("./src-
|
|
3279
|
+
const { ACPThreadManager } = await Promise.resolve().then(() => require("./src-CTL-8bjt.js"));
|
|
3280
3280
|
await new ACPThreadManager().terminate(id);
|
|
3281
3281
|
console.log(require("chalk").green(`\n ✔ Thread terminated: ${id}\n`));
|
|
3282
3282
|
process.exit(0);
|
|
@@ -3520,7 +3520,7 @@ logsCmd.action(async (opts) => {
|
|
|
3520
3520
|
}
|
|
3521
3521
|
});
|
|
3522
3522
|
program.command("gateway:serve").description("Start the gateway server in the foreground (used by daemon)").action(async () => {
|
|
3523
|
-
const { startGateway } = await Promise.resolve().then(() => require("./server-
|
|
3523
|
+
const { startGateway } = await Promise.resolve().then(() => require("./server-Bt_lNoj3.js"));
|
|
3524
3524
|
await startGateway();
|
|
3525
3525
|
process.on("SIGINT", () => process.exit(0));
|
|
3526
3526
|
process.on("SIGTERM", () => process.exit(0));
|
|
@@ -3768,13 +3768,13 @@ workspaceCmd.command("show [dir]").description("Show workspace files summary").a
|
|
|
3768
3768
|
});
|
|
3769
3769
|
const botCmd = program.command("bot").description("HyperClaw Bot — companion bot for remote gateway control");
|
|
3770
3770
|
botCmd.command("status").action(async () => {
|
|
3771
|
-
const { showBotStatus } = await Promise.resolve().then(() => require("./hyperclawbot-
|
|
3771
|
+
const { showBotStatus } = await Promise.resolve().then(() => require("./hyperclawbot-BHrzgnRc.js"));
|
|
3772
3772
|
await showBotStatus();
|
|
3773
3773
|
process.exit(0);
|
|
3774
3774
|
});
|
|
3775
3775
|
botCmd.command("setup").description("Configure HyperClaw Bot (Telegram token, allowed users)").action(async () => {
|
|
3776
3776
|
const inquirer$2 = require("inquirer");
|
|
3777
|
-
const { saveBotConfig } = await Promise.resolve().then(() => require("./hyperclawbot-
|
|
3777
|
+
const { saveBotConfig } = await Promise.resolve().then(() => require("./hyperclawbot-BHrzgnRc.js"));
|
|
3778
3778
|
const chalk$11 = require("chalk");
|
|
3779
3779
|
console.log(chalk$11.bold.hex("#06b6d4")("\n 🦅 HYPERCLAW BOT SETUP\n"));
|
|
3780
3780
|
console.log(chalk$11.gray(" Create a bot at t.me/BotFather, then paste the token below.\n"));
|
|
@@ -3836,14 +3836,14 @@ botCmd.command("start").description("Start HyperClaw Bot (foreground or backgrou
|
|
|
3836
3836
|
cwd: process.cwd()
|
|
3837
3837
|
});
|
|
3838
3838
|
child.unref();
|
|
3839
|
-
const { writeBotPid } = await Promise.resolve().then(() => require("./hyperclawbot-
|
|
3839
|
+
const { writeBotPid } = await Promise.resolve().then(() => require("./hyperclawbot-BHrzgnRc.js"));
|
|
3840
3840
|
await writeBotPid(child.pid);
|
|
3841
3841
|
console.log(require("chalk").green(`\n ✔ HyperClaw Bot started in background (PID ${child.pid})`));
|
|
3842
3842
|
console.log(require("chalk").gray(" Stop with: hyperclaw bot stop\n"));
|
|
3843
3843
|
process.exit(0);
|
|
3844
3844
|
return;
|
|
3845
3845
|
}
|
|
3846
|
-
const { loadBotConfig, TelegramHyperClawBot, DiscordHyperClawBot } = await Promise.resolve().then(() => require("./hyperclawbot-
|
|
3846
|
+
const { loadBotConfig, TelegramHyperClawBot, DiscordHyperClawBot } = await Promise.resolve().then(() => require("./hyperclawbot-BHrzgnRc.js"));
|
|
3847
3847
|
const cfg = await loadBotConfig();
|
|
3848
3848
|
if (!cfg) {
|
|
3849
3849
|
console.log(require("chalk").red("\n ✖ HyperClaw Bot not configured. Run: hyperclaw bot setup\n"));
|
|
@@ -3870,41 +3870,41 @@ botCmd.command("start").description("Start HyperClaw Bot (foreground or backgrou
|
|
|
3870
3870
|
});
|
|
3871
3871
|
botCmd.command("stop").description("Stop HyperClaw Bot (when running in background)").action(async () => {
|
|
3872
3872
|
const chalk$11 = require("chalk");
|
|
3873
|
-
const { stopBotProcess } = await Promise.resolve().then(() => require("./hyperclawbot-
|
|
3873
|
+
const { stopBotProcess } = await Promise.resolve().then(() => require("./hyperclawbot-BHrzgnRc.js"));
|
|
3874
3874
|
const stopped = await stopBotProcess();
|
|
3875
3875
|
if (stopped) console.log(chalk$11.green("\n ✔ HyperClaw Bot stopped\n"));
|
|
3876
3876
|
else console.log(chalk$11.gray("\n Bot not running in background (no PID file). Use Ctrl+C to stop foreground bot.\n"));
|
|
3877
3877
|
process.exit(stopped ? 0 : 0);
|
|
3878
3878
|
});
|
|
3879
3879
|
memCmd.command("search <query>").description("Search MEMORY.md").action(async (query) => {
|
|
3880
|
-
const { searchMemory } = await Promise.resolve().then(() => require("./src-
|
|
3880
|
+
const { searchMemory } = await Promise.resolve().then(() => require("./src-CTL-8bjt.js"));
|
|
3881
3881
|
await searchMemory(query);
|
|
3882
3882
|
process.exit(0);
|
|
3883
3883
|
});
|
|
3884
3884
|
memCmd.command("auto-show").description("Show auto-extracted memories from MEMORY.md").action(async () => {
|
|
3885
|
-
const { showMemory } = await Promise.resolve().then(() => require("./src-
|
|
3885
|
+
const { showMemory } = await Promise.resolve().then(() => require("./src-CTL-8bjt.js"));
|
|
3886
3886
|
await showMemory();
|
|
3887
3887
|
process.exit(0);
|
|
3888
3888
|
});
|
|
3889
3889
|
memCmd.command("clear").description("Clear all auto-extracted memories").action(async () => {
|
|
3890
|
-
const { clearMemory } = await Promise.resolve().then(() => require("./src-
|
|
3890
|
+
const { clearMemory } = await Promise.resolve().then(() => require("./src-CTL-8bjt.js"));
|
|
3891
3891
|
await clearMemory();
|
|
3892
3892
|
process.exit(0);
|
|
3893
3893
|
});
|
|
3894
3894
|
memCmd.command("save <text>").description("Manually save a fact to MEMORY.md").action(async (text) => {
|
|
3895
|
-
const { saveMemoryDirect } = await Promise.resolve().then(() => require("./src-
|
|
3895
|
+
const { saveMemoryDirect } = await Promise.resolve().then(() => require("./src-CTL-8bjt.js"));
|
|
3896
3896
|
await saveMemoryDirect(text);
|
|
3897
3897
|
console.log(chalk.default.hex("#06b6d4")(` ✅ Saved: ${text}\n`));
|
|
3898
3898
|
process.exit(0);
|
|
3899
3899
|
});
|
|
3900
3900
|
const pcCmd = program.command("pc").description("PC access — give the AI access to your computer");
|
|
3901
3901
|
pcCmd.command("status").description("Show PC access status and config").action(async () => {
|
|
3902
|
-
const { showPCAccessStatus } = await Promise.resolve().then(() => require("./src-
|
|
3902
|
+
const { showPCAccessStatus } = await Promise.resolve().then(() => require("./src-CTL-8bjt.js"));
|
|
3903
3903
|
await showPCAccessStatus();
|
|
3904
3904
|
process.exit(0);
|
|
3905
3905
|
});
|
|
3906
3906
|
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) => {
|
|
3907
|
-
const { savePCAccessConfig } = await Promise.resolve().then(() => require("./src-
|
|
3907
|
+
const { savePCAccessConfig } = await Promise.resolve().then(() => require("./src-CTL-8bjt.js"));
|
|
3908
3908
|
const level = opts.level;
|
|
3909
3909
|
const allowed = [
|
|
3910
3910
|
"read-only",
|
|
@@ -3931,7 +3931,7 @@ pcCmd.command("enable").description("Enable PC access for the AI").option("--lev
|
|
|
3931
3931
|
process.exit(0);
|
|
3932
3932
|
});
|
|
3933
3933
|
pcCmd.command("disable").description("Disable PC access").action(async () => {
|
|
3934
|
-
const { savePCAccessConfig } = await Promise.resolve().then(() => require("./src-
|
|
3934
|
+
const { savePCAccessConfig } = await Promise.resolve().then(() => require("./src-CTL-8bjt.js"));
|
|
3935
3935
|
await savePCAccessConfig({ enabled: false });
|
|
3936
3936
|
console.log(chalk.default.hex("#06b6d4")("\n ✅ PC access disabled\n"));
|
|
3937
3937
|
process.exit(0);
|
|
@@ -3955,7 +3955,7 @@ pcCmd.command("log").description("Show PC access audit log").option("-n, --lines
|
|
|
3955
3955
|
process.exit(0);
|
|
3956
3956
|
});
|
|
3957
3957
|
pcCmd.command("run <command>").description("Run a shell command via PC access (must be enabled)").action(async (command) => {
|
|
3958
|
-
const { loadPCAccessConfig, getPCAccessTools } = await Promise.resolve().then(() => require("./src-
|
|
3958
|
+
const { loadPCAccessConfig, getPCAccessTools } = await Promise.resolve().then(() => require("./src-CTL-8bjt.js"));
|
|
3959
3959
|
const cfg = await loadPCAccessConfig();
|
|
3960
3960
|
if (!cfg.enabled) {
|
|
3961
3961
|
console.log(chalk.default.red("\n ✖ PC access disabled. Run: hyperclaw pc enable\n"));
|
|
@@ -4014,7 +4014,7 @@ if (process.argv.length === 2) (async () => {
|
|
|
4014
4014
|
console.log(` ${t.c("hyperclaw --help")} — all commands\n`);
|
|
4015
4015
|
} else {
|
|
4016
4016
|
await new require_onboard.Banner().showNeonBanner(false);
|
|
4017
|
-
const { HyperClawWizard: HyperClawWizard$1 } = await Promise.resolve().then(() => require("./onboard-
|
|
4017
|
+
const { HyperClawWizard: HyperClawWizard$1 } = await Promise.resolve().then(() => require("./onboard-CrZK-8Lu.js"));
|
|
4018
4018
|
await new HyperClawWizard$1().run({ wizard: true });
|
|
4019
4019
|
}
|
|
4020
4020
|
await runUpdateCheck();
|