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
@@ -37,16 +37,14 @@ export type DailyCheck = {
37
37
  kept: Record<string, number>;
38
38
  };
39
39
  /**
40
- * Look at every key `keys move` removed. With the person's "Keep my CLIs
41
- * signed out" yes, a returned key whose CLI Passport holds a working key for
42
- * (and that isn't kept here on purpose) is removed again, the same way
43
- * `keys move` removes it. Reads a handful of small files.
40
+ * Look at every key `keys move` removed and report which are here again. Since v1 nothing is ever removed: Passport
41
+ * keeps no keys, so a CLI signed in on its own computer is expected. Reads a handful of small files.
44
42
  */
45
43
  export declare function dailyKeysCheck(context: {
46
44
  env: NodeJS.ProcessEnv;
47
45
  home?: string;
48
46
  platform?: NodeJS.Platform;
49
- }, profile: string | undefined, runner?: RemovalRunner): Promise<DailyCheck>;
47
+ }, profile: string | undefined, _runner?: RemovalRunner): Promise<DailyCheck>;
50
48
  /**
51
49
  * The daily check: tell Passport what is here (counts only), which moved
52
50
  * keys came back, which are gone again, and which Passport removed itself.
@@ -71,38 +71,21 @@ export function rememberMovedKey(key, now = Date.now()) {
71
71
  }
72
72
  }
73
73
  /**
74
- * Look at every key `keys move` removed. With the person's "Keep my CLIs
75
- * signed out" yes, a returned key whose CLI Passport holds a working key for
76
- * (and that isn't kept here on purpose) is removed again, the same way
77
- * `keys move` removes it. Reads a handful of small files.
74
+ * Look at every key `keys move` removed and report which are here again. Since v1 nothing is ever removed: Passport
75
+ * keeps no keys, so a CLI signed in on its own computer is expected. Reads a handful of small files.
78
76
  */
