passport-bridge 0.41.0 → 0.44.0

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.
Files changed (72) hide show
  1. package/README.md +16 -56
  2. package/dist/callingAgent.d.ts +64 -0
  3. package/dist/callingAgent.js +163 -0
  4. package/dist/cliExec.d.ts +13 -29
  5. package/dist/cliExec.js +71 -173
  6. package/dist/cliGitCredential.d.ts +2 -1
  7. package/dist/cliGitCredential.js +28 -4
  8. package/dist/cliGuardHealth.js +2 -0
  9. package/dist/cliHook.d.ts +4 -1
  10. package/dist/cliHook.js +12 -5
  11. package/dist/cliHookDecide.js +4 -13
  12. package/dist/cliHookRewrite.d.ts +3 -2
  13. package/dist/cliHookRewrite.js +10 -6
  14. package/dist/cliKeys.js +10 -9
  15. package/dist/cliKeysBack.d.ts +3 -5
  16. package/dist/cliKeysBack.js +6 -23
  17. package/dist/cliKeysShim.d.ts +4 -1
  18. package/dist/cliKeysShim.js +9 -1
  19. package/dist/cliKubeCredential.d.ts +6 -1
  20. package/dist/cliKubeCredential.js +10 -0
  21. package/dist/cliOutput.js +14 -23
  22. package/dist/cliScan.js +3 -4
  23. package/dist/cliStatus.js +1 -3
  24. package/dist/cliSupport.js +7 -10
  25. package/dist/commandRepair.d.ts +1 -1
  26. package/dist/commandRepair.js +1 -1
  27. package/dist/completion.js +4 -4
  28. package/dist/connectorKit/manifests/github.generated.d.ts +1 -1
  29. package/dist/connectorKit/manifests/github.generated.js +13 -7
  30. package/dist/connectorKit/manifests/githubHooks.generated.js +1 -1
  31. package/dist/connectorKit/manifests/railway.generated.js +8 -8
  32. package/dist/connectorKit/manifests/supabase.generated.js +1 -1
  33. package/dist/connectorKit/manifests/supabaseCatalog.generated.js +4 -4
  34. package/dist/controlPlane.generated.d.ts +40 -13
  35. package/dist/controlPlane.generated.js +18 -23
  36. package/dist/controlPlaneBasic.generated.d.ts +2 -5
  37. package/dist/controlPlaneBasic.generated.js +2 -7
  38. package/dist/controlPlaneExec.js +1 -3
  39. package/dist/controlPlaneGithub.generated.d.ts +1 -1
  40. package/dist/controlPlaneGithub.generated.js +1 -1
  41. package/dist/controlPlaneGithubCatalog.generated.d.ts +2 -2
  42. package/dist/controlPlaneGithubCatalog.generated.js +1 -1
  43. package/dist/controlPlaneGithubCli.generated.d.ts +1 -2
  44. package/dist/controlPlaneGithubCli.generated.js +2 -3
  45. package/dist/controlPlaneGuard.d.ts +2 -2
  46. package/dist/controlPlaneGuard.js +2 -2
  47. package/dist/controlPlaneModel.generated.d.ts +2 -1
  48. package/dist/controlPlaneModel.generated.js +10 -2
  49. package/dist/controlPlaneSupabase.js +1 -1
  50. package/dist/execGit.d.ts +14 -10
  51. package/dist/execGit.js +33 -19
  52. package/dist/execVendors.js +3 -6
  53. package/dist/initKeysStep.js +15 -0
  54. package/dist/initPlan.d.ts +1 -1
  55. package/dist/initPlan.js +14 -3
  56. package/dist/initState.d.ts +2 -1
  57. package/dist/keysHere.js +3 -2
  58. package/dist/keysInV1.d.ts +9 -0
  59. package/dist/keysInV1.js +48 -0
  60. package/dist/keysLocal.js +4 -0
  61. package/dist/keysV1Cleanup.d.ts +3 -0
  62. package/dist/keysV1Cleanup.js +37 -0
  63. package/dist/offInV1.d.ts +26 -0
  64. package/dist/offInV1.js +28 -0
  65. package/dist/pluginPin.d.ts +1 -1
  66. package/dist/pluginPin.js +1 -1
  67. package/dist/statusKeys.d.ts +2 -2
  68. package/dist/statusKeys.js +3 -8
  69. package/dist/version.d.ts +1 -1
  70. package/dist/version.js +1 -1
  71. package/npm-shrinkwrap.json +2 -2
  72. package/package.json +1 -1
@@ -8,7 +8,7 @@
8
8
  * Already set up
