@stringsync/splates 0.0.0-stage → 0.0.45

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 (251) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +308 -2
  3. package/acp-extensions.d.ts +82 -0
  4. package/add.d.ts +53 -0
  5. package/adherence.d.ts +49 -0
  6. package/age.d.ts +2 -0
  7. package/agent-connection.d.ts +171 -0
  8. package/agent-errors.d.ts +2 -0
  9. package/agent-process.d.ts +65 -0
  10. package/agent-stream.d.ts +91 -0
  11. package/agents.d.ts +15 -0
  12. package/artifact-room.d.ts +47 -0
  13. package/artifact-viewers.d.ts +6 -0
  14. package/artifact.d.ts +30 -0
  15. package/artifacts.d.ts +161 -0
  16. package/asked.d.ts +146 -0
  17. package/asked.js +7 -0
  18. package/assumed.d.ts +34 -0
  19. package/attach.d.ts +30 -0
  20. package/attachments.d.ts +43 -0
  21. package/baselines.d.ts +55 -0
  22. package/claim.d.ts +17 -0
  23. package/cloudflare-api.d.ts +25 -0
  24. package/cloudflare-error.d.ts +5 -0
  25. package/cloudflared-tunnel-provider.d.ts +27 -0
  26. package/codex-limits.d.ts +19 -0
  27. package/compaction.d.ts +17 -0
  28. package/config-source.d.ts +13 -0
  29. package/config.d.ts +98 -0
  30. package/config.js +7 -0
  31. package/conversation-archive.d.ts +6 -0
  32. package/conversation-background.d.ts +21 -0
  33. package/conversation-choice.d.ts +4 -0
  34. package/conversation-files.d.ts +51 -0
  35. package/conversation-given.d.ts +8 -0
  36. package/conversation-host.d.ts +102 -0
  37. package/conversation-listing.d.ts +15 -0
  38. package/conversation-log.d.ts +301 -0
  39. package/conversation-messages.d.ts +18 -0
  40. package/conversation-name.d.ts +28 -0
  41. package/conversation-options.d.ts +73 -0
  42. package/conversation-reference.d.ts +2 -0
  43. package/conversation-state.d.ts +472 -0
  44. package/conversation-turns.d.ts +115 -0
  45. package/conversation.d.ts +209 -0
  46. package/conversations.d.ts +140 -0
  47. package/coordinator-state.d.ts +28 -0
  48. package/creds.d.ts +123 -0
  49. package/darwin-temperature.d.ts +7 -0
  50. package/decided.d.ts +18 -0
  51. package/demo.d.ts +29 -0
  52. package/dev/api.d.ts +209 -0
  53. package/dev/assets.d.ts +24 -0
  54. package/dev/conversation-address.d.ts +47 -0
  55. package/dev/conversation-feed.d.ts +166 -0
  56. package/dev/live-stream.d.ts +29 -0
  57. package/dev/worker.d.ts +33 -0
  58. package/dev-access.d.ts +61 -0
  59. package/dev-artifacts.d.ts +22 -0
  60. package/dev-budgets.d.ts +18 -0
  61. package/dev-conversation-events.d.ts +39 -0
  62. package/dev-conversation-routes.d.ts +90 -0
  63. package/dev-creds.d.ts +17 -0
  64. package/dev-dictation-connection.d.ts +18 -0
  65. package/dev-dictation.d.ts +17 -0
  66. package/dev-http.d.ts +76 -0
  67. package/dev-open.d.ts +15 -0
  68. package/dev-options.d.ts +133 -0
  69. package/dev-outcomes.d.ts +21 -0
  70. package/dev-pages.d.ts +16 -0
  71. package/dev-picker.d.ts +57 -0
  72. package/dev-port-socket.d.ts +26 -0
  73. package/dev-ports.d.ts +11 -0
  74. package/dev-project-watch.d.ts +44 -0
  75. package/dev-project.d.ts +168 -0
  76. package/dev-push.d.ts +59 -0
  77. package/dev-restart.d.ts +141 -0
  78. package/dev-servers.d.ts +30 -0
  79. package/dev-setup-native.d.ts +23 -0
  80. package/dev-setup-opencode.d.ts +29 -0
  81. package/dev-setup.d.ts +16 -0
  82. package/dev-shell.d.ts +70 -0
  83. package/dev-slot.d.ts +28 -0
  84. package/dev-sockets.d.ts +13 -0
  85. package/dev-task-ports.d.ts +73 -0
  86. package/dev-tasks.d.ts +20 -0
  87. package/dev-terminal-connection.d.ts +19 -0
  88. package/dev-terminal.d.ts +42 -0
  89. package/dev-todos.d.ts +35 -0
  90. package/dev-transcriber.d.ts +15 -0
  91. package/dev-tunnel.d.ts +38 -0
  92. package/dev-versions.d.ts +53 -0
  93. package/dev-workers.d.ts +55 -0
  94. package/dev.d.ts +24 -0
  95. package/diff.d.ts +29 -0
  96. package/dispatched.d.ts +16 -0
  97. package/editors.d.ts +22 -0
  98. package/escalate.d.ts +27 -0
  99. package/events.d.ts +311 -0
  100. package/everywhere.d.ts +41 -0
  101. package/exhibit.d.ts +21 -0
  102. package/exit.d.ts +54 -0
  103. package/fact-todos.d.ts +18 -0
  104. package/fake-agent.d.ts +107 -0
  105. package/fake-agent.js +284 -0
  106. package/finding-facts.d.ts +38 -0
  107. package/findings.d.ts +84 -0
  108. package/fold.d.ts +43 -0
  109. package/follow.d.ts +41 -0
  110. package/format.d.ts +68 -0
  111. package/git.d.ts +112 -0
  112. package/handed-out.d.ts +79 -0
  113. package/handoff.d.ts +23 -0
  114. package/heavy-run.d.ts +12 -0
  115. package/heavy.d.ts +28 -0
  116. package/heavy.js +16 -0
  117. package/held.d.ts +22 -0
  118. package/index-0tfvy823.js +272 -0
  119. package/index-43pq33n4.js +157 -0
  120. package/index-4776671w.js +698 -0
  121. package/index-d4hjrzaq.js +464 -0
  122. package/index-gcfq7awr.js +740 -0
  123. package/index-k73tsw5g.js +101 -0
  124. package/index-kaa44k7q.js +59 -0
  125. package/index-vcv9m93e.js +1265 -0
  126. package/index-xmfmy729.js +249 -0
  127. package/index.d.ts +2 -0
  128. package/index.js +26928 -0
  129. package/init.d.ts +28 -0
  130. package/journal.d.ts +57 -0
  131. package/landed.d.ts +14 -0
  132. package/lane-todos.d.ts +44 -0
  133. package/lane.d.ts +55 -0
  134. package/lanes-from-tags.d.ts +17 -0
  135. package/lanes.d.ts +96 -0
  136. package/legacy-names.d.ts +70 -0
  137. package/legacy-ps.d.ts +31 -0
  138. package/limits.d.ts +32 -0
  139. package/list.d.ts +18 -0
  140. package/load-config.d.ts +44 -0
  141. package/log.d.ts +14 -0
  142. package/machine.d.ts +42 -0
  143. package/merge.d.ts +35 -0
  144. package/migrate-config.d.ts +31 -0
  145. package/models.d.ts +24 -0
  146. package/needs.d.ts +115 -0
  147. package/notices.d.ts +39 -0
  148. package/offered.d.ts +39 -0
  149. package/opencode-usage.d.ts +37 -0
  150. package/outcomes.d.ts +114 -0
  151. package/package.json +74 -5
  152. package/path.d.ts +13 -0
  153. package/plan.d.ts +236 -0
  154. package/port-forward.d.ts +22 -0
  155. package/port-pipe.d.ts +36 -0
  156. package/ports-list.d.ts +19 -0
  157. package/probe-runtime.d.ts +5 -0
  158. package/probe-runtime.js +13 -0
  159. package/project-reaches.d.ts +23 -0
  160. package/projects.d.ts +136 -0
  161. package/prompts.d.ts +128 -0
  162. package/pty.d.ts +39 -0
  163. package/pulse.d.ts +8 -0
  164. package/recommend.d.ts +31 -0
  165. package/release.d.ts +41 -0
  166. package/remote-process.d.ts +26 -0
  167. package/remote-pty.d.ts +29 -0
  168. package/remote-worker.d.ts +77 -0
  169. package/remove.d.ts +31 -0
  170. package/repository.d.ts +91 -0
  171. package/retry.d.ts +34 -0
  172. package/roster.d.ts +63 -0
  173. package/saved-ports-host.d.ts +25 -0
  174. package/saved-tunnel.d.ts +44 -0
  175. package/server-worker-socket.d.ts +21 -0
  176. package/setup-areas.d.ts +7 -0
  177. package/setup-opencode-model-error.d.ts +3 -0
  178. package/setup-opencode-models.d.ts +54 -0
  179. package/setup-opencode-recipe.d.ts +26 -0
  180. package/setup-opencode.d.ts +46 -0
  181. package/setup.d.ts +102 -0
  182. package/shared-browser.d.ts +50 -0
  183. package/shell.d.ts +17 -0
  184. package/show.d.ts +106 -0
  185. package/skill-checks.d.ts +73 -0
  186. package/skill-checks.js +10 -0
  187. package/skills.d.ts +16 -0
  188. package/slot-tunnel.d.ts +27 -0
  189. package/slots.d.ts +135 -0
  190. package/snapshot.d.ts +75 -0
  191. package/splates-artifact.d.ts +3 -0
  192. package/splates-creds.d.ts +3 -0
  193. package/splates-dev.d.ts +22 -0
  194. package/splates-flags.d.ts +34 -0
  195. package/splates-lane.d.ts +3 -0
  196. package/splates-projects.d.ts +3 -0
  197. package/splates-setup.d.ts +17 -0
  198. package/splates-slots.d.ts +3 -0
  199. package/splates-todo.d.ts +3 -0
  200. package/splates-tunnel.d.ts +3 -0
  201. package/splates-worker.d.ts +3 -0
  202. package/splates.d.ts +28 -0
  203. package/stats.d.ts +186 -0
  204. package/supervise.d.ts +50 -0
  205. package/system-changes.d.ts +67 -0
  206. package/system.d.ts +28 -0
  207. package/systems.d.ts +119 -0
  208. package/systems.js +21 -0
  209. package/table.d.ts +5 -0
  210. package/task-log.d.ts +35 -0
  211. package/task-ports.d.ts +25 -0
  212. package/tell.d.ts +47 -0
  213. package/todo-edit.d.ts +60 -0
  214. package/todo-file.d.ts +6 -0
  215. package/todo-lanes.d.ts +82 -0
  216. package/todo-list.d.ts +26 -0
  217. package/todo-take.d.ts +27 -0
  218. package/todo.d.ts +146 -0
  219. package/todos.d.ts +157 -0
  220. package/tool-calls.d.ts +18 -0
  221. package/tunnel-provider.d.ts +37 -0
  222. package/tunnel-provider.js +0 -0
  223. package/tunnel-remove.d.ts +28 -0
  224. package/tunnel-setup.d.ts +104 -0
  225. package/unix-worker-listener.d.ts +23 -0
  226. package/unix-worker-socket.d.ts +30 -0
  227. package/update.d.ts +29 -0
  228. package/update.js +10 -0
  229. package/vocabulary.d.ts +9 -0
  230. package/wait.d.ts +36 -0
  231. package/watch.d.ts +46 -0
  232. package/watched.d.ts +43 -0
  233. package/websocket-worker-socket.d.ts +18 -0
  234. package/worker-call-host.d.ts +51 -0
  235. package/worker-channel.d.ts +83 -0
  236. package/worker-connection.d.ts +24 -0
  237. package/worker-daemon.d.ts +64 -0
  238. package/worker-git.d.ts +18 -0
  239. package/worker-list.d.ts +49 -0
  240. package/worker-machine.d.ts +34 -0
  241. package/worker-port-host.d.ts +21 -0
  242. package/worker-process-host.d.ts +29 -0
  243. package/worker-protocol.d.ts +104 -0
  244. package/worker-pty-host.d.ts +34 -0
  245. package/worker-registry.d.ts +68 -0
  246. package/worker-replay.d.ts +25 -0
  247. package/worker-run.d.ts +20 -0
  248. package/worker-session.d.ts +189 -0
  249. package/worker-socket.d.ts +15 -0
  250. package/worktree-service.d.ts +113 -0
  251. package/worktree.d.ts +232 -0
