@stringsync/splates 0.0.45 → 0.0.47

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 +826 -26419
  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/index-xmfmy729.js DELETED
@@ -1,249 +0,0 @@
1
- import {
2
- LEGACY_DIR
3
- } from "./index-k73tsw5g.js";
4
- import {
5
- splatesHome
6
- } from "./index-43pq33n4.js";
7
-
8
- // heavy.ts
9
- import { HeavyJobs } from "webappwiz/system";
10
-
11
- // slots.ts
12
- import { FileLock } from "webappwiz/system";
13
- import { Duration, sleep } from "webappwiz/time";
14
- import { z } from "zod";
15
- var SERVER_PID = "server.pid";
16
- var SLOT = "SPLATES_SLOT";
17
- var MACHINE_HOME = "SPLATES_MACHINE_HOME";
18
- var STOP_WAIT = Duration.secs(5);
19
- var FORMAT = 1;
20
-
21
- class Slots {
22
- path;
23
- deps;
24
- constructor(path, deps) {
25
- this.path = path;
26
- this.deps = deps;
27
- }
28
- static ofMachine({ fs, ps, log }) {
29
- const home = ps.env(MACHINE_HOME) ?? splatesHome(ps);
30
- return new Slots(`${home}/slots.json`, {
31
- fs,
32
- ps,
33
- lock: new FileLock(`${home}/slots.lock`, { fs, ps, log })
34
- });
35
- }
36
- async owns(tree) {
37
- const { fs } = this.deps;
38
- return await fs.exists(tree) && !await fs.exists(`${tree}/.git/splates`) && !await fs.exists(`${tree}/.git/${LEGACY_DIR}`);
39
- }
40
- async claim(tree) {
41
- const { fs, lock, pool = SLOT_POOL } = this.deps;
42
- await fs.mkdir(this.path.slice(0, this.path.lastIndexOf("/")));
43
- await lock.acquire();
44
- try {
45
- const claims = await this.read();
46
- const held = pool.find(({ word }) => claims[word] === tree);
47
- if (held !== undefined) {
48
- return held;
49
- }
50
- const holders = [];
51
- for (const slot of pool) {
52
- const holder = claims[slot.word];
53
- if (holder !== undefined && await this.owns(holder)) {
54
- holders.push(` ${slot.word}: ${holder}`);
55
- continue;
56
- }
57
- const pid = await this.server(slot);
58
- if (pid !== null) {
59
- holders.push(` ${slot.word}: pid ${pid}${holder === undefined ? "" : `, run from ${holder}`}`);
60
- continue;
61
- }
62
- await this.write({ ...claims, [slot.word]: tree });
63
- return slot;
64
- }
65
- throw new Error([
66
- "every dev slot is held:",
67
- ...holders,
68
- "each is another task's: `splates slots prune` frees those no task owns any more, and stops their servers; never stop another task's server or edit its claim"
69
- ].join(`
70
- `));
71
- } finally {
72
- await lock.release();
73
- }
74
- }
75
- home(slot) {
76
- return `${this.path.slice(0, this.path.lastIndexOf("/"))}/slots/${slot.word}`;
77
- }
78
- async server(slot) {
79
- const { fs, ps } = this.deps;
80
- const file = `${this.home(slot)}/${SERVER_PID}`;
81
- if (!await fs.exists(file)) {
82
- return null;
83
- }
84
- const pid = Number.parseInt((await fs.read(file)).trim(), 10);
85
- if (!Number.isInteger(pid) || pid === ps.pid || !ps.alive(pid)) {
86
- return null;
87
- }
88
- const running = (await ps.processes()).find((each) => each.pid === pid);
89
- if (running !== undefined && !/\bdev\b/.test(running.command)) {
90
- return null;
91
- }
92
- return pid;
93
- }
94
- async list() {
95
- const { pool = SLOT_POOL } = this.deps;
96
- const claims = await this.read();
97
- const held = [];
98
- for (const slot of pool) {
99
- const tree = claims[slot.word];
100
- if (tree !== undefined && await this.owns(tree)) {
101
- held.push({ slot, tree });
102
- }
103
- }
104
- return held;
105
- }
106
- async status() {
107
- const { pool = SLOT_POOL } = this.deps;
108
- const claims = await this.read();
109
- const held = [];
110
- for (const slot of pool) {
111
- const tree = claims[slot.word];
112
- if (tree !== undefined) {
113
- held.push({
114
- slot,
115
- tree,
116
- pid: await this.server(slot),
117
- orphaned: !await this.owns(tree)
118
- });
119
- }
120
- }
121
- return held;
122
- }
123
- async stop(slot) {
124
- const { ps } = this.deps;
125
- const pid = await this.server(slot);
126
- if (pid === null) {
127
- return null;
128
- }
129
- await ps.spawnCapture(["kill", String(pid)]);
130
- const deadline = Date.now() + STOP_WAIT.ms;
131
- while (ps.alive(pid)) {
132
- if (Date.now() >= deadline) {
133
- await ps.spawnCapture(["kill", "-KILL", String(pid)]);
134
- break;
135
- }
136
- await sleep(Duration.ms(100));
137
- }
138
- return pid;
139
- }
140
- async release(tree) {
141
- const { lock, pool = SLOT_POOL } = this.deps;
142
- if (!Object.values(await this.read()).includes(tree)) {
143
- return null;
144
- }
145
- await lock.acquire();
146
- try {
147
- const claims = await this.read();
148
- const slot = pool.find(({ word }) => claims[word] === tree);
149
- if (slot === undefined) {
150
- return null;
151
- }
152
- const stopped = await this.stop(slot);
153
- const { [slot.word]: _, ...rest } = claims;
154
- await this.write(rest);
155
- return { slot, stopped };
156
- } finally {
157
- await lock.release();
158
- }
159
- }
160
- async prune() {
161
- const { lock } = this.deps;
162
- if (!await this.deps.fs.exists(this.path)) {
163
- return [];
164
- }
165
- await lock.acquire();
166
- try {
167
- const orphans = (await this.status()).filter(({ orphaned }) => orphaned);
168
- const claims = await this.read();
169
- for (const orphan of orphans) {
170
- await this.stop(orphan.slot);
171
- delete claims[orphan.slot.word];
172
- }
173
- if (orphans.length > 0) {
174
- await this.write(claims);
175
- }
176
- return orphans;
177
- } finally {
178
- await lock.release();
179
- }
180
- }
181
- async read() {
182
- const raw = await this.deps.fs.read(this.path).catch(() => null);
183
- if (raw === null) {
184
- return {};
185
- }
186
- const parsed = Claims.safeParse(JSON.parse(raw));
187
- if (!parsed.success || parsed.data.format > FORMAT) {
188
- throw new Error(`${this.path} is not slots this splates reads: remove it to start over`);
189
- }
190
- return parsed.data.claims;
191
- }
192
- async write(claims) {
193
- const tmp = `${this.path}.${crypto.randomUUID()}.tmp`;
194
- await this.deps.fs.write(tmp, `${JSON.stringify({ format: FORMAT, claims }, null, "\t")}
195
- `);
196
- await this.deps.fs.rename(tmp, this.path);
197
- }
198
- }
199
- var SLOT_POOL = [
200
- { word: "cat", emoji: "\uD83D\uDE38" },
201
- { word: "bee", emoji: "\uD83D\uDC1D" },
202
- { word: "dog", emoji: "\uD83D\uDC36" },
203
- { word: "fox", emoji: "\uD83E\uDD8A" },
204
- { word: "owl", emoji: "\uD83E\uDD89" },
205
- { word: "pig", emoji: "\uD83D\uDC37" },
206
- { word: "lion", emoji: "\uD83E\uDD81" },
207
- { word: "wolf", emoji: "\uD83D\uDC3A" },
208
- { word: "bear", emoji: "\uD83D\uDC3B" },
209
- { word: "frog", emoji: "\uD83D\uDC38" },
210
- { word: "duck", emoji: "\uD83E\uDD86" },
211
- { word: "crab", emoji: "\uD83E\uDD80" }
212
- ];
213
- function freedLine({
214
- slot,
215
- stopped
216
- }) {
217
- return `${slot.word} ${slot.emoji} given back${stopped === null ? "" : `, its server (pid ${stopped}) stopped`}`;
218
- }
219
- function slotOf(word) {
220
- return SLOT_POOL.find((each) => each.word === word) ?? null;
221
- }
222
- var Claims = z.object({
223
- format: z.number(),
224
- claims: z.record(z.string(), z.string())
225
- });
226
-
227
- // heavy.ts
228
- var HEAVY_JOBS_DEFAULT2 = 2;
229
- var HEAVY_JOBS2 = "SPLATES_HEAVY_JOBS";
230
- var HEAVY_HELD2 = "SPLATES_HEAVY";
231
- function heavyJobsOfMachine2({
232
- fs,
233
- ps,
234
- log
235
- }) {
236
- return HeavyJobs.under(ps.env(MACHINE_HOME) ?? splatesHome(ps), {
237
- fs,
238
- ps,
239
- log,
240
- cap: capOf2(ps.env(HEAVY_JOBS2)),
241
- held: HEAVY_HELD2
242
- });
243
- }
244
- function capOf2(value) {
245
- const cap = Number(value);
246
- return Number.isInteger(cap) && cap > 0 ? cap : HEAVY_JOBS_DEFAULT2;
247
- }
248
-
249
- export { SERVER_PID, SLOT, MACHINE_HOME, Slots, SLOT_POOL, freedLine, slotOf, HEAVY_JOBS_DEFAULT2, HEAVY_JOBS2, HEAVY_HELD2, heavyJobsOfMachine2, capOf2 };
package/init.d.ts DELETED
@@ -1,28 +0,0 @@
1
- import { type Logger } from "webappwiz/log";
2
- import type { Fs, Ps } from "webappwiz/system";
3
- import type { Git } from "./git.js";
4
- import type { Projects } from "./projects.js";
5
- /**
6
- * Makes this repository a splates project: `repository` has set up its records
7
- * by now, when it had none, so what is left is installing the skill that
8
- * teaches its agents to work through splates, through `bunx skills add` from
9
- * this release's tag, and joining the registry, which
10
- * lets one `splates server` serve it beside every other. Run again, or in a
11
- * project already under way, it changes nothing that is already so.
12
- */
13
- export declare function init({ git, projects, fs, ps, log, }: {
14
- git: Git;
15
- projects: Projects;
16
- fs: Fs;
17
- ps: Ps;
18
- log: Logger;
19
- }): Promise<void>;
20
- /**
21
- * Takes this repository off the registry, so `splates server` no longer offers it:
22
- * its records stay, and `splates init` brings it back.
23
- */
24
- export declare function forget({ git, projects, log, }: {
25
- git: Git;
26
- projects: Projects;
27
- log: Logger;
28
- }): Promise<void>;
package/journal.d.ts DELETED
@@ -1,57 +0,0 @@
1
- import { type Fs, type Ps } from "webappwiz/system";
2
- import { type Action, type Event, type Facts, type FactsOf } from "./events.js";
3
- /** How long a log file is kept once it fills, so a live conversation can still show the events in it. */
4
- export declare const LOG_KEPT_MS: number;
5
- /** What a `Journal` is stored through; the real filesystem and process by default. */
6
- export interface JournalOptions {
7
- fs?: Fs;
8
- ps?: Ps;
9
- }
10
- /**
11
- * What has been done in this repo, oldest first. Events outlive their tasks:
12
- * `merge` and `remove` take the record with them, so this is the only thing
13
- * that remembers a task existed at all.
14
- *
15
- * Each event is appended, never rewritten, so two agents writing at once both
16
- * keep theirs. Once the file holds `capacity` events it is moved into the
17
- * `log` directory beside it, under a name that sorts by when, and a fresh one
18
- * starts; moved files go once they are `LOG_KEPT_MS` old.
19
- */
20
- export declare class Journal {
21
- private readonly path;
22
- private readonly capacity;
23
- private readonly fs;
24
- private readonly ps;
25
- private readonly archive;
26
- constructor(path: string, capacity: number, opts?: JournalOptions);
27
- record<A extends Action, T>(action: A, task: string | null, run: () => Promise<T>, ...[facts]: FactsOf<A, T>): Promise<T>;
28
- /**
29
- * Logs a wait as it begins, then `record`s how it ended with `began`
30
- * naming that first event, so the page can count it down while it runs.
31
- */
32
- waiting<A extends "wait" | "todo wait" | "creds wait", T>(action: A, task: string | null, facts: Omit<Facts[A], "began">, run: () => Promise<T>): Promise<T>;
33
- tail(count: number): Promise<Event[]>;
34
- /**
35
- * The events in the log and in the file moved aside last: every event
36
- * written since a reader last looked, so long as it looks before the log
37
- * fills twice over.
38
- */
39
- recent(): Promise<Event[]>;
40
- private append;
41
- /**
42
- * Moves the full file aside. Two writers rotating at once is harmless: the
43
- * second either finds nothing to move or moves the few events written since,
44
- * under a name of its own.
45
- */
46
- private rotate;
47
- /** The moved files, oldest first. */
48
- private archived;
49
- /**
50
- * The events in `path` that carry every fact their action records now:
51
- * one that went through before its action recorded them is left out,
52
- * since a reader trusts an event's facts as its type gives them.
53
- */
54
- private read;
55
- /** Every event in `path`, whatever facts it carries. */
56
- private parsed;
57
- }
package/landed.d.ts DELETED
@@ -1,14 +0,0 @@
1
- import { type Baseline } from "./baselines.js";
2
- import type { Outcome } from "./outcomes.js";
3
- /** How a merged task went, beside how its project's tasks went the week before. */
4
- export interface Landed {
5
- outcome: Outcome;
6
- /** Its project's tasks over the week to its merge, itself among them; null for none. */
7
- baseline: Baseline | null;
8
- }
9
- /**
10
- * The last merge of `task` in `project`, held against the week up to it, so
11
- * the comparison reads the same however long after it is asked. Null when it
12
- * never merged there.
13
- */
14
- export declare function landed(outcomes: Outcome[], project: string, task: string): Landed | null;
package/lane-todos.d.ts DELETED
@@ -1,44 +0,0 @@
1
- import type { Fs } from "webappwiz/system";
2
- import type { LaneRecord } from "./lanes.js";
3
- import type { TodoState } from "./todo.js";
4
- /** A todo in a lane, as a lane's orchestrator hears of it. */
5
- export interface LaneTodo {
6
- id: number;
7
- /** Its lane, by number and name, the name kept for once the lane ends. */
8
- lane: {
9
- id: number;
10
- name: string;
11
- };
12
- /** Whether a task has taken it. */
13
- taken: boolean;
14
- }
15
- /** What became of a todo in a lane since it was last seen. */
16
- export interface LaneTodoChange {
17
- todo: number;
18
- lane: {
19
- id: number;
20
- name: string;
21
- };
22
- /** `done` once it left the list, merged or removed; `open` once its task let it go. */
23
- change: "done" | "open";
24
- }
25
- /** The todos in a lane, out of every todo and the lanes on the board. */
26
- export declare function laneTodos(todos: TodoState[], lanes: LaneRecord[]): LaneTodo[];
27
- /**
28
- * What became of each todo in `before` by `now`: done for one gone from the
29
- * list, open for one taken then and not now. One that moved lanes, or came
30
- * into one, is neither.
31
- */
32
- export declare function laneChanges(before: LaneTodo[], now: LaneTodo[], all: TodoState[]): LaneTodoChange[];
33
- /**
34
- * The lane todos as last seen, kept on disk, so what changed while `splates
35
- * dev` was down is told once it is back.
36
- */
37
- export declare class SeenLaneTodos {
38
- private readonly fs;
39
- private readonly path;
40
- constructor(fs: Fs, path: string);
41
- /** What was last seen, or null before anything was. */
42
- read(): Promise<LaneTodo[] | null>;
43
- write(seen: LaneTodo[]): Promise<void>;
44
- }
@@ -1,17 +0,0 @@
1
- import { type Logger } from "webappwiz/log";
2
- import { type Fs, type Ps } from "webappwiz/system";
3
- /** Where the repository at `dir` keeps its todos, and what to do it with. */
4
- export interface LanesFromTagsOptions {
5
- /** The root of a repository, or of one of its worktrees. */
6
- dir: string;
7
- log?: Logger;
8
- fs?: Fs;
9
- ps?: Ps;
10
- }
11
- /**
12
- * Moves the todos of the repository at `dir` that still have tags, from
13
- * before splates kept lanes instead, into a lane a tag, and says where each
14
- * went; splates refuses to read them until then. Says nothing when `dir` is
15
- * no repository, keeps no todos, or none has tags.
16
- */
17
- export declare function lanesFromTags(opts: LanesFromTagsOptions): Promise<void>;
package/lanes.d.ts DELETED
@@ -1,96 +0,0 @@
1
- import type { TodoState } from "./todo.js";
2
- /**
3
- * What blocks which todos, and the lanes they run in, worked out from the
4
- * todos alone. Nothing here reads or writes the disk, so the CLI and the
5
- * `splates server` page draw the same lanes from the same list.
6
- */
7
- /** A todo that has to merge first, and where it stands now. */
8
- export interface Blocker {
9
- id: number;
10
- subject: string;
11
- /** The lane it is in, or null when it is in none. */
12
- lane: number | null;
13
- /** The task working on it, or null while nobody has it. */
14
- takenBy: string | null;
15
- }
16
- /**
17
- * A lane as stored: its number, never handed out again once it is gone, and
18
- * what it is called. Lanes are kept in the order the board shows them.
19
- */
20
- export interface LaneRecord {
21
- id: number;
22
- name: string;
23
- }
24
- /** A queue of todos that build on each other, worked top first. */
25
- export interface LaneState {
26
- id: number;
27
- name: string;
28
- todos: TodoState[];
29
- /** The tasks at work on its todos now, top first: who is on the lane. */
30
- agents: string[];
31
- /** The first todo no task has taken: what the lane's orchestrator hands out next. */
32
- next: TodoState | null;
33
- /**
34
- * Todos in other lanes, or in none, blocking `next` that have
35
- * yet to merge: what the lane is waiting on before it can go on.
36
- */
37
- blockers: Blocker[];
38
- /** `next` can be taken now: nothing blocking it is left but in this lane's hands. */
39
- ready: boolean;
40
- }
41
- /**
42
- * Every lane, in the order `records` keeps them, each with its todos in list
43
- * order. A lane some todo is in but `records` lacks, as one written before
44
- * lanes had names, comes last, called by its number.
45
- */
46
- export declare function lanes(todos: TodoState[], records: LaneRecord[]): LaneState[];
47
- /** `records`, and after them a record for each lane a todo is in that they lack. */
48
- export declare function named(todos: TodoState[], records: LaneRecord[]): LaneRecord[];
49
- /** The lane `record` stands for, empty when no todo is in it. */
50
- export declare function lane(todos: TodoState[], { id, name }: LaneRecord): LaneState;
51
- /** What blocks `todo` and has yet to merge, in list order. */
52
- export declare function blockersOf(todos: TodoState[], todo: TodoState): Blocker[];
53
- /** The todos `id` blocks, in list order. */
54
- export declare function followers(todos: TodoState[], id: number): TodoState[];
55
- /** Nothing blocking it is still open, and nobody has it: free to start. */
56
- export declare function isReady(todo: TodoState): boolean;
57
- /**
58
- * The todos that would form a loop if `blocker` blocked `id`, as the chain
59
- * from `id` round to itself in merge order, or null when there is none. A
60
- * loop is `id` already blocking `blocker`, however far down.
61
- */
62
- export declare function cycle(todos: TodoState[], id: number, blocker: number): number[] | null;
63
- /**
64
- * `todos` in list order, but with each one below every todo in its own lane
65
- * that blocks it: a todo that would come too soon is moved down to just
66
- * below the last of them, and everything else keeps its place.
67
- */
68
- export declare function settle(todos: TodoState[]): TodoState[];
69
- /**
70
- * The first pair in `todos`, in list order, where a todo sits above one in
71
- * its own lane that blocks it; null when the lanes all keep to their
72
- * links.
73
- */
74
- export declare function misordered(todos: TodoState[]): {
75
- todo: TodoState;
76
- blockedBy: TodoState;
77
- } | null;
78
- /** A blocking todo, and the lane it is in by name: `#177 in Licensing`. */
79
- export declare function blockerLabel({ id, lane }: {
80
- id: number;
81
- lane: number | null;
82
- }, records: LaneRecord[]): string;
83
- /**
84
- * A name for a lane holding `todos`, none of `taken`: its first todo's
85
- * subject, numbered past any lane already called that. The user renames it
86
- * to what the run adds up to.
87
- */
88
- export declare function aptName(todos: TodoState[], taken: string[]): string;
89
- /**
90
- * The todos a markdown text mentions as `#N`, once each, in the order
91
- * mentioned. Code spans and blocks are left out, where `#3` means something
92
- * else, as is `#N` inside a word or a link like `page#2`.
93
- */
94
- export declare function mentioned(text: string): number[];
95
- /** `#` and a number, standing on its own. */
96
- export declare const MENTION: RegExp;
package/legacy-names.d.ts DELETED
@@ -1,70 +0,0 @@
1
- import type { Logger } from "webappwiz/log";
2
- import type { Fs, Ps } from "webappwiz/system";
3
- /** splates's old name, as its command, its skill and its directories went by. */
4
- export declare const LEGACY = "arbor";
5
- /** The old name of a `SPLATES_*` variable or cred, or null for any other. */
6
- export declare function legacyName(name: string): string | null;
7
- /** The `SPLATES_*` name of an `ARBOR_*` variable or cred, or null for any other. */
8
- export declare function renamed(old: string): string | null;
9
- /** A task's notes file in a worktree made before the rename. */
10
- export declare const LEGACY_PLAN_FILE = "ARBOR.md";
11
- /** The state directory under `.git`, and the home directory's, before the rename. */
12
- export declare const LEGACY_DIR = "arbor";
13
- /** Says once per process, on stderr, that an old name was used. */
14
- declare class Warnings {
15
- #private;
16
- once(name: string, instead: string): void;
17
- }
18
- export declare const legacyWarnings: Warnings;
19
- /**
20
- * `next`, or `old` while only the old directory is there: until `splates server`
21
- * has moved it, every command reads records where arbor left them.
22
- */
23
- export declare function unmigrated(next: string, old: string): string;
24
- /** What `moveLegacyDir` works with. */
25
- export interface MoveOptions {
26
- fs: Fs;
27
- log: Logger;
28
- /** Makes `path` a symbolic link to `target`; the real one by default. */
29
- link?: (target: string, path: string) => Promise<void>;
30
- }
31
- /**
32
- * Moves arbor's directory `old` to `next` and leaves a link at `old`, so the
33
- * absolute paths records hold, attachments named in plans, todos and
34
- * conversations above all, still resolve. Does nothing once moved, or when
35
- * `next` is already there. Answers whether it moved.
36
- */
37
- export declare function moveLegacyDir(old: string, next: string, { fs, log, link }: MoveOptions): Promise<boolean>;
38
- /** Renames a worktree's `ARBOR.md` to `planFile`, unless it has one already. */
39
- export declare function movePlan(tree: string, planFile: string, fs: Fs): Promise<void>;
40
- /**
41
- * `path` under `.git/splates` when it names a file under `.git/arbor`, as
42
- * plans, todos and conversations written before the move do.
43
- */
44
- export declare function movedPath(path: string): string;
45
- /** The old name of the file a repo keeps `file`'s settings in, or null. */
46
- export declare function legacyFile(file: string): string | null;
47
- /** What `renameLegacyFiles` and `removeLegacySkill` work with. */
48
- export interface LegacyRepoOptions {
49
- /** The repository's main tree. */
50
- root: string;
51
- fs: Fs;
52
- ps: Ps;
53
- log: Logger;
54
- }
55
- /**
56
- * Renames `arbor.config.ts` and `arbor.systems.ts` to splates's names, through
57
- * git when it tracks them so the rename is staged as one, and points their
58
- * imports of `@webappwiz/arbor` at `@stringsync/splates`. Leaves a file alone when one
59
- * under the new name is already there.
60
- */
61
- export declare function renameLegacyFiles({ root, fs, ps, log, }: LegacyRepoOptions): Promise<void>;
62
- /**
63
- * Takes arbor's skill at `path` out of its project, which splates's replaces.
64
- * Leaves one that links to a copy kept by hand.
65
- */
66
- export declare function removeLegacySkill(path: string, { fs, log }: {
67
- fs: Fs;
68
- log: Logger;
69
- }): Promise<void>;
70
- export {};
package/legacy-ps.d.ts DELETED
@@ -1,31 +0,0 @@
1
- import type { Resource } from "webappwiz/disposable";
2
- import { type Child, type Ps, type SpawnCaptureResult, type SpawnOptions, type SpawnResult, type StartOptions, type TerminalChild, type TerminalOptions } from "webappwiz/system";
3
- /**
4
- * A `Ps` that reads each `SPLATES_*` variable under its `ARBOR_*` name too,
5
- * warning once, and sets both names on every child, so a `wiz` or skill still
6
- * reading the old ones sees what splates means.
7
- */
8
- export declare class LegacyNamesPs implements Ps {
9
- private readonly inner;
10
- constructor(inner: Ps);
11
- get platform(): NodeJS.Platform;
12
- get pid(): number;
13
- get hostname(): string;
14
- get args(): string[];
15
- get self(): string[];
16
- env(name: string): string | undefined;
17
- alive(pid: number): boolean;
18
- spawn(argv: string[], opts?: SpawnOptions): Promise<SpawnResult>;
19
- spawnCapture(argv: string[], opts?: SpawnOptions): Promise<SpawnCaptureResult>;
20
- start(argv: string[], opts?: StartOptions): Child;
21
- startOnTerminal(argv: string[], opts: TerminalOptions): TerminalChild;
22
- processes(): ReturnType<Ps["processes"]>;
23
- listening(): ReturnType<Ps["listening"]>;
24
- cwd(): string;
25
- cd(path: string): void;
26
- exit(code: number): void;
27
- on(signal: string, handler: (...args: unknown[]) => void): Resource;
28
- once(event: "exit", handler: () => void): Resource;
29
- }
30
- /** The machine's processes, under both names. */
31
- export declare function systemPs(): Ps;
package/limits.d.ts DELETED
@@ -1,32 +0,0 @@
1
- import type { Fs } from "webappwiz/system";
2
- import { type Limit } from "./conversations.js";
3
- /**
4
- * Each agent's plan limits as it last said, from any project, kept under the
5
- * user's home: a new conversation shows how much of the plan is left before
6
- * any conversation in its project has said.
7
- */
8
- export declare class Limits {
9
- /** `~/.splates/limits.json`, or a test's own. */
10
- readonly path: string;
11
- private readonly deps;
12
- /** Read once, then kept: this process is the one writing it. */
13
- private known;
14
- /** Set when a newer splates wrote the file, which this one leaves alone. */
15
- private newer;
16
- /** Writes one after another, so none is lost to another. */
17
- private writing;
18
- constructor(
19
- /** `~/.splates/limits.json`, or a test's own. */
20
- path: string, deps: {
21
- fs: Fs;
22
- });
23
- /** Every agent's limits, by its id; none for one that never said. */
24
- all(): Promise<Record<string, Limit[]>>;
25
- /**
26
- * Keeps each of `limits` that is newer than what `agent` said of its
27
- * window before: a log read back can be older than another project's.
28
- */
29
- remember(agent: string, limits: Limit[]): Promise<void>;
30
- private read;
31
- private write;
32
- }
package/list.d.ts DELETED
@@ -1,18 +0,0 @@
1
- import { type Logger } from "webappwiz/log";
2
- import type { Fs } from "webappwiz/system";
3
- import type { WorktreeService } from "./worktree-service.js";
4
- export interface ListOptions {
5
- /** Print the rows as JSON instead of a table. */
6
- json?: boolean;
7
- /**
8
- * Add each task's Goal and changed files, which is what an agent checks
9
- * its own plan against before starting. Off by default: it costs git calls
10
- * and a file read per task.
11
- */
12
- files?: boolean;
13
- }
14
- export declare function list({ service, log, fs }: {
15
- service: WorktreeService;
16
- log: Logger;
17
- fs: Fs;
18
- }, { json, files }?: ListOptions): Promise<void>;