jinzd-ai-cli 0.4.328 → 0.4.329
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/{batch-GE6XWXPK.js → batch-NNYRIS4U.js} +2 -2
- package/dist/{chunk-OVEZ6HB5.js → chunk-2CNJ25U7.js} +1 -1
- package/dist/{chunk-NOQKCHIQ.js → chunk-6UDKGZ3D.js} +1 -1
- package/dist/{chunk-IEKVRC2E.js → chunk-ABIR2TGW.js} +4 -4
- package/dist/{chunk-VKQIHFI5.js → chunk-DRNRQ6SD.js} +1 -1
- package/dist/{chunk-NKTCITLH.js → chunk-I5KLH7TL.js} +1 -1
- package/dist/{chunk-LOS7T2JS.js → chunk-IUC3DRGB.js} +1 -1
- package/dist/{chunk-JXGE4T4U.js → chunk-LKSMXCFL.js} +1 -1
- package/dist/{chunk-IOLDD5ZA.js → chunk-LRRBYGHE.js} +1 -1
- package/dist/{chunk-WDEO7J3T.js → chunk-LSSOPLKJ.js} +7 -7
- package/dist/{chunk-UQI5TOL2.js → chunk-MPCQG7LV.js} +4 -4
- package/dist/{chunk-B4EBCSKM.js → chunk-SS3PG7LP.js} +1 -1
- package/dist/{chunk-U6VATMAI.js → chunk-TYQODNI7.js} +4 -4
- package/dist/{chunk-E3RJEQZA.js → chunk-XF2S7LNM.js} +1 -1
- package/dist/{chunk-T4K4RZKR.js → chunk-YDH5ZWOQ.js} +1 -1
- package/dist/{ci-U5Q3BMQP.js → ci-ODKA57IG.js} +5 -5
- package/dist/{ci-format-4RR2G3RR.js → ci-format-QDC4XKYZ.js} +2 -2
- package/dist/{constants-J3346CYX.js → constants-BYWEJLAI.js} +1 -1
- package/dist/{constants-5YWODQHN.js → constants-MG7EGG5J.js} +1 -1
- package/dist/{doctor-cli-PCSMI6ZV.js → doctor-cli-LYZSHYR6.js} +5 -5
- package/dist/electron-server.js +25 -11
- package/dist/{hub-R3WSYGNT.js → hub-GRHYVLGV.js} +1 -1
- package/dist/index.js +29 -19
- package/dist/{persistent-memory-JZWKXFUF.js → persistent-memory-O6GWHGJH.js} +2 -2
- package/dist/{persistent-memory-64EXCOV4.js → persistent-memory-OCDFR4BH.js} +2 -2
- package/dist/{pr-2EZKHIQ5.js → pr-LDUIDU27.js} +5 -5
- package/dist/{run-tests-RUYOX42E.js → run-tests-LTYJACRX.js} +2 -2
- package/dist/{run-tests-CC24OLYI.js → run-tests-YTRU22LY.js} +2 -2
- package/dist/{server-DQFHA3Z2.js → server-2NZN22XP.js} +30 -15
- package/dist/{server-GU7XSXSR.js → server-ZTFB3KMS.js} +5 -5
- package/dist/{task-orchestrator-62LRX42O.js → task-orchestrator-URFLWSPI.js} +5 -5
- package/dist/{usage-RDLAA5HC.js → usage-IP6G4Q2K.js} +2 -2
- package/dist/web/client/app.js +9 -0
- package/dist/web/client/app.js.br +0 -0
- package/dist/web/client/app.js.gz +0 -0
- package/dist/web/client/index.html +1 -0
- package/dist/web/client/index.html.br +0 -0
- package/dist/web/client/index.html.gz +0 -0
- package/dist/web/client/state.js +3 -0
- package/dist/web/client/state.js.br +0 -0
- package/dist/web/client/state.js.gz +0 -0
- package/dist/web/client/style.css +3 -0
- package/dist/web/client/style.css.br +0 -0
- package/dist/web/client/style.css.gz +0 -0
- package/package.json +1 -1
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
} from "./chunk-RS7SKYTS.js";
|
|
5
5
|
import {
|
|
6
6
|
ConfigManager
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2CNJ25U7.js";
|
|
8
8
|
import "./chunk-TU3L3PW7.js";
|
|
9
9
|
import {
|
|
10
10
|
atomicWriteFileSync
|
|
11
11
|
} from "./chunk-BMLQPSHP.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-6UDKGZ3D.js";
|
|
13
13
|
|
|
14
14
|
// src/cli/batch.ts
|
|
15
15
|
import Anthropic from "@anthropic-ai/sdk";
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
listHooks,
|
|
9
9
|
listInstalledPlugins,
|
|
10
10
|
resetStats
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-SS3PG7LP.js";
|
|
12
12
|
import {
|
|
13
13
|
ProviderRegistry
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-I5KLH7TL.js";
|
|
15
15
|
import {
|
|
16
16
|
ConfigManager
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-2CNJ25U7.js";
|
|
18
18
|
import {
|
|
19
19
|
getGitRoot
|
|
20
20
|
} from "./chunk-HOSJZMQS.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
MCP_PROJECT_CONFIG_NAME,
|
|
27
27
|
MEMORY_FILE_NAME,
|
|
28
28
|
VERSION
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-6UDKGZ3D.js";
|
|
30
30
|
|
|
31
31
|
// src/diagnostics/doctor-report.ts
|
|
32
32
|
import { existsSync as existsSync3, statSync as statSync2 } from "fs";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
MEMORY_FILE_NAME,
|
|
13
13
|
MEMORY_MAX_CHARS,
|
|
14
14
|
MEMORY_STORE_FILE_NAME
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-IUC3DRGB.js";
|
|
16
16
|
|
|
17
17
|
// src/memory/persistent-memory.ts
|
|
18
18
|
import { copyFileSync, existsSync, mkdirSync, readFileSync, statSync } from "fs";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
setPreferredAgentName,
|
|
17
17
|
truncateForPersist,
|
|
18
18
|
undoStack
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-MPCQG7LV.js";
|
|
20
20
|
import {
|
|
21
21
|
buildReviewPrompt,
|
|
22
22
|
buildSecurityReviewPrompt
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
touchMemoryReferences,
|
|
52
52
|
updateMemoryApproval,
|
|
53
53
|
updateMemoryEntry
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-XF2S7LNM.js";
|
|
55
55
|
import {
|
|
56
56
|
theme
|
|
57
57
|
} from "./chunk-5C76XDDF.js";
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
import {
|
|
66
66
|
buildDoctorReport,
|
|
67
67
|
formatDoctorReport
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-ABIR2TGW.js";
|
|
69
69
|
import {
|
|
70
70
|
describePlugin,
|
|
71
71
|
getActivePluginAssets,
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
trustHook,
|
|
81
81
|
trustPlugin,
|
|
82
82
|
untrustHook
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-SS3PG7LP.js";
|
|
84
84
|
import {
|
|
85
85
|
isCleanDocumentBody,
|
|
86
86
|
stripOuterCodeFence
|
|
@@ -109,7 +109,7 @@ import {
|
|
|
109
109
|
MCP_TOOL_PREFIX,
|
|
110
110
|
REPO_URL,
|
|
111
111
|
VERSION
|
|
112
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-6UDKGZ3D.js";
|
|
113
113
|
|
|
114
114
|
// src/skills/manager.ts
|
|
115
115
|
import { existsSync, readdirSync, mkdirSync, statSync } from "fs";
|
|
@@ -2445,7 +2445,7 @@ No tools match "${filter}".
|
|
|
2445
2445
|
const { join: join6 } = await import("path");
|
|
2446
2446
|
const { existsSync: existsSync6 } = await import("fs");
|
|
2447
2447
|
const { getGitRoot } = await import("./git-context-EXOEHQSF.js");
|
|
2448
|
-
const { MCP_PROJECT_CONFIG_NAME } = await import("./constants-
|
|
2448
|
+
const { MCP_PROJECT_CONFIG_NAME } = await import("./constants-MG7EGG5J.js");
|
|
2449
2449
|
const { approveProject, hashMcpFile } = await import("./project-trust-KGG2BWKC.js");
|
|
2450
2450
|
const cwd = process.cwd();
|
|
2451
2451
|
const projectRoot = getGitRoot(cwd) ?? cwd;
|
|
@@ -3553,7 +3553,7 @@ function createReviewCommands() {
|
|
|
3553
3553
|
usage: "/test [command|filter]",
|
|
3554
3554
|
async execute(args, ctx) {
|
|
3555
3555
|
try {
|
|
3556
|
-
const { executeTests } = await import("./run-tests-
|
|
3556
|
+
const { executeTests } = await import("./run-tests-YTRU22LY.js");
|
|
3557
3557
|
const argStr = args.join(" ").trim();
|
|
3558
3558
|
let testArgs = {};
|
|
3559
3559
|
if (argStr) {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
searchPersistentMemories,
|
|
12
12
|
touchMemoryReferences,
|
|
13
13
|
updateMemoryEntry
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-XF2S7LNM.js";
|
|
15
15
|
import {
|
|
16
16
|
indexProject
|
|
17
17
|
} from "./chunk-RWRZVQCB.js";
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
runHook,
|
|
31
31
|
runLifecycleHooks,
|
|
32
32
|
runTool
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-SS3PG7LP.js";
|
|
34
34
|
import {
|
|
35
35
|
buildTruncatedArgumentsError,
|
|
36
36
|
getDangerLevel,
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
recoverGbkMojibake,
|
|
65
65
|
runTestsTool,
|
|
66
66
|
shellInvocation
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-DRNRQ6SD.js";
|
|
68
68
|
import {
|
|
69
69
|
CONFIG_DIR_NAME,
|
|
70
70
|
DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
SUBAGENT_ALLOWED_TOOLS,
|
|
74
74
|
SUBAGENT_DEFAULT_MAX_ROUNDS,
|
|
75
75
|
SUBAGENT_MAX_ROUNDS_LIMIT
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-6UDKGZ3D.js";
|
|
77
77
|
import {
|
|
78
78
|
getCurrentSessionKey,
|
|
79
79
|
getExecutionConfigDir,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
evaluateCiGate,
|
|
4
4
|
normalizeCiThresholds
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YDH5ZWOQ.js";
|
|
6
6
|
import {
|
|
7
7
|
buildReviewPrompt,
|
|
8
8
|
buildSecurityReviewPrompt,
|
|
@@ -13,13 +13,13 @@ import {
|
|
|
13
13
|
} from "./chunk-6YZEZFX5.js";
|
|
14
14
|
import {
|
|
15
15
|
ProviderRegistry
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-I5KLH7TL.js";
|
|
17
17
|
import {
|
|
18
18
|
ConfigManager
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-2CNJ25U7.js";
|
|
20
20
|
import {
|
|
21
21
|
VERSION
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-6UDKGZ3D.js";
|
|
23
23
|
|
|
24
24
|
// src/cli/ci.ts
|
|
25
25
|
import { execFileSync } from "child_process";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
MEMORY_FILE_NAME,
|
|
14
14
|
MEMORY_MAX_CHARS,
|
|
15
15
|
MEMORY_STORE_FILE_NAME
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-6UDKGZ3D.js";
|
|
17
17
|
|
|
18
18
|
// src/memory/persistent-memory.ts
|
|
19
19
|
import { copyFileSync, existsSync, mkdirSync, readFileSync, statSync } from "fs";
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
CI_COMMENT_MARKER,
|
|
4
4
|
countSeverity,
|
|
5
5
|
runCi
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-TYQODNI7.js";
|
|
7
|
+
import "./chunk-YDH5ZWOQ.js";
|
|
8
8
|
import "./chunk-HLWUDRBO.js";
|
|
9
9
|
import "./chunk-6YZEZFX5.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-I5KLH7TL.js";
|
|
11
|
+
import "./chunk-2CNJ25U7.js";
|
|
12
12
|
import "./chunk-E2W2MI6H.js";
|
|
13
13
|
import "./chunk-TU3L3PW7.js";
|
|
14
14
|
import "./chunk-BMLQPSHP.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-6UDKGZ3D.js";
|
|
16
16
|
export {
|
|
17
17
|
CI_COMMENT_MARKER,
|
|
18
18
|
countSeverity,
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
formatDoctorReport,
|
|
4
4
|
runDoctorCli
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-ABIR2TGW.js";
|
|
6
|
+
import "./chunk-SS3PG7LP.js";
|
|
7
7
|
import "./chunk-RS7SKYTS.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-I5KLH7TL.js";
|
|
9
|
+
import "./chunk-2CNJ25U7.js";
|
|
10
10
|
import "./chunk-E2W2MI6H.js";
|
|
11
11
|
import "./chunk-TU3L3PW7.js";
|
|
12
12
|
import "./chunk-HOSJZMQS.js";
|
|
13
13
|
import "./chunk-BMLQPSHP.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-6UDKGZ3D.js";
|
|
15
15
|
export {
|
|
16
16
|
formatDoctorReport,
|
|
17
17
|
runDoctorCli
|
package/dist/electron-server.js
CHANGED
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
touchMemoryReferences,
|
|
56
56
|
updateMemoryApproval,
|
|
57
57
|
updateMemoryEntry
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-LKSMXCFL.js";
|
|
59
59
|
import {
|
|
60
60
|
DEFAULT_PATTERNS,
|
|
61
61
|
redactJson,
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
recoverGbkMojibake,
|
|
82
82
|
runTestsTool,
|
|
83
83
|
shellInvocation
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-LRRBYGHE.js";
|
|
85
85
|
import {
|
|
86
86
|
getCurrentSessionKey,
|
|
87
87
|
getExecutionConfigDir,
|
|
@@ -123,7 +123,7 @@ import {
|
|
|
123
123
|
SUBAGENT_MAX_ROUNDS_LIMIT,
|
|
124
124
|
VERSION,
|
|
125
125
|
buildUserIdentityPrompt
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-IUC3DRGB.js";
|
|
127
127
|
|
|
128
128
|
// src/web/access.ts
|
|
129
129
|
import { randomBytes, timingSafeEqual } from "crypto";
|
|
@@ -17834,7 +17834,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
|
|
|
17834
17834
|
Cost: ${formatCost(cost)}` : "";
|
|
17835
17835
|
let memoryLine = "";
|
|
17836
17836
|
try {
|
|
17837
|
-
const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-
|
|
17837
|
+
const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-OCDFR4BH.js");
|
|
17838
17838
|
const pending = countPendingMemories2(ctx.config.getConfigDir());
|
|
17839
17839
|
if (pending > 0) memoryLine = `
|
|
17840
17840
|
Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
|
|
@@ -18822,7 +18822,7 @@ async function handleTest(args, ctx) {
|
|
|
18822
18822
|
const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
|
|
18823
18823
|
testArgs = isCommand ? { command: argStr } : { filter: argStr };
|
|
18824
18824
|
}
|
|
18825
|
-
const runTests = ctx.runTests ?? (await import("./run-tests-
|
|
18825
|
+
const runTests = ctx.runTests ?? (await import("./run-tests-LTYJACRX.js")).executeTests;
|
|
18826
18826
|
const report = await runTests(testArgs);
|
|
18827
18827
|
ctx.send({ type: "info", message: report });
|
|
18828
18828
|
} catch (err) {
|
|
@@ -19213,7 +19213,7 @@ async function handleMemory(args, ctx) {
|
|
|
19213
19213
|
}
|
|
19214
19214
|
if (intent.kind === "status") {
|
|
19215
19215
|
const { getChatIndexStatus: getChatIndexStatus2 } = await import("./chat-index-RLVLQRRC.js");
|
|
19216
|
-
const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-
|
|
19216
|
+
const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-OCDFR4BH.js");
|
|
19217
19217
|
const memories = listMemoryEntries2(configDir, { includeExpired: true, includeRejected: true });
|
|
19218
19218
|
const injected = formatMemoryForPrompt2(configDir, process.cwd(), ctx.config.get("memory")?.maxChars);
|
|
19219
19219
|
const view = buildMemoryStatusView({
|
|
@@ -19236,7 +19236,7 @@ async function handleMemory(args, ctx) {
|
|
|
19236
19236
|
return;
|
|
19237
19237
|
}
|
|
19238
19238
|
if (intent.kind === "recall") {
|
|
19239
|
-
const { searchPersistentMemories: searchPersistentMemories2, touchMemoryReferences: touchMemoryReferences2 } = await import("./persistent-memory-
|
|
19239
|
+
const { searchPersistentMemories: searchPersistentMemories2, touchMemoryReferences: touchMemoryReferences2 } = await import("./persistent-memory-OCDFR4BH.js");
|
|
19240
19240
|
const { searchChatMemory: searchChatMemory2 } = await import("./chat-index-RLVLQRRC.js");
|
|
19241
19241
|
const persistentHits = searchPersistentMemories2(configDir, intent.query, process.cwd(), 3);
|
|
19242
19242
|
if (persistentHits.length > 0) {
|
|
@@ -19357,7 +19357,7 @@ async function handleMemory(args, ctx) {
|
|
|
19357
19357
|
ctx.handleMemoryManage(intent.action, args[1], intent.action === "expire" ? args[2] : void 0);
|
|
19358
19358
|
} else if (intent.kind === "export") {
|
|
19359
19359
|
if (args[1] === "md") {
|
|
19360
|
-
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-
|
|
19360
|
+
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-OCDFR4BH.js");
|
|
19361
19361
|
ctx.send({
|
|
19362
19362
|
type: "export_data",
|
|
19363
19363
|
format: "md",
|
|
@@ -20363,7 +20363,7 @@ No tools match "${filter}".
|
|
|
20363
20363
|
const { join: join26 } = await import("path");
|
|
20364
20364
|
const { existsSync: existsSync32 } = await import("fs");
|
|
20365
20365
|
const { getGitRoot: getGitRoot2 } = await import("./git-context-VNCA2GU7.js");
|
|
20366
|
-
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-
|
|
20366
|
+
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-BYWEJLAI.js");
|
|
20367
20367
|
const { approveProject, hashMcpFile } = await import("./project-trust-6CJB5ZMX.js");
|
|
20368
20368
|
const cwd = process.cwd();
|
|
20369
20369
|
const projectRoot = getGitRoot2(cwd) ?? cwd;
|
|
@@ -21282,7 +21282,7 @@ function createReviewCommands() {
|
|
|
21282
21282
|
usage: "/test [command|filter]",
|
|
21283
21283
|
async execute(args, ctx) {
|
|
21284
21284
|
try {
|
|
21285
|
-
const { executeTests } = await import("./run-tests-
|
|
21285
|
+
const { executeTests } = await import("./run-tests-LTYJACRX.js");
|
|
21286
21286
|
const argStr = args.join(" ").trim();
|
|
21287
21287
|
let testArgs = {};
|
|
21288
21288
|
if (argStr) {
|
|
@@ -25253,6 +25253,12 @@ function getModuleDir() {
|
|
|
25253
25253
|
}
|
|
25254
25254
|
return resolve12(".");
|
|
25255
25255
|
}
|
|
25256
|
+
var WebStartupError = class extends Error {
|
|
25257
|
+
constructor(message) {
|
|
25258
|
+
super(message);
|
|
25259
|
+
this.name = "WebStartupError";
|
|
25260
|
+
}
|
|
25261
|
+
};
|
|
25256
25262
|
async function startWebServer(options = {}) {
|
|
25257
25263
|
const port = options.port ?? 3e3;
|
|
25258
25264
|
const host = options.host ?? "localhost";
|
|
@@ -25261,7 +25267,7 @@ async function startWebServer(options = {}) {
|
|
|
25261
25267
|
const config = new ConfigManager();
|
|
25262
25268
|
const authManager = new AuthManager(config.getConfigDir());
|
|
25263
25269
|
if (!authManager.isEnabled() && !["localhost", "127.0.0.1", "::1"].includes(host)) {
|
|
25264
|
-
throw new
|
|
25270
|
+
throw new WebStartupError("Network listening requires authentication. Create a user first: aicli user create <username>");
|
|
25265
25271
|
}
|
|
25266
25272
|
await setupProxy(config.get("proxy"));
|
|
25267
25273
|
const providers = new ProviderRegistry();
|
|
@@ -25387,6 +25393,8 @@ async function startWebServer(options = {}) {
|
|
|
25387
25393
|
const cookie = parseCookie(req.headers.cookie ?? "");
|
|
25388
25394
|
return equalToken(cookie.aicli_local, access.localToken) || !!authManager.verifyToken(cookie.aicli_token ?? "");
|
|
25389
25395
|
} });
|
|
25396
|
+
wss.on("error", () => {
|
|
25397
|
+
});
|
|
25390
25398
|
if (authManager.isEnabled()) {
|
|
25391
25399
|
console.log(` Auth: ${authManager.listUsers().length} user(s) registered`);
|
|
25392
25400
|
} else {
|
|
@@ -25931,6 +25939,12 @@ async function startWebServer(options = {}) {
|
|
|
25931
25939
|
actualPort++;
|
|
25932
25940
|
console.log(` \u26A0 Port ${actualPort - 1} in use, trying ${actualPort}...`);
|
|
25933
25941
|
server.close(() => tryListen(attempt + 1));
|
|
25942
|
+
} else if (err.code === "EADDRINUSE") {
|
|
25943
|
+
reject(new WebStartupError(`Ports ${port}-${actualPort} are all in use. Pick another one: aicli web --port <number>`));
|
|
25944
|
+
} else if (err.code === "EACCES") {
|
|
25945
|
+
reject(new WebStartupError(`No permission to listen on port ${actualPort}. Pick another one: aicli web --port <number>`));
|
|
25946
|
+
} else if (err.code === "EADDRNOTAVAIL" || err.code === "ENOTFOUND") {
|
|
25947
|
+
reject(new WebStartupError(`Cannot listen on host "${host}" (${err.code}). Check the --host value.`));
|
|
25934
25948
|
} else {
|
|
25935
25949
|
reject(err);
|
|
25936
25950
|
}
|
|
@@ -158,7 +158,7 @@ ${content}`);
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
async function runTaskMode(config, providers, configManager, topic) {
|
|
161
|
-
const { TaskOrchestrator } = await import("./task-orchestrator-
|
|
161
|
+
const { TaskOrchestrator } = await import("./task-orchestrator-URFLWSPI.js");
|
|
162
162
|
const orchestrator = new TaskOrchestrator(config, providers, configManager);
|
|
163
163
|
let interrupted = false;
|
|
164
164
|
const onSigint = () => {
|
package/dist/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
setupProxy,
|
|
25
25
|
snapshotFile,
|
|
26
26
|
stripRoutingTags
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-LSSOPLKJ.js";
|
|
28
28
|
import {
|
|
29
29
|
CostTracker,
|
|
30
30
|
getPricing,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
setMaxOutputCap,
|
|
48
48
|
spawnAgentContext,
|
|
49
49
|
undoStack
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-MPCQG7LV.js";
|
|
51
51
|
import "./chunk-HLWUDRBO.js";
|
|
52
52
|
import {
|
|
53
53
|
NO_THINKING,
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
countPendingMemories,
|
|
61
61
|
detectStaleLegacyMarkdownEdit,
|
|
62
62
|
formatMemoryForPrompt
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-XF2S7LNM.js";
|
|
64
64
|
import "./chunk-RWRZVQCB.js";
|
|
65
65
|
import "./chunk-B3MPYI4E.js";
|
|
66
66
|
import "./chunk-M6HLYG33.js";
|
|
@@ -81,22 +81,22 @@ import {
|
|
|
81
81
|
import {
|
|
82
82
|
loadContextFiles,
|
|
83
83
|
writeCrashLog
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-ABIR2TGW.js";
|
|
85
85
|
import {
|
|
86
86
|
getActivePluginAssets,
|
|
87
87
|
getPendingHookTrust,
|
|
88
88
|
installFlushOnExit,
|
|
89
89
|
mergePluginHooks,
|
|
90
90
|
runLifecycleHooks
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-SS3PG7LP.js";
|
|
92
92
|
import "./chunk-RS7SKYTS.js";
|
|
93
93
|
import {
|
|
94
94
|
ProviderRegistry,
|
|
95
95
|
listBuiltInProviderMetadata
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-I5KLH7TL.js";
|
|
97
97
|
import {
|
|
98
98
|
ConfigManager
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-2CNJ25U7.js";
|
|
100
100
|
import {
|
|
101
101
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
102
102
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
isInterrupted,
|
|
135
135
|
requestInterrupt,
|
|
136
136
|
resetInterrupt
|
|
137
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-DRNRQ6SD.js";
|
|
138
138
|
import {
|
|
139
139
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
140
140
|
AUTHOR,
|
|
@@ -152,7 +152,7 @@ import {
|
|
|
152
152
|
SKILLS_DIR_NAME,
|
|
153
153
|
VERSION,
|
|
154
154
|
buildUserIdentityPrompt
|
|
155
|
-
} from "./chunk-
|
|
155
|
+
} from "./chunk-6UDKGZ3D.js";
|
|
156
156
|
import "./chunk-SXIJLSVF.js";
|
|
157
157
|
|
|
158
158
|
// src/index.ts
|
|
@@ -4117,8 +4117,18 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
4117
4117
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
4118
4118
|
process.exit(1);
|
|
4119
4119
|
}
|
|
4120
|
-
const { startWebServer } = await import("./server-
|
|
4121
|
-
|
|
4120
|
+
const { startWebServer, WebStartupError } = await import("./server-2NZN22XP.js");
|
|
4121
|
+
try {
|
|
4122
|
+
await startWebServer({ port, host: options.host, externalOrigin: options.externalOrigin });
|
|
4123
|
+
} catch (err) {
|
|
4124
|
+
if (err instanceof WebStartupError) {
|
|
4125
|
+
console.error(`
|
|
4126
|
+
\u2717 ${err.message}
|
|
4127
|
+
`);
|
|
4128
|
+
process.exit(1);
|
|
4129
|
+
}
|
|
4130
|
+
throw err;
|
|
4131
|
+
}
|
|
4122
4132
|
});
|
|
4123
4133
|
program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | logout-all <name> | migrate <name>)").action(async (action, username) => {
|
|
4124
4134
|
const { AuthManager } = await import("./auth-QTQNZ6IX.js");
|
|
@@ -4284,11 +4294,11 @@ program.command("sessions").description("List recent conversation sessions").opt
|
|
|
4284
4294
|
console.log(footer + "\n");
|
|
4285
4295
|
});
|
|
4286
4296
|
program.command("usage").description("Show token + cost usage grouped by provider/model (cross-session)").option("--days <n>", "Only the last N days (inclusive of today)").option("--month <ym>", "Only a specific month, format YYYY-MM (e.g. 2026-06)").option("--json", "Output as JSON (for scripting)").action(async (options) => {
|
|
4287
|
-
const { runUsageCli } = await import("./usage-
|
|
4297
|
+
const { runUsageCli } = await import("./usage-IP6G4Q2K.js");
|
|
4288
4298
|
await runUsageCli(options);
|
|
4289
4299
|
});
|
|
4290
4300
|
program.command("doctor").description("Health check: API keys, config, MCP, recent crashes, tool usage, disk usage").option("--json", "Output as JSON (for scripting)").option("--reset-stats", "Reset accumulated tool usage statistics").action(async (options) => {
|
|
4291
|
-
const { runDoctorCli } = await import("./doctor-cli-
|
|
4301
|
+
const { runDoctorCli } = await import("./doctor-cli-LYZSHYR6.js");
|
|
4292
4302
|
const argv = process.argv.slice(2);
|
|
4293
4303
|
await runDoctorCli({
|
|
4294
4304
|
json: !!options.json || argv.includes("--json"),
|
|
@@ -4297,7 +4307,7 @@ program.command("doctor").description("Health check: API keys, config, MCP, rece
|
|
|
4297
4307
|
});
|
|
4298
4308
|
program.command("batch <action> [arg] [arg2]").description("Anthropic Message Batches: submit | list | status <id> | results <id> [out] | cancel <id>").option("--dry-run", "Parse and validate input without submitting (submit only)").action(async (action, arg, arg2, options) => {
|
|
4299
4309
|
try {
|
|
4300
|
-
const batch = await import("./batch-
|
|
4310
|
+
const batch = await import("./batch-NNYRIS4U.js");
|
|
4301
4311
|
switch (action) {
|
|
4302
4312
|
case "submit":
|
|
4303
4313
|
if (!arg) {
|
|
@@ -4340,7 +4350,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
4340
4350
|
}
|
|
4341
4351
|
});
|
|
4342
4352
|
program.command("mcp-serve").description("Start an MCP server over STDIO, exposing aicli's built-in tools to Claude Desktop / Cursor / other MCP clients").option("--allow-destructive", "Allow bash / run_interactive / task_create (always destructive in MCP mode)").option("--allow-outside-cwd", "Allow tool path arguments to escape the sandbox root \u2014 disabled by default").option("--tools <list>", "Comma-separated whitelist of tools to expose (default: all eligible tools)").option("--cwd <path>", "Working directory AND sandbox root (default: current directory)").action(async (options) => {
|
|
4343
|
-
const { startMcpServer } = await import("./server-
|
|
4353
|
+
const { startMcpServer } = await import("./server-ZTFB3KMS.js");
|
|
4344
4354
|
await startMcpServer({
|
|
4345
4355
|
allowDestructive: !!options.allowDestructive,
|
|
4346
4356
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -4353,7 +4363,7 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
4353
4363
|
console.error(`Unknown pr action: ${action}. Use review | security-review | summarize.`);
|
|
4354
4364
|
process.exit(1);
|
|
4355
4365
|
}
|
|
4356
|
-
const { runPrCli } = await import("./pr-
|
|
4366
|
+
const { runPrCli } = await import("./pr-LDUIDU27.js");
|
|
4357
4367
|
const result = await runPrCli({
|
|
4358
4368
|
action,
|
|
4359
4369
|
target,
|
|
@@ -4373,8 +4383,8 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
4373
4383
|
process.exit(result.exitCode);
|
|
4374
4384
|
});
|
|
4375
4385
|
program.command("ci").description("Headless PR review (code + security) \u2014 reads git/gh diff, optionally posts to PR. Designed for GitHub Actions.").option("--pr <num>", "PR number or URL; diff fetched via gh pr diff <value>", (v) => /^#?\d+$/.test(v) ? parseInt(v.replace(/^#/, ""), 10) : v).option("--base <ref>", "Base ref for git diff <ref>...HEAD (ignored when --pr set)").option("--post", "Post review as a PR comment (requires gh CLI + GH_TOKEN, needs --pr)").option("--no-update", "Always create a new comment instead of updating the previous aicli review").option("--skip-code", "Skip the code review section").option("--skip-security", "Skip the security review section").option("--detailed", "Use the detailed code-review prompt").option("--max-diff <n>", "Max diff chars sent to the model (default 30000)", (v) => parseInt(v, 10)).option("--provider <id>", "Override provider (default: config.defaultProvider)").option("--model <id>", "Override model").option("--dry-run", "Print result to stdout instead of posting (overrides --post)").option("--json", "Output a structured JSON report").option("--markdown", "Output Markdown report (default)").option("--sarif", "Output SARIF 2.1.0 for code scanning artifacts").option("--fail-on-security-high", "Fail when the security review contains HIGH/CRITICAL findings (default)").option("--no-fail-on-security-high", "Do not fail on security HIGH/CRITICAL findings").option("--fail-on-test-failure", "Fail when the report mentions test failures (default)").option("--no-fail-on-test-failure", "Do not fail on test failure findings").option("--fail-on-lint-failure", "Fail when the report mentions lint/typecheck failures (default)").option("--no-fail-on-lint-failure", "Do not fail on lint/typecheck failure findings").action(async (options) => {
|
|
4376
|
-
const { runCi } = await import("./ci-
|
|
4377
|
-
const { formatCiResult } = await import("./ci-format-
|
|
4386
|
+
const { runCi } = await import("./ci-ODKA57IG.js");
|
|
4387
|
+
const { formatCiResult } = await import("./ci-format-QDC4XKYZ.js");
|
|
4378
4388
|
const formats = [options.json, options.markdown, options.sarif].filter(Boolean).length;
|
|
4379
4389
|
if (formats > 1) {
|
|
4380
4390
|
console.error("Choose only one output format: --json, --markdown, or --sarif.");
|
|
@@ -4533,7 +4543,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
4533
4543
|
config.get("customProviders"),
|
|
4534
4544
|
config.getConfigDir()
|
|
4535
4545
|
);
|
|
4536
|
-
const { startHub } = await import("./hub-
|
|
4546
|
+
const { startHub } = await import("./hub-GRHYVLGV.js");
|
|
4537
4547
|
await startHub(
|
|
4538
4548
|
{
|
|
4539
4549
|
topic: topic ?? "",
|
|
@@ -28,11 +28,11 @@ import {
|
|
|
28
28
|
touchMemoryReferences,
|
|
29
29
|
updateMemoryApproval,
|
|
30
30
|
updateMemoryEntry
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-XF2S7LNM.js";
|
|
32
32
|
import "./chunk-3FEZSLGI.js";
|
|
33
33
|
import "./chunk-HOSJZMQS.js";
|
|
34
34
|
import "./chunk-BMLQPSHP.js";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-6UDKGZ3D.js";
|
|
36
36
|
export {
|
|
37
37
|
addMemoryEntry,
|
|
38
38
|
backupMemoryStore,
|
|
@@ -27,11 +27,11 @@ import {
|
|
|
27
27
|
touchMemoryReferences,
|
|
28
28
|
updateMemoryApproval,
|
|
29
29
|
updateMemoryEntry
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-LKSMXCFL.js";
|
|
31
31
|
import "./chunk-FSC6KEWU.js";
|
|
32
32
|
import "./chunk-2XMUCC42.js";
|
|
33
33
|
import "./chunk-CGLYJRFA.js";
|
|
34
|
-
import "./chunk-
|
|
34
|
+
import "./chunk-IUC3DRGB.js";
|
|
35
35
|
export {
|
|
36
36
|
addMemoryEntry,
|
|
37
37
|
backupMemoryStore,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
countSeverity,
|
|
4
4
|
runCi
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-TYQODNI7.js";
|
|
6
|
+
import "./chunk-YDH5ZWOQ.js";
|
|
7
7
|
import {
|
|
8
8
|
buildReviewPrompt,
|
|
9
9
|
buildSecurityReviewPrompt,
|
|
@@ -14,16 +14,16 @@ import {
|
|
|
14
14
|
} from "./chunk-6YZEZFX5.js";
|
|
15
15
|
import {
|
|
16
16
|
ProviderRegistry
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-I5KLH7TL.js";
|
|
18
18
|
import {
|
|
19
19
|
ConfigManager
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-2CNJ25U7.js";
|
|
21
21
|
import "./chunk-E2W2MI6H.js";
|
|
22
22
|
import "./chunk-TU3L3PW7.js";
|
|
23
23
|
import "./chunk-BMLQPSHP.js";
|
|
24
24
|
import {
|
|
25
25
|
VERSION
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-6UDKGZ3D.js";
|
|
27
27
|
|
|
28
28
|
// src/cli/pr.ts
|
|
29
29
|
import { execFileSync } from "child_process";
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
executeTests,
|
|
3
3
|
runTestProcess,
|
|
4
4
|
runTestsTool
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LRRBYGHE.js";
|
|
6
6
|
import "./chunk-QMFMST2T.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-IUC3DRGB.js";
|
|
8
8
|
export {
|
|
9
9
|
executeTests,
|
|
10
10
|
runTestProcess,
|
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
skillHistoryNote,
|
|
87
87
|
snapshotFile,
|
|
88
88
|
stripRoutingTags
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-LSSOPLKJ.js";
|
|
90
90
|
import {
|
|
91
91
|
CNY_PER_USD,
|
|
92
92
|
CostTracker,
|
|
@@ -130,7 +130,7 @@ import {
|
|
|
130
130
|
spawnAgentContext,
|
|
131
131
|
truncateOutput,
|
|
132
132
|
undoStack
|
|
133
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-MPCQG7LV.js";
|
|
134
134
|
import {
|
|
135
135
|
buildReviewPrompt,
|
|
136
136
|
buildSecurityReviewPrompt
|
|
@@ -157,7 +157,7 @@ import {
|
|
|
157
157
|
restoreMemoryEntries,
|
|
158
158
|
updateMemoryApproval,
|
|
159
159
|
updateMemoryEntry
|
|
160
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-XF2S7LNM.js";
|
|
161
161
|
import "./chunk-RWRZVQCB.js";
|
|
162
162
|
import "./chunk-B3MPYI4E.js";
|
|
163
163
|
import "./chunk-M6HLYG33.js";
|
|
@@ -176,7 +176,7 @@ import {
|
|
|
176
176
|
buildDoctorReport,
|
|
177
177
|
formatDoctorReport,
|
|
178
178
|
loadContextFiles
|
|
179
|
-
} from "./chunk-
|
|
179
|
+
} from "./chunk-ABIR2TGW.js";
|
|
180
180
|
import {
|
|
181
181
|
describePlugin,
|
|
182
182
|
getActivePluginAssets,
|
|
@@ -191,14 +191,14 @@ import {
|
|
|
191
191
|
runTool,
|
|
192
192
|
setPluginEnabled,
|
|
193
193
|
trustPlugin
|
|
194
|
-
} from "./chunk-
|
|
194
|
+
} from "./chunk-SS3PG7LP.js";
|
|
195
195
|
import "./chunk-RS7SKYTS.js";
|
|
196
196
|
import {
|
|
197
197
|
ProviderRegistry
|
|
198
|
-
} from "./chunk-
|
|
198
|
+
} from "./chunk-I5KLH7TL.js";
|
|
199
199
|
import {
|
|
200
200
|
ConfigManager
|
|
201
|
-
} from "./chunk-
|
|
201
|
+
} from "./chunk-2CNJ25U7.js";
|
|
202
202
|
import {
|
|
203
203
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
204
204
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -231,7 +231,7 @@ import {
|
|
|
231
231
|
import {
|
|
232
232
|
assertReadablePath
|
|
233
233
|
} from "./chunk-JJFJWD35.js";
|
|
234
|
-
import "./chunk-
|
|
234
|
+
import "./chunk-DRNRQ6SD.js";
|
|
235
235
|
import {
|
|
236
236
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
237
237
|
AUTHOR,
|
|
@@ -247,7 +247,7 @@ import {
|
|
|
247
247
|
SKILLS_DIR_NAME,
|
|
248
248
|
VERSION,
|
|
249
249
|
buildUserIdentityPrompt
|
|
250
|
-
} from "./chunk-
|
|
250
|
+
} from "./chunk-6UDKGZ3D.js";
|
|
251
251
|
import {
|
|
252
252
|
runWithExecutionContext,
|
|
253
253
|
runWithSessionKey
|
|
@@ -979,7 +979,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
|
|
|
979
979
|
Cost: ${formatCost(cost)}` : "";
|
|
980
980
|
let memoryLine = "";
|
|
981
981
|
try {
|
|
982
|
-
const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-
|
|
982
|
+
const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-O6GWHGJH.js");
|
|
983
983
|
const pending = countPendingMemories2(ctx.config.getConfigDir());
|
|
984
984
|
if (pending > 0) memoryLine = `
|
|
985
985
|
Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
|
|
@@ -1908,7 +1908,7 @@ async function handleTest(args, ctx) {
|
|
|
1908
1908
|
const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
|
|
1909
1909
|
testArgs = isCommand ? { command: argStr } : { filter: argStr };
|
|
1910
1910
|
}
|
|
1911
|
-
const runTests = ctx.runTests ?? (await import("./run-tests-
|
|
1911
|
+
const runTests = ctx.runTests ?? (await import("./run-tests-YTRU22LY.js")).executeTests;
|
|
1912
1912
|
const report = await runTests(testArgs);
|
|
1913
1913
|
ctx.send({ type: "info", message: report });
|
|
1914
1914
|
} catch (err) {
|
|
@@ -2184,7 +2184,7 @@ async function handleMemory(args, ctx) {
|
|
|
2184
2184
|
}
|
|
2185
2185
|
if (intent.kind === "status") {
|
|
2186
2186
|
const { getChatIndexStatus } = await import("./chat-index-7CLR4CBG.js");
|
|
2187
|
-
const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-
|
|
2187
|
+
const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-O6GWHGJH.js");
|
|
2188
2188
|
const memories = listMemoryEntries2(configDir, { includeExpired: true, includeRejected: true });
|
|
2189
2189
|
const injected = formatMemoryForPrompt2(configDir, process.cwd(), ctx.config.get("memory")?.maxChars);
|
|
2190
2190
|
const view = buildMemoryStatusView({
|
|
@@ -2207,7 +2207,7 @@ async function handleMemory(args, ctx) {
|
|
|
2207
2207
|
return;
|
|
2208
2208
|
}
|
|
2209
2209
|
if (intent.kind === "recall") {
|
|
2210
|
-
const { searchPersistentMemories, touchMemoryReferences } = await import("./persistent-memory-
|
|
2210
|
+
const { searchPersistentMemories, touchMemoryReferences } = await import("./persistent-memory-O6GWHGJH.js");
|
|
2211
2211
|
const { searchChatMemory } = await import("./chat-index-7CLR4CBG.js");
|
|
2212
2212
|
const persistentHits = searchPersistentMemories(configDir, intent.query, process.cwd(), 3);
|
|
2213
2213
|
if (persistentHits.length > 0) {
|
|
@@ -2328,7 +2328,7 @@ async function handleMemory(args, ctx) {
|
|
|
2328
2328
|
ctx.handleMemoryManage(intent.action, args[1], intent.action === "expire" ? args[2] : void 0);
|
|
2329
2329
|
} else if (intent.kind === "export") {
|
|
2330
2330
|
if (args[1] === "md") {
|
|
2331
|
-
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-
|
|
2331
|
+
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-O6GWHGJH.js");
|
|
2332
2332
|
ctx.send({
|
|
2333
2333
|
type: "export_data",
|
|
2334
2334
|
format: "md",
|
|
@@ -4392,6 +4392,12 @@ function getModuleDir() {
|
|
|
4392
4392
|
}
|
|
4393
4393
|
return resolve3(".");
|
|
4394
4394
|
}
|
|
4395
|
+
var WebStartupError = class extends Error {
|
|
4396
|
+
constructor(message) {
|
|
4397
|
+
super(message);
|
|
4398
|
+
this.name = "WebStartupError";
|
|
4399
|
+
}
|
|
4400
|
+
};
|
|
4395
4401
|
async function startWebServer(options = {}) {
|
|
4396
4402
|
const port = options.port ?? 3e3;
|
|
4397
4403
|
const host = options.host ?? "localhost";
|
|
@@ -4400,7 +4406,7 @@ async function startWebServer(options = {}) {
|
|
|
4400
4406
|
const config = new ConfigManager();
|
|
4401
4407
|
const authManager = new AuthManager(config.getConfigDir());
|
|
4402
4408
|
if (!authManager.isEnabled() && !["localhost", "127.0.0.1", "::1"].includes(host)) {
|
|
4403
|
-
throw new
|
|
4409
|
+
throw new WebStartupError("Network listening requires authentication. Create a user first: aicli user create <username>");
|
|
4404
4410
|
}
|
|
4405
4411
|
await setupProxy(config.get("proxy"));
|
|
4406
4412
|
const providers = new ProviderRegistry();
|
|
@@ -4526,6 +4532,8 @@ async function startWebServer(options = {}) {
|
|
|
4526
4532
|
const cookie = parseCookie(req.headers.cookie ?? "");
|
|
4527
4533
|
return equalToken(cookie.aicli_local, access.localToken) || !!authManager.verifyToken(cookie.aicli_token ?? "");
|
|
4528
4534
|
} });
|
|
4535
|
+
wss.on("error", () => {
|
|
4536
|
+
});
|
|
4529
4537
|
if (authManager.isEnabled()) {
|
|
4530
4538
|
console.log(` Auth: ${authManager.listUsers().length} user(s) registered`);
|
|
4531
4539
|
} else {
|
|
@@ -5070,6 +5078,12 @@ async function startWebServer(options = {}) {
|
|
|
5070
5078
|
actualPort++;
|
|
5071
5079
|
console.log(` \u26A0 Port ${actualPort - 1} in use, trying ${actualPort}...`);
|
|
5072
5080
|
server.close(() => tryListen(attempt + 1));
|
|
5081
|
+
} else if (err.code === "EADDRINUSE") {
|
|
5082
|
+
reject(new WebStartupError(`Ports ${port}-${actualPort} are all in use. Pick another one: aicli web --port <number>`));
|
|
5083
|
+
} else if (err.code === "EACCES") {
|
|
5084
|
+
reject(new WebStartupError(`No permission to listen on port ${actualPort}. Pick another one: aicli web --port <number>`));
|
|
5085
|
+
} else if (err.code === "EADDRNOTAVAIL" || err.code === "ENOTFOUND") {
|
|
5086
|
+
reject(new WebStartupError(`Cannot listen on host "${host}" (${err.code}). Check the --host value.`));
|
|
5073
5087
|
} else {
|
|
5074
5088
|
reject(err);
|
|
5075
5089
|
}
|
|
@@ -5172,5 +5186,6 @@ async function openBrowser(url) {
|
|
|
5172
5186
|
}
|
|
5173
5187
|
}
|
|
5174
5188
|
export {
|
|
5189
|
+
WebStartupError,
|
|
5175
5190
|
startWebServer
|
|
5176
5191
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ToolRegistry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MPCQG7LV.js";
|
|
5
5
|
import "./chunk-6JHACXB3.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-XF2S7LNM.js";
|
|
7
7
|
import "./chunk-RWRZVQCB.js";
|
|
8
8
|
import "./chunk-B3MPYI4E.js";
|
|
9
9
|
import "./chunk-M6HLYG33.js";
|
|
@@ -14,7 +14,7 @@ import "./chunk-JL44HGZC.js";
|
|
|
14
14
|
import "./chunk-3FEZSLGI.js";
|
|
15
15
|
import {
|
|
16
16
|
runTool
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-SS3PG7LP.js";
|
|
18
18
|
import "./chunk-RS7SKYTS.js";
|
|
19
19
|
import {
|
|
20
20
|
getDangerLevel,
|
|
@@ -24,10 +24,10 @@ import "./chunk-TU3L3PW7.js";
|
|
|
24
24
|
import "./chunk-HOSJZMQS.js";
|
|
25
25
|
import "./chunk-BMLQPSHP.js";
|
|
26
26
|
import "./chunk-JJFJWD35.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-DRNRQ6SD.js";
|
|
28
28
|
import {
|
|
29
29
|
VERSION
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-6UDKGZ3D.js";
|
|
31
31
|
import "./chunk-SXIJLSVF.js";
|
|
32
32
|
|
|
33
33
|
// src/mcp/server.ts
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
googleSearchContext,
|
|
5
5
|
isToolCapableProvider,
|
|
6
6
|
truncateOutput
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MPCQG7LV.js";
|
|
8
8
|
import "./chunk-6JHACXB3.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-XF2S7LNM.js";
|
|
10
10
|
import "./chunk-RWRZVQCB.js";
|
|
11
11
|
import "./chunk-B3MPYI4E.js";
|
|
12
12
|
import "./chunk-M6HLYG33.js";
|
|
@@ -17,7 +17,7 @@ import "./chunk-JL44HGZC.js";
|
|
|
17
17
|
import "./chunk-3FEZSLGI.js";
|
|
18
18
|
import {
|
|
19
19
|
runTool
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-SS3PG7LP.js";
|
|
21
21
|
import "./chunk-RS7SKYTS.js";
|
|
22
22
|
import {
|
|
23
23
|
getDangerLevel,
|
|
@@ -29,10 +29,10 @@ import {
|
|
|
29
29
|
atomicWriteFileSync
|
|
30
30
|
} from "./chunk-BMLQPSHP.js";
|
|
31
31
|
import "./chunk-JJFJWD35.js";
|
|
32
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-DRNRQ6SD.js";
|
|
33
33
|
import {
|
|
34
34
|
SUBAGENT_ALLOWED_TOOLS
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-6UDKGZ3D.js";
|
|
36
36
|
import "./chunk-SXIJLSVF.js";
|
|
37
37
|
|
|
38
38
|
// src/hub/task-orchestrator.ts
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
import "./chunk-RS7SKYTS.js";
|
|
10
10
|
import {
|
|
11
11
|
ConfigManager
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-2CNJ25U7.js";
|
|
13
13
|
import "./chunk-TU3L3PW7.js";
|
|
14
14
|
import "./chunk-BMLQPSHP.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-6UDKGZ3D.js";
|
|
16
16
|
|
|
17
17
|
// src/cli/usage.ts
|
|
18
18
|
function classifyRowCost(row) {
|
package/dist/web/client/app.js
CHANGED
|
@@ -2705,6 +2705,7 @@ function showAuthScreen(hasUsers) {
|
|
|
2705
2705
|
screen.classList.remove('hidden');
|
|
2706
2706
|
app.style.display = 'none';
|
|
2707
2707
|
|
|
2708
|
+
authHasUsers = !!hasUsers;
|
|
2708
2709
|
// If no users registered, show register form by default
|
|
2709
2710
|
if (!hasUsers) {
|
|
2710
2711
|
authMode = 'register';
|
|
@@ -2734,10 +2735,18 @@ function updateAuthForm() {
|
|
|
2734
2735
|
|
|
2735
2736
|
errorEl.classList.add('hidden');
|
|
2736
2737
|
|
|
2738
|
+
// Registration is closed server-side once a user exists: say how accounts
|
|
2739
|
+
// are added instead of offering a Register link that always fails with 403.
|
|
2740
|
+
const registrationClosed = authMode === 'login' && authHasUsers;
|
|
2741
|
+
toggle.classList.toggle('hidden', registrationClosed);
|
|
2742
|
+
document.getElementById('auth-closed-hint')?.classList.toggle('hidden', !registrationClosed);
|
|
2737
2743
|
if (authMode === 'register') {
|
|
2738
2744
|
subtitle.textContent = 'Create your account to get started';
|
|
2739
2745
|
submit.textContent = 'Create Account';
|
|
2740
2746
|
toggle.innerHTML = 'Already have an account? <span class="text-primary">Sign In</span>';
|
|
2747
|
+
} else if (registrationClosed) {
|
|
2748
|
+
subtitle.textContent = 'Sign in to continue';
|
|
2749
|
+
submit.textContent = 'Sign In';
|
|
2741
2750
|
} else {
|
|
2742
2751
|
subtitle.textContent = 'Sign in to continue';
|
|
2743
2752
|
submit.textContent = 'Sign In';
|
|
Binary file
|
|
Binary file
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
<button id="auth-toggle" class="btn btn-ghost btn-sm" data-action="toggle-auth-mode" type="button">
|
|
60
60
|
Don't have an account? <span class="text-primary">Register</span>
|
|
61
61
|
</button>
|
|
62
|
+
<p id="auth-closed-hint" class="hidden text-sm opacity-70">New accounts are added on the host:<br><code>aicli user create <name></code></p>
|
|
62
63
|
</div>
|
|
63
64
|
</div>
|
|
64
65
|
</div>
|
|
Binary file
|
|
Binary file
|
package/dist/web/client/state.js
CHANGED
|
@@ -54,6 +54,9 @@ let authToken = '';
|
|
|
54
54
|
try { localStorage.removeItem('aicli-auth-token'); } catch {}
|
|
55
55
|
let authUsername = localStorage.getItem('aicli-auth-user') || '';
|
|
56
56
|
let authMode = 'login'; // 'login' or 'register'
|
|
57
|
+
// Once a user exists the server closes registration (403) — the login form
|
|
58
|
+
// must not offer a Register link it can never honour.
|
|
59
|
+
let authHasUsers = false;
|
|
57
60
|
|
|
58
61
|
// ── Streaming render state ─────────────────────────────────────────
|
|
59
62
|
/** @type {HTMLElement|null} */
|
|
Binary file
|
|
Binary file
|
|
@@ -791,6 +791,9 @@ button, a, .session-item, .file-tree-row, .template-item, .tool-item, .mcp-serve
|
|
|
791
791
|
#btn-think, #btn-plan { font-size: 0.8rem; padding: 0 0.4rem; }
|
|
792
792
|
}
|
|
793
793
|
|
|
794
|
+
/* Brand stays on one line: in a crowded navbar it wrapped to "ai-" / "cli". */
|
|
795
|
+
.brand-text { white-space: nowrap; }
|
|
796
|
+
|
|
794
797
|
/* ── Responsive: Phone ──────────────────────────────── */
|
|
795
798
|
@media (max-width: 640px) {
|
|
796
799
|
/* Navbar: compact layout */
|
|
Binary file
|
|
Binary file
|