zen-code 2.0.0 → 2.2.0
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/MultiSelect-DPUY1M3X.mjs +651 -0
- package/dist/{_commonjsHelpers-DQNKXVTB.mjs → _commonjsHelpers-ByX85dGu.mjs} +2 -2
- package/dist/app-DSomQ6O6.mjs +9425 -0
- package/dist/{checkpoint-1sAx_j1E-C7vuWMYk.mjs → checkpoint-1sAx_j1E-DxhHzrFo.mjs} +2 -1
- package/dist/{checkpoint-DxiUsHMy-BAS0QTsO.mjs → checkpoint-DxiUsHMy-DQXGrxXE.mjs} +4 -3
- package/dist/cli.mjs +33 -0
- package/dist/{devtools-m8Lnvjy_.mjs → devtools-BxIzBVXg.mjs} +1 -1
- package/dist/{app-BYHr8LGb.mjs → graph-DDkv1rqg.mjs} +21511 -31014
- package/dist/{id-D9MvPv5H.mjs → id-CzaxLw8O.mjs} +1 -1
- package/dist/index-B5v_6qaq.mjs +22 -0
- package/dist/{index-CUBPsTPx.mjs → index-C1CZncrT.mjs} +5 -4
- package/dist/nonInteractive.mjs +45 -0
- package/dist/{queue-BSCnCent-Ct_0uFlj.mjs → queue-BSCnCent-CSGRBLST.mjs} +1 -1
- package/dist/{shallow-CZp172oK.mjs → shallow-DwTxKmlC.mjs} +5 -4
- package/dist/{MultiSelect-CZS5qXWj.mjs → use-input-CQELhJxU.mjs} +10200 -10340
- package/dist/zen-code.mjs +2 -2
- package/dist/zen-init.mjs +45 -43
- package/dist/zen-keyboard.mjs +13 -0
- package/package.json +5 -6
- package/cli.js +0 -8
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Low as e } from "lowdb";
|
|
2
|
+
import { JSONFile as t } from "lowdb/node";
|
|
3
|
+
import c from "node:os";
|
|
4
|
+
import r from "node:path";
|
|
5
|
+
const o = {
|
|
6
|
+
config: {
|
|
7
|
+
main_model: "claude-sonnet-4-5",
|
|
8
|
+
model_provider: "openai"
|
|
9
|
+
}
|
|
10
|
+
}, s = c.homedir(), d = r.join(s, ".code-graph.json"), _ = new t(d), a = new e(_, o), l = async () => {
|
|
11
|
+
await a.read(), (!a.data || !a.data.config) && (a.data = o, await a.write()), i();
|
|
12
|
+
}, u = () => a.data.config, i = () => {
|
|
13
|
+
a.data.config.model_provider && (process.env.MODEL_PROVIDER = a.data.config.model_provider), a.data.config.openai_api_key && (process.env.OPENAI_API_KEY = a.data.config.openai_api_key), a.data.config.openai_base_url && (process.env.OPENAI_BASE_URL = a.data.config.openai_base_url), a.data.config.anthropic_api_key && (process.env.ANTHROPIC_API_KEY = a.data.config.anthropic_api_key), a.data.config.anthropic_base_url && (process.env.ANTHROPIC_BASE_URL = a.data.config.anthropic_base_url);
|
|
14
|
+
}, v = async (n) => {
|
|
15
|
+
Object.assign(a.data.config, n), await a.write(), i();
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
d,
|
|
19
|
+
u as g,
|
|
20
|
+
l as i,
|
|
21
|
+
v as u
|
|
22
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { u as C } from "./id-
|
|
2
|
-
import { B as v, c as x, T as $, m as I } from "./app-
|
|
1
|
+
import { u as C } from "./id-CzaxLw8O.mjs";
|
|
2
|
+
import { B as v, c as x, T as $, m as I } from "./app-DSomQ6O6.mjs";
|
|
3
|
+
import "./graph-DDkv1rqg.mjs";
|
|
3
4
|
import { createClient as O, createCluster as N } from "redis";
|
|
4
5
|
const W = [
|
|
5
6
|
{
|
|
@@ -105,7 +106,7 @@ const W = [
|
|
|
105
106
|
}
|
|
106
107
|
}
|
|
107
108
|
];
|
|
108
|
-
var
|
|
109
|
+
var L = class m extends v {
|
|
109
110
|
client;
|
|
110
111
|
ttlConfig;
|
|
111
112
|
constructor(e, t) {
|
|
@@ -459,5 +460,5 @@ function g(w) {
|
|
|
459
460
|
});
|
|
460
461
|
}
|
|
461
462
|
export {
|
|
462
|
-
|
|
463
|
+
L as RedisSaver
|
|
463
464
|
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { HumanMessage as c } from "langchain";
|
|
2
|
+
import { g as l } from "./graph-DDkv1rqg.mjs";
|
|
3
|
+
import { i as m, g } from "./index-B5v_6qaq.mjs";
|
|
4
|
+
async function d() {
|
|
5
|
+
return new Promise((r, t) => {
|
|
6
|
+
let o = "";
|
|
7
|
+
process.stdin.setEncoding("utf8"), process.stdin.on("data", (n) => {
|
|
8
|
+
o += n;
|
|
9
|
+
}), process.stdin.on("end", () => {
|
|
10
|
+
r(o);
|
|
11
|
+
}), process.stdin.on("error", (n) => {
|
|
12
|
+
t(n);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
async function u(r, t = !1) {
|
|
17
|
+
await m();
|
|
18
|
+
const o = g();
|
|
19
|
+
let n = r || "";
|
|
20
|
+
if (t)
|
|
21
|
+
try {
|
|
22
|
+
n = (await d()).trim();
|
|
23
|
+
} catch (e) {
|
|
24
|
+
throw console.error("❌ 读取 stdin 失败:", e), e;
|
|
25
|
+
}
|
|
26
|
+
n || (console.error("❌ 错误: 未提供输入内容"), console.error(`
|
|
27
|
+
用法:`), console.error(' zen-code -p "你的任务描述"'), console.error(' echo "内容" | zen-code'), process.exit(1));
|
|
28
|
+
try {
|
|
29
|
+
const e = {
|
|
30
|
+
messages: [new c(n)],
|
|
31
|
+
main_model: o.main_model,
|
|
32
|
+
enable_thinking: o.enable_thinking
|
|
33
|
+
}, s = await l.invoke(e, {
|
|
34
|
+
recursionLimit: 200
|
|
35
|
+
}), i = s.messages || [], a = i[i.length - 1];
|
|
36
|
+
return a && console.log(a.text), s;
|
|
37
|
+
} catch (e) {
|
|
38
|
+
throw console.error(`
|
|
39
|
+
❌ 执行失败: ${e instanceof Error ? e.message : String(e)}
|
|
40
|
+
`), e;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
u as runNonInteractive
|
|
45
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { u as $ } from "./id-
|
|
2
|
-
import { B as g } from "./app-
|
|
1
|
+
import { u as $ } from "./id-CzaxLw8O.mjs";
|
|
2
|
+
import { B as g } from "./app-DSomQ6O6.mjs";
|
|
3
|
+
import "./graph-DDkv1rqg.mjs";
|
|
3
4
|
import { createClient as T } from "redis";
|
|
4
5
|
function k(u) {
|
|
5
6
|
if (u === null || typeof u != "object") return JSON.stringify(u);
|
|
@@ -86,7 +87,7 @@ const S = [{
|
|
|
86
87
|
}
|
|
87
88
|
}
|
|
88
89
|
}];
|
|
89
|
-
var
|
|
90
|
+
var O = class w extends g {
|
|
90
91
|
client;
|
|
91
92
|
ttlConfig;
|
|
92
93
|
constructor(t, e) {
|
|
@@ -327,5 +328,5 @@ var C = class w extends g {
|
|
|
327
328
|
}
|
|
328
329
|
};
|
|
329
330
|
export {
|
|
330
|
-
|
|
331
|
+
O as ShallowRedisSaver
|
|
331
332
|
};
|