9
9
  * ✓ GitHub connected
10
10
  * Not changed
11
- * – Railway and AWS keys stay on this computer. Move them any time: passport keys move
11
+ * – Your AWS and Railway keys stay on this computer.
12
12
  *
13
13
  * Then one question: "Use the recommended setup? [Y/n]". No walks each step.
14
14
  * `--dry-run` (and `--json` without `--yes`) stops after the plan.
package/dist/initPlan.js CHANGED
@@ -8,7 +8,7 @@
8
8
  * Already set up
9
9
  * ✓ GitHub connected
10
10
  * Not changed
11
- * – Railway and AWS keys stay on this computer. Move them any time: passport keys move
11
+ * – Your AWS and Railway keys stay on this computer.
12
12
  *
13
13
  * Then one question: "Use the recommended setup? [Y/n]". No walks each step.
14
14
  * `--dry-run` (and `--json` without `--yes`) stops after the plan.
@@ -18,6 +18,7 @@ import { agentFiles } from "./initLocalSteps.js";
18
18
  import { appLabel } from "./initState.js";
19
19
  import { listOf } from "./initUi.js";
20
20
  import { AGENT_NAMES, displayHome } from "./initAgents.js";
21
+ import { issuesCredentials } from "./offInV1.js";
21
22
  function names(list) {
22
23
  return listOf(list.map((entry) => entry.name));
23
24
  }
@@ -59,7 +60,17 @@ function planApps(b, apps, options) {
59
60
  b.kept("apps", options.interactive ? "No apps found on this computer. Answer n to pick some." : "No apps found on this computer.");
60
61
  }
61
62
  }
