toolroll 0.9.61 → 0.9.63

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 (117) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +51 -3
  3. package/dist/agent-fence.d.ts +155 -10
  4. package/dist/agent-fence.js +473 -38
  5. package/dist/browser/workspace.css +1 -1
  6. package/dist/browser/workspace.js +21 -21
  7. package/dist/browser-workspace.d.ts +28 -0
  8. package/dist/chat-actions.js +2 -2
  9. package/dist/check-levels.js +3 -0
  10. package/dist/claim.js +1 -1
  11. package/dist/cli-help.d.ts +1 -1
  12. package/dist/cli-help.js +1 -0
  13. package/dist/cli.js +31 -11
  14. package/dist/contracts/cli.d.ts +8 -0
  15. package/dist/contracts/cli.js +3 -1
  16. package/dist/contracts/console-api.d.ts +19 -1
  17. package/dist/contracts/console-api.js +2 -1
  18. package/dist/contracts/integration-metadata.d.ts +2 -1
  19. package/dist/contracts/integration-metadata.js +2 -1
  20. package/dist/desktop-update.d.ts +1 -1
  21. package/dist/dispatch.js +7 -4
  22. package/dist/doctor.d.ts +53 -0
  23. package/dist/doctor.js +427 -0
  24. package/dist/evidence-pack.d.ts +1 -1
  25. package/dist/evidence-pack.js +2 -2
  26. package/dist/exec.d.ts +3 -0
  27. package/dist/exec.js +5 -4
  28. package/dist/flow-code.d.ts +2 -2
  29. package/dist/flow-code.js +4 -15
  30. package/dist/flow-engine.js +11 -6
  31. package/dist/flow-triggers.d.ts +8 -4
  32. package/dist/flow-triggers.js +45 -25
  33. package/dist/flow-unattended-words.d.ts +28 -0
  34. package/dist/flow-unattended-words.js +50 -0
  35. package/dist/flow-unattended.d.ts +227 -0
  36. package/dist/flow-unattended.js +776 -0
  37. package/dist/flows-cli.d.ts +28 -1
  38. package/dist/flows-cli.js +55 -10
  39. package/dist/flows-ui.d.ts +2 -1
  40. package/dist/flows-ui.js +4 -1
  41. package/dist/google-mail.d.ts +1 -0
  42. package/dist/google-mail.js +61 -18
  43. package/dist/integrations-ui.d.ts +2 -1
  44. package/dist/integrations-ui.js +6 -3
  45. package/dist/integrations.d.ts +17 -3
  46. package/dist/integrations.js +38 -18
  47. package/dist/invoke.js +300 -168
  48. package/dist/landed-cleanup.d.ts +26 -12
  49. package/dist/landed-cleanup.js +199 -85
  50. package/dist/lead-contract.d.ts +1 -1
  51. package/dist/lead-contract.js +3 -3
  52. package/dist/lead-tools.js +11 -3
  53. package/dist/mcp-connect.d.ts +8 -7
  54. package/dist/mcp-connect.js +49 -51
  55. package/dist/oauth-run-token.d.ts +51 -0
  56. package/dist/oauth-run-token.js +127 -0
  57. package/dist/operate.js +74 -17
  58. package/dist/plan-auto.d.ts +11 -0
  59. package/dist/plan-auto.js +62 -11
  60. package/dist/process-recovery-eligibility.d.ts +1 -1
  61. package/dist/project-access.d.ts +3 -0
  62. package/dist/project-access.js +3 -0
  63. package/dist/project-admission.d.ts +10 -6
  64. package/dist/project-admission.js +33 -11
  65. package/dist/project-delete-ui.d.ts +1 -0
  66. package/dist/project-delete-ui.js +4 -1
  67. package/dist/project-delete.d.ts +3 -1
  68. package/dist/project-delete.js +10 -4
  69. package/dist/project-file.d.ts +3 -0
  70. package/dist/project-file.js +16 -0
  71. package/dist/project-tools.d.ts +99 -25
  72. package/dist/project-tools.js +394 -98
  73. package/dist/provider-home.d.ts +22 -0
  74. package/dist/provider-home.js +99 -0
  75. package/dist/provider.d.ts +17 -3
  76. package/dist/provider.js +34 -10
  77. package/dist/remote-main.d.ts +61 -0
  78. package/dist/remote-main.js +179 -0
  79. package/dist/scope.d.ts +1 -1
  80. package/dist/serve.js +11 -3
  81. package/dist/server/flows.js +27 -5
  82. package/dist/server/render-tasks.d.ts +3 -0
  83. package/dist/server/render-tasks.js +3 -0
  84. package/dist/server/route-table.js +3 -0
  85. package/dist/server/runtime.d.ts +1 -1
  86. package/dist/server/settings.js +14 -5
  87. package/dist/server/task-views.js +2 -0
  88. package/dist/storage-sweep-child.js +3 -1
  89. package/dist/storage-sweep-process.d.ts +14 -0
  90. package/dist/storage-sweep-process.js +37 -3
  91. package/dist/storage-sweep-schedule.d.ts +30 -0
  92. package/dist/storage-sweep-schedule.js +164 -0
  93. package/dist/storage-sweep.d.ts +6 -5
  94. package/dist/storage-sweep.js +10 -70
  95. package/dist/storage-ui.d.ts +2 -0
  96. package/dist/storage-ui.js +7 -4
  97. package/dist/store.d.ts +75 -7
  98. package/dist/store.js +241 -17
  99. package/dist/subagent-tools.d.ts +1 -1
  100. package/dist/surface.js +10 -6
  101. package/dist/task-base.d.ts +35 -0
  102. package/dist/task-base.js +51 -0
  103. package/dist/teardown-git.d.ts +14 -0
  104. package/dist/teardown-git.js +119 -0
  105. package/dist/tool-broker.d.ts +37 -0
  106. package/dist/tool-broker.js +369 -0
  107. package/dist/tool-launcher.js +5 -4
  108. package/dist/tool-secret-store.d.ts +170 -0
  109. package/dist/tool-secret-store.js +834 -0
  110. package/dist/toolroll-update.js +4 -2
  111. package/dist/tools-ui.d.ts +7 -1
  112. package/dist/tools-ui.js +17 -8
  113. package/dist/work-index.js +5 -3
  114. package/dist/worktree.d.ts +64 -6
  115. package/dist/worktree.js +171 -35
  116. package/package.json +3 -1
  117. package/scripts/provider-canary.mjs +210 -31
