toolroll 0.9.60 → 0.9.62

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 (128) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/agent-board.d.ts +208 -0
  3. package/dist/agent-board.js +454 -0
  4. package/dist/agent-fence.d.ts +19 -0
  5. package/dist/agent-fence.js +100 -8
  6. package/dist/agent-pulse.d.ts +43 -0
  7. package/dist/agent-pulse.js +214 -0
  8. package/dist/agent-turns.d.ts +52 -0
  9. package/dist/agent-turns.js +137 -0
  10. package/dist/agents-board.d.ts +101 -0
  11. package/dist/agents-board.js +225 -0
  12. package/dist/assignment-adapters.d.ts +1 -0
  13. package/dist/assignment-status.d.ts +1 -1
  14. package/dist/assignment.d.ts +4 -0
  15. package/dist/assignment.js +8 -6
  16. package/dist/browser/workspace.css +1 -1
  17. package/dist/browser/workspace.js +29 -25
  18. package/dist/browser-crew.js +2 -0
  19. package/dist/browser-workspace.d.ts +79 -1
  20. package/dist/browser-workspace.js +1 -0
  21. package/dist/builder.d.ts +8 -0
  22. package/dist/builder.js +113 -13
  23. package/dist/chat-channel.js +9 -0
  24. package/dist/chat-core.d.ts +6 -0
  25. package/dist/chat-core.js +8 -0
  26. package/dist/chat-delivery.js +22 -0
  27. package/dist/chat-messages.js +8 -1
  28. package/dist/chat-quiet.js +1 -0
  29. package/dist/chat-voice.d.ts +2 -0
  30. package/dist/chat-voice.js +2 -0
  31. package/dist/checkout-cleanup.d.ts +3 -0
  32. package/dist/checkout-cleanup.js +11 -2
  33. package/dist/cli.js +28 -11
  34. package/dist/contracts/console-api.d.ts +3 -1
  35. package/dist/contracts/console-api.js +5 -1
  36. package/dist/contracts/lead-tools.d.ts +16 -2
  37. package/dist/contracts/lead-tools.js +5 -1
  38. package/dist/desktop-update.d.ts +1 -1
  39. package/dist/evidence-pack.js +1 -1
  40. package/dist/evidence.d.ts +6 -0
  41. package/dist/evidence.js +14 -3
  42. package/dist/exec.d.ts +32 -0
  43. package/dist/exec.js +229 -10
  44. package/dist/invoke.js +110 -18
  45. package/dist/landed-cleanup.d.ts +170 -0
  46. package/dist/landed-cleanup.js +814 -0
  47. package/dist/lead-cli.js +22 -19
  48. package/dist/lead-contract.d.ts +1 -1
  49. package/dist/lead-contract.js +4 -4
  50. package/dist/lead-doors.js +45 -1
  51. package/dist/lead-tools.js +40 -7
  52. package/dist/live-input.d.ts +68 -0
  53. package/dist/live-input.js +254 -0
  54. package/dist/live.d.ts +1 -1
  55. package/dist/live.js +4 -2
  56. package/dist/maintenance.d.ts +2 -0
  57. package/dist/maintenance.js +5 -2
  58. package/dist/operate-remote-arguments.js +5 -1
  59. package/dist/operate-remote.js +1 -1
  60. package/dist/operate.d.ts +1 -1
  61. package/dist/operate.js +249 -26
  62. package/dist/orphan-sweep.d.ts +2 -0
  63. package/dist/orphan-sweep.js +5 -3
  64. package/dist/project-admission.d.ts +10 -6
  65. package/dist/project-admission.js +33 -11
  66. package/dist/project-delete-ui.d.ts +12 -0
  67. package/dist/project-delete-ui.js +32 -2
  68. package/dist/project-tools.d.ts +7 -11
  69. package/dist/project-tools.js +13 -37
  70. package/dist/provider.d.ts +65 -8
  71. package/dist/provider.js +80 -21
  72. package/dist/remote-main.d.ts +57 -0
  73. package/dist/remote-main.js +179 -0
  74. package/dist/result-completion.d.ts +7 -0
  75. package/dist/result-completion.js +9 -0
  76. package/dist/runner.d.ts +4 -2
  77. package/dist/runner.js +3 -3
  78. package/dist/serve.js +19 -1
  79. package/dist/server/live.d.ts +3 -0
  80. package/dist/server/live.js +35 -2
  81. package/dist/server/pages.js +59 -35
  82. package/dist/server/render-chat.js +12 -0
  83. package/dist/server/render-tasks.d.ts +15 -2
  84. package/dist/server/render-tasks.js +30 -7
  85. package/dist/server/route-table.js +4 -1
  86. package/dist/server/settings.js +5 -3
  87. package/dist/server/task-views.js +11 -0
  88. package/dist/server/tasks.js +63 -0
  89. package/dist/shared-deps.d.ts +9 -4
  90. package/dist/shared-deps.js +89 -13
  91. package/dist/staged-runtimes.d.ts +16 -4
  92. package/dist/staged-runtimes.js +160 -38
  93. package/dist/steer-live.d.ts +19 -0
  94. package/dist/steer-live.js +93 -0
  95. package/dist/steer-status.d.ts +8 -2
  96. package/dist/steer-status.js +19 -5
  97. package/dist/storage-sweep-child.d.ts +1 -0
  98. package/dist/storage-sweep-child.js +76 -0
  99. package/dist/storage-sweep-process.d.ts +48 -0
  100. package/dist/storage-sweep-process.js +204 -0
  101. package/dist/storage-sweep-schedule.d.ts +30 -0
  102. package/dist/storage-sweep-schedule.js +164 -0
  103. package/dist/storage-sweep.d.ts +31 -6
  104. package/dist/storage-sweep.js +165 -39
  105. package/dist/storage-ui.d.ts +4 -0
  106. package/dist/storage-ui.js +22 -7
  107. package/dist/storage.d.ts +6 -0
  108. package/dist/storage.js +35 -0
  109. package/dist/store.d.ts +200 -3
  110. package/dist/store.js +443 -17
  111. package/dist/surface.js +8 -4
  112. package/dist/sweep-quarantine.d.ts +28 -0
  113. package/dist/sweep-quarantine.js +153 -0
  114. package/dist/task-base.d.ts +35 -0
  115. package/dist/task-base.js +51 -0
  116. package/dist/task-status.d.ts +2 -0
  117. package/dist/task-status.js +5 -1
  118. package/dist/test-temp.d.ts +6 -3
  119. package/dist/test-temp.js +15 -9
  120. package/dist/toolroll-update.js +4 -2
  121. package/dist/work-index.d.ts +1 -0
  122. package/dist/work-index.js +32 -12
  123. package/dist/work-summary.d.ts +2 -2
  124. package/dist/workspace-revision.js +3 -1
  125. package/dist/worktree.d.ts +57 -3
  126. package/dist/worktree.js +201 -23
  127. package/package.json +1 -1
  128. package/scripts/provider-canary.mjs +235 -147
