toolroll 0.9.72 → 0.9.73

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 (63) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/dist/agent-fence.d.ts +5 -0
  3. package/dist/agent-fence.js +42 -7
  4. package/dist/browser/workspace.js +28 -28
  5. package/dist/chat-actions.js +13 -8
  6. package/dist/chat-decide.d.ts +47 -1
  7. package/dist/chat-decide.js +170 -4
  8. package/dist/check-report.js +2 -1
  9. package/dist/coding-provider.js +4 -2
  10. package/dist/commit-extract.d.ts +17 -0
  11. package/dist/commit-extract.js +82 -4
  12. package/dist/contracts/console-api.d.ts +3 -3
  13. package/dist/contracts/console-api.js +4 -4
  14. package/dist/contracts/release-terms.d.ts +7 -1
  15. package/dist/contracts/release-terms.js +6 -2
  16. package/dist/exec.d.ts +1 -1
  17. package/dist/exec.js +7 -3
  18. package/dist/flow-gallery-ui.js +4 -2
  19. package/dist/flow-gallery.d.ts +3 -0
  20. package/dist/flow-gallery.js +6 -2
  21. package/dist/flow-triggers.d.ts +8 -0
  22. package/dist/flow-triggers.js +15 -0
  23. package/dist/flows-cli.js +13 -3
  24. package/dist/guides.js +10 -1
  25. package/dist/kits-ui.js +4 -2
  26. package/dist/kits.d.ts +6 -4
  27. package/dist/kits.js +9 -11
  28. package/dist/mcp-connect.d.ts +10 -0
  29. package/dist/mcp-connect.js +2 -0
  30. package/dist/project-tools.js +3 -1
  31. package/dist/protected-storage.d.ts +67 -0
  32. package/dist/protected-storage.js +398 -0
  33. package/dist/release-adapters.d.ts +8 -1
  34. package/dist/release-adapters.js +80 -14
  35. package/dist/release-authority.d.ts +6 -0
  36. package/dist/release-authority.js +9 -0
  37. package/dist/release-card.d.ts +76 -0
  38. package/dist/release-card.js +252 -0
  39. package/dist/release-carry.d.ts +3 -0
  40. package/dist/release-carry.js +23 -4
  41. package/dist/release-cli.js +36 -3
  42. package/dist/release-git.d.ts +43 -0
  43. package/dist/release-git.js +106 -0
  44. package/dist/release.d.ts +8 -2
  45. package/dist/release.js +79 -6
  46. package/dist/scope.d.ts +7 -0
  47. package/dist/scope.js +22 -5
  48. package/dist/server/flows.js +40 -10
  49. package/dist/server/render-settings.js +1 -1
  50. package/dist/server/settings.js +26 -5
  51. package/dist/setup-guide.d.ts +2 -2
  52. package/dist/store.d.ts +3 -0
  53. package/dist/store.js +6 -0
  54. package/dist/subagent-memory.d.ts +1 -0
  55. package/dist/subagent-memory.js +1 -1
  56. package/dist/subagent-tools.d.ts +22 -6
  57. package/dist/subagent-tools.js +44 -8
  58. package/dist/subagent-work.d.ts +2 -0
  59. package/dist/subagent-work.js +5 -2
  60. package/dist/subagents-ui.js +6 -4
  61. package/dist/telegram.d.ts +6 -1
  62. package/dist/telegram.js +58 -6
  63. package/package.json +1 -1
@@ -36,7 +36,7 @@ import { requestUndo, undoFor } from "./subagent-week.js";
36
36
  import { kitInstalled, kitOf, KITS, setUpKitNow } from "./kits.js";
37
37
  import { starterFlowOf, starterOf, startersFor, starterTerms, STARTER_FLOWS, switchOnStarter } from "./flow-starters.js";
38
38
  import { answerSubagentQuestion } from "./subagent-work.js";
39
- import { callWords, checkRule, defaultRule, grantListed, revokeTool, ruleWords, setToolRules } from "./subagent-tools.js";
39
+ import { callWords, checkRule, defaultRule, grantListed, revokeTool, ruleLoosens, ruleWords, setToolRules } from "./subagent-tools.js";
40
40
  import { aboutYouOf, checkAboutYouLine, saveAboutYou, withAboutYouLine } from "./lead-about.js";
41
41
  import { CHAT_ACTION_FIELDS, readChatActionRequest, readSharedAction, SHARED_ACTION_VERSION } from "./contracts/chat-actions.js";
42
42
  export { CHAT_ACTION_FIELDS };
@@ -441,12 +441,10 @@ export function prepareSharedAction(store, who, operation, input, root, now = ne
441
441
  throw Error(`${project} has no tool called ${tool}.${named.length === 0 ? " Add it on the Tools page first." : ` Its tools: ${named.join(", ")}.`}${uses}`);
442
442
  if (grant !== null)
443
443
  throw Error(`${name} can already use ${tool}.`);
444
- const actions = found.lastTest?.tools ?? [];
445
- if (actions.length === 0)
444
+ if ((found.lastTest?.tools ?? []).length === 0)
446
445
  throw Error(`${tool} hasn't said what it can do yet. Test it on the Tools page first.`);
447
- state = { rules: "" };
448
- title = `Let ${name} use ${tool}`;
449
- terms.push(...actions.map(one => `${one}: ${defaultRule({ name: one, readOnly: false }).use === "free" ? "does it" : "asks you first"}`), `${name} asks for each call on its turn; Toolroll makes it by these rules, and every call is kept on the card. Change a rule any time.`);
446
+ // Giving a subagent a tool takes the person's password (chat-management.md §0a.3), which never goes in chat.
447
+ throw Error(`Giving ${name} a tool takes your password. Open ${name}'s page in Toolroll, then Tools → Let ${name} use ${tool}.`);
450
448
  }
