toolroll 0.9.6 → 0.9.8

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 (102) hide show
  1. package/CHANGELOG.md +64 -1
  2. package/dist/actor.d.ts +21 -0
  3. package/dist/actor.js +48 -0
  4. package/dist/assignment-adapters.d.ts +2 -0
  5. package/dist/assignment-adapters.js +2 -0
  6. package/dist/assignment-ui.js +3 -1
  7. package/dist/assignment.d.ts +15 -0
  8. package/dist/assignment.js +80 -16
  9. package/dist/browser/workspace.css +2 -2
  10. package/dist/browser/workspace.js +28 -24
  11. package/dist/browser-workspace.d.ts +117 -2
  12. package/dist/build-review.d.ts +38 -0
  13. package/dist/build-review.js +341 -0
  14. package/dist/builder.d.ts +1 -0
  15. package/dist/builder.js +33 -13
  16. package/dist/chat-actions.js +2 -1
  17. package/dist/chat-delivery.js +2 -0
  18. package/dist/chat-quiet.js +11 -1
  19. package/dist/chat-task-actions.d.ts +13 -0
  20. package/dist/chat-task-actions.js +19 -1
  21. package/dist/check-levels-ui.d.ts +26 -0
  22. package/dist/check-levels-ui.js +84 -0
  23. package/dist/check-levels.d.ts +67 -0
  24. package/dist/check-levels.js +171 -0
  25. package/dist/claim.d.ts +22 -0
  26. package/dist/claim.js +43 -0
  27. package/dist/cli.d.ts +1 -1
  28. package/dist/cli.js +6 -0
  29. package/dist/demo-chat.js +4 -1
  30. package/dist/dispatch.js +9 -3
  31. package/dist/dispose.d.ts +12 -3
  32. package/dist/dispose.js +19 -5
  33. package/dist/exec.d.ts +5 -0
  34. package/dist/exec.js +30 -4
  35. package/dist/export.js +3 -2
  36. package/dist/first-run.d.ts +34 -0
  37. package/dist/first-run.js +37 -1
  38. package/dist/flow-gallery-ui.d.ts +30 -0
  39. package/dist/flow-gallery-ui.js +85 -0
  40. package/dist/flow-gallery.d.ts +111 -0
  41. package/dist/flow-gallery.js +445 -0
  42. package/dist/flow-share.d.ts +102 -0
  43. package/dist/flow-share.js +614 -0
  44. package/dist/flow-starters.d.ts +2 -0
  45. package/dist/flow-starters.js +1 -1
  46. package/dist/flow-steps.js +7 -0
  47. package/dist/flow-triggers.js +2 -0
  48. package/dist/flows-cli.d.ts +56 -0
  49. package/dist/flows-cli.js +109 -3
  50. package/dist/flows-ui.d.ts +15 -1
  51. package/dist/flows-ui.js +31 -6
  52. package/dist/guides.js +27 -2
  53. package/dist/invoke.js +5 -0
  54. package/dist/lead-context.js +6 -2
  55. package/dist/mate-doors.d.ts +0 -15
  56. package/dist/mate-doors.js +5 -1
  57. package/dist/mate-tools.js +9 -4
  58. package/dist/models-ui.js +1 -1
  59. package/dist/modes.d.ts +3 -1
  60. package/dist/modes.js +3 -1
  61. package/dist/operate.d.ts +4 -1
  62. package/dist/operate.js +711 -98
  63. package/dist/process-custody.js +8 -0
  64. package/dist/project-concurrency.d.ts +62 -0
  65. package/dist/project-concurrency.js +116 -0
  66. package/dist/project-delete-ui.d.ts +7 -0
  67. package/dist/project-delete-ui.js +19 -2
  68. package/dist/project-delete.js +4 -0
  69. package/dist/provider.js +16 -0
  70. package/dist/pull-request-flow.d.ts +9 -0
  71. package/dist/pull-request-flow.js +21 -3
  72. package/dist/result-follow-ups.d.ts +101 -0
  73. package/dist/result-follow-ups.js +333 -0
  74. package/dist/retention-ui.d.ts +3 -1
  75. package/dist/retention-ui.js +4 -4
  76. package/dist/retention.d.ts +13 -6
  77. package/dist/retention.js +50 -12
  78. package/dist/review-switch.d.ts +41 -0
  79. package/dist/review-switch.js +88 -0
  80. package/dist/reviewer.d.ts +24 -2
  81. package/dist/reviewer.js +49 -1
  82. package/dist/scope.js +11 -0
  83. package/dist/serve.d.ts +211 -2
  84. package/dist/serve.js +1038 -145
  85. package/dist/store.d.ts +112 -4
  86. package/dist/store.js +447 -27
  87. package/dist/surface.js +36 -9
  88. package/dist/tailnet.d.ts +11 -0
  89. package/dist/tailnet.js +47 -0
  90. package/dist/task-outcome-cli.js +2 -2
  91. package/dist/task-status.d.ts +13 -3
  92. package/dist/task-status.js +38 -16
  93. package/dist/team-cli.js +3 -0
  94. package/dist/telegram-status.js +2 -2
  95. package/dist/verification-evidence.js +21 -1
  96. package/dist/webhooks.js +5 -0
  97. package/dist/work-index.js +39 -6
  98. package/dist/work-summary.d.ts +0 -4
  99. package/dist/work-summary.js +4 -1
  100. package/dist/workspace-ui.d.ts +6 -1
  101. package/dist/workspace-ui.js +14 -11
  102. package/package.json +1 -1
