@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/todo.d.ts CHANGED
@@ -1,146 +1,3 @@
1
- import type { Attachment, Attachments } from "./attachments.js";
2
- import type { Journal } from "./journal.js";
3
- import type { AgentPick } from "./roster.js";
4
- import type { Todos } from "./todos.js";
5
- /** What a todo is on disk: one file apiece, so two agents never rewrite one. */
6
- export interface TodoState {
7
- id: number;
8
- /** What is left to do, in a line. */
9
- subject: string;
10
- /** Whatever more there is to say about it, or empty when the line is enough. */
11
- text: string;
12
- /** Where it stands in the list, 1 at the top: the one to pick up first. */
13
- position: number;
14
- /** The task it came up in, or null when a person added it from the main tree. */
15
- from: string | null;
16
- createdAt: string;
17
- /** The task working on it now, or null while it waits to be picked up. */
18
- takenBy: string | null;
19
- /** Absolute paths of the files attached, in `todos/<id>/`. */
20
- files: string[];
21
- /**
22
- * The todos that have to merge before this one starts, sorted. One leaves
23
- * the list when it merges or is removed, and with it every link to it.
24
- */
25
- blockedBy: number[];
26
- /** The lane it runs in, or null for none. */
27
- lane: number | null;
28
- /** The agent, and model, that should work it, over its lane's; absent for none. */
29
- assignee?: AgentPick;
30
- /** The other project it was added from; absent for one added here. */
31
- origin?: TodoOrigin;
32
- }
33
- /**
34
- * Work deferred for later: what an agent notes when something outside its
35
- * task comes up, so it can move on instead of growing the task. Kept under the
36
- * shared `.git`, so every worktree sees a new one at once, with nothing to
37
- * commit and nothing to merge.
38
- */
39
- export declare class Todo {
40
- private readonly todos;
41
- readonly state: TodoState;
42
- constructor(todos: Todos, state: TodoState);
43
- get id(): number;
44
- get subject(): string;
45
- get text(): string;
46
- get position(): number;
47
- get from(): string | null;
48
- get takenBy(): string | null;
49
- get createdAt(): Date;
50
- /** How long it has waited, in milliseconds. */
51
- get waited(): number;
52
- /**
53
- * The todos blocking it that have yet to merge, leaving out those `task`
54
- * has or takes in the same breath, among `together`: what it should not be
55
- * started before.
56
- */
57
- blockers(task: string, together?: number[]): Promise<Todo[]>;
58
- /** Marks it as the work of `task`, refusing one another task already has. */
59
- take(task: string): Promise<Todo>;
60
- /** Puts it back on the list, as when the task that took it is removed. */
61
- release(): Promise<Todo>;
62
- get files(): string[];
63
- /** The todos that have to merge before it starts. */
64
- get blockedBy(): number[];
65
- get lane(): number | null;
66
- get attachments(): Attachments;
67
- /**
68
- * Says what is left to do in other words, with other files, or higher or
69
- * lower in the list, keeping its id and history.
70
- */
71
- update({ subject, text, position, files, keep, blockedBy, lane, assignee, }: TodoChange): Promise<Todo>;
72
- remove(): Promise<void>;
73
- /** Removes it, as the person did, keeping it for `Todos.restore` to put back. */
74
- discard(): Promise<void>;
75
- }
76
- /** A todo's words, place or files changed: new ones added, some of the old kept. */
77
- export interface TodoChange {
78
- /** A new line; the old one stays when this is absent. */
79
- subject?: string;
80
- /** New detail, empty for none; the old stays when this is absent. */
81
- text?: string;
82
- /** Where to move it in the list; it stays put when this is absent. */
83
- position?: number;
84
- /** Files to add. */
85
- files?: Attachment[];
86
- /** The paths of the files it has now to keep; absent keeps them all. */
87
- keep?: string[];
88
- /** Every todo blocking it from now on; the old stay when this is absent. */
89
- blockedBy?: number[];
90
- /** The lane it runs in, `"new"` for one of its own, null for none; it stays when absent. */
91
- lane?: number | "new" | null;
92
- /** The agent that should work it, null for none; it stays when absent. */
93
- assignee?: AgentPick | null;
94
- }
95
- /**
96
- * Where a todo came up, as a list shows it: its task here, or for one added
97
- * from another project, `<project>/<task>`, the project by its directory's
98
- * name; null for one a person added from the main tree.
99
- */
100
- export declare function cameFrom({ from, origin }: TodoState): string | null;
101
- /** The other project a todo was added from, and the task there it came up in. */
102
- export interface TodoOrigin {
103
- /** That project's main tree. */
104
- project: string;
105
- /** Its task the todo came up in, or null for its main tree. */
106
- task: string | null;
107
- }
108
- /** What a new todo has besides its subject, all of it optional. */
109
- export interface TodoNew {
110
- /** Whatever more there is to say about it. */
111
- text?: string;
112
- files?: Attachment[];
113
- /** Where it goes in the list, pushing those from there down; the bottom by default. */
114
- position?: number;
115
- /** The todos blocking it: each has to merge before it starts. */
116
- blockedBy?: number[];
117
- /** The lane it goes in, `"new"` for one of its own; none by default. */
118
- lane?: number | "new" | null;
119
- /** The agent that should work it; none by default. */
120
- assignee?: AgentPick | null;
121
- /** The other project it is added from; none by default. */
122
- origin?: TodoOrigin;
123
- }
124
- /** `state` worked by `assignee`, or by nobody in particular for null. */
125
- export declare function assigned<State extends {
126
- assignee?: AgentPick;
127
- }>(state: State, assignee: AgentPick | null | undefined): State;
128
- /**
129
- * A subject and its detail, trimmed. A subject running past one line keeps
130
- * only the first, the rest leading the detail, so the list stays one line a
131
- * todo however it was written.
132
- */
133
- export declare function wording(subject: string, text: string): {
134
- subject: string;
135
- text: string;
136
- };
137
- /**
138
- * Runs `update`, which changes todo `id`, and journals it with what moved
139
- * between the todo before and after, so a refused one is journaled bare.
140
- */
141
- export declare function recordUpdate(journal: Journal, todos: Todos, id: number, update: () => Promise<Todo>): Promise<Todo>;
142
- /** `todos` as an event names them: each by its id and subject. */
143
- export declare function todosNamed(todos: readonly Todo[]): {
144
- id: number;
145
- subject: string;
146
- }[];
1
+ import type { SplatesDeps } from "@stringsync/splates-server/server";
2
+ /** `splates todo`, which the root cli mounts after the task commands. */
3
+ export declare const splatesTodo: import("webappwiz/cmd").Cli<SplatesDeps, SplatesDeps>;
@@ -1,3 +1,3 @@
1
- import type { SplatesDeps } from "./splates.js";
1
+ import type { SplatesDeps } from "@stringsync/splates-server/server";
2
2
  /** `splates tunnel`, which the root cli mounts after `splates lane`. */
