jinzd-ai-cli 0.3.2 → 0.3.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/dist/{agent-client-OGXLZR5O.js → agent-client-POWN3QOR.js} +112 -48
- package/dist/{chunk-GBP4DNBU.js → chunk-6YBF647F.js} +1 -1
- package/dist/{chunk-UEOKNL7V.js → chunk-HUQVG74X.js} +1 -1
- package/dist/{chunk-4ZAZF4CF.js → chunk-SVOWJLQJ.js} +13 -3
- package/dist/{chunk-AJ26XC7E.js → chunk-YYZEZ6BO.js} +1 -1
- package/dist/{hub-ZTEJJ4WD.js → hub-Y4UP3NAQ.js} +25 -5
- package/dist/{hub-server-P547YWUN.js → hub-server-2MT2GPJK.js} +9 -6
- package/dist/index.js +11 -9
- package/dist/{run-tests-6VOBLE77.js → run-tests-5F4IFT5H.js} +1 -1
- package/dist/{run-tests-YDNIQ4L6.js → run-tests-F5ZKAP6K.js} +1 -1
- package/dist/{server-YFR3DO2P.js → server-AXKGLNOI.js} +3 -3
- package/package.json +1 -1
|
@@ -3,33 +3,49 @@
|
|
|
3
3
|
// src/hub/agent-client.ts
|
|
4
4
|
import WebSocket from "ws";
|
|
5
5
|
import chalk from "chalk";
|
|
6
|
+
import { createInterface } from "readline";
|
|
6
7
|
var PASS_MARKER = "[PASS]";
|
|
7
8
|
async function joinHub(options, configManager, providers) {
|
|
8
9
|
const host = options.host ?? "localhost";
|
|
9
10
|
const url = `ws://${host}:${options.port}`;
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
let defaultModel =
|
|
13
|
-
if (!
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
const isHuman = options.human === true;
|
|
12
|
+
let defaultProvider = "";
|
|
13
|
+
let defaultModel = "";
|
|
14
|
+
if (!isHuman) {
|
|
15
|
+
defaultProvider = options.provider ?? configManager.get("defaultProvider");
|
|
16
|
+
const allDefaultModels = configManager.get("defaultModels");
|
|
17
|
+
defaultModel = options.model ?? allDefaultModels[defaultProvider] ?? "";
|
|
18
|
+
if (!defaultModel) {
|
|
19
|
+
try {
|
|
20
|
+
const p = providers.get(defaultProvider);
|
|
21
|
+
defaultModel = p.info.defaultModel;
|
|
22
|
+
} catch {
|
|
23
|
+
console.error(` \u2717 Provider "${defaultProvider}" not configured.`);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
20
26
|
}
|
|
21
27
|
}
|
|
28
|
+
let rl = null;
|
|
29
|
+
if (isHuman) {
|
|
30
|
+
rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
31
|
+
}
|
|
22
32
|
console.log();
|
|
23
|
-
console.log(chalk.bold.cyan(" \u{1F916} AI-CLI Agent \u2014 Connecting to Hub"));
|
|
33
|
+
console.log(chalk.bold.cyan(isHuman ? " \u{1F464} AI-CLI Hub \u2014 Human Participant" : " \u{1F916} AI-CLI Agent \u2014 Connecting to Hub"));
|
|
24
34
|
console.log(chalk.dim(` Server: ${url}`));
|
|
25
35
|
if (options.role) console.log(chalk.dim(` Requested role: ${options.role}`));
|
|
26
|
-
|
|
36
|
+
if (isHuman) {
|
|
37
|
+
console.log(chalk.dim(" Mode: HUMAN (you type your responses)"));
|
|
38
|
+
console.log(chalk.dim(" Tip: type [PASS] to skip your turn, empty line to send"));
|
|
39
|
+
} else {
|
|
40
|
+
console.log(chalk.dim(` Provider: ${defaultProvider} / ${defaultModel}`));
|
|
41
|
+
}
|
|
27
42
|
console.log();
|
|
28
43
|
const ws = new WebSocket(url);
|
|
29
44
|
let myRoleId = "";
|
|
30
45
|
let myRoleName = "";
|
|
31
46
|
let topic = "";
|
|
32
47
|
let allRoles = [];
|
|
48
|
+
let hubContext;
|
|
33
49
|
let persona = "";
|
|
34
50
|
ws.on("open", () => {
|
|
35
51
|
console.log(chalk.green(" \u2713 Connected to Hub"));
|
|
@@ -37,6 +53,7 @@ async function joinHub(options, configManager, providers) {
|
|
|
37
53
|
ws.send(JSON.stringify(msg));
|
|
38
54
|
});
|
|
39
55
|
ws.on("close", () => {
|
|
56
|
+
if (rl) rl.close();
|
|
40
57
|
console.log(chalk.dim("\n Disconnected from Hub."));
|
|
41
58
|
process.exit(0);
|
|
42
59
|
});
|
|
@@ -60,6 +77,7 @@ async function joinHub(options, configManager, providers) {
|
|
|
60
77
|
myRoleName = msg.roleName;
|
|
61
78
|
topic = msg.topic;
|
|
62
79
|
allRoles = msg.roles;
|
|
80
|
+
hubContext = msg.context;
|
|
63
81
|
persona = buildPersonaFromRole(myRoleId, myRoleName);
|
|
64
82
|
console.log(chalk.bold(` \u{1F4CB} Assigned role: ${chalk.cyan(myRoleName)} (${myRoleId})`));
|
|
65
83
|
if (topic) {
|
|
@@ -73,42 +91,52 @@ async function joinHub(options, configManager, providers) {
|
|
|
73
91
|
`));
|
|
74
92
|
break;
|
|
75
93
|
case "your_turn": {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
console.
|
|
94
|
+
let response;
|
|
95
|
+
if (isHuman) {
|
|
96
|
+
console.log(chalk.bold.green(`
|
|
97
|
+
\u270F\uFE0F Your turn to speak, ${myRoleName}! (Round ${msg.round}/${msg.maxRounds})`));
|
|
98
|
+
console.log(chalk.dim(" Type your response (multi-line: end with empty line). [PASS] to skip.\n"));
|
|
99
|
+
response = await readMultiLineInput(rl);
|
|
100
|
+
} else {
|
|
101
|
+
console.log(chalk.bold.cyan(` \u{1F4AD} Your turn to speak (Round ${msg.round}/${msg.maxRounds})...`));
|
|
102
|
+
try {
|
|
103
|
+
response = await generateResponse(
|
|
104
|
+
topic,
|
|
105
|
+
msg.history,
|
|
106
|
+
msg.round,
|
|
107
|
+
msg.maxRounds,
|
|
108
|
+
myRoleId,
|
|
109
|
+
myRoleName,
|
|
110
|
+
persona,
|
|
111
|
+
providers,
|
|
112
|
+
defaultProvider,
|
|
113
|
+
defaultModel,
|
|
114
|
+
hubContext
|
|
115
|
+
);
|
|
116
|
+
} catch (err) {
|
|
117
|
+
console.error(chalk.red(` \u2717 Response error: ${err.message}`));
|
|
118
|
+
const errReply = { type: "error", message: err.message };
|
|
119
|
+
ws.send(JSON.stringify(errReply));
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
const passed = response.trim().toUpperCase() === PASS_MARKER || response.trim() === "";
|
|
124
|
+
if (passed) {
|
|
125
|
+
console.log(chalk.dim(" [PASS \u2014 nothing to add]\n"));
|
|
126
|
+
} else if (!isHuman) {
|
|
127
|
+
console.log(chalk.cyan(` \u250C\u2500 ${myRoleName} (you)`));
|
|
128
|
+
for (const line of response.split("\n")) {
|
|
129
|
+
console.log(chalk.cyan(" \u2502 ") + line);
|
|
100
130
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
content: passed ? "" : response,
|
|
104
|
-
passed
|
|
105
|
-
};
|
|
106
|
-
ws.send(JSON.stringify(reply));
|
|
107
|
-
} catch (err) {
|
|
108
|
-
console.error(chalk.red(` \u2717 Response error: ${err.message}`));
|
|
109
|
-
const errReply = { type: "error", message: err.message };
|
|
110
|
-
ws.send(JSON.stringify(errReply));
|
|
131
|
+
console.log(chalk.cyan(" \u2514" + "\u2500".repeat(50)));
|
|
132
|
+
console.log();
|
|
111
133
|
}
|
|
134
|
+
const reply = {
|
|
135
|
+
type: "response",
|
|
136
|
+
content: passed ? "" : response.trim(),
|
|
137
|
+
passed
|
|
138
|
+
};
|
|
139
|
+
ws.send(JSON.stringify(reply));
|
|
112
140
|
break;
|
|
113
141
|
}
|
|
114
142
|
case "agent_spoke": {
|
|
@@ -156,9 +184,13 @@ async function joinHub(options, configManager, providers) {
|
|
|
156
184
|
await new Promise(() => {
|
|
157
185
|
});
|
|
158
186
|
}
|
|
159
|
-
async function generateResponse(topic, history, round, maxRounds, roleId, roleName, persona, providers, providerId, modelId) {
|
|
187
|
+
async function generateResponse(topic, history, round, maxRounds, roleId, roleName, persona, providers, providerId, modelId, context) {
|
|
160
188
|
const provider = providers.get(providerId);
|
|
161
189
|
if (!provider) throw new Error(`Provider "${providerId}" not available`);
|
|
190
|
+
const contextSection = context ? `
|
|
191
|
+
|
|
192
|
+
## Reference Documents
|
|
193
|
+
${context}` : "";
|
|
162
194
|
const systemPrompt = `# Multi-Agent Discussion \u2014 Role: ${roleName}
|
|
163
195
|
|
|
164
196
|
${persona}
|
|
@@ -173,7 +205,7 @@ ${persona}
|
|
|
173
205
|
- Use the language that the topic is written in (if the topic is in Chinese, respond in Chinese).
|
|
174
206
|
|
|
175
207
|
## Topic
|
|
176
|
-
${topic}`;
|
|
208
|
+
${topic}${contextSection}`;
|
|
177
209
|
const messages = [];
|
|
178
210
|
for (const msg of history) {
|
|
179
211
|
if (msg.passed) continue;
|
|
@@ -204,6 +236,38 @@ function buildPersonaFromRole(roleId, roleName) {
|
|
|
204
236
|
Respond thoughtfully based on your area of expertise.
|
|
205
237
|
Be constructive, collaborative, and open to other perspectives while maintaining your professional viewpoint.`;
|
|
206
238
|
}
|
|
239
|
+
function readMultiLineInput(rl) {
|
|
240
|
+
return new Promise((resolve) => {
|
|
241
|
+
const lines = [];
|
|
242
|
+
let lastLineEmpty = false;
|
|
243
|
+
const prompt = () => {
|
|
244
|
+
rl.question(chalk.green(" > "), (line) => {
|
|
245
|
+
if (line === "" && lines.length > 0) {
|
|
246
|
+
if (lastLineEmpty) {
|
|
247
|
+
resolve(lines.join("\n"));
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
lastLineEmpty = true;
|
|
251
|
+
lines.push("");
|
|
252
|
+
prompt();
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
if (line === "" && lines.length === 0) {
|
|
256
|
+
resolve(PASS_MARKER);
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
if (line.trim().toUpperCase() === PASS_MARKER && lines.length === 0) {
|
|
260
|
+
resolve(PASS_MARKER);
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
lastLineEmpty = false;
|
|
264
|
+
lines.push(line);
|
|
265
|
+
prompt();
|
|
266
|
+
});
|
|
267
|
+
};
|
|
268
|
+
prompt();
|
|
269
|
+
});
|
|
270
|
+
}
|
|
207
271
|
export {
|
|
208
272
|
joinHub
|
|
209
273
|
};
|
|
@@ -7,11 +7,14 @@ var HubAgent = class {
|
|
|
7
7
|
providers;
|
|
8
8
|
defaultProvider;
|
|
9
9
|
defaultModel;
|
|
10
|
-
|
|
10
|
+
/** External context documents injected into system prompt */
|
|
11
|
+
context;
|
|
12
|
+
constructor(role, providers, defaultProvider, defaultModel, context) {
|
|
11
13
|
this.role = role;
|
|
12
14
|
this.providers = providers;
|
|
13
15
|
this.defaultProvider = defaultProvider;
|
|
14
16
|
this.defaultModel = defaultModel;
|
|
17
|
+
this.context = context;
|
|
15
18
|
}
|
|
16
19
|
get providerId() {
|
|
17
20
|
return this.role.provider ?? this.defaultProvider;
|
|
@@ -75,6 +78,10 @@ var HubAgent = class {
|
|
|
75
78
|
}
|
|
76
79
|
// ── Private ──────────────────────────────────────────────────────
|
|
77
80
|
buildSystemPrompt(topic, round, maxRounds) {
|
|
81
|
+
const contextSection = this.context ? `
|
|
82
|
+
|
|
83
|
+
## Reference Documents
|
|
84
|
+
${this.context}` : "";
|
|
78
85
|
return `# Multi-Agent Discussion \u2014 Role: ${this.role.name}
|
|
79
86
|
|
|
80
87
|
${this.role.persona}
|
|
@@ -89,7 +96,7 @@ ${this.role.persona}
|
|
|
89
96
|
- Use the language that the topic is written in (if the topic is in Chinese, respond in Chinese).
|
|
90
97
|
|
|
91
98
|
## Topic
|
|
92
|
-
${topic}`;
|
|
99
|
+
${topic}${contextSection}`;
|
|
93
100
|
}
|
|
94
101
|
buildMessages(history) {
|
|
95
102
|
const messages = [];
|
|
@@ -173,13 +180,16 @@ function assignRoleColors(roles) {
|
|
|
173
180
|
}
|
|
174
181
|
});
|
|
175
182
|
}
|
|
176
|
-
function renderHubBanner(topic, roles, maxRounds) {
|
|
183
|
+
function renderHubBanner(topic, roles, maxRounds, contextFiles) {
|
|
177
184
|
console.log();
|
|
178
185
|
console.log(chalk.bold.white(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"));
|
|
179
186
|
console.log(chalk.bold.white(" \u2551") + chalk.bold.cyan(" \u{1F3DB}\uFE0F AI-CLI Multi-Agent Hub \u2014 Discussion Mode ") + chalk.bold.white("\u2551"));
|
|
180
187
|
console.log(chalk.bold.white(" \u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563"));
|
|
181
188
|
console.log(chalk.bold.white(" \u2551") + chalk.dim(` Topic: ${truncate(topic, 52)}`.padEnd(62)) + chalk.bold.white("\u2551"));
|
|
182
189
|
console.log(chalk.bold.white(" \u2551") + chalk.dim(` Rounds: up to ${maxRounds}`.padEnd(62)) + chalk.bold.white("\u2551"));
|
|
190
|
+
if (contextFiles && contextFiles.length > 0) {
|
|
191
|
+
console.log(chalk.bold.white(" \u2551") + chalk.dim(` Context: ${contextFiles.join(", ")}`.padEnd(62)) + chalk.bold.white("\u2551"));
|
|
192
|
+
}
|
|
183
193
|
console.log(chalk.bold.white(" \u2551") + chalk.dim(" Participants:".padEnd(62)) + chalk.bold.white("\u2551"));
|
|
184
194
|
for (const role of roles) {
|
|
185
195
|
const color = colorMap.get(role.id) ?? chalk.white;
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
assignRoleColors,
|
|
5
5
|
renderHubBanner,
|
|
6
6
|
renderHubEvent
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SVOWJLQJ.js";
|
|
8
8
|
|
|
9
9
|
// src/hub/discuss.ts
|
|
10
10
|
var DiscussionOrchestrator = class {
|
|
@@ -12,7 +12,7 @@ var DiscussionOrchestrator = class {
|
|
|
12
12
|
this.config = config;
|
|
13
13
|
this.providers = providers;
|
|
14
14
|
this.agents = config.roles.map(
|
|
15
|
-
(role) => new HubAgent(role, providers, config.defaultProvider, config.defaultModel)
|
|
15
|
+
(role) => new HubAgent(role, providers, config.defaultProvider, config.defaultModel, config.context)
|
|
16
16
|
);
|
|
17
17
|
this.state = {
|
|
18
18
|
topic: "",
|
|
@@ -331,13 +331,33 @@ async function startHub(options, configManager, providers) {
|
|
|
331
331
|
console.error(' aicli hub --preset brainstorm "your topic here"');
|
|
332
332
|
process.exit(1);
|
|
333
333
|
}
|
|
334
|
+
let context;
|
|
335
|
+
const contextFileNames = [];
|
|
336
|
+
if (options.contextFiles && options.contextFiles.length > 0) {
|
|
337
|
+
const parts = [];
|
|
338
|
+
for (const filePath of options.contextFiles) {
|
|
339
|
+
if (!existsSync(filePath)) {
|
|
340
|
+
console.error(` \u2717 Context file not found: ${filePath}`);
|
|
341
|
+
process.exit(1);
|
|
342
|
+
}
|
|
343
|
+
const content = readFileSync(filePath, "utf-8");
|
|
344
|
+
const fileName = filePath.replace(/\\/g, "/").split("/").pop() ?? filePath;
|
|
345
|
+
contextFileNames.push(fileName);
|
|
346
|
+
parts.push(`### ${fileName}
|
|
347
|
+
|
|
348
|
+
${content}`);
|
|
349
|
+
}
|
|
350
|
+
context = parts.join("\n\n---\n\n");
|
|
351
|
+
}
|
|
334
352
|
const config = {
|
|
335
353
|
mode: options.mode ?? "discuss",
|
|
336
354
|
roles,
|
|
337
355
|
defaultProvider,
|
|
338
356
|
defaultModel,
|
|
339
357
|
maxRounds: options.maxRounds ?? 10,
|
|
340
|
-
enableTools: false
|
|
358
|
+
enableTools: false,
|
|
359
|
+
context,
|
|
360
|
+
contextFiles: contextFileNames.length > 0 ? contextFileNames : void 0
|
|
341
361
|
};
|
|
342
362
|
if (config.mode === "discuss") {
|
|
343
363
|
if (options.distributed) {
|
|
@@ -351,7 +371,7 @@ async function startHub(options, configManager, providers) {
|
|
|
351
371
|
}
|
|
352
372
|
}
|
|
353
373
|
async function runDistributedDiscussion(config, providers, topic, port) {
|
|
354
|
-
const { HubServer } = await import("./hub-server-
|
|
374
|
+
const { HubServer } = await import("./hub-server-2MT2GPJK.js");
|
|
355
375
|
const hub = new HubServer(config, providers, port);
|
|
356
376
|
let interrupted = false;
|
|
357
377
|
const onSigint = () => {
|
|
@@ -387,7 +407,7 @@ async function runDiscussion(config, providers, topic) {
|
|
|
387
407
|
orchestrator.abort();
|
|
388
408
|
};
|
|
389
409
|
process.on("SIGINT", onSigint);
|
|
390
|
-
renderHubBanner(topic, config.roles, config.maxRounds ?? 10);
|
|
410
|
+
renderHubBanner(topic, config.roles, config.maxRounds ?? 10, config.contextFiles);
|
|
391
411
|
try {
|
|
392
412
|
await orchestrator.run(topic);
|
|
393
413
|
} catch (err) {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
renderRoundHeader,
|
|
12
12
|
renderSummary,
|
|
13
13
|
renderUserInterrupt
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-SVOWJLQJ.js";
|
|
15
15
|
|
|
16
16
|
// src/hub/hub-server.ts
|
|
17
17
|
import { WebSocketServer } from "ws";
|
|
@@ -43,7 +43,7 @@ var HubServer = class {
|
|
|
43
43
|
this.httpServer.listen(this.port, () => resolve());
|
|
44
44
|
});
|
|
45
45
|
const maxRounds = this.config.maxRounds ?? 10;
|
|
46
|
-
renderHubBanner(topic, this.config.roles, maxRounds);
|
|
46
|
+
renderHubBanner(topic, this.config.roles, maxRounds, this.config.contextFiles);
|
|
47
47
|
console.log(chalk.bold.cyan(` \u{1F310} Hub server listening on ws://localhost:${this.port}`));
|
|
48
48
|
console.log(chalk.dim(` Waiting for ${this.config.roles.length} agent(s) to connect...`));
|
|
49
49
|
console.log(chalk.dim(` Each agent should run: aicli join --port ${this.port}`));
|
|
@@ -145,7 +145,8 @@ var HubServer = class {
|
|
|
145
145
|
roleName: role.name,
|
|
146
146
|
topic: "",
|
|
147
147
|
// Will be sent when discussion starts
|
|
148
|
-
roles: this.config.roles.map((r) => ({ id: r.id, name: r.name }))
|
|
148
|
+
roles: this.config.roles.map((r) => ({ id: r.id, name: r.name })),
|
|
149
|
+
context: this.config.context
|
|
149
150
|
});
|
|
150
151
|
}
|
|
151
152
|
// ── Wait for Agents ──────────────────────────────────────────────
|
|
@@ -172,7 +173,8 @@ var HubServer = class {
|
|
|
172
173
|
roleId: agent.roleId,
|
|
173
174
|
roleName: agent.roleName,
|
|
174
175
|
topic,
|
|
175
|
-
roles: this.config.roles.map((r) => ({ id: r.id, name: r.name }))
|
|
176
|
+
roles: this.config.roles.map((r) => ({ id: r.id, name: r.name })),
|
|
177
|
+
context: this.config.context
|
|
176
178
|
});
|
|
177
179
|
}
|
|
178
180
|
}
|
|
@@ -248,7 +250,7 @@ var HubServer = class {
|
|
|
248
250
|
}
|
|
249
251
|
}
|
|
250
252
|
async getBuiltinResponse(role, topic, round, maxRounds) {
|
|
251
|
-
const agent = new HubAgent(role, this.providers, this.config.defaultProvider, this.config.defaultModel);
|
|
253
|
+
const agent = new HubAgent(role, this.providers, this.config.defaultProvider, this.config.defaultModel, this.config.context);
|
|
252
254
|
return agent.speak(topic, this.history, round, maxRounds);
|
|
253
255
|
}
|
|
254
256
|
async generateSummary(topic) {
|
|
@@ -259,7 +261,8 @@ var HubServer = class {
|
|
|
259
261
|
this.config.roles[0],
|
|
260
262
|
this.providers,
|
|
261
263
|
this.config.defaultProvider,
|
|
262
|
-
this.config.defaultModel
|
|
264
|
+
this.config.defaultModel,
|
|
265
|
+
this.config.context
|
|
263
266
|
);
|
|
264
267
|
try {
|
|
265
268
|
console.log(chalk.dim(" Generating summary..."));
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
theme,
|
|
37
37
|
truncateOutput,
|
|
38
38
|
undoStack
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-6YBF647F.js";
|
|
40
40
|
import {
|
|
41
41
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
42
42
|
AUTHOR,
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
REPO_URL,
|
|
57
57
|
SKILLS_DIR_NAME,
|
|
58
58
|
VERSION
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-HUQVG74X.js";
|
|
60
60
|
|
|
61
61
|
// src/index.ts
|
|
62
62
|
import { program } from "commander";
|
|
@@ -1907,7 +1907,7 @@ ${hint}` : "")
|
|
|
1907
1907
|
description: "Run project tests and show structured report",
|
|
1908
1908
|
usage: "/test [command|filter]",
|
|
1909
1909
|
async execute(args, _ctx) {
|
|
1910
|
-
const { executeTests } = await import("./run-tests-
|
|
1910
|
+
const { executeTests } = await import("./run-tests-5F4IFT5H.js");
|
|
1911
1911
|
const argStr = args.join(" ").trim();
|
|
1912
1912
|
let testArgs = {};
|
|
1913
1913
|
if (argStr) {
|
|
@@ -5517,7 +5517,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
5517
5517
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
5518
5518
|
process.exit(1);
|
|
5519
5519
|
}
|
|
5520
|
-
const { startWebServer } = await import("./server-
|
|
5520
|
+
const { startWebServer } = await import("./server-AXKGLNOI.js");
|
|
5521
5521
|
await startWebServer({ port, host: options.host });
|
|
5522
5522
|
});
|
|
5523
5523
|
program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | migrate <name>)").action(async (action, username) => {
|
|
@@ -5638,7 +5638,7 @@ program.command("sessions").description("List recent conversation sessions").act
|
|
|
5638
5638
|
}
|
|
5639
5639
|
console.log();
|
|
5640
5640
|
});
|
|
5641
|
-
program.command("hub [topic]").description("Start multi-agent hub (discuss / brainstorm with multiple AI roles)").option("--preset <name>", "Use a built-in role preset (default: tech-review)").option("--roles <file>", "Load roles from a JSON file").option("--provider <name>", "Override default AI provider").option("-m, --model <name>", "Override default model").option("--max-rounds <n>", "Max discussion rounds (default: 10)").option("--presets", "List available role presets").option("--distributed", "Start WebSocket server so remote aicli instances can join as agents").option("--port <n>", "WebSocket port for distributed mode (default: 9527)", "9527").action(async (topic, options) => {
|
|
5641
|
+
program.command("hub [topic]").description("Start multi-agent hub (discuss / brainstorm with multiple AI roles)").option("--preset <name>", "Use a built-in role preset (default: tech-review)").option("--roles <file>", "Load roles from a JSON file").option("--provider <name>", "Override default AI provider").option("-m, --model <name>", "Override default model").option("--max-rounds <n>", "Max discussion rounds (default: 10)").option("--presets", "List available role presets").option("--context <files...>", "Inject external document(s) as context for all agents (e.g. README.md spec.md)").option("--distributed", "Start WebSocket server so remote aicli instances can join as agents").option("--port <n>", "WebSocket port for distributed mode (default: 9527)", "9527").action(async (topic, options) => {
|
|
5642
5642
|
const config = new ConfigManager();
|
|
5643
5643
|
const registry = new ProviderRegistry();
|
|
5644
5644
|
await registry.initialize(
|
|
@@ -5649,7 +5649,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
5649
5649
|
}),
|
|
5650
5650
|
config.get("customProviders")
|
|
5651
5651
|
);
|
|
5652
|
-
const { startHub } = await import("./hub-
|
|
5652
|
+
const { startHub } = await import("./hub-Y4UP3NAQ.js");
|
|
5653
5653
|
await startHub(
|
|
5654
5654
|
{
|
|
5655
5655
|
topic: topic ?? "",
|
|
@@ -5659,6 +5659,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
5659
5659
|
model: options.model,
|
|
5660
5660
|
maxRounds: options.maxRounds ? parseInt(options.maxRounds, 10) : void 0,
|
|
5661
5661
|
listPresets: options.presets === true,
|
|
5662
|
+
contextFiles: options.context,
|
|
5662
5663
|
distributed: options.distributed === true,
|
|
5663
5664
|
port: options.port ? parseInt(options.port, 10) : void 0
|
|
5664
5665
|
},
|
|
@@ -5666,7 +5667,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
5666
5667
|
registry
|
|
5667
5668
|
);
|
|
5668
5669
|
});
|
|
5669
|
-
program.command("join").description("Join a running hub as a remote AI agent").option("--port <n>", "Hub WebSocket port (default: 9527)", "9527").option("--host <name>", "Hub host (default: localhost)", "localhost").option("--role <id>", "Request a specific role (e.g. architect, developer)").option("--provider <name>", "Override AI provider for this agent").option("-m, --model <name>", "Override model for this agent").action(async (options) => {
|
|
5670
|
+
program.command("join").description("Join a running hub as a remote AI agent").option("--port <n>", "Hub WebSocket port (default: 9527)", "9527").option("--host <name>", "Hub host (default: localhost)", "localhost").option("--role <id>", "Request a specific role (e.g. architect, developer)").option("--human", "Join as a human participant (type your own responses)").option("--provider <name>", "Override AI provider for this agent").option("-m, --model <name>", "Override model for this agent").action(async (options) => {
|
|
5670
5671
|
const config = new ConfigManager();
|
|
5671
5672
|
const registry = new ProviderRegistry();
|
|
5672
5673
|
await registry.initialize(
|
|
@@ -5677,14 +5678,15 @@ program.command("join").description("Join a running hub as a remote AI agent").o
|
|
|
5677
5678
|
}),
|
|
5678
5679
|
config.get("customProviders")
|
|
5679
5680
|
);
|
|
5680
|
-
const { joinHub } = await import("./agent-client-
|
|
5681
|
+
const { joinHub } = await import("./agent-client-POWN3QOR.js");
|
|
5681
5682
|
await joinHub(
|
|
5682
5683
|
{
|
|
5683
5684
|
port: parseInt(options.port ?? "9527", 10),
|
|
5684
5685
|
host: options.host,
|
|
5685
5686
|
role: options.role,
|
|
5686
5687
|
provider: options.provider,
|
|
5687
|
-
model: options.model
|
|
5688
|
+
model: options.model,
|
|
5689
|
+
human: options.human === true
|
|
5688
5690
|
},
|
|
5689
5691
|
config,
|
|
5690
5692
|
registry
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
spawnAgentContext,
|
|
28
28
|
truncateOutput,
|
|
29
29
|
undoStack
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-6YBF647F.js";
|
|
31
31
|
import {
|
|
32
32
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
33
33
|
CONTEXT_FILE_CANDIDATES,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
PLAN_MODE_SYSTEM_ADDON,
|
|
40
40
|
SKILLS_DIR_NAME,
|
|
41
41
|
VERSION
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-HUQVG74X.js";
|
|
43
43
|
import {
|
|
44
44
|
AuthManager
|
|
45
45
|
} from "./chunk-CPLT6CD3.js";
|
|
@@ -1438,7 +1438,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
|
|
|
1438
1438
|
case "test": {
|
|
1439
1439
|
this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
1440
1440
|
try {
|
|
1441
|
-
const { executeTests } = await import("./run-tests-
|
|
1441
|
+
const { executeTests } = await import("./run-tests-5F4IFT5H.js");
|
|
1442
1442
|
const argStr = args.join(" ").trim();
|
|
1443
1443
|
let testArgs = {};
|
|
1444
1444
|
if (argStr) {
|