@stringsync/splates 0.0.45 → 0.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/README.md +121 -9
  2. package/artifact.d.ts +3 -30
  3. package/budget.d.ts +3 -0
  4. package/coordinator.d.ts +3 -0
  5. package/creds.d.ts +3 -123
  6. package/flags.d.ts +37 -0
  7. package/index.js +729 -26375
  8. package/lane.d.ts +3 -55
  9. package/main.d.ts +6 -0
  10. package/package.json +3 -42
  11. package/projects.d.ts +3 -136
  12. package/queue.d.ts +3 -0
  13. package/setup.d.ts +16 -98
  14. package/slots.d.ts +3 -135
  15. package/splates.d.ts +1 -19
  16. package/todo.d.ts +3 -146
  17. package/{splates-tunnel.d.ts → tunnel.d.ts} +1 -1
  18. package/{splates-worker.d.ts → worker.d.ts} +1 -1
  19. package/acp-extensions.d.ts +0 -82
  20. package/add.d.ts +0 -53
  21. package/adherence.d.ts +0 -49
  22. package/age.d.ts +0 -2
  23. package/agent-connection.d.ts +0 -171
  24. package/agent-errors.d.ts +0 -2
  25. package/agent-process.d.ts +0 -65
  26. package/agent-stream.d.ts +0 -91
  27. package/agents.d.ts +0 -15
  28. package/artifact-room.d.ts +0 -47
  29. package/artifact-viewers.d.ts +0 -6
  30. package/artifacts.d.ts +0 -161
  31. package/asked.d.ts +0 -146
  32. package/asked.js +0 -7
  33. package/assumed.d.ts +0 -34
  34. package/attach.d.ts +0 -30
  35. package/attachments.d.ts +0 -43
  36. package/baselines.d.ts +0 -55
  37. package/claim.d.ts +0 -17
  38. package/cloudflare-api.d.ts +0 -25
  39. package/cloudflare-error.d.ts +0 -5
  40. package/cloudflared-tunnel-provider.d.ts +0 -27
  41. package/codex-limits.d.ts +0 -19
  42. package/compaction.d.ts +0 -17
  43. package/config-source.d.ts +0 -13
  44. package/config.d.ts +0 -98
  45. package/config.js +0 -7
  46. package/conversation-archive.d.ts +0 -6
  47. package/conversation-background.d.ts +0 -21
  48. package/conversation-choice.d.ts +0 -4
  49. package/conversation-files.d.ts +0 -51
  50. package/conversation-given.d.ts +0 -8
  51. package/conversation-host.d.ts +0 -102
  52. package/conversation-listing.d.ts +0 -15
  53. package/conversation-log.d.ts +0 -301
  54. package/conversation-messages.d.ts +0 -18
  55. package/conversation-name.d.ts +0 -28
  56. package/conversation-options.d.ts +0 -73
  57. package/conversation-reference.d.ts +0 -2
  58. package/conversation-state.d.ts +0 -472
  59. package/conversation-turns.d.ts +0 -115
  60. package/conversation.d.ts +0 -209
  61. package/conversations.d.ts +0 -140
  62. package/coordinator-state.d.ts +0 -28
  63. package/darwin-temperature.d.ts +0 -7
  64. package/decided.d.ts +0 -18
  65. package/demo.d.ts +0 -29
  66. package/dev/api.d.ts +0 -209
  67. package/dev/assets.d.ts +0 -24
  68. package/dev/conversation-address.d.ts +0 -47
  69. package/dev/conversation-feed.d.ts +0 -166
  70. package/dev/live-stream.d.ts +0 -29
  71. package/dev/worker.d.ts +0 -33
  72. package/dev-access.d.ts +0 -61
  73. package/dev-artifacts.d.ts +0 -22
  74. package/dev-budgets.d.ts +0 -18
  75. package/dev-conversation-events.d.ts +0 -39
  76. package/dev-conversation-routes.d.ts +0 -90
  77. package/dev-creds.d.ts +0 -17
  78. package/dev-dictation-connection.d.ts +0 -18
  79. package/dev-dictation.d.ts +0 -17
  80. package/dev-http.d.ts +0 -76
  81. package/dev-open.d.ts +0 -15
  82. package/dev-options.d.ts +0 -133
  83. package/dev-outcomes.d.ts +0 -21
  84. package/dev-pages.d.ts +0 -16
  85. package/dev-picker.d.ts +0 -57
  86. package/dev-port-socket.d.ts +0 -26
  87. package/dev-ports.d.ts +0 -11
  88. package/dev-project-watch.d.ts +0 -44
  89. package/dev-project.d.ts +0 -168
  90. package/dev-push.d.ts +0 -59
  91. package/dev-restart.d.ts +0 -141
  92. package/dev-servers.d.ts +0 -30
  93. package/dev-setup-native.d.ts +0 -23
  94. package/dev-setup-opencode.d.ts +0 -29
  95. package/dev-setup.d.ts +0 -16
  96. package/dev-shell.d.ts +0 -70
  97. package/dev-slot.d.ts +0 -28
  98. package/dev-sockets.d.ts +0 -13
  99. package/dev-task-ports.d.ts +0 -73
  100. package/dev-tasks.d.ts +0 -20
  101. package/dev-terminal-connection.d.ts +0 -19
  102. package/dev-terminal.d.ts +0 -42
  103. package/dev-todos.d.ts +0 -35
  104. package/dev-transcriber.d.ts +0 -15
  105. package/dev-tunnel.d.ts +0 -38
  106. package/dev-versions.d.ts +0 -53
  107. package/dev-workers.d.ts +0 -55
  108. package/dev.d.ts +0 -24
  109. package/diff.d.ts +0 -29
  110. package/dispatched.d.ts +0 -16
  111. package/editors.d.ts +0 -22
  112. package/escalate.d.ts +0 -27
  113. package/events.d.ts +0 -311
  114. package/everywhere.d.ts +0 -41
  115. package/exhibit.d.ts +0 -21
  116. package/exit.d.ts +0 -54
  117. package/fact-todos.d.ts +0 -18
  118. package/fake-agent.d.ts +0 -107
  119. package/fake-agent.js +0 -284
  120. package/finding-facts.d.ts +0 -38
  121. package/findings.d.ts +0 -84
  122. package/fold.d.ts +0 -43
  123. package/follow.d.ts +0 -41
  124. package/format.d.ts +0 -68
  125. package/git.d.ts +0 -112
  126. package/handed-out.d.ts +0 -79
  127. package/handoff.d.ts +0 -23
  128. package/heavy-run.d.ts +0 -12
  129. package/heavy.d.ts +0 -28
  130. package/heavy.js +0 -16
  131. package/held.d.ts +0 -22
  132. package/index-0tfvy823.js +0 -272
  133. package/index-43pq33n4.js +0 -157
  134. package/index-4776671w.js +0 -698
  135. package/index-d4hjrzaq.js +0 -464
  136. package/index-gcfq7awr.js +0 -740
  137. package/index-k73tsw5g.js +0 -101
  138. package/index-kaa44k7q.js +0 -59
  139. package/index-vcv9m93e.js +0 -1265
  140. package/index-xmfmy729.js +0 -249
  141. package/init.d.ts +0 -28
  142. package/journal.d.ts +0 -57
  143. package/landed.d.ts +0 -14
  144. package/lane-todos.d.ts +0 -44
  145. package/lanes-from-tags.d.ts +0 -17
  146. package/lanes.d.ts +0 -96
  147. package/legacy-names.d.ts +0 -70
  148. package/legacy-ps.d.ts +0 -31
  149. package/limits.d.ts +0 -32
  150. package/list.d.ts +0 -18
  151. package/load-config.d.ts +0 -44
  152. package/log.d.ts +0 -14
  153. package/machine.d.ts +0 -42
  154. package/merge.d.ts +0 -35
  155. package/migrate-config.d.ts +0 -31
  156. package/models.d.ts +0 -24
  157. package/needs.d.ts +0 -115
  158. package/notices.d.ts +0 -39
  159. package/offered.d.ts +0 -39
  160. package/opencode-usage.d.ts +0 -37
  161. package/outcomes.d.ts +0 -114
  162. package/path.d.ts +0 -13
  163. package/plan.d.ts +0 -236
  164. package/port-forward.d.ts +0 -22
  165. package/port-pipe.d.ts +0 -36
  166. package/ports-list.d.ts +0 -19
  167. package/probe-runtime.d.ts +0 -5
  168. package/probe-runtime.js +0 -13
  169. package/project-reaches.d.ts +0 -23
  170. package/prompts.d.ts +0 -128
  171. package/pty.d.ts +0 -39
  172. package/pulse.d.ts +0 -8
  173. package/recommend.d.ts +0 -31
  174. package/release.d.ts +0 -41
  175. package/remote-process.d.ts +0 -26
  176. package/remote-pty.d.ts +0 -29
  177. package/remote-worker.d.ts +0 -77
  178. package/remove.d.ts +0 -31
  179. package/repository.d.ts +0 -91
  180. package/retry.d.ts +0 -34
  181. package/roster.d.ts +0 -63
  182. package/saved-ports-host.d.ts +0 -25
  183. package/saved-tunnel.d.ts +0 -44
  184. package/server-worker-socket.d.ts +0 -21
  185. package/setup-areas.d.ts +0 -7
  186. package/setup-opencode-model-error.d.ts +0 -3
  187. package/setup-opencode-models.d.ts +0 -54
  188. package/setup-opencode-recipe.d.ts +0 -26
  189. package/setup-opencode.d.ts +0 -46
  190. package/shared-browser.d.ts +0 -50
  191. package/shell.d.ts +0 -17
  192. package/show.d.ts +0 -106
  193. package/skill-checks.d.ts +0 -73
  194. package/skill-checks.js +0 -10
  195. package/skills.d.ts +0 -16
  196. package/slot-tunnel.d.ts +0 -27
  197. package/snapshot.d.ts +0 -75
  198. package/splates-artifact.d.ts +0 -3
  199. package/splates-creds.d.ts +0 -3
  200. package/splates-dev.d.ts +0 -22
  201. package/splates-flags.d.ts +0 -34
  202. package/splates-lane.d.ts +0 -3
  203. package/splates-projects.d.ts +0 -3
  204. package/splates-setup.d.ts +0 -17
  205. package/splates-slots.d.ts +0 -3
  206. package/splates-todo.d.ts +0 -3
  207. package/stats.d.ts +0 -186
  208. package/supervise.d.ts +0 -50
  209. package/system-changes.d.ts +0 -67
  210. package/system.d.ts +0 -28
  211. package/systems.d.ts +0 -119
  212. package/systems.js +0 -21
  213. package/table.d.ts +0 -5
  214. package/task-log.d.ts +0 -35
  215. package/task-ports.d.ts +0 -25
  216. package/tell.d.ts +0 -47
  217. package/todo-edit.d.ts +0 -60
  218. package/todo-file.d.ts +0 -6
  219. package/todo-lanes.d.ts +0 -82
  220. package/todo-list.d.ts +0 -26
  221. package/todo-take.d.ts +0 -27
  222. package/todos.d.ts +0 -157
  223. package/tool-calls.d.ts +0 -18
  224. package/tunnel-provider.d.ts +0 -37
  225. package/tunnel-provider.js +0 -0
  226. package/tunnel-remove.d.ts +0 -28
  227. package/tunnel-setup.d.ts +0 -104
  228. package/unix-worker-listener.d.ts +0 -23
  229. package/unix-worker-socket.d.ts +0 -30
  230. package/update.d.ts +0 -29
  231. package/update.js +0 -10
  232. package/vocabulary.d.ts +0 -9
  233. package/wait.d.ts +0 -36
  234. package/watch.d.ts +0 -46
  235. package/watched.d.ts +0 -43
  236. package/websocket-worker-socket.d.ts +0 -18
  237. package/worker-call-host.d.ts +0 -51
  238. package/worker-channel.d.ts +0 -83
  239. package/worker-connection.d.ts +0 -24
  240. package/worker-daemon.d.ts +0 -64
  241. package/worker-git.d.ts +0 -18
  242. package/worker-list.d.ts +0 -49
  243. package/worker-machine.d.ts +0 -34
  244. package/worker-port-host.d.ts +0 -21
  245. package/worker-process-host.d.ts +0 -29
  246. package/worker-protocol.d.ts +0 -104
  247. package/worker-pty-host.d.ts +0 -34
  248. package/worker-registry.d.ts +0 -68
  249. package/worker-replay.d.ts +0 -25
  250. package/worker-run.d.ts +0 -20
  251. package/worker-session.d.ts +0 -189
  252. package/worker-socket.d.ts +0 -15
  253. package/worktree-service.d.ts +0 -113
  254. package/worktree.d.ts +0 -232