451
449
  else if (change === "revoke") {
452
450
  if (grant === null)
@@ -463,6 +461,10 @@ export function prepareSharedAction(store, who, operation, input, root, now = ne
463
461
  const checked = checkRule(grant, action, { use: input["use"], limit, undo: input["undoWith"] ?? grant.rules[action]?.undo ?? "" });
464
462
  if (!checked.ok)
465
463
  throw Error(checked.said);
464
+ // Letting it do more on its own takes the person's password (chat-management.md §0a.3), never a card.
465
+ const info = grant.actions.find(one => one.name === action);
466
+ if (ruleLoosens(grant.rules[action] ?? defaultRule(info), checked.rule))
467
+ throw Error(`Letting ${name} do more with ${action} on its own takes your password. Change the rule on ${name}'s page in Toolroll.`);
466
468
  state = { rules: JSON.stringify(grant.rules) };
467
469
  title = `${name}: ${action} — ${ruleWords(checked.rule)}`;
468
470
  terms.push(`${tool} → ${action}: ${ruleWords(checked.rule)}.`, `Was: ${ruleWords(grant.rules[action] ?? { use: "ask" })}.`, ...(checked.rule.undo === undefined ? [] : [`A person can undo it with ${checked.rule.undo}, called with the same input.`]));
@@ -1168,7 +1170,7 @@ export function executeSharedAction(store, who, id, payload, now, options) {
1168
1170
  }
1169
1171
  else if (payload.operation === "kit_setup") {
1170
1172
  const kit = kitOf(String(req["kit"]));
1171
- const made = setUpKitNow(store, kit, repo, actor, now, null, true);
1173
+ const made = setUpKitNow(store, kit, repo, actor, now, null);
1172
1174
  if (!made.ok)
1173
1175
  throw Error(made.said);
1174
1176
  return { ok: true, taskId: null, said: `${made.said} Try it with a sample card from its page.`, href: `/kits/${kit.id}?repo=${encodeURIComponent(repo)}` };
@@ -1431,7 +1433,10 @@ function runSubagentAction(store, payload, actor, now) {
1431
1433
  if ((grant === null ? "" : JSON.stringify(grant.rules)) !== payload.state["rules"])
1432
1434
  throw Error("Someone changed its tools since. Ask for a fresh proposal.");
1433
1435
  const found = projectToolsOf(store, mate.repo).find(one => one.name === tool);
1434
- const done = req["change"] === "grant" ? found === undefined ? { ok: false, said: `There's no tool called ${tool} any more.` } : grantListed(store, mate, found, null, actor, now)
1436
+ // A grant takes the person's password on the subagent's page (chat-management.md §0a.3): never from a card.
1437
+ if (req["change"] === "grant")
1438
+ throw Error("Giving a subagent a tool takes your password. Do it on its page in Toolroll.");
1439
+ const done = req["change"] === "grant" ? found === undefined ? { ok: false, said: `There's no tool called ${tool} any more.` } : grantListed(store, mate, found, null, actor, now, {})
1435
1440
  : req["change"] === "revoke" ? revokeTool(store, mate, tool, actor, now)
1436
1441
  : setToolRules(store, mate, tool, { [String(req["action"])]: { use: req["use"], limit: req["limitField"] === undefined || req["limitField"] === null || req["limitField"] === "" ? null : { field: req["limitField"], over: req["limitOver"] },
1437
1442
  undo: req["undoWith"] ?? grant?.rules[String(req["action"])]?.undo ?? "" } }, actor, now);
@@ -2,6 +2,7 @@ import { DECIDE_ACTS } from "./contracts/chat-callback-rows.js";
2
2
  import { type ChatApprovalLimits } from "./chat-approval.js";
3
3
  import { type VerifiedApprover } from "./principal.js";
4
4
  import type { Scope } from "./scope.js";
5
+ import { type ReleaseCard } from "./release-card.js";
5
6
  import type { Store } from "./store.js";
6
7
  /** The tokens live in chat_decide_action and the open "What should change?" in chat_decide_prompt (store.ts). */
7
8
  export type DecideAct = (typeof DECIDE_ACTS)[number];
@@ -59,11 +60,17 @@ type ActSpec = {
59
60
  act: DecideAct;
60
61
  run: number | null;
61
62
  digest: string;
63
+ label?: string;
62
64
  };
63
- /** What a card offers: an optional replacement text (the plan card) and rows of acts and links. */
65
+ /** What a card offers: an optional replacement text (the plan card) and rows of acts and links; a release card also
66
+ * sends its full terms as a file with it (`file`), where the chat app can. */
64
67
  export type DecideOffer = {
65
68
  text: string | null;
66
69
  rows: Array<Array<ActSpec | DecideLink>>;
70
+ file?: {
71
+ name: string;
72
+ text: string;
73
+ };
67
74
  };
68
75
  /** What lets this person's chat on `channel` approve on this repository now: their lasting chat-approval setting
69
76
  * (chat-approval.ts), or else a live signed mode carrying the chatApprove term, signed by them, that names this chat
@@ -127,12 +134,24 @@ export declare function hasLiveDecideTokens(store: Store, channel: DecideChannel
127
134
  export declare function isDecideToken(store: Store, token: string): boolean;
128
135
  export type DecideTapOutcome = {
129
136
  ack: string;
137
+ /** A release card's full terms, sent as a file before its Approve is offered (chat apps that limit a message). */
138
+ file?: {
139
+ name: string;
140
+ text: string;
141
+ };
130
142
  /** The card repainted: its text and buttons now. */
131
143
  edit?: {
132
144
  text: string;
133
145
  rows: DecideButton[][];
134
146
  tokens: string[];
135
147
  };
148
+ /** With `file`, where the chat app carries the terms only as a file: the card instead of `edit` when the file didn't
149
+ * arrive. No Approve, a fresh Continue to send it again; the channel drops whichever set it doesn't show. */
150
+ unsent?: {
151
+ text: string;
152
+ rows: DecideButton[][];
153
+ tokens: string[];
154
+ };
136
155
  /** Ask "What should change?": the person's next message is the feedback. `id` names the prompt, so the channel can
137
156
  * record the message it sent (a reply to anything else is not the feedback). */
138
157
  prompt?: {
@@ -152,6 +171,33 @@ export type ChatMerge = {
152
171
  repo: string;
153
172
  via: string;
154
173
  };
174
+ /** Where a release card is tapped: the person's binding and the chat the tap came from. */
175
+ export type ReleaseSeat = Pick<DecideSeat, "channel" | "binding" | "chat" | "approver">;
176
+ /**
177
+ * Whether a release card's tap comes from the person's own private chat with Toolroll (chat-management.md §0a.5), from
178
+ * the binding's own record, failing closed: Telegram, a private chat (a positive id, which Telegram makes equal to the
179
+ * user's own id) that is the binding's chat and its user's; Slack, a direct-message channel (D…) that is the binding's.
180
+ * Any other chat app, a missing chat or binding, or another person's binding is not.
181
+ */
182
+ export declare function privateReleaseChat(store: Store, seat: ReleaseSeat): boolean;
183
+ /**
184
+ * A deploy gate this person may approve from this chat now, through its release card: every plain-plan rule
185
+ * (planInChat: their Approve from chat setting and limits, no coordinator-, lead- or scout-written text, organisation
186
+ * policy, protected work), never a nightly check, only in their private chat, and the card as the live records say
187
+ * it now (chat-management.md §0a.5).
188
+ */
189
+ export declare function releaseInChat(store: Store, taskId: string, approver: string, now: Date, channel: DecideChannel,
190
+ /** The seat a tap came from, checked strictly; "offer" only where the card is drawn for the binding's own chat (no act). */
191
+ seat: ReleaseSeat | "offer", root?: string): {
192
+ ok: true;
193
+ card: ReleaseCard;
194
+ modeDigest: string;
195
+ source: "setting" | "mode";
196
+ scope: Scope;
197
+ } | {
198
+ ok: false;
199
+ why: string;
200
+ };
155
201
  /** The links a card keeps once its acts are spent or stale: where to look, never a token. */
156
202
  export declare function linksFor(target: DecideTarget): DecideButton[][];
157
203
  /** Where a plan card's task is now, for a card whose buttons no longer act: the family's current version, named only
@@ -28,7 +28,8 @@ import { verifyApproverStanding } from "./principal.js";
28
28
  import { pullRequestFollowOf } from "./pull-request-flow.js";
29
29
  import { requestResultChanges } from "./result-actions.js";
30
30
  import { revisionSourceOf } from "./result-review.js";
31
- import { APPROVAL_PROOF, approvalOf, approvalProofDetail, quarantinedAuthor } from "./scope.js";
31
+ import { APPROVAL_PROOF, approvalOf, approvalProofDetail, deployGateScope, quarantinedAuthor } from "./scope.js";
32
+ import { releaseCardOf } from "./release-card.js";
32
33
  import { phoneText } from "./telegram-status.js";
33
34
  /** The words, said once. */
34
35
  export const DECIDE_LABELS = {
@@ -44,6 +45,7 @@ export const DECIDE_LABELS = {
44
45
  cancel: "Cancel",
45
46
  };
46
47
  const OFFER_TTL_MS = 7 * 86_400_000;
48
+ const CHANNEL_NAMES = { telegram: "Telegram", slack: "Slack", discord: "Discord", teams: "Teams" };
47
49
  const CONFIRM_TTL_MS = 10 * 60_000;
48
50
  const PROMPT_TTL_MS = 30 * 60_000;
49
51
  export const WHAT_SHOULD_CHANGE = "What should change?";
@@ -262,6 +264,30 @@ export function decideOffer(store, target, who, now, channel, root) {
262
264
  const plan = planInChat(store, target.taskId, who.name, now, channel, root);
263
265
  if (!plan.ok)
264
266
  return null;
267
+ const release = deployGateScope(plan.scope);
268
+ // Checks beyond the sandbox seal only on the person's password (store.ts sealScopeApproval): the card says so and
269
+ // links to the approval in Toolroll, and offers no Continue or Approve that would dead-end. A release or a plan.
270
+ if (passwordOnlySeal(plan.scope)) {
271
+ let head;
272
+ try {
273
+ head = release ? releaseCardOf(store, plan.scope, plan.digest, { profile: permissionPlainWords }).short.split("\n").slice(0, 3)
274
+ : planCardText(store, target.taskId, plan.scope, root, channel).split("\n").slice(0, 1);
275
+ }
276
+ catch {
277
+ head = [title(store, target.taskId)];
278
+ }
279
+ return { text: [...head, "", needsPassword(plan.scope)].join("\n"), rows: [[{ label: "Approve in Toolroll", path: chatControlHref("approval", target.taskId) }]] };
280
+ }
281
+ // A deploy gate is approved from chat only through its release card (chat-management.md §0a.5).
282
+ if (release) {
283
+ const release = releaseInChat(store, target.taskId, who.name, now, channel, "offer", root);
284
+ if (!release.ok)
285
+ return null;
286
+ const card = release.card;
287
+ return { text: channel === "telegram" ? card.short : `${card.short}\n\n${card.full}`,
288
+ rows: [[{ act: "approve", run: null, digest: releaseDigest(card), label: "Continue" }], [{ label: DECIDE_LABELS.edit, path: chatControlHref("approval", target.taskId) }, { act: "not-now", run: null, digest: releaseDigest(card) }]],
289
+ ...(channel === "telegram" ? { file: { name: card.fileName, text: card.full } } : {}) };
290
+ }
265
291
  return { text: planCardText(store, target.taskId, plan.scope, root, channel),
266
292
  rows: [[{ act: "approve", run: null, digest: plan.digest }], [{ label: DECIDE_LABELS.edit, path: chatControlHref("approval", target.taskId) }, { act: "not-now", run: null, digest: plan.digest }]] };
267
293
  }
@@ -320,7 +346,7 @@ export function mintDecideButtons(store, seat, target, offer, now, message = nul
320
346
  return { label: one.label, link: one };
321
347
  const token = mint(store, seat, message, one, target.taskId, "offer", now);
322
348
  tokens.push(token);
323
- return { label: DECIDE_LABELS[one.act], token };
349
+ return { label: one.label ?? DECIDE_LABELS[one.act], token };
324
350
  }));
325
351
  return { rows, tokens };
326
352
  }
@@ -350,6 +376,66 @@ export function hasLiveDecideTokens(store, channel, chat, message, now) {
350
376
  export function isDecideToken(store, token) {
351
377
  return token.startsWith("d:") && store.handle.prepare("SELECT 1 FROM chat_decide_action WHERE token = ?").get(token) !== undefined;
352
378
  }
379
+ /** A release card's acts carry its card digest (release-card.ts), never a plan's. */
380
+ const RELEASE_DIGEST = "release:";
381
+ /** Why a password-only scope (passwordOnlySeal) isn't approved from chat, for a release or a plan. */
382
+ const needsPassword = (scope) => `This ${deployGateScope(scope) ? "release" : "plan"}'s checks run outside the sandbox, so it's approved in Toolroll with your password.`;
383
+ /** Whether only a person's password ceremony seals this scope (store.ts sealScopeApproval): checks that reach beyond the
384
+ * sandbox (sign-ins, or none at all) or extra macOS services, sealed into its profile. */
385
+ const passwordOnlySeal = (scope) => {
386
+ const profile = scope.profile;
387
+ return profile != null && (profile["checkAccess"] !== undefined || profile["machLookup"] !== undefined);
388
+ };
389
+ const releaseDigest = (card) => `${RELEASE_DIGEST}${card.digest}`;
390
+ /**
391
+ * Whether a release card's tap comes from the person's own private chat with Toolroll (chat-management.md §0a.5), from
392
+ * the binding's own record, failing closed: Telegram, a private chat (a positive id, which Telegram makes equal to the
393
+ * user's own id) that is the binding's chat and its user's; Slack, a direct-message channel (D…) that is the binding's.
394
+ * Any other chat app, a missing chat or binding, or another person's binding is not.
395
+ */
396
+ export function privateReleaseChat(store, seat) {
397
+ const row = store.handle.prepare("SELECT member, channel, approver FROM chat_binding WHERE provider = ? AND id = ? AND revoked IS NULL").get(seat.channel, seat.binding);
398
+ if (row === undefined || String(row["approver"]) !== seat.approver || seat.chat !== String(row["channel"]))
399
+ return false;
400
+ if (seat.channel === "telegram")
401
+ return /^[1-9][0-9]*$/.test(seat.chat) && seat.chat === String(row["member"]);
402
+ if (seat.channel === "slack")
403
+ return /^D[A-Z0-9]+$/.test(seat.chat);
404
+ return false;
405
+ }
406
+ /**
407
+ * A deploy gate this person may approve from this chat now, through its release card: every plain-plan rule
408
+ * (planInChat: their Approve from chat setting and limits, no coordinator-, lead- or scout-written text, organisation
409
+ * policy, protected work), never a nightly check, only in their private chat, and the card as the live records say
410
+ * it now (chat-management.md §0a.5).
411
+ */
412
+ export function releaseInChat(store, taskId, approver, now, channel,
413
+ /** The seat a tap came from, checked strictly; "offer" only where the card is drawn for the binding's own chat (no act). */
414
+ seat, root) {
415
+ const plan = planInChat(store, taskId, approver, now, channel, root);
416
+ if (!plan.ok)
417
+ return plan;
418
+ if (!deployGateScope(plan.scope))
419
+ return { ok: false, why: "This plan isn't a release." };
420
+ if (passwordOnlySeal(plan.scope))
421
+ return { ok: false, why: needsPassword(plan.scope) };
422
+ const ref = store.lookupRef(taskId);
423
+ if (ref === null || nightlyTaskRef(store, ref.id))
424
+ return { ok: false, why: NIGHTLY_CHECK_ONLY };
425
+ if (seat !== "offer" && (seat.channel !== channel || !privateReleaseChat(store, seat)))
426
+ return { ok: false, why: "A release is approved only in your private chat with Toolroll." };
427
+ let card;
428
+ try {
429
+ card = releaseCardOf(store, plan.scope, plan.digest, { profile: permissionPlainWords });
430
+ }
431
+ catch {
432
+ return { ok: false, why: "This release's terms can't be shown here, so you approve it in Toolroll." };
433
+ }
434
+ // What changed is part of what's approved: a list that couldn't be read (or was refused as rewritten history) is no card.
435
+ if (plan.scope.releaseTerms != null && card.changes.commits === null)
436
+ return { ok: false, why: "This release's list of changes couldn't be read, so you approve it in Toolroll." };
437
+ return { ok: true, card, modeDigest: plan.modeDigest, source: plan.source, scope: plan.scope };
438
+ }
353
439
  const QUESTIONS = {
354
440
  accept: name => `Accept and finish "${name}"?`,
355
441
  retry: name => `Retry "${name}"? It queues another attempt.`,
@@ -366,6 +452,24 @@ function targetOf(row) {
366
452
  }
367
453
  }
368
454
  /** Why the card's act no longer applies, or null while it still does — checked at the offer and again at the yes. */
455
+ /**
456
+ * A release card's terms, then its Approve (Continue, and a release card refreshed after it changed): the full terms
457
+ * (a file on Telegram, where a message is limited; inline elsewhere), Approve and Cancel bound to this card's digest,
458
+ * and on Telegram the card to show instead when the file didn't arrive: no Approve, a Continue to send it again.
459
+ */
460
+ function releaseContinue(store, seat, message, taskId, name, card, now, ack, lead) {
461
+ const spec = { act: "approve", run: null, digest: releaseDigest(card) };
462
+ const yes = mint(store, seat, message, spec, taskId, "yes", now);
463
+ const cancel = mint(store, seat, message, spec, taskId, "cancel", now);
464
+ const text = `${seat.channel === "telegram" ? card.short : `${card.short}\n\n${card.full}`}${lead === null ? "" : `\n\n${lead}`}`;
465
+ // Telegram carries the terms only as the file: Approve shows only once that file has arrived (telegram.ts).
466
+ const again = seat.channel === "telegram" ? mint(store, seat, message, spec, taskId, "offer", now) : null;
467
+ return { ack, file: { name: card.fileName, text: card.full },
468
+ edit: { text: `${text}\n\nApprove release "${name}"? This approves exactly these terms${seat.channel === "telegram" ? `, every one in ${card.fileName}` : ""}.`,
469
+ rows: [[{ label: "Approve", token: yes }, { label: DECIDE_LABELS.cancel, token: cancel }]], tokens: [yes, cancel] },
470
+ ...(again === null ? {} : { unsent: { text: `${text}\n\nThe terms file didn't arrive, so Approve isn't shown. Tap Continue to send it again.`,
471
+ rows: [[{ label: "Continue", token: again }]], tokens: [again] } }) };
472
+ }
369
473
  function staleWhy(store, row, who, now, channel, root) {
370
474
  switch (row.act) {
371
475
  case "accept":
@@ -384,9 +488,21 @@ function staleWhy(store, row, who, now, channel, root) {
384
488
  }
385
489
  case "approve":
386
490
  case "not-now": {
491
+ if (row.digest.startsWith(RELEASE_DIGEST)) {
492
+ // The button's own seat as it was minted: its binding's chat, checked against the binding's record.
493
+ const release = releaseInChat(store, row.taskId, who.name, now, channel, { channel, binding: row.binding ?? -1, chat: row.chat ?? "", approver: who.name }, root);
494
+ if (!release.ok)
495
+ return release.why;
496
+ return releaseDigest(release.card) === row.digest ? null : "This release changed while you were reading.";
497
+ }
387
498
  const plan = planInChat(store, row.taskId, who.name, now, channel, root);
388
499
  if (!plan.ok)
389
500
  return plan.why;
501
+ // A deploy gate's plain plan card never approves it: only its release card does.
502
+ if (deployGateScope(plan.scope))
503
+ return "This is a release: approve it from its release card.";
504
+ if (passwordOnlySeal(plan.scope))
505
+ return needsPassword(plan.scope);
390
506
  return plan.digest === row.digest ? null : "The plan changed since this card was sent.";
391
507
  }
392
508
  case "merge": {
@@ -427,7 +543,7 @@ export function planWhereNow(store, taskId, who, now, root) {
427
543
  }
428
544
  return { said: `"${name}" is under way.`, rows: [] };
429
545
  }
430
- const QUESTION_STARTS = ["Accept and finish \"", "Retry \"", "Approve and start \"", "Merge \""];
546
+ const QUESTION_STARTS = ["Accept and finish \"", "Retry \"", "Approve and start \"", "Merge \"", "Approve release "];
431
547
  /** The card's words without a question this module appended. */
432
548
  function cardBody(shown) {
433
549
  const at = shown.lastIndexOf("\n\n");
@@ -484,8 +600,24 @@ export function applyDecideTap(store, seat, input) {
484
600
  return { ack: "Cancelled.", edit: { text: offer.text ?? body, ...minted } };
485
601
  }
486
602
  const why = staleWhy(store, row, who, now, seat.channel, input.root);
487
- if (why !== null)
603
+ if (why !== null) {
604
+ // A release that changed while it was read: the new card, with fresh buttons, so the person reads it again.
605
+ // Through the same gate as Continue: the new terms go first (as a file where the chat app limits a message), and
606
+ // Approve shows only once they arrived; else a Continue to send them again. A release that is now password-only
607
+ // gets its card with the link to Toolroll.
608
+ if (row.digest.startsWith(RELEASE_DIGEST) && row.act === "approve" && why === "This release changed while you were reading.") {
609
+ spend();
610
+ const release = releaseInChat(store, row.taskId, who.name, now, seat.channel, seat, input.root);
611
+ if (release.ok)
612
+ return releaseContinue(store, seat, input.message, row.taskId, name, release.card, now, why, `${why} Here it is now.`);
613
+ const offer = decideOffer(store, target, who, now, seat.channel, input.root);
614
+ if (offer !== null && offer.file === undefined) {
615
+ const minted = mintDecideButtons(store, seat, target, offer, now, input.message);
616
+ return { ack: why, edit: { text: `${offer.text ?? body}\n\n${why} Here it is now.`, ...minted } };
617
+ }
618
+ }
488
619
  return stale(why);
620
+ }
489
621
  if (row.phase === "offer") {
490
622
  if (row.act === "changes") {
491
623
  const id = openDecidePrompt(store, seat, row.taskId, row.run ?? 0, row.digest, now);
@@ -496,6 +628,14 @@ export function applyDecideTap(store, seat, input) {
496
628
  return { ack: "Okay, it waits.", edit: { text: `${body}\n\nNot now. It waits for you in Tasks.`,
497
629
  rows: [[{ label: DECIDE_LABELS.edit, link: { label: DECIDE_LABELS.edit, path: chatControlHref("approval", row.taskId) } }]], tokens: [] } };
498
630
  }
631
+ // A release card's Continue: the card again from the live records, its full terms as a file, then Approve.
632
+ if (row.act === "approve" && row.digest.startsWith(RELEASE_DIGEST)) {
633
+ const release = releaseInChat(store, row.taskId, who.name, now, seat.channel, seat, input.root);
634
+ if (!release.ok)
635
+ return stale(release.why);
636
+ spend();
637
+ return releaseContinue(store, seat, input.message, row.taskId, name, release.card, now, "Read the terms, then approve.", null);
638
+ }
499
639
  // The first tap asks; only the yes acts, bound to exactly what this button was.
500
640
  spend();
501
641
  const spec = { act: row.act, run: row.run, digest: row.digest };
@@ -521,9 +661,35 @@ export function applyDecideTap(store, seat, input) {
521
661
  return retried.ok ? done("✓ Queued again. Existing approvals and holds still apply.") : notDone(retried.message);
522
662
  }
523
663
  case "approve": {
664
+ if (row.digest.startsWith(RELEASE_DIGEST)) {
665
+ const release = releaseInChat(store, row.taskId, who.name, now, seat.channel, seat, input.root);
666
+ if (!release.ok)
667
+ return notDone(release.why);
668
+ const cardDigest = release.card.digest;
669
+ // The seal knows which card it came from: a chat seal of a deploy gate needs this evidence (store.ts).
670
+ if (!store.sealScopeApproval(row.taskId, who.name, now, {}, { kind: "chat", modeDigest: release.modeDigest, card: "release", cardDigest }))
671
+ return notDone("the release couldn't be approved from chat. Open it in Toolroll.");
672
+ const sealedDigest = store.getScope(row.taskId)?.approvedDigest ?? "";
673
+ store.recordAction({ at: now.toISOString(), actor: who.name, repo: ref.repo, taskId: row.taskId, runId: null, action: APPROVAL_PROOF, outcome: "chat", source: "request",
674
+ detail: JSON.stringify({ v: 1, at: now.toISOString(), generation: store.accountOf(who.name)?.generation ?? 0, digest: sealedDigest, card: "release", cardDigest }) });
675
+ const where = `${CHANNEL_NAMES[seat.channel]} · chat binding #${seat.binding}`;
676
+ store.recordAction({ at: now.toISOString(), actor: who.name, repo: ref.repo, taskId: row.taskId, runId: null, action: "release approved in chat", outcome: "approved",
677
+ source: "request", detail: `via ${where} · ${release.source} ${release.modeDigest} · card ${cardDigest}` });
678
+ // Said everywhere the person hears from Toolroll (their other chats and push), naming the chat it came from.
679
+ const terms = release.scope.releaseTerms ?? null;
680
+ store.enqueueNotification({ dedupeKey: `release-approved-chat:${row.taskId}:${cardDigest}`, kind: "release-approved", recipient: who.name, pushClass: "attention",
681
+ subject: `Release${terms === null ? "" : ` ${terms.packageVersion}`} approved from ${CHANNEL_NAMES[seat.channel]}`,
682
+ body: `You approved "${name}"${terms === null ? "" : ` (${terms.approvedSha.slice(0, 7)}, pull request #${terms.pr})`} from ${CHANNEL_NAMES[seat.channel]}. If that wasn't you, stop it in Toolroll now.`,
683
+ link: chatControlHref("task", row.taskId), source: { taskRef: ref.id } }, now);
684
+ return done("✓ Release approved. It deploys when its check passes and someone runs the release.");
685
+ }
524
686
  const plan = planInChat(store, row.taskId, who.name, now, seat.channel, input.root);
525
687
  if (!plan.ok)
526
688
  return notDone(plan.why);
689
+ if (deployGateScope(plan.scope))
690
+ return notDone("This is a release: approve it from its release card.");
691
+ if (passwordOnlySeal(plan.scope))
692
+ return notDone(needsPassword(plan.scope));
527
693
  // The owner's own yes, sealed as theirs ("chat"), never as a mode's: it stands like the console's after the mode or setting ends.
528
694
  if (!store.sealScopeApproval(row.taskId, who.name, now, {}, { kind: "chat", modeDigest: plan.modeDigest }))
529
695
  return notDone("the plan couldn't be approved from chat. Open it in Toolroll.");
@@ -127,7 +127,8 @@ export function prepareCheckAttempt(store, root, input, now) {
127
127
  planDigest: plan === null ? null : payloadDigest(plan), snapshotDigest: snapshot === null ? null : payloadDigest(snapshot),
128
128
  inventoryDigest: payloadDigest(inventory), contextDigest: payloadDigest(context), nonceHash: sha256(nonce),
129
129
  }, now);
130
- const stdin = JSON.stringify({ nonce, mode, plan, watch: [...(input.watch ?? [])] });
130
+ // The command's own limit rides along, so the check ends itself (logs and report printed) before the plane stops it.
131
+ const stdin = JSON.stringify({ nonce, mode, plan, watch: [...(input.watch ?? [])], limitMs: input.command.timeoutMs });
131
132
  return { runId: input.runId, nonce, stdin, mode, inventory, context, plan, snapshot, watch: [...(input.watch ?? [])] };
132
133
  }
133
134
  /** Seal one JSON payload as a structured-output artifact under its capture label. */
@@ -10,6 +10,7 @@ import { createContainer, currentContainment } from "./containment.js";
10
10
  import { processMayBeAlive } from "./process-liveness.js";
11
11
  import { observeProcessTree, sampleProcessTree, stopProcessTree } from "./process-tree.js";
12
12
  import { isOwnEnv } from "./names.js";
13
+ import { isProtectedEnvName } from "./protected-storage.js";
13
14
  import { sleep } from "./sleep.js";
14
15
  /** A response from the server, distinct from an ambiguous transport failure. */
15
16
  export class CodingProviderRequestError extends Error {
@@ -54,8 +55,9 @@ export function codingEnvironment() {
54
55
  // Preserve native Codex auth, HOME, PATH, CODEX_HOME and project config.
55
56
  // A parent desktop session's control pipe and identity do not belong to
56
57
  // this independent native client. Keep install/runtime paths such as
57
- // CODEX_MCP_NODE_PATH. Service credentials stay with the web service.
58
- if (isOwnEnv(key) || /^(TELEGRAM|SLACK|DISCORD)_.*(TOKEN|SECRET|KEY)$/i.test(key) || /^CODEX_APP_TOOLS_/.test(key) || invokingSession.has(key) || key === "NODE_OPTIONS" || key === "NODE_PATH")
58
+ // CODEX_MCP_NODE_PATH. Service credentials stay with the web service; no chat or vault variable reaches it
59
+ // (protected-storage.ts).
60
+ if (isOwnEnv(key) || isProtectedEnvName(key) || /^CODEX_APP_TOOLS_/.test(key) || invokingSession.has(key) || key === "NODE_OPTIONS" || key === "NODE_PATH")
59
61
  delete env[key];
60
62
  }
61
63
  return env;
@@ -60,6 +60,12 @@ export type Verified<T> = {
60
60
  ok: false;
61
61
  message: string;
62
62
  };
63
+ /** Which Git runs and with what environment: the release path's fixed absolute Git and its own environment, or by
64
+ * default the checkout Git environment's. The hardening settings are added over either. */
65
+ export type GitRunner = {
66
+ git?: string;
67
+ env?: NodeJS.ProcessEnv;
68
+ };
63
69
  /** One commit, hashed here and parsed from its own bytes. */
64
70
  export declare function readVerifiedCommit(gitDir: string, sha: string): Verified<VerifiedCommit>;
65
71
  /**
@@ -91,4 +97,15 @@ export declare function verifiedBlobs(gitDir: string, tree: string, paths: reado
91
97
  id: string;
92
98
  bytes: Buffer;
93
99
  }>>;
100
+ /**
101
+ * The commits reachable from `to` and not from `from`, as Git lists them (newest first), each read from its own verified
102
+ * bytes: what a release card says changed (release-card.ts). Git only names them. Each is hashed here and its parents
103
+ * checked against Git's listing; every commit the range stops at (a parent outside it) must be reached from `from`
104
+ * through verified parents within `reach` commits, so history a build rewrote around the objects can't shorten the
105
+ * list. A shallow boundary, grafts or replacement refs refuse (verifiedReader), as does a range longer than `max`.
106
+ */
107
+ export declare function verifiedRange(gitDir: string, from: string, to: string, options?: GitRunner & {
108
+ max?: number;
109
+ reach?: number;
110
+ }): Verified<VerifiedCommit[]>;
94
111
  export {};
@@ -167,10 +167,11 @@ export function extractCommit(gitDir, sha, dest, limits = EXTRACTION_LIMITS) {
167
167
  return { ok: true, files: files.length };
168
168
  }
169
169
  /** A reader over the project's object store that hashes every object it hands back, or why it can't be one. */
170
- function verifiedReader(gitDir) {
170
+ function verifiedReader(gitDir, runner = {}) {
171
171
  const refuse = (message) => ({ ok: false, message });
172
- const env = { ...checkoutGitEnv(), GIT_CONFIG_NOSYSTEM: "1", GIT_CONFIG_GLOBAL: "/dev/null", GIT_NO_REPLACE_OBJECTS: "1", GIT_NO_LAZY_FETCH: "1", GIT_ATTR_NOSYSTEM: "1" };
173
- const git = (args, input) => spawnSync("git", ["--git-dir", gitDir, "--no-replace-objects", ...HARDENED_GIT_ARGS, ...args], { env, input, maxBuffer: MAX_BYTES, timeout: 300_000 });
172
+ const env = { ...(runner.env ?? checkoutGitEnv()), GIT_CONFIG_NOSYSTEM: "1", GIT_CONFIG_GLOBAL: "/dev/null", GIT_NO_REPLACE_OBJECTS: "1", GIT_NO_LAZY_FETCH: "1", GIT_ATTR_NOSYSTEM: "1" };
173
+ // The commit-graph file is a cache a build can write: parents come from the objects themselves, never from it.
174
+ const git = (args, input) => spawnSync(runner.git ?? "git", ["--git-dir", gitDir, "--no-replace-objects", ...HARDENED_GIT_ARGS, "-c", "core.commitGraph=false", ...args], { cwd: "/", env, input, maxBuffer: MAX_BYTES, timeout: 300_000 });
174
175
  // History a build could have rewritten around the objects: a shallow boundary, grafts, or replacement refs. Each is
175
176
  // refused outright, so no reader here ever has to decide whether to believe one.
176
177
  if (existsSync(join(gitDir, "shallow")))
@@ -221,7 +222,7 @@ function verifiedReader(gitDir) {
221
222
  }
222
223
  return found;
223
224
  };
224
- return { ok: true, value: { format, hexLength, read } };
225
+ return { ok: true, value: { format, hexLength, read, git } };
225
226
  }
226
227
  /** Parse a commit from its verified bytes: tree, parents, message. Null when malformed. */
227
228
  function parseCommit(id, bytes, hexLength) {
@@ -434,3 +435,80 @@ export function verifiedBlobs(gitDir, tree, paths) {
434
435
  return { ok: false, message: `A file couldn't be verified: ${blobs}.` };
435
436
  return { ok: true, value: new Map(wanted.map(one => [one.path, { id: one.id, bytes: blobs.get(one.id).bytes }])) };
436
437
  }
438
+ /**
439
+ * The commits reachable from `to` and not from `from`, as Git lists them (newest first), each read from its own verified
440
+ * bytes: what a release card says changed (release-card.ts). Git only names them. Each is hashed here and its parents
441
+ * checked against Git's listing; every commit the range stops at (a parent outside it) must be reached from `from`
442
+ * through verified parents within `reach` commits, so history a build rewrote around the objects can't shorten the
443
+ * list. A shallow boundary, grafts or replacement refs refuse (verifiedReader), as does a range longer than `max`.
444
+ */
445
+ export function verifiedRange(gitDir, from, to, options = {}) {
446
+ const { max = 1_000, reach = 5_000 } = options;
447
+ const reader = verifiedReader(gitDir, options);
448
+ if (!reader.ok)
449
+ return reader;
450
+ const { git, read, hexLength } = reader.value;
451
+ const id = new RegExp(`^[0-9a-f]{${hexLength}}$`);
452
+ if (!id.test(from) || !id.test(to))
453
+ return { ok: false, message: "A commit id isn't a full id." };
454
+ /** Git's listing: each line's commit (`-` marks a boundary) and the parents it names. */
455
+ const listing = (args) => {
456
+ const listed = git(["rev-list", "--parents", ...args]);
457
+ if (listed.status !== 0)
458
+ return null;
459
+ const rows = String(listed.stdout).split("\n").filter(line => line !== "").map(line => {
460
+ const [first = "", ...parents] = line.split(" ");
461
+ return { id: first.replace(/^-/, ""), boundary: first.startsWith("-"), parents };
462
+ });
463
+ return rows.every(row => id.test(row.id) && row.parents.every(one => id.test(one))) ? rows : null;
464
+ };
465
+ const range = listing(["--boundary", `${from}..${to}`, "--"]);
466
+ if (range === null)
467
+ return { ok: false, message: "The commits between the releases couldn't be listed." };
468
+ const inside = range.filter(row => !row.boundary), stops = new Set(range.filter(row => row.boundary).map(row => row.id));
469
+ if (inside.length > max)
470
+ return { ok: false, message: `More than ${max} commits lie between the releases.` };
471
+ const objects = read(inside.map(row => row.id));
472
+ if (typeof objects === "string")
473
+ return { ok: false, message: `A commit couldn't be verified: ${objects}.` };
474
+ const listed = new Set(inside.map(row => row.id));
475
+ const commits = [];
476
+ for (const row of inside) {
477
+ const object = objects.get(row.id);
478
+ const commit = object.type === "commit" ? parseCommit(row.id, object.bytes, hexLength) : null;
479
+ if (commit === null)
480
+ return { ok: false, message: `${row.id.slice(0, 7)} isn't a commit.` };
481
+ // Git's parents must be the commit's own, and each one inside the range or where it stops.
482
+ if (commit.parents.join(" ") !== row.parents.join(" "))
483
+ return { ok: false, message: `Git's history of ${row.id.slice(0, 7)} isn't its own.` };
484
+ if (commit.parents.some(parent => !listed.has(parent) && !stops.has(parent)))
485
+ return { ok: false, message: `The history of ${row.id.slice(0, 7)} is incomplete.` };
486
+ commits.push(commit);
487
+ }
488
+ if (inside.length > 0 && !listed.has(to))
489
+ return { ok: false, message: `${to.slice(0, 7)} isn't in its own range.` };
490
+ // Where the range stops: each must be `from` or one of its verified ancestors. An empty range says `to` is already in
491
+ // the last release: that too is proved, never taken from Git's listing.
492
+ const wanted = [...stops, ...(inside.length === 0 ? [to] : [])].filter(one => one !== from);
493
+ if (wanted.length === 0)
494
+ return { ok: true, value: commits };
495
+ const before = listing([`--max-count=${reach}`, from, "--"]);
496
+ if (before === null)
497
+ return { ok: false, message: "The last release's history couldn't be listed." };
498
+ const ancestry = read(before.map(row => row.id));
499
+ if (typeof ancestry === "string")
500
+ return { ok: false, message: `The last release's history couldn't be verified: ${ancestry}.` };
501
+ const reached = new Set([from]);
502
+ const queue = [from];
503
+ while (queue.length > 0) {
504
+ const object = ancestry.get(queue.shift());
505
+ const commit = object === undefined || object.type !== "commit" ? null : parseCommit("", object.bytes, hexLength);
506
+ for (const parent of commit?.parents ?? [])
507
+ if (!reached.has(parent)) {
508
+ reached.add(parent);
509
+ queue.push(parent);
510
+ }
511
+ }
512
+ const unreached = wanted.find(one => !reached.has(one));
513
+ return unreached === undefined ? { ok: true, value: commits } : { ok: false, message: `${unreached.slice(0, 7)} isn't verified as part of the last release's history.` };
514
+ }
@@ -75,8 +75,8 @@ export declare const CONSOLE_FORMS: {
75
75
  readonly term: FormContract<"password" | "program" | "repo">;
76
76
  readonly skillsRevise: FormContract<"feedback" | "nonce" | "repo" | "run">;
77
77
  readonly skillsChange: FormContract<"action" | "content" | "files" | "identity" | "method" | "nonce" | "repo" | "restore" | "revision" | "sample" | "sha" | "url">;
78
- readonly kit: FormContract<"repo">;
79
- readonly subagents: FormContract<"choice" | "dailyTurns" | "id" | "manager" | "model" | "name" | "note" | "op" | "repo" | "schedule" | "soul" | "state" | "template" | "text" | "tool" | `field.${string}` | `over.${string}` | `undo.${string}` | `use.${string}`>;
78
+ readonly kit: FormContract<"password" | "repo">;
79
+ readonly subagents: FormContract<"choice" | "dailyTurns" | "id" | "manager" | "model" | "name" | "note" | "op" | "password" | "repo" | "schedule" | "soul" | "state" | "template" | "text" | "tool" | `field.${string}` | `over.${string}` | `undo.${string}` | `use.${string}`>;
80
80
  readonly galleryUse: FormContract<string>;
81
81
  readonly flows: FormContract<"about" | "address" | "answers" | "approve" | "body" | "budget" | "choice" | "confirm" | "days" | "decision" | "definition" | "description" | "document" | "draft" | "entry" | "file" | "include" | "key" | "label" | "language" | "name" | "note" | "owner" | "password" | "previewed" | "project" | "remove" | "repo" | "revision" | "runs" | "schedules" | "secret" | "sender" | "stage" | "team" | "template" | "timeoutMinutes" | "title" | "trigger" | "url" | "value" | "watching" | `param.${string}`>;
82
82
  readonly spendBudget: FormContract<"action" | "password" | "stop" | "target" | "usd">;
@@ -118,7 +118,7 @@ export declare const CONSOLE_FORMS: {
118
118
  readonly teams: FormContract<"app-id" | "password" | "secret" | "tenant">;
119
119
  readonly discord: FormContract<"bot-token" | "password">;
120
120
  readonly messaging: FormContract<"primary">;
121
- readonly permissionDefault: FormContract<"permission-mode">;
121
+ readonly permissionDefault: FormContract<"password" | "permission-mode">;
122
122
  readonly qualityDefault: FormContract<"quality-mode">;
123
123
  readonly notifications: FormContract<"digest" | "mode" | "screenshots">;
124
124
  readonly notificationsMute: FormContract<"pings" | "repo">;
@@ -84,9 +84,9 @@ export const CONSOLE_FORMS = {
84
84
  term: formContract("POST /term/start, /term/<terminal>/close, /term/<terminal>/remove", ["repo", "program", "password"]),
85
85
  skillsRevise: formContract("POST /settings/skills/revise", ["run", "repo", "feedback", "nonce"]),
86
86
  skillsChange: formContract("POST /settings/skills/import, /settings/skills/change", ["repo", "identity", "revision", "method", "content", "files", "url", "action", "sha", "sample", "nonce", "restore"]),
87
- kit: formContract("POST /kits/<kit>/<act>", ["repo"]),
88
- subagents: formContract("POST /settings/lead/subagents/new, /settings/lead/subagents/<id>/<part>, /settings/lead/subagents/questions/<id>/answer", ["choice", "text", "repo", "template", "name", "soul", "op", "id", "schedule", "tool", "state", "note", "model", "dailyTurns", "manager"], { prefixes: ["use.", "undo.", "field.", "over."] }),
89
- galleryUse: formContract("POST /flows/new/<template>", ["repo", "send-result", "name", "intent", "previewed"], { dynamic: true }),
87
+ kit: formContract("POST /kits/<kit>/<act>", ["repo", "password"]),
88
+ subagents: formContract("POST /settings/lead/subagents/new, /settings/lead/subagents/<id>/<part>, /settings/lead/subagents/questions/<id>/answer", ["choice", "text", "repo", "template", "name", "soul", "op", "id", "schedule", "tool", "state", "note", "model", "dailyTurns", "manager", "password"], { prefixes: ["use.", "undo.", "field.", "over."] }),
89
+ galleryUse: formContract("POST /flows/new/<template>", ["repo", "send-result", "name", "intent", "previewed", "password"], { dynamic: true }),
90
90
  flows: formContract("POST /flows/new, /flows/example, /flows/import, /flows/<id>/<act>, /flows/<id>/cards/<card>/<act>, /flows/<id>/triggers/<trigger>/<act>", ["repo", "document", "url", "confirm", "previewed", "template", "name", "answers", "password", "secret", "sender", "project", "team", "trigger", "approve", "remove", "about", "body", "timeoutMinutes", "language", "file", "address", "key", "definition", "owner", "revision", "value", "title", "description", "stage", "decision", "note", "draft", "choice", "entry", "label", "watching", "days", "budget", "runs", "include", "schedules"], { prefixes: ["param."] }),
91
91
  spendBudget: formContract("POST /spend/budget", ["password", "target", "action", "usd", "stop"]),
92
92
  projectConcurrency: formContract("POST /settings/project/concurrency", ["repo", "concurrency"]),
@@ -127,7 +127,7 @@ export const CONSOLE_FORMS = {
127
127
  teams: formContract("POST /settings/teams/connect|pair|unpair|disconnect|alerts", ["password", "app-id", "tenant", "secret"]),
128
128
  discord: formContract("POST /settings/discord/connect|pair|unpair|disconnect|alerts", ["password", "bot-token"]),
129
129
  messaging: formContract("POST /settings/messaging", ["primary"]),
130
- permissionDefault: formContract("POST /settings/permission-default", ["permission-mode"]),
130
+ permissionDefault: formContract("POST /settings/permission-default", ["permission-mode", "password"]),
131
131
  qualityDefault: formContract("POST /settings/quality-default", ["quality-mode"]),
132
132
  notifications: formContract("POST /settings/notifications", ["mode", "digest", "screenshots"]),
133
133
  notificationsMute: formContract("POST /settings/notifications/mute", ["repo", "pings"]),