passport-bridge 0.45.0 → 0.46.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 (68) hide show
  1. package/dist/cliArgs.d.ts +1 -1
  2. package/dist/cliArgs.js +3 -0
  3. package/dist/cliConnect.d.ts +3 -1
  4. package/dist/cliConnect.js +58 -6
  5. package/dist/cliConnections.d.ts +3 -3
  6. package/dist/cliConnections.js +13 -5
  7. package/dist/cliExec.js +1 -5
  8. package/dist/cliGuardHealth.js +2 -1
  9. package/dist/cliHook.js +5 -1
  10. package/dist/cliHookAfter.js +2 -2
  11. package/dist/cliHookNotices.d.ts +7 -0
  12. package/dist/cliHookNotices.js +14 -0
  13. package/dist/cliMain.js +33 -3
  14. package/dist/cliOutput.js +4 -6
  15. package/dist/cliRequest.d.ts +65 -0
  16. package/dist/cliRequest.js +135 -0
  17. package/dist/cliScan.js +1 -1
  18. package/dist/cliSession.d.ts +0 -1
  19. package/dist/cliSession.js +0 -2
  20. package/dist/cliStatus.d.ts +4 -2
  21. package/dist/cliStatus.js +21 -4
  22. package/dist/cliSupport.d.ts +0 -8
  23. package/dist/completion.js +1 -0
  24. package/dist/connectorKit/engine.generated.d.ts +2 -2
  25. package/dist/connectorKit/engine.generated.js +23 -3
  26. package/dist/connectorKit/manifest.generated.d.ts +1 -1
  27. package/dist/connectorKit/manifests/github.generated.js +26 -3
  28. package/dist/connectorKit/manifests/githubCapture.generated.js +41 -10
  29. package/dist/connectorKit/manifests/githubHooks.generated.js +21 -1
  30. package/dist/connectorKit/manifests/githubReads.generated.d.ts +2 -0
  31. package/dist/connectorKit/manifests/githubReads.generated.js +30 -5
  32. package/dist/connectorKit/manifests/railway.generated.js +3 -3
  33. package/dist/connectorKit/manifests/supabase.generated.js +1 -1
  34. package/dist/connectorKit/manifests/supabaseCatalog.generated.js +3 -3
  35. package/dist/controlPlane.generated.d.ts +16 -15
  36. package/dist/controlPlane.generated.js +12 -17
  37. package/dist/controlPlaneGithub.generated.d.ts +2 -2
  38. package/dist/controlPlaneGithub.generated.js +12 -2
  39. package/dist/controlPlaneGithubApi.generated.d.ts +2 -0
  40. package/dist/controlPlaneGithubApi.generated.js +56 -1
  41. package/dist/controlPlaneGithubCatalog.generated.d.ts +9 -3
  42. package/dist/controlPlaneGithubCatalog.generated.js +19 -13
  43. package/dist/controlPlaneGithubCli.generated.d.ts +2 -0
  44. package/dist/controlPlaneGithubCli.generated.js +65 -12
  45. package/dist/controlPlaneGuard.js +2 -0
  46. package/dist/controlPlanePeople.generated.d.ts +117 -0
  47. package/dist/controlPlanePeople.generated.js +6 -0
  48. package/dist/controlPlaneSupabase.js +3 -1
  49. package/dist/controlPlaneUnnamed.generated.d.ts +58 -0
  50. package/dist/controlPlaneUnnamed.generated.js +225 -0
  51. package/dist/cpCli.js +5 -1
  52. package/dist/initAppsStep.d.ts +1 -1
  53. package/dist/initAppsStep.js +7 -5
  54. package/dist/initOutro.js +13 -10
  55. package/dist/initState.d.ts +3 -2
  56. package/dist/initState.js +7 -18
  57. package/dist/localNotices.d.ts +22 -0
  58. package/dist/localNotices.js +100 -0
  59. package/dist/pluginPin.d.ts +1 -1
  60. package/dist/pluginPin.js +1 -1
  61. package/dist/version.d.ts +1 -1
  62. package/dist/version.js +1 -1
  63. package/dist/webLinks.d.ts +23 -6
  64. package/dist/webLinks.js +21 -22
  65. package/npm-shrinkwrap.json +8 -8
  66. package/package.json +1 -1
  67. package/dist/cliApprovalLink.d.ts +0 -5
  68. package/dist/cliApprovalLink.js +0 -21
@@ -1,6 +1,5 @@
1
1
  import { type ParsedArgs } from "./cliArgs.js";
2
2
  import { CliFailure, type CommandResult, type Runtime } from "./cliSupport.js";
3
- export { linkApproval } from "./cliApprovalLink.js";
4
3
  export declare const CLI_SESSION_LINE_MAX_BYTES: number;
5
4
  export declare const CLI_SESSION_ARGV_MAX_ITEMS = 128;
