@stringsync/splates 0.0.45 → 0.0.46

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 (254) hide show
  1. package/README.md +121 -9
  2. package/artifact.d.ts +3 -30
  3. package/budget.d.ts +3 -0
  4. package/coordinator.d.ts +3 -0
  5. package/creds.d.ts +3 -123
  6. package/flags.d.ts +37 -0
  7. package/index.js +729 -26375
  8. package/lane.d.ts +3 -55
  9. package/main.d.ts +6 -0
  10. package/package.json +3 -42
  11. package/projects.d.ts +3 -136
  12. package/queue.d.ts +3 -0
  13. package/setup.d.ts +16 -98
  14. package/slots.d.ts +3 -135
  15. package/splates.d.ts +1 -19
  16. package/todo.d.ts +3 -146
  17. package/{splates-tunnel.d.ts → tunnel.d.ts} +1 -1
  18. package/{splates-worker.d.ts → worker.d.ts} +1 -1
  19. package/acp-extensions.d.ts +0 -82
  20. package/add.d.ts +0 -53
  21. package/adherence.d.ts +0 -49
  22. package/age.d.ts +0 -2
  23. package/agent-connection.d.ts +0 -171
  24. package/agent-errors.d.ts +0 -2
  25. package/agent-process.d.ts +0 -65
  26. package/agent-stream.d.ts +0 -91
  27. package/agents.d.ts +0 -15
  28. package/artifact-room.d.ts +0 -47
  29. package/artifact-viewers.d.ts +0 -6
  30. package/artifacts.d.ts +0 -161
  31. package/asked.d.ts +0 -146
  32. package/asked.js +0 -7
  33. package/assumed.d.ts +0 -34
  34. package/attach.d.ts +0 -30
  35. package/attachments.d.ts +0 -43
  36. package/baselines.d.ts +0 -55
  37. package/claim.d.ts +0 -17
  38. package/cloudflare-api.d.ts +0 -25
  39. package/cloudflare-error.d.ts +0 -5
  40. package/cloudflared-tunnel-provider.d.ts +0 -27
  41. package/codex-limits.d.ts +0 -19
  42. package/compaction.d.ts +0 -17
  43. package/config-source.d.ts +0 -13
  44. package/config.d.ts +0 -98
  45. package/config.js +0 -7
  46. package/conversation-archive.d.ts +0 -6
  47. package/conversation-background.d.ts +0 -21
  48. package/conversation-choice.d.ts +0 -4
  49. package/conversation-files.d.ts +0 -51
  50. package/conversation-given.d.ts +0 -8
  51. package/conversation-host.d.ts +0 -102
  52. package/conversation-listing.d.ts +0 -15
  53. package/conversation-log.d.ts +0 -301
  54. package/conversation-messages.d.ts +0 -18
  55. package/conversation-name.d.ts +0 -28
  56. package/conversation-options.d.ts +0 -73
  57. package/conversation-reference.d.ts +0 -2
  58. package/conversation-state.d.ts +0 -472
  59. package/conversation-turns.d.ts +0 -115
  60. package/conversation.d.ts +0 -209
  61. package/conversations.d.ts +0 -140
  62. package/coordinator-state.d.ts +0 -28
  63. package/darwin-temperature.d.ts +0 -7
  64. package/decided.d.ts +0 -18
  65. package/demo.d.ts +0 -29
  66. package/dev/api.d.ts +0 -209
  67. package/dev/assets.d.ts +0 -24
  68. package/dev/conversation-address.d.ts +0 -47
  69. package/dev/conversation-feed.d.ts +0 -166
  70. package/dev/live-stream.d.ts +0 -29
  71. package/dev/worker.d.ts +0 -33
  72. package/dev-access.d.ts +0 -61
  73. package/dev-artifacts.d.ts +0 -22
  74. package/dev-budgets.d.ts +0 -18
  75. package/dev-conversation-events.d.ts +0 -39
  76. package/dev-conversation-routes.d.ts +0 -90
  77. package/dev-creds.d.ts +0 -17
  78. package/dev-dictation-connection.d.ts +0 -18
  79. package/dev-dictation.d.ts +0 -17
  80. package/dev-http.d.ts +0 -76
  81. package/dev-open.d.ts +0 -15
  82. package/dev-options.d.ts +0 -133
  83. package/dev-outcomes.d.ts +0 -21
  84. package/dev-pages.d.ts +0 -16
  85. package/dev-picker.d.ts +0 -57
  86. package/dev-port-socket.d.ts +0 -26
  87. package/dev-ports.d.ts +0 -11
  88. package/dev-project-watch.d.ts +0 -44
  89. package/dev-project.d.ts +0 -168
  90. package/dev-push.d.ts +0 -59
  91. package/dev-restart.d.ts +0 -141
  92. package/dev-servers.d.ts +0 -30
  93. package/dev-setup-native.d.ts +0 -23
  94. package/dev-setup-opencode.d.ts +0 -29
  95. package/dev-setup.d.ts +0 -16
  96. package/dev-shell.d.ts +0 -70
  97. package/dev-slot.d.ts +0 -28
  98. package/dev-sockets.d.ts +0 -13
  99. package/dev-task-ports.d.ts +0 -73
  100. package/dev-tasks.d.ts +0 -20
  101. package/dev-terminal-connection.d.ts +0 -19
  102. package/dev-terminal.d.ts +0 -42
  103. package/dev-todos.d.ts +0 -35
  104. package/dev-transcriber.d.ts +0 -15
  105. package/dev-tunnel.d.ts +0 -38
  106. package/dev-versions.d.ts +0 -53
  107. package/dev-workers.d.ts +0 -55
  108. package/dev.d.ts +0 -24
  109. package/diff.d.ts +0 -29
  110. package/dispatched.d.ts +0 -16
  111. package/editors.d.ts +0 -22
  112. package/escalate.d.ts +0 -27
  113. package/events.d.ts +0 -311
  114. package/everywhere.d.ts +0 -41
  115. package/exhibit.d.ts +0 -21
  116. package/exit.d.ts +0 -54
  117. package/fact-todos.d.ts +0 -18
  118. package/fake-agent.d.ts +0 -107
  119. package/fake-agent.js +0 -284
  120. package/finding-facts.d.ts +0 -38
  121. package/findings.d.ts +0 -84
  122. package/fold.d.ts +0 -43
  123. package/follow.d.ts +0 -41
  124. package/format.d.ts +0 -68
  125. package/git.d.ts +0 -112
  126. package/handed-out.d.ts +0 -79
  127. package/handoff.d.ts +0 -23
  128. package/heavy-run.d.ts +0 -12
  129. package/heavy.d.ts +0 -28
  130. package/heavy.js +0 -16
  131. package/held.d.ts +0 -22
  132. package/index-0tfvy823.js +0 -272
  133. package/index-43pq33n4.js +0 -157
  134. package/index-4776671w.js +0 -698
  135. package/index-d4hjrzaq.js +0 -464
  136. package/index-gcfq7awr.js +0 -740
  137. package/index-k73tsw5g.js +0 -101
  138. package/index-kaa44k7q.js +0 -59
  139. package/index-vcv9m93e.js +0 -1265
  140. package/index-xmfmy729.js +0 -249
  141. package/init.d.ts +0 -28
  142. package/journal.d.ts +0 -57
  143. package/landed.d.ts +0 -14
  144. package/lane-todos.d.ts +0 -44
  145. package/lanes-from-tags.d.ts +0 -17
  146. package/lanes.d.ts +0 -96
  147. package/legacy-names.d.ts +0 -70
  148. package/legacy-ps.d.ts +0 -31
  149. package/limits.d.ts +0 -32
  150. package/list.d.ts +0 -18
  151. package/load-config.d.ts +0 -44
  152. package/log.d.ts +0 -14
  153. package/machine.d.ts +0 -42
  154. package/merge.d.ts +0 -35
  155. package/migrate-config.d.ts +0 -31
  156. package/models.d.ts +0 -24
  157. package/needs.d.ts +0 -115
  158. package/notices.d.ts +0 -39
  159. package/offered.d.ts +0 -39
  160. package/opencode-usage.d.ts +0 -37
  161. package/outcomes.d.ts +0 -114
  162. package/path.d.ts +0 -13
  163. package/plan.d.ts +0 -236
  164. package/port-forward.d.ts +0 -22
  165. package/port-pipe.d.ts +0 -36
  166. package/ports-list.d.ts +0 -19
  167. package/probe-runtime.d.ts +0 -5
  168. package/probe-runtime.js +0 -13
  169. package/project-reaches.d.ts +0 -23
  170. package/prompts.d.ts +0 -128
  171. package/pty.d.ts +0 -39
  172. package/pulse.d.ts +0 -8
  173. package/recommend.d.ts +0 -31
  174. package/release.d.ts +0 -41
  175. package/remote-process.d.ts +0 -26
  176. package/remote-pty.d.ts +0 -29
  177. package/remote-worker.d.ts +0 -77
  178. package/remove.d.ts +0 -31
  179. package/repository.d.ts +0 -91
  180. package/retry.d.ts +0 -34
  181. package/roster.d.ts +0 -63
  182. package/saved-ports-host.d.ts +0 -25
  183. package/saved-tunnel.d.ts +0 -44
  184. package/server-worker-socket.d.ts +0 -21
  185. package/setup-areas.d.ts +0 -7
  186. package/setup-opencode-model-error.d.ts +0 -3
  187. package/setup-opencode-models.d.ts +0 -54
  188. package/setup-opencode-recipe.d.ts +0 -26
  189. package/setup-opencode.d.ts +0 -46
  190. package/shared-browser.d.ts +0 -50
  191. package/shell.d.ts +0 -17
  192. package/show.d.ts +0 -106
  193. package/skill-checks.d.ts +0 -73
  194. package/skill-checks.js +0 -10
  195. package/skills.d.ts +0 -16
  196. package/slot-tunnel.d.ts +0 -27
  197. package/snapshot.d.ts +0 -75
  198. package/splates-artifact.d.ts +0 -3
  199. package/splates-creds.d.ts +0 -3
  200. package/splates-dev.d.ts +0 -22
  201. package/splates-flags.d.ts +0 -34
  202. package/splates-lane.d.ts +0 -3
  203. package/splates-projects.d.ts +0 -3
  204. package/splates-setup.d.ts +0 -17
  205. package/splates-slots.d.ts +0 -3
  206. package/splates-todo.d.ts +0 -3
  207. package/stats.d.ts +0 -186
  208. package/supervise.d.ts +0 -50
  209. package/system-changes.d.ts +0 -67
  210. package/system.d.ts +0 -28
  211. package/systems.d.ts +0 -119
  212. package/systems.js +0 -21
  213. package/table.d.ts +0 -5
  214. package/task-log.d.ts +0 -35
  215. package/task-ports.d.ts +0 -25
  216. package/tell.d.ts +0 -47
  217. package/todo-edit.d.ts +0 -60
  218. package/todo-file.d.ts +0 -6
  219. package/todo-lanes.d.ts +0 -82
  220. package/todo-list.d.ts +0 -26
  221. package/todo-take.d.ts +0 -27
  222. package/todos.d.ts +0 -157
  223. package/tool-calls.d.ts +0 -18
  224. package/tunnel-provider.d.ts +0 -37
  225. package/tunnel-provider.js +0 -0
  226. package/tunnel-remove.d.ts +0 -28
  227. package/tunnel-setup.d.ts +0 -104
  228. package/unix-worker-listener.d.ts +0 -23
  229. package/unix-worker-socket.d.ts +0 -30
  230. package/update.d.ts +0 -29
  231. package/update.js +0 -10
  232. package/vocabulary.d.ts +0 -9
  233. package/wait.d.ts +0 -36
  234. package/watch.d.ts +0 -46
  235. package/watched.d.ts +0 -43
  236. package/websocket-worker-socket.d.ts +0 -18
  237. package/worker-call-host.d.ts +0 -51
  238. package/worker-channel.d.ts +0 -83
  239. package/worker-connection.d.ts +0 -24
  240. package/worker-daemon.d.ts +0 -64
  241. package/worker-git.d.ts +0 -18
  242. package/worker-list.d.ts +0 -49
  243. package/worker-machine.d.ts +0 -34
  244. package/worker-port-host.d.ts +0 -21
  245. package/worker-process-host.d.ts +0 -29
  246. package/worker-protocol.d.ts +0 -104
  247. package/worker-pty-host.d.ts +0 -34
  248. package/worker-registry.d.ts +0 -68
  249. package/worker-replay.d.ts +0 -25
  250. package/worker-run.d.ts +0 -20
  251. package/worker-session.d.ts +0 -189
  252. package/worker-socket.d.ts +0 -15
  253. package/worktree-service.d.ts +0 -113
  254. package/worktree.d.ts +0 -232
