@tyvm/knowhow 0.0.73 → 0.0.75

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/bin/knowhow.js ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from "node:child_process";
3
+ import path from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+
6
+ const __filename = fileURLToPath(import.meta.url);
7
+ const __dirname = path.dirname(__filename);
8
+
9
+ // avoid infinite recursion
10
+ if (!process.env.KNOWHOW_REEXEC_NO_SNAPSHOT) {
11
+ const nodeArgs = process.execArgv ?? [];
12
+ const hasFlag = nodeArgs.includes("--no-node-snapshot");
13
+
14
+ if (!hasFlag) {
15
+ const cliEntrypoint = path.join(__dirname, "../ts_build/src/cli.js"); // adjust to your real entry
16
+ const r = spawnSync(
17
+ process.execPath,
18
+ ["--no-node-snapshot", cliEntrypoint, ...process.argv.slice(2)],
19
+ {
20
+ stdio: "inherit",
21
+ env: { ...process.env, KNOWHOW_REEXEC_NO_SNAPSHOT: "1" },
22
+ }
23
+ );
24
+ process.exit(r.status ?? 1);
25
+ }
26
+ }
27
+
28
+ // If already launched with the flag, just run the real CLI.
29
+ await import("../ts_build/src/cli.js"); // or require(...) if CJS
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@tyvm/knowhow",
3
- "version": "0.0.73",
3
+ "version": "0.0.75",
4
4
  "description": "ai cli with plugins and agents",
5
5
  "main": "ts_build/src/index.js",
6
6
  "bin": {
7
- "knowhow": "ts_build/src/cli.js"
7
+ "knowhow": "bin/knowhow.js"
8
8
  },
9
9
  "scripts": {
10
10
  "test": "jest --testTimeout 300000",
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@tyvm/knowhow",
3
- "version": "0.0.73",
3
+ "version": "0.0.75",
4
4
  "description": "ai cli with plugins and agents",
5
5
  "main": "ts_build/src/index.js",
6
6
  "bin": {
7
- "knowhow": "ts_build/src/cli.js"
7
+ "knowhow": "bin/knowhow.js"
8
8
  },
9
9
  "scripts": {
10
10
  "test": "jest --testTimeout 300000",