79
- export async function dailyKeysCheck(context, profile, runner) {
80
- const { findLocalKeys, removeLocalCopy } = await import("./keysLocal.js");
77
+ export async function dailyKeysCheck(context, profile, _runner) {
78
+ const { findLocalKeys } = await import("./keysLocal.js");
81
79
  const { readKeysChoices } = await import("./keysKept.js");
82
- const { readExecVendors } = await import("./execMarker.js");
83
80
  const { localCounts } = await import("./keysReport.js");
84
81
  const { npmKeys } = await import("./keysHere.js");
85
82
  const local = { ...context, home: context.home ?? (context.env.HOME || homedir()) };
86
83
  const choices = readKeysChoices(profile);
87
- const working = profile ? readExecVendors(profile) : new Set();
88
84
  const entries = readMovedKeys();
89
85
  const checked = [...new Set(entries.map((entry) => entry.vendor))];
90
- let found = findLocalKeys(local);
91
- const returned = found.filter((key) => entries.some((entry) => entry.vendor === key.vendor && entry.location === key.location));
86
+ // Off in v1 (decided 2026-11-16): a key that came back is only reported, never removed, whatever was answered.
87
+ const found = findLocalKeys(local);
92
88
  const autoRemoved = new Set();
93
- if (choices.signedOut?.on) {
94
- for (const key of returned) {
95
- if (choices.kept[key.vendor] || !working.has(key.vendor))
96
- continue;
97
- const removed = await removeLocalCopy(key, local, runner);
98
- if (removed.localCopy !== "removed")
99
- continue;
100
- rememberMovedKey(key);
101
- autoRemoved.add(key.vendor);
102
- }
103
- if (autoRemoved.size)
104
- found = findLocalKeys(local);
105
- }
106
89
  const still = new Set(found
107
90
  .filter((key) => entries.some((entry) => entry.vendor === key.vendor && entry.location === key.location))
108
91
  .map((key) => key.vendor));
@@ -1,13 +1,16 @@
1
1
  /**
2
2
  * `passport keys shim`, and the offer after `keys move`: the commands that
3
3
  * keep a moved CLI working when it's typed (`execShims.ts` writes them).
4
+ * Off in v1 (offInV1.ts): adding one prints one line; listing and --remove
5
+ * stay so old shims can be cleaned up.
4
6
  */
5
7
  import { type ParsedArgs } from "./cliArgs.js";
6
8
  import { type CommandResult, type Runtime } from "./cliSupport.js";
7
9
  import { type ShimInfo } from "./execShims.js";
8
10
  import { type ExecVendor } from "./execVendors.js";
11
+ import { type CredentialsSwitch } from "./offInV1.js";
9
12
  /** What the shim commands take from `keys`' dependencies (tests). */
10
- export type ShimDependencies = {
13
+ export type ShimDependencies = CredentialsSwitch & {
11
14
  platform?: NodeJS.Platform;
12
15
  /** What a shim runs to reach Passport. */
13
16
  passportCommand?: string[];
@@ -1,6 +1,8 @@
1
1
  /**
2
2
  * `passport keys shim`, and the offer after `keys move`: the commands that
3
3
  * keep a moved CLI working when it's typed (`execShims.ts` writes them).
4
+ * Off in v1 (offInV1.ts): adding one prints one line; listing and --remove
5
+ * stay so old shims can be cleaned up.
4
6
  */
5
7
  import { bool } from "./cliArgs.js";
6
8
  import { failure } from "./cliSupport.js";
@@ -8,6 +10,7 @@ import { readExecVendors } from "./execMarker.js";
8
10
  import { findVendorBinary, installShims, listShims, removeShims, shimBinaries, shimPathAdvice } from "./execShims.js";
9
11
  import { EXEC_VENDOR_NAMES, execVendorOf } from "./execVendors.js";
10
12
  import { listOf } from "./initUi.js";
13
+ import { issuesCredentials, KEYS_OFF, offResult } from "./offInV1.js";
11
14
  import { pathLines } from "./pathLines.js";
12
15
  import { table } from "./term.js";
13
16
  /** A shim as JSON: no home-folder paths beyond Passport's own. */
@@ -32,7 +35,9 @@ export async function shim(args, runtime, deps, profile) {
32
35
  const advice = shimPathAdvice(shims, runtime.env, platform);
33
36
  const lines = shims.length
34
37
  ? table(shims.map((entry) => [entry.binary, SHIM_STATE_WORDS[entry.state]]), Number.POSITIVE_INFINITY)
35
- : ["No shims yet. To keep typing a CLI whose key Passport holds, add one.", "Run: passport keys shim <cli>"];
38
+ : issuesCredentials(deps)
39
+ ? ["No shims yet. To keep typing a CLI whose key Passport holds, add one.", "Run: passport keys shim <cli>"]
40
+ : ["No Passport shims on this computer."];
36
41
  if (advice)
37
42
  lines.push(...pathLines(advice));
38
43
  return { json: { shims: shims.map(shimJson), ...(advice ? { pathLine: advice } : {}) }, human: lines.join("\n") };
@@ -49,6 +54,9 @@ export async function shim(args, runtime, deps, profile) {
49
54
  : "No Passport shim to remove."
50
55
  };
51
56
  }
57
+ // Off in v1: a shim ran a CLI with the key Passport held. Listing and --remove stay, to clean old ones up.
58
+ if (!issuesCredentials(deps))
59
+ return offResult("keys shim", KEYS_OFF);
52
60
  const vendor = execVendorOf(target);
53
61
  if (!vendor)
54
62
  return failure(`passport keys shim works for ${SHIM_USAGE}.`, 6, "usage");
@@ -16,10 +16,15 @@
16
16
  *
17
17
  * `passport kube-credential setup` prints the kubectl config lines that point
18
18
  * a context at this plugin. It never writes the kubeconfig.
19
+ *
20
+ * Off in v1 (offInV1.ts): Passport issues no cluster tokens. Every form of
21
+ * the command prints one line on stderr and exits 1, with no request; the
22
+ * code above is switched off, not deleted.
19
23
  */
20
24
  import { type ParsedArgs } from "./cliArgs.js";
21
25
  import { type CommandResult, type Runtime } from "./cliSupport.js";
22
26
  import { type LinkFs } from "./envLinkFs.js";
27
+ import { type CredentialsSwitch } from "./offInV1.js";
23
28
  export declare const KUBE_CREDENTIAL_PATH = "/api/my/kube/credential";
24
29
  export declare const KUBE_EXEC_API_VERSION = "client.authentication.k8s.io/v1beta1";
25
30
  /** Use a cached token only with at least this long left. */
@@ -33,7 +38,7 @@ type Binding = {
33
38
  endpoint: string;
34
39
  refresh: string;
35
40
  };
36
- export type KubeCredentialDependencies = {
41
+ export type KubeCredentialDependencies = CredentialsSwitch & {
37
42
  /** The authenticated call (tests); the default is the hook's cached-access path. */
38
43
  api?: ApiCall;
39
44
  now?: () => number;
@@ -16,6 +16,10 @@
16
16
  *
17
17
  * `passport kube-credential setup` prints the kubectl config lines that point
18
18
  * a context at this plugin. It never writes the kubeconfig.
19
+ *
20
+ * Off in v1 (offInV1.ts): Passport issues no cluster tokens. Every form of
21
+ * the command prints one line on stderr and exits 1, with no request; the
22
+ * code above is switched off, not deleted.
19
23
  */
20
24
  import { lstatSync } from "node:fs";
21
25
  import { homedir } from "node:os";
@@ -27,6 +31,7 @@ import { failure, readBoundedJson, resolveCliAuth, safeApiError, sanitize, timeo
27
31
  import { credentialDir, enforceOwner, writePrivateAtomic } from "./credentialStorage.js";
28
32
  import { NODE_LINK_FS } from "./envLinkFs.js";
29
33
  import { kubeconfigFiles, readKubeconfig } from "./kubeconfig.js";
34
+ import { issuesCredentials, KUBE_OFF, offLine } from "./offInV1.js";
30
35
  export const KUBE_CREDENTIAL_PATH = "/api/my/kube/credential";
31
36
  export const KUBE_EXEC_API_VERSION = "client.authentication.k8s.io/v1beta1";
32
37
  const API_VERSIONS = new Set([KUBE_EXEC_API_VERSION, "client.authentication.k8s.io/v1"]);
@@ -272,6 +277,11 @@ function setup(args, runtime, deps) {
272
277
  /* ---------------------------------- entry ---------------------------------- */
273
278
  export async function kubeCredential(args, runtime, deps = {}) {
274
279
  const [sub] = args.positionals;
280
+ // Off in v1: kubectl needs a credential or a clear failure, so one line on stderr and exit 1. No request.
281
+ if (!issuesCredentials(deps)) {
282
+ runtime.stderr.write(`${offLine("kube-credential", KUBE_OFF)}\n`);
283
+ return { json: null, silent: true, exitCode: 1 };
284
+ }
275
285
  if (sub === "setup")
276
286
  return setup(args, runtime, deps);
277
287
  if (sub !== undefined) {
package/dist/cliOutput.js CHANGED
@@ -20,7 +20,7 @@ const EXAMPLES = {
20
20
  help: [
21
21
  ["passport init", "Set up Passport for your agents"],
22
22
  ["passport status", "Your setup on one screen"],
23
- ["passport exec -- railway up", "Run a CLI with a key Passport holds"],
23
+ ["passport exec -- railway up", "Run a CLI after Passport decides"],
24
24
  ["passport help <command>", "Every option for one command"]
25
25
  ],
26
26
  init: [
@@ -41,19 +41,10 @@ const EXAMPLES = {
41
41
  ["passport exec -- railway up", "Run it after your rules decide"],
42
42
  ["passport exec --verbose -- gh pr merge 42", "Also say which key was issued"]
43
43
  ],
44
- "git-credential": [
45
- ["passport git-credential setup", "Send git pushes to github.com through Passport"],
46
- ["passport git-credential setup --remove", "Go back to your own GitHub sign-in"]
47
- ],
48
- "kube-credential": [
49
- ["passport kube-credential setup", "The kubectl lines for your current context"],
50
- ["passport kube-credential setup --context prod", "The same, for another context"]
51
- ],
44
+ "git-credential": [["passport git-credential setup --remove", "Take Passport out of git's config"]],
52
45
  keys: [
53
- ["passport keys", "Keys Passport holds, and any still on this computer"],
54
- ["passport keys move railway", "Move the Railway key into Passport"],
55
- ["passport keys add vercel", "Store a key you paste"],
56
- ["passport keys rotate railway", "Replace the Railway key with a new one"]
46
+ ["passport keys", "The CLI keys on this computer"],
47
+ ["passport keys shim --remove all", "Remove Passport's old shims"]
57
48
  ],
58
49
  scan: [
59
50
  ["passport scan", "Keys your agents can reach from this folder"],
@@ -117,8 +108,8 @@ const HELP_GROUPS = [
117
108
  [
118
109
  "Daily",
119
110
  [
120
- ["keys", "Move CLI keys from this computer into Passport"],
121
- ["exec", "Run a vendor CLI with a key Passport holds"],
111
+ ["keys", "List the CLI keys on this computer"],
112
+ ["exec", "Run a vendor CLI after Passport decides"],
122
113
  ["hook", "Record the CLIs your agents run, and decide before they run"],
123
114
  ["connections", "Your connections: what's connected and what needs you"],
124
115
  ["connect", "Sign in to your apps"],
@@ -144,8 +135,8 @@ const HELP_GROUPS = [
144
135
  [
145
136
  ["resources", "List or read MCP resources"],
146
137
  ["prompts", "List or get MCP prompts"],
147
- ["kube-credential", "Sign kubectl in to EKS and GKE clusters through Passport"],
148
- ["git-credential", "Send git pushes to GitHub through Passport"],
138
+ ["kube-credential", "Off in v1: Passport issues no cluster tokens"],
139
+ ["git-credential", "Off in v1: git uses your own sign-in"],
149
140
  ["completion", "Generate bash, zsh, or fish completion"],
150
141
  ["session", "Reuse one authenticated MCP session for NDJSON commands"],
151
142
  ["access", "Use the signed managed access gateway"],
@@ -167,19 +158,19 @@ export function commandGroups(all) {
167
158
  function helpText(verb, all = false) {
168
159
  const details = {
169
160
  // copy-style-allow double-space: help columns line up
170
- init: "passport init [--yes] [--dry-run] [--move-keys] [--no-open] [--cloud <origin>] [--skip-apps] [--skip-agents] [--skip-guard] [--verbose] [--json]\nnpx passport-bridge@latest init [same options]\nnpx passport-bridge@latest init --org <pek_key> --yes [--agents <list>] [--cloud <origin>]\nsudo npx passport-bridge@latest init --org <pek_key> --yes --lock [--strict] [--agents <list>]\nSets up Passport in one pass: scans for keys your agents can reach, signs you in (or up), then shows one plan before changing anything: the apps it connects, the agents it adds Passport to, the guard for shell commands, every file it edits (each backed up first), and what stays as it is. One question applies it; n goes step by step. Run it again any time: finished steps are left as they are, and with nothing to change it asks nothing.\n --yes use the recommended setup without asking (needed without a terminal); never waits for app sign-ins; CLI keys stay on this computer\n --dry-run show the plan and change nothing\n --move-keys also move CLI keys into Passport and sign those CLIs out\n --no-open print links instead of opening a browser\n --cloud <url> a self-hosted Passport\n --skip-apps leave out connecting apps\n --skip-agents leave out adding Passport to agents\n --skip-guard leave out the guard\n --verbose show the full scan\n --json with --yes: one JSON summary with each step's status and the plan; without --yes: the plan only\nFor your company (MDM and scripts), --org sets up every agent on this computer without asking anything or signing in: a stable copy of the CLI, Passport in each detected agent at your company's one URL, and the guard and audit hooks. People sign in later from each agent. It prints one line per agent, exits 0 even when no agents are found, and repairs anything that drifted when run again.\n --org <key> your enrollment key (pek_…)\n --agents <list> only these: claude-code, codex, cursor, vscode, claude (--lock: the first three)\n --lock run as root: put the guard in each agent's managed settings, where people can't turn it off. Without administrator rights it writes nothing and prints what to deploy through MDM\n --strict with --lock: allow only managed hooks, and block commands when the guard can't run\nTo undo it, remove the guard, then the \"passport\" entry from each agent.\nRun: passport hook uninstall --agent <agent> --apply",
161
+ init: "passport init [--yes] [--dry-run] [--move-keys] [--no-open] [--cloud <origin>] [--skip-apps] [--skip-agents] [--skip-guard] [--verbose] [--json]\nnpx passport-bridge@latest init [same options]\nnpx passport-bridge@latest init --org <pek_key> --yes [--agents <list>] [--cloud <origin>]\nsudo npx passport-bridge@latest init --org <pek_key> --yes --lock [--strict] [--agents <list>]\nSets up Passport in one pass: scans for keys your agents can reach, signs you in (or up), then shows one plan before changing anything: the apps it connects, the agents it adds Passport to, the guard for shell commands, every file it edits (each backed up first), and what stays as it is. One question applies it; n goes step by step. Run it again any time: finished steps are left as they are, and with nothing to change it asks nothing.\n --yes use the recommended setup without asking (needed without a terminal); never waits for app sign-ins; CLI keys stay on this computer\n --dry-run show the plan and change nothing\n --move-keys off in v1: accepted, moves nothing\n --no-open print links instead of opening a browser\n --cloud <url> a self-hosted Passport\n --skip-apps leave out connecting apps\n --skip-agents leave out adding Passport to agents\n --skip-guard leave out the guard\n --verbose show the full scan\n --json with --yes: one JSON summary with each step's status and the plan; without --yes: the plan only\nFor your company (MDM and scripts), --org sets up every agent on this computer without asking anything or signing in: a stable copy of the CLI, Passport in each detected agent at your company's one URL, and the guard and audit hooks. People sign in later from each agent. It prints one line per agent, exits 0 even when no agents are found, and repairs anything that drifted when run again.\n --org <key> your enrollment key (pek_…)\n --agents <list> only these: claude-code, codex, cursor, vscode, claude (--lock: the first three)\n --lock run as root: put the guard in each agent's managed settings, where people can't turn it off. Without administrator rights it writes nothing and prints what to deploy through MDM\n --strict with --lock: allow only managed hooks, and block commands when the guard can't run\nTo undo it, remove the guard, then the \"passport\" entry from each agent.\nRun: passport hook uninstall --agent <agent> --apply",
171
162
  login:
172
163
  // copy-style-allow double-space: help columns line up
173
164
  "passport login [--workspace <id>] [--cloud <origin>] [--agent <id>] [--profile <name>] [--no-open] [--switch] [--verbose]\npassport login --complete <id>\nSigns in through the browser with a short code, stores a rotating sign-in for the CLI, and makes that profile active. Check the code in the browser matches the one in your terminal before you approve. Without --workspace, login reuses the workspace and cloud of the saved profile it refreshes, or the one workspace all saved profiles share; it never chooses between several. With no saved workspace, the browser signs you in or up and you pick or create a workspace. Passport Cloud is the default; self-hosted servers take --cloud.\n Already signed in: login says as whom and asks Switch? [y/N]. --switch skips the question and lets the browser pick again.\n Without a terminal, or with --json: two steps. Login prints {verification_url, code, next_step} and exits; after the code is approved, run next_step (passport login --complete <id>) to finish.\n --verbose also show the profile name and where the sign-in is saved",
174
165
  logout: "passport logout [--profile <name>]\nRevokes the rotating sign-in and always removes the local profile.",
175
166
  profiles: "passport profiles\nLists saved profiles and marks the active profile. Works offline.",
176
167
  use: "passport use <name>\nSelects a saved profile as the default for subsequent commands. Works offline.",
177
- status: "passport status\nStart here. Shows you, your workspace, and this computer; each agent's guard and its fix; apps; keys, each with whether Passport holds it, whether a key for that app is also on this computer (an agent could use that one and skip Passport), and the step to move it; and the CLI version. It sends Passport how many keys each app has here; never a key or a file. When a command fails, passport doctor checks why.\nJSON: {workspace,member,endpoint,auth,profile?,client,mcps:[{app,name,status,toolCount}],guard?:{agents,repaired?},computer,keys?,localKeys?:[{vendor,name,label,location,fingerprint?,holdable,kept,step}],cli}",
168
+ status: "passport status\nStart here. Shows you, your workspace, and this computer; each agent's guard and its fix; apps; the CLI keys found on this computer; and the CLI version. It sends Passport how many keys each app has here; never a key or a file. When a command fails, passport doctor checks why.\nJSON: {workspace,member,endpoint,auth,profile?,client,mcps:[{app,name,status,toolCount}],guard?:{agents,repaired?},computer,keys?,localKeys?:[{vendor,name,label,location,fingerprint?,holdable,kept,step}],cli}",
178
169
  // copy-style-allow double-space: help columns line up
179
- exec: "passport exec [--verbose] [--mask | --no-masking] -- <cli> [args…]\nRuns railway, gh, vercel, wrangler, supabase, stripe, aws, neonctl, flyctl, gcloud, firebase, az, or azd with a key Passport holds, after your rules decide. The key reaches only that command's environment, short-lived where the vendor allows (GitHub App tokens, 15-minute AWS sessions, 15-minute Cloudflare tokens, 1-hour Google and Azure tokens). The exit code passes through unchanged.\n Output: when stdout isn't a terminal (an agent's shell, a pipe, a log), any copy of the key the CLI prints (raw, base64, or URL-encoded) reads <hidden by Passport>, since that output is kept and read later. In a terminal the CLI gets the terminal itself (colors, prompts), unmasked.\n --mask hide the key in a terminal too (the CLI then writes to a pipe)\n --no-masking never hide it (in a shim, set PASSPORT_EXEC_NO_MASKING=1)\n --verbose say which key was issued (on stderr)\n Blocked: exit 5 with the reason, at once.\n No key in Passport, or it stopped working: exit 3.\n Offline: nothing runs (exit 1); exec never uses a key on this computer.\n Refuses shells, env, and subcommands that would print the key or run another program with it.",
180
- "git-credential": "passport git-credential setup [--remove]\npassport git-credential get|store|erase (git runs these)\ngit's sign-in for github.com: git runs it for each fetch and push, and it hands git a 1-hour token from your workspace's GitHub App, read-only for a fetch, Contents write for a push. Before a push gets its token, Passport decides it like the guard does, so a blocked push stops with the reason. GitHub then reports the push as Passport's App, so it counts as through Passport. Repositories the App doesn't cover use the sign-in git used before. No token is stored on this computer.\nsetup: adds Passport's helper for https://github.com/ to your global git config (backed up once to <file>.passport-backup), and sends pushes from SSH remotes over HTTPS so they reach it. --remove takes out exactly what setup added.",
181
- "kube-credential": "passport kube-credential --cluster <key>\npassport kube-credential setup [--context <name>]\nkubectl's sign-in for EKS and GKE clusters: kubectl and helm run it, and it hands them a short-lived token Passport makes from the key it holds (14 minutes from the AWS key for EKS, 1 hour from the Google Cloud key for GKE; the production key for a cluster in Production), so no cluster token stays on this computer. It keeps each token, readable only by you, until a minute before it expires, so most commands don't wait on the network. Errors are one line on stderr, exit 1.\nsetup: prints the two kubectl config lines that point a context (--context, else the current one) at Passport, and the line to go back. It never edits your kubeconfig.",
182
- keys: "passport keys [list]\npassport keys move [<cli>] [--yes] [--no-shim]\npassport keys add <cli> [<key file>]\npassport keys rotate <app>\npassport keys shim [<cli>] [--remove]\npassport keys keep <cli> [--remove]\npassport keys signed-out [on|off]\nmove: finds CLI sign-ins on this computer (Railway, GitHub CLI, Vercel, Wrangler, Supabase, Stripe, AWS, gcloud, Firebase, and keys in Claude Code's settings), stores each in Passport after you confirm it ([y/N]), then signs that CLI out here. With <cli>, only that one. When Passport already holds a different key for that CLI, every agent that uses it would switch, so you type the CLI's name at a terminal to replace it; no flag does it, and without a terminal both keys stay. .env files are never touched: your apps need them. add: stores a key you paste (read from stdin, never echoed); for gcloud and firebase, give the key file: passport keys add gcloud <key.json>; for az and azd, the service principal az ad sp create-for-rbac prints. Agents then use the keys through passport exec.\nrotate: replaces a key Passport holds. It shows where to make the new key, asks for it at a terminal (never echoed), and Passport checks it with one harmless read at the provider before it swaps anything; a refused key leaves the old one. It then prints where to revoke the old key. The old key stays restorable in Apps for 7 days, and your admins are told.\nshim: so typing railway keeps working after its key moves, a small railway command in Passport's folder (~/.passport/cli/bin) runs passport exec -- railway. move offers one for each CLI it moved ([Y/n]; --yes installs them, --no-shim skips). Put the folder first on PATH (the line is printed when it isn't). With no <cli>, lists them; --remove <cli|all> takes them out. A shim goes by itself when Passport no longer holds that key, and when you sign out of the last profile.\nWhen Passport already holds a working key, move signs out the copy here, browser sign-ins included, and agents asking to sign a CLI in are told to run it through Passport.\nkeep: keeps a CLI signed in on this computer on purpose, for dev loops (railway run, vercel dev) or releases. Passport never removes it or lists it as a chore, and its sign-in runs. --remove undoes it. wrangler dev runs through passport exec with a short-lived key instead, when your key can mint one.\nsigned-out on: when a CLI signs in here again, Passport removes that copy once a day while it holds a working key (move asks once). off stops it.",
170
+ exec: "passport exec -- <cli> [args…]\nRuns railway, gh, vercel, wrangler, supabase, stripe, aws, neonctl, flyctl, gcloud, firebase, az, or azd after your rules decide (git too: each push is decided as the guard decides it). The CLI runs with your own sign-in and this shell's environment: Passport issues no key (v1). The output and exit code pass through unchanged.\n Blocked, or Passport couldn't decide in time: exit 5 with the reason, at once.\n Offline: nothing runs (exit 1).\n Refuses shells, env, and subcommands that would run another program.",
171
+ "git-credential": "passport git-credential setup --remove\npassport git-credential get|store|erase (git runs these)\nOff in v1: Passport issues no git tokens, and git uses your own sign-in. If git still runs Passport's helper, get passes the request to the helpers git used before setup (else answers nothing, so git asks as usual), and setup changes nothing. The guard still decides each git push.\n--remove takes out exactly what setup added.",
172
+ "kube-credential": "passport kube-credential\nOff in v1: Passport issues no cluster tokens. It prints one line on stderr and exits 1, so kubectl stops with a clear error. Point the kubectl context at your own credentials.",
173
+ keys: "passport keys [list]\npassport keys shim [--remove <cli|all>]\nLists the CLI keys found on this computer (Railway, GitHub CLI, Vercel, Wrangler, Supabase, Stripe, AWS, gcloud, Firebase, npm, and keys in Claude Code's settings). They stay: in v1 Passport holds no keys, and your CLIs keep their own sign-ins. Nothing is read from or sent to Passport.\nshim: lists the commands Passport wrote in its folder (~/.passport/cli/bin) to run a CLI through passport exec; --remove <cli|all> takes them out.\nOff in v1: keys move, add, rotate, keep and signed-out, and adding a shim, print one line and change nothing.",
183
174
  doctor: "passport doctor [--profile <name>]\nWhen a command fails: checks Node, how your sign-in is stored, the server, your sign-in, and that this CLI and the server match, with the fix for each. For your whole setup (guard, apps, keys), run passport status; in scripts and CI, passport ready. Not signed in: exit 2.\nJSON: {ok,auth,profile?,profileCount,endpointOrigin?,server?,checks}",
184
175
  ready: "passport ready [--profile <name>]\nThe same checks as doctor, for scripts and CI: is this CLI ready to use? Check the exit code: 0 is ready. Not signed in: exit 2.\nJSON: {ready,ok,auth,profile?,profileCount,endpointOrigin?,server?,checks}",
185
176
  search: "passport search [query…] [--app <key>]\nFinds tools you can run that match the words. With no words, lists every tool you can run, by app.\nJSON: the search result, with a note on how to narrow it.",
package/dist/cliScan.js CHANGED
@@ -218,10 +218,9 @@ export function keysLines(keys, verbose) {
218
218
  const names = (list) => sentenceList([...new Set(list.map(where))]);
219
219
  const move = keys.filter((key) => !key.kept && key.vendor !== "npm");
220
220
  const kept = keys.filter((key) => key.kept);
221
- if (move.length) {
222
- lines.push(`Passport can hold these for your agents: ${names(move)}.`);
223
- lines.push(`Move ${move.length === 1 ? "it" : "them"} into Passport: passport keys move`);
224
- }
221
+ // Off in v1 (offInV1.ts): Passport holds no keys, so these stay.
222
+ if (move.length)
223
+ lines.push(`CLI keys on this computer, which stay: ${names(move)}.`);
225
224
  if (kept.length)
226
225
  lines.push(`Kept on this computer on purpose: ${names(kept)}.`);
227
226
  for (const key of keys.filter((entry) => entry.vendor === "npm")) {
package/dist/cliStatus.js CHANGED
@@ -209,13 +209,11 @@ function keysRow(view, term) {
209
209
  return {
210
210
  mark: ok ? "done" : "warn",
211
211
  name: key.name,
212
- detail: ok ? keyUse(key.lastUsedAt, view.now) : key.status.replace(/_/g, " "),
213
- ...(ok ? {} : { note: `Run: passport keys move ${key.vendor}` })
212
+ detail: ok ? keyUse(key.lastUsedAt, view.now) : key.status.replace(/_/g, " ")
214
213
  };
215
214
  }));
216
215
  if (keys.onThisComputer.length) {
217
216
  lines.push(...wrap(`Still on this computer: ${listOf(keys.onThisComputer)}.`, valueWidth(term)));
218
- lines.push("Run: passport keys move");
219
217
  }
220
218
  return { label: "Keys", lines };
221
219
  }
@@ -2,6 +2,7 @@ import { spawn } from "node:child_process";
2
2
  import { value } from "./cliArgs.js";
3
3
  import { assertProfileName, isCliProfile, readActiveProfile, readCreds, setActiveProfile } from "./credentials.js";
4
4
  import { readBoundedJson } from "./boundedResponse.js";
5
+ import { agentFromEnv } from "./callingAgent.js";
5
6
  export { readBoundedJson } from "./boundedResponse.js";
6
7
  export const DEFAULT_TIMEOUT_MS = 30_000;
7
8
  /** How a person runs a one-liner again. Through `passport-bridge` it is the npx
@@ -213,17 +214,13 @@ export function callerFrom(args, env) {
213
214
  }
214
215
  return normalized;
215
216
  }
216
- const keys = Object.keys(env);
217
- if (Object.hasOwn(env, "CLAUDECODE") || keys.some((key) => key.startsWith("CLAUDE_CODE")))
218
- return "claude-code";
219
- if (Object.hasOwn(env, "CODEX_SANDBOX") || keys.some((key) => key.startsWith("CODEX_")))
220
- return "codex";
221
- if (Object.hasOwn(env, "OPENCODE") || keys.some((key) => key.startsWith("OPENCODE_")))
217
+ // The agent's own markers, each checked against its docs (`callingAgent.ts`).
218
+ const marked = agentFromEnv(env);
219
+ if (marked)
220
+ return marked;
221
+ // OpenCode names the gateway caller only (it documents no marker; Passport records it as an unknown agent).
222
+ if (Object.hasOwn(env, "OPENCODE") || Object.keys(env).some((key) => key.startsWith("OPENCODE_")))
222
223
  return "opencode";
223
- if (Object.hasOwn(env, "CURSOR_TRACE_ID") || keys.some((key) => key.startsWith("CURSOR_")))
224
- return "cursor";
225
- if (Object.hasOwn(env, "GEMINI_CLI"))
226
- return "gemini";
227
224
  return undefined;
228
225
  }
229
226
  export function sanitize(message) {
@@ -9,5 +9,5 @@ export type CommandRepairDeps = {
9
9
  };
10
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
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.";
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. To take it out, run passport git-credential setup --remove.";
13
13
  export declare function repairPassportCommand(env: Env, deps?: CommandRepairDeps): string[];
@@ -24,7 +24,7 @@ import { compareVersions, launcherCurrent } from "./launcherHealth.js";
24
24
  import { VERSION } from "./version.js";
25
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
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.";
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. To take it out, run passport git-credential setup --remove.";
28
28
  export function repairPassportCommand(env, deps = {}) {
29
29
  const lines = [];
30
30
  try {
@@ -18,10 +18,10 @@ const DESCRIPTIONS = {
18
18
  scan: "Find the keys and MCP servers your agents can reach",
19
19
  discover: "Now part of scan",
20
20
  hook: "Record the CLIs your agents run, and decide before they run",
21
- exec: "Run a vendor CLI with a key Passport holds",
22
- "kube-credential": "Sign kubectl in to EKS and GKE clusters through Passport",
23
- "git-credential": "Send git pushes to GitHub through Passport",
24
- keys: "Move CLI keys from this computer into Passport",
21
+ exec: "Run a vendor CLI after Passport decides",
22
+ "kube-credential": "Off in v1: Passport issues no cluster tokens",
23
+ "git-credential": "Off in v1: git uses your own sign-in",
24
+ keys: "List the CLI keys on this computer",
25
25
  session: "Reuse one authenticated session for NDJSON commands",
26
26
  access: "Use the signed managed access gateway",
27
27
  update: "Update the Passport CLI to the version Passport names",
@@ -8,7 +8,7 @@ import type { ResourceTypeDef } from "../../controlPlane.generated.js";
8
8
  * can name are listed (the webhook's are Level 2).
9
9
  *
10
10
  * A target's key is today's canonical exact target (`githubTarget`: JSON of the named fields), so a decision
11
- * the kit makes ties an "Allow once" to the same digest. Branch nodes, lower-cased names and git refspecs
11
+ * the kit makes records the same digest. Branch nodes, lower-cased names and git refspecs
12
12
  * are the hooks' (`githubHooks.ts`).
13
13
  */
14
14
  export declare const GITHUB_TYPES: readonly ResourceTypeDef[];
@@ -9,7 +9,7 @@ import { GITHUB_CAPTURE } from "./githubCapture.generated.js";
9
9
  * can name are listed (the webhook's are Level 2).
10
10
  *
11
11
  * A target's key is today's canonical exact target (`githubTarget`: JSON of the named fields), so a decision
12
- * the kit makes ties an "Allow once" to the same digest. Branch nodes, lower-cased names and git refspecs
12
+ * the kit makes records the same digest. Branch nodes, lower-cased names and git refspecs
13
13
  * are the hooks' (`githubHooks.ts`).
14
14
  */
15
15
  export const GITHUB_TYPES = [
@@ -31,12 +31,12 @@ export const GITHUB_ACTIONS = [
31
31
  { key: "github.repo.tag", kind: "change", appliesTo: "repo", label: "Push a tag", icon: "Tag" },
32
32
  {
33
33
  key: "github.repo.collaborator",
34
- kind: "grant",
34
+ kind: "create",
35
35
  appliesTo: "repo",
36
36
  label: "Add or change a collaborator",
37
37
  icon: "UserPlus"
38
38
  },
39
- { key: "github.repo.public", kind: "expose", appliesTo: "repo", label: "Make the repository public", icon: "Eye" },
39
+ { key: "github.repo.public", kind: "change", appliesTo: "repo", label: "Make the repository public", icon: "Eye" },
40
40
  { key: "github.repo.delete", kind: "delete", appliesTo: "repo", label: "Delete the repository", icon: "Trash2" },
41
41
  { key: "github.branch.push", kind: "change", appliesTo: "branch", label: "Push commits", icon: "GitCommit" },
42
42
  {
@@ -49,13 +49,19 @@ export const GITHUB_ACTIONS = [
49
49
  { key: "github.branch.delete", kind: "delete", appliesTo: "branch", label: "Delete the branch", icon: "Trash2" },
50
50
  {
51
51
  key: "github.branch.protection",
52
- kind: "disarm",
52
+ kind: "delete",
53
53
  appliesTo: "branch",
54
54
  label: "Change or remove branch protection",
55
55
  icon: "Shield"
56
56
  },
57
- { key: "github.org.invite", kind: "grant", appliesTo: "org", label: "Invite a member", icon: "UserPlus" },
58
- { key: "github.secret.change", kind: "grant", appliesTo: "secrets", label: "Create or change a secret", icon: "Key" },
57
+ { key: "github.org.invite", kind: "create", appliesTo: "org", label: "Invite a member", icon: "UserPlus" },
58
+ {
59
+ key: "github.secret.change",
60
+ kind: "change",
61
+ appliesTo: "secrets",
62
+ label: "Create or change a secret",
63
+ icon: "Key"
64
+ },
59
65
  // Anything the manifest can't name fails closed; in the server catalog since E3 (2026-11-16).
60
66
  { key: "github.unclassified", kind: "delete", appliesTo: "repo", label: "Unclassified action", icon: "CircleHelp" }
61
67
  ];
@@ -64,7 +70,7 @@ export const GITHUB = {
64
70
  platform: "github",
65
71
  label: "GitHub",
66
72
  // 1: the shadow run's first manifest (2026-11-14), node ids as today's classifier names them.
67
- version: 2,
73
+ version: 3,
68
74
  plans: ["free", "team", "enterprise"],
69
75
  identity: "member",
70
76
  services: [
@@ -394,7 +394,7 @@ export function githubHooks(m, branches) {
394
394
  if (found === null)
395
395
  return "unclassified";
396
396
  const list = Array.isArray(found) ? found : [found];
397
- // A body that can't be read names no exact target: no "Allow once" is offered for it.
397
+ // A body that can't be read names no exact target.
398
398
  return opaque ? list.map(({ target: _t, ...rest }) => rest) : list;
399
399
  },
400
400
  gitPush: (n, _p, context) => gitPush(n, context, branches),
@@ -41,11 +41,11 @@ export const RAILWAY_NODES = {
41
41
  };
42
42
  /** The catalog's keys and kinds; a key the catalog folded into another keeps that one's kind. */
43
43
  const ACTIONS = [
44
- ["railway.workspace.member", "grant", "workspace", "Invite or change a member", "Users"],
45
- ["railway.workspace.token", "grant", "workspace", "Create a token", "Key"],
44
+ ["railway.workspace.member", "create", "workspace", "Invite or change a member", "Users"],
45
+ ["railway.workspace.token", "create", "workspace", "Create a token", "Key"],
46
46
  ["railway.workspace.limit", "change", "workspace", "Change the usage limit", "Gauge"],
47
- ["railway.project.member", "grant", "project", "Add or change a member", "Users"],
48
- ["railway.project.token", "grant", "project", "Create a project token", "Key"],
47
+ ["railway.project.member", "create", "project", "Add or change a member", "Users"],
48
+ ["railway.project.token", "create", "project", "Create a project token", "Key"],
49
49
  ["railway.project.change", "change", "project", "Other change", "Pencil"],
50
50
  ["railway.project.delete", "change", "project", "Delete project", "Trash2"],
51
51
  ["railway.project.webhook", "change", "project", "Add a webhook", "Webhook"],
@@ -58,11 +58,11 @@ const ACTIONS = [
58
58
  ["railway.service.delete", "delete", "service", "Delete service", "Trash2"],
59
59
  ["railway.service.variables", "change", "service", "Change variables", "Variable"],
60
60
  ["railway.service.variable.delete", "delete", "service", "Delete a variable", "Variable"],
61
- ["railway.service.secrets", "expose", "service", "Read variable values", "Eye"],
61
+ ["railway.service.secrets", "read", "service", "Read variable values", "Variable"],
62
62
  ["railway.service.shell", "change", "service", "Open a shell", "Terminal"],
63
- ["railway.service.domain", "expose", "service", "Add a domain", "Globe"],
63
+ ["railway.service.domain", "create", "service", "Add a domain", "Globe"],
64
64
  ["railway.service.domain.delete", "delete", "service", "Remove a domain", "Globe"],
65
- ["railway.service.tcp", "expose", "service", "Add a TCP Proxy", "Network"],
65
+ ["railway.service.tcp", "create", "service", "Add a TCP Proxy", "Network"],
66
66
  ["railway.service.tcp.delete", "delete", "service", "Remove a TCP Proxy", "Network"],
67
67
  ["railway.service.scale", "change", "service", "Change scale", "Gauge"],
68
68
  ["railway.volume.delete", "delete", "volume", "Delete volume and its data", "Trash2"],
@@ -85,7 +85,7 @@ export const RAILWAY = {
85
85
  platform: "railway",
86
86
  label: "Railway",
87
87
  // 1: the shadow run's first manifest (2026-11-14), node ids as today's classifier names them.
88
- version: 1,
88
+ version: 2,
89
89
  plans: ["hobby", "pro", "enterprise"],
90
90
  identity: "member",
91
91
  services: [
@@ -15,7 +15,7 @@ export const SUPABASE = {
15
15
  // 2: schema 2 (fail closed, Unclassified, reads with evidence). 3: SQL code, policy and drop-object
16
16
  // Actions after the round 2 review. 4: the 9 governed actions (2026-11-13); declared inputs. Node ids
17
17
  // unchanged.
18
- version: 4,
18
+ version: 5,
19
19
  plans: ["free", "pro", "team", "enterprise"],
20
20
  identity: "member",
21
21
  services: [
@@ -12,11 +12,11 @@ export const SUPABASE_ACTIONS = [
12
12
  a("supabase.branch.merge", "change", "branch", "Merge into production", "GitMerge"),
13
13
  // Supabase publishes no API for invitations; the org members feed reports them (Auth's own invite
14
14
  // endpoint is on the project's URL, outside the Management API sources).
15
- a("supabase.auth.invite", "grant", "organization", "Invite users", "Mail"),
16
- a("supabase.auth.sso", "disarm", "auth", "Change sign-in providers", "Fingerprint"),
17
- a("supabase.storage.public", "expose", "bucket", "Make a bucket public", "Globe"),
15
+ a("supabase.auth.invite", "create", "organization", "Invite users", "Mail"),
16
+ a("supabase.auth.sso", "delete", "auth", "Change sign-in providers", "Fingerprint"),
17
+ a("supabase.storage.public", "change", "bucket", "Make a bucket public", "Globe"),
18
18
  a("supabase.function.deploy", "change", "function", "Deploy a function", "Rocket"),
19
- a("supabase.database.grant", "grant", "database", "Grant database privileges", "KeyRound"),
19
+ a("supabase.database.grant", "change", "database", "Grant database privileges", "KeyRound"),
20
20
  a("supabase.project.delete", "delete", "project", "Pause or delete the project", "Trash2"),
21
21
  // Every other write. Kind change (allowed by default, still recorded): a write that only creates or
22
22
  // modifies. Everything else (deletes, settings, keys, code that runs later, access) is Unclassified.