package/README.md CHANGED
@@ -19,7 +19,7 @@ installs the same skill. From then on, your agents start each change with
19
19
 
20
20
  Spinning Plates was arbor (`@webappwiz/arbor`). In a project that used it, run
21
21
  `bunx @stringsync/splates update`: it installs the splates skill in place of arbor's and
22
- renames `arbor.config.ts` and `arbor.systems.ts`. The next `splates server` moves
22
+ renames `arbor.config.ts`. The next `splates server` moves
23
23
  `~/.arbor` and each repository's `.git/arbor` to their new names, leaving links
24
24
  behind. For one release, `arbor` still runs splates, and the `ARBOR_*`
25
25
  variables, `ARBOR.md` and the `[ARBOR …]` directives are still read.
@@ -40,7 +40,10 @@ and is absent from the published CLI.
40
40
  **Merging.** `splates merge` rebases the task onto `main`, runs your checks
41
41
  (`preMerge` in `splates.config.ts`) on the result, fast-forwards `main`, and
42
42
  removes the worktree. A conflict or a failing check goes back to the agent that
43
- made the change, which fixes it and merges again.
43
+ made the change, which fixes it and merges again. A check that writes a JUnit
44
+ XML report to `$SPLATES_TEST_REPORT` (`bun test --reporter=junit
45
+ --reporter-outfile="$SPLATES_TEST_REPORT"`) gets a todo for each test slower
46
+ than 5 seconds.
44
47
 
