zen-code 2.2.0 → 2.3.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 → MultiSelect-DZAUJ6V8.mjs} +1 -1
- package/dist/{app-DSomQ6O6.mjs → app-C0lXPfzi.mjs} +3079 -2477
- package/dist/{checkpoint-1sAx_j1E-DxhHzrFo.mjs → checkpoint-1sAx_j1E-CeuO6wLL.mjs} +2 -2
- package/dist/{checkpoint-DxiUsHMy-DQXGrxXE.mjs → checkpoint-DxiUsHMy-D5StF4Dg.mjs} +2 -2
- package/dist/{devtools-BxIzBVXg.mjs → devtools-DpL9Fl6d.mjs} +658 -649
- package/dist/{graph-DDkv1rqg.mjs → graph-aTwGGPhX.mjs} +6852 -6365
- package/dist/{id-CzaxLw8O.mjs → id-D-r9rdKn.mjs} +1 -1
- package/dist/{index-C1CZncrT.mjs → index-DgogF6Ub.mjs} +3 -3
- package/dist/index-DpsJ-2by.mjs +23 -0
- package/dist/nonInteractive.mjs +2 -2
- package/dist/{queue-BSCnCent-CSGRBLST.mjs → queue-D6tEGCGs-CEAj3iiS.mjs} +21 -15
- package/dist/{shallow-DwTxKmlC.mjs → shallow-Cg7nKycD.mjs} +3 -3
- package/dist/{use-input-CQELhJxU.mjs → use-input-1eSjZocJ.mjs} +751 -748
- package/dist/zen-code.mjs +2 -2
- package/dist/zen-init.mjs +3 -3
- package/dist/zen-keyboard.mjs +1 -1
- package/package.json +12 -12
- package/dist/index-B5v_6qaq.mjs +0 -22
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { u as C } from "./id-
|
|
2
|
-
import { B as v, c as x, T as $, m as I } from "./app-
|
|
3
|
-
import "./graph-
|
|
1
|
+
import { u as C } from "./id-D-r9rdKn.mjs";
|
|
2
|
+
import { B as v, c as x, T as $, m as I } from "./app-C0lXPfzi.mjs";
|
|
3
|
+
import "./graph-aTwGGPhX.mjs";
|
|
4
4
|
import { createClient as O, createCluster as N } from "redis";
|
|
5
5
|
const W = [
|
|
6
6
|
{
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Low as s } from "lowdb";
|
|
2
|
+
import { JSONFile as c } from "lowdb/node";
|
|
3
|
+
import d from "node:os";
|
|
4
|
+
import i from "node:path";
|
|
5
|
+
import e from "node:fs";
|
|
6
|
+
const n = {
|
|
7
|
+
config: {
|
|
8
|
+
main_model: "claude-sonnet-4-5",
|
|
9
|
+
model_provider: "openai"
|
|
10
|
+
}
|
|
11
|
+
}, f = d.homedir(), o = i.join(f, ".zen-code"), _ = i.join(o, "settings.json"), p = new c(_), a = new s(p, n), w = async () => {
|
|
12
|
+
await e.promises.mkdir(o, { recursive: !0 }), await a.read(), (!a.data || !a.data.config) && (a.data = n, await a.write()), t();
|
|
13
|
+
}, E = () => a.data.config, t = () => {
|
|
14
|
+
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);
|
|
15
|
+
}, b = async (r) => {
|
|
16
|
+
await e.promises.mkdir(o, { recursive: !0 }), Object.assign(a.data.config, r), await a.write(), t();
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
_ as d,
|
|
20
|
+
E as g,
|
|
21
|
+
w as i,
|
|
22
|
+
b as u
|
|
23
|
+
};
|
package/dist/nonInteractive.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HumanMessage as c } from "langchain";
|
|
2
|
-
import { g as l } from "./graph-
|
|
3
|
-
import { i as m, g } from "./index-
|
|
2
|
+
import { g as l } from "./graph-aTwGGPhX.mjs";
|
|
3
|
+
import { i as m, g } from "./index-DpsJ-2by.mjs";
|
|
4
4
|
async function d() {
|
|
5
5
|
return new Promise((r, t) => {
|
|
6
6
|
let o = "";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { createClient as
|
|
3
|
-
class
|
|
1
|
+
import { a as h, C as u } from "./app-C0lXPfzi.mjs";
|
|
2
|
+
import { createClient as c } from "redis";
|
|
3
|
+
class n extends h {
|
|
4
4
|
constructor(s, e = !0, i = 300) {
|
|
5
|
-
super(s, !0, i), this.id = s, this.compressMessages = e, this.ttl = i, this.queueKey = `queue:${this.id}`, this.channelKey = `channel:${this.id}`, this.redis =
|
|
5
|
+
super(s, !0, i), this.id = s, this.compressMessages = e, this.ttl = i, this.queueKey = `queue:${this.id}`, this.channelKey = `channel:${this.id}`, this.redis = n.redis, this.subscriberRedis = n.subscriberRedis, this.cancelSignal = new AbortController(), this.redis.isOpen || this.redis.connect(), this.subscriberRedis.isOpen || this.subscriberRedis.connect(), this.isConnected = !0;
|
|
6
6
|
}
|
|
7
|
-
static redis =
|
|
8
|
-
static subscriberRedis =
|
|
7
|
+
static redis = c({ url: process.env.REDIS_URL });
|
|
8
|
+
static subscriberRedis = c({ url: process.env.REDIS_URL });
|
|
9
9
|
static isQueueExist(s) {
|
|
10
10
|
return this.redis.exists(`queue:${s}`).then((e) => e > 0);
|
|
11
11
|
}
|
|
@@ -27,17 +27,23 @@ class r extends u {
|
|
|
27
27
|
*/
|
|
28
28
|
async *onDataReceive() {
|
|
29
29
|
let s = [], e = null, i = !1;
|
|
30
|
-
|
|
30
|
+
if (this.cancelSignal.signal.aborted)
|
|
31
|
+
return;
|
|
32
|
+
const l = async (t) => {
|
|
31
33
|
const a = await this.decodeData(t);
|
|
32
34
|
s.push(a), (a.event === "__stream_end__" || a.event === "__stream_error__" || a.event === "__stream_cancel__") && (setTimeout(() => {
|
|
33
35
|
i = !0, e && (e(), e = null);
|
|
34
|
-
}, 300), a.event === "__stream_cancel__" && this.cancel()), e && (e(), e = null);
|
|
36
|
+
}, 300), a.event === "__stream_cancel__" && await this.cancel()), e && (e(), e = null);
|
|
35
37
|
};
|
|
36
38
|
await this.subscriberRedis.subscribe(this.channelKey, (t) => {
|
|
37
|
-
|
|
39
|
+
l(t);
|
|
38
40
|
});
|
|
41
|
+
const r = () => {
|
|
42
|
+
i = !0, e && (e(), e = null);
|
|
43
|
+
};
|
|
44
|
+
this.cancelSignal.signal.addEventListener("abort", r);
|
|
39
45
|
try {
|
|
40
|
-
for (; !i; )
|
|
46
|
+
for (; !i && !this.cancelSignal.signal.aborted; )
|
|
41
47
|
if (s.length > 0) {
|
|
42
48
|
for (const t of s)
|
|
43
49
|
yield t;
|
|
@@ -47,7 +53,7 @@ class r extends u {
|
|
|
47
53
|
e = t;
|
|
48
54
|
});
|
|
49
55
|
} finally {
|
|
50
|
-
await this.subscriberRedis.unsubscribe(this.channelKey);
|
|
56
|
+
await this.subscriberRedis.unsubscribe(this.channelKey), this.cancelSignal.signal.removeEventListener("abort", r);
|
|
51
57
|
}
|
|
52
58
|
}
|
|
53
59
|
/**
|
|
@@ -68,14 +74,14 @@ class r extends u {
|
|
|
68
74
|
/**
|
|
69
75
|
* 取消操作
|
|
70
76
|
*/
|
|
71
|
-
cancel() {
|
|
72
|
-
this.
|
|
77
|
+
async cancel() {
|
|
78
|
+
this.cancelSignal.abort("user cancel this run"), await this.push(new u());
|
|
73
79
|
}
|
|
74
80
|
async copyToQueue(s, e) {
|
|
75
|
-
const i = new
|
|
81
|
+
const i = new n(s, this.compressMessages, e ?? this.ttl);
|
|
76
82
|
return await this.redis.copy(this.queueKey, i.queueKey), await this.redis.expire(i.queueKey, e ?? this.ttl), i;
|
|
77
83
|
}
|
|
78
84
|
}
|
|
79
85
|
export {
|
|
80
|
-
|
|
86
|
+
n as RedisStreamQueue
|
|
81
87
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { u as $ } from "./id-
|
|
2
|
-
import { B as g } from "./app-
|
|
3
|
-
import "./graph-
|
|
1
|
+
import { u as $ } from "./id-D-r9rdKn.mjs";
|
|
2
|
+
import { B as g } from "./app-C0lXPfzi.mjs";
|
|
3
|
+
import "./graph-aTwGGPhX.mjs";
|
|
4
4
|
import { createClient as T } from "redis";
|
|
5
5
|
function k(u) {
|
|
6
6
|
if (u === null || typeof u != "object") return JSON.stringify(u);
|