@@ -1,5 +1,6 @@
1
- import { type ExecResult } from "./exec.js";
1
+ import type { RemoteMainRead, RemoteMains } from "./remote-main.js";
2
2
  import type { Store } from "./store.js";
3
+ import { type Git } from "./teardown-git.js";
3
4
  import { type Runner, type WorktreePool } from "./worktree.js";
4
5
  /** `storage clean --landed` takes only what has waited at least this long. */
5
6
  export declare const BACKLOG_DAYS = 7;
@@ -10,13 +11,16 @@ export declare const LANDED_CLEANED_ACTION = "landed work cleaned up";
10
11
  /** Reconcile looks at most this many results and finishes at most this many items a pass; the pass by hand has no cap. */
11
12
  export declare const AUTO_LOOKS = 20;
12
13
  export declare const AUTO_ITEMS = 40;
13
- export type Git = (cwd: string, args: readonly string[]) => Promise<ExecResult>;
14
+ export type { Git };
15
+ /** Landed cleanup's git, reads and teardown alike: always the hardened teardown helper (teardown-git.ts). */
14
16
  export declare function gitOf(runner?: Runner): Git;
15
17
  export type LandedHow = "merged" | "in-main" | "content-in-main";
18
+ /** `trusted`: it may complete a task automatically (a recorded merge, or the recorded remote's main). */
16
19
  export type LandedProof = {
17
20
  landed: true;
18
21
  how: LandedHow;
19
22
  reason: string;
23
+ trusted: boolean;
20
24
  } | {
21
25
  landed: false;
22
26
  why: string;
@@ -28,10 +32,17 @@ export type PullRequestFact = {
28
32
  number: number | null;
29
33
  };
30
34
  /**
31
- * Whether this commit's work landed, read from what Toolroll recorded and the local repository only. Fails closed:
32
- * every doubt is "not proven", with the reason in a few words.
35
+ * Whether this commit's work landed, read from what Toolroll recorded and the local repository. Fails closed: every
36
+ * doubt is "not proven", with the reason in a few words. Only a recorded merge is trusted to complete a task: a build
37
+ * can write the local main.
33
38
  */
34
39
  export declare function landedProof(git: Git, repo: string, head: string | null, pullRequest?: PullRequestFact | null): Promise<LandedProof>;
40
+ /**
41
+ * The proof automatic completion trusts: a recorded merge of this exact commit, or its work in the main of the
42
+ * project's recorded remote, compared only in the private directory that main was fetched into. `remote` is read only
43
+ * when no recorded merge settles it.
44
+ */
45
+ export declare function remoteLandedProof(remote: () => Promise<RemoteMainRead>, repo: string, head: string | null, pullRequest?: PullRequestFact | null): Promise<LandedProof>;
35
46
  export type LandedTarget = {
36
47
  kind: "checkout" | "branch";
37
48
  target: string;
@@ -54,6 +65,8 @@ export type LandedCandidate = {
54
65
  completes: boolean;
55
66
  how: LandedHow;
56
67
  reason: string;
68
+ /** Proven by a recorded merge or the recorded remote's main: only then may it complete. */
69
+ trusted: boolean;
57
70
  targets: LandedTarget[];
58
71
  keeps: LandedKeep[];
59
72
  };
@@ -62,7 +75,7 @@ export type LandedCandidate = {
62
75
  * `limit` caps how many results are read against git (reconcile's bound; results read before and unchanged since
63
76
  * don't count); `before` takes only results finished before it (the one-time pass's seven days).
64
77
  */
65
- export declare function landedResults(store: Store, git: Git, repo: string, root: string, now: Date, options?: {
78
+ export declare function landedResults(store: Store, git: Git, remotes: RemoteMains, repo: string, root: string, now: Date, options?: {
66
79
  limit?: number;
67
80
  before?: string;
68
81
  memo?: boolean;
@@ -104,9 +117,10 @@ export type LandedStep = {
104
117
  /**
105
118
  * Finish what teardowns intended: pending items, oldest first (checkouts before branches). Each is checked again
106
119
  * right before it goes, and recorded right after. Doubt leaves it pending for the next pass; a branch that moved, or
107
- * a result that has newer work, is kept for good. `only` limits it to these teardowns.
120
+ * a result that has newer work, is kept for good. `limit` caps the items settled (removed, already gone or kept), so
121
+ * items left waiting never crowd out later ones. `only` limits it to these teardowns.
108
122
  */
109
- export declare function finishLanded(store: Store, pool: WorktreePool, git: Git, now: () => Date, options?: {
123
+ export declare function finishLanded(store: Store, pool: WorktreePool, git: Git, remotes: RemoteMains, now: () => Date, options?: {
110
124
  repo?: string;
111
125
  limit?: number;
112
126
  only?: ReadonlySet<number>;
@@ -115,7 +129,7 @@ export declare function finishLanded(store: Store, pool: WorktreePool, git: Git,
115
129
  * Reconcile's part: finish teardowns a crash cut short, then find newly landed results (a bounded few), mark them
116
130
  * complete and tear them down.
117
131
  */
118
- export declare function reconcileLanded(store: Store, pool: WorktreePool, git: Git, repo: string, root: string, now: () => Date): Promise<{
132
+ export declare function reconcileLanded(store: Store, pool: WorktreePool, git: Git, remotes: RemoteMains, repo: string, root: string, now: () => Date): Promise<{
119
133
  completed: string[];
120
134
  steps: LandedStep[];
121
135
  }>;
@@ -142,15 +156,15 @@ export type LandedPlan = {
142
156
  };
143
157
  /**
144
158
  * What `storage clean --landed` would do now, across every project: landed results finished at least a week ago,
145
- * and Toolroll's own branches (toolroll/, toolroll-plan/, standing-orders/) no task uses whose last commit is at
146
- * least a week old and landed in main. Reads only.
159
+ * and branches Toolroll created (toolroll/, toolroll-plan/, standing-orders/) at least a week ago that no task uses
160
+ * and that landed in main. Reads only.
147
161
  */
148
- export declare function landedBacklog(store: Store, git: Git, root: string, now: Date, options?: {
162
+ export declare function landedBacklog(store: Store, git: Git, remotes: RemoteMains, root: string, now: Date, options?: {
149
163
  repos?: readonly string[];
150
164
  }): Promise<LandedPlan>;
151
165
  /** Act on a preview: record every teardown first, then carry them out. Refuses nothing it previewed silently: what
152
166
  * changed since is reported as kept. */
153
- export declare function cleanLandedBacklog(store: Store, pool: WorktreePool, git: Git, root: string, now: () => Date, plan: LandedPlan, actor: string): Promise<{
167
+ export declare function cleanLandedBacklog(store: Store, pool: WorktreePool, git: Git, remotes: RemoteMains, root: string, now: () => Date, plan: LandedPlan, actor: string): Promise<{
154
168
  completed: string[];
155
169
  steps: LandedStep[];
156
170
  refused: LandedKeep[];