@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/conversation.d.ts DELETED
@@ -1,209 +0,0 @@
1
- import type { Resource } from "webappwiz/disposable";
2
- import { type Eventful } from "webappwiz/events";
3
- import type { Agent, ProcessHandle } from "./agent-process.js";
4
- import { Artifacts } from "./artifacts.js";
5
- import type { ConversationDeps, ConversationEvents, ConversationHost } from "./conversation-host.js";
6
- import { ConversationLog } from "./conversation-log.js";
7
- import { type Answer, type Attached, type ConversationState, type Device, type Limit, type Upload } from "./conversation-state.js";
8
- import { type PromptOptions } from "./conversation-turns.js";
9
- /**
10
- * One conversation with one agent. Live, it holds the agent's process; read
11
- * back from its log, it is what was said, and resumes on the next prompt.
12
- */
13
- export declare class Conversation implements Eventful<ConversationEvents>, Resource, ConversationHost {
14
- readonly state: ConversationState;
15
- readonly log: ConversationLog;
16
- private readonly deps;
17
- /** What to run to resume it; null when its agent is no longer known. */
18
- readonly agent: Agent | null;
19
- /** Where it runs; null for a log too old to say. */
20
- private dir;
21
- private readonly dispatcher;
22
- readonly events: import("webappwiz/events").Events<ConversationEvents>;
23
- private readonly files;
24
- /** The files its agent kept as its outputs, read and changed here. */
25
- readonly artifacts: Artifacts;
26
- private readonly connection;
27
- private readonly turns;
28
- private readonly background;
29
- /** Under way while the agent starts or comes back, for a prompt to wait on. */
30
- opening: Promise<void> | null;
31
- /** Stops the agent once it has sat idle `IDLE_STOP`; null while it works. */
32
- private resting;
33
- /** Let go of its process for a restart: nothing here ends it now. */
34
- private detached;
35
- private constructor();
36
- /**
37
- * A conversation as its log at `path` left it: stopped, whatever it was
38
- * doing, unless its agent still runs on a worker, which the launcher
39
- * takes back, and the conversation carries on where the log leaves off.
40
- */
41
- static read(path: string, agents: Agent[], deps: ConversationDeps): Promise<Conversation | null>;
42
- /** Starts `agent` in `cwd` and opens a session with it. */
43
- static start({ settings, model, ...opening }: Opening & {
44
- /** Values to set, by setting id, once the session offers them. */
45
- settings?: Record<string, string>;
46
- /**
47
- * The model to pick, by its value or name in the session's model
48
- * setting, over what `settings` says. An unavailable choice fails.
49
- */
50
- model?: string;
51
- }, deps: ConversationDeps): Promise<Conversation>;
52
- /**
53
- * Brings in `session`, one `agent` holds outside splates, such as from its
54
- * CLI: loads it in `cwd`, writing what the agent replays of it to a new
55
- * log, from which it resumes like any other.
56
- */
57
- static bring({ session, title, ...opening }: Opening & {
58
- session: string;
59
- /** What the agent listed it as, until the replay says otherwise. */
60
- title: string | null;
61
- }, deps: ConversationDeps): Promise<Conversation>;
62
- /** A new conversation with `agent` in `cwd`, its log begun, not yet opened. */
63
- private static begin;
64
- get id(): string;
65
- /** The agent's pid while it runs, for the commands it left running. */
66
- get pid(): number | null;
67
- /**
68
- * The handle for reattaching after a coordinator restart, or null when
69
- * this process cannot survive a restart.
70
- */
71
- get handle(): ProcessHandle | null;
72
- /** The agent's session, once it has opened one. */
73
- get sessionId(): string | null;
74
- /** Where it runs; null for a log too old to say. */
75
- get cwd(): string | null;
76
- /**
77
- * When it was archived, or when it started for a log too old to say; null
78
- * while it is not archived.
79
- */
80
- get archivedSince(): string | null;
81
- /** Whether a checkpoint has ended and nothing has been said since. */
82
- get stoppedByCheckpoint(): boolean;
83
- now(): string;
84
- /** Says `text` to the agent, with `files` (see `ConversationTurns`). */
85
- prompt(text: string, files?: Upload[], from?: Device, opts?: PromptOptions): Promise<void>;
86
- /** Takes back the `index`th queued message, answering with its words and files. */
87
- unqueue(index: number): {
88
- text: string;
89
- files: Attached[];
90
- };
91
- /** Sends what is queued now, stopping the running turn first. */
92
- sendNow(): Promise<void>;
93
- /** Stops the agent's turn for the person, and stays open for the next. */
94
- cancel(): Promise<void>;
95
- /** Asks the agent to bring its `SPLATES.md` up to date and stop (see `ConversationTurns`). */
96
- checkpoint(merging: boolean): Promise<void>;
97
- /**
98
- * Checkpoints the agent for the person, as `checkpoint` does, and leaves
99
- * it stopped there: nothing resumes a pause, and Power leaves it alone.
100
- */
101
- pause(merging: boolean): Promise<void>;
102
- /** Forgets the checkpoint, done or not, so the next starts afresh. */
103
- dismissCheckpoint(): void;
104
- /** Settles once the checkpoint asked is no longer under way. */
105
- answered(): Promise<void>;
106
- /** Settles the agent's pending ask, if `id` is still the one it is on. */
107
- answer(id: string, answer: Answer): void;
108
- /** The file `name` the person sent, or null when they sent none by that name. */
109
- attachment(name: string): Promise<{
110
- bytes: Uint8Array;
111
- mimeType: string;
112
- } | null>;
113
- /** Keeps the plan's windows in `limits`, asked of the agent's maker. */
114
- hear(limits: Limit[]): void;
115
- /** Stops background command `id`, leaving the agent's turn as it is. */
116
- stopBackground(id: string): Promise<void>;
117
- /** What background command `id` has printed, then more as it prints it. */
118
- backgroundOutput(id: string): ReadableStream<Uint8Array>;
119
- /**
120
- * Sets the session's setting `id` to `value`, one the agent offers: at once
121
- * while the agent runs, or, while it is stopped, when it next resumes.
122
- */
123
- choose(id: string, value: string): Promise<void>;
124
- /**
125
- * Brings a stopped conversation back: a new process, the same session, or
126
- * a new one when its agent died before opening one.
127
- */
128
- resume(): Promise<void>;
129
- /**
130
- * Follows the agent into a task's worktree, or back to the main tree: a
131
- * running session keeps the directory it opened in, and the agent works by
132
- * absolute path; a resumed one opens in the new.
133
- */
134
- move(task: string | null, cwd: string, base?: string | null, caller?: string | null): void;
135
- /** Stops the agent; the next prompt resumes where it left off. */
136
- stop(): Promise<void>;
137
- /**
138
- * Lets go of the agent's process without ending it, for a coordinator
139
- * started again to take back from the worker: its log, flushed, says
140
- * where it stopped. Answers whether there was one to let go of; a
141
- * conversation with none, or one nothing could take back, stops as ever.
142
- */
143
- detach(): Promise<boolean>;
144
- /**
145
- * Stops it and puts it away, off the list of conversations; `with`, the
146
- * conversation whose archiving takes it along, which brings it back.
147
- * Its artifacts keep only what their panel shows.
148
- */
149
- archive(withConversation?: string): Promise<void>;
150
- /** Names it `name` over the agent's title; blank goes back to the title. */
151
- rename(name: string): Promise<void>;
152
- /** Back on the list, stopped until the next prompt. */
153
- unarchive(): Promise<void>;
154
- /** Keeps it atop the list, or lets it go back among the rest. */
155
- pin(pinned: boolean): Promise<void>;
156
- /**
157
- * Nests it in the list under the conversation `id`, or at the top for
158
- * null, over where its task would, cutting it loose from the conversation
159
- * that started it or added its task: that one no longer tells it, hears
160
- * from it, or archives it along. Never for a subagent, which stays with
161
- * the one it answers to.
162
- */
163
- reparent(id: string | null): Promise<void>;
164
- /** Settles once everything said so far is in its log, for a reader of the file. */
165
- saved(): Promise<void>;
166
- /** Marks it seen, or unseen again for the person to come back to. */
167
- markUnread(unread: boolean): Promise<void>;
168
- /** Stops it and deletes its log and files, for good. */
169
- delete(): Promise<void>;
170
- dispose(): void;
171
- /** Marks it `unread` or not, keeping how much was seen when it was read. */
172
- flag(unread: boolean): void;
173
- /** Back to idle once a turn ends, then on to what was queued meanwhile. */
174
- ended(error: string | null): void;
175
- /** Ends the agent's process, with `error` for one that failed, and keeps that it stopped. */
176
- close(error: string | null): Promise<void>;
177
- set(next: Partial<ConversationState>): void;
178
- changed(): void;
179
- /**
180
- * Stops an agent left idle `IDLE_STOP`, with no command running in the background,
181
- * no question open and no checkpoint, so its process exits and takes what
182
- * it started along, MCP servers and browsers included. The next prompt
183
- * resumes the same session.
184
- */
185
- private rest;
186
- /** Opens the agent in `cwd`, clearing `opening` once it has or failed to. */
187
- private wake;
188
- }
189
- /** What a conversation is opened with, started afresh or brought in. */
190
- interface Opening {
191
- id: string;
192
- agent: Agent;
193
- task: string | null;
194
- /** The branch `task` was cut from. */
195
- base?: string | null;
196
- /** The conversation whose agent added `task`. */
197
- caller?: string | null;
198
- cwd: string;
199
- log: string;
200
- /** Started on what a todo or `splates add --agent` assigned. */
201
- assigned?: boolean;
202
- /** The conversation that handed it its task, which it answers to. */
203
- handedBy?: string | null;
204
- /** The lane orchestrator that handed it its task, which hears when it stops. */
205
- startedBy?: string | null;
206
- /** The project's splates skill version as it starts; null when it has none. */
207
- skill?: string | null;
208
- }
209
- export {};
@@ -1,140 +0,0 @@
1
- import type { ConversationsOptions } from "./conversation-options.js";
2
- export type { ConversationsOptions } from "./conversation-options.js";
3
- import type { Resource } from "webappwiz/disposable";
4
- import { type Eventful } from "webappwiz/events";
5
- import { type Agent, type Session } from "./agent-process.js";
6
- import { Conversation } from "./conversation.js";
7
- import type { ConversationsEvents } from "./conversation-host.js";
8
- import type { Limit, Setting } from "./conversation-state.js";
9
- /** How many archived conversations are kept; older archived ones are deleted. */
10
- export declare const ARCHIVED_KEPT = 200;
11
- /**
12
- * Every conversation in the repo: the live ones this process started, and
13
- * the stopped ones read back from their logs, one JSON-lines file each under
14
- * `.git/splates/conversations`.
15
- */
16
- export declare class Conversations implements Eventful<ConversationsEvents>, Resource {
17
- readonly dir: string;
18
- readonly agents: Agent[];
19
- private readonly dispatcher;
20
- readonly events: import("webappwiz/events").Events<ConversationsEvents>;
21
- private readonly known;
22
- private readonly fs;
23
- private readonly ids;
24
- private readonly launcher;
25
- private readonly machine;
26
- private readonly starting;
27
- private readonly timer;
28
- private readonly clock;
29
- private readonly watch;
30
- private readonly offered;
31
- private readonly limited;
32
- private readonly adherence;
33
- private readonly outcomes;
34
- private readonly readLimits;
35
- private readonly root;
36
- private readonly projects;
37
- private readonly servers;
38
- private readonly artifacts;
39
- /** What every conversation's artifacts make room through, across the project. */
40
- private readonly room;
41
- /** The read of the records on disk, shared by every caller until it settles. */
42
- private loaded;
43
- /** The last deletion of archived conversations past `ARCHIVED_KEPT`, so they run one at a time. */
44
- private pruning;
45
- /** When each agent's limits were last asked for, by its id, in epoch ms. */
46
- private readonly asked;
47
- /** Where `splates server` answers, once it does, for the agents' CLI. */
48
- url: string | null;
49
- /** New starts use the refreshed roster; existing conversations retain their snapshot. */
50
- refreshRoster(agents: Agent[]): void;
51
- constructor(dir: string, agents: Agent[], opts?: ConversationsOptions);
52
- /** What each conversation is made with. */
53
- private get deps();
54
- /**
55
- * What each agent's sessions last offered, from any project, by its id:
56
- * what a first conversation with one shows before it starts.
57
- */
58
- settings(): Promise<Record<string, Setting[]>>;
59
- /**
60
- * Each agent's plan limits as it last said, from any project, by its id:
61
- * what a new conversation shows before one here says.
62
- */
63
- limits(): Promise<Record<string, Limit[]>>;
64
- /**
65
- * Asks each agent that does not send its limits for them, unless it was
66
- * asked within `LIMITS_FRESH`, and keeps what it says for every project.
67
- */
68
- refreshLimits(): Promise<void>;
69
- /** Every conversation, newest first. */
70
- list(): Promise<Conversation[]>;
71
- find(id: string): Promise<Conversation>;
72
- /**
73
- * Starts a conversation with `agent` in `cwd`, for `task` if it is one's,
74
- * with `settings` set once the session offers them.
75
- */
76
- start(agent: string, { task, base, caller, cwd, settings, model, assigned, handedBy, startedBy, }: {
77
- task: string | null;
78
- /** The branch `task` was cut from. */
79
- base?: string | null;
80
- /** The conversation whose agent added `task`. */
81
- caller?: string | null;
82
- cwd: string;
83
- settings?: Record<string, string>;
84
- /** The model to start on, by its value or name in the model setting. */
85
- model?: string;
86
- /** Whether a todo or `splates add --agent` assigned the agent and model. */
87
- assigned?: boolean;
88
- /** The conversation that handed it its task, which it answers to. */
89
- handedBy?: string | null;
90
- /** The lane orchestrator that handed it its task, which hears when it stops. */
91
- startedBy?: string | null;
92
- }): Promise<Conversation>;
93
- /**
94
- * The sessions each agent holds in `cwd` that splates does not, such as ones
95
- * started in its CLI, to bring in: newest first, from every agent that
96
- * lists and loads sessions.
97
- */
98
- sessions(cwd: string): Promise<Session[]>;
99
- /**
100
- * Brings in `session`, one `agent` holds outside splates, as a conversation
101
- * in `cwd`, for `task` if it is one's.
102
- */
103
- bring(agent: string, session: string, { task, base, caller, cwd, title, }: {
104
- task: string | null;
105
- /** The branch `task` was cut from. */
106
- base?: string | null;
107
- /** The conversation whose agent added `task`. */
108
- caller?: string | null;
109
- cwd: string;
110
- title?: string | null;
111
- }): Promise<Conversation>;
112
- /**
113
- * Deletes the archived conversations past the `ARCHIVED_KEPT` archived
114
- * most recently, so their logs do not pile up, their artifacts and
115
- * attached files going with them.
116
- */
117
- prune(): Promise<void>;
118
- /** Stops every live conversation, so no agent outlives the server. */
119
- disposeAsync(): Promise<void>;
120
- /**
121
- * Lets go of every agent a worker runs, for a coordinator started again
122
- * to take back, and says whether there was any: the rest stop as ever.
123
- */
124
- detachAsync(): Promise<boolean>;
125
- dispose(): void;
126
- private track;
127
- /** Asks for `conversation`'s agent's limits, when it does not send them. */
128
- private askLimits;
129
- private load;
130
- private trim;
131
- private read;
132
- }
133
- export type { Agent, AgentProcess, Launch, Launcher, Session, } from "./agent-process.js";
134
- export { launch } from "./agent-process.js";
135
- export type { Artifact, ArtifactGone, ArtifactVersion, } from "./artifacts.js";
136
- export { Conversation } from "./conversation.js";
137
- export type { ConversationEvents, ConversationsEvents, } from "./conversation-host.js";
138
- export type { After, Answer, Ask, Attached, Background, BackgroundState, Checkpoint, Command, Compaction, ConversationState, Decision, Device, Edit, Field, Image, Limit, Message, Part, Setting, Status, Step, Taking, Tool, Upload, Usage, } from "./conversation-state.js";
139
- export { DEVICES, FROM_HEADER, unused } from "./conversation-state.js";
140
- export { fold, heard } from "./fold.js";
@@ -1,28 +0,0 @@
1
- import type { Fs } from "webappwiz/system";
2
- import type { KeptShell } from "./dev-shell.js";
3
- /**
4
- * What one `splates server` keeps across its own restarts, in
5
- * `~/.splates/coordinator.json`: the session id its workers know it by, so a
6
- * worker finds the next run unchanged and keeps every agent it runs for it,
7
- * and the roots of the projects whose agents it let go of at its last
8
- * restart, for the next run to serve before the worker joins and take them
9
- * back, and the shells it let go of, for the next run to take back too.
10
- */
11
- export declare class CoordinatorState {
12
- readonly path: string;
13
- private readonly fs;
14
- /** What this coordinator's worker sessions answer as, the same across restarts. */
15
- readonly session: string;
16
- /** The projects with agents on the worker at the last restart; none after a fresh start. */
17
- readonly roots: string[];
18
- /** The pages' shells on the worker at the last restart, by key. */
19
- readonly terminals: KeptShell[];
20
- private constructor();
21
- /**
22
- * Reads what the last run kept at `path`, or starts afresh with a session
23
- * of its own, written there so the next run answers as the same.
24
- */
25
- static open(path: string, fs: Fs): Promise<CoordinatorState>;
26
- /** Keeps `roots` as the projects whose agents, and `terminals` as the shells, the next run takes back. */
27
- write(roots: string[], terminals: KeptShell[]): Promise<void>;
28
- }
@@ -1,7 +0,0 @@
1
- /**
2
- * The hottest CPU die sensor on an Apple Silicon Mac, in °C, or null when
3
- * none answers. macOS has no public API for these, and `powermetrics` needs
4
- * sudo, so this asks IOKit's private HID event system the way macmon and
5
- * Stats do, which any user may.
6
- */
7
- export declare function darwinTemperature(): number | null;
package/decided.d.ts DELETED
@@ -1,18 +0,0 @@
1
- import type { Outcome } from "./outcomes.js";
2
- import type { Decision } from "./plan.js";
3
- /**
4
- * Who made `decision`: the person, for one put to them or an assumption
5
- * they challenged, which took their attention either way; otherwise the
6
- * agent, whose assumption stood without them.
7
- */
8
- export declare function whose(decision: Pick<Decision, "how" | "ended">): "decidedByYou" | "decidedByAgents";
9
- /** How many calls in `outcome` `who` made. */
10
- export declare function madeBy(outcome: Outcome, who: ReturnType<typeof whose>): number;
11
- /**
12
- * The calls `outcome` made, each with how many it stands for: its own
13
- * decisions one each, or for a line from before they were kept, its counts
14
- * read back as unsized calls.
15
- */
16
- export declare function decided(outcome: Outcome): [Pick<Decision, "size" | "how" | "ended">, number][];
17
- /** Whether `outcome` kept its calls at all: lines from before any were kept say nothing of them. */
18
- export declare function keptDecisions(outcome: Outcome): boolean;
package/demo.d.ts DELETED
@@ -1,29 +0,0 @@
1
- /**
2
- * Something to try, as the skill writes it under `### 🎬 Demo: <title>`:
3
- * where, then numbered steps.
4
- */
5
- export interface Demo {
6
- /** What it shows, from its heading; null when the heading says none. */
7
- title: string | null;
8
- /** Where to try it and anything said before the steps, as markdown. */
9
- intro: string;
10
- steps: Step[];
11
- }
12
- /** A step of a demo: what to do, on its line, and what to see, under it. */
13
- export interface Step {
14
- number: string;
15
- action: string;
16
- /** What should happen, screenshots included, as markdown. */
17
- expect: string;
18
- }
19
- /**
20
- * The demo titled at `start`: what it says up to its steps, or to `until`,
21
- * where something else begins, then its steps, and the line after them; null
22
- * for any other line.
23
- */
24
- export declare function demoAt(lines: string[], start: number, until: number): {
25
- demo: Demo;
26
- end: number;
27
- } | null;
28
- /** Whether `line` titles a demo. */
29
- export declare function isDemoTitle(line: string): boolean;
package/dev/api.d.ts DELETED
@@ -1,209 +0,0 @@
1
- /**
2
- * The page's writes: the same core functions as `splates todo add`, `update`
3
- * and `remove`, and the lanes' own.
4
- * A refusal comes back as the CLI's own reason and message, thrown so the
5
- * caller can show it.
6
- */
7
- import type { HeavyJobsReading } from "webappwiz/system";
8
- import type { KeptCred, Scope } from "../creds.js";
9
- import type { PortLink } from "../dev-task-ports.js";
10
- import type { FileDiff } from "../diff.js";
11
- import type { Landed } from "../landed.js";
12
- import type { MachineReading } from "../machine.js";
13
- import type { Wants } from "../notices.js";
14
- import type { AgentPick } from "../roster.js";
15
- import type { SetupProgress } from "../setup.js";
16
- import type { PeriodId, Stats } from "../stats.js";
17
- import type { SystemsReport } from "../system-changes.js";
18
- import type { NamedSystem } from "../systems.js";
19
- export declare class ApiError extends Error {
20
- readonly reason: string;
21
- constructor(reason: string, message: string);
22
- }
23
- /**
24
- * `path` for the project this page shows: the one `?project=` names, or none
25
- * for the one `splates server` started in, unless `path` names one itself. Every
26
- * request the page makes goes through here.
27
- */
28
- export declare function scoped(path: string): string;
29
- /**
30
- * POSTs to `path` for this project, or as `init` says, answering with the
31
- * body, or throwing the refusal as an `ApiError`.
32
- */
33
- export declare function send(path: string, init: RequestInit): Promise<unknown>;
34
- /** A todo's files: new ones to add, and the stored ones to keep. */
35
- export interface FilesForm {
36
- files: File[];
37
- /** Paths of files already stored to keep; the rest are dropped. */
38
- keep: string[];
39
- }
40
- /** What a todo says: a line, and whatever more there is to say. */
41
- export interface TodoForm {
42
- subject: string;
43
- text: string;
44
- /** Where it goes in the list, 1 at the top; absent leaves it be. */
45
- position?: number;
46
- }
47
- /** Adds a todo at the bottom of `lane`, or of the untriaged ones for null. */
48
- export declare function addTodo({ subject, text, position }: TodoForm, files: File[], lane?: number | null): Promise<void>;
49
- export declare function updateTodo(id: number, { subject, text, position, files, keep }: FilesForm & TodoForm): Promise<void>;
50
- /** Puts a todo at `position`, 1 at the top, moving the rest around it. */
51
- export declare function moveTodo(id: number, position: number): Promise<void>;
52
- /** `send` with `body` as JSON, by `method`. */
53
- export declare function sendJson(path: string, method: string, body: unknown): Promise<unknown>;
54
- /** Says `id` is blocked by exactly the todos in `blockedBy`, no more and no fewer. */
55
- export declare function linkTodo(id: number, blockedBy: number[]): Promise<void>;
56
- /**
57
- * Puts a todo in `lane` (`"new"` for one of its own, null for none), just
58
- * above the todo `before`, or at the bottom of the lane without one.
59
- */
60
- export declare function arrangeTodo(id: number, lane: number | "new" | null, before?: number,
61
- /** What to call a new lane; named after the todo without one. */
62
- name?: string): Promise<void>;
63
- /** Has `assignee` work todo `id`, or nobody in particular for null. */
64
- export declare function assignTodo(id: number, assignee: AgentPick | null): Promise<void>;
65
- /** Moves lane `from`'s todos to the bottom of lane `into`. */
66
- export declare function joinLanes(from: number, into: number): Promise<void>;
67
- /** Starts an empty lane called `name`, after the others. */
68
- export declare function addLane(name: string): Promise<void>;
69
- /** Calls lane `id` by another name. */
70
- export declare function renameLane(id: number, name: string): Promise<void>;
71
- /** Puts lane `id` at `position` among the lanes, 1 the first column. */
72
- export declare function moveLane(id: number, position: number): Promise<void>;
73
- /** Removes lane `id`, putting its todos back with the untriaged ones. */
74
- export declare function dropLane(id: number): Promise<void>;
75
- /** Removes a todo, kept for `restoreTodo` to put back. */
76
- export declare function removeTodo(id: number): Promise<void>;
77
- /** Puts back a todo `removeTodo` removed, under its id, where it stood. */
78
- export declare function restoreTodo(id: number): Promise<void>;
79
- /** Where the page loads a file a todo holds. */
80
- export declare function fileUrl(path: string): string;
81
- /**
82
- * The files and directories (ending in `/`) a task's tree holds, or the main
83
- * tree's for none: what `@` offers.
84
- */
85
- export declare function paths(task?: string): Promise<string[]>;
86
- /** Every system `task`'s worktree names, or the main tree's for none. */
87
- export declare function systems(task?: string): Promise<NamedSystem[]>;
88
- /** What each system holds on trunk, and the commits that lately changed it. */
89
- export declare function systemChanges(): Promise<SystemsReport>;
90
- /** What `task` changed against its base, uncommitted edits included. */
91
- export declare function taskDiff(task: string): Promise<FileDiff[]>;
92
- /**
93
- * How `task` went once it merged, beside its project's week before; null
94
- * when it never merged here.
95
- */
96
- export declare function taskOutcome(task: string): Promise<Landed | null>;
97
- /**
98
- * Gives `task`, escalated once it spent its merge attempts, another round of
99
- * them, as `splates retry` does.
100
- */
101
- export declare function retryTask(task: string): Promise<void>;
102
- /**
103
- * `splates remove` for `task`, past any lease, stopping each conversation in
104
- * its tree and moving it to the main tree.
105
- */
106
- export declare function removeTask(task: string): Promise<void>;
107
- /**
108
- * How tasks ended across every project, summed for the Stats page over
109
- * `period`.
110
- */
111
- export declare function stats(period: PeriodId): Promise<Stats>;
112
- /**
113
- * The email Cloudflare Access signed this page's visitor in with, or null
114
- * when the page is opened on this machine or Access is off.
115
- */
116
- export declare function identity(): Promise<string | null>;
117
- /**
118
- * Each port a task serves now, with its link through the ports host, if one
119
- * is saved, and on the machine `splates server` runs on.
120
- */
121
- export declare function taskPorts(): Promise<PortLink[]>;
122
- /** What the page shows of the machine: its reading, and its heavy jobs. */
123
- export type MachineStatus = MachineReading & {
124
- heavy: HeavyJobsReading;
125
- };
126
- /** How hard the machine `splates server` runs on is working right now. */
127
- export declare function machine(): Promise<MachineStatus>;
128
- /** This machine's setup: every step checked, by area, and the one to do next. */
129
- export declare function setup(): Promise<SetupProgress>;
130
- /** Skips setup step `step`, or asks for it again, answering the fresh progress. */
131
- export declare function skipSetupStep(step: string, skipped: boolean): Promise<SetupProgress>;
132
- /** Marks setup seen on this machine, so the page stops nudging towards it. */
133
- export declare function seeSetup(): Promise<SetupProgress>;
134
- /** The public key this device subscribes to the server's pushes with. */
135
- export declare function pushKey(): Promise<string>;
136
- /** Has the server push this device the notices `wants` asks for, at `subscription`. */
137
- export declare function subscribePush(subscription: PushSubscriptionJSON, wants: Wants & {
138
- inFront: boolean;
139
- }): Promise<void>;
140
- /** Has the server stop pushing to the subscription `endpoint` names. */
141
- export declare function unsubscribePush(endpoint: string): Promise<void>;
142
- /** What the project's store and the device's keep, by name, and what each store is called. */
143
- export interface KeptCreds {
144
- kept: KeptCred[];
145
- labels: Record<Scope, string>;
146
- }
147
- /** The creds kept for this project and this device; never a value. */
148
- export declare function keptCreds(): Promise<KeptCreds>;
149
- /**
150
- * Keeps `value` as `name`: in the scope its open request asked for, else in
151
- * `scope`. The value goes to the store and never comes back.
152
- */
153
- export declare function saveCred(name: string, value: string, scope?: Scope): Promise<void>;
154
- export declare function removeCred(name: string, scope: Scope): Promise<void>;
155
- /** Turns down the open request for `name`, so the agent waiting on it stops. */
156
- export declare function dismissCred(name: string): Promise<void>;
157
- /**
158
- * Where a project's scry budgets stand, as `splates dev scry budgets --format json`
159
- * prints it; splates only passes it on, so this mirrors the CLI's type.
160
- */
161
- export interface Budgets {
162
- /** Whether any config or change declares budgets. */
163
- declared: boolean;
164
- roles: RoleBudget[];
165
- }
166
- /** Where one model's budget stands. */
167
- export interface RoleBudget {
168
- role: "som" | "llm";
169
- /** Like `5m/day`, `nothing` or `unlimited`; none when undeclared. */
170
- spend: string | null;
171
- /** The config or file that declared it. */
172
- from: string | null;
173
- /** Whether it was set here, over the configs. */
174
- set: boolean;
175
- standing: {
176
- /** Like `today` or `the last 7d`. */
177
- window: string;
178
- tokens: number;
179
- raised: number;
180
- spent: number;
181
- left: number;
182
- }[];
183
- raises: {
184
- id: number;
185
- tokens: number;
186
- from: number;
187
- until: number;
188
- }[];
189
- /** The pause stopping it asking anything; none when it asks as it may. */
190
- paused: {
191
- from: number;
192
- until: number;
193
- } | null;
194
- }
195
- export declare function budgets(): Promise<Budgets>;
196
- /** Sets what `role` may spend here, like `5m/day`; null gives it back to the configs. */
197
- export declare function setBudget(role: RoleBudget["role"], spend: string | null): Promise<Budgets>;
198
- /** Adds `tokens`, like `2m`, to each of `role`'s limits `span`, like `1d`. */
199
- export declare function raiseBudget(role: RoleBudget["role"], tokens: string, span: string): Promise<Budgets>;
200
- /** Stops `role` asking anything for `span`, like `1d`. */
201
- export declare function pauseBudget(role: RoleBudget["role"], span: string): Promise<Budgets>;
202
- /** Lets a paused `role` ask again before its pause ends. */
203
- export declare function resumeBudget(role: RoleBudget["role"]): Promise<Budgets>;
204
- export declare function endRaise(id: number): Promise<Budgets>;
205
- /**
206
- * Opens `path` in `editor` on this machine, inside the tree it belongs to,
207
- * at `line` when there is one.
208
- */
209
- export declare function openFile(editor: string, path: string, line: number | null): Promise<void>;
package/dev/assets.d.ts DELETED
@@ -1,24 +0,0 @@
1
- /** The files the browser asks for, as the server hands them over. */
2
- export interface Assets {
3
- /** The page, which asks for the rest. */
4
- shell: string;
5
- /** The React app, bundled for the browser. */
6
- script: string;
7
- /** The React app's source map, which DevTools asks for while open. */
8
- scriptMap: string;
9
- /** The stylesheet, with Tailwind already compiled. */
10
- styles: string;
11
- /** The service worker, through which a phone shows notifications. */
12
- worker: string;
13
- /** The service worker's source map. */
14
- workerMap: string;
15
- /** The web app manifest, which makes the page installable as an app. */
16
- manifest: string;
17
- /** The app icon as PNG, at 192px and 512px square. */
18
- icons: {
19
- 192: Uint8Array<ArrayBuffer>;
20
- 512: Uint8Array<ArrayBuffer>;
21
- };
22
- }
23
- /** The page this package ships. Serve each field's contents as-is. */
24
- export declare const assets: Assets;