skalpel 4.0.15 → 4.0.16
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/package.json +1 -1
- package/skalpel-setup.mjs +14 -14
package/package.json
CHANGED
package/skalpel-setup.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// setup — the automatic install flow (`skalpel
|
|
2
|
+
// setup — the automatic install flow (`skalpel setup`, also npm postinstall). Prints the
|
|
3
3
|
// banner, signs you in with Google (once), reads your last 30 days of Claude Code / Codex history,
|
|
4
4
|
// UPLOADS it to the hosted graph (the server judges + builds — the client stays engine-free), wires
|
|
5
5
|
// the two hooks into Claude Code + Codex, and reports "you're live". Skips in CI / non-TTY (override:
|
|
@@ -22,8 +22,8 @@ import { fileURLToPath } from "node:url";
|
|
|
22
22
|
import { spawn, spawnSync } from "node:child_process";
|
|
23
23
|
import { identity as authIdentity, cliAuthPath } from "./auth.mjs";
|
|
24
24
|
|
|
25
|
-
// CLI (the `skalpel
|
|
26
|
-
// [--user <id>]`, plus `skalpel
|
|
25
|
+
// CLI (the `skalpel` bin): `skalpel setup [--api https://graph.skalpel.ai]
|
|
26
|
+
// [--user <id>]`, plus `skalpel uninstall` and `skalpel login`. A bare invocation
|
|
27
27
|
// (npm postinstall) keeps the TTY-gated flow below.
|
|
28
28
|
const argv = process.argv.slice(2);
|
|
29
29
|
const sub = argv[0] && !argv[0].startsWith("-") ? argv[0] : null;
|
|
@@ -55,14 +55,14 @@ const KNOWN_SUBS = new Set(["setup", "login", "logout", "uninstall", "autopsy",
|
|
|
55
55
|
const VALUE_FLAGS = new Set(["--api", "--user"]);
|
|
56
56
|
// Boolean flags that take no value. `--purge` on `uninstall` also removes auth + all local data.
|
|
57
57
|
const BOOL_FLAGS = new Set(["--purge"]);
|
|
58
|
-
const USAGE = `skalpel
|
|
58
|
+
const USAGE = `skalpel — connect your coding history to your behavioral graph
|
|
59
59
|
|
|
60
60
|
usage:
|
|
61
|
-
skalpel
|
|
62
|
-
skalpel
|
|
63
|
-
skalpel
|
|
64
|
-
skalpel
|
|
65
|
-
skalpel
|
|
61
|
+
skalpel [setup] [--api <url>] [--user <id>] sign in, learn your history, wire the hooks
|
|
62
|
+
skalpel login (re-)run the Google sign-in
|
|
63
|
+
skalpel logout clear the saved session
|
|
64
|
+
skalpel autopsy local, read-only receipt of your verified patterns
|
|
65
|
+
skalpel uninstall [--purge] remove the hooks + local data from this machine
|
|
66
66
|
|
|
67
67
|
options:
|
|
68
68
|
--api <url> point at a different graph server
|
|
@@ -325,7 +325,7 @@ function promptLaunch(targets) {
|
|
|
325
325
|
const launchers = (targets || []).filter((entry) => !!entry?.command);
|
|
326
326
|
if (!launchers.length) {
|
|
327
327
|
console.log(`
|
|
328
|
-
${D}No AI launcher was found on PATH. Re-run ${X}skalpel
|
|
328
|
+
${D}No AI launcher was found on PATH. Re-run ${X}skalpel setup${D} after installing Claude Code or Codex.${X}
|
|
329
329
|
`);
|
|
330
330
|
return Promise.resolve();
|
|
331
331
|
}
|
|
@@ -810,12 +810,12 @@ async function main() {
|
|
|
810
810
|
spawnSync("node", [join(__dir, "install.mjs"), ...passthrough], { stdio: "inherit" });
|
|
811
811
|
return;
|
|
812
812
|
}
|
|
813
|
-
// `skalpel
|
|
813
|
+
// `skalpel login` — just run the sign-in flow (also invoked automatically by setup).
|
|
814
814
|
if (sub === "login") {
|
|
815
815
|
spawnSync("node", [join(__dir, "login.mjs")], { stdio: "inherit" });
|
|
816
816
|
return;
|
|
817
817
|
}
|
|
818
|
-
// `skalpel
|
|
818
|
+
// `skalpel logout` — clear the saved Google session so the next run signs in fresh.
|
|
819
819
|
// (Setup skips the sign-in when a valid ~/.skalpel/auth.json exists — this is how you force a new
|
|
820
820
|
// account / a real Google popup.)
|
|
821
821
|
if (sub === "logout") {
|
|
@@ -886,7 +886,7 @@ async function main() {
|
|
|
886
886
|
id = await identity();
|
|
887
887
|
if (!id) {
|
|
888
888
|
console.log(
|
|
889
|
-
`\n ${D}Not signed in — run ${X}skalpel
|
|
889
|
+
`\n ${D}Not signed in — run ${X}skalpel login${D} then re-run to build your graph.${X}\n`,
|
|
890
890
|
);
|
|
891
891
|
return;
|
|
892
892
|
}
|
|
@@ -967,7 +967,7 @@ async function main() {
|
|
|
967
967
|
`Couldn't build your graph${err ? ` (${String(err.message || err).slice(0, 40)})` : ""}`,
|
|
968
968
|
);
|
|
969
969
|
console.log(
|
|
970
|
-
`\n ${D}Hooks are wired and fail open. Re-run ${X}skalpel
|
|
970
|
+
`\n ${D}Hooks are wired and fail open. Re-run ${X}skalpel setup${D} to try building again.${X}\n`,
|
|
971
971
|
);
|
|
972
972
|
}
|
|
973
973
|
} else if (files.length) {
|