zen-code 2.1.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.
@@ -1,6 +1,7 @@
1
1
  import { K as T } from "./kysely-Bchvsze0.mjs";
2
2
  import { F as r } from "./sql-CJsUpKEQ.mjs";
3
- import { B as f, T as l, c as y, m } from "./app-CdJSgzzZ.mjs";
3
+ import { B as f, T as l, c as y, m } from "./app-DSomQ6O6.mjs";
4
+ import "./graph-DDkv1rqg.mjs";
4
5
  const g = ["source", "step", "parents"];
5
6
  const E = g;
6
7
  class w extends f {
@@ -1,4 +1,5 @@
1
- import { T as l, B as N, W as k, m as y } from "./app-CdJSgzzZ.mjs";
1
+ import { T as l, B as N, W as k, m as y } from "./app-DSomQ6O6.mjs";
2
+ import "./graph-DDkv1rqg.mjs";
2
3
  import w from "pg";
3
4
  const S = (h) => [
4
5
  "checkpoints",
@@ -384,10 +385,10 @@ var $ = class L extends N {
384
385
  }
385
386
  }
386
387
  };
387
- const A = async () => {
388
+ const R = async () => {
388
389
  const h = $.fromConnString(process.env.DATABASE_URL);
389
390
  return process.env.DATABASE_INIT === "true" && (console.debug("LG | Initializing postgres checkpoint"), await h.setup()), h;
390
391
  };
391
392
  export {
392
- A as createPGCheckpoint
393
+ R as createPGCheckpoint
393
394
  };
package/dist/cli.mjs ADDED
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+ const t = process.argv.slice(2);
3
+ async function o() {
4
+ const s = t.indexOf("--yolo");
5
+ if (s !== -1 && (process.env.YOLO_MODE = "true", t.splice(s, 1)), t[0] === "init")
6
+ import("./zen-init.mjs");
7
+ else if (t[0] === "keyboard")
8
+ import("./zen-keyboard.mjs");
9
+ else if (t[0] === "-p" || t[0] === "--prompt") {
10
+ const e = t.slice(1).join(" "), { runNonInteractive: i } = await import("./nonInteractive.mjs");
11
+ await i(e, !1);
12
+ } else if (await r()) {
13
+ const { runNonInteractive: i } = await import("./nonInteractive.mjs");
14
+ await i(void 0, !0);
15
+ } else
16
+ await import("./zen-code.mjs");
17
+ }
18
+ async function r() {
19
+ return new Promise((s) => {
20
+ if (process.stdin.isTTY) {
21
+ s(!1);
22
+ return;
23
+ }
24
+ const i = process.stdin.read();
25
+ i ? (process.stdin.unshift(i), s(!0)) : setTimeout(() => {
26
+ const n = process.stdin.read();
27
+ n ? (process.stdin.unshift(n), s(!0)) : s(!1);
28
+ }, 100);
29
+ });
30
+ }
31
+ o().catch((s) => {
32
+ console.error("❌ 执行失败:", s), process.exit(1);
33
+ });