zen-code 4.1.0 → 4.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.
@@ -1,6 +1,6 @@
1
- import { r as P, u as d, s as _ } from "./graphBuilder-BSX1uOgk.mjs";
1
+ import { t as P, u as d, v as _ } from "./graphBuilder-B3T9KyfH.mjs";
2
2
  var v, m, g = 0, O = 0;
3
- function s(r, e, n) {
3
+ function h(r, e, n) {
4
4
  var f = 0, t = e || new Array(16);
5
5
  r = r || {};
6
6
  var i = r.node, a = r.clockseq;
@@ -20,7 +20,7 @@ function s(r, e, n) {
20
20
  t[f + b] = i[b];
21
21
  return e || d(t);
22
22
  }
23
- function h(r) {
23
+ function s(r) {
24
24
  var e = typeof r == "string" ? _(r) : r, n = S(e);
25
25
  return typeof r == "string" ? d(n) : n;
26
26
  }
@@ -66,10 +66,10 @@ function q(r, e) {
66
66
  return (e === "string" ? String : Number)(r);
67
67
  }
68
68
  function E(r = {}, e, n = 0) {
69
- var f = s(w(w({}, r), {}, {
69
+ var f = h(w(w({}, r), {}, {
70
70
  _v6: !0
71
71
  }), new Uint8Array(16));
72
- return f = h(f), d(f);
72
+ return f = s(f), d(f);
73
73
  }
74
74
  function A(r) {
75
75
  return E({ clockseq: r });
@@ -1,5 +1,5 @@
1
- import { S as n } from "./graphBuilder-BSX1uOgk.mjs";
2
- import { n as b, f as j, k as T, A as v, m as R, l as L, B as A, o as x, d as $, i as C, e as _, M as I, P as E, j as U, b as z, h as F, T as W, q as K, p as Y } from "./graphBuilder-BSX1uOgk.mjs";
1
+ import { S as n } from "./graphBuilder-B3T9KyfH.mjs";
2
+ import { p as b, h as j, m as T, A as v, o as R, n as L, B as A, q as x, e as $, k as C, f as _, M as I, P as E, l as U, d as z, j as F, T as W, s as K, r as Y } from "./graphBuilder-B3T9KyfH.mjs";
3
3
  import r from "node:fs/promises";
4
4
  import { join as p } from "node:path";
5
5
  import { l as d } from "./load-Cjl9cJ0o.mjs";
@@ -1,6 +1,6 @@
1
- import { u as C } from "./id-CW5jldpA.mjs";
2
- import { B as v, c as x, T as $, m as I } from "./app-C-NaCZSh.mjs";
3
- import "./graphBuilder-BSX1uOgk.mjs";
1
+ import { u as C } from "./id-DAEnqc1v.mjs";
2
+ import { B as v, c as x, T as $, m as I } from "./app-DWJrZDvr.mjs";
3
+ import "./graphBuilder-B3T9KyfH.mjs";
4
4
  import { createClient as O, createCluster as N } from "redis";
5
5
  const W = [
6
6
  {
@@ -1,5 +1,5 @@
1
1
  import { l } from "./load-Bh8eo6qE.mjs";
2
- import { S as h } from "./graphBuilder-BSX1uOgk.mjs";
2
+ import { S as h } from "./graphBuilder-B3T9KyfH.mjs";
3
3
  const M = `## Memory System
4
4
 
5
5
  你可以访问一个包含之前任务和经验知识的记忆库。
@@ -1,45 +1,44 @@
1
1
  import { HumanMessage as c } from "langchain";
2
- import { g as m } from "./graphBuilder-BSX1uOgk.mjs";
2
+ import { i as d, g as m, a as p } from "./graphBuilder-B3T9KyfH.mjs";
3
3
  import "@langchain/langgraph";
4
4
  import "zod";
5
5
  import "@langchain/openai";
6
6
  import "@langchain/anthropic";
7
7
  import "yaml";
8
8
  import "micromatch";
9
- import { initDb as d, getConfig as p } from "./index-DFARkGOA.mjs";
10
9
  import "lowdb";
11
10
  import "lowdb/node";
12
11
  async function l() {
13
12
  return new Promise((t, n) => {
14
- let e = "";
15
- process.stdin.setEncoding("utf8"), process.stdin.on("data", (r) => {
16
- e += r;
13
+ let r = "";
14
+ process.stdin.setEncoding("utf8"), process.stdin.on("data", (e) => {
15
+ r += e;
17
16
  }), process.stdin.on("end", () => {
18
- t(e);
19
- }), process.stdin.on("error", (r) => {
20
- n(r);
17
+ t(r);
18
+ }), process.stdin.on("error", (e) => {
19
+ n(e);
21
20
  });
22
21
  });
23
22
  }
24
- async function C(t, n = !1) {
23
+ async function x(t, n = !1) {
25
24
  await d();
26
- const e = await p();
27
- let r = t || "";
25
+ const r = await m();
26
+ let e = t || "";
28
27
  if (n)
29
28
  try {
30
- r = (await l()).trim();
29
+ e = (await l()).trim();
31
30
  } catch (o) {
32
31
  throw console.error("❌ 读取 stdin 失败:", o), o;
33
32
  }
34
- r || (console.error("❌ 错误: 未提供输入内容"), console.error(`
33
+ e || (console.error("❌ 错误: 未提供输入内容"), console.error(`
35
34
  用法:`), console.error(' zen-code -p "你的任务描述"'), console.error(' echo "内容" | zen-code'), process.exit(1));
36
35
  try {
37
36
  const o = {
38
- messages: [new c(r)],
39
- provider_id: e.provider_id,
40
- model_id: e.model_id,
41
- enable_thinking: e.enable_thinking
42
- }, i = await m.invoke(o, {
37
+ messages: [new c(e)],
38
+ provider_id: r.provider_id,
39
+ model_id: r.model_id,
40
+ enable_thinking: r.enable_thinking
41
+ }, i = await p.invoke(o, {
43
42
  recursionLimit: 500
44
43
  }), s = i.messages || [], a = s[s.length - 1];
45
44
  return a && console.log(a.text), i;
@@ -50,5 +49,5 @@ async function C(t, n = !1) {
50
49
  }
51
50
  }
52
51
  export {
53
- C as runNonInteractive
52
+ x as runNonInteractive
54
53
  };
@@ -1,4 +1,4 @@
1
- import { a as h, C as u } from "./app-C-NaCZSh.mjs";
1
+ import { a as h, C as u } from "./app-DWJrZDvr.mjs";
2
2
  import { createClient as c } from "redis";
3
3
  class n extends h {
4
4
  constructor(s, e = !0, i = 300) {
@@ -1,6 +1,6 @@
1
- import { u as $ } from "./id-CW5jldpA.mjs";
2
- import { B as g } from "./app-C-NaCZSh.mjs";
3
- import "./graphBuilder-BSX1uOgk.mjs";
1
+ import { u as $ } from "./id-DAEnqc1v.mjs";
2
+ import { B as g } from "./app-DWJrZDvr.mjs";
3
+ import "./graphBuilder-B3T9KyfH.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);
@@ -1,7 +1,7 @@
1
1
  import { tool as p, HumanMessage as d, SystemMessage as m } from "langchain";
2
2
  import { Command as f, Annotation as b } from "@langchain/langgraph";
3
3
  import { z as i } from "zod";
4
- import { c as w, a as y } from "./graphBuilder-BSX1uOgk.mjs";
4
+ import { c as w, b as y } from "./graphBuilder-B3T9KyfH.mjs";
5
5
  import "@langchain/openai";
6
6
  const k = i.object({
7
7
  task_store: i.record(i.string(), i.any()).default({})
@@ -1,5 +1,5 @@
1
1
  import "micromatch";
2
- import "./index-DFARkGOA.mjs";
2
+ import "./graphBuilder-B3T9KyfH.mjs";
3
3
  import { Low as n } from "lowdb";
4
4
  import { JSONFile as d } from "lowdb/node";
5
5
  import "yaml";
package/dist/zen-code.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import "./MultiLineTextInput-DjNvaZzA.mjs";
1
+ import "./MultiLineTextInput-e7hD79Wp.mjs";
2
2
  import "chalk";
3
- import "./app-C-NaCZSh.mjs";
3
+ import "./app-DWJrZDvr.mjs";