skalpel 3.0.12 → 3.0.14

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skalpel",
3
- "version": "3.0.12",
3
+ "version": "3.0.14",
4
4
  "description": "Skalpel — local proxy and TUI for coding agents (skalpel + skalpeld bundle).",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://skalpel.ai",
@@ -53,10 +53,10 @@
53
53
  "x64"
54
54
  ],
55
55
  "optionalDependencies": {
56
- "@skalpelai/skalpel-darwin-arm64": "3.0.12",
57
- "@skalpelai/skalpel-darwin-x64": "3.0.12",
58
- "@skalpelai/skalpel-linux-arm64": "3.0.12",
59
- "@skalpelai/skalpel-linux-x64": "3.0.12",
60
- "@skalpelai/skalpel-win32-x64": "3.0.12"
56
+ "@skalpelai/skalpel-darwin-arm64": "3.0.14",
57
+ "@skalpelai/skalpel-darwin-x64": "3.0.14",
58
+ "@skalpelai/skalpel-linux-arm64": "3.0.14",
59
+ "@skalpelai/skalpel-linux-x64": "3.0.14",
60
+ "@skalpelai/skalpel-win32-x64": "3.0.14"
61
61
  }
62
62
  }
@@ -46,53 +46,35 @@ function resolveDispatcher() {
46
46
 
47
47
  function run({ dryRun, prior }) {
48
48
  if (prior) {
49
- log.info('sign-in: prior auth.json detected — skipping browser flow');
49
+ log.info('sign-in: prior auth.json detected — skipping');
50
50
  return { skipped: true };
51
51
  }
52
52
 
53
- const dispatcher = resolveDispatcher();
54
-
53
+ // Per UX request 2026-05-14: postinstall must NOT pop a browser
54
+ // unprompted. The first-time-user contract is now:
55
+ // 1. npm install completes silently (no auto-launched browser).
56
+ // 2. Postinstall prints "all set — run `skalpel` to open the TUI".
57
+ // 3. On first `skalpel` invocation, the TUI detects missing
58
+ // auth.json and renders an in-TUI sign-in gate (press Enter
59
+ // to open the browser, q to quit). See the runTUI auth gate
60
+ // in cmd/skalpel/main.go.
61
+ //
62
+ // We keep this module's surface unchanged so postinstall/index.js
63
+ // does not need to special-case the deferred path; we just return
64
+ // `skipped: true` whether or not auth exists.
65
+ log.info('sign-in: deferred — first `skalpel` launch will gate sign-in');
55
66
  if (dryRun) {
56
- log.dryRun(
57
- `step 2 sign-in: would exec \`node ${dispatcher || '<dispatcher-missing>'} login\` ` +
58
- '(loopback browser flow with manual-paste fallback)'
59
- );
60
- return { skipped: false, dryRun: true };
61
- }
62
-
63
- if (!dispatcher) {
64
- log.warn(
65
- 'sign-in: dispatch shim not resolvable; user must run `skalpel login` ' +
66
- 'manually after install'
67
- );
68
- return { skipped: true, reason: 'no-dispatcher' };
67
+ log.dryRun('step 2 sign-in: would defer (no postinstall browser pop)');
68
+ return { skipped: true, dryRun: true, deferred: true };
69
69
  }
70
-
71
- // B6: actually spawn `skalpel login`. The subprocess opens the
72
- // browser, waits for the loopback callback, and writes auth.json.
73
- // We propagate stdio so the user can see the prompt; we cap at
74
- // SIGN_IN_TIMEOUT_MS so a runaway hang does not block npm install.
75
- log.info(
76
- 'sign-in: launching `skalpel login` (loopback browser flow); ' +
77
- `timeout ${Math.round(SIGN_IN_TIMEOUT_MS / 1000)}s`
78
- );
79
- const r = spawnSync(process.execPath, [dispatcher, 'login'], {
80
- stdio: 'inherit',
81
- timeout: SIGN_IN_TIMEOUT_MS,
82
- });
83
- if (r.error) {
84
- log.warn(`sign-in: spawn error: ${r.error.message}; user can re-run \`skalpel login\``);
85
- return { skipped: false, error: r.error.message };
86
- }
87
- if (r.status !== 0) {
88
- log.warn(
89
- `sign-in: \`skalpel login\` exited ${r.status}; user can re-run after install ` +
90
- `(config dir: ${paths.configDir()})`
91
- );
92
- return { skipped: false, exitCode: r.status };
93
- }
94
- log.info(`sign-in: ok (config dir: ${paths.configDir()})`);
95
- return { skipped: false, ok: true };
70
+ return { skipped: true, deferred: true };
96
71
  }
97
72
 
73
+ // resolveDispatcher and SIGN_IN_TIMEOUT_MS are retained at module
74
+ // scope (used by no callers today) so the spawn-on-install behaviour
75
+ // can be reinstated with a single edit if the deferred-auth UX needs
76
+ // to be reverted.
77
+ void resolveDispatcher;
78
+ void SIGN_IN_TIMEOUT_MS;
79
+
98
80
  module.exports = { run, resolveDispatcher };