passport-bridge 0.35.0 → 0.35.1

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/README.md CHANGED
@@ -364,7 +364,7 @@ passport git-credential setup --remove # back to your own GitHub sign-in
364
364
 
365
365
  When your workspace's GitHub App covers a repository, `gh` and `git` use tokens Passport issues from it, so GitHub reports their pushes, PRs and merges as the App (`<app>[bot]`; commit authors stay you) and the control plane counts them through Passport. `passport exec -- gh …` (the guard's rewrite in Claude Code, and the `gh` shim) already gets one; `passport keys` lists `gh` as going through Passport and says when git doesn't yet.
366
366
 
367
- `setup` adds Passport as git's credential helper for `https://github.com/` in your global git config (`GIT_CONFIG_GLOBAL` is honored), after an empty `helper =` so no helper set before it (osxkeychain, `gh auth git-credential`) answers for github.com. Those earlier helpers (from your system and global config only, never a repository's own) are remembered (names only, in `$PASSPORT_HOME/git-credential.json`) and still answer for repositories the App doesn't cover; running setup again keeps them. Pushes from SSH remotes go over HTTPS (`url.https://github.com/<owner>/.pushInsteadOf`) only for the accounts the App covers, and only when one of those helpers can answer over HTTPS; fetches stay on SSH. The file is copied once to `<file>.passport-backup`. `--remove` puts Passport's section back exactly as it was and removes only what setup added. If `gh auth setup-git` runs afterwards, git asks gh first again; `passport keys` says so, and setup again fixes it. `passport init` offers it in the Keys step when the App covers you (asked step by step, done with `--move-keys`, otherwise the next command). Not on Windows: setup refuses there, since its reset would stop Git Credential Manager answering for github.com.
367
+ `setup` adds Passport as git's credential helper for `https://github.com/` in your global git config (`GIT_CONFIG_GLOBAL` is honored), after an empty `helper =` so no helper set before it (osxkeychain, `gh auth git-credential`) answers for github.com. Those earlier helpers (from your system and global config only, never a repository's own) are remembered (names only, in `$PASSPORT_HOME/git-credential.json`) and still answer for repositories the App doesn't cover; running setup again keeps them. Pushes from SSH remotes go over HTTPS (`url.https://github.com/<owner>/.pushInsteadOf`) only for the accounts the App covers, and only when one of those helpers can answer over HTTPS; fetches stay on SSH. The file is copied once to `<file>.passport-backup`. `--remove` puts Passport's section back exactly as it was and removes only what setup added. If `gh auth setup-git` runs afterwards, git asks gh first again; `passport keys` says so, and setup again fixes it. Setup says done only once git's helper answers as this Passport (it runs the helper with `probe`); otherwise git goes back to how it was. If the helper or the launcher it runs falls behind (a global npm update leaves an old copy behind it), `passport init` and `passport status` point it at this Passport again. `passport init` offers it in the Keys step when the App covers you (asked step by step, done with `--move-keys`, otherwise the next command). Not on Windows: setup refuses there, since its reset would stop Git Credential Manager answering for github.com.
368
368
 
369
369
  Then for each fetch or push git runs `passport git-credential get`:
370
370
 
