jinzd-ai-cli 0.1.97 → 0.1.99
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/{chunk-ZI3JNFJI.js → chunk-IV3LYGTI.js} +1 -8
- package/dist/{chunk-XII3FWIZ.js → chunk-NSDG4SSQ.js} +1 -1
- package/dist/electron-server.js +7723 -0
- package/dist/index.js +4 -4
- package/dist/{run-tests-FU5CQLMA.js → run-tests-3B3RXSVK.js} +1 -1
- package/dist/{server-L6JPEMMK.js → server-QD5KCAGD.js} +36 -33
- package/package.json +43 -2
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
theme,
|
|
36
36
|
truncateOutput,
|
|
37
37
|
undoStack
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-NSDG4SSQ.js";
|
|
39
39
|
import {
|
|
40
40
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
41
41
|
AUTHOR,
|
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
REPO_URL,
|
|
56
56
|
SKILLS_DIR_NAME,
|
|
57
57
|
VERSION
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-IV3LYGTI.js";
|
|
59
59
|
|
|
60
60
|
// src/index.ts
|
|
61
61
|
import { program } from "commander";
|
|
@@ -1904,7 +1904,7 @@ ${hint}` : "")
|
|
|
1904
1904
|
description: "Run project tests and show structured report",
|
|
1905
1905
|
usage: "/test [command|filter]",
|
|
1906
1906
|
async execute(args, _ctx) {
|
|
1907
|
-
const { executeTests } = await import("./run-tests-
|
|
1907
|
+
const { executeTests } = await import("./run-tests-3B3RXSVK.js");
|
|
1908
1908
|
const argStr = args.join(" ").trim();
|
|
1909
1909
|
let testArgs = {};
|
|
1910
1910
|
if (argStr) {
|
|
@@ -5292,7 +5292,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
5292
5292
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
5293
5293
|
process.exit(1);
|
|
5294
5294
|
}
|
|
5295
|
-
const { startWebServer } = await import("./server-
|
|
5295
|
+
const { startWebServer } = await import("./server-QD5KCAGD.js");
|
|
5296
5296
|
await startWebServer({ port, host: options.host });
|
|
5297
5297
|
});
|
|
5298
5298
|
program.command("sessions").description("List recent conversation sessions").action(async () => {
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
setupProxy,
|
|
24
24
|
spawnAgentContext,
|
|
25
25
|
truncateOutput
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-NSDG4SSQ.js";
|
|
27
27
|
import {
|
|
28
28
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
29
29
|
CONTEXT_FILE_CANDIDATES,
|
|
@@ -34,9 +34,8 @@ import {
|
|
|
34
34
|
PLAN_MODE_READONLY_TOOLS,
|
|
35
35
|
PLAN_MODE_SYSTEM_ADDON,
|
|
36
36
|
SKILLS_DIR_NAME,
|
|
37
|
-
VERSION
|
|
38
|
-
|
|
39
|
-
} from "./chunk-ZI3JNFJI.js";
|
|
37
|
+
VERSION
|
|
38
|
+
} from "./chunk-IV3LYGTI.js";
|
|
40
39
|
|
|
41
40
|
// src/web/server.ts
|
|
42
41
|
import express from "express";
|
|
@@ -44,6 +43,7 @@ import { createServer } from "http";
|
|
|
44
43
|
import { WebSocketServer } from "ws";
|
|
45
44
|
import { join as join3, dirname, resolve as resolve2, relative } from "path";
|
|
46
45
|
import { existsSync as existsSync4, readFileSync as readFileSync4, readdirSync, statSync } from "fs";
|
|
46
|
+
import { networkInterfaces } from "os";
|
|
47
47
|
|
|
48
48
|
// src/web/tool-executor-web.ts
|
|
49
49
|
import { randomUUID } from "crypto";
|
|
@@ -1559,41 +1559,43 @@ async function startWebServer(options = {}) {
|
|
|
1559
1559
|
});
|
|
1560
1560
|
const MAX_PORT_ATTEMPTS = 10;
|
|
1561
1561
|
let actualPort = port;
|
|
1562
|
-
const
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1562
|
+
const result = await new Promise((resolve3, reject) => {
|
|
1563
|
+
const tryListen = (attempt) => {
|
|
1564
|
+
server.once("error", (err) => {
|
|
1565
|
+
if (err.code === "EADDRINUSE" && attempt < MAX_PORT_ATTEMPTS) {
|
|
1566
|
+
actualPort++;
|
|
1567
|
+
console.log(` \u26A0 Port ${actualPort - 1} in use, trying ${actualPort}...`);
|
|
1568
|
+
server.close(() => tryListen(attempt + 1));
|
|
1569
|
+
} else {
|
|
1570
|
+
reject(err);
|
|
1571
|
+
}
|
|
1572
|
+
});
|
|
1573
|
+
server.listen(actualPort, host, () => {
|
|
1574
|
+
const url = `http://${host === "0.0.0.0" ? "localhost" : host}:${actualPort}`;
|
|
1575
|
+
console.log(`
|
|
1566
1576
|
\u{1F310} Web UI ready: ${url}`);
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1577
|
+
if (actualPort !== port) console.log(` (port ${port} was in use, using ${actualPort})`);
|
|
1578
|
+
if (host === "0.0.0.0" || host === "::") {
|
|
1579
|
+
try {
|
|
1580
|
+
const nets = networkInterfaces();
|
|
1581
|
+
for (const name of Object.keys(nets)) {
|
|
1582
|
+
for (const net of nets[name] ?? []) {
|
|
1583
|
+
if (net.family === "IPv4" && !net.internal) {
|
|
1584
|
+
console.log(` \u{1F4F1} LAN access: http://${net.address}:${actualPort}`);
|
|
1585
|
+
}
|
|
1575
1586
|
}
|
|
1576
1587
|
}
|
|
1588
|
+
} catch {
|
|
1577
1589
|
}
|
|
1578
|
-
} catch {
|
|
1579
1590
|
}
|
|
1580
|
-
|
|
1581
|
-
console.log(` Press Ctrl+C to stop
|
|
1591
|
+
console.log(` Press Ctrl+C to stop
|
|
1582
1592
|
`);
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
tryListen(attempt + 1);
|
|
1590
|
-
} else {
|
|
1591
|
-
console.error(` \u274C Failed to start server: ${err.message}`);
|
|
1592
|
-
process.exit(1);
|
|
1593
|
-
}
|
|
1594
|
-
});
|
|
1595
|
-
};
|
|
1596
|
-
tryListen(1);
|
|
1593
|
+
resolve3({ port: actualPort, host, url });
|
|
1594
|
+
});
|
|
1595
|
+
};
|
|
1596
|
+
tryListen(1);
|
|
1597
|
+
});
|
|
1598
|
+
if (!options._skipBrowserOpen) openBrowser(result.url);
|
|
1597
1599
|
process.on("SIGINT", () => {
|
|
1598
1600
|
console.log("\n Shutting down...");
|
|
1599
1601
|
for (const handler of handlers.values()) handler.onDisconnect();
|
|
@@ -1602,6 +1604,7 @@ async function startWebServer(options = {}) {
|
|
|
1602
1604
|
server.close();
|
|
1603
1605
|
process.exit(0);
|
|
1604
1606
|
});
|
|
1607
|
+
return result;
|
|
1605
1608
|
}
|
|
1606
1609
|
function loadProjectMcpConfig() {
|
|
1607
1610
|
const cwd = process.cwd();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jinzd-ai-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.99",
|
|
4
4
|
"description": "Cross-platform REPL-style AI CLI with multi-provider support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,7 +28,13 @@
|
|
|
28
28
|
"pack:mac": "npm run build && npm run patch && npx pkg dist-cjs/index.cjs --target node22-macos-arm64 --output release/ai-cli-mac --compress GZip --options no-deprecation",
|
|
29
29
|
"pack:mac-x64": "npm run build && npm run patch && npx pkg dist-cjs/index.cjs --target node22-macos-x64 --output release/ai-cli-mac-x64 --compress GZip --options no-deprecation",
|
|
30
30
|
"pack:linux": "npm run build && npm run patch && npx pkg dist-cjs/index.cjs --target node22-linux-x64 --output release/ai-cli-linux --compress GZip --options no-deprecation",
|
|
31
|
-
"pack:all": "npm run build && npm run patch && npx pkg dist-cjs/index.cjs --target node22-win-x64,node22-macos-arm64,node22-linux-x64 --out-path release --compress GZip --options no-deprecation"
|
|
31
|
+
"pack:all": "npm run build && npm run patch && npx pkg dist-cjs/index.cjs --target node22-win-x64,node22-macos-arm64,node22-linux-x64 --out-path release --compress GZip --options no-deprecation",
|
|
32
|
+
"electron": "npm run build && electron electron/main.cjs",
|
|
33
|
+
"electron:dev": "electron electron/main.cjs",
|
|
34
|
+
"electron:build-win": "npm run build && electron-builder --win",
|
|
35
|
+
"electron:build-mac": "npm run build && electron-builder --mac",
|
|
36
|
+
"electron:build-linux": "npm run build && electron-builder --linux",
|
|
37
|
+
"electron:build-all": "npm run build && electron-builder --win --mac --linux"
|
|
32
38
|
},
|
|
33
39
|
"pkg": {
|
|
34
40
|
"scripts": "dist-cjs/index.cjs",
|
|
@@ -92,9 +98,44 @@
|
|
|
92
98
|
"@types/node": "^22.10.0",
|
|
93
99
|
"@types/uuid": "^10.0.0",
|
|
94
100
|
"@yao-pkg/pkg": "^6.14.0",
|
|
101
|
+
"electron": "^35.0.0",
|
|
102
|
+
"electron-builder": "^26.0.0",
|
|
95
103
|
"tsup": "^8.3.5",
|
|
96
104
|
"tsx": "^4.19.2",
|
|
97
105
|
"typescript": "^5.7.3",
|
|
98
106
|
"vitest": "^2.1.8"
|
|
107
|
+
},
|
|
108
|
+
"build": {
|
|
109
|
+
"appId": "com.jinzd.ai-cli",
|
|
110
|
+
"productName": "ai-cli",
|
|
111
|
+
"electronMain": "electron/main.cjs",
|
|
112
|
+
"artifactName": "ai-cli-${os}-${arch}.${ext}",
|
|
113
|
+
"files": [
|
|
114
|
+
"dist/**/*",
|
|
115
|
+
"dist-cjs/**/*",
|
|
116
|
+
"electron/**/*.cjs",
|
|
117
|
+
"!dist-cjs/index.cjs"
|
|
118
|
+
],
|
|
119
|
+
"extraResources": [
|
|
120
|
+
{ "from": "dist/web/client", "to": "web-client" }
|
|
121
|
+
],
|
|
122
|
+
"win": {
|
|
123
|
+
"target": ["nsis", "portable"],
|
|
124
|
+
"icon": "src/web/client/icon-512.png"
|
|
125
|
+
},
|
|
126
|
+
"mac": {
|
|
127
|
+
"target": ["dmg", "zip"],
|
|
128
|
+
"category": "public.app-category.developer-tools",
|
|
129
|
+
"icon": "src/web/client/icon-512.png"
|
|
130
|
+
},
|
|
131
|
+
"linux": {
|
|
132
|
+
"target": ["AppImage", "deb"],
|
|
133
|
+
"icon": "src/web/client/icon-512.png",
|
|
134
|
+
"category": "Development"
|
|
135
|
+
},
|
|
136
|
+
"nsis": {
|
|
137
|
+
"oneClick": false,
|
|
138
|
+
"allowToChangeInstallationDirectory": true
|
|
139
|
+
}
|
|
99
140
|
}
|
|
100
141
|
}
|