45
48
  **Heavy jobs.** Hooks (`postCheckout`, `postRewrite`, `preMerge`) run in one
46
49
  of the machine's heavy-job slots, two by default (`SPLATES_HEAVY_JOBS` sets
@@ -48,6 +51,62 @@ how many), so several agents testing at once queue rather than run the
48
51
  machine out of memory. `splates heavy -- <command>` runs anything else as
49
52
  heavy, such as a test suite an agent runs mid-task, in a slot too.
50
53
 
54
+ **Pushing.** With `remote: "origin"` in `splates.config.ts`, each task's
55
+ branch goes to that remote as `splates/<task>`: after every commit an agent
56
+ makes under `splates server`, at `splates checkpoint`, escalation and handoff,
57
+ and it is deleted once the task merges or is removed. `splates checkpoint`
58
+ commits uncommitted work first, as a `WIP: checkpoint` commit squashed before
59
+ merging. A branch that tracks `SPLATES.md` is never pushed or merged. With the
60
+ GitHub App's id and private key kept as the creds `SPLATES_GITHUB_APP_ID` and
61
+ `SPLATES_GITHUB_APP_KEY`, pushes to github.com use an hour-long token the App
62
+ mints for that repository's contents alone; otherwise, the machine's own git
63
+ credentials. Without `remote`, nothing is pushed.
64
+
65
+ With `remote`, `main` is the remote's: `splates merge` fetches it, rebases
66
+ onto it, runs the checks, pushes the tested `splates/<task>`, and asks
67
+ `splates server`, the coordinator, to move `main` there. The coordinator alone
68
+ pushes `main`, with its machine's own git credentials, and only when the
69
+ remote's `main` is still the commit the checks ran on; then it fast-forwards
70
+ its own `main` checkout. A merge refuses while the local `main` holds commits
71
+ the remote lacks, until they are pushed. Protect `main` with a ruleset that
72
+ lets only the coordinator's identity update it, and every tag with one, so the
73
+ App's tokens, which workers push with, reach `splates/*` alone.
74
+
75
+ Setup's GitHub pushing area walks through it for the project it is opened
76
+ from (`splates setup` in its repository, or the page on that project), each
77
+ step checked against GitHub:
78
+
79
+ 1. `github-app`: [make a GitHub App](https://github.com/settings/apps/new)
80
+ with Webhook off and Repository permissions **Contents: Read and write**
81
+ alone, and keep its App ID and a private key it generates as the device
82
+ creds above.
83
+ 2. `github-install`: install it on the project's repository alone.
84
+ 3. `github-ruleset`: in the repository's **Settings → Rules → Rulesets**,
85
+ two active rulesets that restrict creations, updates and deletions, with
86
+ only **Repository admin** allowed to bypass them, the role of the account
87
+ the coordinator pushes `main` with: a branch ruleset on **All branches**
88
+ but `splates/*`, and a tag ruleset on **All tags**, since the App's
89
+ Contents permission would let a token push or move a release tag. GitHub
90
+ has no token that pushes branches but not tags. Or, with your own `gh`
91
+ sign-in, once for each body:
92
+
93
+ ```sh
94
+ gh api --method POST repos/<owner>/<repo>/rulesets --input - <<'JSON'
95
+ {"name":"splates","target":"branch","enforcement":"active",
96
+ "conditions":{"ref_name":{"include":["~ALL"],"exclude":["refs/heads/splates/*"]}},
97
+ "rules":[{"type":"creation"},{"type":"update"},{"type":"deletion"}],
98
+ "bypass_actors":[{"actor_id":5,"actor_type":"RepositoryRole","bypass_mode":"always"}]}
99
+ JSON
100
+ gh api --method POST repos/<owner>/<repo>/rulesets --input - <<'JSON'
101
+ {"name":"splates-tags","target":"tag","enforcement":"active",
102
+ "conditions":{"ref_name":{"include":["~ALL"],"exclude":[]}},
103
+ "rules":[{"type":"creation"},{"type":"update"},{"type":"deletion"}],
104
+ "bypass_actors":[{"actor_id":5,"actor_type":"RepositoryRole","bypass_mode":"always"}]}
105
+ JSON
106
+ ```
107
+
108
+ 4. `github-push`: add `remote: "origin"` to `splates.config.ts` and merge it.
109
+
51
110
  **Escalating.** When an agent needs you (a decision, access, a review, or
52
111
  merges that keep failing), it runs `splates escalate`: it stops, leaves its
53
112
  worktree as it is, and writes down its questions. You answer, and it picks up
@@ -156,8 +215,8 @@ To use another tunnel, give `splates.config.ts` a `tunnel`, any object that
156
215
  implements `TunnelProvider`:
157
216
 
158
217
  ```ts
159
- import type { ConfigFile } from "@stringsync/splates/config";
160
- import type { TunnelProvider } from "@stringsync/splates/tunnel-provider";
218
+ import type { ConfigFile } from "@stringsync/splates-server/config";
219
+ import type { TunnelProvider } from "@stringsync/splates-server/tunnel";
161
220
 
162
221
  const myTunnel: TunnelProvider = {
163
222
  // throw, saying what to do, unless the tunnel can run
@@ -178,6 +237,59 @@ traffic, and `--tunnel-name` is refused beside a provider of your own. One
178
237
  that is not ready, or fails to start, is logged and skipped: the page keeps
179
238
  serving on this machine.
180
239
 
240
+ ### Worker providers
241
+
242
+ To have splates make workers when agents queue for want of a slot, give
243
+ `splates.config.ts`, in the repo `splates server` starts in, a
244
+ `workerProvider`, any object that implements `WorkerProvider`:
245
+
246
+ ```ts
247
+ import type { ConfigFile } from "@stringsync/splates-server/config";
248
+ import type { WorkerProvider } from "@stringsync/splates-server/workers";
249
+
250
+ const myCloud: WorkerProvider = {
251
+ // the machines it makes, with what each costs you per hour
252
+ types: async () => [
253
+ { name: "small", platform: "linux", slots: 4, dollarsPerHour: 0.05 },
254
+ ],
255
+ // build an image by running recipe.script as root on a fresh machine
256
+ snapshot: async (recipe) => ({ id: "img-1", version: recipe.version, builtAt: Date.now() }),
257
+ // boot spec.snapshot and run spec.boot on it, as the `splates` user
258
+ create: async (spec) => ({ id: spec.id, type: spec.type }),
259
+ destroy: async (id) => {},
260
+ // the machines it made that still exist
261
+ list: async () => [],
262
+ };
263
+
264
+ export default { workerProvider: myCloud } satisfies ConfigFile;
265
+ ```
266
+
267
+ A made worker boots from a snapshot splates asks for when there is none, and
268
+ again when splates's version changes or the snapshot is a week old; it holds
269
+ bun, git, the browser and splates, and no credentials. Its boot command spends
270
+ a single-use join token, dialing the page at its tunnel host, so the server
271
+ needs a tunnel. Placement makes one only once agents other agents started are
272
+ queued, and only as far as the worker budget allows; none is kept warm.
273
+ `splates worker add --provider [--type <name>]` makes one by hand, past the
274
+ rate cap, and `splates worker remove` destroys its machine.
275
+
276
+ The worker budget is in dollars, at each type's list price, so every figure is
277
+ an estimate: a rate cap on what the made workers running at once cost an hour
278
+ ($0.25/h by default), and limits on what they cost in a day ($5) and a month
279
+ ($75), from the start of each in local time. Past the rate cap no worker is
280
+ made, and the queue says which limit holds it, as `rate cap $0.25/h reached`.
281
+ Once a day's or month's limit is spent, made workers take nothing new, their
282
+ agents are asked to stop at a checkpoint, and each is destroyed once its last
283
+ agent ends. Each limit warns at 80%, 90% and 100%, once in its window, by Web
284
+ Push and on the page's header. Agents' own API spend is not counted here.
285
+
286
+ ```bash
287
+ bunx @stringsync/splates budget show
288
+ bunx @stringsync/splates budget set day 10 # or `default`
289
+ bunx @stringsync/splates budget raise hour 0.1 --for 1d
290
+ bunx @stringsync/splates budget end 1 # a raise, by its number
291
+ ```
292
+
181
293
  ### Task ports
182
294
 
183
295
  Any port a task's processes listen on, in its worktree or under its agent, is
@@ -200,7 +312,7 @@ with its remote and local links, as the task's dialog on the page does.
200
312
  As each task merges or is removed, splates writes down how it went in
201
313
  `~/.splates/outcomes.jsonl`: how many times it came to you with questions or for
202
314
  a review, how many merges failed and why, how many of the agent's picks you
203
- overturned or took with words added, how long it waited on you, the systems it touched, why it was
315
+ overturned or took with words added, how long it waited on you, why it was
204
316
  removed, and the agent and model behind it. The Stats page sums it over the
205
317
  last 6 hours, day, 3 days or 7 days, cut into bars of half an hour to six
206
318
  hours, or over all time a bar a week, by model, project and system, so you can tell whether tasks are landing
@@ -241,7 +353,7 @@ existing conversations and native authentication remain.
241
353
  #### Advanced manual reference
242
354
 
243
355
  Manual roster editing remains available for custom launches; use the supported
244
- V2 recipe and inspection commands in [the setup contracts](design/opencode-acp.md#374-readiness-and-completion).
356
+ V2 recipe and inspection commands in [the setup contracts](../../designs/opencode-acp.md#374-readiness-and-completion).
245
357
  A plain `opencode acp` entry or custom command does not establish wizard readiness.
246
358
  Custom commands are never replaced or removed automatically. Avoid the older V1
247
359
  `small_model`/provider recipe: it does not pin every V2 auxiliary/custom agent.
@@ -271,7 +383,7 @@ fixtures, not a recorded OpenCode executable. `opencode` was absent from the
271
383
  implementation environment's PATH, so no executable version or live login was
272
384
  verified and no minimum supported version is claimed. Production acceptance
273
385
  requires recording a version and sanitized handshake separately; no paid smoke
274
- test was run. See [the experiment plan](design/opencode-acp.md) for opt-in setup,
386
+ test was run. See [the experiment plan](../../designs/opencode-acp.md) for opt-in setup,
275
387
  provider restrictions, and the separate paid-overflow control. Fixture checks
276
388
  never establish account entitlement or remaining quota.
277
389
 
@@ -285,7 +397,7 @@ charges; it is not a subscription invoice. Quota and mixed-model remaining
285
397
  allowance stay unknown: consult OpenCode Console and keep **Use balance** disabled.
286
398
  Legacy task cost/token aggregates exclude these differently scoped observations.
287
399
 
288
- See [the manual comparison recipe](design/opencode-acp.md#354-implementation-and-manual-comparison-record)
400
+ See [the manual comparison recipe](../../designs/opencode-acp.md#354-implementation-and-manual-comparison-record)
289
401
  for identical baseline files, a results worksheet, provenance and the authorization
290
402
  gate. Fixtures need no production login. Live executable compatibility remains
291
403
  unverified and no real comparison was run. `splates dev fix --code-only` disables
@@ -305,5 +417,5 @@ Installation/connection is the first part of this wizard. Model selection and
305
417
  configuration (#373), then final conversation readiness (#374), remain separate
306
418
  lane steps. Until those land, this step does not add an agent roster entry. A
307
419
  stored credential and ACP handshake do not verify subscription access, billing,
308
- model availability or inference. See the [setup contract](design/opencode-acp.md#372-setup-wizard-contract-lane-53-step-1)
420
+ model availability or inference. See the [setup contract](../../designs/opencode-acp.md#372-setup-wizard-contract-lane-53-step-1)
309
421
  for exact files and supported interfaces.
package/artifact.d.ts CHANGED
@@ -1,30 +1,3 @@
1
- import { type Logger } from "webappwiz/log";
2
- import type { Fs, Ps } from "webappwiz/system";
3
- import { type ArtifactVersion } from "./artifacts.js";
4
- import type { WorktreeService } from "./worktree-service.js";
5
- /** What `fetch` is used for here, so a test can stand in for it. */
6
- type Send = (url: string, init: RequestInit) => Promise<Response>;
7
- export interface ArtifactDeps {
8
- service: WorktreeService;
9
- log: Logger;
10
- fs: Fs;
11
- ps: Ps;
12
- send?: Send;
13
- }
14
- /**
15
- * Keeps `file` as the next version of the artifact of that name in the
16
- * conversation `id`, through the `splates server` serving this repository when
17
- * the agent has one in its env, so the page hears of it, else straight into
18
- * the conversation's log.
19
- */
20
- export declare function addArtifact(deps: ArtifactDeps, id: string, file: {
21
- name: string;
22
- bytes: Uint8Array;
23
- }): Promise<ArtifactVersion>;
24
- /** Marks the artifact `name` of conversation `id` removed; answers the version that was current. */
25
- export declare function removeArtifact(deps: ArtifactDeps, id: string, name: string): Promise<number>;
26
- /** Prints what the conversation `id` holds, or, given a `name`, that artifact's versions. */
27
- export declare function listArtifacts(deps: ArtifactDeps, id: string, name?: string): Promise<void>;
28
- /** The media type `name`'s extension says, else plain bytes. */
29
- export declare function mimeTypeOf(name: string): string;
30
- export {};
1
+ import type { SplatesDeps } from "@stringsync/splates-server/server";
2
+ /** `splates artifact`, which the root cli mounts after `splates attach`. */
3
+ export declare const splatesArtifact: import("webappwiz/cmd").Cli<SplatesDeps, SplatesDeps>;
package/budget.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import type { SplatesDeps } from "@stringsync/splates-server/server";
2
+ /** `splates budget`, which the root cli mounts beside `splates worker`. */
3
+ export declare const splatesBudget: import("webappwiz/cmd").Cli<SplatesDeps, SplatesDeps>;
@@ -0,0 +1,3 @@
1
+ import { type SplatesDeps } from "@stringsync/splates-server/server";
2
+ /** `splates coordinator`, which the root cli mounts after `splates budget`. */
3
+ export declare const splatesCoordinator: import("webappwiz/cmd").Cli<SplatesDeps, SplatesDeps>;
package/creds.d.ts CHANGED
@@ -1,123 +1,3 @@
1
- import { Credentials, type SecretStore } from "webappwiz/creds";
2
- import { type Fs, type Lock } from "webappwiz/system";
3
- import { Duration } from "webappwiz/time";
4
- import { z } from "zod";
5
- /** Where a cred is kept: for this project alone, or every project on this device. */
6
- export declare const SCOPES: readonly ["project", "device"];
7
- export type Scope = (typeof SCOPES)[number];
8
- /** How long `wait` gives a request before handing the wait back to its caller. */
9
- export declare const DEFAULT_TIMEOUT: Duration;
10
- /** The two stores a cred can be kept in, the system's unless a test says otherwise. */
11
- export interface SecretStores {
12
- /** The store of the project whose main tree is at `root`. */
13
- project(root: string): Promise<SecretStore>;
14
- device: SecretStore;
15
- }
16
- /** The operating system's own stores, shared with `wiz creds`. */
17
- export declare const SYSTEM_STORES: SecretStores;
18
- declare const REQUEST: z.ZodObject<{
19
- name: z.ZodString;
20
- scope: z.ZodEnum<{
21
- device: "device";
22
- project: "project";
23
- }>;
24
- purpose: z.ZodDefault<z.ZodString>;
25
- instructions: z.ZodString;
26
- task: z.ZodNullable<z.ZodString>;
27
- status: z.ZodEnum<{
28
- dismissed: "dismissed";
29
- open: "open";
30
- saved: "saved";
31
- }>;
32
- requestedAt: z.ZodString;
33
- }, z.core.$strip>;
34
- /** A cred an agent asked a person for, with what for and how to get it. */
35
- export type CredRequest = z.infer<typeof REQUEST>;
36
- /** A cred a store keeps, by name; never its value. */
37
- export interface KeptCred {
38
- name: string;
39
- scope: Scope;
40
- /** The tool that saved it, when one said so; null when a person did. */
41
- savedBy: string | null;
42
- }
43
- /**
44
- * A project's creds: the requests agents make for them, which `splates server`
45
- * shows on its Creds page for a person to fill, and the two stores they are
46
- * kept in, the project's and the device's, as `wiz creds` keeps them. A value
47
- * goes into a store and never comes out through here but to code reading it
48
- * through `credentials`, so no agent, page or log ever holds it.
49
- */
50
- export declare class Creds {
51
- #private;
52
- /** The record of requests, `.git/splates/creds.json`. */
53
- readonly file: string;
54
- /** Held while the record is read and written back. */
55
- private readonly lock;
56
- private readonly stores;
57
- constructor(
58
- /** The record of requests, `.git/splates/creds.json`. */
59
- file: string,
60
- /** Held while the record is read and written back. */
61
- lock: Lock, stores: Record<Scope, SecretStore>, opts?: {
62
- fs?: Fs;
63
- });
64
- /** The project's creds, kept in `stores`. */
65
- static open(splatesDir: string, root: string, lock: Lock, stores: SecretStores, opts?: {
66
- fs?: Fs;
67
- }): Promise<Creds>;
68
- /**
69
- * Where code reads a cred's value: the project's store, then the device's.
70
- * Never the environment, so a stray export is not what splates reads.
71
- */
72
- get credentials(): Credentials;
73
- /** Every request, open or not, the latest first. */
74
- requests(): Promise<CredRequest[]>;
75
- /**
76
- * Asks a person for `name`, saying what for, kept in `scope`'s store once they save it.
77
- * Asks nothing, returning null, when that store already keeps it, unless
78
- * `replace` says the value kept there does not work, and then a purpose or
79
- * instructions left off are those of the last request for `name`.
80
- */
81
- request(name: string, { scope, purpose, instructions, task, replace, }: {
82
- scope: Scope;
83
- purpose: string;
84
- instructions: string;
85
- task: string | null;
86
- replace?: boolean;
87
- }): Promise<CredRequest | null>;
88
- /**
89
- * Blocks until a person fills or dismisses the request for `name`,
90
- * returning what became of it; gives up with `timeout`.
91
- */
92
- wait(name: string, { timeout, poll, }?: {
93
- timeout?: Duration;
94
- poll?: Duration;
95
- }): Promise<"saved" | "dismissed">;
96
- /**
97
- * Keeps `value` as `name`, filling its request if one is open, in the
98
- * request's scope, else in `scope`. `by` names the tool saving it, for
99
- * the page to say; a person's own save says nothing.
100
- */
101
- save(name: string, value: string, { scope, by }?: {
102
- scope?: Scope;
103
- by?: string | null;
104
- }): Promise<Scope>;
105
- /** Turns down the open request for `name`, so its agent stops waiting. */
106
- dismiss(name: string): Promise<void>;
107
- /** Deletes `name` from `scope`'s store; whether there was one. */
108
- remove(name: string, scope: Scope): Promise<boolean>;
109
- /**
110
- * Copies each cred kept under arbor's `ARBOR_*` name to its `SPLATES_*`
111
- * one in the same store, unless that is kept already. The old one stays,
112
- * for an arbor still running, and any record naming it, to read.
113
- */
114
- copyLegacy(): Promise<void>;
115
- /** Every cred either store keeps, the project's first, by name. */
116
- kept(): Promise<KeptCred[]>;
117
- /** What a person calls `scope`'s store, as in "the macOS Keychain". */
118
- label(scope: Scope): string;
119
- private has;
120
- private read;
121
- private change;
122
- }
123
- export {};
1
+ import type { SplatesDeps } from "@stringsync/splates-server/server";
2
+ /** `splates creds`, which the root cli mounts after `splates lane`. */
3
+ export declare const splatesCreds: import("webappwiz/cmd").Cli<SplatesDeps, SplatesDeps>;
package/flags.d.ts ADDED
@@ -0,0 +1,37 @@
1
+ import { type AgentPick, Offered, type RosterAgent } from "@stringsync/splates-server/models";
2
+ import type { Repository } from "@stringsync/splates-server/records";
3
+ import type { SplatesDeps } from "@stringsync/splates-server/server";
4
+ import { SavedTunnel } from "@stringsync/splates-server/tunnel";
5
+ import { z } from "zod";
6
+ /** A place in the todo list, 1 at the top; absent leaves it to the command. */
7
+ export declare const position: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
8
+ /**
9
+ * The agent `--agent`, `--model` and `--effort` name off the roster:
10
+ * undefined when none is given, null for `--agent none`.
11
+ */
12
+ export declare function assigneeIn(deps: SplatesDeps, agent: string, model: string, effort: string): Promise<AgentPick | null | undefined>;
13
+ /**
14
+ * `agent` on `model` off `agents`, at the thinking level `effort` names
15
+ * among those it offers, each left out when empty.
16
+ */
17
+ export declare function pickIn(deps: SplatesDeps, agents: RosterAgent[], agent: string, model: string, effort: string, data?: Record<string, unknown>): Promise<AgentPick>;
18
+ /**
19
+ * `{ effort }` for the thinking level `effort` names among those `agent`
20
+ * offered when last started, or nothing when it is empty.
21
+ */
22
+ export declare function effortIn(deps: SplatesDeps, agent: string, effort: string, data?: Record<string, unknown>): Promise<{
23
+ effort?: string;
24
+ }>;
25
+ /** The settings each agent offered when last started, from any project. */
26
+ export declare function offeredOf({ ps, fs }: SplatesDeps): Offered;
27
+ /** The tunnel each slot's home may have saved, for every word of the pool. */
28
+ export declare function slotTunnelsOf({ ps, fs, secrets, }: SplatesDeps): SavedTunnel[];
29
+ /** `--lane 3`, `new` or `none` as a lane; absent leaves it to the command. */
30
+ export declare function laneIn(raw: string): number | "new" | null | undefined;
31
+ /** `--todo 3,5` as ids, refusing anything that is not one. */
32
+ export declare function todoIds(raw: string): number[];
33
+ /**
34
+ * Which task a command that takes no task name is about, so the journal can
35
+ * name it. `merge` and `escalate` read it off the current branch.
36
+ */
37
+ export declare function here({ service, git, ps, project, }: SplatesDeps & Repository): Promise<string | null>;