package/worktree.d.ts ADDED
@@ -0,0 +1,232 @@
1
+ import { type FileDiff } from "./diff.js";
2
+ import type { GitResult } from "./git.js";
3
+ import type { WorktreeService } from "./worktree-service.js";
4
+ /**
5
+ * One task, whether or not it is still there. Commands ask the service for
6
+ * one of these and read its status rather than assembling the same handful of
7
+ * existence checks themselves.
8
+ */
9
+ export declare class Worktree {
10
+ private readonly service;
11
+ private readonly snapshot;
12
+ constructor(service: WorktreeService, snapshot: WorktreeSnapshot);
13
+ get task(): string;
14
+ get branch(): string;
15
+ /** Where this task's work lands: its recorded base branch, else trunk. */
16
+ get base(): string;
17
+ /** The conversation whose agent added the task, or null. */
18
+ get caller(): string | null;
19
+ get path(): string;
20
+ get state(): TaskState | null;
21
+ get lease(): LeaseState | null;
22
+ /** The `splates server` conversation whose agent last took the task, or null. */
23
+ get takenBy(): string | null;
24
+ get leaseHeld(): boolean;
25
+ get leaseStatus(): "held" | "stale" | "none";
26
+ get leaseOurs(): boolean;
27
+ get leaseHeldByOther(): boolean;
28
+ get mergeAttempts(): number;
29
+ /** How many merge attempts a task gets before `merge` stops on `budget_exhausted`. */
30
+ get mergeAttemptLimit(): number;
31
+ get exists(): boolean;
32
+ get hasBranch(): boolean;
33
+ get removedAt(): string | null;
34
+ get status(): WorktreeStatus;
35
+ get gone(): boolean;
36
+ /**
37
+ * Merges changes into the record and writes it. Works on a name that has no
38
+ * record yet, which is how `add` writes the first one and how `claim`
39
+ * rebuilds one from a worktree found on disk.
40
+ */
41
+ save(changes?: Partial<TaskState>): Promise<Worktree>;
42
+ take(changes?: Partial<TaskState>): Promise<Worktree>;
43
+ /** Re-reads from disk. `merge` needs this: the record is the truth. */
44
+ reload(): Promise<Worktree>;
45
+ /**
46
+ * Removes the directory, the branch, and the record; remembers the name,
47
+ * and how the task ended.
48
+ */
49
+ discard(ended: "merged" | "removed", opts?: DiscardOptions): Promise<GitResult>;
50
+ /** The message of each commit it has that its base does not, oldest first. */
51
+ commitMessages(): Promise<string[] | null>;
52
+ commitsAhead(): Promise<number | null>;
53
+ /** Files and lines across all its pending work, as `diff` shows it; null without a branch. */
54
+ size(): Promise<DiffSize | null>;
55
+ /**
56
+ * Its committed and uncommitted changes, new files among them, parsed;
57
+ * null without a branch.
58
+ */
59
+ diff(): Promise<FileDiff[] | null>;
60
+ /** Committed and uncommitted paths this task touches; null without a branch. */
61
+ changedFiles(): Promise<string[] | null>;
62
+ uncommitted(): Promise<string[]>;
63
+ /** When its branch's latest commit was made, or null without a branch. */
64
+ committedAt(): Promise<string | null>;
65
+ interruptedOps(): Promise<string[]>;
66
+ }
67
+ export interface DiscardOptions {
68
+ /**
69
+ * The `splates server` conversation working on it, when ended from the page
70
+ * rather than by the agent, whose env names it.
71
+ */
72
+ conversation?: string;
73
+ /**
74
+ * The repo-relative paths the task changed, for a merge, which reads them
75
+ * before landing leaves nothing between the branch and its base. Read
76
+ * from the branch when not given.
77
+ */
78
+ changed?: string[];
79
+ /**
80
+ * The message of each commit a merge lands, read before landing as
81
+ * `changed` is.
82
+ */
83
+ commits?: string[];
84
+ /** Why it was removed, as `splates remove --reason` gives it. */
85
+ reason?: RemoveReason;
86
+ /** What a merge lands, read before landing as `changed` is. */
87
+ size?: DiffSize;
88
+ }
89
+ /** How big a change is, as its diff counts it. */
90
+ export interface DiffSize {
91
+ files: number;
92
+ added: number;
93
+ removed: number;
94
+ }
95
+ /** Why a task can be removed rather than merged, as `--reason` names it. */
96
+ export declare const REMOVE_REASONS: readonly ["nothing", "moot", "superseded", "redo"];
97
+ /** Why a task was removed rather than merged. */
98
+ export type RemoveReason = (typeof REMOVE_REASONS)[number];
99
+ /** The status a task's own record carries. */
100
+ export type RecordStatus = "working" | "merging" | "escalated";
101
+ /** What a task's record stores about who is driving it. */
102
+ export interface LeaseState {
103
+ pid: number;
104
+ hostname: string;
105
+ heartbeatAt: string;
106
+ /**
107
+ * The `splates server` conversation whose agent took it, or its caller's for a
108
+ * subagent; absent for an agent outside the page, and in older records.
109
+ */
110
+ conversation?: string;
111
+ }
112
+ export interface Escalation {
113
+ reason: string;
114
+ at: string;
115
+ /**
116
+ * Set for a task handed over to be approved rather than to answer
117
+ * questions, the reason saying what to look at.
118
+ */
119
+ review?: true | string;
120
+ /**
121
+ * When `claim` took the task back up, ending the wait on a person; absent
122
+ * while it waits, and in records from before it was kept.
123
+ */
124
+ resumedAt?: string;
125
+ }
126
+ /** Why a merge failed, as `merge` refuses it. */
127
+ export type MergeFailure = "conflict" | "tests_failed" | "merge_failed";
128
+ /** A test the gate named as failing, and what it said, as far as the runner printed. */
129
+ export interface FailedTest {
130
+ name: string;
131
+ message: string;
132
+ }
133
+ /** One time `merge` turned a task away, and what it said of why. */
134
+ export interface GateFailure {
135
+ reason: MergeFailure | "budget_exhausted";
136
+ at: string;
137
+ /** The files the rebase conflicted in, for a conflict. */
138
+ files?: string[];
139
+ /** What git said, for a conflict that named no file: why the rebase failed. */
140
+ output?: string;
141
+ /** The tests the gate named as failing, for `tests_failed`. */
142
+ tests?: string[];
143
+ /** Those tests with what each said, for `tests_failed`. Absent in old records. */
144
+ failures?: FailedTest[];
145
+ /** What git said, for `merge_failed`. */
146
+ error?: string;
147
+ }
148
+ export interface TaskState {
149
+ task: string;
150
+ branch: string;
151
+ worktree: string;
152
+ /** The branch this task lands on. Absent in old records: trunk. */
153
+ base?: string;
154
+ status: RecordStatus;
155
+ lease: LeaseState | null;
156
+ mergeAttempts: number;
157
+ /**
158
+ * Every merge that failed, which `retry` leaves alone while it hands back
159
+ * the attempts. Absent in old records: none counted yet.
160
+ */
161
+ mergeFailures?: number;
162
+ /** `mergeFailures` by why each failed. Absent in old records. */
163
+ mergeFailuresBy?: Partial<Record<MergeFailure, number>>;
164
+ /**
165
+ * Each time the gate turned it away, oldest first, with what it named:
166
+ * every failed merge, and each refusal once its attempts ran out. Absent in
167
+ * old records.
168
+ */
169
+ gateFailures?: GateFailure[];
170
+ /** How many times `splates retry` granted it more attempts. Absent in old records. */
171
+ retries?: number;
172
+ createdAt: string;
173
+ updatedAt: string;
174
+ escalations?: Escalation[];
175
+ /**
176
+ * The agent `splates add --agent` or `splates handoff` handed the task to, for
177
+ * `splates server` to start.
178
+ */
179
+ dispatch?: Dispatched;
180
+ /**
181
+ * The `splates server` conversation whose agent added the task, which the page
182
+ * nests it under. Absent for one added outside a conversation, or before
183
+ * tasks remembered it.
184
+ */
185
+ caller?: string;
186
+ }
187
+ /**
188
+ * Who `splates add --agent` or `splates handoff` handed a task to. `splates server` starts the agent in
189
+ * the task's tree and writes down the conversation it started, so it starts
190
+ * once.
191
+ */
192
+ export interface Dispatched {
193
+ agent: string;
194
+ /** The model to pick, by the session's model setting; absent, the agent's own. */
195
+ model?: string;
196
+ /** What the agent is told beyond claiming the task. */
197
+ prompt?: string;
198
+ /** The conversation `splates server` started, once it has. */
199
+ conversation?: string;
200
+ /**
201
+ * Set while the postCheckout hook readies the tree; `splates server` starts the
202
+ * agent once it clears.
203
+ */
204
+ pending?: true;
205
+ /**
206
+ * Set when the agent at work on the task handed it on with `splates
207
+ * handoff`, so the one started is told `[SPLATES HANDOFF <task>]`.
208
+ */
209
+ handoff?: true;
210
+ /**
211
+ * Whether the agent started answers to the task's caller rather than the
212
+ * person, as for `splates handoff --relay`. Absent in records written
213
+ * before it was kept, when a handoff with a caller always relayed.
214
+ */
215
+ relay?: boolean;
216
+ }
217
+ /**
218
+ * Everything a name can turn out to be. The record's own status when the
219
+ * task is intact, and otherwise the way in which it is not.
220
+ */
221
+ export type WorktreeStatus = RecordStatus | "absent" | "removed" | "orphaned" | "stray" | "unrecorded" | "unknown";
222
+ /** What the service found on disk. */
223
+ export interface WorktreeSnapshot {
224
+ task: string;
225
+ branch: string;
226
+ path: string;
227
+ state: TaskState | null;
228
+ exists: boolean;
229
+ hasBranch: boolean;
230
+ removedAt: string | null;
231
+ corrupt: boolean;
232
+ }