package/dist/store.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { type Actor } from "./actor.js";
1
2
  import { type CriterionMatrixRow, type CriterionJudgementWord } from "./proof.js";
2
3
  import { type ExecutionProfile, type ChainEntry, type UnattendedPermissionMode, type AcceptanceCriterion } from "./scope.js";
3
4
  import { type PhaseRoute, type PublicationAuthority, type RouteStamp, type ReadinessLookup, type ReadinessObservation, type RiskLevel, type RouteOverride } from "./phase-routing.js";
@@ -14,11 +15,21 @@ import { type ProjectAccess } from "./project-access.js";
14
15
  import { type LedgerEntry } from "./action-ledger.js";
15
16
  import type { LimitReading, LimitWindow } from "./provider-limits.js";
16
17
  import { underCeiling, type OrgPolicy, type SavedPolicy } from "./policy.js";
18
+ import { type ReviewSwitch } from "./review-switch.js";
17
19
  import { type Billing, type Budget, type BudgetAgent, type BudgetHold, type BudgetScope, type BudgetState, type SpendItem } from "./spend.js";
18
20
  import { type RetentionKind, type RetentionPeriods } from "./retention.js";
19
21
  import { type CheckoutCleanup } from "./storage.js";
20
22
  import { type LedgerChainReport } from "./ledger-chain.js";
21
23
  import { type ApprovalGate, type ApprovalRules, type ApproverKind, type Filer } from "./approval-policy.js";
24
+ export type TaskAct = "filed" | "approved" | "cancelled" | "completed" | "asked";
25
+ export type TaskActRow = {
26
+ act: TaskAct;
27
+ account: string;
28
+ lead: boolean;
29
+ person: string | null;
30
+ why: string | null;
31
+ at: string;
32
+ };
22
33
  /** Settings → Integrations (no version bump): each integration's last check. `outcome` is ok, failed, or absent (the check found
23
34
  * nothing set up, such as no `gh` sign-in). `ok_at` and `error`/`error_at` keep the last success and the last
24
35
  * failure across checks, so a row can say both. `account` is a display name only, never a credential. */
@@ -676,6 +687,8 @@ export type FlowScriptRow = {
676
687
  savedAt: string;
677
688
  language: "shell" | "python" | "node";
678
689
  file: string | null;
690
+ /** Why it can't run yet ("imported": it came in with a flow file and waits for a person's approval); null when it runs. */
691
+ held: string | null;
679
692
  };
