@appchy/jarvis 0.1.35 → 0.1.36
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/config-change.dev.mjs +17 -0
- package/bin/config-change.mjs +17 -0
- package/bin/jarvis-dev.mjs +13 -23
- package/bin/pre-tool-use.dev.mjs +23 -0
- package/bin/pre-tool-use.mjs +29 -0
- package/bin/session-start.dev.mjs +17 -0
- package/bin/session-start.mjs +17 -0
- package/bin/stop.dev.mjs +17 -0
- package/bin/stop.mjs +17 -0
- package/bin/user-prompt-submit.dev.mjs +17 -0
- package/bin/user-prompt-submit.mjs +17 -0
- package/dev/bin.js +38718 -0
- package/dev/bin.js.map +1 -0
- package/dev/env.json +1 -0
- package/dev/hooks/config-change.js +110 -0
- package/dev/hooks/config-change.js.map +1 -0
- package/dev/hooks/pre-tool-use.js +120 -0
- package/dev/hooks/pre-tool-use.js.map +1 -0
- package/dev/hooks/session-start.js +115 -0
- package/dev/hooks/session-start.js.map +1 -0
- package/dev/hooks/stop.js +112 -0
- package/dev/hooks/stop.js.map +1 -0
- package/dev/hooks/user-prompt-submit.js +111 -0
- package/dev/hooks/user-prompt-submit.js.map +1 -0
- package/dist/bin.js +9719 -7456
- package/dist/bin.js.map +1 -1
- package/dist/hooks/config-change.js +110 -0
- package/dist/hooks/config-change.js.map +1 -0
- package/dist/hooks/pre-tool-use.js +120 -0
- package/dist/hooks/pre-tool-use.js.map +1 -0
- package/dist/hooks/session-start.js +115 -0
- package/dist/hooks/session-start.js.map +1 -0
- package/dist/hooks/stop.js +112 -0
- package/dist/hooks/stop.js.map +1 -0
- package/dist/hooks/user-prompt-submit.js +111 -0
- package/dist/hooks/user-prompt-submit.js.map +1 -0
- package/package.json +19 -6
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Jarvis ConfigChange hook — Dev Launcher.
|
|
5
|
+
* See bin/pre-tool-use.dev.mjs for the pattern.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
|
+
import { dirname, join } from "path";
|
|
10
|
+
import { existsSync } from "fs";
|
|
11
|
+
|
|
12
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const bundle = join(__dirname, "..", "dev", "hooks", "config-change.js");
|
|
14
|
+
|
|
15
|
+
if (!existsSync(bundle)) process.exit(0);
|
|
16
|
+
|
|
17
|
+
await import(bundle);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Jarvis ConfigChange hook — Prod Launcher.
|
|
5
|
+
* See bin/pre-tool-use.mjs for the pattern.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
|
+
import { dirname, join } from "path";
|
|
10
|
+
import { existsSync } from "fs";
|
|
11
|
+
|
|
12
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const bundle = join(__dirname, "..", "dist", "hooks", "config-change.js");
|
|
14
|
+
|
|
15
|
+
if (!existsSync(bundle)) process.exit(0);
|
|
16
|
+
|
|
17
|
+
await import(bundle);
|
package/bin/jarvis-dev.mjs
CHANGED
|
@@ -3,38 +3,28 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Jarvis CLI — Dev Launcher
|
|
5
5
|
*
|
|
6
|
-
* Always runs `
|
|
7
|
-
*
|
|
6
|
+
* Always runs the bundled `dev/bin.js` (development: hits localhost:3000 /
|
|
7
|
+
* ws://localhost:7863, uses `~/.jarvis/dev/` for config, logs, pid, machine
|
|
8
|
+
* identity, worktrees, skills, prompts). Mirrors the prod launcher
|
|
9
|
+
* (`jarvis.mjs` → `dist/bin.js`); the only difference is which `env.json`
|
|
10
|
+
* discriminator ships in the bundle.
|
|
8
11
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* the ride — there's nothing for it to run).
|
|
12
|
+
* For source-tree iteration with hot reload, use `pnpm -C apps/cli dev`
|
|
13
|
+
* instead — that runs `tsx watch src/bin.ts` directly.
|
|
12
14
|
*/
|
|
13
15
|
|
|
14
16
|
import { fileURLToPath } from "url";
|
|
15
17
|
import { dirname, join } from "path";
|
|
16
18
|
import { existsSync } from "fs";
|
|
17
|
-
import { execFileSync } from "child_process";
|
|
18
19
|
|
|
19
20
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
20
|
-
const
|
|
21
|
-
const srcEntry = join(root, "src", "bin.ts");
|
|
22
|
-
const tsxBin = join(root, "node_modules", ".bin", "tsx");
|
|
21
|
+
const distEntry = join(__dirname, "..", "dev", "bin.js");
|
|
23
22
|
|
|
24
|
-
if (!existsSync(
|
|
25
|
-
console.error(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
);
|
|
23
|
+
if (!existsSync(distEntry)) {
|
|
24
|
+
console.error("Error: dev/bin.js not found.");
|
|
25
|
+
console.error(" Build the dev bundle with `pnpm -C apps/cli build`,");
|
|
26
|
+
console.error(" or reinstall the package with `pnpm i -g @appchy/jarvis`.");
|
|
29
27
|
process.exit(1);
|
|
30
28
|
}
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
execFileSync(tsxBin, [srcEntry, ...process.argv.slice(2)], {
|
|
34
|
-
stdio: "inherit",
|
|
35
|
-
cwd: process.cwd(),
|
|
36
|
-
env: { ...process.env, NODE_NO_WARNINGS: "1" },
|
|
37
|
-
});
|
|
38
|
-
} catch (err) {
|
|
39
|
-
process.exit(err.status ?? 1);
|
|
40
|
-
}
|
|
30
|
+
await import(distEntry);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Jarvis PreToolUse hook — Dev Launcher
|
|
5
|
+
*
|
|
6
|
+
* Invoked by Claude Code for every tool use when the dev daemon's
|
|
7
|
+
* `~/.claude/settings.json` entry is installed (via `jarvis-dev start`).
|
|
8
|
+
* Appends one envelope line to `~/.jarvis/dev/hooks/<sessionId>.jsonl`
|
|
9
|
+
* and exits — same hot-path contract as the prod shim.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { fileURLToPath } from "url";
|
|
13
|
+
import { dirname, join } from "path";
|
|
14
|
+
import { existsSync } from "fs";
|
|
15
|
+
|
|
16
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
const bundle = join(__dirname, "..", "dev", "hooks", "pre-tool-use.js");
|
|
18
|
+
|
|
19
|
+
if (!existsSync(bundle)) {
|
|
20
|
+
process.exit(0);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
await import(bundle);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Jarvis PreToolUse hook — Prod Launcher
|
|
5
|
+
*
|
|
6
|
+
* Invoked by Claude Code for every tool use (configured in
|
|
7
|
+
* `~/.claude/settings.json` by the prod daemon on `jarvis start`).
|
|
8
|
+
* Reads CC's JSON payload from stdin, appends one envelope line to
|
|
9
|
+
* `~/.jarvis/hooks/<sessionId>.jsonl`, exits 0.
|
|
10
|
+
*
|
|
11
|
+
* NEVER blocks, NEVER RPCs the daemon. CC's terminal permission prompt
|
|
12
|
+
* fires as usual after this process exits.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { fileURLToPath } from "url";
|
|
16
|
+
import { dirname, join } from "path";
|
|
17
|
+
import { existsSync } from "fs";
|
|
18
|
+
|
|
19
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
20
|
+
// tsup preserves the `src/hooks/` directory layout, so the bundle lands
|
|
21
|
+
// at `dist/hooks/pre-tool-use.js` (not `dist/pre-tool-use.js`).
|
|
22
|
+
const bundle = join(__dirname, "..", "dist", "hooks", "pre-tool-use.js");
|
|
23
|
+
|
|
24
|
+
if (!existsSync(bundle)) {
|
|
25
|
+
// Silent on missing bundle — CC must never see a hook error.
|
|
26
|
+
process.exit(0);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
await import(bundle);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Jarvis SessionStart hook — Dev Launcher.
|
|
5
|
+
* See bin/pre-tool-use-dev.mjs for the pattern.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
|
+
import { dirname, join } from "path";
|
|
10
|
+
import { existsSync } from "fs";
|
|
11
|
+
|
|
12
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const bundle = join(__dirname, "..", "dev", "hooks", "session-start.js");
|
|
14
|
+
|
|
15
|
+
if (!existsSync(bundle)) process.exit(0);
|
|
16
|
+
|
|
17
|
+
await import(bundle);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Jarvis SessionStart hook — Prod Launcher.
|
|
5
|
+
* See bin/pre-tool-use.mjs for the pattern.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
|
+
import { dirname, join } from "path";
|
|
10
|
+
import { existsSync } from "fs";
|
|
11
|
+
|
|
12
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const bundle = join(__dirname, "..", "dist", "hooks", "session-start.js");
|
|
14
|
+
|
|
15
|
+
if (!existsSync(bundle)) process.exit(0);
|
|
16
|
+
|
|
17
|
+
await import(bundle);
|
package/bin/stop.dev.mjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Jarvis Stop hook — Dev Launcher.
|
|
5
|
+
* See bin/pre-tool-use-dev.mjs for the pattern.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
|
+
import { dirname, join } from "path";
|
|
10
|
+
import { existsSync } from "fs";
|
|
11
|
+
|
|
12
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const bundle = join(__dirname, "..", "dev", "hooks", "stop.js");
|
|
14
|
+
|
|
15
|
+
if (!existsSync(bundle)) process.exit(0);
|
|
16
|
+
|
|
17
|
+
await import(bundle);
|
package/bin/stop.mjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Jarvis Stop hook — Prod Launcher.
|
|
5
|
+
* See bin/pre-tool-use.mjs for the pattern.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
|
+
import { dirname, join } from "path";
|
|
10
|
+
import { existsSync } from "fs";
|
|
11
|
+
|
|
12
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const bundle = join(__dirname, "..", "dist", "hooks", "stop.js");
|
|
14
|
+
|
|
15
|
+
if (!existsSync(bundle)) process.exit(0);
|
|
16
|
+
|
|
17
|
+
await import(bundle);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Jarvis UserPromptSubmit hook — Dev Launcher.
|
|
5
|
+
* See bin/pre-tool-use.dev.mjs for the pattern.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
|
+
import { dirname, join } from "path";
|
|
10
|
+
import { existsSync } from "fs";
|
|
11
|
+
|
|
12
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const bundle = join(__dirname, "..", "dev", "hooks", "user-prompt-submit.js");
|
|
14
|
+
|
|
15
|
+
if (!existsSync(bundle)) process.exit(0);
|
|
16
|
+
|
|
17
|
+
await import(bundle);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Jarvis UserPromptSubmit hook — Prod Launcher.
|
|
5
|
+
* See bin/pre-tool-use.mjs for the pattern.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
|
+
import { dirname, join } from "path";
|
|
10
|
+
import { existsSync } from "fs";
|
|
11
|
+
|
|
12
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const bundle = join(__dirname, "..", "dist", "hooks", "user-prompt-submit.js");
|
|
14
|
+
|
|
15
|
+
if (!existsSync(bundle)) process.exit(0);
|
|
16
|
+
|
|
17
|
+
await import(bundle);
|