@@ -0,0 +1,170 @@
1
+ import { type ExecResult } from "./exec.js";
2
+ import type { RemoteMainRead, RemoteMains } from "./remote-main.js";
3
+ import type { Store } from "./store.js";
4
+ import { type Runner, type WorktreePool } from "./worktree.js";
5
+ /** `storage clean --landed` takes only what has waited at least this long. */
6
+ export declare const BACKLOG_DAYS = 7;
7
+ /** The local branches the one-time pass looks at: Toolroll's build and plan branches, under either name. */
8
+ export declare const BACKLOG_PREFIXES: readonly string[];
9
+ /** The ledger action that closes a teardown. */
10
+ export declare const LANDED_CLEANED_ACTION = "landed work cleaned up";
11
+ /** Reconcile looks at most this many results and finishes at most this many items a pass; the pass by hand has no cap. */
12
+ export declare const AUTO_LOOKS = 20;
13
+ export declare const AUTO_ITEMS = 40;
14
+ export type Git = (cwd: string, args: readonly string[]) => Promise<ExecResult>;
15
+ export declare function gitOf(runner?: Runner): Git;
16
+ export type LandedHow = "merged" | "in-main" | "content-in-main";
17
+ /** `trusted`: it may complete a task automatically (a recorded merge, or the recorded remote's main). */
18
+ export type LandedProof = {
19
+ landed: true;
20
+ how: LandedHow;
21
+ reason: string;
22
+ trusted: boolean;
23
+ } | {
24
+ landed: false;
25
+ why: string;
26
+ };
27
+ /** What Toolroll last saw of the result's pull request. */
28
+ export type PullRequestFact = {
29
+ merged: boolean;
30
+ headSha: string | null;
31
+ number: number | null;
32
+ };
33
+ /**
34
+ * Whether this commit's work landed, read from what Toolroll recorded and the local repository. Fails closed: every
35
+ * doubt is "not proven", with the reason in a few words. Only a recorded merge is trusted to complete a task: a build
36
+ * can write the local main.
37
+ */
38
+ export declare function landedProof(git: Git, repo: string, head: string | null, pullRequest?: PullRequestFact | null): Promise<LandedProof>;
39
+ /**
40
+ * The proof automatic completion trusts: a recorded merge of this exact commit, or its work in the main of the
41
+ * project's recorded remote, compared only in the private directory that main was fetched into. `remote` is read only
42
+ * when no recorded merge settles it.
43
+ */
44
+ export declare function remoteLandedProof(remote: () => Promise<RemoteMainRead>, repo: string, head: string | null, pullRequest?: PullRequestFact | null): Promise<LandedProof>;
45
+ export type LandedTarget = {
46
+ kind: "checkout" | "branch";
47
+ target: string;
48
+ expect: string;
49
+ };
50
+ export type LandedKeep = {
51
+ repo: string;
52
+ what: string;
53
+ why: string;
54
+ };
55
+ export type LandedCandidate = {
56
+ repo: string;
57
+ taskId: string;
58
+ rootId: string;
59
+ runId: number;
60
+ receipt: string;
61
+ head: string;
62
+ finishedAt: string;
63
+ /** False when it is already complete: only its teardown is left. */
64
+ completes: boolean;
65
+ how: LandedHow;
66
+ reason: string;
67
+ /** Proven by a recorded merge or the recorded remote's main: only then may it complete. */
68
+ trusted: boolean;
69
+ targets: LandedTarget[];
70
+ keeps: LandedKeep[];
71
+ };
72
+ /**
73
+ * Results in a project whose work landed, with what their teardown would remove and what stays. Reads only.
74
+ * `limit` caps how many results are read against git (reconcile's bound; results read before and unchanged since
75
+ * don't count); `before` takes only results finished before it (the one-time pass's seven days).
76
+ */
77
+ export declare function landedResults(store: Store, git: Git, remotes: RemoteMains, repo: string, root: string, now: Date, options?: {
78
+ limit?: number;
79
+ before?: string;
80
+ memo?: boolean;
81
+ }): Promise<{
82
+ found: LandedCandidate[];
83
+ kept: LandedKeep[];
84
+ }>;
85
+ /**
86
+ * Mark a landed result complete (unless it already is) and record its teardown, in one transaction, bound to the
87
+ * exact result read: refused when the result changed since. The completion's ledger entry says why. Returns the
88
+ * teardown's id; a result already taken returns its existing teardown.
89
+ */
90
+ export declare function recordLandedIntent(store: Store, candidate: LandedCandidate, now: Date, root: string, actor?: string): {
91
+ ok: true;
92
+ id: number;
93
+ completed: boolean;
94
+ } | {
95
+ ok: false;
96
+ why: string;
97
+ };
98
+ /** A landed branch no task names: its teardown, on its own. */
99
+ export type LandedBranch = {
100
+ repo: string;
101
+ branch: string;
102
+ oid: string;
103
+ how: LandedHow;
104
+ reason: string;
105
+ checkout: string | null;
106
+ };
107
+ export declare function recordBranchIntent(store: Store, branch: LandedBranch, now: Date, actor: string): number;
108
+ export type LandedStep = {
109
+ kind: "checkout" | "branch";
110
+ repo: string;
111
+ target: string;
112
+ taskId: string | null;
113
+ outcome: "removed" | "already gone" | "waits" | "kept";
114
+ why: string | null;
115
+ };
116
+ /**
117
+ * Finish what teardowns intended: pending items, oldest first (checkouts before branches). Each is checked again
118
+ * right before it goes, and recorded right after. Doubt leaves it pending for the next pass; a branch that moved, or
119
+ * a result that has newer work, is kept for good. `limit` caps the items settled (removed, already gone or kept), so
120
+ * items left waiting never crowd out later ones. `only` limits it to these teardowns.
121
+ */
122
+ export declare function finishLanded(store: Store, pool: WorktreePool, git: Git, remotes: RemoteMains, now: () => Date, options?: {
123
+ repo?: string;
124
+ limit?: number;
125
+ only?: ReadonlySet<number>;
126
+ }): Promise<LandedStep[]>;
127
+ /**
128
+ * Reconcile's part: finish teardowns a crash cut short, then find newly landed results (a bounded few), mark them
129
+ * complete and tear them down.
130
+ */
131
+ export declare function reconcileLanded(store: Store, pool: WorktreePool, git: Git, remotes: RemoteMains, repo: string, root: string, now: () => Date): Promise<{
132
+ completed: string[];
133
+ steps: LandedStep[];
134
+ }>;
135
+ export type LandedSummary = {
136
+ completed: number;
137
+ checkouts: number;
138
+ branches: number;
139
+ /** What a teardown still waits on, and why. */
140
+ waiting: {
141
+ target: string;
142
+ why: string | null;
143
+ }[];
144
+ };
145
+ /** What landed-work teardowns did so far, and what they still wait on (Settings → Storage). Reads only. */
146
+ export declare function landedSummary(store: Store): LandedSummary;
147
+ export type LandedPlan = {
148
+ at: string;
149
+ cutoff: string;
150
+ results: LandedCandidate[];
151
+ branches: LandedBranch[];
152
+ kept: LandedKeep[];
153
+ /** Items an earlier teardown still has to finish. */
154
+ pending: number;
155
+ };
156
+ /**
157
+ * What `storage clean --landed` would do now, across every project: landed results finished at least a week ago,
158
+ * and branches Toolroll created (toolroll/, toolroll-plan/, standing-orders/) at least a week ago that no task uses
159
+ * and that landed in main. Reads only.
160
+ */
161
+ export declare function landedBacklog(store: Store, git: Git, remotes: RemoteMains, root: string, now: Date, options?: {
162
+ repos?: readonly string[];
163
+ }): Promise<LandedPlan>;
164
+ /** Act on a preview: record every teardown first, then carry them out. Refuses nothing it previewed silently: what
165
+ * changed since is reported as kept. */
166
+ export declare function cleanLandedBacklog(store: Store, pool: WorktreePool, git: Git, remotes: RemoteMains, root: string, now: () => Date, plan: LandedPlan, actor: string): Promise<{
167
+ completed: string[];
168
+ steps: LandedStep[];
169
+ refused: LandedKeep[];
170
+ }>;