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
@@ -0,0 +1,225 @@
1
+ // Generated by scripts/generate-control-plane-classifier.mjs. Do not edit.
2
+ /**
3
+ * What an action Passport can't name hit (`UnnamedHit`, decided 2026-11-17), made coarse: an API path becomes a
4
+ * template of the platform's own path words, a command line its program and known subcommand words. Pure; the
5
+ * server, the bridge and the kit share it. Never an owner, repository, number, id, sha, branch, query string, body,
6
+ * flag or argument: a segment or word that isn't the platform's own vocabulary is a placeholder or dropped.
7
+ */
8
+ /** An app's action Passport can't name (`github.unclassified`). */
9
+ export const isUnclassifiedAction = (actionKey) => actionKey.endsWith(".unclassified");
10
+ /** The kind an event is shown as: Unclassified for an unnamed action whatever kind it was stored with (events
11
+ * from before 2026-11-17 recorded it as a Delete), else its own. */
12
+ export function displayKind(event) {
13
+ return isUnclassifiedAction(event.actionKey) ? "unclassified" : event.kind;
14
+ }
15
+ export const UNNAMED_METHODS = ["POST", "PUT", "PATCH", "DELETE", "GET", "HEAD"];
16
+ const MAX_SEGMENTS = 12;
17
+ const MAX_PATH = 200;
18
+ /** A subcommand word as a CLI spells one. */
19
+ const COMMAND_WORD = /^[a-z][a-z-]{0,30}$/;
20
+ const words = (text) => new Set(text.split(/\s+/).filter(Boolean));
21
+ /** GitHub REST's literal path words (api.github.com), not exhaustive: any other segment becomes a placeholder. */
22
+ export const GITHUB_PATH_WORDS = words(`
23
+ repos orgs users user enterprises graphql app installations installation
24
+ actions workflows runs jobs dispatches cancel force-cancel rerun rerun-failed-jobs approve logs timing attempts
25
+ artifacts caches secrets variables runners runner-groups permissions oidc environments deployment-protection-rules
26
+ pulls issues comments reviews requested_reviewers merge update-branch files commits labels assignees milestones
27
+ events timeline reactions lock sub_issues
28
+ releases assets latest tags git refs heads blobs trees matching-refs ref contents readme
29
+ branches protection required_status_checks required_pull_request_reviews enforce_admins restrictions rename
30
+ rulesets rules collaborators invitations members memberships teams outside_collaborators public_members
31
+ hooks tests pings deliveries config redeliver keys deployments statuses check-runs check-suites pages forks topics subscription subscribers stargazers
32
+ vulnerability-alerts automated-security-fixes code-scanning dependabot secret-scanning alerts autolinks
33
+ properties values transfer generate dispatch notifications languages contributors traffic projects codespaces
34
+ `);
35
+ /** Supabase's Management API path words (api.supabase.com/v1). */
36
+ export const SUPABASE_PATH_WORDS = words(`
37
+ v1 projects organizations branches database query migrations functions deploy body secrets api-keys config auth
38
+ postgrest pgbouncer storage buckets network-restrictions network-bans ssl-enforcement custom-hostname
39
+ vanity-subdomain restore pause unpause upgrade readonly health types typescript snippets sso providers
40
+ third-party-auth signing-keys billing addons apply push reset merge backups pitr settings members
41
+ `);
42
+ /** Railway is GraphQL: its path is one word. */
43
+ export const RAILWAY_PATH_WORDS = words("graphql v2");
44
+ export function pathWordsFor(platform) {
45
+ if (platform === "github")
46
+ return GITHUB_PATH_WORDS;
47
+ if (platform === "supabase")
48
+ return SUPABASE_PATH_WORDS;
49
+ if (platform === "railway")
50
+ return RAILWAY_PATH_WORDS;
51
+ return new Set();
52
+ }
53
+ /** A root word whose next segments are names, in order: `repos/{owner}/{repo}`. */
54
+ const POSITIONAL = {
55
+ repos: ["owner", "repo"],
56
+ orgs: ["org"],
57
+ users: ["user"],
58
+ enterprises: ["enterprise"]
59
+ };
60
+ /** The placeholder a value takes after a path word, when it isn't `{id}`. */
61
+ const AFTER = {
62
+ pulls: "number",
63
+ issues: "number",
64
+ milestones: "number",
65
+ branches: "branch",
66
+ heads: "branch",
67
+ tags: "tag",
68
+ labels: "name",
69
+ secrets: "name",
70
+ variables: "name",
71
+ environments: "name",
72
+ contents: "path",
73
+ commits: "sha",
74
+ projects: "ref",
75
+ functions: "slug"
76
+ };
77
+ function decoded(segment) {
78
+ try {
79
+ return decodeURIComponent(segment);
80
+ }
81
+ catch {
82
+ return segment;
83
+ }
84
+ }
85
+ /**
86
+ * An API path as a template of the platform's own words: scheme, host, query and fragment dropped; the names after
87
+ * `repos`, `orgs`, `users` (as the first word) are `{owner}/{repo}`, `{org}`, `{user}`; any other segment stays only
88
+ * when it is one of `known`, else it is one placeholder named by the word before it (`{number}` after `pulls`,
89
+ * `{branch}` after `branches`, `{sha}` for a commit hash, else `{id}`), a run of them collapsed into one.
90
+ */
91
+ export function templatePath(raw, known) {
92
+ const bare = raw
93
+ .trim()
94
+ .replace(/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i, "")
95
+ .replace(/[?#][\s\S]*$/, "");
96
+ const segments = bare.split("/").filter(Boolean).slice(0, 64).map(decoded);
97
+ const out = [];
98
+ let index = 0;
99
+ const positional = segments[0] !== undefined && known.has(segments[0]) ? POSITIONAL[segments[0]] : undefined;
100
+ if (positional) {
101
+ out.push(segments[0]);
102
+ index = 1;
103
+ for (const name of positional) {
104
+ if (index >= segments.length)
105
+ break;
106
+ out.push(`{${name}}`);
107
+ index++;
108
+ }
109
+ }
110
+ let word;
111
+ let inRun = false;
112
+ for (; index < segments.length; index++) {
113
+ const segment = segments[index];
114
+ if (known.has(segment)) {
115
+ out.push(segment);
116
+ word = segment;
117
+ inRun = false;
118
+ continue;
119
+ }
120
+ if (inRun)
121
+ continue;
122
+ const name = /^[0-9a-f]{40}$/i.test(segment) ? "sha" : ((word && AFTER[word]) ?? "id");
123
+ out.push(`{${name}}`);
124
+ inRun = true;
125
+ }
126
+ return out.slice(0, MAX_SEGMENTS).join("/").slice(0, MAX_PATH);
127
+ }
128
+ /** `gh`'s command groups and their subcommands (gh 2.6x manual); a group with none takes no subcommand. */
129
+ const GH_COMMANDS = Object.fromEntries(Object.entries({
130
+ agent: "",
131
+ alias: "delete import list set",
132
+ api: "",
133
+ attestation: "download trusted-root verify",
134
+ auth: "login logout refresh setup-git status switch token",
135
+ browse: "",
136
+ cache: "delete list",
137
+ codespace: "code cp create delete edit jupyter list logs ports rebuild ssh stop view",
138
+ completion: "",
139
+ config: "clear-cache get list set",
140
+ extension: "browse create exec install list remove search upgrade",
141
+ gist: "clone create delete edit list rename view",
142
+ "gpg-key": "add delete list",
143
+ issue: "close comment create delete develop edit list lock pin reopen status transfer unlock unpin view", // copy-style-allow filler: gh's own subcommand names
144
+ label: "clone create delete edit list",
145
+ org: "list",
146
+ pr: "checkout checks close comment create diff edit list lock merge ready reopen review revert status unlock update-branch view", // copy-style-allow filler: gh's own subcommand names
147
+ project: "close copy create delete edit field-create field-delete field-list item-add item-archive item-create item-delete item-edit item-list link list mark-template unlink view",
148
+ release: "create delete delete-asset download edit list upload verify verify-asset view",
149
+ repo: "archive autolink clone create delete deploy-key edit fork gitignore license list rename set-default sync unarchive view",
150
+ ruleset: "check list view",
151
+ run: "cancel delete download list rerun view watch",
152
+ search: "code commits issues prs repos",
153
+ secret: "delete list set",
154
+ "ssh-key": "add delete list",
155
+ status: "",
156
+ variable: "delete get list set",
157
+ workflow: "disable enable list run view"
158
+ }).map(([group, subs]) => [group, words(subs)]));
159
+ /** Git's own commands; git takes one word. */
160
+ const GIT_COMMANDS = words(`
161
+ add am apply archive bisect blame branch bundle checkout cherry-pick clean clone commit config describe diff fetch
162
+ format-patch gc grep init log ls-files ls-remote merge mv notes pull push range-diff rebase reflog remote reset
163
+ restore revert rm shortlog show sparse-checkout stash status submodule switch tag worktree
164
+ `);
165
+ /** A program's name from its path: `/usr/bin/gh.exe` is `gh`. */
166
+ const programName = (argv0) => (argv0 ?? "").replace(/^.*[\\/]/, "").replace(/\.exe$/i, "");
167
+ /**
168
+ * A command line as its program and at most two subcommand words: each a CLI word (`^[a-z][a-z-]{0,30}$`) and, for
169
+ * `gh` and `git`, one that CLI has, so a positional argument (a branch, a remote, a repository, a number) never
170
+ * passes as a subcommand. Flags end it. Null when the program itself isn't a plain name.
171
+ */
172
+ export function unnamedCommand(argv) {
173
+ const program = programName(argv[0]);
174
+ if (!COMMAND_WORD.test(program))
175
+ return null;
176
+ const out = [program];
177
+ const rest = argv.slice(1);
178
+ for (const word of rest.slice(0, 2)) {
179
+ if (!COMMAND_WORD.test(word))
180
+ break;
181
+ if (program === "git" && (out.length > 1 || !GIT_COMMANDS.has(word)))
182
+ break;
183
+ if (program === "gh") {
184
+ const group = out.length === 1 ? GH_COMMANDS[word] : GH_COMMANDS[out[1]];
185
+ if (out.length === 1 ? !Object.prototype.hasOwnProperty.call(GH_COMMANDS, word) : !group?.has(word))
186
+ break;
187
+ }
188
+ out.push(word);
189
+ }
190
+ return out.join(" ");
191
+ }
192
+ /** An API call's hit: its method (one of the HTTP methods) and its path's template; either may be unknown. */
193
+ export function unnamedApi(platform, method, path) {
194
+ const upper = method?.toUpperCase();
195
+ const template = path === undefined ? "" : templatePath(path, pathWordsFor(platform));
196
+ return {
197
+ via: "api",
198
+ ...(upper && UNNAMED_METHODS.includes(upper) ? { method: upper } : {}),
199
+ ...(template ? { path: template } : {})
200
+ };
201
+ }
202
+ /** A command line's hit; undefined when nothing of it can be kept. */
203
+ export function unnamedCli(argv) {
204
+ const command = unnamedCommand(argv);
205
+ return command === null ? undefined : { via: "cli", command };
206
+ }
207
+ /**
208
+ * What a caller sent (the bridge's classification) made coarse again, so nothing it adds survives: the method from
209
+ * the list, the path re-templated with the platform's words, the command re-read word by word. Anything else is
210
+ * dropped, never refused.
211
+ */
212
+ export function sanitizeUnnamed(platform, value) {
213
+ if (!value || typeof value !== "object" || Array.isArray(value))
214
+ return undefined;
215
+ const hit = value;
216
+ if (hit.via === "api") {
217
+ const method = typeof hit.method === "string" ? hit.method.slice(0, 10) : undefined;
218
+ const path = typeof hit.path === "string" ? hit.path.slice(0, 2_000) : undefined;
219
+ return unnamedApi(platform, method, path);
220
+ }
221
+ if (hit.via === "cli" && typeof hit.command === "string") {
222
+ return unnamedCli(hit.command.slice(0, 200).trim().split(/\s+/));
223
+ }
224
+ return undefined;
225
+ }
package/dist/cpCli.js CHANGED
@@ -14,6 +14,7 @@ import { readBoundedJson } from "./boundedResponse.js";
14
14
  import { credentialDir, enforceOwner, ensurePrivateDirectory, writePrivateAtomic } from "./credentialStorage.js";
15
15
  import { assertProfileName, getProfile } from "./credentials.js";
16
16
  import { disarmFastPath } from "./fastPathFlag.js";
17
+ import { parseNotices, saveLocalNotices } from "./localNotices.js";
17
18
  export const CP_CLI_PATH = "/api/cp/cli";
18
19
  /** Older than this, the hooks refresh the copy after they have answered. */
19
20
  export const CP_CLI_STALE_MS = 60 * 60 * 1000;
@@ -162,7 +163,10 @@ export async function refreshCpCli(profile, signal, deps = {}) {
162
163
  await response.body?.cancel().catch(() => undefined);
163
164
  return response.status === 404 ? "unavailable" : "failed";
164
165
  }
165
- const cli = parseCpCli(await readBoundedJson(response, MAX_BYTES));
166
+ const body = await readBoundedJson(response, MAX_BYTES);
167
+ const cli = parseCpCli(body);
168
+ // Notices are handed over once by this read: keep them before anything else can fail.
169
+ saveLocalNotices(profile, parseNotices(plainObject(body)?.notices));
166
170
  if (!cli || signal.aborted)
167
171
  return "failed";
168
172
  writeCpCli(profile, cli, (deps.now ?? Date.now)());
@@ -20,7 +20,7 @@ export type AppsPlan = {
20
20
  };
21
21
  /** Apps to connect, in the order the scan found them. */
22
22
  export declare function appsTodo(plan: AppsPlan): InitApp[];
23
- export declare function detectApps(s: InitSession, candidates?: ("github" | "railway" | "supabase" | "vercel" | "stripe" | "cloudflare-bindings")[]): AppsPlan;
23
+ export declare function detectApps(s: InitSession, candidates?: ("github" | "railway" | "supabase")[]): AppsPlan;
24
24
  export declare function pickApps(s: InitSession): Promise<InitApp[]>;
25
25
  export declare function addApp(s: InitSession, app: InitApp): Promise<{
26
26
  state: "pending" | "connected" | "attention";
@@ -11,7 +11,7 @@ import { firstText } from "./cliResult.js";
11
11
  import { openUrl, readBoundedJson, safeApiError, sleep } from "./cliSupport.js";
12
12
  import { APP_LABELS, INIT_APPS, appLabel, WAIT_CHUNK_SECONDS, WAIT_INTERACTIVE_MS, WAIT_NEXT_SECONDS, printable } from "./initState.js";
13
13
  import { listOf } from "./initUi.js";
14
- import { APPS_LINK } from "./webLinks.js";
14
+ import { CONNECT_LINK_LIFETIME, myAppLink } from "./webLinks.js";
15
15
  export function connectionRows(managed) {
16
16
  const rows = new Map();
17
17
  for (const raw of managed.connections) {
@@ -46,7 +46,7 @@ export function detectApps(s, candidates = s.candidates) {
46
46
  else if (row.status === "needs_your_signin")
47
47
  plan.pending.push(app);
48
48
  else
49
- plan.attention.push({ app, message: `${appLabel(app)} needs a one-time setup by your admin.` });
49
+ plan.attention.push({ app, message: `Your company doesn't have ${appLabel(app)} in Passport yet.` });
50
50
  }
51
51
  s.connected = [...plan.already];
52
52
  return plan;
@@ -80,7 +80,7 @@ export async function addApp(s, app) {
80
80
  const name = appLabel(app);
81
81
  if (response.status === 401 || response.status === 403 || response.status === 405) {
82
82
  await response.body?.cancel().catch(() => undefined);
83
- return { state: "attention", message: `Add ${name} in Passport first: ${s.gateway.origin}/${APPS_LINK}` };
83
+ return { state: "attention", message: `Add ${name} in Passport first: ${s.gateway.origin}/${myAppLink(app)}` };
84
84
  }
85
85
  if (response.status === 404) {
86
86
  const message = await safeApiError(response, "");
@@ -88,7 +88,7 @@ export async function addApp(s, app) {
88
88
  state: "attention",
89
89
  message: /catalog/i.test(message)
90
90
  ? `${name} isn't in this Passport's catalog.`
91
- : `Add ${name} in Passport first: ${s.gateway.origin}/${APPS_LINK}`
91
+ : `Add ${name} in Passport first: ${s.gateway.origin}/${myAppLink(app)}`
92
92
  };
93
93
  }
94
94
  if (response.status === 429) {
@@ -102,7 +102,7 @@ export async function addApp(s, app) {
102
102
  if (body.lifecycle === "waiting_on_admin") {
103
103
  const reason = typeof body.statusReason === "string" ? body.statusReason : "";
104
104
  if (body.request?.kind === "company_setup")
105
- return { state: "attention", message: `${name} needs a one-time setup by your admin.` };
105
+ return { state: "attention", message: `Your company doesn't have ${name} in Passport yet.` };
106
106
  if (/blocked/i.test(reason))
107
107
  return { state: "attention", message: `${name} is blocked by your workspace's app rules.` };
108
108
  return { state: "attention", message: `${name} needs approval from your admin.` };
@@ -256,6 +256,7 @@ export async function connectApps(s, apps) {
256
256
  else {
257
257
  s.screen.line("Open this link to sign in:", "Apps");
258
258
  s.screen.line(url);
259
+ s.screen.line(CONNECT_LINK_LIFETIME);
259
260
  }
260
261
  return "not_waited";
261
262
  }
@@ -268,6 +269,7 @@ export async function connectApps(s, apps) {
268
269
  else {
269
270
  s.screen.line(`Open this link to sign in.${stopHint}`, "Apps");
270
271
  s.screen.line(url);
272
+ s.screen.line(CONNECT_LINK_LIFETIME);
271
273
  }
272
274
  return waitForApps(s, apps, enter);
273
275
  }
package/dist/initOutro.js CHANGED
@@ -7,8 +7,7 @@
7
7
  * ! Railway connects to Passport once you finish signing in
8
8
  *
9
9
  * Next: ask your agent to work with one of your apps, like GitHub or
10
- * Railway. You'll see each step in Activity:
11
- * https://passportmcp.com/#cp/activity
10
+ * Railway. See what your agents do: https://passportmcp.com/#p
12
11
  */
13
12
  import { EXEC_TOKEN_PAGES, EXEC_VENDOR_NAMES } from "./execVendors.js";
14
13
  import { AGENT_NAMES } from "./initAgents.js";
@@ -19,7 +18,7 @@ import { desktopLine } from "./initLocalSteps.js";
19
18
  import { TRY_IT, appLabel } from "./initState.js";
20
19
  import { listOf } from "./initUi.js";
21
20
  import { wrap } from "./term.js";
22
- import { ACTIVITY_LINK, hashLink } from "./webLinks.js";
21
+ import { MY_ACTIVITY_LINK, hashLink } from "./webLinks.js";
23
22
  const done = (text) => ({ mark: "done", text });
24
23
  const warn = (text) => ({ mark: "warn", text });
25
24
  /** Apps this run connected, left waiting for a sign-in, skipped, or sent to an admin. */
@@ -114,15 +113,15 @@ function agentFollowUps(s) {
114
113
  }
115
114
  return items;
116
115
  }
117
- /** The one next step: put passport on PATH (then Activity), finish app
118
- * sign-ins, try an agent, or watch its work in Activity. A command or link is
116
+ /** The one next step: put passport on PATH (then My activity), finish app
117
+ * sign-ins, try an agent, or watch its work in My activity. A command or link is
119
118
  * never wrapped. */
120
119
  function nextCommand(s, waiting) {
121
120
  const stable = s.stable;
122
121
  if (stable?.binDir && !stable.onPath) {
123
122
  const line = pathLine(stable.binDir, s.env, s.home, s.platform);
124
123
  s.summary.pathLine = line;
125
- // PATH first, then Activity, so a first npx run still ends there.
124
+ // PATH first, then My activity, so a first npx run still ends there.
126
125
  const work = workNext(s, "Then");
127
126
  return [...pathNext(line, s.terminal.width), ...(work.length ? ["", ...work] : [])];
128
127
  }
@@ -137,13 +136,17 @@ function nextCommand(s, waiting) {
137
136
  const work = workNext(s, "Next:");
138
137
  return work.length ? work : ["Run: passport status"];
139
138
  }
140
- /** "Next: ask your agent to work with an app…" and the Activity link; nothing without a server to link to. */
139
+ /** "Next: ask your agent to work with an app…" and the My activity link; nothing without a server to link to. The
140
+ * link is never wrapped. */
141
141
  function workNext(s, lead) {
142
- const work = hashLink(s.gateway?.origin, ACTIVITY_LINK);
142
+ const work = hashLink(s.gateway?.origin, MY_ACTIVITY_LINK);
143
143
  if (!work)
144
144
  return [];
145
- const step = `${lead} ask your agent to work with one of your apps, like GitHub or Railway. You'll see each step in Activity:`;
146
- return [...wrap(step, s.terminal.width), work];
145
+ const step = `${lead} ask your agent to work with one of your apps, like GitHub or Railway.`;
146
+ const see = `See what your agents do: ${work}`;
147
+ // Narrow, the link gets a line of its own.
148
+ const tail = [...see].length <= s.terminal.width ? [see] : ["See what your agents do:", work];
149
+ return [...wrap(step, s.terminal.width), ...tail];
147
150
  }
148
151
  /** What to do next about PATH: the step, then the command on its own line. */
149
152
  export function pathNext(line, width) {
@@ -9,8 +9,9 @@ import type { InitScreen, InitTerminal } from "./initUi.js";
9
9
  import type { CredentialsSwitch } from "./offInV1.js";
10
10
  import type { ScanOptions, ScanResult } from "./scan.js";
11
11
  export declare const PASSPORT_CLOUD = "https://passportmcp.com";
12
- /** The production apps init looks for, in the order it lists them. */
13
- export declare const INIT_APPS: readonly ["railway", "vercel", "supabase", "cloudflare-bindings", "github", "stripe"];
12
+ /** The production apps init looks for, in the order it lists them: the deep apps (gateway apps were removed on
13
+ * 2026-11-17). */
14
+ export declare const INIT_APPS: readonly ["railway", "supabase", "github"];
14
15
  export type InitApp = (typeof INIT_APPS)[number];
15
16
  export declare const APP_LABELS: Record<InitApp, string>;
16
17
  /** The short name init uses for an app in its copy. */
package/dist/initState.js CHANGED
@@ -6,15 +6,13 @@
6
6
  import { dirname, join } from "node:path";
7
7
  import { fileURLToPath } from "node:url";
8
8
  export const PASSPORT_CLOUD = "https://passportmcp.com";
9
- /** The production apps init looks for, in the order it lists them. */
10
- export const INIT_APPS = ["railway", "vercel", "supabase", "cloudflare-bindings", "github", "stripe"];
9
+ /** The production apps init looks for, in the order it lists them: the deep apps (gateway apps were removed on
10
+ * 2026-11-17). */
11
+ export const INIT_APPS = ["railway", "supabase", "github"];
11
12
  export const APP_LABELS = {
12
13
  railway: "Railway",
13
- vercel: "Vercel",
14
14
  supabase: "Supabase",
15
- "cloudflare-bindings": "Cloudflare",
16
- github: "GitHub",
17
- stripe: "Stripe"
15
+ github: "GitHub"
18
16
  };
19
17
  /** The short name init uses for an app in its copy. */
20
18
  export function appLabel(app) {
@@ -23,29 +21,20 @@ export function appLabel(app) {
23
21
  /** A scan finding's provider → the catalog app that replaces the key. */
24
22
  export const APP_BY_PROVIDER = {
25
23
  Railway: "railway",
26
- Vercel: "vercel",
27
24
  Supabase: "supabase",
28
- Cloudflare: "cloudflare-bindings",
29
- GitHub: "github",
30
- Stripe: "stripe"
25
+ GitHub: "github"
31
26
  };
32
27
  /** A vendor CLI on PATH → its catalog app. */
33
28
  export const APP_BY_CLI = [
34
29
  ["railway", "railway"],
35
- ["vercel", "vercel"],
36
30
  ["supabase", "supabase"],
37
- ["wrangler", "cloudflare-bindings"],
38
- ["gh", "github"],
39
- ["stripe", "stripe"]
31
+ ["gh", "github"]
40
32
  ];
41
33
  /** A read-only first request per app, for the closing "Try it" line. */
42
34
  export const TRY_IT = {
43
35
  railway: "list your Railway services",
44
- vercel: "list your Vercel deployments",
45
36
  supabase: "list your Supabase projects",
46
- "cloudflare-bindings": "list your Cloudflare Workers",
47
- github: "list your open GitHub pull requests",
48
- stripe: "show your Stripe balance"
37
+ github: "list your open GitHub pull requests"
49
38
  };
50
39
  export const WAIT_INTERACTIVE_MS = 10 * 60 * 1000;
51
40
  /** How long the printed `passport connect --wait` command waits. */
@@ -0,0 +1,22 @@
1
+ /**
2
+ * One-time notices for this person (docs/design/v21/requests.md section 9b; docs/design/v21/people.md section 4):
3
+ * `GET /api/cp/cli` hands them over once (`notices`, marked delivered by that read), the CLI keeps them in a private
4
+ * local file, and whichever prints first takes them: the CLI at the end of a command, or the Claude Code hook as a
5
+ * system message after a command Passport handled. Taking is a rename, so two processes never print the same notice.
6
+ *
7
+ * Reading and taking never throw: a missing, corrupt or foreign-owned file is treated as empty.
8
+ */
9
+ export type LocalNotice = {
10
+ id: string;
11
+ text: string;
12
+ url?: string;
13
+ linkLabel?: string;
14
+ };
15
+ /** Validate notices from the server or the file; anything malformed is dropped, never thrown. */
16
+ export declare function parseNotices(value: unknown): LocalNotice[];
17
+ /** Keep notices the server just handed over, beside any not yet printed (newest kept when over the cap). */
18
+ export declare function saveLocalNotices(profile: string, notices: readonly LocalNotice[]): void;
19
+ /** Take every waiting notice, once: the file is renamed away first, so a parallel process finds nothing. */
20
+ export declare function takeLocalNotices(profile: string): LocalNotice[];
21
+ /** One notice as a person reads it: "Northwind · Priya Sharma asked you to … Open setup: https://…". */
22
+ export declare function noticeLine(notice: LocalNotice, workspace?: string): string;
@@ -0,0 +1,100 @@
1
+ /**
2
+ * One-time notices for this person (docs/design/v21/requests.md section 9b; docs/design/v21/people.md section 4):
3
+ * `GET /api/cp/cli` hands them over once (`notices`, marked delivered by that read), the CLI keeps them in a private
4
+ * local file, and whichever prints first takes them: the CLI at the end of a command, or the Claude Code hook as a
5
+ * system message after a command Passport handled. Taking is a rename, so two processes never print the same notice.
6
+ *
7
+ * Reading and taking never throw: a missing, corrupt or foreign-owned file is treated as empty.
8
+ */
9
+ import { lstatSync, renameSync, rmSync } from "node:fs";
10
+ import { join } from "node:path";
11
+ import { readBoundedUtf8File } from "./boundedFile.js";
12
+ import { credentialDir, enforceOwner, writePrivateAtomic } from "./credentialStorage.js";
13
+ import { assertProfileName } from "./credentials.js";
14
+ const MAX_BYTES = 16 * 1024;
15
+ const MAX_KEPT = 10;
16
+ const ID = /^nt_[0-9a-f]{8,32}$/;
17
+ function safeUrl(value) {
18
+ if (typeof value !== "string" || value.length > 600)
19
+ return undefined;
20
+ try {
21
+ const url = new URL(value);
22
+ return url.protocol === "https:" || (url.protocol === "http:" && ["localhost", "127.0.0.1"].includes(url.hostname))
23
+ ? url.toString()
24
+ : undefined;
25
+ }
26
+ catch {
27
+ return undefined;
28
+ }
29
+ }
30
+ /** Validate notices from the server or the file; anything malformed is dropped, never thrown. */
31
+ export function parseNotices(value) {
32
+ if (!Array.isArray(value))
33
+ return [];
34
+ const out = [];
35
+ for (const entry of value.slice(0, MAX_KEPT)) {
36
+ if (!entry || typeof entry !== "object")
37
+ continue;
38
+ const { id, text, url, linkLabel } = entry;
39
+ if (typeof id !== "string" || !ID.test(id) || typeof text !== "string")
40
+ continue;
41
+ const line = text
42
+ .replace(/[\u0000-\u001f\u007f]+/g, " ")
43
+ .trim()
44
+ .slice(0, 200);
45
+ if (!line)
46
+ continue;
47
+ const link = safeUrl(url);
48
+ const label = typeof linkLabel === "string" ? linkLabel.replace(/[^\p{L}\p{N} ]+/gu, "").slice(0, 24) : undefined;
49
+ out.push({ id, text: line, ...(link ? { url: link } : {}), ...(link && label ? { linkLabel: label } : {}) });
50
+ }
51
+ return out;
52
+ }
53
+ function noticesPath(profile) {
54
+ assertProfileName(profile);
55
+ return join(credentialDir(), `notices-${profile}.json`);
56
+ }
57
+ function readFile(path) {
58
+ try {
59
+ enforceOwner(lstatSync(path), "notices");
60
+ return parseNotices(JSON.parse(readBoundedUtf8File(path, MAX_BYTES)));
61
+ }
62
+ catch {
63
+ return [];
64
+ }
65
+ }
66
+ /** Keep notices the server just handed over, beside any not yet printed (newest kept when over the cap). */
67
+ export function saveLocalNotices(profile, notices) {
68
+ if (!notices.length)
69
+ return;
70
+ try {
71
+ const path = noticesPath(profile);
72
+ const kept = readFile(path);
73
+ for (const notice of notices)
74
+ if (!kept.some((existing) => existing.id === notice.id))
75
+ kept.push(notice);
76
+ writePrivateAtomic(path, ".notices", `${JSON.stringify(kept.slice(-MAX_KEPT))}\n`, "notices");
77
+ }
78
+ catch {
79
+ /* A notice lost here is one line someone doesn't see; Slack and email still carry setup asks. */
80
+ }
81
+ }
82
+ /** Take every waiting notice, once: the file is renamed away first, so a parallel process finds nothing. */
83
+ export function takeLocalNotices(profile) {
84
+ try {
85
+ const path = noticesPath(profile);
86
+ const claimed = `${path}.${process.pid}.taking`;
87
+ renameSync(path, claimed);
88
+ const notices = readFile(claimed);
89
+ rmSync(claimed, { force: true });
90
+ return notices;
91
+ }
92
+ catch {
93
+ return [];
94
+ }
95
+ }
96
+ /** One notice as a person reads it: "Northwind · Priya Sharma asked you to … Open setup: https://…". */
97
+ export function noticeLine(notice, workspace) {
98
+ const link = notice.url ? ` ${notice.linkLabel || "Open"}: ${notice.url}` : "";
99
+ return `${workspace ? `${workspace} · ` : ""}${notice.text}${link}`;
100
+ }
@@ -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.45.0";
7
+ export declare const PLUGIN_PIN = "0.46.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.45.0";
7
+ export const PLUGIN_PIN = "0.46.0";
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.45.0";
1
+ export declare const VERSION = "0.46.0";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Keep in lockstep with bridge/package.json.
2
- export const VERSION = "0.45.0";
2
+ export const VERSION = "0.46.0";
@@ -1,10 +1,27 @@
1
- export declare const ACTIVITY_LINK = "#cp/activity";
1
+ /**
2
+ * Links into the Passport web app for things the CLI names. The web app is
3
+ * served from the same origin as the profile's endpoint, and routes by hash.
4
+ * A member's own pages (docs/design/v21/member.md):
5
+ *
6
+ * #p My activity: what your agents did, and your apps
7
+ * #p?app=<key> My activity with one app highlighted under Your apps
8
+ * #cp/rules Allow and Block rules (an admin's page)
9
+ *
10
+ * A block's message carries the person's Why blocked link itself
11
+ * (`<origin>/b/<eventId>`), so the CLI prints no link of its own for it.
12
+ * Each returns null when the origin or page is unusable, so callers print a
13
+ * link only when they know exactly what it points at.
14
+ */
15
+ /** How long a connect or connections link lasts (the server's default; docs/design/v21/member.md, link lifetimes). */
16
+ export declare const LINK_MINUTES = 15;
17
+ /** The line under a connect link. */
18
+ export declare const CONNECT_LINK_LIFETIME = "Link expires in 15 minutes.";
19
+ /** My activity. */
20
+ export declare const MY_ACTIVITY_LINK = "#p";
2
21
  export declare const RULES_LINK = "#cp/rules";
3
- /** Apps: your connections page. */
4
- export declare const APPS_LINK = "#cp/connections";
22
+ /** My activity with `app` highlighted under Your apps (just My activity for a key that isn't one). */
23
+ export declare function myAppLink(app: string): string;
5
24
  /** `https://passportmcp.com` from an endpoint or origin, or null. */
6
25
  export declare function webOrigin(endpointOrOrigin: string | undefined): string | null;
7
- /** Where a block is answered: Blocked, in Passport. */
8
- export declare function approvalLink(origin: string | undefined, approvalId: string | undefined, _workspaceId?: string): string | null;
9
- /** A page the server named by its hash (`#cp/connections`), or null. */
26
+ /** A page the server named by its hash (`#p`), or null. */
10
27
  export declare function hashLink(origin: string | undefined, hash: unknown): string | null;