@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/events.d.ts ADDED
@@ -0,0 +1,311 @@
1
+ import type { Question } from "./plan.js";
2
+ import type { FailedTest, RemoveReason } from "./worktree.js";
3
+ /** An escalation that went through, which asks the person to act. */
4
+ export type Escalated = Extract<Event, {
5
+ action: "escalate";
6
+ reason: null;
7
+ }>;
8
+ /** Whether `event` is an escalation that went through. */
9
+ export declare function isEscalation(event: Event): event is Escalated;
10
+ /**
11
+ * What each action's event says beyond what every event does, keyed by the
12
+ * action as `splates log` names it. An action with nothing of its own yet maps
13
+ * to `None`: each slice of the Splates events lane fills in its command's.
14
+ */
15
+ export interface Facts {
16
+ add: {
17
+ /** The branch the task starts from and merges onto. */
18
+ base: string;
19
+ /** The todos it took, by id. */
20
+ todos: number[];
21
+ /** What `--goal` said done means, or null when the todos seed the Goal. */
22
+ goal: string | null;
23
+ /** The subjects of the todos it took, in order, which seed its Goal. */
24
+ subjects: string[];
25
+ /** The agent it was handed to, or null when this conversation keeps it. */
26
+ agent: string | null;
27
+ /** That agent's model, or null for its own default or no agent. */
28
+ model: string | null;
29
+ };
30
+ claim: {
31
+ /** Whether the task was escalated, so the claim ends a wait on the user. */
32
+ escalated: boolean;
33
+ /**
34
+ * Whether the agent claiming is the one the task was handed to with
35
+ * `splates handoff`, taking it over.
36
+ */
37
+ tookOver: boolean;
38
+ /** What its `SPLATES.md` says done means, as markdown, or "" for nothing yet. */
39
+ goal: string;
40
+ };
41
+ tell: {
42
+ /**
43
+ * The conversation it was said in, the agent the task was handed to. The
44
+ * sender is the event's own `conversation`. The page shows it as no line
45
+ * of its own: the receiving message says where it came from.
46
+ */
47
+ to: string;
48
+ };
49
+ /** A wait on a task, the event's own: see `Waiting`. */
50
+ wait: Waiting;
51
+ merge: {
52
+ /** The branch it landed on, or was refused landing on. */
53
+ base: string;
54
+ /** The commit the base reached, short. */
55
+ commit: string;
56
+ /**
57
+ * What it touched when it landed, or the files the rebase conflicted in
58
+ * when refused for a conflict. Empty when a refusal names none.
59
+ */
60
+ files: string[];
61
+ /** The merge attempts it has left. */
62
+ attemptsLeft: number;
63
+ /**
64
+ * The tests the gate named as failing when refused for `tests_failed`,
65
+ * with what each said, so the log shows which ones fail most and why.
66
+ * Empty when the runner named none.
67
+ */
68
+ failedTests: FailedTest[];
69
+ };
70
+ remove: {
71
+ /** The `--reason` it gave, or null when it gave none. */
72
+ why: RemoveReason | null;
73
+ /** The todos it put back on the list, by id and subject. */
74
+ released: {
75
+ id: number;
76
+ subject: string;
77
+ }[];
78
+ };
79
+ escalate: {
80
+ /** Why it needs the person, or for a review, what to look at. */
81
+ about: string;
82
+ /** Whether it asks the person to approve merging, not to answer. */
83
+ review: boolean;
84
+ /** Where it merges once done. */
85
+ base: string;
86
+ /**
87
+ * Its open questions under `## Blocked` as they stood, which the card
88
+ * asks: a report never follows the task afterwards.
89
+ */
90
+ questions: Question[];
91
+ };
92
+ handoff: {
93
+ /** The roster agent it went to, by its id. */
94
+ agent: string;
95
+ /** Its model, by the id the roster gives it, or null for the agent's own. */
96
+ model: string | null;
97
+ /** Whether the agent answers to the conversation that handed it on. */
98
+ relay: boolean;
99
+ };
100
+ attach: {
101
+ /** The paths it stored, in the order given. */
102
+ stored: string[];
103
+ /** What `--remove` named to drop, each by path or stored name. */
104
+ removed: string[];
105
+ };
106
+ "artifact add": {
107
+ /** The artifact, by name. */
108
+ name: string;
109
+ /** The version it made. */
110
+ version: number;
111
+ /** That version's size. */
112
+ bytes: number;
113
+ };
114
+ "artifact remove": {
115
+ /** The artifact, by name. */
116
+ name: string;
117
+ /** The version that was current. */
118
+ version: number;
119
+ };
120
+ retry: {
121
+ /** The merge attempts the task had spent, which the grant gives it more of. */
122
+ attempts: number;
123
+ };
124
+ "todo add": {
125
+ /** The todo it added, by id. */
126
+ todo: number;
127
+ /** Its line, as the page names it. */
128
+ subject: string;
129
+ /** The lane it went in, or null when it went in none. */
130
+ lane: number | null;
131
+ /** Where it went in the list, 1 at the top. */
132
+ position: number;
133
+ };
134
+ "todo update": {
135
+ /** The todo, by id. */
136
+ todo: number;
137
+ /** Its subject once updated, so a line names it though it was reworded. */
138
+ subject: string;
139
+ /** Only what moved: a key is absent when its part stayed as it was. */
140
+ changed: {
141
+ /** The new subject. */
142
+ subject?: string;
143
+ /** Whether its detail was rewritten. */
144
+ text?: true;
145
+ /** Where it moved to in the list, 1 at the top. */
146
+ position?: number;
147
+ /** The lane it moved to, null for none. */
148
+ lane?: number | null;
149
+ /** Todos it is now blocked by. */
150
+ blocked?: number[];
151
+ /** Todos that no longer block it. */
152
+ unblocked?: number[];
153
+ /** Names of the files attached. */
154
+ attached?: string[];
155
+ /** Names of the files dropped. */
156
+ detached?: string[];
157
+ /** The agent and model it now names, null once it names none. */
158
+ assignee?: {
159
+ agent: string;
160
+ model?: string;
161
+ } | null;
162
+ };
163
+ };
164
+ "todo take": TodosFacts;
165
+ "todo wait": Waiting & {
166
+ /** The todo, by id. */
167
+ todo: number;
168
+ /** Its subject as the wait began, or null for a todo there is no such thing as. */
169
+ subject: string | null;
170
+ };
171
+ "todo release": TodosFacts;
172
+ "todo remove": TodosFacts;
173
+ "lane add": {
174
+ /** The lane it started, by number. */
175
+ lane: number;
176
+ /** Its name. */
177
+ name: string;
178
+ };
179
+ "lane update": {
180
+ /** The lane, by number. */
181
+ lane: number;
182
+ /** Its name once updated, so a line names it though it was renamed. */
183
+ name: string;
184
+ /** Only what changed: a key is absent when it stayed as it was. */
185
+ changed: {
186
+ /** The new name. */
187
+ name?: string;
188
+ /** Where it moved to among the lanes, 1 the first column. */
189
+ position?: number;
190
+ };
191
+ };
192
+ "lane remove": {
193
+ /** The lane, by the number it had. */
194
+ lane: number;
195
+ /** Its name. */
196
+ name: string;
197
+ /** The todos it held, now in no lane. */
198
+ todos: number[];
199
+ };
200
+ "lane join": None;
201
+ "creds request": {
202
+ /** The cred asked for, as its environment variable. */
203
+ name: string;
204
+ /** Whether it asked, rather than finding the cred already kept. */
205
+ asked: boolean;
206
+ };
207
+ "creds save": None;
208
+ "creds remove": None;
209
+ "creds dismiss": None;
210
+ "creds wait": Waiting & {
211
+ /** The cred waited for, by name. */
212
+ name: string;
213
+ };
214
+ "tunnel setup": None;
215
+ "tunnel remove": None;
216
+ }
217
+ type None = Record<never, never>;
218
+ /**
219
+ * A wait the page counts down: its start shows a line that runs until `until`,
220
+ * and its end says how the wait went, pointing back at its start with `began`.
221
+ */
222
+ export interface Waiting {
223
+ /** When it gives up, as an ISO time. */
224
+ until: string;
225
+ /** The id of the event it began with, on the one it ends with; null on that first. */
226
+ began: string | null;
227
+ }
228
+ /** The todos a command took, released or removed, as they were named then. */
229
+ interface TodosFacts {
230
+ todos: {
231
+ id: number;
232
+ subject: string;
233
+ }[];
234
+ }
235
+ export type Action = keyof Facts;
236
+ /**
237
+ * Each action's facts by name, as its event records them now: the journal
238
+ * reads an event only when it carries all of them, and none of an action
239
+ * missing here.
240
+ */
241
+ export declare const FACTS: {
242
+ readonly add: readonly ["base", "todos", "goal", "subjects", "agent", "model"];
243
+ readonly claim: readonly ["escalated", "tookOver", "goal"];
244
+ readonly tell: readonly ["to"];
245
+ readonly wait: readonly ["until", "began"];
246
+ readonly merge: readonly ["base", "commit", "files", "attemptsLeft", "failedTests"];
247
+ readonly remove: readonly ["why", "released"];
248
+ readonly escalate: readonly ["about", "review", "base", "questions"];
249
+ readonly handoff: readonly ["agent", "model", "relay"];
250
+ readonly attach: readonly ["stored", "removed"];
251
+ readonly "artifact add": readonly ["name", "version", "bytes"];
252
+ readonly "artifact remove": readonly ["name", "version"];
253
+ readonly retry: readonly ["attempts"];
254
+ readonly "todo add": readonly ["todo", "subject", "lane", "position"];
255
+ readonly "todo update": readonly ["todo", "subject", "changed"];
256
+ readonly "todo take": readonly ["todos"];
257
+ readonly "todo wait": readonly ["until", "began", "todo", "subject"];
258
+ readonly "todo release": readonly ["todos"];
259
+ readonly "todo remove": readonly ["todos"];
260
+ readonly "lane add": readonly ["lane", "name"];
261
+ readonly "lane update": readonly ["lane", "name", "changed"];
262
+ readonly "lane remove": readonly ["lane", "name", "todos"];
263
+ readonly "lane join": readonly [];
264
+ readonly "creds request": readonly ["name", "asked"];
265
+ readonly "creds save": readonly [];
266
+ readonly "creds remove": readonly [];
267
+ readonly "creds dismiss": readonly [];
268
+ readonly "creds wait": readonly ["until", "began", "name"];
269
+ readonly "tunnel setup": readonly [];
270
+ readonly "tunnel remove": readonly [];
271
+ };
272
+ /**
273
+ * Whether `event` carries every fact its action records now. One that went
274
+ * through before its action recorded them all does not, and nor does one
275
+ * logged by a newer splates for an action this one does not know.
276
+ */
277
+ export declare function isCurrent(event: Event): boolean;
278
+ /** What every event carries, whatever its action. */
279
+ interface Common<A extends Action> {
280
+ /** Its own, so a reader following the log takes each event once. */
281
+ id: string;
282
+ at: string;
283
+ action: A;
284
+ /** The task it was about, or null when the command names none. */
285
+ task: string | null;
286
+ /** The refusal reason, or null when the command succeeded. */
287
+ reason: string | null;
288
+ /**
289
+ * The `splates server` conversation that ran it, so the page can show it there,
290
+ * or null for an external agent or the page itself.
291
+ */
292
+ conversation: string | null;
293
+ }
294
+ /**
295
+ * One thing that was done, and how it went. A refused command carries only
296
+ * the facts it was asked with, since it never got to learn the rest.
297
+ */
298
+ export type Event = {
299
+ [A in Action]: (Common<A> & {
300
+ reason: null;
301
+ } & Facts[A]) | (Common<A> & {
302
+ reason: string;
303
+ } & Partial<Facts[A]>);
304
+ }[Action];
305
+ /**
306
+ * What `ctx.journal.record` takes for an action's facts: a value, for what the
307
+ * command was asked with, kept even when it is refused, or a function of what
308
+ * it returned, kept only on success. An action with no facts takes none.
309
+ */
310
+ export type FactsOf<A extends Action, T> = keyof Facts[A] extends never ? [] : [facts: Facts[A] | ((out: T) => Facts[A])];
311
+ export {};
@@ -0,0 +1,41 @@
1
+ import type { Conversation, Conversations } from "./conversations.js";
2
+ import type { Served } from "./dev-project.js";
3
+ import type { Projects } from "./projects.js";
4
+ /**
5
+ * The conversations of every project `splates server` serves, so a conversation
6
+ * that handed out a task in another project than its own hears of, and
7
+ * answers for, the agent it handed it to, as it would one in its own.
8
+ */
9
+ export declare class Everywhere {
10
+ private readonly placing;
11
+ /** Only the conversations of the project at `root`, as a server of one has them. */
12
+ static onlyHere(root: string, conversations: Conversations): Everywhere;
13
+ /**
14
+ * The conversations of each project in `served`, by its root, those that
15
+ * failed to open left out, each named as `projects` names it.
16
+ */
17
+ static served(served: Map<string, Promise<Served>>, projects: Projects): Everywhere;
18
+ constructor(placing: Placing);
19
+ /** Every conversation of every project served so far, with its project's main tree. */
20
+ list(): Promise<Placed[]>;
21
+ /** The conversation `id`, of whichever project holds it, or undefined for none. */
22
+ find(id: string): Promise<Placed | undefined>;
23
+ /**
24
+ * How a directive names `task`, of the project at `root`, to a
25
+ * conversation of the project at `to`: bare in its own, else
26
+ * `<slug>/<task>`, which `splates --project <slug>` reaches.
27
+ */
28
+ taskNamed(task: string, root: string, to: string): Promise<string>;
29
+ }
30
+ /** A conversation, and the main tree of the project it is in. */
31
+ export interface Placed {
32
+ conversation: Conversation;
33
+ root: string;
34
+ }
35
+ /** Where `Everywhere` finds the conversations, and the projects' names. */
36
+ export interface Placing {
37
+ /** Every conversation of every project served so far. */
38
+ list(): Promise<Placed[]>;
39
+ /** What the registry names the project at `root` by. */
40
+ slug(root: string): Promise<string>;
41
+ }
package/exhibit.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Something to look at that the skill captions with the one or two calls it
3
+ * shows, as a reply writes it under `### 🖼️ <title>`: a screenshot, a
4
+ * diagram or a snippet.
5
+ */
6
+ export interface Exhibit {
7
+ /** What it shows, from its heading. */
8
+ title: string;
9
+ /** The screenshot, diagram or snippet, as markdown. */
10
+ body: string;
11
+ }
12
+ /** What the exhibit titled by `line` shows; null for any other line. */
13
+ export declare function exhibitTitle(line: string): string | null;
14
+ /**
15
+ * An assumption's `body` parted into what is to look at, its images and code
16
+ * blocks, as markdown, null when it holds neither, and the words around them.
17
+ */
18
+ export declare function shownIn(body: string): {
19
+ shown: string | null;
20
+ said: string;
21
+ };
package/exit.d.ts ADDED
@@ -0,0 +1,54 @@
1
+ import type { Deps, Middleware } from "webappwiz/cmd";
2
+ /** Exit codes are the API: an agent branches on these, not on prose. */
3
+ export declare const EXIT: {
4
+ readonly usage: 1;
5
+ readonly conflict: 2;
6
+ readonly tests_failed: 3;
7
+ readonly lease_lost: 4;
8
+ readonly budget_exhausted: 5;
9
+ readonly lease_held: 6;
10
+ readonly dirty: 7;
11
+ readonly not_found: 8;
12
+ readonly hook_failed: 9;
13
+ readonly exists: 10;
14
+ readonly orphaned: 11;
15
+ readonly merge_failed: 12;
16
+ readonly already_removed: 13;
17
+ readonly timeout: 14;
18
+ readonly blocked: 16;
19
+ readonly cycle: 18;
20
+ readonly outdated: 19;
21
+ readonly uninitialized: 20;
22
+ readonly too_large: 21;
23
+ readonly dismissed: 22;
24
+ readonly no_secret_store: 23;
25
+ readonly cloudflare: 24;
26
+ readonly requested: 25;
27
+ readonly slots_full: 26;
28
+ readonly slot_running: 27;
29
+ readonly not_granted: 28;
30
+ readonly agents_full: 29;
31
+ };
32
+ export type Reason = keyof typeof EXIT;
33
+ /**
34
+ * A refusal, carrying the reason to branch on, a message to show, and any
35
+ * data worth reporting with it. `exits` turns one into output and a status
36
+ * code.
37
+ */
38
+ export declare class Exit extends Error {
39
+ readonly reason: Reason;
40
+ readonly data: Record<string, unknown>;
41
+ constructor(reason: Reason, message: string, data?: Record<string, unknown>);
42
+ }
43
+ /**
44
+ * How a command refuses. Every call site means "and go no further", which is
45
+ * what the `never` return buys: the code below a `fail` is unreachable, and
46
+ * TypeScript narrows accordingly.
47
+ */
48
+ export declare function fail(reason: Reason, message: string, data?: Record<string, unknown>): never;
49
+ /**
50
+ * Decides what a refusal looks like (a machine-readable reason on stdout, a
51
+ * human explanation on stderr) and is the only place that ends the process.
52
+ * An agent branches on the first and reads the second.
53
+ */
54
+ export declare function exits<C extends Deps>(): Middleware<C>;
@@ -0,0 +1,18 @@
1
+ import { type Logger } from "webappwiz/log";
2
+ import type { Git } from "./git.js";
3
+ import type { Journal } from "./journal.js";
4
+ import type { Outcomes } from "./outcomes.js";
5
+ import type { Todos } from "./todos.js";
6
+ /**
7
+ * Adds a todo, untriaged, for each thing that went worse in `task`'s merge,
8
+ * as its merged card lists them, journaled so the conversation that merged
9
+ * it shows each as an "Added" line the person can remove it from. One whose
10
+ * line is on the list already is not added again.
11
+ */
12
+ export declare function addFactTodos({ git, outcomes, todos, journal, log, }: {
13
+ git: Git;
14
+ outcomes: Outcomes;
15
+ todos: Todos;
16
+ journal: Journal;
17
+ log: Logger;
18
+ }, task: string): Promise<void>;
@@ -0,0 +1,107 @@
1
+ import * as acp from "@agentclientprotocol/sdk";
2
+ import type { Agent, AgentProcess } from "./conversations.js";
3
+ import type { RosterAgent } from "./roster.js";
4
+ /** What the agent does with each prompt, given the connection back to splates. */
5
+ export type Turn = (client: acp.AgentSideConnection, session: string, text: string) => Promise<acp.StopReason>;
6
+ export declare const AGENT: Agent;
7
+ /** `AGENT` as the roster lists it, with the models its Model setting offers. */
8
+ export declare const ROSTERED: RosterAgent;
9
+ /**
10
+ * An ACP agent in this process, joined to the conversation by two pipes in
11
+ * place of a child's stdio, and played by `turn`.
12
+ */
13
+ export declare class FakeAgent {
14
+ turn: Turn;
15
+ cancelled: number;
16
+ /** The sessions resumed, by id, in order. */
17
+ resumed: string[];
18
+ /**
19
+ * What `_session/steering` answers, or null for an agent that does not
20
+ * offer it, the default: `startedNewTurn` as Codex does when it finds no
21
+ * turn, whatever splates asked, and `failed` as it does on an error.
22
+ */
23
+ steering: "injected" | "promptRequired" | "startedNewTurn" | "failed" | null;
24
+ /** What was steered into a turn, in order. */
25
+ steered: string[];
26
+ /** What it does before it answers a steer, as ending the turn it would steer into. */
27
+ beforeSteer: () => Promise<void>;
28
+ /** Whether it offers its session list to subscribe to, as Codex does. */
29
+ lists: boolean;
30
+ /** The working directories its session list was subscribed for, in order. */
31
+ subscribed: string[];
32
+ /** What splates said it can take, as it started the last process. */
33
+ capabilities: acp.ClientCapabilities | null;
34
+ /** The background commands stopped, by id, in order. */
35
+ stoppedBackground: string[];
36
+ /** Whether it says it takes images in a prompt. */
37
+ sees: boolean;
38
+ /** The tokens it says each turn used; none, the default, says nothing. */
39
+ usage: acp.Usage | null;
40
+ /**
41
+ * The sessions it holds from before, as its CLI would, to list and load;
42
+ * none, the default, for an agent that does not offer either.
43
+ */
44
+ held: (acp.SessionInfo & {
45
+ replay: acp.SessionUpdate[];
46
+ })[] | null;
47
+ /** The sessions loaded, by id, in order. */
48
+ loaded: string[];
49
+ /** The `_meta` each session was opened, loaded or resumed with, in order. */
50
+ opened: unknown[];
51
+ /** Whether it takes MCP servers over HTTP, as Claude's adapter does. */
52
+ http: boolean;
53
+ /** The MCP servers each session was opened, loaded or resumed with, in order. */
54
+ mcp: acp.McpServer[][];
55
+ /** Every prompt it was sent, block by block, in order. */
56
+ prompts: acp.ContentBlock[][];
57
+ /** The settings set, in order. */
58
+ chosen: {
59
+ configId: string;
60
+ value: unknown;
61
+ }[];
62
+ options: acp.SessionConfigOption[];
63
+ /** Negotiated resume support; absent capabilities must never imply it. */
64
+ resumes: boolean;
65
+ protocolVersion: number;
66
+ disconnect: () => void;
67
+ /** Simulate an agent refusing to apply a model choice. */
68
+ ignoreChoices: boolean;
69
+ /** What each start's `initialize` waits on; null, the default, answers at once. */
70
+ hold: Promise<void> | null;
71
+ /** How many starts to come die before answering `initialize`. */
72
+ dying: number;
73
+ stderr: string;
74
+ launched: {
75
+ argv: string[];
76
+ cwd: string;
77
+ env: Record<string, string>;
78
+ }[];
79
+ killed: number;
80
+ /** The pid each process it launches says it has. */
81
+ pid: number | null;
82
+ private exit;
83
+ launch: (argv: string[], cwd: string, env: Record<string, string>) => AgentProcess;
84
+ /** Dies as a crashed agent would, on its own. */
85
+ crash(): void;
86
+ /** Says `update` outside any turn, as Claude does of a background command. */
87
+ say(update: acp.SessionUpdate): Promise<void>;
88
+ /**
89
+ * Says on its session list that session `s1` is in `state`, its last turn
90
+ * ended at `endedAt`, as Codex does as a turn starts and ends.
91
+ */
92
+ list(state: "running" | "idle" | "error", endedAt?: string): Promise<void>;
93
+ private client;
94
+ private agent;
95
+ }
96
+ /** What the person said, as an agent replays it. */
97
+ export declare function heard(text: string): acp.SessionUpdate;
98
+ export declare function say(text: string): acp.SessionUpdate;
99
+ /**
100
+ * Claude's adapter saying it left a command running in the background as
101
+ * `id`, started by tool call `tool`: a draft the SDK's types leave out.
102
+ */
103
+ export declare function backgroundStarted(id: string, description: string, tool: string, taskType?: string, output?: string): acp.SessionUpdate;
104
+ /** Claude's adapter saying background command `id` ended as `state`. */
105
+ export declare function backgroundEnded(id: string, state: "completed" | "failed" | "stopped"): acp.SessionUpdate;
106
+ /** Claude's adapter saying where background command `id` writes its output. */
107
+ export declare function backgroundWrites(id: string, output: string): acp.SessionUpdate;