@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/load-config.d.ts DELETED
@@ -1,44 +0,0 @@
1
- import { type Fs } from "webappwiz/system";
2
- import type { Config } from "./config.js";
3
- import { Git } from "./git.js";
4
- /** The file a repo's settings are in, at its root. */
5
- export declare const CONFIG_FILE = "splates.config.ts";
6
- export interface LoadConfigOptions {
7
- /** What `splates.config.ts` is looked for through; the real one by default. */
8
- fs?: Fs;
9
- /** What the trunk is detected through; the repo's own git by default. */
10
- git?: Git;
11
- }
12
- /**
13
- * The settings splates runs a repo with: what `splates.config.ts` names, then the
14
- * branch `origin/HEAD` points at for the trunk, then splates's own defaults.
15
- * Throws when the config file is there but cannot be imported.
16
- */
17
- export declare function loadConfig(root: string, opts?: LoadConfigOptions): Promise<Config>;
18
- /** Reads the TypeScript files a repo keeps its settings in, through `fs`. */
19
- export declare class ConfigFiles {
20
- private readonly fs;
21
- constructor(fs?: Fs);
22
- /**
23
- * What `root`'s `splates.config.ts` names, or nothing when there is no such
24
- * file. Systems live in `splates.systems.ts` now: a config that still names
25
- * them is read without them, so `splates update` can run to move them.
26
- */
27
- read(root: string): Promise<Partial<Config>>;
28
- /**
29
- * Everything `root`'s `splates.config.ts` exports as its default, unchecked, or
30
- * nothing when there is no such file.
31
- */
32
- importConfig(root: string): Promise<Record<string, unknown>>;
33
- /**
34
- * Where `file` is at `root`, under arbor's old name for it until `splates
35
- * update` renames it, or null when it is under neither.
36
- */
37
- private found;
38
- /**
39
- * What the TypeScript file `file` at `root` exports as its default, unchecked,
40
- * or nothing when there is no such file. Read afresh whenever the file has
41
- * changed, so a long-running `splates server` sees an edit without a restart.
42
- */
43
- importDefault(root: string, file: string): Promise<Record<string, unknown>>;
44
- }
package/log.d.ts DELETED
@@ -1,14 +0,0 @@
1
- import { type Logger } from "webappwiz/log";
2
- import type { Journal } from "./journal.js";
3
- /** Enough to cover a session's worth of work without scrolling. */
4
- export declare const DEFAULT_COUNT = 20;
5
- export interface LogOptions {
6
- /** How many of the most recent entries to show. */
7
- count?: number;
8
- /** Print the entries as JSON instead of a table. */
9
- json?: boolean;
10
- }
11
- export declare function log({ journal, log }: {
12
- journal: Journal;
13
- log: Logger;
14
- }, { count, json }?: LogOptions): Promise<void>;
package/machine.d.ts DELETED
@@ -1,42 +0,0 @@
1
- import type { Fs } from "webappwiz/system";
2
- /** How hard the machine `splates server` runs on is working right now. */
3
- export interface MachineReading {
4
- /** What the page calls the machine: "Mac" on macOS, else "machine". */
5
- kind: "Mac" | "machine";
6
- /** The share of CPU time busy since the reading before, 0 to 1. */
7
- cpu: number;
8
- /** The share of memory in use, 0 to 1. */
9
- memory: number;
10
- /** The load average over the last minute. */
11
- load: number;
12
- cores: number;
13
- /** The hottest CPU sensor in °C, or null where none can be read. */
14
- temperature: number | null;
15
- }
16
- /** Where a reading comes from: the OS by default, a fake in tests. */
17
- export interface MachineSensors {
18
- platform: NodeJS.Platform;
19
- cpus(): {
20
- times: Record<"user" | "nice" | "sys" | "idle" | "irq", number>;
21
- }[];
22
- loadavg(): number[];
23
- freemem(): number;
24
- totalmem(): number;
25
- temperature(): Promise<number | null>;
26
- }
27
- /**
28
- * Reads the machine on each ask, its CPU share taken over the time since the
29
- * ask before, or since it was made for the first.
30
- */
31
- export declare class Machine {
32
- #private;
33
- constructor(sensors: MachineSensors);
34
- read(): Promise<MachineReading>;
35
- }
36
- /**
37
- * The machine this process runs on. Temperature is read from Linux's thermal
38
- * zones, and from the CPU die sensors on Apple Silicon; null elsewhere.
39
- */
40
- export declare function osSensors(fs: Fs): MachineSensors;
41
- /** The hottest of Linux's thermal zones under `root`, in °C, or null for none. */
42
- export declare function thermalZones(fs: Fs, root: string): Promise<number | null>;
package/merge.d.ts DELETED
@@ -1,35 +0,0 @@
1
- import { type Logger } from "webappwiz/log";
2
- import type { Fs, HeavyCap, Lock } from "webappwiz/system";
3
- import type { Config } from "./config.js";
4
- import type { Facts } from "./events.js";
5
- import type { Git } from "./git.js";
6
- import type { Shell } from "./shell.js";
7
- import { type Slots } from "./slots.js";
8
- import type { Todos } from "./todos.js";
9
- import type { FailedTest } from "./worktree.js";
10
- import type { WorktreeService } from "./worktree-service.js";
11
- /**
12
- * Lands the current worktree's branch on its base branch, trunk unless the
13
- * task was created with `--base`. Never a merge commit: it rebases onto the
14
- * base, runs the gate there, and fast-forwards the base with
15
- * `git merge --ff-only`, in whichever worktree has the base checked out.
16
- * History stays linear.
17
- */
18
- export declare function merge({ service, git, lock, shell, config, log, todos, fs, slots, heavy, }: {
19
- service: WorktreeService;
20
- git: Git;
21
- lock: Lock;
22
- shell: Shell;
23
- config: Config;
24
- log: Logger;
25
- todos: Todos;
26
- fs: Fs;
27
- slots: Slots;
28
- heavy: HeavyCap;
29
- }, cwd: string, facts?: Partial<Facts["merge"]>): Promise<void>;
30
- /**
31
- * The tests a runner reported as failing, each with what it said, which the
32
- * tail cuts off. Another runner prints none, so the tail alone is what the
33
- * agent gets.
34
- */
35
- export declare function failedTests(output: string): FailedTest[];
@@ -1,31 +0,0 @@
1
- import { type Logger } from "webappwiz/log";
2
- import type { Fs } from "webappwiz/system";
3
- import { type SystemsFile } from "./systems.js";
4
- /**
5
- * Moves the systems an older `splates.config.ts` names into `splates.systems.ts`,
6
- * taking the `systems` key out of the config. Does nothing when the config
7
- * names none. Rewrites the config only once re-importing it shows the rest of
8
- * it unchanged, and puts it back otherwise. Answers with the exit code to end
9
- * on.
10
- */
11
- export declare function moveSystems({ root, fs, log, }: {
12
- /** The repository's main tree. */
13
- root: string;
14
- fs: Fs;
15
- log: Logger;
16
- }): Promise<number>;
17
- /**
18
- * Types an older `splates.config.ts` by a type-only import and `satisfies`
19
- * rather than `defineConfig`, so a reader can import it without splates
20
- * installed. Leaves a config it cannot rewrite as it is, since
21
- * `defineConfig` still works. Rewrites it only once re-importing it shows it
22
- * unchanged, and puts it back otherwise.
23
- */
24
- export declare function typeConfig({ root, fs, log, }: {
25
- /** The repository's main tree. */
26
- root: string;
27
- fs: Fs;
28
- log: Logger;
29
- }): Promise<void>;
30
- /** A `splates.systems.ts` that names `systems`, keys unquoted where they can be. */
31
- export declare function systemsSource(systems: SystemsFile): string;
package/models.d.ts DELETED
@@ -1,24 +0,0 @@
1
- import type { Fs } from "webappwiz/system";
2
- import type { Setting } from "./conversations.js";
3
- /**
4
- * Where `model` is among `settings`: the model setting's id, and the value
5
- * there whose value or name it is; null when none offers it. Provider-qualified
6
- * values always require an exact ID; `exact` also disables all display aliases.
7
- */
8
- export declare function modelOption(settings: Setting[], model: string, exact?: boolean): {
9
- setting: string;
10
- value: string;
11
- } | null;
12
- /**
13
- * The model `settings` has picked, by its name, `Opus 5.5`; for a default,
14
- * the model its description says it stands for. Null when none is offered.
15
- */
16
- export declare function pickedModel(settings: Setting[]): string | null;
17
- /**
18
- * The agent the conversation logged at `log` runs, and the model it last had
19
- * picked; null when there is no such log.
20
- */
21
- export declare function ranWith(log: string, fs: Fs): Promise<{
22
- agent: string;
23
- model: string | null;
24
- } | null>;
package/needs.d.ts DELETED
@@ -1,115 +0,0 @@
1
- import { Duration } from "webappwiz/time";
2
- import type { ConversationState } from "./conversations.js";
3
- import { type Question } from "./plan.js";
4
- import type { Details } from "./show.js";
5
- /**
6
- * What an agent needs from the person, by how much it costs to leave it:
7
- * `waiting` has stopped on them, `assuming` goes ahead on a guess an answer
8
- * may overturn, `working` needs nothing yet, and `idle` is not doing anything.
9
- */
10
- export type Need = {
11
- kind: "waiting";
12
- why: Why;
13
- /**
14
- * What to act on: the ask, what a review asks you to look at, the
15
- * first open question, or the failure.
16
- */
17
- subject: string;
18
- /** When it stopped, where that is known. */
19
- since: string | null;
20
- /** The task's open questions, none for a task-less conversation. */
21
- questions: Question[];
22
- /** The agent handed out by this one it waits for, lifted onto it. */
23
- via?: string;
24
- } | {
25
- kind: "assuming";
26
- /** The first open question. */
27
- subject: string;
28
- questions: Question[];
29
- /** The agent handed out by this one whose questions it relays. */
30
- via?: string;
31
- } | {
32
- kind: "working";
33
- /** The next step under `## Next`, else the Goal's first line. */
34
- subject: string | null;
35
- } | {
36
- kind: "idle";
37
- };
38
- /** One agent the page shows: a conversation, its task, or both. */
39
- export interface Needing {
40
- conversation: ConversationState | null;
41
- task: Details | null;
42
- need: Need;
43
- }
44
- /**
45
- * Every listed conversation, and every live task no listed conversation runs
46
- * in (an external agent, run outside the page) and none is about to, with
47
- * what each needs: those waiting first,
48
- * oldest stop first, then those assuming, most open questions first, then the
49
- * rest in the order given.
50
- */
51
- export declare function needs({ tasks, conversations, }: {
52
- tasks: Details[];
53
- conversations: ConversationState[];
54
- }): Needing[];
55
- /**
56
- * Why an agent waits: a live ACP ask (a permission or a form), a review it
57
- * escalated for, any other escalation, open questions it ended its turn on,
58
- * a failure, or for a task, no agent left on it (see `abandoned`).
59
- */
60
- export type Why = "ask" | "review" | "escalated" | "questions" | "failed" | "abandoned";
61
- /**
62
- * Every live task no listed conversation runs in, an external agent's, with
63
- * what it needs, before `answeredThrough`. One handed to an agent shows once
64
- * its conversation starts.
65
- */
66
- export declare function externals(tasks: Details[], conversations: ConversationState[]): Needing[];
67
- /** What a task no listed conversation runs in needs: see `externals`. */
68
- export declare function needOfExternal(task: Details, conversations: ConversationState[]): Need;
69
- /**
70
- * Whether no agent is left on an external task, for certain: the page
71
- * conversation whose agent last took it is archived, or gone with the oldest
72
- * archived ones, and no agent outside the page has taken it since. What it
73
- * says of it, and since when; null while an agent may yet be on it. A
74
- * conversation listed on another task may still have a subagent on this
75
- * one, so only going quiet tells of it.
76
- */
77
- export declare function abandoned(task: Details, conversations: ConversationState[]): {
78
- subject: string;
79
- since: string | null;
80
- } | null;
81
- /**
82
- * How long an external agent's task goes without a sign of it at work before
83
- * it shows as quiet: long enough for a test run or a long think.
84
- */
85
- export declare const QUIET_AFTER: Duration;
86
- /**
87
- * When an external agent's task last showed a sign of its agent at work, once
88
- * that is `QUIET_AFTER` ago at `now`; null while it has lately, or nothing
89
- * says. Only an agent taken to be at work goes quiet: one that waits on the
90
- * person is still for a reason.
91
- */
92
- export declare function quietSince({ task, need }: Pick<Needing, "task" | "need">, now: number): string | null;
93
- /**
94
- * What one agent needs, from its conversation (null for an agent the page
95
- * does not run) and the task it is in (null for the main tree).
96
- */
97
- export declare function need(task: Details | null, conversation: ConversationState | null): Need;
98
- /**
99
- * `found` with each agent that answers to another conversation waiting on
100
- * that one rather than on the person: only the person answers its asks, so
101
- * one waits on that one's row, where they show, whatever it is doing; its
102
- * escalations reach the person through that one's reports, so one waits on
103
- * that one's row once it is idle, having relayed it, naming the agent, and
104
- * while it works on regardless, that one goes ahead with them owed, as an
105
- * assuming agent does. A failure stays the agent's own, since nothing tells
106
- * that one of it.
107
- */
108
- export declare function answeredThrough(found: Needing[], conversations: ConversationState[]): Needing[];
109
- /**
110
- * The conversation an agent answers to, rather than to the person, while the
111
- * page holds it: the one that handed its conversation the task, or for an
112
- * external agent, such as a subagent its harness started, the listed one
113
- * whose agent added its task.
114
- */
115
- export declare function answersTo({ conversation, task }: Pick<Needing, "conversation" | "task">, conversations: readonly ConversationState[]): ConversationState | null;
package/notices.d.ts DELETED
@@ -1,39 +0,0 @@
1
- import type { Needing } from "./needs.js";
2
- /** Something a row did worth telling the person about, away from the page. */
3
- export interface Notice {
4
- row: Needing;
5
- title: string;
6
- body: string;
7
- }
8
- /** Which notices the person asked for, as the page's Notifications settings say. */
9
- export interface Wants {
10
- waiting: boolean;
11
- finished: boolean;
12
- quiet: boolean;
13
- /** Minutes a running agent goes without a word before it counts as quiet. */
14
- quietAfter: number;
15
- }
16
- /**
17
- * Tells what changed in the rows since the last look worth notifying of,
18
- * the same on the page and on the server, which pushes it to a phone the
19
- * page cannot run on once it leaves the front.
20
- */
21
- export declare class Notices {
22
- /** By row, what the last look saw; null before the first. */
23
- private seen;
24
- /**
25
- * Compares `rows`, named by `name`, with the last look at `now`, and
26
- * returns what changed worth telling, of the kinds `wants` asks for: a
27
- * row that came to wait, a conversation that finished its turn, and one
28
- * running with no word for the quiet time. The first look tells nothing,
29
- * since it has nothing to compare.
30
- */
31
- look(rows: Needing[], name: (row: Needing) => string, now: number, wants: Wants): Notice[];
32
- }
33
- /** What tells `row` apart from the others, in a notification and its click. */
34
- export declare function keyOf(row: Needing): string;
35
- /**
36
- * The first line of `markdown` with its marks taken out, cut to `length`:
37
- * a notification shows plain text, and a phone only a line or so of it.
38
- */
39
- export declare function plain(markdown: string, length: number): string;
package/offered.d.ts DELETED
@@ -1,39 +0,0 @@
1
- import type { Fs } from "webappwiz/system";
2
- import type { Conversation } from "./conversation.js";
3
- import type { Setting } from "./conversations.js";
4
- /**
5
- * The agent settings offered across projects, with defaults changed only by
6
- * user selections. Session reports can refresh available options without
7
- * replacing the values the person picked.
8
- */
9
- export declare class Offered {
10
- /** `~/.splates/offered.json`, or a test's own. */
11
- readonly path: string;
12
- private readonly deps;
13
- /** Read once, then kept: this process is the one writing it. */
14
- private known;
15
- /** Set when a newer splates wrote the file, which this one leaves alone. */
16
- private newer;
17
- /** Writes one after another, so none is lost to another. */
18
- private writing;
19
- constructor(
20
- /** `~/.splates/offered.json`, or a test's own. */
21
- path: string, deps: {
22
- fs: Fs;
23
- });
24
- /** Every agent's settings, by its id; none for one never started. */
25
- all(): Promise<Record<string, Setting[]>>;
26
- /**
27
- * Keeps `settings` as what `agent`'s sessions offer from now on, or, with
28
- * `preserveChoices`, refreshes options while keeping existing default values.
29
- */
30
- remember(agent: string, settings: Setting[], { preserveChoices }?: {
31
- preserveChoices?: boolean;
32
- }): Promise<void>;
33
- /** Saves only settings the person selected, leaving other defaults alone. */
34
- choose(agent: string, settings: Setting[], ids: string[]): Promise<void>;
35
- /** Tracks capabilities separately from explicit choices, including the opening form. */
36
- track(conversation: Conversation, changed: () => void, picks?: Record<string, string>): void;
37
- private read;
38
- private write;
39
- }
@@ -1,37 +0,0 @@
1
- import type * as acp from "@agentclientprotocol/sdk";
2
- import type { ConversationState } from "./conversation-state.js";
3
- /** Observations, never a quota estimate or evidence of an invoice. */
4
- export interface OpenCodeUsage {
5
- turns: ObservedTurn[];
6
- costAt: string | null;
7
- retry: {
8
- attempt: number | null;
9
- nextRetryAt: string | null;
10
- message: string;
11
- type: string | null;
12
- status: number | null;
13
- } | null;
14
- }
15
- /** Null means absent or invalid, including in logs predating instrumentation. */
16
- export interface ObservedTurn {
17
- at: string;
18
- until: string | null;
19
- firstText: string | null;
20
- requested: string | null;
21
- confirmed: string | null;
22
- cwd: string | null;
23
- /** ACP prompt response; per turn, parent session only. */
24
- tokens: {
25
- input: number | null;
26
- output: number | null;
27
- cachedRead: number | null;
28
- cachedWrite: number | null;
29
- } | null;
30
- }
31
- export declare function metric(value: unknown): number | null;
32
- /** End exactly once, including cancellation, failure and worker reattachment. */
33
- export declare function finishObservation(state: ConversationState, at: string | null): void;
34
- /** Keep only documented retry fields; provider response bodies are not diagnostics. */
35
- export declare function safeOpenCodeUpdate(update: acp.SessionUpdate): acp.SessionUpdate;
36
- /** Snapshot fields independently; optional cache data is not evidence of zero. */
37
- export declare function observeTokens(state: ConversationState, usage: acp.Usage): void;
package/outcomes.d.ts DELETED
@@ -1,114 +0,0 @@
1
- import type { Fs } from "webappwiz/system";
2
- import type { Device } from "./conversation-state.js";
3
- import type { Finding } from "./findings.js";
4
- import type { Decision } from "./plan.js";
5
- import { type TaskUsage } from "./task-log.js";
6
- import type { DiffSize, MergeFailure, RemoveReason } from "./worktree.js";
7
- /**
8
- * Every task that has ended on this machine, across projects, in
9
- * `~/.splates/outcomes.jsonl`, oldest first. Unlike the journal it is never
10
- * trimmed: a trend needs months of it, and a line per task stays small.
11
- */
12
- export declare class Outcomes {
13
- /** `~/.splates/outcomes.jsonl`, or a test's own. */
14
- readonly path: string;
15
- private readonly fs;
16
- constructor(
17
- /** `~/.splates/outcomes.jsonl`, or a test's own. */
18
- path: string, fs: Fs);
19
- /**
20
- * Beside `path`, the usage of the turns tasks ended in, which `splates
21
- * merge` writes its line too early to see. Apart from `path`, so splates
22
- * versions that read only that never mistake one for a task.
23
- */
24
- get turnsPath(): string;
25
- record(outcome: Outcome): Promise<void>;
26
- list(): Promise<Outcome[]>;
27
- /**
28
- * Credits the task that `conversation`, logged at `log`, ended last in
29
- * its turn from `since` to `until` with what the rest of that turn used,
30
- * once the turn has ended and said it. Several ended in one turn: the
31
- * last one's is what the turn finished on.
32
- */
33
- creditTurn(conversation: string, log: string, since: string, until: string): Promise<void>;
34
- private get dir();
35
- }
36
- /**
37
- * How one task ended, written as it goes. Its record goes with it, so this is
38
- * what is left to tell whether tasks are getting easier to land over time.
39
- */
40
- export interface Outcome {
41
- /** The main tree of the repository the task was in. */
42
- project: string;
43
- task: string;
44
- /** Where it landed or would have: trunk, or `task/<parent>` for a part. */
45
- base: string;
46
- ended: "merged" | "removed";
47
- /** When it was added, as an ISO timestamp. */
48
- startedAt: string;
49
- /** When it was merged or removed, as an ISO timestamp. */
50
- endedAt: string;
51
- /** How many times it was handed to a person with questions. */
52
- questionRounds: number;
53
- /** How many times it was handed to a person to approve. */
54
- reviewRounds: number;
55
- /** Merges that failed on a conflict, the gate, or a base that would not move. */
56
- failedMerges: number;
57
- /** `failedMerges` by why each failed. Absent from lines written before it was kept. */
58
- failedMergesBy?: Partial<Record<MergeFailure, number>>;
59
- /** The questions its plan asked under `## Blocked`. Absent from older lines. */
60
- questionsAsked?: number;
61
- /** Of those, the ones that offered a `(chosen)` pick and were answered with a choice. */
62
- picksAsked?: number;
63
- /** Of `picksAsked`, those answered with another choice than the agent's. */
64
- picksOverturned?: number;
65
- /** Of `picksAsked`, those answered with the agent's choice but with words added. */
66
- picksAmended?: number;
67
- /** The calls its plan made without asking, under `## Assumptions` or challenged out of it. Absent from older lines. */
68
- assumptionsMade?: number;
69
- /** Of `assumptionsMade`, those the person challenged. */
70
- assumptionsChallenged?: number;
71
- /**
72
- * Each call its plan made, asked or assumed, with its size and what became
73
- * of it. Absent from older lines, whose calls the counts above alone keep.
74
- */
75
- decisions?: Decision[];
76
- /** The systems its changed files fall in, by name. Absent from older lines. */
77
- systems?: string[];
78
- /** How long it waited on a person, escalated, in milliseconds. Absent from older lines. */
79
- waitedMs?: number;
80
- /** Why it was removed, when `splates remove --reason` said; null when merged or unsaid. */
81
- removedFor?: RemoveReason | null;
82
- /** For a merge, each commit's message it landed, oldest first. Absent from older lines. */
83
- commits?: string[];
84
- /**
85
- * How many times the person spoke to its conversation from each layout of
86
- * the page while it ran. Absent from older lines.
87
- */
88
- promptsFrom?: Partial<Record<Device, number>>;
89
- /**
90
- * What its own turns used, not the rest of its conversation's, the turn it
91
- * ended in added from `turnsPath` once `splates server` saw it end. Absent from
92
- * older lines, for a task with no conversation log to read, and, as read,
93
- * for one with no tokens out, which never kept the turns that did its work.
94
- */
95
- usage?: TaskUsage;
96
- /** How long its agent worked, its turns summed, in milliseconds. Absent as `usage` is. */
97
- workedMs?: number;
98
- /** What it landed, or for a removed task, what its branch held. Absent from older lines. */
99
- size?: DiffSize;
100
- /** What went worse than it could have. Absent from older lines, never read as none. */
101
- findings?: Finding[];
102
- /** The `splates server` conversation that ended it; null for an external agent. */
103
- conversation: string | null;
104
- /** The agent `splates add --agent` handed it to, if any. */
105
- agent: string | null;
106
- /** The model it was handed over with, if any. */
107
- model: string | null;
108
- }
109
- /**
110
- * How many prompts the person said from each layout in the conversation
111
- * logged at `log`, from `since` to `until`: a conversation can outlive the
112
- * task, or come to it already under way.
113
- */
114
- export declare function promptsFrom(log: string, fs: Fs, since: string, until: string): Promise<Partial<Record<Device, number>>>;
package/path.d.ts DELETED
@@ -1,13 +0,0 @@
1
- import type { Logger } from "webappwiz/log";
2
- import type { WorktreeService } from "./worktree-service.js";
3
- /**
4
- * Where a task lives, or (with no task) the main tree. Nothing but the path
5
- * on stdout, so it composes: `cd "$(splates path)"`, `zed -a "$(splates path x)"`.
6
- * Moving between trees is `cd` and nothing else, and the main tree is the one
7
- * path a process standing in a worktree cannot otherwise name: git's
8
- * `--show-toplevel` hands back the worktree it is already in.
9
- */
10
- export declare function path({ service, log }: {
11
- service: WorktreeService;
12
- log: Logger;
13
- }, task?: string): Promise<void>;