6
5
  export type SessionRequest = {
@@ -2,8 +2,6 @@ import { once } from "node:events";
2
2
  import { bool, parseArgs, value } from "./cliArgs.js";
3
3
  import { asFailure, failurePayload } from "./cliOutput.js";
4
4
  import { callerFrom, CliFailure, failure, resolveCliAuth, timeoutMs } from "./cliSupport.js";
5
- // Failures leave through here and the CLI's catch; both name the approval they hit.
6
- export { linkApproval } from "./cliApprovalLink.js";
7
5
  export const CLI_SESSION_LINE_MAX_BYTES = 1024 * 1024;
8
6
  export const CLI_SESSION_ARGV_MAX_ITEMS = 128;
9
7
  /**
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * `passport status`: one screen, like `gh auth status`, in the web's words.
3
3
  *
4
- * You erin@acme.test in Acme
4
+ * You Erin Park in Acme
5
+ * My activity https://passportmcp.com/#p
5
6
  * Computer Ramish's Laptop
6
7
  * Guard ✓ Claude Code On
7
8
  * ! Codex Not trusted. Open Codex → /hooks and trust Passport's hooks.
@@ -55,7 +56,8 @@ export type StatusView = {
55
56
  };
56
57
  member: {
57
58
  id: string;
58
- email: string;
59
+ name?: string;
60
+ email?: string;
59
61
  };
60
62
  computer: string;
61
63
  mcps: Array<{
package/dist/cliStatus.js CHANGED
@@ -11,14 +11,15 @@ import { keyRows } from "./statusKeys.js";
11
11
  import { countOf } from "./plural.js";
12
12
  import { listOf } from "./initUi.js";
13
13
  import { VERSION } from "./version.js";
14
+ import { hashLink, MY_ACTIVITY_LINK } from "./webLinks.js";
14
15
  const CLI_POLICY_SYNC_MS = 5_000;
15
16
  const LABEL = 13;
16
17
  /** Plain words for a connection state in human output; --json keeps the code. */
17
18
  const CONNECTION_STATUS_LABELS = {
18
19
  connected: "connected",
19
- org_managed: "company-managed",
20
+ org_managed: "connected by your company",
20
21
  needs_your_signin: "needs your sign-in",
21
- needs_setup: "needs admin setup"
22
+ needs_setup: "not set up yet"
22
23
  };
23
24
  function connectionStatusLabel(status) {
24
25
  return CONNECTION_STATUS_LABELS[status] ?? status.replace(/_/g, " ");
@@ -143,13 +144,25 @@ function markedTable(term, rows) {
143
144
  ...(row.note ? wrap(row.note, width, indent) : [])
144
145
  ]);
145
146
  }
147
+ /** Who is signed in: the name cached at login, else the server's name, with the email only when an older server
148
+ * still sends one. */
149
+ function memberLabel(view) {
150
+ const name = view.signedInAs || view.member.name;
151
+ const email = view.member.email;
152
+ if (name && email && name !== email)
153
+ return `${name} (${email})`;
154
+ return name || email || "You";
155
+ }
146
156
  function youRows(view, term) {
147
157
  const host = hostOf(view.auth.endpoint);
148
158
  const who = view.auth.kind === "agent-key"
149
159
  ? `An agent token in ${view.workspace.name}`
150
- : `${view.signedInAs && view.signedInAs !== view.member.email ? `${view.signedInAs} (${view.member.email})` : view.member.email} in ${view.workspace.name}`;
160
+ : `${memberLabel(view)} in ${view.workspace.name}`;
161
+ // A person's own page in the web app; an agent token has none. The link is never wrapped.
162
+ const page = view.auth.kind === "agent-key" ? null : hashLink(view.auth.endpoint, MY_ACTIVITY_LINK);
151
163
  return [
152
164
  { label: "You", lines: wrap(`${who}${host ? ` (${host})` : ""}`, valueWidth(term)) },
165
+ ...(page ? [{ label: "My activity", lines: [page] }] : []),
153
166
  { label: "Computer", lines: wrap(view.computer, valueWidth(term)) }
154
167
  ];
155
168
  }