680
693
  /** Where a card came from when a trigger made it: what to call it and where to look (a GitHub issue, a Linear issue, another flow's card). */
681
694
  /** Where a card came from. `mail` (v89): the email it came from, so a reply to its sender stays in the thread.
@@ -1843,9 +1856,9 @@ export declare class Store {
1843
1856
  } | {
1844
1857
  kind: "machine";
1845
1858
  code: "mirror-latched" | "disowned-completion";
1846
- }, now: Date, admittedFrom: readonly TaskState[] | null): CancellationTransition;
1859
+ }, now: Date, admittedFrom: readonly TaskState[] | null, replacedBy?: string): CancellationTransition;
1847
1860
  private applyCancellationLocked;
1848
- setTaskState(id: string, state: TaskState, now: Date, mutation?: Mutation, cancellationReason?: string): {
1861
+ setTaskState(id: string, state: TaskState, now: Date, mutation?: Mutation, cancellationReason?: string, replacedBy?: string): {
1849
1862
  ok: true;
1850
1863
  } | {
1851
1864
  ok: false;
@@ -2407,6 +2420,14 @@ export declare class Store {
2407
2420
  };
2408
2421
  /** v99: a policy change, as the ledger keeps it: what changed and from what to what. Nothing is kept when nothing changed. */
2409
2422
  private recordPolicy;
2423
+ /** The project's automatic review switch: its explicit setting, else on
2424
+ * while a hands-off mode is active on it, else off. */
2425
+ reviewSwitch(repo: string, now: Date): ReviewSwitch;
2426
+ /** Turn a project's automatic review on or off; the policy log keeps before → after. */
2427
+ setReviewSwitch(repo: string, on: boolean, by: string, now: Date): {
2428
+ before: ReviewSwitch;
2429
+ after: ReviewSwitch;
2430
+ };
2410
2431
  /** A project deleted (project-delete.ts): who, and what it held → how it went. Returns the entry's id. */
2411
2432
  recordProjectDeleted(by: string, repo: string, held: string, how: string, now: Date): number;
2412
2433
  recordAction(entry: Omit<LedgerEntry, "id" | "detail"> & {
@@ -5089,8 +5110,10 @@ export declare class Store {
5089
5110
  hardStop: boolean;
5090
5111
  }, by: string, now: Date): Budget;
5091
5112
  removeBudget(id: number, by: string, now: Date): boolean;
5092
- /** How long each kind of data is kept; null is forever (every kind, until someone chooses). */
5113
+ /** How long each kind of data is kept; null is forever. A kind nobody chose keeps its default (evidence 28 days, the rest forever). */
5093
5114
  retentionPeriods(): RetentionPeriods;
5115
+ /** The periods someone chose: only kinds with a saved row. */
5116
+ retentionChosen(): Partial<RetentionPeriods>;
5094
5117
  /** Set how long one kind is kept (null: forever); the ledger keeps before → after. */
5095
5118
  setRetentionPeriod(kind: RetentionKind, days: number | null, by: string, now: Date): RetentionPeriods;
5096
5119
  /** Settings → Storage: when a finished task's clean checkout is removed (the default until someone chooses). */
@@ -6446,7 +6469,10 @@ export declare class Store {
6446
6469
  by: string;
6447
6470
  language?: "shell" | "python" | "node";
6448
6471
  file?: string | null;
6472
+ held?: string | null;
6449
6473
  }, now: Date): number;
6474
+ /** A person approves a held script (one an imported flow brought): from now on it runs. False when it wasn't held. */
6475
+ approveFlowScript(repo: string, name: string): boolean;
6450
6476
  removeFlowScript(repo: string, name: string): boolean;
6451
6477
  /** Claim a card's visit to a step zone. False when another pass holds it or it already finished. */