3
3
  export declare const splatesTunnel: import("webappwiz/cmd").Cli<SplatesDeps, SplatesDeps>;
@@ -1,3 +1,3 @@
1
- import type { SplatesDeps } from "./splates.js";
1
+ import type { SplatesDeps } from "@stringsync/splates-server/server";
2
2
  /** `splates worker`, which the root cli mounts after `splates slots`. */
3
3
  export declare const splatesWorker: import("webappwiz/cmd").Cli<SplatesDeps, SplatesDeps>;
@@ -1,82 +0,0 @@
1
- import type * as acp from "@agentclientprotocol/sdk";
2
- import type { ConversationState } from "./conversation-state.js";
3
- /**
4
- * What every session is opened with. Claude's AskUserQuestion is off, so its
5
- * questions go under `## Blocked` and into its reply, as the splates skill asks,
6
- * rather than into a form `SPLATES.md` never sees. Other agents ignore it.
7
- */
8
- export declare const SESSION_META: {
9
- claudeCode: {
10
- options: {
11
- disallowedTools: string[];
12
- };
13
- };
14
- };
15
- /** The ACP extension that says a prompt into the turn the agent is running. */
16
- export declare const STEER = "_session/steering";
17
- /**
18
- * The updates and request, an ACP draft Claude's adapter speaks ahead of the
19
- * SDK, that say when a background command starts and ends, and stop one.
20
- */
21
- export declare const ASYNC_TASK_SPAWNED = "async_task_spawned";
22
- export declare const ASYNC_TASK_STATE = "async_task_state_update";
23
- export declare const ASYNC_TASK_PROGRESS = "async_task_progress";
24
- export declare const ASYNC_TASK_STOP = "_session/async_task/stop";
25
- /** The notification the client hears each of those updates as (see `asyncTasks`). */
26
- export declare const ASYNC_TASK_UPDATE = "_splates/async_task";
27
- /**
28
- * The messages from an agent, each update on a background command moved to
29
- * `ASYNC_TASK_UPDATE`, ahead of the SDK's checks, which would refuse it as a
30
- * session update they do not know.
31
- */
32
- export declare function asyncTasks(messages: ReadableStream<acp.AnyMessage>): ReadableStream<acp.AnyMessage>;
33
- export interface AsyncTaskSpawned {
34
- sessionUpdate: typeof ASYNC_TASK_SPAWNED;
35
- asyncTaskId: string;
36
- name: string;
37
- /** `shell` for a command, else a workflow or the like. */
38
- taskType: string;
39
- description: string;
40
- toolCallId?: string;
41
- outputFilePath?: string;
42
- }
43
- export interface AsyncTaskState {
44
- sessionUpdate: typeof ASYNC_TASK_STATE;
45
- asyncTaskId: string;
46
- state: "running" | "paused" | "completed" | "failed" | "stopped";
47
- outputFilePath?: string;
48
- }
49
- /** What the agent says as a command goes on: here, only where its output is. */
50
- export interface AsyncTaskProgress {
51
- sessionUpdate: typeof ASYNC_TASK_PROGRESS;
52
- asyncTaskId: string;
53
- outputFilePath?: string;
54
- }
55
- export type AsyncTaskUpdate = AsyncTaskSpawned | AsyncTaskState | AsyncTaskProgress;
56
- /** Whether an agent says, as it starts, that it takes `STEER`. */
57
- export declare function steers(initialized: acp.InitializeResponse): boolean;
58
- /**
59
- * The AIR session list: subscribed for a working directory, the agent says
60
- * as each of its sessions there starts or ends a turn. Codex says so of a
61
- * turn it starts on its own nowhere else.
62
- */
63
- export declare const SESSION_LIST_SUBSCRIBE = "_session/list/subscribe";
64
- export declare const SESSION_LIST_CHANGES = "_session/list/changes";
65
- /** Whether an agent says, as it starts, that it takes `SESSION_LIST_SUBSCRIBE`. */
66
- export declare function listsSessions(initialized: acp.InitializeResponse): boolean;
67
- /** What a `SESSION_LIST_CHANGES` row says of a session's turn. */
68
- export interface ListedTurn {
69
- running: boolean;
70
- /** When its last turn ended, in ms; null before one has. */
71
- endedAt: number | null;
72
- }
73
- /**
74
- * What `params` of `SESSION_LIST_CHANGES` say of `session`'s turn; null when
75
- * they hold no row for it, or one that says nothing of its turns, as for a
76
- * session no process has open.
77
- */
78
- export declare function listedTurn(params: Record<string, unknown>, session: string): ListedTurn | null;
79
- /** Whether `update` is the agent's final answer, after which its turn ends. */
80
- export declare function finalAnswer(update: acp.SessionUpdate): boolean;
81
- /** Folds an update on a background command into those the agent left. */
82
- export declare function foldBackground(state: ConversationState, update: AsyncTaskUpdate): void;
package/add.d.ts DELETED
@@ -1,53 +0,0 @@
1
- import { type Logger } from "webappwiz/log";
2
- import type { Fs, HeavyCap } from "webappwiz/system";
3
- import type { Config } from "./config.js";
4
- import { type RosterAgent } from "./roster.js";
5
- import type { Shell } from "./shell.js";
6
- import type { Todos } from "./todos.js";
7
- import type { Dispatched } from "./worktree.js";
8
- import type { WorktreeService } from "./worktree-service.js";
9
- export interface AddOptions {
10
- /** Branch the task starts from and merges onto. Defaults to the trunk. */
11
- base?: string;
12
- /**
13
- * The todos this task takes up: their words seed the plan's Goal, and
14
- * nobody else can take them while the task lives.
15
- */
16
- todos?: number[];
17
- /**
18
- * One or two lines on what done means, written under `## Goal` ahead of
19
- * whatever the todos seed it with.
20
- */
21
- goal?: string;
22
- /**
23
- * Runs once the worktree exists and before its record makes the task live,
24
- * so whatever it tells of the task is in place before anyone can see it.
25
- */
26
- onTree?: () => Promise<void>;
27
- /**
28
- * The agent to hand the task to, which `splates server` starts in its tree once
29
- * the tree is ready; its id must be one of `agents`.
30
- */
31
- dispatch?: Dispatched;
32
- /** The roster's agents, which `dispatch` must name one of, and its model. */
33
- agents?: RosterAgent[];
34
- /**
35
- * Added from another project, as `splates --project` does: the task goes
36
- * to an agent of its own, so `dispatch` is a must.
37
- */
38
- away?: boolean;
39
- /**
40
- * Hands the task out though the agent adding it has as many out to
41
- * agents as `config.agentsPerAgent` allows, as only the person may ask.
42
- */
43
- overCapacity?: boolean;
44
- }
45
- export declare function add({ service, shell, config, log, fs, todos, heavy, }: {
46
- service: WorktreeService;
47
- shell: Shell;
48
- config: Config;
49
- log: Logger;
50
- fs: Fs;
51
- todos: Todos;
52
- heavy: HeavyCap;
53
- }, task: string, { base, todos: ids, goal: asked, onTree, dispatch, agents, away, overCapacity, }?: AddOptions): Promise<void>;
package/adherence.d.ts DELETED
@@ -1,49 +0,0 @@
1
- import type { Fs } from "webappwiz/system";
2
- import type { ConversationState } from "./conversation-state.js";
3
- import type { Outcomes } from "./outcomes.js";
4
- import { type Transcript } from "./skill-checks.js";
5
- /**
6
- * How closely `splates server`'s conversations follow the splates skill, across
7
- * projects, in `~/.splates/adherence.jsonl`: a line each time a turn ends and
8
- * changes how a conversation's checks went, the last one standing for it. It
9
- * outlives the conversations' logs, which go as archived ones are pruned.
10
- */
11
- export declare class Adherence {
12
- /** `~/.splates/adherence.jsonl`, or a test's own. */
13
- readonly path: string;
14
- private readonly fs;
15
- /** Where the commits a conversation merged are kept; null to judge without them. */
16
- private readonly outcomes;
17
- /** The scores last written for each conversation, so a turn that changes none writes nothing. */
18
- private readonly written;
19
- constructor(
20
- /** `~/.splates/adherence.jsonl`, or a test's own. */
21
- path: string, fs: Fs,
22
- /** Where the commits a conversation merged are kept; null to judge without them. */
23
- outcomes: Outcomes | null);
24
- /** Judges `state` as it stands, and keeps the result when it changed. */
25
- judge(state: ConversationState, project: string, at: string): Promise<void>;
26
- /** Each conversation's checks as last judged. */
27
- list(): Promise<Judged[]>;
28
- /** What `state` merged, read from the outcomes only once it has merged anything. */
29
- private endOf;
30
- }
31
- /** How each check went over one conversation: the places it applied, passed and failed. */
32
- export type Scores = Record<string, {
33
- passed: number;
34
- failed: number;
35
- }>;
36
- /** A conversation's checks as last judged, a line of `~/.splates/adherence.jsonl`. */
37
- export interface Judged {
38
- conversation: string;
39
- /** The main tree of the repository it ran in. */
40
- project: string;
41
- agent: string;
42
- /** The splates skill version it started on; null when unknown. */
43
- skill: string | null;
44
- /** When it was judged, as an ISO timestamp. */
45
- at: string;
46
- scores: Scores;
47
- }
48
- /** A conversation as `skill-checks` reads it: what it said and ran, in order. */
49
- export declare function condense(state: ConversationState): Transcript;
package/age.d.ts DELETED
@@ -1,2 +0,0 @@
1
- /** How long ago an ISO timestamp was, at the coarsest unit that still reads. */
2
- export declare function age(since: string): string;
@@ -1,171 +0,0 @@
1
- import * as acp from "@agentclientprotocol/sdk";
2
- import type { Agent, AgentProcess, ProcessHandle } from "./agent-process.js";
3
- import type { ConversationDeps, ConversationHost } from "./conversation-host.js";
4
- import type { Live } from "./conversation-log.js";
5
- import type { Answer, Setting } from "./conversation-state.js";
6
- /**
7
- * A conversation's side of ACP: the agent's process and the connection to
8
- * it, what the agent asks of this side, routed to the person, and the calls
9
- * the conversation makes on it. Opened anew each time the agent starts or
10
- * comes back, with the same session, or reattached to a process a worker
11
- * kept running while the coordinator restarted.
12
- */
13
- export declare class AgentConnection {
14
- private readonly host;
15
- private readonly deps;
16
- private connection;
17
- private process;
18
- private stream;
19
- /** What listens on the stream and the log while they are up. */
20
- private listening;
21
- /** How many times `open` has run, so a start that fails late knows it is still the latest. */
22
- private opens;
23
- /** The agent's session, once it has opened one. */
24
- private session;
25
- /** Settles the agent's pending ask with the person's answer. */
26
- private settle;
27
- /** Whether the agent takes a prompt into its running turn. */
28
- private steering;
29
- /**
30
- * Whether the running turn is on its final answer: a prompt steered in
31
- * now may find it ended, and the agent start a turn of its own for it.
32
- */
33
- private finishing;
34
- /** Whether the agent takes images in a prompt. */
35
- private seeing;
36
- /** Whether the turn running is one the agent started, with no prompt to end it. */
37
- private unprompted;
38
- /** Whether the agent has said a turn ended, as Claude does, so one it starts can end. */
39
- private tells;
40
- /** Whether the agent says on its session list when a turn ends, as Codex does. */
41
- private follows;
42
- /**
43
- * The turn the agent started for a steer, as Codex does when its turn
44
- * ended on the way: when splates heard of it, in ms, and whether the
45
- * session list has said since that it runs.
46
- */
47
- private following;
48
- /** Settles once the agent has answered the last steer, which may have started a turn of its own. */
49
- private steered;
50
- /** The commands running, by tool call, each watched since it started. */
51
- private readonly watching;
52
- /** Whether the next open loads the session, replaying it, rather than resuming it. */
53
- private loading;
54
- /** The person's words the replay has said so far, not yet logged as a prompt. */
55
- private heard;
56
- /** Recovery loads replay history already in the log. */
57
- private suppressReplay;
58
- /** Settings picked before the session opened, set once it has. */
59
- private picks;
60
- /** The model asked for before the session opened, picked once it has. */
61
- private model;
62
- private sessionCwd;
63
- constructor(host: ConversationHost, deps: ConversationDeps, { session, loading, picks, model, sessionCwd, }?: {
64
- session?: string | null;
65
- /** Whether the first open loads `session`, replaying it, rather than resuming it. */
66
- loading?: boolean;
67
- picks?: Record<string, string>;
68
- model?: string | null;
69
- sessionCwd?: string | null;
70
- });
71
- /** The agent's pid while it runs, for the commands it left running. */
72
- get pid(): number | null;
73
- /** What takes the agent's process back after a restart; null while none could. */
74
- get handle(): ProcessHandle | null;
75
- get sessionId(): string | null;
76
- /** Whether the agent's process is up and speaking ACP. */
77
- get connected(): boolean;
78
- /** Whether the agent takes a prompt into its running turn, as it stands. */
79
- get canSteer(): boolean;
80
- /** Whether the agent takes images in a prompt. */
81
- get sees(): boolean;
82
- /** Whether the agent is waiting on the person for an answer. */
83
- get asking(): boolean;
84
- /**
85
- * Runs the agent and opens a session with it: the one this conversation
86
- * had, when there was one, else a new one.
87
- */
88
- open(agent: Agent, cwd: string): Promise<void>;
89
- /**
90
- * Speaks ACP again to `process`, which a worker kept running while the
91
- * coordinator restarted, where the log left off: `live` says what was in
92
- * flight. A late answer to the prompt it was on ends the turn, and the
93
- * question it was asking is answered on the request it came in.
94
- */
95
- reattach(agent: Agent, process: AgentProcess, live: Live): void;
96
- /**
97
- * Releases the running agent for the next coordinator to reconnect.
98
- * Flush the conversation log after awaiting this before shutting down.
99
- */
100
- detach(): Promise<void>;
101
- /**
102
- * Opens ACP over `process`, which from here is the one this conversation
103
- * runs: its frames stamp the log, its exit closes the conversation, and
104
- * the worker is acked for each frame once the log holds it.
105
- */
106
- private attach;
107
- /** What `process` said on stderr if it exits within `DEATH_WAIT`, else null. */
108
- private diedSaying;
109
- /**
110
- * Waits for no other agent to be starting, answering with what lets the
111
- * next one start: once this one's process is up, has died, or has had
112
- * `START_WAIT` to answer, so one that hangs holds up no other for long.
113
- */
114
- private startAlone;
115
- /** Says `prompt` to the agent as a turn, settling with what it answered once the turn ends. */
116
- prompt(prompt: acp.ContentBlock[]): Promise<acp.PromptResponse | undefined>;
117
- /** Whether the agent runs a turn it started for a steer, which no prompt's answer ends. */
118
- get detached(): boolean;
119
- /** A stale or substituted choice must never reach a prompt or steering call. */
120
- private validateModel;
121
- /**
122
- * Says `prompt` into the turn the agent is running, answering with what
123
- * came of it: `injected`, `startedNewTurn`, or `promptRequired` when the
124
- * turn ended on the way.
125
- */
126
- steer(prompt: acp.ContentBlock[]): Promise<string | undefined>;
127
- private steerInto;
128
- /** Shows the turn the agent started for a steer as running, until it ends. */
129
- private follow;
130
- /**
131
- * Ends the turn being followed once the session list says it no longer
132
- * runs. A row read before it started can come after `startedNewTurn`,
133
- * saying the turn before it ended: it counts only once a row has said the
134
- * turn runs, or when it ended past the second splates heard it start in,
135
- * since the agent says when in whole seconds.
136
- */
137
- private listed;
138
- /** Stops the agent's turn, if it is connected. */
139
- cancel(): Promise<void>;
140
- /** Stops background command `id`; the agent says it ended as it does. */
141
- stopTask(id: string): Promise<void>;
142
- /**
143
- * Sets `setting` to `value`, answering with the session's settings as the
144
- * agent then offers them: at once while it is connected, or, while it is
145
- * not, as picked for when it next opens.
146
- */
147
- choose(setting: Setting, value: string): Promise<Setting[]>;
148
- /** Settles the agent's pending ask, if `id` is still the one it is on. */
149
- answer(id: string, answer: Answer): void;
150
- /** Ends the process, dismissing whatever the agent was asking. */
151
- close(): void;
152
- /** What the agent may ask of this side, all of it routed to the person. */
153
- private client;
154
- /**
155
- * Watches each command the agent runs from when it starts, and keeps what
156
- * it did to git that it should not have once it ends.
157
- */
158
- private watchCommand;
159
- /** Logs the person's words the replay has said, as one prompt. */
160
- private logHeard;
161
- /** Keeps how the person answered the permission asked for tool call `id`. */
162
- private decided;
163
- /**
164
- * Holds `asked` until the person answers it, or the turn is cancelled,
165
- * logged with the request it came in, so a coordinator started again can
166
- * answer it there.
167
- */
168
- private ask;
169
- /** Settles the pending ask, if any, with `answer`, and logs that it is answered. */
170
- private settled;
171
- }
package/agent-errors.d.ts DELETED
@@ -1,2 +0,0 @@
1
- /** Redacts common credential-bearing diagnostics before persistence or display. */
2
- export declare function agentError(message: string): string;
@@ -1,65 +0,0 @@
1
- import { type Timer } from "webappwiz/time";
2
- /** An agent splates can hold a conversation with over ACP, and how to start it. */
3
- export interface Agent {
4
- id: string;
5
- name: string;
6
- argv: string[];
7
- }
8
- /** What a process wrote to stdout, numbered from 1 so a restart can say what it holds. */
9
- export interface AgentFrame {
10
- bytes: Uint8Array;
11
- seq: number;
12
- }
13
- /** What finds a process again after a restart: the worker it runs on and its channel there. */
14
- export interface ProcessHandle {
15
- worker: string;
16
- channel: number;
17
- }
18
- /** A running agent: bytes in, frames out, and a way to stop it. */
19
- export interface AgentProcess {
20
- /** Its pid, for what runs under it; null for one that never started. */
21
- pid: number | null;
22
- input: WritableStream<Uint8Array>;
23
- output: ReadableStream<AgentFrame>;
24
- /**
25
- * Says everything up to frame `seq` is written down, so a restart replays
26
- * from past it; nothing to do for a process that ends with this one.
27
- */
28
- ack(seq: number): void;
29
- /** What takes it back after a restart; null for one that ends with this process. */
30
- handle: ProcessHandle | null;
31
- /** What it last wrote to stderr, for when it dies before saying why. */
32
- stderr(): string;
33
- exited: Promise<number>;
34
- kill(): void;
35
- }
36
- /** `bytes` as frames, numbered from 1 as they come. */
37
- export declare function framed(bytes: ReadableStream<Uint8Array>): ReadableStream<AgentFrame>;
38
- /** Starts `argv` in `cwd`, with `env` added to its own, its stdio piped. */
39
- export type Launch = (argv: string[], cwd: string, env: Record<string, string>) => AgentProcess;
40
- /** What starts a conversation's agent, and takes one back after a restart. */
41
- export interface Launcher {
42
- launch: Launch;
43
- /**
44
- * The process `handle` names, kept running while this coordinator was
45
- * away, its output carrying on from past frame `held`, the last one the
46
- * log holds. Throws when nothing here can take it back.
47
- */
48
- resume(handle: ProcessHandle, held: number): AgentProcess;
49
- }
50
- /** `launch` alone, for a process that ends with this one: nothing takes one back. */
51
- export declare function launcherOf(launch: Launch): Launcher;
52
- export declare const launch: Launch;
53
- /** A session an agent holds that splates could bring in. */
54
- export interface Session {
55
- agent: string;
56
- session: string;
57
- title: string | null;
58
- /** When it was last active, as the agent says; null when it does not. */
59
- updatedAt: string | null;
60
- }
61
- /**
62
- * The sessions `agent` holds in `cwd`, asked of a process of its own that
63
- * stops once it answers; none when it cannot both list and load them.
64
- */
65
- export declare function listSessions(agent: Agent, cwd: string, run: Launch, timer: Timer): Promise<Session[]>;