@@ -323,7 +336,11 @@ export async function status(args, runtime, withGateway, syncCliPolicy) {
323
336
  const local = localStatus(auth, runtime.env);
324
337
  const data = {
325
338
  workspace: { id: String(managed.workspace.id), name: String(managed.workspace.name) },
326
- member: { id: String(managed.member.id), email: String(managed.member.email) },
339
+ member: {
340
+ id: String(managed.member.id),
341
+ ...(typeof managed.member.name === "string" ? { name: managed.member.name } : {}),
342
+ ...(typeof managed.member.email === "string" ? { email: managed.member.email } : {})
343
+ },
327
344
  endpoint: auth.endpoint,
328
345
  auth: managed.auth,
329
346
  ...(auth.kind === "profile" ? { profile: auth.profile } : {}),
@@ -67,8 +67,6 @@ export declare class CliFailure extends Error {
67
67
  readonly cause: string;
68
68
  readonly details: {
69
69
  approvalId?: string;
70
- /** The approval in the web app, when the origin is known. */
71
- approvalUrl?: string;
72
70
  app?: string;
73
71
  connectUrl?: string;
74
72
  hint?: string;
@@ -77,13 +75,9 @@ export declare class CliFailure extends Error {
77
75
  remediation?: CliRemediation;
78
76
  retry?: CliRetry;
79
77
  requiredInput?: string[];
80
- /** The approval link is already on screen (the waiting line printed it). */
81
- linkShown?: boolean;
82
78
  };
83
79
  constructor(message: string, exitCode: number, cause: string, details?: {
84
80
  approvalId?: string;
85
- /** The approval in the web app, when the origin is known. */
86
- approvalUrl?: string;
87
81
  app?: string;
88
82
  connectUrl?: string;
89
83
  hint?: string;
@@ -92,8 +86,6 @@ export declare class CliFailure extends Error {
92
86
  remediation?: CliRemediation;
93
87
  retry?: CliRetry;
94
88
  requiredInput?: string[];
95
- /** The approval link is already on screen (the waiting line printed it). */
96
- linkShown?: boolean;
97
89
  });
98
90
  }
99
91
  export declare function failure(message: string, exitCode: number, cause: string, details?: CliFailure["details"]): never;
@@ -13,6 +13,7 @@ const DESCRIPTIONS = {
13
13
  run: "Run a governed tool",
14
14
  connect: "Connect member app accounts",
15
15
  connections: "Your connections, and your connections page",
16
+ request: "Ask for an app",
16
17
  resources: "List or read MCP resources",
17
18
  prompts: "List or get MCP prompts",
18
19
  scan: "Find the keys and MCP servers your agents can reach",
@@ -4,8 +4,8 @@
4
4
  * like every connector's `classify` (spec Part 2): no network, no platform
5
5
  * names. Summaries are templates filled with safe names only.
6
6
  *
7
- * Fails closed. These all become the manifest's Unclassified Action (kind
8
- * delete, so a Delete Block blocks it): a command, tool or route the manifest doesn't
7
+ * What it can't name is never guessed. These all become the manifest's Unclassified Action (its own kind,
8
+ * Unclassified, 2026-11-17; with what it hit, `unnamed`): a command, tool or route the manifest doesn't
9
9
  * name; a flag the vendor's spec doesn't list; a boolean the CLI framework
10
10
  * wouldn't accept; a value flag with no value; an argument no rule names; a
11
11
  * known operation whose conditions no rule matches; a SQL rule with no SQL; a
@@ -5,8 +5,8 @@
5
5
  * like every connector's `classify` (spec Part 2): no network, no platform
6
6
  * names. Summaries are templates filled with safe names only.
7
7
  *
8
- * Fails closed. These all become the manifest's Unclassified Action (kind
9
- * delete, so a Delete Block blocks it): a command, tool or route the manifest doesn't
8
+ * What it can't name is never guessed. These all become the manifest's Unclassified Action (its own kind,
9
+ * Unclassified, 2026-11-17; with what it hit, `unnamed`): a command, tool or route the manifest doesn't
10
10
  * name; a flag the vendor's spec doesn't list; a boolean the CLI framework
11
11
  * wouldn't accept; a value flag with no value; an argument no rule names; a
12
12
  * known operation whose conditions no rule matches; a SQL rule with no SQL; a
@@ -17,6 +17,7 @@
17
17
  * or SQL the parser shows only reads returns null.
18
18
  */
19
19
  import { nodeId } from "../controlPlane.generated.js";
20
+ import { unnamedApi, unnamedCli } from "../controlPlaneUnnamed.generated.js";
20
21
  import { knownOps, normalizeCli } from "./cli.generated.js";
21
22
  import { MANIFEST_SCHEMA } from "./manifest.generated.js";
22
23
  import { canonical, holds } from "./params.generated.js";
@@ -333,6 +334,23 @@ function build(m, part, params, context, hooks, each) {
333
334
  });
334
335
  return out;
335
336
  }
337
+ /** What an unnamed request hit, coarse (`controlPlaneUnnamed.ts`): an API call's method and path template, a command
338
+ * line's program and the words the CLI itself uses, up to the first it doesn't. Nothing for an MCP tool. */
339
+ function unnamedOf(m, n, ops) {
340
+ if (n.iface === "api") {
341
+ const [method, path] = n.op.split(" ");
342
+ return unnamedApi(m.platform, method, path ?? "");
343
+ }
344
+ if (n.iface !== "cli")
345
+ return undefined;
346
+ const words = [];
347
+ for (const [i, part] of n.op.split(" ").entries()) {
348
+ if (!ops.some((op) => op.split(" ")[i] === part))
349
+ break;
350
+ words.push(part);
351
+ }
352
+ return unnamedCli([m.capture.cli.programs[0] ?? m.platform, ...words]);
353
+ }
336
354
  /** What a request that fails closed becomes: the Unclassified Action, on the most specific node it names. */
337
355
  function unclassified(m, n, params, context, hooks, problem = n.problem) {
338
356
  const action = m.actions.find((a) => a.key === m.capture.unclassified);
@@ -349,13 +367,15 @@ function unclassified(m, n, params, context, hooks, problem = n.problem) {
349
367
  .join(" ")
350
368
  : (safeName(n.op) ?? "…");
351
369
  const at = nodeChain(m, action.appliesTo, params, context, hooks);
370
+ const unnamed = unnamedOf(m, n, ops);
352
371
  return {
353
372
  nodeId: at.unresolved
354
373
  ? nodeId(m.platform, m.types.find((t) => t.type === action.appliesTo)?.service ?? m.services[0].key)
355
374
  : at.nodeId,
356
375
  actionKey: m.capture.unclassified,
357
376
  summary: `${action.label}: ${what}${problem ? ` (${safeName(problem) ?? "invalid flags"})` : ""}`,
358
- nodes: at.unresolved ? [] : at.chain
377
+ nodes: at.unresolved ? [] : at.chain,
378
+ ...(unnamed ? { unnamed } : {})
359
379
  };
360
380
  }
361
381
  /* ------------------------------------------------------------------ */
@@ -199,7 +199,7 @@ export type CaptureSpec = {
199
199
  };
200
200
  /** SQL categories (sql.ts) → Action keys; a category not listed is a read. */
201
201
  sql: Readonly<Partial<Record<SqlCategory, string>>>;
202
- /** What anything unnamed becomes: an Action of kind delete, so the default rules block it. */
202
+ /** What anything unnamed becomes: an Action of kind Unclassified (2026-11-17), never assumed to be a Delete. */
203
203
  unclassified: string;
204
204
  };
205
205
  export type SqlCategory = "drop_database" | "drop_schema" | "drop_table" | "truncate" | "delete_all" | "rls_off" | "grant" | "ddl" | "write" | "export" | "opaque"
@@ -62,15 +62,38 @@ export const GITHUB_ACTIONS = [
62
62
  label: "Create or change a secret",
63
63
  icon: "Key"
64
64
  },
65
- // Anything the manifest can't name fails closed; in the server catalog since E3 (2026-11-16).
66
- { key: "github.unclassified", kind: "delete", appliesTo: "repo", label: "Unclassified action", icon: "CircleHelp" }
65
+ // The repository writes named since 2026-11-17 (docs/design/v22/unclassified.md).
66
+ { key: "github.workflow.run", kind: "change", appliesTo: "repo", label: "Run a workflow", icon: "Play" },
67
+ { key: "github.run.cancel", kind: "change", appliesTo: "repo", label: "Cancel a workflow run", icon: "CircleX" },
68
+ { key: "github.run.rerun", kind: "change", appliesTo: "repo", label: "Re-run a workflow", icon: "RefreshCw" },
69
+ { key: "github.pr.open", kind: "create", appliesTo: "repo", label: "Open a pull request", icon: "GitPullRequest" },
70
+ { key: "github.pr.edit", kind: "change", appliesTo: "repo", label: "Edit a pull request", icon: "GitPullRequest" },
71
+ {
72
+ key: "github.pr.state",
73
+ kind: "change",
74
+ appliesTo: "repo",
75
+ label: "Close or reopen a pull request",
76
+ icon: "GitPullRequestClosed"
77
+ },
78
+ { key: "github.comment", kind: "create", appliesTo: "repo", label: "Comment", icon: "MessageSquare" },
79
+ { key: "github.issue.open", kind: "create", appliesTo: "repo", label: "Open an issue", icon: "CircleDot" },
80
+ { key: "github.issue.edit", kind: "change", appliesTo: "repo", label: "Edit or close an issue", icon: "CircleCheck" },
81
+ { key: "github.label.manage", kind: "change", appliesTo: "repo", label: "Manage labels", icon: "Tag" },
82
+ // Anything the manifest can't name: its own kind, Unclassified (2026-11-17), never assumed to be a Delete.
83
+ {
84
+ key: "github.unclassified",
85
+ kind: "unclassified",
86
+ appliesTo: "repo",
87
+ label: "Unclassified action",
88
+ icon: "CircleHelp"
89
+ }
67
90
  ];