6452
6478
  claimFlowStep(step: {
@@ -6746,7 +6772,8 @@ export declare class Store {
6746
6772
  getMateTurn(id: number): MateTurn | null;
6747
6773
  liveMateTurnFor(approver: string): MateTurn | null;
6748
6774
  mateStepsOf(mateTurn: number): ChatTurn[];
6749
- /** Remember a project was opened. Upsert keeps added_at; recency always moves. */
6775
+ /** Remember a project was opened. Upsert keeps added_at; recency always moves.
6776
+ * A project added for the first time starts on Quick checks. */
6750
6777
  upsertProject(path: string, name: string, now: Date): void;
6751
6778
  /** Most recently opened first — the opener page's order. */
6752
6779
  listProjects(): {
@@ -7062,6 +7089,30 @@ export declare class Store {
7062
7089
  group: boolean;
7063
7090
  }): number;
7064
7091
  finishUnspawnedProcess(witness: number, now: Date): void;
7092
+ /** The reconcile road for a pid-less witness a crash or a thrown spawn
7093
+ * left behind: once its run has finished, no live child is tracked for it
7094
+ * here, every other witness of the run has exited and none of the run's
7095
+ * process groups is alive, it settles as never started, with a ledger
7096
+ * entry. A sole pid-less witness has no group to prove gone and stays for
7097
+ * `run settle`. Native witnesses keep their OS-only road. */
7098
+ settleUnspawnedWitnesses(now: Date): number;
7099
+ /** `run settle` (an approver's last resort): every witness of a finished
7100
+ * run that cannot be proven either way is recorded settled under the
7101
+ * approver's reason, in the ledger. Refuses while anything of the run is
7102
+ * alive or could be checked only from another host. Never signals. */
7103
+ settleRunWitnessesByApprover(args: {
7104
+ runId: number;
7105
+ by: string;
7106
+ why: string;
7107
+ }, now: Date): {
7108
+ ok: true;
7109
+ witnesses: number[];
7110
+ repeated: boolean;
7111
+ } | {
7112
+ ok: false;
7113
+ reason: "unknown-run" | "still-running" | "alive";
7114
+ detail: string;
7115
+ };
7065
7116
  recordRunProcess(runId: number, pid: number, now: Date, group?: boolean, witness?: number): void;
7066
7117
  /** The native OS object a witnessed spawn ran inside (v53) — recorded
7067
7118
  * with the spawn, before the target can execute. */
@@ -7147,6 +7198,12 @@ export declare class Store {
7147
7198
  * conversations never freeze the runner's queue.
7148
7199
  */
7149
7200
  liveClaimCount(runner: string, now: Date): number;
7201
+ /** The same live claims as liveClaimCount, by the project their task is placed in. */
7202
+ liveClaimCountsByRepo(runner: string, now: Date): Map<string, number>;
7203
+ /** Every builder's live attempts, by project: what `status` shows against each project's limit. */
7204
+ runningBuildsByRepo(now: Date): Map<string, number>;
7205
+ /** A project's build concurrency changed (project-concurrency.ts): the ledger keeps before → after. */
7206
+ recordProjectConcurrency(by: string, repo: string, before: number, after: number, now: Date): void;
7150
7207
  /** Forward only, and only under the live generation. A stale poller moves nothing. */
7151
7208
  /** v98: an update Telegram pushed, kept until the bridge applies it; false when it's already kept or applied. */
7152
7209
  queueTelegramUpdate(botId: string, updateId: number, payload: string, now: Date): boolean;
@@ -7339,6 +7396,55 @@ export declare class Store {
7339
7396
  }[];
7340
7397
  /** Claim one local day's digest for one person: true once, false if it was already considered. */
7341
7398
  claimEveningDigestDay(account: string, day: string): boolean;
7399
+ /** A lead token for one person, shown once. A new one ends their earlier ones; the ledger names it "lead for <owner>". */
7400
+ mintLeadCredential(owner: string, by: string, now: Date): {
7401
+ id: string;
7402
+ token: string;
7403
+ };
7404
+ /** End every live lead token for one person. */
7405
+ revokeLeadCredentials(owner: string, by: string, now: Date): number;
7406
+ /** Whose lead a presented token is: a live token whose owner is still an approver, or null. */
7407
+ leadFor(presented: string): {
7408
+ owner: string;
7409
+ id: string;
7410
+ } | null;
7411
+ /** Record who did this to a task, when someone is acting. The lead's acts are also in the ledger as "lead for <owner>". */
7412
+ noteTaskAct(taskRef: number, act: TaskAct, now: Date, handed?: {
7413
+ person: string;
7414
+ why: string;
7415
+ }, actor?: Actor | null): void;
7416
+ /** Every recorded act on a task, oldest first. */
7417
+ taskActs(taskRef: number): TaskActRow[];
7418
+ /** Whose lead's work this task is: the last to file, approve or hand it on was that person's lead (null: a person's). */
7419
+ leadWorkOf(taskRef: number): string | null;
7420
+ /** The lead hands a task to a person: it becomes theirs, and they get one message saying why. */
7421
+ askPerson(taskId: string, person: string, why: string, now: Date): {
7422
+ ok: true;
7423
+ } | {
7424
+ ok: false;
7425
+ reason: "unknown-task" | "unknown-person" | "unplaced";
7426
+ };
7427
+ /** The task that replaced a cancelled one, or null. */
7428
+ replacementOf(taskId: string): string | null;
7429
+ /** Every replaced task in one read, for lists: task id → its successor. */
7430
+ replacements(): Map<string, string>;
7431
+ /** Mute or unmute one project's pings for one person. The console and digest keep everything. */
7432
+ setProjectMuted(account: string, repo: string, muted: boolean, now: Date): void;
7433
+ mutedProjects(account: string): string[];
7434
+ /** Whose act made this fact, if anyone's. */
7435
+ notificationActor(id: number): Actor | null;
7436
+ /**
7437
+ * Whether this fact may message this person (every chat, phone and browser asks here). Pings follow
7438
+ * responsibility: a security alert always does; nobody is messaged about their own act (or their lead's);
7439
+ * the lead's work messages nobody unless it is handed to a person or fails with nothing left for the lead
7440
+ * to try; and a person's muted project stays quiet. A fact addressed to one person is theirs. The console
7441
+ * and the evening digest keep every fact either way.
7442
+ */
7443
+ pingAllowed(row: Pick<Notification, "id" | "kind" | "recipient" | "project" | "taskRef">, account: string): boolean;
7444
+ /** The lead's work, which messages nobody: unless it is a security alert or a failure with nothing left for the lead. */
7445
+ leadQuiet(row: Pick<Notification, "id" | "kind" | "taskRef">, actor?: Actor | null): boolean;
7446
+ /** A failure with nothing left for the lead to do: its attempts are spent, or the task has failed for good. */
7447
+ private failedForGood;
7342
7448
  /** The card a destination keeps for this task. A task with none joins a card whose first task was filed within
7343
7449
  * a minute of it (up to eight tasks), or starts its own. */
7344
7450
  chatCardFor(destination: string, taskRef: number, filedAt: string, now: Date): ChatCard;
@@ -7487,6 +7593,8 @@ export declare class Store {
7487
7593
  export declare const TELEGRAM_SKIPPED_RECEIPT = "skipped:before-pairing";
7488
7594
  /** v83: a notification for another person, settled for this destination without sending. */
7489
7595
  export declare const TELEGRAM_SKIPPED_ELSEWHERE = "skipped:for-another-person";
7596
+ /** A fact this person is not messaged about: the lead's work, their own act, or a project they muted. */
7597
+ export declare const TELEGRAM_SKIPPED_QUIET = "skipped:quiet";
7490
7598
  /**
7491
7599
  * Why the store itself holds a Telegram delivery back: authority,
7492
7600
  * provenance, ordering, a switched-off channel, or a wait it imposed. A