package/dev-options.d.ts DELETED
@@ -1,133 +0,0 @@
1
- import type { Pusher, VapidKeys } from "webappwiz/push";
2
- import type { HeavyCap, PortProvider } from "webappwiz/system";
3
- import type { Duration } from "webappwiz/time";
4
- import type { Config } from "./config.js";
5
- import type { Conversations } from "./conversations.js";
6
- import type { CoordinatorState } from "./coordinator-state.js";
7
- import type { AccessConfig } from "./dev-access.js";
8
- import type { Project } from "./dev-project.js";
9
- import type { ServerChoice } from "./dev-servers.js";
10
- import type { TranscriberFor } from "./dev-transcriber.js";
11
- import type { TunnelConfig } from "./dev-tunnel.js";
12
- import type { DevWorkers } from "./dev-workers.js";
13
- import type { Git } from "./git.js";
14
- import type { MachineSensors } from "./machine.js";
15
- import type { Slot } from "./slots.js";
16
- import type { WorkerMachine } from "./worker-machine.js";
17
- /** What `dev` lets a caller choose. */
18
- export interface DevOptions {
19
- /**
20
- * Where the local worker dials in, a Unix socket path; without it, workers
21
- * reach this server only through `/api/workers`.
22
- */
23
- workerSocket?: string | null;
24
- /** Where workers are taken in; one of its own by default. */
25
- workers?: DevWorkers | null;
26
- /**
27
- * What this coordinator keeps across its restarts: the roots of the
28
- * projects whose agents the last run let go of, served before the worker
29
- * joins so they are taken back, and written again at the next restart;
30
- * null keeps nothing, and a restart ends every agent.
31
- */
32
- coordinator?: CoordinatorState | null;
33
- /**
34
- * The worker agents and terminals run on, whose process table a restart
35
- * reads; this machine, read directly, by default.
36
- */
37
- worker?: WorkerMachine | null;
38
- /**
39
- * The wildcard base host task ports are served under, as
40
- * `<task>-<port>.<base>`, behind `access`; null serves them only on
41
- * loopback ports here. Refused without `access`.
42
- */
43
- portsHost?: string | null;
44
- /** Where to listen; the port `--port` asked for, and the span above it. */
45
- ports?: PortProvider;
46
- /**
47
- * Host names besides this machine's own that the page may be reached by,
48
- * like the hostname of a tunnel. Anything else is refused, which is what
49
- * stops another site from reading the repo through a browser pointed at
50
- * localhost. Who may use those names is the Access policy's business, not
51
- * splates's.
52
- */
53
- hosts?: string[];
54
- /**
55
- * The Cloudflare Access application in front of `hosts`, or null for none.
56
- * Given one, a request to those hosts must carry a token it signed, and
57
- * then may use conversations and terminals too. Anything that exposes the
58
- * page beyond this machine refuses to without it.
59
- */
60
- access?: AccessConfig | null;
61
- /**
62
- * The Cloudflare tunnel to run once listening, whose host `hosts` also
63
- * lets in. Refused without `access`.
64
- */
65
- tunnel?: TunnelConfig | null;
66
- /**
67
- * Makes the conversations a project's page may hold with agents, its
68
- * records in `splatesDir`, its commands watched through `git`, its limits
69
- * from `config`; without it no page has any to show, and the routes
70
- * say they are off.
71
- */
72
- conversations?: ((project: {
73
- splatesDir: string;
74
- git: Git;
75
- config: Config;
76
- }) => Conversations) | null;
77
- /**
78
- * The shell a page's terminal runs, as argv, in the main tree or a task's
79
- * worktree; without it, the page has no terminal and the route says so.
80
- */
81
- shell?: string[] | null;
82
- /**
83
- * What a project's dictations transcribe with, by default OpenAI on the
84
- * key its creds keep; a test hands in a fake.
85
- */
86
- transcriber?: TranscriberFor;
87
- /** Opens a registered project by its root; `openRepository` by default. */
88
- open?: (root: string) => Promise<Project>;
89
- /**
90
- * The latest splates on npm, or null when it cannot say, asked as the server
91
- * starts and hourly after; the page hints at a restart once it is past
92
- * `running`. Without it, nothing is checked.
93
- */
94
- newest?: () => Promise<string | null>;
95
- /** The version serving; the one installed by default. */
96
- running?: string;
97
- /** How often `newest` is asked after the first time: hourly by default. */
98
- checkEvery?: Duration;
99
- /**
100
- * The last commit to splates's own source, or null when it does not run
101
- * from a checkout. Asked as the server starts, then every `sourceEvery`;
102
- * once it moves on, the page hints at a restart. A server started from a
103
- * checkout asks this in place of `newest`, since a restart runs the
104
- * checkout again. Without it, nothing is checked.
105
- */
106
- source?: () => Promise<string | null>;
107
- /** How often `source` is asked after the first time. */
108
- sourceEvery?: Duration;
109
- /**
110
- * Whether building the page failed before this start, so what it serves
111
- * is the page built before; the page says so.
112
- */
113
- unbuilt?: boolean;
114
- /** The slot `splates server --slot` serves under, which the page shows; null for none. */
115
- slot?: Slot | null;
116
- /**
117
- * Every `splates server` on this machine, the machine's own and each slot's,
118
- * which the page's switcher lists beside the projects; none by default.
119
- */
120
- servers?: () => Promise<ServerChoice[]>;
121
- /**
122
- * Ends the process with `RESTART` or `UPDATE` once the server has
123
- * stopped, for its supervisor to start another; without it, the page
124
- * cannot restart `splates server`.
125
- */
126
- exit?: ((code: number) => void) | null;
127
- /** Where the page's machine stats come from; this machine's OS for none. */
128
- sensors?: MachineSensors | null;
129
- /** Whose test runs and installs the page shows; this machine's for none. */
130
- heavy?: Pick<HeavyCap, "read"> | null;
131
- /** What pushes notices to the devices that subscribed; the Web Push services by default. */
132
- pusher?: (keys: VapidKeys) => Pusher;
133
- }
package/dev-outcomes.d.ts DELETED
@@ -1,21 +0,0 @@
1
- import type { Fs, Ps } from "webappwiz/system";
2
- import { Adherence } from "./adherence.js";
3
- import type { Handler } from "./dev-project.js";
4
- /**
5
- * What the page reads of how tasks ended, from the records every project on
6
- * this machine shares, so one not open here still counts: the Stats page's
7
- * sums, and how one merged task went.
8
- */
9
- export declare class DevOutcomes {
10
- private readonly outcomes;
11
- /** What `splates server` judged of each conversation as its turns ended. */
12
- readonly adherence: Adherence;
13
- constructor({ fs, ps }: {
14
- fs: Fs;
15
- ps: Ps;
16
- });
17
- /** `?period=` names the period, as `PERIODS` does, or `all` for all time; 7 days for none. */
18
- readonly stats: Handler;
19
- /** How `/api/tasks/:task/outcome`'s task went once it merged in `project`; null when it never did. */
20
- landed(project: string): Handler;
21
- }
package/dev-pages.d.ts DELETED
@@ -1,16 +0,0 @@
1
- import type { Assets } from "./dev/assets.js";
2
- /**
3
- * The page the server hands to browsers: the files built as this run
4
- * started. It changes only with a restart, which builds it again before the
5
- * server comes back, so the page always matches the server it talks to.
6
- */
7
- export declare class Pages {
8
- readonly assets: Assets;
9
- /** The shell, naming the script and styles by what they hold. */
10
- readonly page: string;
11
- constructor(assets: Assets);
12
- /** The server's routes for the page's own files, spread into its `routes`. */
13
- routes(): Record<string, (request: Request) => Response>;
14
- /** `body` as `type`, or a 304 for a request that holds this very build. */
15
- respond(request: Request, body: string | Uint8Array<ArrayBuffer>, type: string): Response;
16
- }
package/dev-picker.d.ts DELETED
@@ -1,57 +0,0 @@
1
- import type { Deps } from "webappwiz/cmd";
2
- import type { Fs } from "webappwiz/system";
3
- import type { SecretStores } from "./creds.js";
4
- import type { DevMachine } from "./dev-project.js";
5
- import type { Project } from "./projects.js";
6
- /**
7
- * What the page's project picker asks of `splates server` beyond listing: adding
8
- * a project, committing what `splates init` wrote there, and focusing one. Its
9
- * handlers are properties, so `dev` hands them to its routes as they are.
10
- */
11
- export declare class Picker {
12
- private readonly deps;
13
- constructor(deps: DevMachine);
14
- /**
15
- * Adds the repository the body's `path` names, as `splates init` there
16
- * would, and focuses it.
17
- */
18
- readonly add: (request: Request) => Promise<Response>;
19
- /** Commits the body's `paths`, which `splates init` wrote, once the person said to. */
20
- readonly commit: (request: Request) => Promise<Response>;
21
- /** Makes the body's `project` what an address naming none shows, on any device. */
22
- readonly focus: (request: Request) => Promise<Response>;
23
- }
24
- /**
25
- * What `splates init` writes in a project: the skill, its link for Claude
26
- * Code, and the lock `skills` keeps. Uncommitted, each is offered again,
27
- * even when an earlier init left it so.
28
- */
29
- export declare const INIT_WRITES: string[];
30
- /** A project the page added, and what `splates init` left in it to commit. */
31
- export interface Added {
32
- project: Project;
33
- /**
34
- * Each file init wrote that is not committed, as `git status` names it:
35
- * what the page asks to commit, and all it commits.
36
- */
37
- uncommitted: string[];
38
- /** The same, each under one of `INIT_WRITES` named by that, for the page to say. */
39
- shown: string[];
40
- /** The branch a commit of them lands on; null on a detached HEAD. */
41
- branch: string | null;
42
- }
43
- /**
44
- * Makes the repository `path` sits in a splates project, as `splates init` run
45
- * there would, `~` meaning the home directory: its records, made or brought
46
- * forward, the skill, and its place in the registry, focused. Commits
47
- * nothing, but says what init wrote, for the page to ask before it commits.
48
- */
49
- export declare function initProject(machine: Deps & {
50
- fs: Fs;
51
- secrets?: SecretStores;
52
- }, path: string): Promise<Added>;
53
- /**
54
- * Commits `paths` in the main tree at `root` as setting up splates, on
55
- * whatever it has checked out, leaving every other change as it was.
56
- */
57
- export declare function commitInit({ ps }: Deps, root: string, paths: string[]): Promise<void>;
@@ -1,26 +0,0 @@
1
- import type { Connection } from "./dev-sockets.js";
2
- /**
3
- * A page's WebSocket to a task's server, such as a dev server's hot reload,
4
- * carried on to that server: each message as it came, both ways, and a
5
- * close at either end closes the other. The server's end opens first, so the
6
- * page's upgrade can answer with the subprotocol the server chose.
7
- */
8
- export declare class PortSocket implements Connection {
9
- private readonly upstream;
10
- private socket;
11
- /** What the task's server said before the page's end opened. */
12
- private early;
13
- private constructor();
14
- /**
15
- * Opens a WebSocket to `url` with the page's `headers` and subprotocols,
16
- * or says why it could not.
17
- */
18
- static open(url: string, headers: Headers, protocols: string[]): Promise<PortSocket | {
19
- refused: string;
20
- }>;
21
- /** The subprotocol the task's server chose, for the page's upgrade to answer with. */
22
- get protocol(): string;
23
- open(socket: Bun.ServerWebSocket<Connection>): void;
24
- message(_socket: Bun.ServerWebSocket<Connection>, message: string | Buffer<ArrayBuffer>): void;
25
- closed(): void;
26
- }
package/dev-ports.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import { type PortProvider } from "webappwiz/system";
2
- /** Preferred, not required: `dev` moves up from here when it is taken. */
3
- export declare const DEFAULT_PORT = 4269;
4
- /** How far above the port asked for `dev` will look before giving up. */
5
- export declare const PORT_SPAN = 20;
6
- /**
7
- * Where `dev` will listen, given the port asked for. A flag is outside input,
8
- * so a port that cannot exist is a refusal with an exit code rather than the
9
- * assertion `OpenPortProvider` would raise for a bug in here.
10
- */
11
- export declare function devPorts(from: number): PortProvider;
@@ -1,44 +0,0 @@
1
- import { Duration } from "webappwiz/time";
2
- import { type StreamWatcher } from "./dev-http.js";
3
- import type { DevContext, Project } from "./dev-project.js";
4
- import { type Snapshot } from "./snapshot.js";
5
- /** How long changes to a repo's files settle before it is read again. */
6
- export declare const SETTLE: Duration;
7
- /**
8
- * What one project's pages hear of its repo: its records, read whole, and a
9
- * stream that says `changed` whenever what they show moved. The repo is
10
- * watched only while a page listens.
11
- */
12
- export declare class ProjectWatch implements StreamWatcher {
13
- private readonly project;
14
- private readonly context;
15
- /** The streams of the pages listening. */
16
- private readonly open;
17
- private last;
18
- private watches;
19
- private readonly trees;
20
- private poll;
21
- private readonly settle;
22
- private readonly edits;
23
- /** Watches `project`, read once now so the first change is told apart. */
24
- static start(project: Project, context: DevContext): Promise<ProjectWatch>;
25
- private constructor();
26
- /** The whole repo, as a page shows it. */
27
- read(): Promise<Snapshot>;
28
- tick(): Promise<void>;
29
- /** Reads the repo again soon, telling its pages if anything moved. */
30
- readonly changed: () => void;
31
- private readonly edited;
32
- /** The stream a page listens to for `changed`. */
33
- events(): Response;
34
- opened(): void;
35
- closed(): void;
36
- dispose(): void;
37
- private arm;
38
- private disarm;
39
- /**
40
- * Watches each worktree in `paths`, and no other: its SPLATES.md, and its
41
- * files as they are edited, which move its counts and its systems.
42
- */
43
- private follow;
44
- }
package/dev-project.d.ts DELETED
@@ -1,168 +0,0 @@
1
- import type { Deps } from "webappwiz/cmd";
2
- import type { Transcriber } from "webappwiz/dictate";
3
- import type { AsyncResource } from "webappwiz/disposable";
4
- import type { Logger } from "webappwiz/log";
5
- import type { Fs, Ps } from "webappwiz/system";
6
- import type { ConversationState, Conversations } from "./conversations.js";
7
- import type { SecretStores } from "./creds.js";
8
- import type { Assets } from "./dev/assets.js";
9
- import type { TranscriberFor } from "./dev-transcriber.js";
10
- import type { Everywhere } from "./everywhere.js";
11
- import type { Format } from "./format.js";
12
- import type { LaneRecord } from "./lanes.js";
13
- import { type Needing } from "./needs.js";
14
- import type { Projects } from "./projects.js";
15
- import type { Behind, Release } from "./release.js";
16
- import type { Repository } from "./repository.js";
17
- import type { Details } from "./show.js";
18
- import type { Slot } from "./slots.js";
19
- import type { PortOwners } from "./task-ports.js";
20
- /**
21
- * Everything one project's page talks to: its records, its stream of
22
- * changes and its conversations, kept from the first request for it until
23
- * the server stops.
24
- */
25
- export declare function serveProject(project: Project, context: DevContext): Promise<Served>;
26
- /** What `dev` serves a project with: its own records, read and written. */
27
- export type Project = Pick<Repository, "service" | "journal" | "todos" | "format" | "splatesDir" | "git" | "creds" | "slots"> & {
28
- fs: Fs;
29
- ps: Ps;
30
- log: Logger;
31
- };
32
- /**
33
- * What `dev` runs with: the machine's, not any project's, since it serves
34
- * every registered project wherever it was started.
35
- */
36
- export type DevMachine = Deps & {
37
- fs: Fs;
38
- /** Where each project's creds are kept; the system's stores by default. */
39
- secrets?: SecretStores;
40
- /** How setup's checks reach the network; the global fetch by default. */
41
- fetch?: typeof fetch;
42
- /** The built page. */
43
- assets: Assets;
44
- /** Every splates project on this machine. */
45
- projects: Projects;
46
- /**
47
- * Projects opened already, served as they are rather than opened again:
48
- * a test's own, with its fakes.
49
- */
50
- opened?: Project[];
51
- };
52
- /** What the server as a whole tells each project it serves. */
53
- export interface DevContext {
54
- /** Where the agents' own `splates` reaches this server, once it listens. */
55
- readonly url: string | null;
56
- /** A newer splates on npm, once a check has found one; every page says so. */
57
- readonly release: Release | null;
58
- /** Commits to splates's own source since this run started, once seen. */
59
- readonly behind: Behind | null;
60
- /** Whether building the page failed, so it serves the one built before. */
61
- readonly unbuilt: boolean;
62
- /** The slot `splates server --slot` serves under, or null. */
63
- readonly slot: Slot | null;
64
- /** The conversations `project`'s page may hold, or null when they are off. */
65
- conversationsFor(project: Project): Conversations | null;
66
- /** Every served project's conversations, where a caller of one may be. */
67
- readonly everywhere: Everywhere;
68
- /** What `project`'s dictations transcribe with. */
69
- readonly transcriberFor: TranscriberFor;
70
- }
71
- /** A route's work once its project is known. */
72
- export type Handler = (request: Request) => Promise<Response>;
73
- /** One project as the server holds it: what each of its routes does. */
74
- export interface Served extends AsyncResource {
75
- root: string;
76
- format: Format;
77
- conversations: Conversations | null;
78
- /** Reads the repo again soon, telling its pages if anything moved. */
79
- refresh: () => void;
80
- snapshot: Handler;
81
- /** How many of its agents wait on the person. */
82
- waiting: () => Promise<number>;
83
- /** What each of its agents needs, and the lanes that name an orchestrator. */
84
- needing: () => Promise<{
85
- rows: Needing[];
86
- lanes: LaneRecord[];
87
- }>;
88
- /** Every lane there has been, to name an orchestrator after. */
89
- lanes: () => Promise<LaneRecord[]>;
90
- /** Its tasks' worktrees and agents, whose processes' ports are the tasks'. */
91
- portOwners: () => Promise<PortOwners>;
92
- events: Handler;
93
- file: Handler;
94
- open: Handler;
95
- paths: Handler;
96
- systems: Handler;
97
- systemChanges: Handler;
98
- diff: Handler;
99
- retryTask: Handler;
100
- removeTask: Handler;
101
- addTodo: Handler;
102
- updateTodo: Handler;
103
- moveTodo: Handler;
104
- linkTodo: Handler;
105
- arrangeTodo: Handler;
106
- assignTodo: Handler;
107
- joinLane: Handler;
108
- addLane: Handler;
109
- updateLane: Handler;
110
- dropLane: Handler;
111
- removeTodo: Handler;
112
- restoreTodo: Handler;
113
- listCreds: Handler;
114
- saveCred: Handler;
115
- removeCred: Handler;
116
- dismissCred: Handler;
117
- listBudgets: Handler;
118
- setBudget: Handler;
119
- raiseBudget: Handler;
120
- endRaise: Handler;
121
- pauseBudget: Handler;
122
- resumeBudget: Handler;
123
- listConversations: Handler;
124
- refreshLimits: Handler;
125
- startConversation: Handler;
126
- listSessions: Handler;
127
- bringSession: Handler;
128
- /**
129
- * Asks every live conversation here to bring its SPLATES.md up to date,
130
- * answering with what settles as each answers.
131
- */
132
- checkpoint: (only?: string[]) => Promise<Promise<void>[]>;
133
- moveConversation: Handler;
134
- promptConversation: Handler;
135
- tellConversation: Handler;
136
- addArtifact: Handler;
137
- removeArtifact: Handler;
138
- deleteArtifactVersion: Handler;
139
- terminateConversation: Handler;
140
- conversationAttachment: Handler;
141
- conversationArtifact: Handler;
142
- answerConversation: Handler;
143
- cancelConversation: Handler;
144
- pauseConversation: Handler;
145
- stopBackground: Handler;
146
- backgroundOutput: Handler;
147
- unqueueConversation: Handler;
148
- sendQueuedNow: Handler;
149
- chooseSetting: Handler;
150
- renameConversation: Handler;
151
- markUnread: Handler;
152
- pinConversation: Handler;
153
- reparentConversation: Handler;
154
- archiveConversation: Handler;
155
- conversationEvents: Handler;
156
- terminalTree: (request: Request) => Promise<string>;
157
- /**
158
- * What a dictation transcribes with, read afresh for each take; null,
159
- * after asking for the key on the Creds page, without one.
160
- */
161
- transcriber: () => Promise<Transcriber | null>;
162
- }
163
- /**
164
- * How many agents wait on the person, as the page's own waiting line counts
165
- * them, but for an external agent whose reply the page copied: only the page
166
- * knows that.
167
- */
168
- export declare function waitingOn(tasks: Details[], conversations: ConversationState[]): number;
package/dev-push.d.ts DELETED
@@ -1,59 +0,0 @@
1
- import type { Logger } from "webappwiz/log";
2
- import { type Pusher, type VapidKeys } from "webappwiz/push";
3
- import type { Fs, Ps } from "webappwiz/system";
4
- import { Duration } from "webappwiz/time";
5
- import type { Handler, Served } from "./dev-project.js";
6
- import type { Projects } from "./projects.js";
7
- /** How often the server looks for something worth pushing, while a device listens. */
8
- export declare const PUSH_EVERY: Duration;
9
- /** What `Pushes` reads each served project through. */
10
- export interface PushesDeps {
11
- fs: Fs;
12
- ps: Ps;
13
- log: Logger;
14
- projects: Projects;
15
- /** By root, every project the server has opened. */
16
- served: Map<string, Promise<Served>>;
17
- /** What sends a push, signed with the keys kept; the Web Push services by default. */
18
- pusher?: (keys: VapidKeys) => Pusher;
19
- /** How often to look; `PUSH_EVERY` by default. */
20
- every?: Duration;
21
- }
22
- /**
23
- * Tells each device that subscribed, through its browser's push service,
24
- * what the page's own notifications would: an agent that came to wait,
25
- * finished its turn or went quiet, in any project the server has open. The
26
- * page cannot tell it itself once a phone freezes it, soon after the app
27
- * leaves the front. The keys it signs with and the devices it pushes to are
28
- * kept in one file for every project on the machine, so a restart keeps them.
29
- */
30
- export declare class Pushes {
31
- private readonly deps;
32
- private readonly file;
33
- private readonly keys;
34
- private devices;
35
- private readonly pusher;
36
- /** By device and project, what the last look saw. */
37
- private readonly notices;
38
- private readonly tick;
39
- private looking;
40
- static start(deps: PushesDeps): Promise<Pushes>;
41
- private constructor();
42
- /** The public key a page subscribes with. */
43
- readonly key: Handler;
44
- /** Keeps a device's subscription and what it wants, replacing what it said before. */
45
- readonly subscribe: Handler;
46
- /** Forgets the device whose subscription `endpoint` names. */
47
- readonly unsubscribe: Handler;
48
- /**
49
- * Compares every open project's rows with the last look, for each device,
50
- * and pushes each notice it wants. A look still going when the next is due
51
- * lets it pass.
52
- */
53
- look(): Promise<void>;
54
- dispose(): void;
55
- private lookOnce;
56
- private push;
57
- private forget;
58
- private keep;
59
- }