jinzd-ai-cli 0.3.3 → 0.3.5
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-YRCQVYHJ.js → agent-client-POWN3QOR.js} +10 -3
- package/dist/{chunk-54GQL2O4.js → chunk-GTQRHY5Q.js} +1 -1
- package/dist/{chunk-NLSQEHZU.js → chunk-GU5NVLYL.js} +1 -1
- package/dist/{chunk-IPGCPV3X.js → chunk-SGYQBV2O.js} +1 -1
- package/dist/{chunk-4ZAZF4CF.js → chunk-SVOWJLQJ.js} +13 -3
- 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 +107 -7
- package/dist/{run-tests-CTA7UEXQ.js → run-tests-WO3LYFX7.js} +1 -1
- package/dist/{run-tests-WGSNA7K4.js → run-tests-XCNLK66A.js} +1 -1
- package/dist/{server-BIZW2NHV.js → server-I7FDITW7.js} +3 -3
- package/package.json +1 -1
|
@@ -45,6 +45,7 @@ async function joinHub(options, configManager, providers) {
|
|
|
45
45
|
let myRoleName = "";
|
|
46
46
|
let topic = "";
|
|
47
47
|
let allRoles = [];
|
|
48
|
+
let hubContext;
|
|
48
49
|
let persona = "";
|
|
49
50
|
ws.on("open", () => {
|
|
50
51
|
console.log(chalk.green(" \u2713 Connected to Hub"));
|
|
@@ -76,6 +77,7 @@ async function joinHub(options, configManager, providers) {
|
|
|
76
77
|
myRoleName = msg.roleName;
|
|
77
78
|
topic = msg.topic;
|
|
78
79
|
allRoles = msg.roles;
|
|
80
|
+
hubContext = msg.context;
|
|
79
81
|
persona = buildPersonaFromRole(myRoleId, myRoleName);
|
|
80
82
|
console.log(chalk.bold(` \u{1F4CB} Assigned role: ${chalk.cyan(myRoleName)} (${myRoleId})`));
|
|
81
83
|
if (topic) {
|
|
@@ -108,7 +110,8 @@ async function joinHub(options, configManager, providers) {
|
|
|
108
110
|
persona,
|
|
109
111
|
providers,
|
|
110
112
|
defaultProvider,
|
|
111
|
-
defaultModel
|
|
113
|
+
defaultModel,
|
|
114
|
+
hubContext
|
|
112
115
|
);
|
|
113
116
|
} catch (err) {
|
|
114
117
|
console.error(chalk.red(` \u2717 Response error: ${err.message}`));
|
|
@@ -181,9 +184,13 @@ async function joinHub(options, configManager, providers) {
|
|
|
181
184
|
await new Promise(() => {
|
|
182
185
|
});
|
|
183
186
|
}
|
|
184
|
-
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) {
|
|
185
188
|
const provider = providers.get(providerId);
|
|
186
189
|
if (!provider) throw new Error(`Provider "${providerId}" not available`);
|
|
190
|
+
const contextSection = context ? `
|
|
191
|
+
|
|
192
|
+
## Reference Documents
|
|
193
|
+
${context}` : "";
|
|
187
194
|
const systemPrompt = `# Multi-Agent Discussion \u2014 Role: ${roleName}
|
|
188
195
|
|
|
189
196
|
${persona}
|
|
@@ -198,7 +205,7 @@ ${persona}
|
|
|
198
205
|
- Use the language that the topic is written in (if the topic is in Chinese, respond in Chinese).
|
|
199
206
|
|
|
200
207
|
## Topic
|
|
201
|
-
${topic}`;
|
|
208
|
+
${topic}${contextSection}`;
|
|
202
209
|
const messages = [];
|
|
203
210
|
for (const msg of history) {
|
|
204
211
|
if (msg.passed) continue;
|
|
@@ -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-GTQRHY5Q.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-GU5NVLYL.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-XCNLK66A.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-I7FDITW7.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,106 @@ program.command("sessions").description("List recent conversation sessions").act
|
|
|
5638
5638
|
}
|
|
5639
5639
|
console.log();
|
|
5640
5640
|
});
|
|
5641
|
-
program.command("
|
|
5641
|
+
program.command("help").description("Show a comprehensive guide to all aicli features and commands").action(() => {
|
|
5642
|
+
const B = "\x1B[1m";
|
|
5643
|
+
const D = "\x1B[2m";
|
|
5644
|
+
const C = "\x1B[36m";
|
|
5645
|
+
const G = "\x1B[32m";
|
|
5646
|
+
const Y = "\x1B[33m";
|
|
5647
|
+
const M = "\x1B[35m";
|
|
5648
|
+
const R = "\x1B[0m";
|
|
5649
|
+
const lines = [
|
|
5650
|
+
"",
|
|
5651
|
+
`${B} AI-CLI v${VERSION} \u2014 Cross-platform AI Programming Assistant${R}`,
|
|
5652
|
+
`${D} Supports OpenAI, Claude, Gemini, DeepSeek, Zhipu, Kimi, OpenRouter${R}`,
|
|
5653
|
+
"",
|
|
5654
|
+
`${B}${C} \u25A0 LAUNCH MODES${R}`,
|
|
5655
|
+
` ${G}aicli${R} Interactive REPL (default)`,
|
|
5656
|
+
` ${G}aicli web${R} Browser-based Web UI`,
|
|
5657
|
+
` ${G}aicli -p "prompt"${R} Headless single-shot (for scripts/CI)`,
|
|
5658
|
+
` ${G}aicli hub "topic"${R} Multi-agent collaborative discussion`,
|
|
5659
|
+
` ${G}aicli join${R} Join a hub as a remote agent`,
|
|
5660
|
+
"",
|
|
5661
|
+
`${B}${C} \u25A0 CLI SUBCOMMANDS${R}`,
|
|
5662
|
+
` ${G}aicli config${R} Setup wizard (API keys, preferences)`,
|
|
5663
|
+
` ${G}aicli providers${R} List all providers and status`,
|
|
5664
|
+
` ${G}aicli sessions${R} List recent conversation sessions`,
|
|
5665
|
+
` ${G}aicli user <action>${R} User management (list/create/delete)`,
|
|
5666
|
+
"",
|
|
5667
|
+
`${B}${C} \u25A0 STARTUP OPTIONS${R}`,
|
|
5668
|
+
` ${Y}--provider <name>${R} Set AI provider`,
|
|
5669
|
+
` ${Y}-m, --model <name>${R} Set model`,
|
|
5670
|
+
` ${Y}--resume <id>${R} Resume a previous session`,
|
|
5671
|
+
` ${Y}--allowed-tools <list>${R} Tool whitelist (comma-separated)`,
|
|
5672
|
+
` ${Y}--blocked-tools <list>${R} Tool blacklist (comma-separated)`,
|
|
5673
|
+
` ${Y}--no-stream${R} Disable streaming output`,
|
|
5674
|
+
"",
|
|
5675
|
+
`${B}${C} \u25A0 HEADLESS OPTIONS${R}`,
|
|
5676
|
+
` ${Y}-p, --prompt <text>${R} Send prompt and exit`,
|
|
5677
|
+
` ${Y}--system <prompt>${R} Override system prompt`,
|
|
5678
|
+
` ${Y}--json${R} Output as JSON`,
|
|
5679
|
+
` ${Y}--output-format <fmt>${R} text | streaming-json (NDJSON)`,
|
|
5680
|
+
` ${D}echo "code" | aicli -p "explain" \u2190 pipe stdin as context${R}`,
|
|
5681
|
+
"",
|
|
5682
|
+
`${B}${C} \u25A0 WEB UI OPTIONS${R}`,
|
|
5683
|
+
` ${Y}aicli web --port 8080${R} Custom port (default: 3000)`,
|
|
5684
|
+
` ${Y}aicli web --host 0.0.0.0${R} LAN access (mobile/tablet)`,
|
|
5685
|
+
"",
|
|
5686
|
+
`${B}${C} \u25A0 MULTI-AGENT HUB${R}`,
|
|
5687
|
+
` ${Y}--preset <name>${R} Role preset (tech-review/brainstorm/code-review/debate)`,
|
|
5688
|
+
` ${Y}--roles <file>${R} Custom roles JSON file`,
|
|
5689
|
+
` ${Y}--context <files...>${R} Inject documents as context for all agents`,
|
|
5690
|
+
` ${Y}--distributed${R} Distributed mode (WebSocket, multi-process)`,
|
|
5691
|
+
` ${Y}--max-rounds <n>${R} Max discussion rounds (default: 10)`,
|
|
5692
|
+
` ${Y}aicli join --human${R} Join as a human participant`,
|
|
5693
|
+
` ${Y}aicli hub --presets${R} List available role presets`,
|
|
5694
|
+
"",
|
|
5695
|
+
`${B}${C} \u25A0 REPL COMMANDS (inside aicli)${R}`,
|
|
5696
|
+
` ${M}/help${R} Full command list`,
|
|
5697
|
+
` ${M}/provider${R} ${M}/model${R} Switch provider or model on the fly`,
|
|
5698
|
+
` ${M}/plan${R} Enter read-only planning mode`,
|
|
5699
|
+
` ${M}/think${R} Toggle Extended Thinking (deep reasoning)`,
|
|
5700
|
+
` ${M}/review${R} AI code review from git diff`,
|
|
5701
|
+
` ${M}/test${R} Run tests with structured report`,
|
|
5702
|
+
` ${M}/init${R} Generate AICLI.md for project context`,
|
|
5703
|
+
` ${M}/search${R} Search across all session histories`,
|
|
5704
|
+
` ${M}/compact${R} Compress conversation to save context`,
|
|
5705
|
+
` ${M}/checkpoint${R} ${M}/fork${R} Save/restore/fork session state`,
|
|
5706
|
+
` ${M}/undo${R} Undo file operations`,
|
|
5707
|
+
` ${M}/yolo${R} Skip all tool confirmations`,
|
|
5708
|
+
` ${M}/mcp${R} Manage MCP server connections`,
|
|
5709
|
+
` ${M}/skill${R} Manage agent skills`,
|
|
5710
|
+
` ${M}/memory${R} View/edit persistent memory`,
|
|
5711
|
+
` ${M}/doctor${R} Health check (keys, config, MCP)`,
|
|
5712
|
+
"",
|
|
5713
|
+
`${B}${C} \u25A0 AI TOOLS (Agentic Mode \u2014 AI uses these autonomously)${R}`,
|
|
5714
|
+
` ${D}bash read_file write_file edit_file list_dir grep_files glob_files${R}`,
|
|
5715
|
+
` ${D}web_fetch google_search run_interactive run_tests spawn_agent${R}`,
|
|
5716
|
+
` ${D}ask_user write_todos save_memory save_last_response + MCP tools${R}`,
|
|
5717
|
+
"",
|
|
5718
|
+
`${B}${C} \u25A0 CONFIGURATION${R}`,
|
|
5719
|
+
` ${D}Config: ~/.aicli/config.json${R}`,
|
|
5720
|
+
` ${D}Context: ~/.aicli/AICLI.md (global) | ./AICLI.md (project)${R}`,
|
|
5721
|
+
` ${D}Memory: ~/.aicli/memory.md${R}`,
|
|
5722
|
+
` ${D}Skills: ~/.aicli/skills/*.md${R}`,
|
|
5723
|
+
` ${D}Commands: ~/.aicli/commands/*.md${R}`,
|
|
5724
|
+
` ${D}Sessions: ~/.aicli/history/*.json${R}`,
|
|
5725
|
+
"",
|
|
5726
|
+
`${B}${C} \u25A0 QUICK EXAMPLES${R}`,
|
|
5727
|
+
` ${G}aicli${R} ${D}# start REPL${R}`,
|
|
5728
|
+
` ${G}aicli --provider claude -m claude-sonnet-4-20250514${R} ${D}# specific model${R}`,
|
|
5729
|
+
` ${G}aicli -p "explain this" < main.py${R} ${D}# headless + file${R}`,
|
|
5730
|
+
` ${G}aicli web --host 0.0.0.0${R} ${D}# Web UI on LAN${R}`,
|
|
5731
|
+
` ${G}aicli hub --preset brainstorm "idea"${R} ${D}# multi-agent brainstorm${R}`,
|
|
5732
|
+
` ${G}aicli hub --context spec.md "build it"${R} ${D}# hub + docs context${R}`,
|
|
5733
|
+
"",
|
|
5734
|
+
`${D} Docs: https://github.com/jinzhengdong/ai-cli${R}`,
|
|
5735
|
+
`${D} Issues: https://github.com/jinzhengdong/ai-cli/issues${R}`,
|
|
5736
|
+
""
|
|
5737
|
+
];
|
|
5738
|
+
console.log(lines.join("\n"));
|
|
5739
|
+
});
|
|
5740
|
+
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
5741
|
const config = new ConfigManager();
|
|
5643
5742
|
const registry = new ProviderRegistry();
|
|
5644
5743
|
await registry.initialize(
|
|
@@ -5649,7 +5748,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
5649
5748
|
}),
|
|
5650
5749
|
config.get("customProviders")
|
|
5651
5750
|
);
|
|
5652
|
-
const { startHub } = await import("./hub-
|
|
5751
|
+
const { startHub } = await import("./hub-Y4UP3NAQ.js");
|
|
5653
5752
|
await startHub(
|
|
5654
5753
|
{
|
|
5655
5754
|
topic: topic ?? "",
|
|
@@ -5659,6 +5758,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
5659
5758
|
model: options.model,
|
|
5660
5759
|
maxRounds: options.maxRounds ? parseInt(options.maxRounds, 10) : void 0,
|
|
5661
5760
|
listPresets: options.presets === true,
|
|
5761
|
+
contextFiles: options.context,
|
|
5662
5762
|
distributed: options.distributed === true,
|
|
5663
5763
|
port: options.port ? parseInt(options.port, 10) : void 0
|
|
5664
5764
|
},
|
|
@@ -5677,7 +5777,7 @@ program.command("join").description("Join a running hub as a remote AI agent").o
|
|
|
5677
5777
|
}),
|
|
5678
5778
|
config.get("customProviders")
|
|
5679
5779
|
);
|
|
5680
|
-
const { joinHub } = await import("./agent-client-
|
|
5780
|
+
const { joinHub } = await import("./agent-client-POWN3QOR.js");
|
|
5681
5781
|
await joinHub(
|
|
5682
5782
|
{
|
|
5683
5783
|
port: parseInt(options.port ?? "9527", 10),
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
spawnAgentContext,
|
|
28
28
|
truncateOutput,
|
|
29
29
|
undoStack
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-GTQRHY5Q.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-GU5NVLYL.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-XCNLK66A.js");
|
|
1442
1442
|
const argStr = args.join(" ").trim();
|
|
1443
1443
|
let testArgs = {};
|
|
1444
1444
|
if (argStr) {
|