passport-bridge 0.28.0 → 0.30.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/README.md +3 -3
- package/dist/approvalNotice.js +2 -2
- package/dist/cliActions.js +14 -5
- package/dist/cliArgs.d.ts +1 -1
- package/dist/cliArgs.js +22 -13
- package/dist/cliAutopilotPolicy.d.ts +3 -0
- package/dist/cliChanges.js +4 -11
- package/dist/cliGuardState.js +2 -2
- package/dist/cliHookDecide.d.ts +6 -1
- package/dist/cliHookDecide.js +44 -4
- package/dist/cliHookGuard.d.ts +3 -0
- package/dist/cliHookGuard.js +2 -2
- package/dist/cliMain.js +1 -1
- package/dist/cliOutput.js +8 -8
- package/dist/cliPolicyV2.js +3 -1
- package/dist/cliProjectSummary.js +1 -1
- package/dist/cliSessions.d.ts +11 -11
- package/dist/cliSessions.js +19 -23
- package/dist/cliSessionsJson.js +3 -8
- package/dist/cliSessionsRender.js +3 -3
- package/dist/cliWait.js +1 -1
- package/dist/completion.js +2 -2
- package/dist/initOutro.js +11 -5
- package/dist/pluginPin.d.ts +1 -1
- package/dist/pluginPin.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/webLinks.d.ts +7 -1
- package/dist/webLinks.js +25 -9
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -293,9 +293,9 @@ The Passport plugin (`rsyed94/passport-plugins`) runs the same two hooks from th
|
|
|
293
293
|
passport rules test "railway redeploy -e staging"
|
|
294
294
|
passport rules test "rm -rf ~/"
|
|
295
295
|
passport wait apr_123
|
|
296
|
-
passport
|
|
297
|
-
passport
|
|
298
|
-
passport
|
|
296
|
+
passport tasks # or: --all, --running, --production-changes
|
|
297
|
+
passport tasks --project acme-api # the project's summary, then its work
|
|
298
|
+
passport tasks ses_123
|
|
299
299
|
passport changes --env production --since 1h
|
|
300
300
|
passport sync # or: passport sync --remove
|
|
301
301
|
passport env # or: passport env set railway qa staging
|
package/dist/approvalNotice.js
CHANGED
|
@@ -173,8 +173,8 @@ export function noticeContext(notices, now) {
|
|
|
173
173
|
return `- ${what}: approved by ${notice.approvedBy} ${span(now - notice.approvedAt)} ago (${when} UTC). The approval lapses in ${span(notice.expiresAt - now)}.`;
|
|
174
174
|
});
|
|
175
175
|
const lead = notices.length === 1
|
|
176
|
-
? "Passport: a command this
|
|
177
|
-
: "Passport: commands this
|
|
176
|
+
? "Passport: a command this task asked about earlier was approved after you stopped waiting. It hasn't run."
|
|
177
|
+
: "Passport: commands this task asked about earlier were approved after you stopped waiting. They haven't run.";
|
|
178
178
|
return [
|
|
179
179
|
lead,
|
|
180
180
|
...lines,
|
package/dist/cliActions.js
CHANGED
|
@@ -53,7 +53,9 @@ function repository(cwd, runtime, fs) {
|
|
|
53
53
|
return {
|
|
54
54
|
root,
|
|
55
55
|
cwd: machine.cwd,
|
|
56
|
-
...(remote
|
|
56
|
+
...(remote
|
|
57
|
+
? { repo: remoteFingerprint(remote), repoName: remote.split("/").pop(), repoHost: remote.split("/")[0] }
|
|
58
|
+
: {})
|
|
57
59
|
};
|
|
58
60
|
}
|
|
59
61
|
/** What `<script> [args…]` names, with the hash of what it runs today. */
|
|
@@ -64,7 +66,7 @@ function describeScript(words, explicitArgs, repo, fs) {
|
|
|
64
66
|
const cwd = repo.cwd ?? repo.root;
|
|
65
67
|
if (!cwd)
|
|
66
68
|
return "Run this inside the project.";
|
|
67
|
-
const ids =
|
|
69
|
+
const ids = repo.repo ? { repo: repo.repo, repoName: repo.repoName, repoHost: repo.repoHost } : {};
|
|
68
70
|
if (RUNNERS.has(first)) {
|
|
69
71
|
// `make deploy`, `npm run deploy`: what the target or package script runs.
|
|
70
72
|
const target = first === "make" ? rest.join(" ") : `run ${rest.filter((word) => word !== "run").join(" ")}`;
|
|
@@ -115,8 +117,15 @@ async function post(client, body, args, runtime) {
|
|
|
115
117
|
body: JSON.stringify(body),
|
|
116
118
|
signal: AbortSignal.any([runtime.signal, AbortSignal.timeout(timeoutMs(args))])
|
|
117
119
|
});
|
|
118
|
-
if (!response.ok)
|
|
119
|
-
|
|
120
|
+
if (!response.ok) {
|
|
121
|
+
const error = await safeApiError(response, "Passport couldn't save it.");
|
|
122
|
+
// A server from before repository hosts refuses the field: send it without.
|
|
123
|
+
if (response.status === 400 && body.repoHost && error.includes('"repoHost"')) {
|
|
124
|
+
const { repoHost: _host, ...older } = body;
|
|
125
|
+
return post(client, older, args, runtime);
|
|
126
|
+
}
|
|
127
|
+
return { error, status: response.status };
|
|
128
|
+
}
|
|
120
129
|
const parsed = (await readBoundedJson(response).catch(() => ({})));
|
|
121
130
|
return { action: parsed.action ?? {} };
|
|
122
131
|
}
|
|
@@ -125,7 +134,7 @@ function line(action, fallback) {
|
|
|
125
134
|
const where = action.environment ? (ENV_WORD[action.environment] ?? action.environment) : "";
|
|
126
135
|
const what = classWord(action.actionClass);
|
|
127
136
|
return action.status === "proposed"
|
|
128
|
-
? `${label}: proposed (${what} in ${where}). An admin approves it
|
|
137
|
+
? `${label}: proposed (${what} in ${where}). An admin approves it on the app's page in Passport.`
|
|
129
138
|
: `${label}: ${what} in ${where}. Passport checks it from now on.`;
|
|
130
139
|
}
|
|
131
140
|
function classified(args) {
|
package/dist/cliArgs.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const COMMANDS: readonly ["init", "login", "logout", "profiles", "use", "status", "doctor", "ready", "search", "describe", "run", "connect", "request", "resources", "prompts", "discover", "scan", "hook", "wait", "rules", "actions", "
|
|
1
|
+
export declare const COMMANDS: readonly ["init", "login", "logout", "profiles", "use", "status", "doctor", "ready", "search", "describe", "run", "connect", "request", "resources", "prompts", "discover", "scan", "hook", "wait", "rules", "actions", "tasks", "changes", "env", "sync", "exec", "undo", "keys", "setup", "session", "access", "update", "completion", "help", "version"];
|
|
2
2
|
export type Command = (typeof COMMANDS)[number];
|
|
3
3
|
/** Old names that still run for one release, left out of help, completion,
|
|
4
4
|
* and suggestions. `discover` is part of `scan` now. */
|
package/dist/cliArgs.js
CHANGED
|
@@ -21,7 +21,7 @@ export const COMMANDS = [
|
|
|
21
21
|
"wait",
|
|
22
22
|
"rules",
|
|
23
23
|
"actions",
|
|
24
|
-
"
|
|
24
|
+
"tasks",
|
|
25
25
|
"changes",
|
|
26
26
|
"env",
|
|
27
27
|
"sync",
|
|
@@ -93,13 +93,13 @@ const FLAGS = {
|
|
|
93
93
|
"delegation-id": { kind: "value", commands: ["access"] },
|
|
94
94
|
"client-id": { kind: "value", commands: ["access"] },
|
|
95
95
|
environment: { kind: "value", commands: ["rules", "actions"] },
|
|
96
|
-
status: { kind: "value", commands: ["
|
|
97
|
-
all: { kind: "boolean", commands: ["
|
|
98
|
-
running: { kind: "boolean", commands: ["
|
|
99
|
-
"production-changes": { kind: "boolean", commands: ["
|
|
100
|
-
project: { kind: "value", commands: ["
|
|
101
|
-
pr: { kind: "value", commands: ["
|
|
102
|
-
since: { kind: "value", commands: ["
|
|
96
|
+
status: { kind: "value", commands: ["tasks"] },
|
|
97
|
+
all: { kind: "boolean", commands: ["tasks"] },
|
|
98
|
+
running: { kind: "boolean", commands: ["tasks"] },
|
|
99
|
+
"production-changes": { kind: "boolean", commands: ["tasks"] },
|
|
100
|
+
project: { kind: "value", commands: ["tasks", "changes"] },
|
|
101
|
+
pr: { kind: "value", commands: ["tasks", "changes"] },
|
|
102
|
+
since: { kind: "value", commands: ["tasks", "changes"] },
|
|
103
103
|
until: { kind: "value", commands: ["changes"] },
|
|
104
104
|
env: { kind: "value", commands: ["changes"] },
|
|
105
105
|
remove: { kind: "boolean", commands: ["sync", "keys"] },
|
|
@@ -144,8 +144,13 @@ function unknownOption(raw, command) {
|
|
|
144
144
|
const where = command && command !== "help" ? `passport help ${command}` : "passport help";
|
|
145
145
|
return new ArgError(`Unknown option "${raw}". See the options with ${where}.`);
|
|
146
146
|
}
|
|
147
|
+
/** Old names that still run: `passport sessions` is `passport tasks`. */
|
|
148
|
+
const COMMAND_ALIASES = { sessions: "tasks" };
|
|
149
|
+
function commandNamed(value) {
|
|
150
|
+
return COMMANDS.includes(value) ? value : COMMAND_ALIASES[value];
|
|
151
|
+
}
|
|
147
152
|
function knownCommand(value) {
|
|
148
|
-
return
|
|
153
|
+
return commandNamed(value) !== undefined;
|
|
149
154
|
}
|
|
150
155
|
function flagParts(raw) {
|
|
151
156
|
const body = raw.slice(2);
|
|
@@ -212,9 +217,9 @@ export function parseArgs(argv) {
|
|
|
212
217
|
continue;
|
|
213
218
|
}
|
|
214
219
|
if (!command) {
|
|
215
|
-
|
|
220
|
+
command = commandNamed(raw);
|
|
221
|
+
if (!command)
|
|
216
222
|
throw unknownCommand(raw);
|
|
217
|
-
command = raw;
|
|
218
223
|
}
|
|
219
224
|
else {
|
|
220
225
|
positionals.push(raw);
|
|
@@ -245,8 +250,12 @@ function settle(args) {
|
|
|
245
250
|
if (command === "help" && positionals[0] !== undefined && !knownCommand(positionals[0]))
|
|
246
251
|
throw unknownCommand(positionals[0], true);
|
|
247
252
|
// `help keys add` shows the page for keys, which covers its subcommands.
|
|
248
|
-
|
|
253
|
+
// `help sessions` shows the page for its new name, tasks.
|
|
254
|
+
if (command === "help") {
|
|
249
255
|
positionals.splice(1);
|
|
256
|
+
if (positionals[0] !== undefined)
|
|
257
|
+
positionals[0] = commandNamed(positionals[0]);
|
|
258
|
+
}
|
|
250
259
|
validateShape(command, positionals);
|
|
251
260
|
validateNumbers(values);
|
|
252
261
|
return { command, positionals, values, repeats, booleans };
|
|
@@ -270,7 +279,7 @@ function validateShape(command, positionals) {
|
|
|
270
279
|
hook: 1,
|
|
271
280
|
wait: 1,
|
|
272
281
|
rules: 2,
|
|
273
|
-
|
|
282
|
+
tasks: 1,
|
|
274
283
|
changes: 0,
|
|
275
284
|
env: 4,
|
|
276
285
|
sync: 0,
|
|
@@ -147,6 +147,9 @@ export type AutopilotPolicy = {
|
|
|
147
147
|
/** The workspace keeps the agent's own step descriptions (cli-policy v2
|
|
148
148
|
* `descriptions`, "Show what agents say they're doing"). Off when absent. */
|
|
149
149
|
reportsSteps?: boolean;
|
|
150
|
+
/** The server answers an attended ask with its reason line and short link
|
|
151
|
+
* (cli-policy v2 `asks`), so the guard asks it before the agent's prompt. */
|
|
152
|
+
askLines?: boolean;
|
|
150
153
|
/** Production classes someone else must approve: never run here, and never
|
|
151
154
|
* approved in the agent's own prompt. "Maya or Sam" names who approves. */
|
|
152
155
|
secondPerson?: {
|
package/dist/cliChanges.js
CHANGED
|
@@ -17,7 +17,7 @@ import { failure, timeoutMs } from "./cliSupport.js";
|
|
|
17
17
|
import { appName, clientName, count, list, oneOf, record, text, time, windowOf } from "./cliSessionsJson.js";
|
|
18
18
|
import { countOf } from "./plural.js";
|
|
19
19
|
import { joinParts, mark, visibleLength, wrap, termOf } from "./term.js";
|
|
20
|
-
import { hashLink } from "./webLinks.js";
|
|
20
|
+
import { APPS_LINK, hashLink, workLink } from "./webLinks.js";
|
|
21
21
|
const DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
22
22
|
const RANGES = ["1h", "6h", "24h", "7d", "30d", "today"];
|
|
23
23
|
const DEFAULT_SINCE = "7d";
|
|
@@ -332,20 +332,13 @@ export async function changes(args, runtime, deps = {}) {
|
|
|
332
332
|
headers: { accept: "application/json" },
|
|
333
333
|
signal: AbortSignal.any([runtime.signal, AbortSignal.timeout(timeoutMs(args))])
|
|
334
334
|
});
|
|
335
|
-
const page = changesOf(await json(response, "This Passport server doesn't list Production changes yet. Run: passport
|
|
335
|
+
const page = changesOf(await json(response, "This Passport server doesn't list Production changes yet. Run: passport tasks --production-changes"));
|
|
336
336
|
const since = value(args, "since")?.trim() ?? DEFAULT_SINCE;
|
|
337
|
-
const web = query({
|
|
338
|
-
view: "production",
|
|
339
|
-
since: filters.since,
|
|
340
|
-
until: filters.until,
|
|
341
|
-
project: filters.project,
|
|
342
|
-
pr: filters.pr
|
|
343
|
-
});
|
|
344
337
|
return {
|
|
345
338
|
json: page,
|
|
346
339
|
human: renderChanges(page, term, now, since, {
|
|
347
|
-
environments: hashLink(client.origin,
|
|
348
|
-
more:
|
|
340
|
+
environments: hashLink(client.origin, APPS_LINK),
|
|
341
|
+
more: workLink(client.origin, "actions", { env: "production", since: filters.since, project: filters.project })
|
|
349
342
|
})
|
|
350
343
|
};
|
|
351
344
|
}
|
package/dist/cliGuardState.js
CHANGED
|
@@ -79,7 +79,7 @@ export function problemFix(kind, client) {
|
|
|
79
79
|
};
|
|
80
80
|
case "coverage-drop":
|
|
81
81
|
return {
|
|
82
|
-
text: "Open the agent's
|
|
82
|
+
text: "Open the agent's tasks on Work and look at what Passport couldn't tell.",
|
|
83
83
|
link: agent,
|
|
84
84
|
docs: `${DOCS_BASE}/member/cli-hook#decided-placed-and-blind`
|
|
85
85
|
};
|
|
@@ -87,7 +87,7 @@ export function problemFix(kind, client) {
|
|
|
87
87
|
return {
|
|
88
88
|
text: "Move it back into Passport.",
|
|
89
89
|
command: "passport keys move",
|
|
90
|
-
link: "#
|
|
90
|
+
link: "#apps",
|
|
91
91
|
docs: `${DOCS_BASE}/member/cli-hook#keys-in-passport`
|
|
92
92
|
};
|
|
93
93
|
}
|
package/dist/cliHookDecide.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ export type ServerDecision = {
|
|
|
51
51
|
/** A pending approval: when it expires, and who decides. */
|
|
52
52
|
expiresAt?: number;
|
|
53
53
|
waitingFor?: string;
|
|
54
|
+
/** An attended ask's reason line, ending with its short link (≤ 240). */
|
|
55
|
+
askLine?: string;
|
|
54
56
|
};
|
|
55
57
|
type ApiCall = (path: string, init: RequestInit) => Promise<Response>;
|
|
56
58
|
/** Validate what the server said. Anything unexpected is no answer at all. */
|
|
@@ -61,7 +63,10 @@ export declare function decideRequest(decision: GuardDecision, context: {
|
|
|
61
63
|
toolUseId?: string;
|
|
62
64
|
folder?: string;
|
|
63
65
|
project?: string;
|
|
64
|
-
}, command: string, local?: boolean
|
|
66
|
+
}, command: string, local?: boolean,
|
|
67
|
+
/** Someone is at the keyboard: the agent's own prompt answers, and Passport
|
|
68
|
+
* only supplies its reason line (cli-policy `asks`). */
|
|
69
|
+
interactive?: boolean): CliDecideRequest & {
|
|
65
70
|
project?: string;
|
|
66
71
|
};
|
|
67
72
|
/** Ask the server, or null when it couldn't answer in time. Never throws. */
|
package/dist/cliHookDecide.js
CHANGED
|
@@ -60,6 +60,7 @@ export function parseServerDecision(raw) {
|
|
|
60
60
|
const explanation = line(body.explanation, 240);
|
|
61
61
|
const message = line(body.message, 400);
|
|
62
62
|
const waitingFor = line(body.waitingFor, 80);
|
|
63
|
+
const askLine = line(body.askLine, 240);
|
|
63
64
|
const expiresAt = typeof body.expiresAt === "number" && Number.isSafeInteger(body.expiresAt) && body.expiresAt > 0
|
|
64
65
|
? body.expiresAt
|
|
65
66
|
: undefined;
|
|
@@ -74,7 +75,8 @@ export function parseServerDecision(raw) {
|
|
|
74
75
|
...(approvalId ? { approvalId } : {}),
|
|
75
76
|
...(message ? { message } : {}),
|
|
76
77
|
...(expiresAt !== undefined ? { expiresAt } : {}),
|
|
77
|
-
...(waitingFor ? { waitingFor } : {})
|
|
78
|
+
...(waitingFor ? { waitingFor } : {}),
|
|
79
|
+
...(askLine ? { askLine } : {})
|
|
78
80
|
};
|
|
79
81
|
}
|
|
80
82
|
const VERB_TOKEN = /^-{0,2}[A-Za-z0-9][A-Za-z0-9._:+-]{0,39}$/;
|
|
@@ -86,7 +88,10 @@ function safeVerbOf(raw) {
|
|
|
86
88
|
.slice(0, 4);
|
|
87
89
|
return tokens.join(" ").slice(0, 80).trim() || UNRECOGNIZED_VERB;
|
|
88
90
|
}
|
|
89
|
-
export function decideRequest(decision, context, command, local = false
|
|
91
|
+
export function decideRequest(decision, context, command, local = false,
|
|
92
|
+
/** Someone is at the keyboard: the agent's own prompt answers, and Passport
|
|
93
|
+
* only supplies its reason line (cli-policy `asks`). */
|
|
94
|
+
interactive = false) {
|
|
90
95
|
const findings = (decision.decided ?? [])
|
|
91
96
|
.filter((entry) => entry.finding.vendor)
|
|
92
97
|
// Everyday commands go only to a server that places them.
|
|
@@ -110,7 +115,7 @@ export function decideRequest(decision, context, command, local = false) {
|
|
|
110
115
|
...(context.folder ? { folder: context.folder } : {}),
|
|
111
116
|
// The repository's name, for code that reaches its default branch.
|
|
112
117
|
...(context.project ? { project: context.project } : {}),
|
|
113
|
-
interactive
|
|
118
|
+
interactive,
|
|
114
119
|
findings,
|
|
115
120
|
...(summary ? { commandSummary: summary } : {}),
|
|
116
121
|
...(key ? { commandKey: key } : {})
|
|
@@ -286,7 +291,7 @@ async function decidePlan(decision, policy, context) {
|
|
|
286
291
|
// Codex can't ask from a hook: like an unattended run, the ask goes to
|
|
287
292
|
// Passport as an approval request instead of a prompt nobody would see.
|
|
288
293
|
if (staysLocal(context, secondPerson || irreversible))
|
|
289
|
-
return local;
|
|
294
|
+
return attendedPlan(decision, policy, context, local);
|
|
290
295
|
if (!context.canAsk)
|
|
291
296
|
return local;
|
|
292
297
|
const request = decideRequest(decision, {
|
|
@@ -323,6 +328,41 @@ async function decidePlan(decision, policy, context) {
|
|
|
323
328
|
? heldPlan(decision, server, request, api, context)
|
|
324
329
|
: { output: serverOutput(context.client, decision, server), server, offline: false };
|
|
325
330
|
}
|
|
331
|
+
/**
|
|
332
|
+
* An attended ask the agent's own prompt answers. Passport, when it answers in
|
|
333
|
+
* time, supplies the reason line (the ask, ending with its short link to every
|
|
334
|
+
* other choice) and anything it knows better: an answer already given there
|
|
335
|
+
* ("It’s Staging, always run", Run for this task) runs, a stop refuses. Out
|
|
336
|
+
* of time, or no answer: the local prompt, unchanged.
|
|
337
|
+
*/
|
|
338
|
+
async function attendedPlan(decision, policy, context, local) {
|
|
339
|
+
// Only a server that sends ask lines (cli-policy `asks`) is asked, and only signed in.
|
|
340
|
+
if (policy.version !== 2 || !policy.autopilot.askLines || !context.canAsk)
|
|
341
|
+
return local;
|
|
342
|
+
const request = decideRequest(decision, {
|
|
343
|
+
runtime: context.report?.runtime ?? "other",
|
|
344
|
+
...(context.report?.sessionId ? { sessionId: context.report.sessionId } : {}),
|
|
345
|
+
...(context.report?.toolUseId ? { toolUseId: context.report.toolUseId } : {}),
|
|
346
|
+
...(context.report?.cwdName ? { folder: context.report.cwdName } : {}),
|
|
347
|
+
...(context.report?.project && policy.autopilot.repos ? { project: context.report.project } : {})
|
|
348
|
+
}, context.command, context.local === true, true);
|
|
349
|
+
if (!request.findings.length)
|
|
350
|
+
return local;
|
|
351
|
+
const api = await context.openApi();
|
|
352
|
+
const left = context.deadline - context.now();
|
|
353
|
+
const server = api && left > 50
|
|
354
|
+
? await decideOnServer(api, request, AbortSignal.any([context.budget, AbortSignal.timeout(left)]))
|
|
355
|
+
: null;
|
|
356
|
+
if (!server || server.decision === "none")
|
|
357
|
+
return local;
|
|
358
|
+
if (server.decision === "ask" && !server.approvalId) {
|
|
359
|
+
const output = guardOutput(context.client, decision, server.askLine ? { askReason: server.askLine } : {});
|
|
360
|
+
return { output, server, offline: false, ...(api ? { api } : {}) };
|
|
361
|
+
}
|
|
362
|
+
return api
|
|
363
|
+
? heldPlan(decision, server, request, api, context)
|
|
364
|
+
: { output: serverOutput(context.client, decision, server), server, offline: false };
|
|
365
|
+
}
|
|
326
366
|
/**
|
|
327
367
|
* The server's answer as a plan. A request a person can answer: hold for them (Claude Code and Cursor run
|
|
328
368
|
* the original command when they approve in time); otherwise, or when the
|
package/dist/cliHookGuard.d.ts
CHANGED
|
@@ -133,6 +133,9 @@ export declare const CODEX_ASK_NOTE = "Codex can't ask from a hook, so Passport
|
|
|
133
133
|
export type GuardOutputOptions = {
|
|
134
134
|
/** Replaces the reason entirely: an approval request is waiting. */
|
|
135
135
|
waiting?: string;
|
|
136
|
+
/** An ask's reason line from Passport (its short link to every other
|
|
137
|
+
* choice at the end), in place of the local one. */
|
|
138
|
+
askReason?: string;
|
|
136
139
|
/** One line added to the reason, e.g. OFFLINE_NOTE. */
|
|
137
140
|
note?: string;
|
|
138
141
|
/** Who to ask, for a block. */
|
package/dist/cliHookGuard.js
CHANGED
|
@@ -469,7 +469,7 @@ export function guardOutput(client, decision, options = {}) {
|
|
|
469
469
|
return { permission: "allow" };
|
|
470
470
|
return verdict === "deny"
|
|
471
471
|
? { permission: "deny", user_message: deny, agent_message: agentDeny }
|
|
472
|
-
: { permission: "ask", user_message: withNote(askMessage(decision), options.note) };
|
|
472
|
+
: { permission: "ask", user_message: withNote(options.askReason ?? askMessage(decision), options.note) };
|
|
473
473
|
}
|
|
474
474
|
if (client === "codex") {
|
|
475
475
|
if (verdict === "ask") {
|
|
@@ -518,7 +518,7 @@ export function guardOutput(client, decision, options = {}) {
|
|
|
518
518
|
hookSpecificOutput: {
|
|
519
519
|
hookEventName: "PreToolUse",
|
|
520
520
|
permissionDecision: "ask",
|
|
521
|
-
permissionDecisionReason: withNote(askMessage(decision), options.note)
|
|
521
|
+
permissionDecisionReason: withNote(options.askReason ?? askMessage(decision), options.note)
|
|
522
522
|
}
|
|
523
523
|
};
|
|
524
524
|
}
|
package/dist/cliMain.js
CHANGED
|
@@ -471,7 +471,7 @@ async function hook(args, runtime) {
|
|
|
471
471
|
/** Commands that load their own module and need nothing else from here. */
|
|
472
472
|
const LAZY_COMMANDS = {
|
|
473
473
|
wait: async () => (await import("./cliWait.js")).wait,
|
|
474
|
-
|
|
474
|
+
tasks: async () => (await import("./cliSessions.js")).sessions,
|
|
475
475
|
changes: async () => (await import("./cliChanges.js")).changes,
|
|
476
476
|
request: async () => (await import("./cliRequest.js")).request,
|
|
477
477
|
sync: async () => (await import("./cliSync.js")).sync,
|
package/dist/cliOutput.js
CHANGED
|
@@ -54,10 +54,10 @@ const EXAMPLES = {
|
|
|
54
54
|
["passport env", "Where commands in this folder land"],
|
|
55
55
|
["passport env set railway api production", "Place a resource for the workspace"]
|
|
56
56
|
],
|
|
57
|
-
|
|
58
|
-
["passport
|
|
59
|
-
["passport
|
|
60
|
-
["passport
|
|
57
|
+
tasks: [
|
|
58
|
+
["passport tasks", "Work that needs a look, by project"],
|
|
59
|
+
["passport tasks --production-changes", "What changed Production this week"],
|
|
60
|
+
["passport tasks --project api --since 24h --all", "Every work item in one project today"]
|
|
61
61
|
],
|
|
62
62
|
request: [
|
|
63
63
|
[
|
|
@@ -144,14 +144,14 @@ function helpText(verb) {
|
|
|
144
144
|
status: "passport status\nShows you, your workspace, and this computer; each agent's guard and its fix; Autopilot presets, team floors, and how old this computer's copy of your rules is; apps; keys Passport holds and when each was last used; this folder's environments; and the CLI version.\nJSON: {workspace,member,endpoint,auth,profile?,client,mcps:[{app,name,status,toolCount}],autopilot?:{presets,floors,cache},computer,keys?,folder,cli}",
|
|
145
145
|
wait: "passport wait <approval-id> [--timeout <sec>]\nWaits for a person to decide an approval request, until they do or it expires. Agents run it as a background command. While it is still waiting, prints the approval link; on a terminal, one live line counts down. Ctrl-C stops waiting and the request stays open (exit 4).\n Approved: prints who approved it and for how long; run the command again. Exit 0.\n Declined: prints the person's note for the agent. Exit 5.\n Expired: run the command again to ask again. Exit 5.\n Still waiting at --timeout: exit 4; run it again.",
|
|
146
146
|
rules: 'passport rules test "<command>" [--environment production|staging|development]\nShows what Autopilot decides for a command, why, and which environment it acts on. The command is read on this computer; only its app and verb are sent to Passport.',
|
|
147
|
-
actions: "passport actions\npassport actions add <script> [args…] --environment production|staging|development --class read|change|delete|irreversible [--args <glob>]\npassport actions add --id <op_…> --environment <kind> --class <class>\npassport actions sync\nTells Passport what a project script does, so the guard checks it: its environment and action class. Your presets and exceptions still decide what runs; a project script never runs on its say-so alone. <script> is a file in the project, or make, npm, pnpm, or yarn with the target or script name. --args is a glob over its arguments (* is any). --id is the id a Session row shows under \"Tell Passport what this does\"; this computer resolves it, since the script's name never left it. sync proposes each entry of the project's .passport/actions.toml. You can say Production for a change, delete, or irreversible action; anything else waits for an admin in
|
|
147
|
+
actions: "passport actions\npassport actions add <script> [args…] --environment production|staging|development --class read|change|delete|irreversible [--args <glob>]\npassport actions add --id <op_…> --environment <kind> --class <class>\npassport actions sync\nTells Passport what a project script does, so the guard checks it: its environment and action class. Your presets and exceptions still decide what runs; a project script never runs on its say-so alone. <script> is a file in the project, or make, npm, pnpm, or yarn with the target or script name. --args is a glob over its arguments (* is any). --id is the id a Session row shows under \"Tell Passport what this does\"; this computer resolves it, since the script's name never left it. sync proposes each entry of the project's .passport/actions.toml. You can say Production for a change, delete, or irreversible action; anything else waits for an admin in the app's Project scripts in Passport. Sends the script's path in the repository, the repository's fingerprint, name, and host, and a SHA-256 of what it runs, never its contents.\nJSON: {action} | {actions:[…]}",
|
|
148
148
|
// copy-style-allow double-space: help columns line up
|
|
149
149
|
sync: "passport sync [--remove]\nAdds what your Autopilot rules run without asking (reads, and changes inside the project: tests, builds, formatters, git add, git commit) to each agent's own allowlist, so those prompts stop even offline and in Codex. Claude Code: permissions.allow in ~/.claude/settings.json. Codex: ~/.codex/rules/passport.rules. Cursor CLI: permissions.allow in ~/.cursor/cli-config.json; Cursor: terminalAllowlist in ~/.cursor/permissions.json when you keep one there. Deletes, installs, and Production never sync. Your own entries are never changed. Runs again on its own when your rules change.\n --remove take Passport's entries out and stop syncing\nJSON: {action,agents:[{agent,name,path,added,removed,skipped?}]}",
|
|
150
150
|
// copy-style-allow double-space: help columns line up
|
|
151
151
|
env: "passport env [--json]\npassport env set <vendor> <resource> <production|staging|development>\nShows where commands in this folder land, read the way each vendor's own CLI reads it: Railway, Vercel, Supabase, Wrangler, Netlify, Firebase, Convex, Neon, Fly, Heroku, kubectl, AWS, gcloud, Terraform, Stripe, and database URLs. One row per app: the resource, how Passport knows (linked, a flag, the vendor's default), and its environment. Anything Passport can't place counts as Production. Read on this computer; nothing is sent.\n set place a resource for the whole workspace. Admins choose any environment; everyone else can only say Production.\nJSON: {environments:[{vendor,resource,how,kind,assumed,note?}]}",
|
|
152
|
-
|
|
152
|
+
tasks:
|
|
153
153
|
// copy-style-allow double-space: help columns line up
|
|
154
|
-
"passport
|
|
154
|
+
"passport tasks [--all] [--running] [--production-changes] [--project <name>] [--pr <number>] [--since <when>] [--status running|ended]\npassport tasks <task-id>\nYour agents' tasks, as Work shows them: work items (a pull request or branch, every task on it rolled up) by project, each with its agents and what happened: actions, active time, failures, confirmed Production changes, unplaced changes, asks and how they ended, and how much Passport couldn't check. Notable work comes first; routine work folds into one line per project.\n --all every work item, routine ones too (pass one of --all, --running, --production-changes)\n --running work items with a running task\n --production-changes changes to confirmed Production, by app and target (7 days unless --since)\n --project <name> one project (repository, else folder)\n --pr <number> one pull request\n --since <when> today, 24h, 7d, 30d, 90d, or a date (YYYY-MM-DD)\n --status <status> running or ended tasks only\n <task-id> one task: its outcome and recent actions with what they acted on\nAlso runs as passport sessions.\nJSON: {view,groups:[{key,kind,label,apps,running,production,unplaced,items:[{key,title,project,branch,pull,agents,sessions,sessionIds,startedAt,lastActivityAt,activeMs,running,waiting,shape,reasons,severity,link}],routine}],totals,work,window,complete,nextCursor}; --production-changes: {view,sinceTs,untilTs,total,unplaced,window,apps:[{appKey,appName,count,lastTs,targets}]}; <task-id>: {view,session,outcome,approvals,timeline,nextCursor}",
|
|
155
155
|
changes:
|
|
156
156
|
// copy-style-allow double-space: help columns line up
|
|
157
157
|
"passport changes [--env production] [--since <when>] [--until <date>] [--project <name>] [--pr <number>] [--app <key>] [--agent <id>]\nWhat your agents changed in Production, the list Sessions › Production changes shows: every change, delete, and irreversible action that ran on confirmed Production in the window, grouped by app, newest first. Each row has its time and command, then the agent, the person, the pull request (else branch), Failed or Approved, and whether Passport can undo it. Blocked and declined actions never reached Production and aren't listed; changes to targets nobody placed are one count.\n --env <env> production (the only one for now)\n --since <when> 1h, 6h, 24h, 7d (default), 30d, today, or a date (YYYY-MM-DD)\n --until <date> through the end of a date (YYYY-MM-DD)\n --project <name> one project (repository, else folder)\n --pr <number> one pull request\n --app <key> one app, or several separated by commas\n --agent <id> one agent (claude-code, codex, cursor)\nJSON: {view,environment,sinceTs,untilTs,total,unplaced,complete,window,apps:[{vendor,appName,changes:[{id,ts,person,agent,agentName,appKey,vendor,appName,command,target,actionClass,result,approved,sessionId,project,branch,pull,undo}]}]}",
|
|
@@ -220,7 +220,7 @@ Commands:
|
|
|
220
220
|
rules Test what Autopilot decides for a command
|
|
221
221
|
actions Tell Passport what a project script does
|
|
222
222
|
env Show where commands in this folder land
|
|
223
|
-
|
|
223
|
+
tasks Your agents' tasks: what needs a look, and Production changes
|
|
224
224
|
changes What your agents changed in Production, one row each
|
|
225
225
|
sync Keep your agents' own allowlists in line with your rules
|
|
226
226
|
exec Run a vendor CLI with a key Passport holds
|
package/dist/cliPolicyV2.js
CHANGED
|
@@ -464,6 +464,7 @@ export function serializeCliPolicyV2(policy) {
|
|
|
464
464
|
...(autopilot.reportsSpeed ? { speed: true } : {}),
|
|
465
465
|
...(autopilot.reportsUsage ? { usage: true } : {}),
|
|
466
466
|
...(autopilot.reportsSteps ? { descriptions: true } : {}),
|
|
467
|
+
...(autopilot.askLines ? { asks: true } : {}),
|
|
467
468
|
...(autopilot.repos ? { repos: autopilot.repos } : {}),
|
|
468
469
|
...(autopilot.project
|
|
469
470
|
? {
|
|
@@ -481,7 +482,8 @@ function keptReports(body) {
|
|
|
481
482
|
return {
|
|
482
483
|
...(body.speed === true ? { reportsSpeed: true } : {}),
|
|
483
484
|
...(body.usage === true ? { reportsUsage: true } : {}),
|
|
484
|
-
...(body.descriptions === true ? { reportsSteps: true } : {})
|
|
485
|
+
...(body.descriptions === true ? { reportsSteps: true } : {}),
|
|
486
|
+
...(body.asks === true ? { askLines: true } : {})
|
|
485
487
|
};
|
|
486
488
|
}
|
|
487
489
|
export function parseCliPolicyV2(value) {
|
|
@@ -106,7 +106,7 @@ export function renderProject(project, term) {
|
|
|
106
106
|
blocks.push([
|
|
107
107
|
project.project,
|
|
108
108
|
...joinParts([
|
|
109
|
-
countOf(project.totals.sessions, "
|
|
109
|
+
countOf(project.totals.sessions, "task"),
|
|
110
110
|
...(project.totals.running ? [`${project.totals.running.toLocaleString("en-US")} running`] : []),
|
|
111
111
|
...(project.window ? [project.window.label] : [])
|
|
112
112
|
], term.width)
|
package/dist/cliSessions.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `passport sessions
|
|
3
|
-
*
|
|
2
|
+
* `passport tasks` (also `passport sessions`): your agents' tasks the way
|
|
3
|
+
* Work shows them (shared/workItemContract.ts).
|
|
4
4
|
*
|
|
5
|
-
* passport
|
|
6
|
-
*
|
|
7
|
-
* passport
|
|
8
|
-
* passport
|
|
9
|
-
* passport
|
|
10
|
-
* passport
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* passport
|
|
5
|
+
* passport tasks Notable work items by project; routine
|
|
6
|
+
* ones fold into one line per project
|
|
7
|
+
* passport tasks --all every work item
|
|
8
|
+
* passport tasks --running work items with a running task
|
|
9
|
+
* passport tasks --production-changes the Production changes ledger
|
|
10
|
+
* passport tasks --project <name> the project's summary first: where its
|
|
11
|
+
* targets are placed, its rules, and
|
|
12
|
+
* its Production changes this week
|
|
13
|
+
* passport tasks <id> one task: its outcome and recent timeline
|
|
14
14
|
*
|
|
15
15
|
* `--project`, `--pr`, `--since`, and `--status` narrow on the server
|
|
16
16
|
* (`GET /api/my/work-items`, `/api/my/production-ledger`), never on a loaded
|
package/dist/cliSessions.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `passport sessions
|
|
3
|
-
*
|
|
2
|
+
* `passport tasks` (also `passport sessions`): your agents' tasks the way
|
|
3
|
+
* Work shows them (shared/workItemContract.ts).
|
|
4
4
|
*
|
|
5
|
-
* passport
|
|
6
|
-
*
|
|
7
|
-
* passport
|
|
8
|
-
* passport
|
|
9
|
-
* passport
|
|
10
|
-
* passport
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* passport
|
|
5
|
+
* passport tasks Notable work items by project; routine
|
|
6
|
+
* ones fold into one line per project
|
|
7
|
+
* passport tasks --all every work item
|
|
8
|
+
* passport tasks --running work items with a running task
|
|
9
|
+
* passport tasks --production-changes the Production changes ledger
|
|
10
|
+
* passport tasks --project <name> the project's summary first: where its
|
|
11
|
+
* targets are placed, its rules, and
|
|
12
|
+
* its Production changes this week
|
|
13
|
+
* passport tasks <id> one task: its outcome and recent timeline
|
|
14
14
|
*
|
|
15
15
|
* `--project`, `--pr`, `--since`, and `--status` narrow on the server
|
|
16
16
|
* (`GET /api/my/work-items`, `/api/my/production-ledger`), never on a loaded
|
|
@@ -22,7 +22,7 @@ import { bool, value } from "./cliArgs.js";
|
|
|
22
22
|
import { api, json } from "./cliAutopilot.js";
|
|
23
23
|
import { failure, timeoutMs } from "./cliSupport.js";
|
|
24
24
|
import { termOf } from "./term.js";
|
|
25
|
-
import { hashLink } from "./webLinks.js";
|
|
25
|
+
import { APPS_LINK, hashLink, workLink } from "./webLinks.js";
|
|
26
26
|
import { count, ID, ledgerOf, list, mergeGroups, record, sessionOf, text, windowOf, workCountsOf, workGroupOf } from "./cliSessionsJson.js";
|
|
27
27
|
import { renderLedger, renderSession, renderWork } from "./cliSessionsRender.js";
|
|
28
28
|
import { projectOf, renderProject } from "./cliProjectSummary.js";
|
|
@@ -106,7 +106,7 @@ async function projectSummary(client, name, args, runtime, range = {}) {
|
|
|
106
106
|
// The page counts over the same window as the work list (--since).
|
|
107
107
|
const window = query({ since: range.since });
|
|
108
108
|
const raw = await read(client, `/api/my/projects/${encodeURIComponent(name)}${window}`, args, runtime, "No project.");
|
|
109
|
-
return projectOf(raw,
|
|
109
|
+
return projectOf(raw, workLink(client.origin, "history", { project: name, since: range.since }));
|
|
110
110
|
}
|
|
111
111
|
catch {
|
|
112
112
|
return null;
|
|
@@ -120,9 +120,9 @@ export async function sessions(args, runtime, deps = {}) {
|
|
|
120
120
|
return failure("Pass one of --all, --running, or --production-changes.", 6, "usage");
|
|
121
121
|
if (id !== undefined &&
|
|
122
122
|
(views.length || ["project", "pr", "since", "status"].some((flag) => value(args, flag) !== undefined)))
|
|
123
|
-
return failure("A
|
|
123
|
+
return failure("A task id takes no filters. Run: passport tasks <id>", 6, "usage");
|
|
124
124
|
if (id !== undefined && !ID.test(id))
|
|
125
|
-
return failure("That isn't a
|
|
125
|
+
return failure("That isn't a task id.", 6, "usage");
|
|
126
126
|
const filters = id === undefined ? filtersOf(args, now) : {};
|
|
127
127
|
if (views[0] === "production-changes" && filters.status)
|
|
128
128
|
return failure("--status lists work items; Production changes take --project, --pr, and --since.", 6, "usage");
|
|
@@ -134,7 +134,7 @@ export async function sessions(args, runtime, deps = {}) {
|
|
|
134
134
|
}
|
|
135
135
|
if (views[0] === "production-changes") {
|
|
136
136
|
const ledger = ledgerOf(await read(client, `/api/my/production-ledger${query(filters)}`, args, runtime, "This Passport server doesn't have the Production changes ledger yet."));
|
|
137
|
-
const link = hashLink(client.origin,
|
|
137
|
+
const link = hashLink(client.origin, APPS_LINK);
|
|
138
138
|
return { json: ledger, human: renderLedger(ledger, term, now, value(args, "since"), link) };
|
|
139
139
|
}
|
|
140
140
|
const view = views[0] === "all" ? "all" : views[0] === "running" ? "running" : "notable";
|
|
@@ -172,13 +172,9 @@ export async function sessions(args, runtime, deps = {}) {
|
|
|
172
172
|
const project = view === "notable" && filters.project && !filters.pr && !filters.status
|
|
173
173
|
? await projectSummary(client, filters.project, args, runtime, { since: filters.since })
|
|
174
174
|
: null;
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
pr: filters.pr,
|
|
179
|
-
since: value(args, "since")
|
|
180
|
-
});
|
|
181
|
-
const more = cursor ? hashLink(client.origin, `#sessions${webQuery}`) : null;
|
|
175
|
+
const more = cursor
|
|
176
|
+
? workLink(client.origin, "history", { project: filters.project, since: value(args, "since") })
|
|
177
|
+
: null;
|
|
182
178
|
const filtered = Object.keys(filters).length > 0;
|
|
183
179
|
const work = renderWork(result, term, filtered, more);
|
|
184
180
|
return project
|
package/dist/cliSessionsJson.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* out; a missing count reads 0.
|
|
6
6
|
*/
|
|
7
7
|
import { isEnvKind } from "./cliHookEnvironment.js";
|
|
8
|
-
import {
|
|
8
|
+
import { taskLink, workLink } from "./webLinks.js";
|
|
9
9
|
export function text(raw, max = 200) {
|
|
10
10
|
if (typeof raw !== "string")
|
|
11
11
|
return undefined;
|
|
@@ -157,11 +157,6 @@ function itemTitle(key, branch, pull, agents) {
|
|
|
157
157
|
return clientName(agents[0]?.client ?? "agent");
|
|
158
158
|
return "No branch";
|
|
159
159
|
}
|
|
160
|
-
/** A work item's own page in Passport: its project's branch, or the
|
|
161
|
-
* project's work with no branch. */
|
|
162
|
-
function itemHash(project, branch) {
|
|
163
|
-
return `#projects/${encodeURIComponent(project)}/work${branch ? `?branch=${encodeURIComponent(branch)}` : ""}`;
|
|
164
|
-
}
|
|
165
160
|
export function workItemOf(raw, origin) {
|
|
166
161
|
const item = record(raw);
|
|
167
162
|
const key = text(item.key, 300) ?? "none";
|
|
@@ -194,7 +189,7 @@ export function workItemOf(raw, origin) {
|
|
|
194
189
|
shape: shapeOf(item.shape),
|
|
195
190
|
reasons,
|
|
196
191
|
severity: oneOf(item.severity, ["failed", "asked", "production"]),
|
|
197
|
-
link: one ?
|
|
192
|
+
link: one ? taskLink(origin, sessionIds[0]) : project ? workLink(origin, "history", { project }) : null
|
|
198
193
|
};
|
|
199
194
|
}
|
|
200
195
|
export function workGroupOf(raw, origin) {
|
|
@@ -336,7 +331,7 @@ export function sessionOf(raw, origin) {
|
|
|
336
331
|
unchecked: count(session.unchecked),
|
|
337
332
|
waiting: count(session.waiting),
|
|
338
333
|
asks: session.asks === undefined ? null : asksOf(session.asks),
|
|
339
|
-
link:
|
|
334
|
+
link: taskLink(origin, id)
|
|
340
335
|
},
|
|
341
336
|
outcome: outcome
|
|
342
337
|
? {
|
|
@@ -156,7 +156,7 @@ export function renderWork(page, term, filtered, more) {
|
|
|
156
156
|
return "Nothing is running.";
|
|
157
157
|
if (page.view === "notable" && page.totals.items)
|
|
158
158
|
return "Nothing needs a look.";
|
|
159
|
-
return "No
|
|
159
|
+
return "No tasks yet. Start your agent and its actions will show up here.";
|
|
160
160
|
}
|
|
161
161
|
const sections = page.groups.map((group) => {
|
|
162
162
|
const lines = joinParts(groupHeading(group), term.width);
|
|
@@ -171,9 +171,9 @@ export function renderWork(page, term, filtered, more) {
|
|
|
171
171
|
});
|
|
172
172
|
const notes = [];
|
|
173
173
|
if (page.view === "notable" && page.groups.some((group) => group.routine?.count))
|
|
174
|
-
notes.push("Routine work is folded.\nRun: passport
|
|
174
|
+
notes.push("Routine work is folded.\nRun: passport tasks --all");
|
|
175
175
|
if (!page.complete)
|
|
176
|
-
notes.push("Only the latest
|
|
176
|
+
notes.push("Only the latest tasks were read. Narrow it with --since or --project.");
|
|
177
177
|
if (more)
|
|
178
178
|
notes.push(`More work in Passport: ${more}`);
|
|
179
179
|
// The server's window after its counts ("Last 7 days"); an older server sent none.
|
package/dist/cliWait.js
CHANGED
|
@@ -29,7 +29,7 @@ function approvedLine(lead, scope) {
|
|
|
29
29
|
if (!/^Approved\b.*\.$/.test(lead))
|
|
30
30
|
return lead;
|
|
31
31
|
if (scope === "session") {
|
|
32
|
-
return lead.replace(/\.$/, " for this
|
|
32
|
+
return lead.replace(/\.$/, " for this task. Matching commands in this task run without asking.");
|
|
33
33
|
}
|
|
34
34
|
if (scope === "rule")
|
|
35
35
|
return lead.replace(/\.$/, " and saved as a rule.");
|
package/dist/completion.js
CHANGED
|
@@ -21,7 +21,7 @@ const DESCRIPTIONS = {
|
|
|
21
21
|
wait: "Wait for a person to decide an approval request",
|
|
22
22
|
rules: "Test what Autopilot decides for a command",
|
|
23
23
|
actions: "Tell Passport what a project script does",
|
|
24
|
-
|
|
24
|
+
tasks: "Your agents' tasks: what needs a look, and Production changes",
|
|
25
25
|
changes: "What your agents changed in Production, one row each",
|
|
26
26
|
env: "Show where commands in this folder land",
|
|
27
27
|
sync: "Keep your agents' own allowlists in line with your rules",
|
|
@@ -65,7 +65,7 @@ const COMMAND_FLAGS = {
|
|
|
65
65
|
setup: ["--agent", "--apply"],
|
|
66
66
|
hook: ["--agent", "--guard", "--apply"],
|
|
67
67
|
rules: ["--environment"],
|
|
68
|
-
|
|
68
|
+
tasks: ["--all", "--running", "--production-changes", "--project", "--pr", "--since", "--status"],
|
|
69
69
|
changes: ["--env", "--since", "--until", "--project", "--pr", "--app", "--agent"],
|
|
70
70
|
sync: ["--remove"],
|
|
71
71
|
exec: ["--wait", "--ask-again", "--verbose", "--agent", "--session", "--mask", "--no-masking"],
|
package/dist/initOutro.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* How `passport init` ends: a ✓ list of what's true now and what's left for
|
|
3
|
-
* the person, then one next
|
|
3
|
+
* the person, then one next step.
|
|
4
4
|
*
|
|
5
5
|
* Done.
|
|
6
6
|
* ✓ Passport added to Claude Code and Cursor
|
|
7
7
|
* ! Railway connects to Passport once you finish signing in
|
|
8
8
|
*
|
|
9
|
-
* Next:
|
|
9
|
+
* Next: ask your agent to do something. Its work shows up on Work:
|
|
10
|
+
* https://passportmcp.com/#work
|
|
10
11
|
*/
|
|
11
12
|
import { EXEC_TOKEN_PAGES, EXEC_VENDOR_NAMES } from "./execVendors.js";
|
|
12
13
|
import { AGENT_NAMES } from "./initAgents.js";
|
|
@@ -17,6 +18,7 @@ import { desktopLine } from "./initLocalSteps.js";
|
|
|
17
18
|
import { TRY_IT, appLabel } from "./initState.js";
|
|
18
19
|
import { listOf } from "./initUi.js";
|
|
19
20
|
import { wrap } from "./term.js";
|
|
21
|
+
import { hashLink } from "./webLinks.js";
|
|
20
22
|
const done = (text) => ({ mark: "done", text });
|
|
21
23
|
const warn = (text) => ({ mark: "warn", text });
|
|
22
24
|
/** Apps this run connected, left waiting for a sign-in, skipped, or sent to an admin. */
|
|
@@ -113,8 +115,9 @@ function agentFollowUps(s) {
|
|
|
113
115
|
}
|
|
114
116
|
return items;
|
|
115
117
|
}
|
|
116
|
-
/** The one next
|
|
117
|
-
* agent, or
|
|
118
|
+
/** The one next step: put passport on PATH, finish app sign-ins, try an
|
|
119
|
+
* agent, or watch its work on Work, the page a new person's Get started is
|
|
120
|
+
* waiting on. A command or link is never wrapped. */
|
|
118
121
|
function nextCommand(s, waiting) {
|
|
119
122
|
const stable = s.stable;
|
|
120
123
|
if (stable?.binDir && !stable.onPath) {
|
|
@@ -130,7 +133,10 @@ function nextCommand(s, waiting) {
|
|
|
130
133
|
const ask = app ? TRY_IT[app] : "list your Passport tools";
|
|
131
134
|
return wrap(`Next: in Claude Code, run /mcp to sign in, then ask it to ${ask}.`, s.terminal.width);
|
|
132
135
|
}
|
|
133
|
-
|
|
136
|
+
const work = hashLink(s.gateway?.origin, "#work");
|
|
137
|
+
if (!work)
|
|
138
|
+
return ["Run: passport status"];
|
|
139
|
+
return [...wrap("Next: ask your agent to do something. Its work shows up on Work:", s.terminal.width), work];
|
|
134
140
|
}
|
|
135
141
|
/** What to do next about PATH: the step, then the command on its own line. */
|
|
136
142
|
export function pathNext(line, width) {
|
package/dist/pluginPin.d.ts
CHANGED
package/dist/pluginPin.js
CHANGED
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.30.0";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Keep in lockstep with bridge/package.json.
|
|
2
|
-
export const VERSION = "0.
|
|
2
|
+
export const VERSION = "0.30.0";
|
package/dist/webLinks.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
/** `https://passportmcp.com` from an endpoint or origin, or null. */
|
|
2
2
|
export declare function webOrigin(endpointOrOrigin: string | undefined): string | null;
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function taskLink(origin: string | undefined, sessionId: string | undefined): string | null;
|
|
4
|
+
/** Work's History (`view: "history"`) or Actions (`view: "actions"`), with the
|
|
5
|
+
* filters the web reads; empty values are left out. */
|
|
6
|
+
export declare function workLink(origin: string | undefined, view: "history" | "actions", filters?: Partial<Record<"project" | "since" | "env", string | undefined>>): string | null;
|
|
4
7
|
export declare function approvalLink(origin: string | undefined, approvalId: string | undefined, workspaceId?: string): string | null;
|
|
5
8
|
/** A page the server named by its hash (`#apps/railway/access`), or null. */
|
|
6
9
|
export declare function hashLink(origin: string | undefined, hash: unknown): string | null;
|
|
7
10
|
export declare function ruleLink(origin: string | undefined, ruleId?: string): string | null;
|
|
11
|
+
/** Apps: each app's page holds its environments, keys, and project scripts
|
|
12
|
+
* (shared/appPageLinks.ts APPS_LINK; the CLI can't import shared/). */
|
|
13
|
+
export declare const APPS_LINK = "#apps";
|
package/dist/webLinks.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Links into the Passport web app for things the CLI names: a
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Links into the Passport web app for things the CLI names: a task, an ask, a
|
|
3
|
+
* rule. The web app is served from the same origin as the profile's endpoint,
|
|
4
|
+
* and routes by hash:
|
|
5
5
|
*
|
|
6
|
-
* #
|
|
7
|
-
* #
|
|
6
|
+
* #work/<sessionId> one task
|
|
7
|
+
* #work?focus=<approvalId> one ask, opened on Work
|
|
8
|
+
* #work?view=history&project=<name> a list of tasks (workLink)
|
|
8
9
|
* #rules?rule=<ruleId>
|
|
9
10
|
*
|
|
10
11
|
* Each returns null when the origin or id is unusable, so callers print a link
|
|
@@ -26,18 +27,30 @@ export function webOrigin(endpointOrOrigin) {
|
|
|
26
27
|
function usable(id) {
|
|
27
28
|
return typeof id === "string" && ID.test(id);
|
|
28
29
|
}
|
|
29
|
-
export function
|
|
30
|
+
export function taskLink(origin, sessionId) {
|
|
30
31
|
const base = webOrigin(origin);
|
|
31
|
-
return base && usable(sessionId) ? `${base}/#
|
|
32
|
+
return base && usable(sessionId) ? `${base}/#work/${encodeURIComponent(sessionId)}` : null;
|
|
33
|
+
}
|
|
34
|
+
/** Work's History (`view: "history"`) or Actions (`view: "actions"`), with the
|
|
35
|
+
* filters the web reads; empty values are left out. */
|
|
36
|
+
export function workLink(origin, view, filters = {}) {
|
|
37
|
+
const base = webOrigin(origin);
|
|
38
|
+
if (!base)
|
|
39
|
+
return null;
|
|
40
|
+
const params = new URLSearchParams({ view });
|
|
41
|
+
for (const [key, value] of Object.entries(filters))
|
|
42
|
+
if (value)
|
|
43
|
+
params.set(key, value);
|
|
44
|
+
return `${base}/#work?${params.toString()}`;
|
|
32
45
|
}
|
|
33
46
|
export function approvalLink(origin, approvalId, workspaceId) {
|
|
34
47
|
const base = webOrigin(origin);
|
|
35
48
|
if (!base || !usable(approvalId))
|
|
36
49
|
return null;
|
|
37
|
-
const params = new URLSearchParams({
|
|
50
|
+
const params = new URLSearchParams({ focus: approvalId });
|
|
38
51
|
if (usable(workspaceId))
|
|
39
52
|
params.set("workspace", workspaceId);
|
|
40
|
-
return `${base}/#
|
|
53
|
+
return `${base}/#work?${params.toString()}`;
|
|
41
54
|
}
|
|
42
55
|
/** A page the server named by its hash (`#apps/railway/access`), or null. */
|
|
43
56
|
export function hashLink(origin, hash) {
|
|
@@ -54,3 +67,6 @@ export function ruleLink(origin, ruleId) {
|
|
|
54
67
|
return `${base}/#rules`;
|
|
55
68
|
return usable(ruleId) ? `${base}/#rules?${new URLSearchParams({ rule: ruleId }).toString()}` : null;
|
|
56
69
|
}
|
|
70
|
+
/** Apps: each app's page holds its environments, keys, and project scripts
|
|
71
|
+
* (shared/appPageLinks.ts APPS_LINK; the CLI can't import shared/). */
|
|
72
|
+
export const APPS_LINK = "#apps";
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "passport-bridge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "passport-bridge",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.30.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@modelcontextprotocol/sdk": "1.32.1"
|