@@ -19,6 +19,8 @@ export type GitCredentialDependencies = {
19
19
  fallback?: (helper: string, operation: string, input: string, env: Runtime["env"]) => Promise<string>;
20
20
  run?: RunGit;
21
21
  command?: readonly string[];
22
+ /** What a helper line answers (tests); the default runs it as git would. */
23
+ probe?: (line: string, env: Runtime["env"]) => string | null;
22
24
  mintTimeoutMs?: number;
23
25
  decideTimeoutMs?: number;
24
26
  cwd?: string;
@@ -32,11 +32,13 @@ import { accessCachePath, cachedAccessApi } from "./accessTokenCache.js";
32
32
  import { bool } from "./cliArgs.js";
33
33
  import { memberApi } from "./cliClient.js";
34
34
  import { callerFrom, failure, readBoundedJson, resolveCliAuth, sanitize, timeoutMs } from "./cliSupport.js";
35
- import { defaultPassportCommand } from "./execShims.js";
35
+ import { defaultPassportCommand, thisCliCommand } from "./execShims.js";
36
+ import { compareVersions } from "./launcherHealth.js";
37
+ import { VERSION } from "./version.js";
36
38
  import { askingGitCommand, execGitCommand, isPush } from "./gitInvocation.js";
37
39
  import { MAX_PUSH_REFS, planKey, planPush } from "./gitPush.js";
38
40
  import { takePushDecisions } from "./gitPushDecisions.js";
39
- import { installGitCredential, readGitCredentialState, removeGitCredential } from "./gitCredentialSetup.js";
41
+ import { helperLine, helperProgram, installGitCredential, probeHelper, readGitCredentialState, removeGitCredential } from "./gitCredentialSetup.js";
40
42
  export const GIT_CREDENTIAL_PATH = "/api/my/github/git-credential";
41
43
  export const TOKEN_USERNAME = "x-access-token";
42
44
  const REPO_PATH = /^([A-Za-z0-9_.-]{1,100})\/([A-Za-z0-9_.-]{1,100}?)(?:\.git)?\/?$/;
@@ -362,13 +364,27 @@ async function setup(args, runtime, deps) {
362
364
  api = undefined;
363
365
  }
364
366
  const owners = await coveredOwners(api, runtime.signal);
365
- const result = installGitCredential({
366
- command: deps.command ?? defaultPassportCommand(),
367
+ const install = (command) => installGitCredential({
368
+ command,
367
369
  env,
368
370
  owners,
369
371
  ...(deps.run ? { run: deps.run } : {}),
370
372
  ...(deps.platform ? { platform: deps.platform } : {})
371
373
  });
374
+ const first = deps.command ?? defaultPassportCommand();
375
+ let result = install(first);
376
+ // git must get an answer from the helper it now runs, or every github.com fetch and push fails: else this CLI
377
+ // itself, else git goes back to how it was.
378
+ if (result.ok && first && !answers(helperLine(first), env, deps)) {
379
+ const self = deps.command ? undefined : thisCliCommand();
380
+ const retried = self && helperLine(self) !== helperLine(first) ? install(self) : null;
381
+ if (!retried?.ok || !self || !answers(helperLine(self), env, deps)) {
382
+ removeGitCredential({ env, ...(deps.run ? { run: deps.run } : {}) });
383
+ const program = helperProgram(helperLine(first)) ?? first[0];
384
+ return failure(`git's helper didn't answer: ${program} isn't a Passport that knows git-credential. git is back as it was. Run passport init, then passport git-credential setup.`, 1, "helper_unanswered");
385
+ }
386
+ result = retried;
387
+ }
372
388
  if (!result.ok) {
373
389
  const messages = {
374
390
  no_git: "git isn't installed here, so there's nothing to set up.",
@@ -403,11 +419,19 @@ async function setup(args, runtime, deps) {
403
419
  human: lines.join("\n")
404
420
  };
405
421
  }
422
+ /** Whether a helper line answers as this version of Passport or a newer one. */
423
+ function answers(line, env, deps) {
424
+ const version = (deps.probe ?? probeHelper)(line, env);
425
+ return version !== null && compareVersions(version, VERSION) >= 0;
426
+ }
406
427
  /* -------------------------------- entry --------------------------------- */
407
428
  export async function gitCredential(args, runtime, deps = {}) {
408
429
  const [operation] = args.positionals;
409
430
  if (operation === "setup")
410
431
  return setup(args, runtime, deps);
432
+ // Setup, init and status ask the helper line this, to know it runs a Passport that answers git.
433
+ if (operation === "probe")
434
+ return { json: { version: VERSION }, human: `passport git-credential ${VERSION}` };
411
435
  if (operation !== "get" && operation !== "store" && operation !== "erase") {
412
436
  return failure(`Unknown: ${sanitize(operation ?? "")}. git runs passport git-credential get|store|erase; you run passport git-credential setup.`, 6, "usage");
413
437
  }
package/dist/cliInit.js CHANGED
@@ -148,6 +148,10 @@ export class Init {
148
148
  const mode = await this.choose(plan.will.length > 0);
149
149
  this.screen.endStep();
150
150
  await this.apply(detected, mode);
151
+ // What still runs an older Passport (the launcher, git's helper) runs this one.
152
+ for (const line of (await import("./commandRepair.js")).repairPassportCommand(this.env)) {
153
+ this.screen.result("done", line, "Keys");
154
+ }
151
155
  this.screen.idle();
152
156
  this.outro();
153
157
  }
@@ -59,7 +59,10 @@ export async function guardStatus(api, profile, signal, now = Date.now(), env =
59
59
  // Someone is looking: finish any setup an upgrade left half done first, so
60
60
  // what follows is the state as it now is.
61
61
  const { repairHooks, repairLines } = await import("./hookRepair.js");
62
- const repaired = repairLines(await repairHooks(env));
62
+ const repaired = [
63
+ ...repairLines(await repairHooks(env)),
64
+ ...(await import("./commandRepair.js")).repairPassportCommand(env)
65
+ ];
63
66
  const local = (await localGuardStates(env)).filter((entry) => entry.state);
64
67
  const reported = api && profile ? await guardHeartbeat(api, profile, env, signal, now, true) : null;
65
68
  const agents = local.map((entry) => {
@@ -0,0 +1,13 @@
1
+ import type { Env } from "./cliSupport.js";
2
+ import { type RunGit } from "./gitCredentialSetup.js";
3
+ import { type InstallContext } from "./initInstall.js";
4
+ export type CommandRepairDeps = {
5
+ probe?: (line: string, env: Env) => string | null;
6
+ install?: (context: InstallContext) => unknown;
7
+ run?: RunGit;
8
+ context?: Partial<InstallContext>;
9
+ };
10
+ export declare const LAUNCHER_REPAIRED = "Updated Passport's launcher to this version: git's helper and your shims had been running an older Passport.";
11
+ export declare const HELPER_REPAIRED = "Pointed git's helper for github.com at this Passport, so fetches and pushes work again.";
12
+ export declare const HELPER_BROKEN = "git's helper for github.com runs a Passport that doesn't answer, so github.com fetches and pushes fail. Run passport git-credential setup.";
13
+ export declare function repairPassportCommand(env: Env, deps?: CommandRepairDeps): string[];
@@ -0,0 +1,73 @@
1
+ /**
2
+ * `passport init` and `passport status` point what still runs an older
3
+ * Passport at this one (dogfooding 0.35.0: a global npm install left
4
+ * `$PASSPORT_HOME/cli/bin/passport` on 0.16.8, so git's helper answered
5
+ * "Unknown command: git-credential" and every github.com fetch and push
6
+ * failed, and the Railway shim ran the old CLI too):
7
+ *
8
+ * - the launcher git's helper and the shims run, when it runs an older CLI
9
+ * than this one: installed again as init installs it (`ensureStableCommand`);
10
+ * - git's helper line, when it doesn't answer `probe` as this version or a
11
+ * newer one: pointed at the command setup would use now, once that answers.
12
+ *
13
+ * Only for a person's own signed-in CLI (`mayRepairHooks`), never on Windows,
14
+ * and never throws.
15
+ */
16
+ import { existsSync } from "node:fs";
17
+ import { homedir } from "node:os";
18
+ import { defaultPassportCommand, shimDir } from "./execShims.js";
19
+ import { helperLine, installGitCredential, probeHelper, readGitCredentialState } from "./gitCredentialSetup.js";
20
+ import { mayRepairHooks } from "./hookRepair.js";
21
+ import { ensureStableCommand, launcherPath } from "./initInstall.js";
22
+ import { packageRootOf } from "./initState.js";
23
+ import { compareVersions, launcherCurrent } from "./launcherHealth.js";
24
+ import { VERSION } from "./version.js";
25
+ export const LAUNCHER_REPAIRED = "Updated Passport's launcher to this version: git's helper and your shims had been running an older Passport.";
26
+ export const HELPER_REPAIRED = "Pointed git's helper for github.com at this Passport, so fetches and pushes work again.";
27
+ export const HELPER_BROKEN = "git's helper for github.com runs a Passport that doesn't answer, so github.com fetches and pushes fail. Run passport git-credential setup.";
28
+ export function repairPassportCommand(env, deps = {}) {
29
+ const lines = [];
30
+ try {
31
+ const context = {
32
+ env: env,
33
+ home: homedir(),
34
+ platform: process.platform,
35
+ packageRoot: packageRootOf(),
36
+ execPath: process.execPath,
37
+ nodeVersion: process.versions.node,
38
+ ...deps.context
39
+ };
40
+ if (context.platform === "win32" || !mayRepairHooks(env))
41
+ return lines;
42
+ const launcher = launcherPath(shimDir(), context.platform);
43
+ if (existsSync(launcher) && !launcherCurrent(launcher, VERSION)) {
44
+ try {
45
+ (deps.install ?? ensureStableCommand)(context);
46
+ if (launcherCurrent(launcher, VERSION))
47
+ lines.push(LAUNCHER_REPAIRED);
48
+ }
49
+ catch {
50
+ // No usable Node or no room: setup and init say why when run.
51
+ }
52
+ }
53
+ const state = readGitCredentialState();
54
+ if (!state)
55
+ return lines;
56
+ const probe = deps.probe ?? probeHelper;
57
+ const current = (line) => {
58
+ const version = probe(line, env);
59
+ return version !== null && compareVersions(version, VERSION) >= 0;
60
+ };
61
+ if (current(state.helper))
62
+ return lines;
63
+ const command = defaultPassportCommand();
64
+ const result = command && current(helperLine(command))
65
+ ? installGitCredential({ command, env, ...(deps.run ? { run: deps.run } : {}) })
66
+ : null;
67
+ lines.push(result?.ok ? HELPER_REPAIRED : HELPER_BROKEN);
68
+ }
69
+ catch {
70
+ // Never in the way of what was asked.
71
+ }
72
+ return lines;
73
+ }
@@ -42,9 +42,11 @@ export declare function shimSkipper(): (candidate: string) => boolean;
42
42
  export declare function findVendorBinary(binary: string, env: NodeJS.ProcessEnv, platform?: NodeJS.Platform): string | undefined;
43
43
  /** The shim's text. The marker line is what exec and removal look for. */
44
44
  export declare function shimText(binary: string, passportCommand: readonly string[]): string;
45
- /** What a shim runs: the stable launcher `passport init` installs, else this
46
- * CLI when it isn't a one-off npx copy. */
45
+ /** What a shim and git's helper run: the stable launcher `passport init` installs, while it runs this CLI or a
46
+ * newer one (launcherHealth.ts), else this CLI when it isn't a one-off npx copy. */
47
47
  export declare function defaultPassportCommand(): string[] | undefined;
48
+ /** This CLI's own node and entry, unless it is a one-off npx copy. */
49
+ export declare function thisCliCommand(): string[] | undefined;
48
50
  /** Whether typing `binary` runs Passport's own shim: the first on PATH, and still what Passport recorded (advisory:
49
51
  * the record sits beside the shim, so it catches an edited shim, not someone who can write Passport's folder). */
50
52
  export declare function shimRuns(binary: string, env: NodeJS.ProcessEnv, platform?: NodeJS.Platform): boolean;
package/dist/execShims.js CHANGED
@@ -28,6 +28,8 @@ import { dirname, join, resolve } from "node:path";
28
28
  import { credentialDir, ensurePrivateDirectory, writePrivateAtomic } from "./credentialStorage.js";
29
29
  import { EXEC_ALIASES, EXEC_VENDORS, EXEC_VENDOR_NAMES } from "./execVendors.js";
30
30
  import { findOnPath, isEphemeralPath, launcherPath, pathDirectories, pathLine } from "./initInstall.js";
31
+ import { launcherCurrent } from "./launcherHealth.js";
32
+ import { VERSION } from "./version.js";
31
33
  export const SHIM_MARKER = "# passport-shim v1";
32
34
  /** How many shims deep a command may go before the shim refuses (a vendor
33
35
  * CLI that runs itself once is fine; a loop is not). */
@@ -166,12 +168,16 @@ function executableFile(path) {
166
168
  return false;
167
169
  }
168
170
  }
169
- /** What a shim runs: the stable launcher `passport init` installs, else this
170
- * CLI when it isn't a one-off npx copy. */
171
+ /** What a shim and git's helper run: the stable launcher `passport init` installs, while it runs this CLI or a
172
+ * newer one (launcherHealth.ts), else this CLI when it isn't a one-off npx copy. */
171
173
  export function defaultPassportCommand() {
172
174
  const launcher = launcherPath(shimDir(), process.platform);
173
- if (executableFile(launcher) && !isPassportShim(launcher))
175
+ if (executableFile(launcher) && !isPassportShim(launcher) && launcherCurrent(launcher, VERSION))
174
176
  return [launcher];
177
+ return thisCliCommand();
178
+ }
179
+ /** This CLI's own node and entry, unless it is a one-off npx copy. */
180
+ export function thisCliCommand() {
175
181
  const entry = process.argv[1] ? canonical(process.argv[1]) : "";
176
182
  if (!/[\\/]passport\.js$/.test(entry) || isEphemeralPath(entry) || isEphemeralPath(process.execPath)) {
177
183
  return undefined;
@@ -26,6 +26,9 @@ export declare const defaultRunGit: RunGit;
26
26
  export declare function statePath(): string;
27
27
  /** Setup's record, when Passport's helper is installed on this computer. Never throws. */
28
28
  export declare function readGitCredentialState(): GitCredentialState | null;
29
+ /** The version git's helper line answers with (`… git-credential probe`, run as git runs it), or null when it doesn't
30
+ * answer: an older Passport behind it says "Unknown command: git-credential", and git then fails every fetch. */
31
+ export declare function probeHelper(line: string, env: GitEnv, timeoutMs?: number): string | null;
29
32
  /** Whether setup ran here (its record exists). */
30
33
  export declare function gitHelperInstalled(): boolean;
31
34
  /** The program a helper line runs: `!'<path>' …` or `!<path> …`. */
@@ -107,6 +107,25 @@ export function readGitCredentialState() {
107
107
  return null;
108
108
  }
109
109
  }
110
+ /** The version git's helper line answers with (`… git-credential probe`, run as git runs it), or null when it doesn't
111
+ * answer: an older Passport behind it says "Unknown command: git-credential", and git then fails every fetch. */
112
+ export function probeHelper(line, env, timeoutMs = 15_000) {
113
+ if (!line.startsWith("!"))
114
+ return null;
115
+ try {
116
+ const out = execFileSync("/bin/sh", ["-c", `${line.slice(1)} probe`], {
117
+ encoding: "utf8",
118
+ env: env,
119
+ timeout: timeoutMs,
120
+ stdio: ["ignore", "pipe", "ignore"],
121
+ maxBuffer: 16 * 1024
122
+ });
123
+ return /^passport git-credential (\d+\.\d+\.\d+\S*)\s*$/m.exec(out)?.[1] ?? null;
124
+ }
125
+ catch {
126
+ return null;
127
+ }
128
+ }
110
129
  /** Whether setup ran here (its record exists). */
111
130
  export function gitHelperInstalled() {
112
131
  return readGitCredentialState() !== null;
@@ -20,6 +20,7 @@ import { spawnSync } from "node:child_process";
20
20
  import { basename, delimiter, dirname, join, relative, resolve, sep } from "node:path";
21
21
  import { credentialDir, ensurePrivateDirectory } from "./credentialStorage.js";
22
22
  import { fastPathShell } from "./launcherFastPath.js";
23
+ import { compareVersions, launcherCurrent } from "./launcherHealth.js";
23
24
  import { MIN_NODE_MAJOR } from "./nodeVersion.js";
24
25
  const INSTALL_MARKER = ".passport-install.json";
25
26
  /** `cli/current`: a link to the installed version (POSIX), read by the plugin. */
@@ -67,18 +68,6 @@ export function findOnPath(name, env, platform, skip) {
67
68
  function majorOf(version) {
68
69
  return Number(/^v?(\d+)/.exec(version ?? "")?.[1] ?? NaN);
69
70
  }
70
- function compareVersions(a, b) {
71
- const parse = (value) => value
72
- .split(/[.+-]/)
73
- .slice(0, 3)
74
- .map((part) => Number(part) || 0);
75
- const [left, right] = [parse(a), parse(b)];
76
- for (let index = 0; index < 3; index += 1) {
77
- if (left[index] !== right[index])
78
- return (left[index] ?? 0) - (right[index] ?? 0);
79
- }
80
- return 0;
81
- }
82
71
  function defaultVersionOf(node) {
83
72
  try {
84
73
  const result = spawnSync(node, ["--version"], {
@@ -346,6 +335,20 @@ function writeShims(binDir, node, versionDir, platform) {
346
335
  renameSync(temporary, file);
347
336
  }
348
337
  }
338
+ /** The launchers in `$PASSPORT_HOME/cli/bin` run the package at `packageRoot`. Best effort. */
339
+ function pointLaunchers(node, packageRoot, platform) {
340
+ const version = readPackage(packageRoot).version ?? "0.0.0";
341
+ // A launcher already on this version or a newer one (`passport update`'s copy) stays.
342
+ if (launcherCurrent(launcherPath(join(cliRoot(), "bin"), platform), version))
343
+ return;
344
+ try {
345
+ ensurePrivateDirectory(true);
346
+ writeShims(join(cliRoot(), "bin"), node, packageRoot, platform);
347
+ }
348
+ catch {
349
+ // The hooks run node and the entry themselves; a launcher left as it was is checked before use.
350
+ }
351
+ }
349
352
  /** `cli/current` → the installed version, swapped with one rename. POSIX only:
350
353
  * Windows has the launcher alone. Best effort; the launcher is what hooks run. */
351
354
  function pointCurrent(root, version, platform) {
@@ -391,8 +394,11 @@ export function ensureStableCommand(context) {
391
394
  if (!node) {
392
395
  throw new StableInstallError(`Passport couldn't find Node.js ${MIN_NODE_MAJOR} or newer outside npm's cache. Install Node.js, then run init again.`);
393
396
  }
394
- if (global)
397
+ if (global) {
398
+ // The launchers git's helper and the shims run follow the global install too, so none runs an older CLI.
399
+ pointLaunchers(node, dirname(dirname(global.entry)), context.platform);
395
400
  return { node, entry: global.entry, version, source: "global", onPath };
401
+ }
396
402
  return installCopy(context, node, onPath);
397
403
  }
398
404
  /**
@@ -0,0 +1,11 @@
1
+ /** Major, minor and patch compared as numbers; anything after is ignored. */
2
+ export declare function compareVersions(a: string, b: string): number;
3
+ /** The node and entry a launcher Passport wrote runs (its last `exec` line), or null. */
4
+ export declare function launcherTarget(text: string): {
5
+ node: string;
6
+ entry: string;
7
+ } | null;
8
+ /** The version of the package a launcher runs; null when it can't be read. */
9
+ export declare function launcherVersion(path: string): string | null;
10
+ /** Whether a launcher runs `version` or newer. */
11
+ export declare function launcherCurrent(path: string, version: string): boolean;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Whether `$PASSPORT_HOME/cli/bin/passport` (the launcher git's helper and the
3
+ * shims run) runs this CLI or a newer one. A global npm install never used to
4
+ * rewrite it, so it could keep running a months-old CLI that doesn't know
5
+ * `git-credential`, and every github.com fetch and push failed. A launcher
6
+ * Passport can't read, or whose copy is gone, counts as stale.
7
+ */
8
+ import { readFileSync } from "node:fs";
9
+ import { dirname, join } from "node:path";
10
+ /** Major, minor and patch compared as numbers; anything after is ignored. */
11
+ export function compareVersions(a, b) {
12
+ const parse = (value) => value
13
+ .split(/[.+-]/)
14
+ .slice(0, 3)
15
+ .map((part) => Number(part) || 0);
16
+ const [left, right] = [parse(a), parse(b)];
17
+ for (let index = 0; index < 3; index += 1) {
18
+ if (left[index] !== right[index])
19
+ return (left[index] ?? 0) - (right[index] ?? 0);
20
+ }
21
+ return 0;
22
+ }
23
+ const unquote = (value) => value.replaceAll(`'\\''`, "'");
24
+ /** The node and entry a launcher Passport wrote runs (its last `exec` line), or null. */
25
+ export function launcherTarget(text) {
26
+ const posix = [...text.matchAll(/^exec '((?:[^']|'\\'')*)' '((?:[^']|'\\'')*)' "\$@"$/gm)].at(-1);
27
+ if (posix)
28
+ return { node: unquote(posix[1]), entry: unquote(posix[2]) };
29
+ const windows = /^"([^"\r\n]+)" "([^"\r\n]+)" %\*\r?$/m.exec(text);
30
+ return windows ? { node: windows[1], entry: windows[2] } : null;
31
+ }
32
+ /** The version of the package a launcher runs; null when it can't be read. */
33
+ export function launcherVersion(path) {
34
+ try {
35
+ const target = launcherTarget(readFileSync(path, "utf8"));
36
+ if (!target)
37
+ return null;
38
+ const found = JSON.parse(readFileSync(join(dirname(dirname(target.entry)), "package.json"), "utf8"));
39
+ return typeof found.version === "string" ? found.version : null;
40
+ }
41
+ catch {
42
+ return null;
43
+ }
44
+ }
45
+ /** Whether a launcher runs `version` or newer. */
46
+ export function launcherCurrent(path, version) {
47
+ const found = launcherVersion(path);
48
+ return found !== null && compareVersions(found, version) >= 0;
49
+ }
@@ -4,4 +4,4 @@
4
4
  * the version, then runs `npm run set-version -- <version>` in the plugin repo
5
5
  * and pushes (docs/RELEASING.md). `pluginPin.test.ts` fails when it drifts.
6
6
  */
7
- export declare const PLUGIN_PIN = "0.35.0";
7
+ export declare const PLUGIN_PIN = "0.35.1";
package/dist/pluginPin.js CHANGED
@@ -4,4 +4,4 @@
4
4
  * the version, then runs `npm run set-version -- <version>` in the plugin repo
5
5
  * and pushes (docs/RELEASING.md). `pluginPin.test.ts` fails when it drifts.
6
6
  */
7
- export const PLUGIN_PIN = "0.35.0";
7
+ export const PLUGIN_PIN = "0.35.1";
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.35.0";
1
+ export declare const VERSION = "0.35.1";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Keep in lockstep with bridge/package.json.
2
- export const VERSION = "0.35.0";
2
+ export const VERSION = "0.35.1";
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "passport-bridge",
3
- "version": "0.35.0",
3
+ "version": "0.35.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "passport-bridge",
9
- "version": "0.35.0",
9
+ "version": "0.35.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@modelcontextprotocol/sdk": "1.32.1"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "passport-bridge",
3
- "version": "0.35.0",
3
+ "version": "0.35.1",
4
4
  "description": "Passport CLI for governed terminal and CI agents, plus the local stdio-to-cloud MCP bridge.",
5
5
  "license": "MIT",
6
6
  "repository": {