68
91
  export const GITHUB = {
69
92
  schema: MANIFEST_SCHEMA,
70
93
  platform: "github",
71
94
  label: "GitHub",
72
95
  // 1: the shadow run's first manifest (2026-11-14), node ids as today's classifier names them.
73
- version: 3,
96
+ version: 4,
74
97
  plans: ["free", "team", "enterprise"],
75
98
  identity: "member",
76
99
  services: [
@@ -1,4 +1,4 @@
1
- import { GH_COMMANDS, GH_READS, GITHUB_API_READS, GITHUB_MCP_READS } from "./githubReads.generated.js";
1
+ import { GH_COMMANDS, GH_READS, GH_REPO_WRITES, GITHUB_API_READS, GITHUB_MCP_READS } from "./githubReads.generated.js";
2
2
  /**
3
3
  * GitHub capture for the shadow run (2026-11-14): `gh` and `git push` command lines, GitHub's MCP tools and
4
4
  * REST calls, as today's classifier reads them. Where today's classifier names no action for a write that
@@ -122,6 +122,15 @@ const MCP_RULES = [
122
122
  /** Write methods on a route, each to the same rule. */
123
123
  const writes = (route, rule) => ["POST", "PUT", "PATCH", "DELETE"].map((method) => ({ match: `${method} ${route}`, ...rule }));
124
124
  const REPO = "/repos/{owner}/{repo}";
125
+ /** A repository write named since 2026-11-17: on the repository, no exact target. */
126
+ const repoApi = (match, action, what) => ({
127
+ match,
128
+ action,
129
+ on: "repo",
130
+ summary: `${what} in {owner}/{repo}`
131
+ });
132
+ const CLOSED = { body: ["state"], when: { state: "closed" } };
133
+ const OPENED = { body: ["state"], when: { state: "open" } };
125
134
  const API_RULES = [
126
135
  {
127
136
  match: `PUT ${REPO}/pulls/{number}/merge`,
@@ -232,16 +241,31 @@ const API_RULES = [
232
241
  },
233
242
  { match: `PATCH ${REPO}`, action: "read", because: NOT_GOVERNED },
234
243
  { match: "PATCH /orgs/{org}", action: "read", because: NOT_GOVERNED },
235
- // GraphQL: a mutation fails closed, a query reads (the hook reads the operation, never its values).
244
+ // GraphQL: a mutation is unclassified, a query reads (the hook reads the operation, never its values).
236
245
  { match: "POST /graphql", action: "github.unclassified", hook: "graphql" },
237
- ...[
238
- `POST ${REPO}/pulls`,
239
- `POST ${REPO}/issues`,
240
- `POST ${REPO}/issues/{number}/comments`,
241
- `POST ${REPO}/labels`,
242
- `POST ${REPO}/actions/runs/{run}/rerun`,
243
- `POST ${REPO}/releases/{release}/assets`
244
- ].map((match) => ({ match, action: "read", because: NOT_GOVERNED }))
246
+ // The repository writes named since 2026-11-17, on the repository with no exact target.
247
+ repoApi(`POST ${REPO}/actions/workflows/{workflow}/dispatches`, "github.workflow.run", "Run a workflow"),
248
+ repoApi(`POST ${REPO}/actions/runs/{run}/cancel`, "github.run.cancel", "Cancel a workflow run"),
249
+ repoApi(`POST ${REPO}/actions/runs/{run}/force-cancel`, "github.run.cancel", "Cancel a workflow run"),
250
+ repoApi(`POST ${REPO}/actions/runs/{run}/rerun`, "github.run.rerun", "Re-run a workflow"),
251
+ repoApi(`POST ${REPO}/actions/runs/{run}/rerun-failed-jobs`, "github.run.rerun", "Re-run a workflow"),
252
+ repoApi(`POST ${REPO}/actions/jobs/{job}/rerun`, "github.run.rerun", "Re-run a workflow"),
253
+ repoApi(`POST ${REPO}/pulls`, "github.pr.open", "Open a pull request"),
254
+ { ...repoApi(`PATCH ${REPO}/pulls/{number}`, "github.pr.state", "Close a pull request"), ...CLOSED },
255
+ { ...repoApi(`PATCH ${REPO}/pulls/{number}`, "github.pr.state", "Reopen a pull request"), ...OPENED },
256
+ repoApi(`PATCH ${REPO}/pulls/{number}`, "github.pr.edit", "Edit a pull request"),
257
+ repoApi(`POST ${REPO}/issues`, "github.issue.open", "Open an issue"),
258
+ repoApi(`POST ${REPO}/issues/{number}/comments`, "github.comment", "Comment"),
259
+ { ...repoApi(`PATCH ${REPO}/issues/{number}`, "github.issue.edit", "Close an issue"), ...CLOSED },
260
+ { ...repoApi(`PATCH ${REPO}/issues/{number}`, "github.issue.edit", "Reopen an issue"), ...OPENED },
261
+ repoApi(`PATCH ${REPO}/issues/{number}`, "github.issue.edit", "Edit an issue"),
262
+ repoApi(`POST ${REPO}/labels`, "github.label.manage", "Create a label"),
263
+ repoApi(`PATCH ${REPO}/labels/{name}`, "github.label.manage", "Edit a label"),
264
+ ...[`POST ${REPO}/releases/{release}/assets`].map((match) => ({
265
+ match,
266
+ action: "read",
267
+ because: NOT_GOVERNED
268
+ }))
245
269
  ];
246
270
  export const GITHUB_CAPTURE = {
247
271
  params: {
@@ -280,6 +304,13 @@ export const GITHUB_CAPTURE = {
280
304
  { match: "repo delete", action: "github.repo.delete", hook: "ghRepo" },
281
305
  { match: "repo edit", action: "github.repo.public", hook: "ghRepo" },
282
306
  { match: "secret set", action: "github.secret.change", hook: "ghRepo" },
307
+ // The repository writes named since 2026-11-17 (`GH_REPO_WRITES`).
308
+ ...Object.entries(GH_REPO_WRITES).map(([match, [action]]) => ({
309
+ match,
310
+ action,
311
+ hook: "ghRepo",
312
+ ...(match === "pr close" ? { also: [{ action: "github.branch.delete", on: "repo" }] } : {})
313
+ })),
283
314
  { match: "api", action: "github.unclassified", hook: "ghApi" },
284
315
  // Every ref a push moves (refspecs, force, delete, tags, the worst case for what it can't name).
285
316
  // `also` lists the other Actions the hook names (the engine never builds a hook rule's parts).
@@ -2,6 +2,7 @@
2
2
  import { nodeId } from "../../controlPlane.generated.js";
3
3
  import { matchBranch, MAX_BRANCH_MATCH_LENGTH } from "../../controlPlaneGithubCatalog.generated.js";
4
4
  import { classify, render } from "../engine.generated.js";
5
+ import { GH_REPO_WRITES } from "./githubReads.generated.js";
5
6
  const lower = (value) => value.toLowerCase();
6
7
  const text = (value) => (typeof value === "string" && value !== "" ? value : null);
7
8
  const words = (value) => value === undefined || typeof value === "boolean" ? [] : Array.isArray(value) ? value : [value];
@@ -31,6 +32,8 @@ const SUMMARY = {
31
32
  secret: "Change secret {name}",
32
33
  secrets: "Change secrets",
33
34
  tag: "Push tag {tag}",
35
+ repoWrite: "{what} in {repo}",
36
+ closeAndDelete: "Close a pull request and delete its branch in {repo}",
34
37
  allBranches: "Push to all branches ({why})",
35
38
  branchesDeleted: "Delete branches ({why})"
36
39
  };
@@ -193,9 +196,26 @@ function ghRepo(n, _p, context) {
193
196
  case "secret set":
194
197
  return secretSet(n, argument ?? null, repoFlag);
195
198
  default:
196
- return "unclassified";
199
+ return repoWrite(n, argument, repoFlag);
197
200
  }
198
201
  }
202
+ /** A pull request's or issue's URL names its own repository. */
203
+ const ITEM_URL = /^https?:\/\/[^/]+\/([^/]+)\/([^/]+)\/(?:pull|issues)\/\d+/;
204
+ function repoWrite(n, argument, repoFlag) {
205
+ const write = Object.prototype.hasOwnProperty.call(GH_REPO_WRITES, n.op) ? GH_REPO_WRITES[n.op] : undefined;
206
+ if (!write)
207
+ return "unclassified";
208
+ const url = argument?.match(ITEM_URL);
209
+ const r = url ? { owner: url[1], repo: url[2] } : repoFlag;
210
+ if (!r)
211
+ return "read";
212
+ const repo = slug(r.owner, r.repo);
213
+ // Closing with --delete-branch also deletes the head branch, not named on the line: the worse of the two.
214
+ if (n.op === "pr close" && present(n.params["delete-branch"])) {
215
+ return [onRepo(r.owner, r.repo, "github.branch.delete", render(SUMMARY.closeAndDelete, { repo }))];
216
+ }
217
+ return [onRepo(r.owner, r.repo, write[0], render(SUMMARY.repoWrite, { what: write[1], repo }))];
218
+ }
199
219
  function secretSet(n, name, repoFlag) {
200
220
  const org = text(n.params.org);
201
221
  if (present(n.params.user))
@@ -1,5 +1,7 @@
1
1
  import type { FlagSpec, ReadEvidence } from "../manifest.generated.js";
2
2
  export declare const GH_COMMANDS: Record<string, readonly FlagSpec[]>;
3
+ /** The repository writes named since 2026-11-17, as today's classifier names them (`REPO_WRITES`). */
4
+ export declare const GH_REPO_WRITES: Readonly<Record<string, readonly [string, string]>>;
3
5
  export declare const GH_READS: Readonly<Record<string, ReadEvidence>>;
4
6
  export declare const GITHUB_MCP_READS: Readonly<Record<string, ReadEvidence>>;
5
7
  /** GETs a request names (any other route fails closed through the API; `gh api` reads every GET). */
@@ -33,12 +33,41 @@ const GH = {
33
33
  "repo view": `${JSON_OUT}-b/branch= -w/web`,
34
34
  "release list": `${REPO}${JSON_OUT}exclude-drafts exclude-pre-releases -L/limit= -O/order=`,
35
35
  "release view": `${REPO}${JSON_OUT}-w/web`,
36
+ "workflow run": `${REPO}-F/field=+ -f/raw-field=+ json -r/ref=`,
37
+ "run cancel": `${REPO}`,
38
+ "pr edit": `${REPO}add-assignee=+ add-label=+ add-project=+ add-reviewer=+ -B/base= -b/body= -F/body-file= -m/milestone= remove-assignee=+ remove-label=+ remove-milestone remove-project=+ remove-reviewer=+ -t/title=`,
39
+ "pr comment": `${REPO}-b/body= -F/body-file= create-if-none delete-last edit-last -e/editor -w/web yes`,
40
+ "pr close": `${REPO}-c/comment= -d/delete-branch`,
41
+ "pr reopen": `${REPO}-c/comment=`,
42
+ "issue edit": `${REPO}add-assignee=+ add-label=+ add-project=+ -b/body= -F/body-file= -m/milestone= remove-assignee=+ remove-label=+ remove-milestone remove-project=+ -t/title=`,
43
+ "issue comment": `${REPO}-b/body= -F/body-file= create-if-none delete-last edit-last -e/editor -w/web yes`,
44
+ "issue close": `${REPO}-c/comment= duplicate-of= -r/reason=`,
45
+ "issue reopen": `${REPO}-c/comment=`,
46
+ "label edit": `${REPO}-c/color= -d/description= -n/name=`,
36
47
  "label create": `${REPO}-c/color= -d/description= -f/force`,
37
48
  "ruleset list": `${REPO}-L/limit= -o/org= -p/parents -w/web`,
38
49
  "workflow list": `${REPO}${JSON_OUT}-a/all -L/limit=`,
39
50
  "auth status": "-a/active -h/hostname= -t/show-token"
40
51
  };
41
52
  export const GH_COMMANDS = Object.fromEntries(Object.entries(GH).map(([command, spec]) => [command, parse(spec)]));
53
+ /** The repository writes named since 2026-11-17, as today's classifier names them (`REPO_WRITES`). */
54
+ export const GH_REPO_WRITES = {
55
+ "workflow run": ["github.workflow.run", "Run a workflow"],
56
+ "run cancel": ["github.run.cancel", "Cancel a workflow run"],
57
+ "run rerun": ["github.run.rerun", "Re-run a workflow"],
58
+ "pr create": ["github.pr.open", "Open a pull request"],
59
+ "pr edit": ["github.pr.edit", "Edit a pull request"],
60
+ "pr comment": ["github.comment", "Comment"],
61
+ "pr close": ["github.pr.state", "Close a pull request"],
62
+ "pr reopen": ["github.pr.state", "Reopen a pull request"],
63
+ "issue create": ["github.issue.open", "Open an issue"],
64
+ "issue edit": ["github.issue.edit", "Edit an issue"],
65
+ "issue comment": ["github.comment", "Comment"],
66
+ "issue close": ["github.issue.edit", "Close an issue"],
67
+ "issue reopen": ["github.issue.edit", "Reopen an issue"],
68
+ "label create": ["github.label.manage", "Create a label"],
69
+ "label edit": ["github.label.manage", "Edit a label"]
70
+ };
42
71
  const LOOKS = "Shows or lists; changes nothing on GitHub";
43
72
  export const GH_READS = {
44
73
  "pr view": LOOKS,
@@ -57,11 +86,7 @@ export const GH_READS = {
57
86
  "release view": LOOKS,
58
87
  "ruleset list": LOOKS,
59
88
  "workflow list": LOOKS,
60
- "auth status": "Shows the signed-in account on this computer",
61
- "pr create": NOT_GOVERNED,
62
- "issue create": NOT_GOVERNED,
63
- "run rerun": NOT_GOVERNED,
64
- "label create": NOT_GOVERNED
89
+ "auth status": "Shows the signed-in account on this computer"
65
90
  };
66
91
  /** GitHub's MCP server (github/github-mcp-server): its read-only tools, and the writes not governed in v1. */
67
92
  const MCP_HINT = [
@@ -70,8 +70,8 @@ const ACTIONS = [
70
70
  ["railway.volume.backups", "change", "volume", "Change backups", "Archive"],
71
71
  ["railway.bucket.delete", "change", "bucket", "Delete bucket", "Trash2"],
72
72
  ["railway.bucket.credentials", "change", "bucket", "Reset credentials", "Key"],
73
- // Anything the manifest can't name fails closed; in the server catalog since E3 (2026-11-16).
74
- ["railway.unclassified", "delete", "project", "Unclassified action", "CircleHelp"]
73
+ // Anything the manifest can't name: its own kind, Unclassified (2026-11-17), never assumed to be a Delete.
74
+ ["railway.unclassified", "unclassified", "project", "Unclassified action", "CircleHelp"]
75
75
  ];
76
76
  export const RAILWAY_ACTIONS = ACTIONS.map(([key, kind, appliesTo, label, icon]) => ({
77
77
  key,
@@ -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: 2,
88
+ version: 3,
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: 5,
18
+ version: 6,
19
19
  plans: ["free", "pro", "team", "enterprise"],
20
20
  identity: "member",
21
21
  services: [
@@ -21,9 +21,9 @@ export const SUPABASE_ACTIONS = [
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.
23
23
  a("supabase.project.change", "change", "project", "Other change", "Settings"),
24
- // Anything the manifest doesn't name, and every write that isn't governed and isn't a plain change:
25
- // kind delete, so the default rules block it until a person maps it.
26
- a("supabase.unclassified", "delete", "project", "Unclassified action", "CircleHelp")
24
+ // Anything the manifest doesn't name, and every write that isn't governed and isn't a plain change: its own
25
+ // kind, Unclassified (2026-11-17), allowed by default and decided only by a rule on that kind or this action.
26
+ a("supabase.unclassified", "unclassified", "project", "Unclassified action", "CircleHelp")
27
27
  ];
28
28
  const node = (type, label, service) => ({
29
29
  type,
@@ -1,13 +1,14 @@
1
1
  /**
2
- * The control plane's shared contract (docs/design/control-plane.md). Types
3
- * and a few pure helpers only, imported by the server, the web app and the
4
- * bridge. Every track builds against this file; change it only through the
5
- * spec's owner (the orchestrating session), never from a track. Account-scoped
6
- * ids, exact matching and Managed coverage (decided 2026-11-13) live beside it
7
- * in `controlPlaneModel.ts`.
2
+ * The control plane's shared contract (docs/design/control-plane.md). Types and a few pure helpers only, imported by
3
+ * the server, the web app and the bridge. Every track builds against this file; change it only through the spec's
4
+ * owner (the orchestrating session), never from a track. Account-scoped ids, exact matching and Managed coverage
5
+ * (decided 2026-11-13) live beside it in `controlPlaneModel.ts`; what an unnamed action hit in `controlPlaneUnnamed.ts`.
8
6
  */
9
- /** The kinds (2026-11-16). A read is decided only when a Block could cover it (server `readGate.ts`). */
10
- export declare const KINDS: readonly ["delete", "change", "create", "read"];
7
+ import type { CpAgentV21, CpPersonV21 } from "./controlPlanePeople.generated.js";
8
+ import type { UnnamedHit } from "./controlPlaneUnnamed.generated.js";
9
+ export type * from "./controlPlanePeople.generated.js";
10
+ /** The kinds (2026-11-16; Unclassified 2026-11-17). A read is decided only when a Block could cover it (`readGate.ts`). */
11
+ export declare const KINDS: readonly ["delete", "change", "create", "read", "unclassified"];
11
12
  export type Kind = (typeof KINDS)[number];
12
13
  export declare const KIND_LABEL: Readonly<Record<Kind, string>>;
13
14
  export declare const KIND_MEANING: Readonly<Record<Kind, string>>;
@@ -156,6 +157,7 @@ export type Classification = {
156
157
  nodes?: DiscoveredNode[];
157
158
  /** What it touched beneath the node, when that isn't a node of its own (section 6). */
158
159
  target?: ActionTarget;
160
+ unnamed?: UnnamedHit;
159
161
  };
160
162
  /** The one a bundle's event records when nothing in it is blocked: the most severe, first on ties. */
161
163
  export declare function mostSevere<T extends {
@@ -324,6 +326,7 @@ export type ActionEvent = {
324
326
  dbRole?: string;
325
327
  /** Unmanaged events: the credential that made it, worked out when read; never stored. */
326
328
  credentialRef?: CpCredentialRef;
329
+ unnamed?: UnnamedHit;
327
330
  };
328
331
  export declare const OUTSIDE_CREDENTIAL_KINDS: readonly ["personal_token", "deploy_key", "actions_secret", "railway_token", "service_role_key", "database_password"];
329
332
  export type OutsideCredentialKind = (typeof OUTSIDE_CREDENTIAL_KINDS)[number];
@@ -458,6 +461,7 @@ export type CpPlatformRow = {
458
461
  setUp: boolean;
459
462
  }>;
460
463
  gatewayCalls7d?: number;
464
+ blocked7d?: number;
461
465
  };
462
466
  export type CpNodeView = {
463
467
  node: ResourceNode;
@@ -528,8 +532,8 @@ export type CpTreeResponse = {
528
532
  export type CpRuleSetRow = {
529
533
  rule: ControlRule;
530
534
  path: CpPathEntry[];
531
- /** Observe mode, Block rules only: actions this rule would have blocked in the last 7 days. Absent once enforcing. */
532
535
  wouldBlock?: number;
536
+ hits7d?: number;
533
537
  };
534
538
  /** GET /api/cp/blocked: a pending block, its event and the event's node path (platform first). With
535
539
  * `?decided=today` (or `?decided=since&since=<ms>`): blocks decided since then, newest decision first, each with
@@ -555,8 +559,7 @@ export type CpAgentRow = {
555
559
  consequential7d: number;
556
560
  /** Of those, how many a rule blocked. */
557
561
  blocked7d: number;
558
- guard: "on" | "off" | "unknown";
559
- /** Set only on the one row counting outside identities. */
562
+ guard: "on" | "off" | "outdated" | "na" | "unknown";
560
563
  unknown?: true;
561
564
  /** Passport credentials issued to it that are still live (not revoked, not expired). Every server from v19 sets it. */
562
565
  liveCredentials?: number;
@@ -565,7 +568,7 @@ export type CpAgentRow = {
565
568
  by: string;
566
569
  at: number;
567
570
  };
568
- };
571
+ } & CpAgentV21;
569
572
  /** One member. Never carries an email. */
570
573
  export type CpPersonRow = {
571
574
  id: string;
@@ -575,11 +578,10 @@ export type CpPersonRow = {
575
578
  consequential7d: number;
576
579
  /** Outside events attributed to this person's login in the last 7 days. */
577
580
  outside7d: number;
578
- /** v19: their team when recorded; platforms acted on in 7 days; outside credentials of theirs seen in 30 days. */
579
581
  team?: string;
580
582
  platforms?: PlatformKey[];
581
583
  keys?: number;
582
- };
584
+ } & CpPersonV21;
583
585
  /** One line of fact on the Coverage tab, computed from real data. */
584
586
  export type CpCoverageFact = {
585
587
  /** The card it belongs to. */
@@ -596,4 +598,3 @@ export type CpCoverageView = {
596
598
  /** A fact Passport does not record is left out, never made up. */
597
599
  facts: CpCoverageFact[];
598
600
  };
599
- export {};