@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
@@ -1,25 +0,0 @@
1
- import { z } from "zod";
2
- /** Where Cloudflare's v4 API answers. */
3
- export declare const CLOUDFLARE_API = "https://api.cloudflare.com/client/v4";
4
- /**
5
- * The few calls `splates tunnel setup` makes of Cloudflare's v4 API, over plain
6
- * `fetch` rather than the `cloudflare` SDK, which every `bunx` of splates would
7
- * download for some ten endpoints. Each answer's result is checked against
8
- * the shape the caller names, so a field that moved fails here, saying where.
9
- */
10
- export declare class CloudflareApi {
11
- private readonly token;
12
- private readonly fetch;
13
- constructor(token: string, opts?: {
14
- fetch?: typeof fetch;
15
- });
16
- get<T>(path: string, shape: z.ZodType<T>): Promise<T>;
17
- /** Every item of the list at `path`, page after page. */
18
- list<T>(path: string, item: z.ZodType<T>): Promise<T[]>;
19
- post<T>(path: string, body: unknown, shape: z.ZodType<T>): Promise<T>;
20
- put<T>(path: string, body: unknown, shape: z.ZodType<T>): Promise<T>;
21
- patch<T>(path: string, body: unknown, shape: z.ZodType<T>): Promise<T>;
22
- /** Deletes what is at `path`, whatever Cloudflare answers with. */
23
- delete(path: string): Promise<void>;
24
- private call;
25
- }
@@ -1,5 +0,0 @@
1
- /** A call Cloudflare refused, with the HTTP status it answered. */
2
- export declare class CloudflareError extends Error {
3
- readonly status: number;
4
- constructor(status: number, message: string);
5
- }
@@ -1,27 +0,0 @@
1
- import type { AsyncResource } from "webappwiz/disposable";
2
- import type { Ps } from "webappwiz/system";
3
- import type { TunnelProvider, TunnelRoute } from "./tunnel-provider.js";
4
- /**
5
- * An `sh -c` script that runs the command after it, `sh -c GUARD sh <argv>`,
6
- * until the guard's stdin closes or a SIGTERM reaches it, and exits with the
7
- * command's status. Start it with stdin a pipe, so it dies with its parent.
8
- */
9
- export declare const GUARD: string;
10
- /**
11
- * A TunnelProvider over the `cloudflared` binary, running the named tunnel
12
- * the account already has, or the one its own config names, or, given a
13
- * token, the tunnel `splates tunnel setup` made, with no login or credentials
14
- * file. One that dies while running is logged, never fatal: the page still
15
- * answers on this machine.
16
- */
17
- export declare class CloudflaredTunnelProvider implements TunnelProvider {
18
- private readonly ps;
19
- private readonly name;
20
- /** The tunnel's token, handed over in the environment, never the argv `ps` lists. */
21
- private readonly token;
22
- constructor(ps: Ps, name?: string | null,
23
- /** The tunnel's token, handed over in the environment, never the argv `ps` lists. */
24
- token?: string | null);
25
- ready(): Promise<void>;
26
- run({ host, url, log }: TunnelRoute): AsyncResource;
27
- }
package/codex-limits.d.ts DELETED
@@ -1,19 +0,0 @@
1
- import { type Timer } from "webappwiz/time";
2
- import type { Agent, Launch, Limit } from "./conversations.js";
3
- /** Whether `agent` is Codex's ACP adapter, which says its limits only in `/status`. */
4
- export declare function isCodex(agent: Agent): boolean;
5
- /**
6
- * Asks Codex's app server, the one its ACP adapter runs, for the plan's
7
- * windows, since the adapter never sends them: a window Claude also has goes
8
- * by Claude's name, any other by its length, as `43200_minutes`. None when
9
- * Codex will not say.
10
- */
11
- export declare function codexLimits(deps: {
12
- launch: Launch;
13
- timer: Timer;
14
- now: () => number;
15
- /** Where it runs: anywhere does, since the plan is the account's. */
16
- cwd: string;
17
- /** Where `codex` is, as the adapter reads it; `codex` on the path otherwise. */
18
- codex?: string;
19
- }): Promise<Limit[]>;
package/compaction.d.ts DELETED
@@ -1,17 +0,0 @@
1
- import type * as acp from "@agentclientprotocol/sdk";
2
- import type { Compaction, ConversationState } from "./conversation-state.js";
3
- /** Whether `update` reports a compaction rather than a tool call of the agent's. */
4
- export declare function isCompaction(update: acp.ToolCall | acp.ToolCallUpdate): boolean;
5
- /** Takes what an update says of the compaction into it. */
6
- export declare function fillCompaction(part: Compaction, update: acp.ToolCall | acp.ToolCallUpdate, at: string | null): void;
7
- /** The compaction `id`, wherever in the conversation it was; null for none. */
8
- export declare function compactionIn(state: ConversationState, id: string): Compaction | null;
9
- /** A compaction `id` just begun at `at`, with nothing said of it yet. */
10
- export declare function newCompaction(id: string, at: string | null): Compaction;
11
- /**
12
- * Takes ACP's `compaction_update` into `part`: its status, and its summary,
13
- * which replaces the one kept, or clears it when null or empty.
14
- */
15
- export declare function updateCompaction(part: Compaction, update: acp.CompactionUpdate, at: string | null): void;
16
- /** Appends a `compaction_summary_chunk`'s text to the summary `part` keeps. */
17
- export declare function appendSummary(part: Compaction, chunk: acp.CompactionSummaryChunk): void;
@@ -1,13 +0,0 @@
1
- /**
2
- * `source` typed by a type-only import of `ConfigFile` and `satisfies` rather
3
- * than by calling `defineConfig`, so a reader can import it without splates
4
- * installed; or null unless it imports `defineConfig` alone and calls it
5
- * once.
6
- */
7
- export declare function typedConfig(source: string): string | null;
8
- /**
9
- * `source` with the `systems` property of its outermost object taken out,
10
- * with its line when it has one to itself, or null unless there is exactly
11
- * one such property.
12
- */
13
- export declare function withoutSystems(source: string): string | null;
package/config.d.ts DELETED
@@ -1,98 +0,0 @@
1
- import type { TunnelProvider } from "./tunnel-provider.js";
2
- export interface Config {
3
- /**
4
- * The integration branch name. `merge` rebases a task onto this branch and
5
- * then fast-forwards it to the result; new worktrees start from it.
6
- */
7
- trunk: string;
8
- /** Directory holding one worktree per task, a sibling of the repo. */
9
- worktreeRoot: string;
10
- /** Command run by `add` in the new worktree, via `sh -c`. */
11
- postCheckout: string | null;
12
- /**
13
- * Command run by `merge` after the rebase, before `preMerge`, via `sh -c`.
14
- * A rebase can bring in a dependency the worktree has never installed, and
15
- * whatever `preMerge` runs needs it.
16
- */
17
- postRewrite: string | null;
18
- /**
19
- * Command run by `merge` after the rebase, via `sh -c`. The last gate before
20
- * the branch lands: a nonzero exit rolls the branch back and leaves the base
21
- * untouched. Tests are the obvious thing to put here, but splates has no
22
- * opinion; a repo with nothing to run leaves it null and merges on a green
23
- * rebase alone.
24
- */
25
- preMerge: string | null;
26
- /** How long since its last heartbeat before a task's lease is up for grabs. */
27
- leaseStalenessMs: number;
28
- /**
29
- * How many agents one agent may have started at once: the tasks it
30
- * handed out with `splates add --agent` and that are still out. A lane
31
- * orchestrator hands out every todo that can go, each to an agent of
32
- * its own. Past it, `add --agent` refuses, unless the person asked for
33
- * more and it passes `--over-capacity`.
34
- */
35
- agentsPerAgent: number;
36
- /** Failed `merge` attempts a task gets before it must escalate or be removed. */
37
- mergeRetryCount: number;
38
- /**
39
- * How many removed task names to keep, so `remove` can say "already removed"
40
- * rather than "never existed". A flat cap with no age policy: losing the
41
- * oldest costs a nicer message and nothing else.
42
- */
43
- removedCapacity: number;
44
- /**
45
- * How many events the log holds before it is moved aside and a fresh one
46
- * starts; moved files are kept for `LOG_KEPT_MS` (`journal.ts`).
47
- */
48
- logCapacity: number;
49
- /**
50
- * How long a todo can wait before `merge` stops recommending it and offers
51
- * it for removal instead: work deferred that long has usually been done
52
- * some other way, or stopped mattering.
53
- */
54
- todoStalenessMs: number;
55
- /**
56
- * How many bytes of files `splates attach` lets one task hold, all of them
57
- * together: a screen recording is the one thing here that grows fast.
58
- */
59
- attachmentCapacity: number;
60
- /** How many bytes one artifact a conversation keeps may be (`artifacts.ts`). */
61
- artifactFileCapacity: number;
62
- /**
63
- * How many bytes of artifacts one conversation may keep, every version
64
- * whose bytes have not been deleted.
65
- */
66
- artifactConversationCapacity: number;
67
- /** How many bytes of artifacts every conversation in the project may keep together. */
68
- artifactProjectCapacity: number;
69
- /**
70
- * The command the `splates server` Budget page runs `scry budgets` with, from
71
- * the repo's root. Leave it unset when the repo installs `@webappwiz/cli`;
72
- * name a wrapper of the repo's own otherwise, like `"./bin/splates dev"`.
73
- */
74
- wiz: string;
75
- /**
76
- * What carries `splates server --tunnel` to its public host, a TunnelProvider
77
- * of your own for any tunnel; null runs `cloudflared`.
78
- */
79
- tunnel: TunnelProvider | null;
80
- }
81
- /**
82
- * What `splates.config.ts` exports as its default, typed by a type-only import
83
- * so a reader can import the file without splates installed:
84
- *
85
- * ```ts
86
- * import type { ConfigFile } from "@stringsync/splates/config";
87
- *
88
- * export default { preMerge: "bun test" } satisfies ConfigFile;
89
- * ```
90
- */
91
- export type ConfigFile = Partial<Config>;
92
- /**
93
- * Types a config written before `ConfigFile`, which wraps its default in
94
- * `defineConfig(...)`, so it still loads until `splates update` rewrites it.
95
- *
96
- * @deprecated `satisfies ConfigFile` instead.
97
- */
98
- export declare function defineConfig(config: Partial<Config>): Partial<Config>;
package/config.js DELETED
@@ -1,7 +0,0 @@
1
- // config.ts
2
- function defineConfig(config) {
3
- return config;
4
- }
5
- export {
6
- defineConfig
7
- };
@@ -1,6 +0,0 @@
1
- import type { ConversationHost } from "./conversation-host.js";
2
- /** Records archive membership and its timestamp together. */
3
- export declare function put(host: ConversationHost, { archived, with: withConversation, }: {
4
- archived: boolean;
5
- with?: string | undefined;
6
- }): Promise<void>;
@@ -1,21 +0,0 @@
1
- import type { AgentConnection } from "./agent-connection.js";
2
- import type { ConversationDeps, ConversationHost } from "./conversation-host.js";
3
- /**
4
- * The commands the agent left running in the background, as the
5
- * conversation's state lists them: what each has printed, and stopping one.
6
- */
7
- export declare class ConversationBackground {
8
- private readonly host;
9
- private readonly deps;
10
- private readonly connection;
11
- constructor(host: ConversationHost, deps: ConversationDeps, connection: AgentConnection);
12
- /** Stops background command `id`, leaving the agent's turn as it is. */
13
- stop(id: string): Promise<void>;
14
- /**
15
- * What background command `id` has printed, then more as it prints it,
16
- * ending once the command has and all of it is read.
17
- */
18
- output(id: string): ReadableStream<Uint8Array>;
19
- /** Background command `id`, refusing one the agent never left. */
20
- private command;
21
- }
@@ -1,4 +0,0 @@
1
- import type { AgentConnection } from "./agent-connection.js";
2
- import type { ConversationHost } from "./conversation-host.js";
3
- /** Applies a validated user choice to the session and its log. */
4
- export declare function choose(host: ConversationHost, connection: AgentConnection, id: string, value: string): Promise<void>;
@@ -1,51 +0,0 @@
1
- import type * as acp from "@agentclientprotocol/sdk";
2
- import type { Fs } from "webappwiz/system";
3
- import type { ProjectRoster } from "./conversation-host.js";
4
- import type { Message, Sent, Upload } from "./conversation-state.js";
5
- /**
6
- * The files the person sent in a conversation, kept beside its log in a
7
- * directory named for it, and how what they said goes to the agent.
8
- */
9
- export declare class ConversationFiles {
10
- private readonly fs;
11
- /** Where the files are kept. */
12
- private readonly dir;
13
- private readonly projects;
14
- private readonly home;
15
- constructor(log: string, fs: Fs, { projects, home, }?: {
16
- /** The splates projects on this machine, for `#slug`; null for none. */
17
- projects?: ProjectRoster | null;
18
- /** The main tree of the project the conversation is in; null for none. */
19
- home?: string | null;
20
- });
21
- /**
22
- * Saves each file beside the log, named for what is in it, so the page
23
- * reads it by name rather than with every change to the conversation.
24
- * An image goes to the agent as itself when it `sees` images; anything
25
- * else, as a link to where it is kept, which every agent takes.
26
- */
27
- keep(files: Upload[], sees: boolean): Promise<Sent[]>;
28
- /** The file `name` the person sent in `messages`, or null when they sent none by that name. */
29
- attachment(name: string, messages: Message[]): Promise<{
30
- bytes: Uint8Array;
31
- mimeType: string;
32
- } | null>;
33
- /**
34
- * What `messages` say, as one prompt: their images, links to their other
35
- * files, then their words, with a line on each system they name in
36
- * `tree`, the one the agent runs in (none for a log too old to say), one
37
- * on where each project they name sits, and one on reading them as speech
38
- * when any was dictated.
39
- */
40
- content(messages: Message[], tree: string | null, sees?: boolean): Promise<acp.ContentBlock[]>;
41
- /** Deletes every file kept, for good. */
42
- remove(): Promise<void>;
43
- /**
44
- * A line on each system, conversation UUID and project `text` mentions with `#`,
45
- * then one on each `#word` that names neither, for the agent alone: the
46
- * thread keeps the words as typed. Read from `tree` and the projects as
47
- * it goes, so a system named there a moment ago counts. A system wins
48
- * over a project of the same name.
49
- */
50
- private namedIn;
51
- }
@@ -1,8 +0,0 @@
1
- import type { WorktreeService } from "./worktree-service.js";
2
- /**
3
- * The conversation a command is about: `given` from `--conversation`, for an
4
- * agent outside `splates server`, else the one `splates server` started this agent in
5
- * ($SPLATES_CONVERSATION). Refuses `usage` when neither names one of this
6
- * repository's.
7
- */
8
- export declare function conversationOf(service: WorktreeService, given: string): Promise<string>;
@@ -1,102 +0,0 @@
1
- import type { Events } from "webappwiz/events";
2
- import type { IdProvider } from "webappwiz/id";
3
- import type { Fs, Lock } from "webappwiz/system";
4
- import type { Timer, WallClock } from "webappwiz/time";
5
- import type { Agent, Launcher } from "./agent-process.js";
6
- import type { ArtifactRoom } from "./artifact-room.js";
7
- import type { ArtifactLimits } from "./artifacts.js";
8
- import type { ConversationLog } from "./conversation-log.js";
9
- import type { ConversationState } from "./conversation-state.js";
10
- import type { Reach } from "./projects.js";
11
- import type { SessionServers } from "./shared-browser.js";
12
- import type { Watch } from "./watch.js";
13
- import type { WorkerMachine } from "./worker-machine.js";
14
- /**
15
- * What a conversation's parts, its connection, its turns and its background
16
- * commands, share of it: its state and log, and the few things they do to
17
- * the whole. `Conversation` implements it.
18
- */
19
- export interface ConversationHost {
20
- readonly state: ConversationState;
21
- readonly log: ConversationLog;
22
- readonly events: Events<ConversationEvents>;
23
- /** What runs it; null when its agent is no longer known. */
24
- readonly agent: Agent | null;
25
- /** Where it runs; null for a log too old to say. */
26
- readonly cwd: string | null;
27
- /** Under way while the agent starts or comes back, for a prompt to wait on. */
28
- readonly opening: Promise<void> | null;
29
- now(): string;
30
- set(next: Partial<ConversationState>): void;
31
- changed(): void;
32
- /** A turn ended, with `error` for one that failed. */
33
- ended(error: string | null): void;
34
- /** Ends the agent's process, with `error` for one that failed. */
35
- close(error: string | null): Promise<void>;
36
- /** Brings a stopped conversation back: a new process, the same session or a new one. */
37
- resume(): Promise<void>;
38
- /** Back on the list, stopped until the next prompt. */
39
- unarchive(): Promise<void>;
40
- /** Marks it `unread` or not. */
41
- flag(unread: boolean): void;
42
- }
43
- export type ConversationEvents = {
44
- changed: undefined;
45
- chosen: string;
46
- };
47
- /** What every conversation in a repo is made with. */
48
- export interface ConversationDeps {
49
- fs: Fs;
50
- /** What names the files artifacts are kept in. */
51
- ids: IdProvider;
52
- /** How many bytes of artifacts it may keep (`artifacts.ts`). */
53
- artifacts: ArtifactLimits;
54
- /** What makes room for an add across the project; none refuses one past it. */
55
- room?: ArtifactRoom;
56
- timer: Timer;
57
- clock: WallClock;
58
- /** What starts each agent, and takes one back after a restart. */
59
- launcher: Launcher;
60
- /** Where the agent runs, which its background commands' output is read from. */
61
- machine: WorkerMachine;
62
- /**
63
- * Hold it while an agent's process starts, until it answers
64
- * `initialize`, so agents start one at a time.
65
- */
66
- starting: Lock;
67
- /** Where `splates server` answers, for the agent's CLI to tell it things. */
68
- url: string | null;
69
- /** What watches the agent's commands; null to leave them be. */
70
- watch: Watch | null;
71
- /** The main tree, where a conversation carries on once its worktree is gone. */
72
- root: string | null;
73
- /** The splates projects on this machine, for `#slug`; null for none. */
74
- projects: ProjectRoster | null;
75
- /** The MCP servers each session is offered, beyond the agent's own; null for none. */
76
- servers: SessionServers | null;
77
- }
78
- /** The splates projects on this machine, as `Projects` lists them. */
79
- export interface ProjectRoster {
80
- /** Each project, flagged `gone` when its repository is no longer there. */
81
- list(): Promise<(ProjectRef & {
82
- gone: boolean;
83
- })[]>;
84
- /** What the project at `from` may do in the one at `to`. */
85
- reach(from: string, to: string): Promise<Reach>;
86
- }
87
- /** A splates project a prompt can name as `#slug`. */
88
- export interface ProjectRef {
89
- slug: string;
90
- /** Its main tree's root. */
91
- root: string;
92
- }
93
- /**
94
- * `changed`, `ended` (a turn ended, however it did, or the agent failed to
95
- * start) and `removed` each carry a conversation's id.
96
- */
97
- export type ConversationsEvents = {
98
- settings: undefined;
99
- changed: string;
100
- ended: string;
101
- removed: string;
102
- };
@@ -1,15 +0,0 @@
1
- import type { Conversations } from "./conversations.js";
2
- /** The conversations and saved agent defaults offered to the page. */
3
- export declare function listing(all: Conversations): Promise<{
4
- agents: {
5
- id: string;
6
- name: string;
7
- models: {
8
- id: string;
9
- name: string;
10
- }[];
11
- settings: import("./conversation-state.js").Setting[];
12
- limits: import("./conversation-state.js").Limit[];
13
- }[];
14
- conversations: import("./conversation-state.js").ConversationState[];
15
- }>;