62
- function planKeys(b, keys, options) {
63
+ function planKeys(b, keys, options, on) {
64
+ // Off in v1: Passport holds no keys, so the keys found stay, --move-keys or not.
65
+ if (!on) {
66
+ if (keys?.local.length) {
67
+ const one = keys.local.length === 1;
68
+ b.kept("keys", `Your ${listOf(keys.names)} ${one ? "key stays" : "keys stay"} on this computer.`);
69
+ }
70
+ for (const file of keys?.envFiles ?? [])
71
+ b.kept("keys", `Used by your app, so Passport leaves it: ${file}`);
72
+ return;
73
+ }
63
74
  if (keys?.local.length) {
64
75
  const one = keys.local.length === 1;
65
76
  if (keys.support === "old")
@@ -136,7 +147,7 @@ function planGuard(b, s, guard) {
136
147
  export function buildPlan(s, d, options) {
137
148
  const b = new PlanBuilder();
138
149
  planApps(b, d.apps, options);
139
- planKeys(b, d.keys, options);
150
+ planKeys(b, d.keys, options, issuesCredentials(s.deps));
140
151
  planAgents(b, s, d.agents);
141
152
  planGuard(b, s, d.guard);
142
153
  // Last, since it's the one step the person finishes in another app.
@@ -6,6 +6,7 @@ import type { Env } from "./cliSupport.js";
6
6
  import type { AgentContext, AgentId } from "./initAgents.js";
7
7
  import type { InstallContext, StableCommand } from "./initInstall.js";
8
8
  import type { InitScreen, InitTerminal } from "./initUi.js";
9
+ import type { CredentialsSwitch } from "./offInV1.js";
9
10
  import type { ScanOptions, ScanResult } from "./scan.js";
10
11
  export declare const PASSPORT_CLOUD = "https://passportmcp.com";
11
12
  /** The production apps init looks for, in the order it lists them. */
@@ -26,7 +27,7 @@ export declare const WAIT_NEXT_SECONDS = 300;
26
27
  export declare const WAIT_CHUNK_SECONDS = 10;
27
28
  export type StepStatus = "done" | "already_set_up" | "skipped" | "needs_attention" | "failed" | "unavailable";
28
29
  export type Gateway = Pick<CliGateway, "callTool" | "fetchApi" | "close" | "origin">;
29
- export type InitDependencies = {
30
+ export type InitDependencies = CredentialsSwitch & {
30
31
  terminal?: InitTerminal;
31
32
  scan?: (options: ScanOptions) => ScanResult;
32
33
  login?: typeof login;
package/dist/keysHere.js CHANGED
@@ -78,11 +78,12 @@ export function keysHere(found, kept, salt) {
78
78
  ...(fingerprint ? { fingerprint } : {}),
79
79
  holdable,
80
80
  kept: isKept,
81
+ // Off in v1 (offInV1.ts): Passport holds no keys, so none is moved.
81
82
  step: isKept
82
- ? `Kept here on purpose. To move it: passport keys move ${key.vendor}`
83
+ ? "Kept here on purpose."
83
84
  : key.vendor === "npm"
84
85
  ? LOCAL_ONLY_STEPS[name]
85
- : `Move it into Passport: passport keys move ${key.vendor}`
86
+ : "Stays on this computer: Passport doesn't hold keys in v1."
86
87
  });
87
88
  }
88
89
  return out;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * `passport keys` in v1 (decided 2026-11-16): Passport holds no keys. The list shows the keys found on this computer,
3
+ * which stay; move, add, rotate, keep and signed-out print one line (offInV1.ts).
4
+ */
5
+ import type { CommandResult, Runtime } from "./cliSupport.js";
6
+ /** The v1 answer for a `passport keys` action, or undefined for one that still runs as before (`shim`). */
7
+ export declare function keysInV1(action: string, runtime: Runtime, deps: {
8
+ home?: string;
9
+ }): CommandResult | undefined;
@@ -0,0 +1,48 @@
1
+ import { shimJson } from "./cliKeysShim.js";
2
+ import { listShims } from "./execShims.js";
3
+ import { listOf } from "./initUi.js";
4
+ import { findKeysHere } from "./keysHere.js";
5
+ import { KEYS_OFF, offResult } from "./offInV1.js";
6
+ import { table, termOf } from "./term.js";
7
+ /** Off in v1: these held keys in Passport. `keys shim` (list, --remove) stays, in cliKeysShim.ts. */
8
+ const OFF_ACTIONS = new Set(["move", "add", "rotate", "keep", "signed-out"]);
9
+ /** The v1 answer for a `passport keys` action, or undefined for one that still runs as before (`shim`). */
10
+ export function keysInV1(action, runtime, deps) {
11
+ if (action === "list")
12
+ return detected(runtime, deps);
13
+ if (OFF_ACTIONS.has(action))
14
+ return offResult(`keys ${action}`, KEYS_OFF);
15
+ return undefined;
16
+ }
17
+ /** What `passport keys` lists in v1: the keys found on this computer, which stay. Reads no server. */
18
+ function detected(runtime, deps) {
19
+ const found = findKeysHere({ env: runtime.env, ...(deps.home ? { home: deps.home } : {}) });
20
+ const seen = new Set();
21
+ const local = found.filter((key) => {
22
+ const where = `${key.vendor}\u0000${key.location}`;
23
+ if (seen.has(where))
24
+ return false;
25
+ seen.add(where);
26
+ return true;
27
+ });
28
+ const term = termOf((runtime.stdout ?? {}), runtime.env);
29
+ const lines = local.length
30
+ ? [
31
+ "Keys on this computer:",
32
+ ...table(local.map((key) => [` ${key.label}`, key.location]), term.width, { indent: " " }),
33
+ `${local.length === 1 ? "It stays" : "They stay"} here: Passport doesn't hold keys in v1.`
34
+ ]
35
+ : ["No CLI keys on this computer."];
36
+ const shims = listShims(runtime.env);
37
+ if (shims.length) {
38
+ const typed = listOf(shims.map((shim) => shim.binary));
39
+ lines.push(`Typing ${typed} ${shims.length === 1 ? "runs" : "run"} ${shims.length === 1 ? "it" : "them"} through Passport.`);
40
+ }
41
+ return {
42
+ json: {
43
+ onThisComputer: local.map((key) => ({ vendor: key.vendor, label: key.label, location: key.location })),
44
+ shims: shims.map(shimJson)
45
+ },
46
+ human: lines.join("\n")
47
+ };
48
+ }
package/dist/keysLocal.js CHANGED
@@ -22,6 +22,7 @@ import { join, relative, isAbsolute } from "node:path";
22
22
  import { readBoundedUtf8File } from "./boundedFile.js";
23
23
  import { EXEC_TOKEN_PAGES, EXEC_VENDOR_NAMES } from "./execVendors.js";
24
24
  import { findOnPath } from "./initInstall.js";
25
+ import { removesLocalKeys } from "./offInV1.js";
25
26
  import { removeKeychainItems, stripeKeychain, supabaseKeychain } from "./keysKeychain.js";
26
27
  import { withoutAwsProfileKeys, withoutJsonFields, withoutTomlKeys, writeAtomic } from "./keysLocalEdit.js";
27
28
  import { firebaseKeys, gcloudKeys, removeGcloudAccount } from "./keysLocalGoogle.js";
@@ -476,6 +477,9 @@ function stillThere(key, context) {
476
477
  * stays in Passport either way.
477
478
  */
478
479
  export async function removeLocalCopy(key, context, runner = defaultRunner) {
480
+ // Off in v1 (decided 2026-11-16): Passport never removes or edits a CLI's own sign-in.
481
+ if (!removesLocalKeys())
482
+ return { localCopy: "logout_failed", left: `${key.location} stays: Passport keeps no keys in v1.` };
479
483
  const name = EXEC_VENDOR_NAMES[key.vendor];
480
484
  const removal = key.removal;
481
485
  if (!removal)
@@ -0,0 +1,3 @@
1
+ export declare const V1_CLEARED = "keys-v1-cleared";
2
+ /** True when it cleared something this run. */
3
+ export declare function clearKeyCustodyOnce(now?: number): boolean;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Once, on the first run of a CLI with credentials off in v1 (decided 2026-11-16): clear what the switched-off key
3
+ * custody left behind in $PASSPORT_HOME, so nothing acts on it. The "Keep my CLIs signed out" answer (each profile's
4
+ * keys choices), the exec-vendors marker (`exec-keys/`), and the moved-keys manifest (`keys-moved.json`). Keys kept
5
+ * here on purpose stay recorded. Never throws; a folder that doesn't exist yet is left alone.
6
+ */
7
+ import { existsSync, readdirSync, rmSync, writeFileSync } from "node:fs";
8
+ import { join } from "node:path";
9
+ import { credentialDir } from "./credentialStorage.js";
10
+ import { readKeysChoices, setSignedOut } from "./keysKept.js";
11
+ export const V1_CLEARED = "keys-v1-cleared";
12
+ /** True when it cleared something this run. */
13
+ export function clearKeyCustodyOnce(now = Date.now()) {
14
+ try {
15
+ const dir = credentialDir();
16
+ const done = join(dir, V1_CLEARED);
17
+ if (!existsSync(dir) || existsSync(done))
18
+ return false;
19
+ rmSync(join(dir, "keys-moved.json"), { force: true });
20
+ rmSync(join(dir, "exec-keys"), { recursive: true, force: true });
21
+ const choices = join(dir, "keys-choices");
22
+ if (existsSync(choices)) {
23
+ for (const file of readdirSync(choices)) {
24
+ if (!file.endsWith(".json"))
25
+ continue;
26
+ const profile = file.slice(0, -".json".length);
27
+ if (readKeysChoices(profile).signedOut?.on)
28
+ setSignedOut(profile, false, now);
29
+ }
30
+ }
31
+ writeFileSync(done, `${now}\n`, { mode: 0o600 });
32
+ return true;
33
+ }
34
+ catch {
35
+ return false;
36
+ }
37
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Passport issues no credentials in v1 (decided 2026-11-16, docs/DECISIONS.md):
3
+ * it decides Allow or Block and records, and never gives an agent or a CLI a
4
+ * working app credential. The commands that held keys or issued tokens are
5
+ * switched off, not deleted: `ISSUES_CREDENTIALS` gates their code, and each
6
+ * prints one line from here instead, reading and sending nothing.
7
+ *
8
+ * passport keys move is off in v1: Passport no longer holds keys. Your CLIs keep their own sign-ins.
9
+ */
10
+ import type { CommandResult } from "./cliSupport.js";
11
+ /** False in v1: key custody, git tokens and cluster tokens are off. */
12
+ export declare const ISSUES_CREDENTIALS: boolean;
13
+ /** What a command's dependencies take: tests turn the switched-off code on to keep it covered until it's deleted. */
14
+ export type CredentialsSwitch = {
15
+ issuesCredentials?: boolean;
16
+ };
17
+ export declare function issuesCredentials(deps?: CredentialsSwitch): boolean;
18
+ export declare function allowKeyRemovalForTests(on: boolean): void;
19
+ export declare function removesLocalKeys(): boolean;
20
+ export declare const KEYS_OFF = "Passport no longer holds keys. Your CLIs keep their own sign-ins.";
21
+ export declare const GIT_OFF = "Passport no longer issues git tokens. git keeps using your own sign-in.";
22
+ export declare const KUBE_OFF = "Passport no longer issues cluster tokens. Point kubectl at your own credentials.";
23
+ /** "passport keys move is off in v1: …" */
24
+ export declare function offLine(command: string, reason: string): string;
25
+ /** An off command's answer: the line on stdout, exit 0. */
26
+ export declare function offResult(command: string, reason: string): CommandResult;
@@ -0,0 +1,28 @@
1
+ /** False in v1: key custody, git tokens and cluster tokens are off. */
2
+ export const ISSUES_CREDENTIALS = false;
3
+ export function issuesCredentials(deps) {
4
+ return deps?.issuesCredentials ?? ISSUES_CREDENTIALS;
5
+ }
6
+ /**
7
+ * Off in v1: Passport never removes or edits a CLI's own sign-in on this computer (`removeLocalCopy`). Only a test
8
+ * of the switched-off move code turns it back on, and turns it off again after.
9
+ */
10
+ let removalForTests = false;
11
+ export function allowKeyRemovalForTests(on) {
12
+ removalForTests = on;
13
+ }
14
+ export function removesLocalKeys() {
15
+ return removalForTests;
16
+ }
17
+ export const KEYS_OFF = "Passport no longer holds keys. Your CLIs keep their own sign-ins.";
18
+ export const GIT_OFF = "Passport no longer issues git tokens. git keeps using your own sign-in.";
19
+ export const KUBE_OFF = "Passport no longer issues cluster tokens. Point kubectl at your own credentials.";
20
+ /** "passport keys move is off in v1: …" */
21
+ export function offLine(command, reason) {
22
+ return `passport ${command} is off in v1: ${reason}`;
23
+ }
24
+ /** An off command's answer: the line on stdout, exit 0. */
25
+ export function offResult(command, reason) {
26
+ const message = offLine(command, reason);
27
+ return { json: { off: true, command, message }, human: message };
28
+ }
@@ -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.41.0";
7
+ export declare const PLUGIN_PIN = "0.44.0";
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.41.0";
7
+ export const PLUGIN_PIN = "0.44.0";
@@ -3,12 +3,12 @@
3
3
  * computer, read from the same list `passport scan` prints and Work › To fix
4
4
  * counts (keysHere.ts). "Passport holds it" is only true when no key for that
5
5
  * app is also on this computer: an agent that finds the local one can skip
6
- * Passport, so that case reads plainly, with the step to move it.
6
+ * Passport, so that case reads plainly. Moving keys is off in v1
7
+ * (offInV1.ts), so no row says to move one.
7
8
  *
8
9
  * ✓ Cloudflare in Passport · used 2 h ago
9
10
  * ! Railway used 5 h ago, but also on this computer
10
11
  * ~/.railway/config.json
11
- * Run: passport keys move railway
12
12
  * ! npm on this computer, not in Passport
13
13
  * ~/.npmrc
14
14
  * Passport can't hold npm tokens yet. Run npm logout when you aren't publishing.
@@ -6,12 +6,7 @@ export function keyRows(held, local, use) {
6
6
  const copies = here(key.vendor);
7
7
  const loose = copies.filter((copy) => !copy.kept);
8
8
  if (key.status !== "ok") {
9
- return {
10
- mark: "warn",
11
- name: key.name,
12
- detail: key.status.replace(/_/g, " "),
13
- note: `Run: passport keys move ${key.vendor}`
14
- };
9
+ return { mark: "warn", name: key.name, detail: key.status.replace(/_/g, " ") };
15
10
  }
16
11
  const used = use(key.lastUsedAt);
17
12
  if (loose.length) {
@@ -19,7 +14,7 @@ export function keyRows(held, local, use) {
19
14
  mark: "warn",
20
15
  name: key.name,
21
16
  detail: key.lastUsedAt ? `${used}, but also on this computer` : "in Passport, but also on this computer",
22
- note: `${where(loose)}\nRun: passport keys move ${key.vendor}`
17
+ note: where(loose)
23
18
  };
24
19
  }
25
20
  return {
@@ -41,7 +36,7 @@ export function keyRows(held, local, use) {
41
36
  mark: "warn",
42
37
  name: first.name,
43
38
  detail: "on this computer, not in Passport",
44
- note: `${where(copies)}\n${first.vendor === "npm" ? first.step : `Run: passport keys move ${vendor}`}`
39
+ note: first.vendor === "npm" ? `${where(copies)}\n${first.step}` : where(copies)
45
40
  });
46
41
  }
47
42
  return rows;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.41.0";
1
+ export declare const VERSION = "0.44.0";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Keep in lockstep with bridge/package.json.
2
- export const VERSION = "0.41.0";
2
+ export const VERSION = "0.44.0";
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "passport-bridge",
3
- "version": "0.41.0",
3
+ "version": "0.44.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "passport-bridge",
9
- "version": "0.41.0",
9
+ "version": "0.44.0",
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.41.0",
3
+ "version": "0.44.0",
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": {