passport-bridge 0.43.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.
package/dist/cliExec.js CHANGED
@@ -317,7 +317,7 @@ async function basicDecision(api, profile, prepared, runtime, args) {
317
317
  return;
318
318
  const { askCliVerb } = await import("./controlPlaneCli.js");
319
319
  const session = value(args, "session");
320
- // Authorize decides it again and spends an Allow once with the credential: this ask only finds it.
320
+ // Authorize decides it again; `exec` tells the server this ask comes first.
321
321
  const extra = { exec: true, ...(session ? { sessionId: session } : {}) };
322
322
  const answer = await askCliVerb(api, vendor, verb, extra, runtime.signal);
323
323
  if (answer.kind === "block")
@@ -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 = [
@@ -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),
@@ -73,11 +73,11 @@ export type ActionDef = {
73
73
  appliesTo: string;
74
74
  /** Sentence case, verb first: "Delete the branch". */
75
75
  label: string;
76
- /** What "Allow once" is tied to beyond the node when the request names it ("collaborator"); absent: the node. */
76
+ /** The exact target an event records beyond the node when the request names it ("collaborator"); absent: the node. */
77
77
  exactTarget?: string;
78
78
  /** A lucide-react icon name matching the platform's own iconography ("Trash2"). */
79
79
  icon?: string;
80
- /** Can't be undone (`cli.local.*`): only action rules decide it (`resolveRule`), Observe refuses it, no Allow once. */
80
+ /** Can't be undone (`cli.local.*`): only action rules decide it (`resolveRule`), Observe refuses it. */
81
81
  irreversible?: true;
82
82
  /** The platform sources that report it, and whether they name who did it (visibility levels). */
83
83
  seenBy?: ReadonlyArray<{
@@ -215,7 +215,7 @@ export type ControlRule = {
215
215
  /** Optional note shown beside the rule. */
216
216
  note?: string;
217
217
  };
218
- /** The shipped workspace defaults: Delete is blocked; Read, Create and Change are allowed. */
218
+ /** No rule, no block (2026-11-16): every kind is allowed until an admin adds a Block. */
219
219
  export declare const DEFAULT_KIND_DECISION: Readonly<Record<Kind, Decision>>;
220
220
  export type Resolution = {
221
221
  decision: Decision;
@@ -229,7 +229,7 @@ export type Resolution = {
229
229
  /**
230
230
  * The one resolution order, used by every enforcement point and every view: walk from the node up to its platform; at
231
231
  * each level an action rule beats a kind rule; the nearest level wins; then workspace action rule, workspace kind
232
- * rule, then the shipped default. An irreversible action counts only action rules, and is blocked without one. Pure.
232
+ * rule, then the default (Allow). A kind Allow never decides an irreversible action; a kind Block does. Pure.
233
233
  */
234
234
  export declare function resolveRule(path: readonly string[], action: Pick<ActionDef, "key" | "kind" | "irreversible">, rules: readonly ControlRule[]): Resolution;
235
235
  /**
@@ -302,7 +302,7 @@ export type ActionEvent = {
302
302
  /** An event Passport decided and the platform later confirmed share one id; this records the confirmation. */
303
303
  confirmedAt?: number;
304
304
  /** When the action's target is an argument (a collaborator, a secret, a tag): its keyed hash, never the
305
- * target itself. "Allow once" lets through only an attempt with the same hash. */
305
+ * target itself. */
306
306
  targetHash?: string;
307
307
  /** What it touched beneath the node (section 6): a Variable, a domain, a branch. Names only. */
308
308
  target?: ActionTarget;
@@ -405,14 +405,17 @@ export type Coverage = {
405
405
  };
406
406
  /** Deprecated: counts `through` as recorded, credential-defined on servers before 2026-11-13. Use `managedCoverageOf`. */
407
407
  export declare function coverageOf(events: readonly (Pick<ActionEvent, "through"> & Partial<Pick<ActionEvent, "outcome">>)[], observed: boolean): Coverage;
408
+ /** A block's decision as stored; "once" (Allow once, removed 2026-11-16) is history, read back so old rows render. */
408
409
  export type BlockDecision = "keep" | "once" | "always";
410
+ /** What an admin can decide on a block now: Keep blocked or Always allow. */
411
+ export type BlockChoice = Exclude<BlockDecision, "once">;
409
412
  export type PendingBlock = {
410
413
  /** The blocked event's id. */
411
414
  eventId: string;
412
415
  decidedAt?: number;
413
416
  decidedBy?: string;
414
417
  decision?: BlockDecision;
415
- /** For "once": the pass the agent's next identical attempt consumes, valid for an hour. */
418
+ /** History: an old "once" decision's pass expiry. Never honored since 2026-11-16. */
416
419
  passExpiresAt?: number;
417
420
  /** For "always": the rule it created. */
418
421
  ruleId?: string;
@@ -492,7 +495,7 @@ export type CpRuleRow = {
492
495
  * would have blocked in the last 7 days. Absent once enforcing. */
493
496
  wouldBlock?: number;
494
497
  };
495
- /** An event as the API returns it: whether "Allow once" can be tied to its exact target, never the hash itself. */
498
+ /** An event as the API returns it: whether it names an exact target, never the hash itself. */
496
499
  export type CpEvent = Omit<ActionEvent, "targetHash"> & {
497
500
  hasTarget: boolean;
498
501
  };
@@ -64,9 +64,9 @@ export function mostSevere(found, kindOf) {
64
64
  };
65
65
  return [...found].sort((a, b) => rank(a) - rank(b))[0];
66
66
  }
67
- /** The shipped workspace defaults: Delete is blocked; Read, Create and Change are allowed. */
67
+ /** No rule, no block (2026-11-16): every kind is allowed until an admin adds a Block. */
68
68
  export const DEFAULT_KIND_DECISION = {
69
- delete: "block",
69
+ delete: "allow",
70
70
  change: "allow",
71
71
  create: "allow",
72
72
  read: "allow"
@@ -74,7 +74,7 @@ export const DEFAULT_KIND_DECISION = {
74
74
  /**
75
75
  * The one resolution order, used by every enforcement point and every view: walk from the node up to its platform; at
76
76
  * each level an action rule beats a kind rule; the nearest level wins; then workspace action rule, workspace kind
77
- * rule, then the shipped default. An irreversible action counts only action rules, and is blocked without one. Pure.
77
+ * rule, then the default (Allow). A kind Allow never decides an irreversible action; a kind Block does. Pure.
78
78
  */
79
79
  export function resolveRule(path /* node id first, platform last */, action, rules) {
80
80
  const at = (target, key) => rules.find((rule) => ("workspace" in rule.target
@@ -83,20 +83,19 @@ export function resolveRule(path /* node id first, platform last */, action, rul
83
83
  ("action" in rule.key
84
84
  ? "action" in key && rule.key.action === key.action
85
85
  : "kind" in key && rule.key.kind === key.kind));
86
+ const kindCounts = (rule) => (action.irreversible && rule?.decision !== "block" ? undefined : rule);
86
87
  for (const id of path) {
87
88
  const byAction = at({ nodeId: id }, { action: action.key });
88
89
  if (byAction)
89
90
  return { decision: byAction.decision, ruleId: byAction.id, at: id, by: "action" };
90
- const byKind = action.irreversible ? undefined : at({ nodeId: id }, { kind: action.kind });
91
+ const byKind = kindCounts(at({ nodeId: id }, { kind: action.kind }));
91
92
  if (byKind)
92
93
  return { decision: byKind.decision, ruleId: byKind.id, at: id, by: "kind" };
93
94
  }
94
95
  const wsAction = at({ workspace: true }, { action: action.key });
95
96
  if (wsAction)
96
97
  return { decision: wsAction.decision, ruleId: wsAction.id, at: "workspace", by: "action" };
97
- if (action.irreversible)
98
- return { decision: "block", ruleId: null, at: "default", by: "action" };
99
- const wsKind = at({ workspace: true }, { kind: action.kind });
98
+ const wsKind = kindCounts(at({ workspace: true }, { kind: action.kind }));
100
99
  if (wsKind)
101
100
  return { decision: wsKind.decision, ruleId: wsKind.id, at: "workspace", by: "kind" };
102
101
  return { decision: DEFAULT_KIND_DECISION[action.kind], ruleId: null, at: "default", by: "kind" };
@@ -18,7 +18,7 @@ import type { ActionDef, BasicPlatform } from "./controlPlane.generated.js";
18
18
  * This computer (`cli:local`) is the one exception: commands that can't be undone on the computer an agent runs on
19
19
  * (deleting the home folder, the disk, system files or the project folder; recursive permission changes there), one
20
20
  * action per class (`LOCAL_IRREVERSIBLE_VERBS`), kind Delete, `irreversible`: only an Allow on that action unlocks
21
- * one, kind rules never do, Observe mode refuses it too, and a block offers Always allow, never Allow once.
21
+ * one, kind rules never do, Observe mode refuses it too, and a block offers Always allow.
22
22
  */
23
23
  export declare const BASIC_KINDS: readonly ["delete", "change", "create", "read"];
24
24
  export type BasicKind = (typeof BASIC_KINDS)[number];
@@ -47,9 +47,6 @@ export type LocalIrreversibleVerb = keyof typeof LOCAL_IRREVERSIBLE_VERBS;
47
47
  * No check: naming files is no governed action. */
48
48
  export declare function localSteer(verb: LocalIrreversibleVerb): NonNullable<ActionDef["steer"]>;
49
49
  export declare function isLocalIrreversibleVerb(verb: string): verb is LocalIrreversibleVerb;
50
- /** Why one of these doesn't run, in the words the agent reads after "Blocked by Passport:" and an admin reads when
51
- * Allow once is refused for one. */
52
- export declare function irreversibleRefusal(label: string): string;
53
50
  export declare function isBasicSlug(value: string): boolean;
54
51
  /** Which kind of basic platform a key names: "app" or "cli"; null for a connector platform (or anything else). Lets
55
52
  * code branch on basic platforms first, so switches over `ConnectorPlatform` stay exhaustive. */
@@ -17,7 +17,7 @@
17
17
  * This computer (`cli:local`) is the one exception: commands that can't be undone on the computer an agent runs on
18
18
  * (deleting the home folder, the disk, system files or the project folder; recursive permission changes there), one
19
19
  * action per class (`LOCAL_IRREVERSIBLE_VERBS`), kind Delete, `irreversible`: only an Allow on that action unlocks
20
- * one, kind rules never do, Observe mode refuses it too, and a block offers Always allow, never Allow once.
20
+ * one, kind rules never do, Observe mode refuses it too, and a block offers Always allow.
21
21
  */
22
22
  export const BASIC_KINDS = ["delete", "change", "create", "read"];
23
23
  /** App keys and CLI vendors are slugs: letters, digits, "-" and "_" (never "." or ":"). */
@@ -53,11 +53,6 @@ export function localSteer(verb) {
53
53
  export function isLocalIrreversibleVerb(verb) {
54
54
  return Object.prototype.hasOwnProperty.call(LOCAL_IRREVERSIBLE_VERBS, verb);
55
55
  }
56
- /** Why one of these doesn't run, in the words the agent reads after "Blocked by Passport:" and an admin reads when
57
- * Allow once is refused for one. */
58
- export function irreversibleRefusal(label) {
59
- return `"${label}" can't be undone, so it runs only once an admin allows this kind of command. An admin can Always allow it on every computer in Passport › Blocked.`;
60
- }
61
56
  export function isBasicSlug(value) {
62
57
  return SLUG.test(value);
63
58
  }
@@ -8,7 +8,7 @@
8
8
  * Summaries are fixed templates filled with names and numbers only: never a
9
9
  * secret's value, a commit message, a body or an email address.
10
10
  *
11
- * `target` is what an admin's "Allow once" is tied to when the action's
11
+ * `target` is the exact target an event records (hashed) when the action's
12
12
  * target is an argument rather than the node (a collaborator's login and
13
13
  * permission, a secret's name, a release tag): a canonical string the server
14
14
  * turns into a keyed hash. It is never stored, logged or shown; only the
@@ -9,7 +9,7 @@
9
9
  * Summaries are fixed templates filled with names and numbers only: never a
10
10
  * secret's value, a commit message, a body or an email address.
11
11
  *
12
- * `target` is what an admin's "Allow once" is tied to when the action's
12
+ * `target` is the exact target an event records (hashed) when the action's
13
13
  * target is an argument rather than the node (a collaborator's login and
14
14
  * permission, a secret's name, a release tag): a canonical string the server
15
15
  * turns into a keyed hash. It is never stored, logged or shown; only the
@@ -56,7 +56,7 @@ export type GithubClassification = {
56
56
  nodeId: string;
57
57
  actionKey: string;
58
58
  summary: string;
59
- /** What "Allow once" is tied to beyond the node and action; absent when the node is the whole target. Never stored. */
59
+ /** The exact target beyond the node and action (stored only as a keyed hash); absent when the node is all of it. */
60
60
  target?: string;
61
61
  };
62
62
  export type GithubRepo = {
@@ -77,7 +77,7 @@ export declare const withTarget: (found: GithubClassification, target: string |
77
77
  export declare function withoutTarget(found: GithubClassification): GithubClassification;
78
78
  export declare const onRepo: (r: Repo, actionKey: string, summary: string, target?: string) => GithubClassification;
79
79
  /** Fails closed: a `gh` command Passport can't name, a Delete on its repository (on Repositories when none is
80
- * known). No target, so no Allow once is tied to anything narrower than the node. */
80
+ * known). No target narrower than the node. */
81
81
  export declare const unclassifiedGh: (r: Repo | null) => GithubClassification;
82
82
  /** The branch's own node, its most specific pattern node, or the repository when no node matches. */
83
83
  export declare function branchTarget(r: Repo, branch: string, context: BranchContext): string;
@@ -130,7 +130,7 @@ export function withoutTarget(found) {
130
130
  }
131
131
  export const onRepo = (r, actionKey, summary, target) => withTarget({ nodeId: repoNode(r.owner, r.repo), actionKey, summary }, target);
132
132
  /** Fails closed: a `gh` command Passport can't name, a Delete on its repository (on Repositories when none is
133
- * known). No target, so no Allow once is tied to anything narrower than the node. */
133
+ * known). No target narrower than the node. */
134
134
  export const unclassifiedGh = (r) => r
135
135
  ? {
136
136
  nodeId: repoNode(r.owner, r.repo),
@@ -55,8 +55,7 @@ export type Unnamed = {
55
55
  * The worst a push to branches it doesn't name can do, on the repository
56
56
  * node: force-push and delete, decided together (blocked when either is).
57
57
  * For `git push --all`, `--mirror`, `:` (matching branches), a pattern, or a
58
- * destination that can't be resolved. No target: there is no exact branch to
59
- * tie an "Allow once" to.
58
+ * destination that can't be resolved. No target: there is no exact branch.
60
59
  */
61
60
  export declare function worstCasePush(r: GithubRepo, why: string): GithubClassification[];
62
61
  /**
@@ -112,7 +112,7 @@ export function ghApi(parsed, args, context) {
112
112
  // With --input the body comes from a file (any -f fields go to the query string): unknown here.
113
113
  const opaque = hasFlag(parsed, "--input");
114
114
  const found = classifyApi(method, path, opaque ? OPAQUE_BODY : body, context);
115
- // Fail closed: no target to tie an "Allow once" to, so none is offered for this block.
115
+ // Fail closed: a body that can't be read names no exact target.
116
116
  if (found)
117
117
  return opaque ? withoutTarget(found) : found;
118
118
  // Named nothing: a read isn't decided; any write is Passport's Unclassified action on its repository. A GraphQL
@@ -187,8 +187,7 @@ export const resolveHead = (word, currentBranch) => word === "HEAD" || word ===
187
187
  * The worst a push to branches it doesn't name can do, on the repository
188
188
  * node: force-push and delete, decided together (blocked when either is).
189
189
  * For `git push --all`, `--mirror`, `:` (matching branches), a pattern, or a
190
- * destination that can't be resolved. No target: there is no exact branch to
191
- * tie an "Allow once" to.
190
+ * destination that can't be resolved. No target: there is no exact branch.
192
191
  */
193
192
  export function worstCasePush(r, why) {
194
193
  return [
@@ -16,8 +16,8 @@
16
16
  *
17
17
  * Only the classification leaves this computer: the node, the catalog action
18
18
  * and the classifier's fixed summary, plus the SHA-256 digest of the target
19
- * when the command names one (a collaborator, a secret, a tag), so an admin's
20
- * "Allow once" lets through only that exact target. Never the command line,
19
+ * when the command names one (a collaborator, a secret, a tag), kept on the
20
+ * event only as a keyed hash. Never the command line,
21
21
  * never the target itself.
22
22
  */
23
23
  import { type GithubClassification } from "./controlPlaneGithub.generated.js";
@@ -16,8 +16,8 @@
16
16
  *
17
17
  * Only the classification leaves this computer: the node, the catalog action
18
18
  * and the classifier's fixed summary, plus the SHA-256 digest of the target
19
- * when the command names one (a collaborator, a secret, a tag), so an admin's
20
- * "Allow once" lets through only that exact target. Never the command line,
19
+ * when the command names one (a collaborator, a secret, a tag), kept on the
20
+ * event only as a keyed hash. Never the command line,
21
21
  * never the target itself.
22
22
  */
23
23
  import { createHash } from "node:crypto";
@@ -184,7 +184,7 @@ export function supabaseProjectRef(argv, where) {
184
184
  const ref = flagged.at(-1) ?? refOf(found);
185
185
  return ref && /^[a-z0-9]{20}$/.test(ref) ? ref : undefined;
186
186
  }
187
- /** The exact target's digest, when the first action has one (a table): an Allow once covers only it. */
187
+ /** The exact target's digest, when the first action has one (a table): the event records only its keyed hash. */
188
188
  function exactDigest(first) {
189
189
  const exact = SUPABASE.actions.find((action) => action.key === first.actionKey)?.exactTarget;
190
190
  return exact && first.target?.type === exact ? targetDigest(first.target.key) : undefined;
@@ -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.43.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.43.0";
7
+ export const PLUGIN_PIN = "0.44.0";
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.43.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.43.0";
2
+ export const VERSION = "0.44.0";
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "passport-bridge",
3
- "version": "0.43.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.43.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.43.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": {