@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/todos.d.ts DELETED
@@ -1,157 +0,0 @@
1
- import { type IdProvider } from "webappwiz/id";
2
- import { type Fs, type Lock } from "webappwiz/system";
3
- import { Attachments } from "./attachments.js";
4
- import { type LaneRecord } from "./lanes.js";
5
- import { Todo, type TodoNew, type TodoState } from "./todo.js";
6
- /** Every todo in the repo, one JSON file each under `.git/splates/todos`. */
7
- export declare class Todos {
8
- readonly dir: string;
9
- /**
10
- * Held while numbering a new todo, so two agents never share an id, and
11
- * while writing one, so a move renumbering the rest never loses to a
12
- * write of a position it just changed.
13
- */
14
- private readonly lock;
15
- private readonly fs;
16
- private readonly ids;
17
- private readonly laneFiles;
18
- constructor(dir: string,
19
- /**
20
- * Held while numbering a new todo, so two agents never share an id, and
21
- * while writing one, so a move renumbering the rest never loses to a
22
- * write of a position it just changed.
23
- */
24
- lock: Lock, opts?: TodosOptions);
25
- /** Where a todo's files live, beside its record. */
26
- attachments(id: number): Attachments;
27
- /** Whether `path` is a file some todo holds, and not a way out of here. */
28
- owns(path: string): boolean;
29
- add(subject: string, from: string | null, { text, files, position, blockedBy, lane, assignee, origin, }?: TodoNew): Promise<Todo>;
30
- /**
31
- * Top of the list first. A file that will not parse is skipped rather than
32
- * fatal, and positions are counted again from 1 as they are read, so a
33
- * gap or a tie left by a crash, or a todo saved before they had any (it
34
- * goes below those that do, oldest first), never shows.
35
- */
36
- all(): Promise<Todo[]>;
37
- find(id: number): Promise<Todo>;
38
- /** The todos `task` has taken; what a merge or remove settles. */
39
- takenBy(task: string): Promise<Todo[]>;
40
- /**
41
- * Puts a todo at `position`, 1 at the top, past the bottom meaning the
42
- * bottom, and numbers the rest around it. Refuses to put one above a todo
43
- * in its own lane that it comes after, or below one that comes after it.
44
- */
45
- move(id: number, position: number): Promise<Todo>;
46
- /**
47
- * Says `id` comes after the todos in `add`, and no longer after those in
48
- * `drop`: it is not to be started until they merge. Refuses a link that
49
- * would make a loop, naming the todos in it, and moves a todo down below
50
- * anything in its own lane it now comes after.
51
- */
52
- link(id: number, { add, drop }: {
53
- add?: number[];
54
- drop?: number[];
55
- }): Promise<Todo>;
56
- /**
57
- * Puts a todo in a lane, or in none for null. `"new"` starts a lane of its
58
- * own, called `name`, or after the todo without one. With `before`, it goes just above that todo; otherwise it goes
59
- * below the rest of the lane, or keeps its place when that is in none or
60
- * new. Refuses a place above a todo in the lane that it comes after, or
61
- * below one that comes after it.
62
- */
63
- arrange(id: number, lane: number | "new" | null, { before, name }?: {
64
- before?: number;
65
- name?: string;
66
- }): Promise<Todo>;
67
- /** Every lane, in board order. */
68
- lanes(): Promise<LaneRecord[]>;
69
- /** The name of every lane there has been, those on the board first. */
70
- laneNames(): Promise<LaneRecord[]>;
71
- /** Moves every todo in lane `from` to the bottom of lane `into`; `from` is gone. */
72
- joinLanes(from: number, into: number): Promise<void>;
73
- /** Starts an empty lane called `name`, after the others. */
74
- addLane(name: string): Promise<LaneRecord>;
75
- /** Calls lane `id` by another name. */
76
- renameLane(id: number, name: string): Promise<LaneRecord>;
77
- /** Puts lane `id` at `position` among the lanes, 1 the first column. */
78
- moveLane(id: number, position: number): Promise<LaneRecord[]>;
79
- /** Removes lane `id`, putting its todos back in none, untriaged. */
80
- dropLane(id: number): Promise<void>;
81
- /** @internal Removes each lane in `ids` that no todo is in any more. */
82
- endLanes(ids: number[]): Promise<void>;
83
- /** Moves todos saved while splates kept tags into lanes, one lane a tag. */
84
- moveTagsToLanes(): Promise<{
85
- lane: LaneRecord;
86
- todos: number[];
87
- }[]>;
88
- /**
89
- * @internal Rewrites one todo as it stands on disk now, under the lock, so
90
- * a change to its words or who has it never undoes a move made meanwhile.
91
- */
92
- revise(id: number, change: (state: TodoState) => TodoState): Promise<Todo>;
93
- /** @internal Writes one todo. Rename makes the swap atomic for readers. */
94
- save(state: TodoState): Promise<Todo>;
95
- /**
96
- * @internal Removes one, moving those below it up to close the gap. What
97
- * came after it no longer waits on it, so no todo is left naming one that
98
- * is gone.
99
- */
100
- delete(id: number): Promise<void>;
101
- /**
102
- * @internal Removes one as `delete` does, keeping it and its files under
103
- * `removed/` for `restore` to put back. Only the newest `REMOVED_KEPT` are
104
- * kept, the older going for good.
105
- */
106
- discard(state: TodoState): Promise<void>;
107
- /**
108
- * Puts a todo `discard` removed back under its id, where it stood in the
109
- * list, untaken: in its lane while that lane is still on the board, after
110
- * those it waited on that still are.
111
- */
112
- restore(id: number): Promise<Todo>;
113
- /** @internal Runs `run` holding the lock every write goes through. */
114
- locked<T>(run: () => Promise<T>): Promise<T>;
115
- /**
116
- * Settles the list after a link or a lane changed, moving each todo below
117
- * what it comes after in its lane, and gives back `id` as it ends up.
118
- * Call it under the lock.
119
- */
120
- private settled;
121
- /** Refuses `order` when a lane in it puts a todo above one it comes after. */
122
- private ordered;
123
- /** One todo as it stands on disk; call it under the lock. */
124
- private state;
125
- /**
126
- * Slots `state` in at `position` among the rest and saves whichever moved.
127
- * Call it under the lock.
128
- */
129
- private place;
130
- /**
131
- * @internal Every todo in list order, with the positions it has on disk. `tagged`
132
- * are read though they still have tags, to move them into lanes.
133
- */
134
- stored(tagged?: number[]): Promise<TodoState[]>;
135
- /** @internal Saves each todo in `order` whose position on disk is not its place there. */
136
- renumber(order: TodoState[]): Promise<void>;
137
- private get removedDir();
138
- private removedPath;
139
- /** The todos `discard` kept, the oldest removed first. */
140
- private removed;
141
- private path;
142
- private lastId;
143
- /**
144
- * One todo, or null when it will not parse. One saved with tags is
145
- * refused, unless it is one of `tagged`: dropping them unasked would lose
146
- * what they grouped.
147
- */
148
- private read;
149
- }
150
- /** How many removed todos `Todos.discard` keeps for `restore`. */
151
- export declare const REMOVED_KEPT = 50;
152
- /** What `Todos` is stored through; the real filesystem by default. */
153
- export interface TodosOptions {
154
- fs?: Fs;
155
- /** What names stored files apart; random ids by default. */
156
- ids?: IdProvider;
157
- }
package/tool-calls.d.ts DELETED
@@ -1,18 +0,0 @@
1
- import type * as acp from "@agentclientprotocol/sdk";
2
- import type { ConversationState, Tool } from "./conversation-state.js";
3
- /** How much of a tool call's output, and of each side of an edit, is kept. */
4
- export declare const TOOL_CHARS = 20000;
5
- /**
6
- * Takes what an update says of a tool call into it. Adapters say it in
7
- * different places: Claude sends a command's output whole as `rawOutput`
8
- * once it ends, Codex streams it in `_meta` and says how it exited there.
9
- */
10
- export declare function fill(tool: Tool, update: acp.ToolCall | acp.ToolCallUpdate, at: string | null): void;
11
- /** The tool call `id`, wherever in the conversation it was made. */
12
- export declare function toolIn(state: ConversationState, id: string): Tool | null;
13
- /** The subagent's tool call an update came from; null for the agent's own. */
14
- export declare function parentOf(update: {
15
- _meta?: {
16
- [key: string]: unknown;
17
- } | null;
18
- }): string | null;
@@ -1,37 +0,0 @@
1
- import type { AsyncResource } from "webappwiz/disposable";
2
- import type { Logger } from "webappwiz/log";
3
- /** What a provider is asked to publish. */
4
- export interface TunnelRoute {
5
- /** The public host name that must reach `url`. */
6
- host: string;
7
- /** The page on this machine, `http://localhost:<port>`. */
8
- url: string;
9
- /** Where the provider says what it is doing, such as where it is reachable. */
10
- log: Logger;
11
- }
12
- /**
13
- * TunnelProvider is the seam onto whatever puts the `splates server` page on a
14
- * public host name: `cloudflared` by default, or any tunnel a repo's
15
- * `splates.config.ts` names as `tunnel`:
16
- *
17
- * ```ts
18
- * export default { tunnel: new MyTunnel() } satisfies ConfigFile;
19
- * ```
20
- *
21
- * Whatever it is, `--tunnel` still refuses to run without Cloudflare Access in
22
- * front, which is what decides who may enter; a provider only carries traffic.
23
- */
24
- export interface TunnelProvider {
25
- /**
26
- * Throws unless whatever runs the tunnel is installed and signed in, with a
27
- * message saying what to do about it. Asked before `run`, which is skipped
28
- * when it throws: the page keeps serving on this machine.
29
- */
30
- ready(): Promise<void>;
31
- /**
32
- * Starts carrying `route.host` to `route.url`, and answers with the run,
33
- * which serves until it is disposed of. Disposing stops the tunnel and
34
- * returns once it is gone; disposing one that stopped on its own is silent.
35
- */
36
- run(route: TunnelRoute): AsyncResource;
37
- }
File without changes
@@ -1,28 +0,0 @@
1
- import { type Logger } from "webappwiz/log";
2
- import type { Fs } from "webappwiz/system";
3
- import type { Creds } from "./creds.js";
4
- import { type SavedTunnel } from "./saved-tunnel.js";
5
- /** What `splates tunnel remove` is asked to remove, and what it runs with. */
6
- export interface RemoveOptions {
7
- /** The tunnel `splates tunnel setup` saved for this machine. */
8
- saved: SavedTunnel;
9
- /** Each slot home's tunnel, in the pool's order, whether or not it has one. */
10
- slots: SavedTunnel[];
11
- /** Where the API token is read from, and the tunnels' tokens forgotten. */
12
- creds: Creds;
13
- /** The task asking, for the request to name; null outside any. */
14
- task: string | null;
15
- fs: Fs;
16
- log: Logger;
17
- fetch?: typeof fetch;
18
- }
19
- /**
20
- * Deletes what `splates tunnel setup` and `splates server --slot` made, by what they
21
- * saved: each tunnel and the DNS record routing to it, the Access application
22
- * in front of the machine's host and the one in front of every slot, and the
23
- * policy they share. Then forgets each saved file and the tunnel token kept
24
- * for it. What is already gone is passed over, and a file is forgotten only
25
- * once its tunnel is, so running it again after a failure finishes the job.
26
- * The Cloudflare API token is kept, for `splates tunnel setup` to use again.
27
- */
28
- export declare function tunnelRemove(opts: RemoveOptions): Promise<void>;
package/tunnel-setup.d.ts DELETED
@@ -1,104 +0,0 @@
1
- import { type Logger } from "webappwiz/log";
2
- import { z } from "zod";
3
- import { CloudflareApi } from "./cloudflare-api.js";
4
- import type { Creds } from "./creds.js";
5
- import { type SavedTunnel } from "./saved-tunnel.js";
6
- /** What `splates tunnel setup` is asked to make, and what it runs with. */
7
- export interface SetupOptions {
8
- /** The public host name, in a zone of the account. */
9
- host: string;
10
- /** Who Access lets in, comma separated. */
11
- email: string;
12
- /** What the tunnel, the Access application and its policy are called. */
13
- name: string;
14
- /**
15
- * The Zero Trust team to make, as in `<team>.cloudflareaccess.com`, when
16
- * the account has none yet; "" to use the one it has.
17
- */
18
- team: string;
19
- /** Where the API token is read from, or requested, and the tunnel's token saved. */
20
- creds: Creds;
21
- /** The task asking, for the request to name; null outside any. */
22
- task: string | null;
23
- /** Where what it made is saved for `splates server`. */
24
- saved: SavedTunnel;
25
- log: Logger;
26
- fetch?: typeof fetch;
27
- }
28
- /**
29
- * Makes everything that carries `host` to `splates server` behind Cloudflare
30
- * Access, through the API alone, with the API token the person pasted as
31
- * `API_TOKEN`: the Zero Trust organization when the account has none, a
32
- * tunnel and its token, the DNS record routing `host` to it, and an Access
33
- * application letting in only `email`. What already exists by name is
34
- * reused, and changed only where it differs, so running it again is safe,
35
- * like `splates init`. Saves what it made, so a bare `splates server` runs it.
36
- *
37
- * Without the API token, it requests one with instructions for making it,
38
- * and refuses with `requested`, to run again once it is saved.
39
- */
40
- export declare function tunnelSetup(opts: SetupOptions): Promise<void>;
41
- /**
42
- * The cred the Cloudflare API token is kept as, on the device, since the
43
- * account is the person's. Not `CLOUDFLARE_API_TOKEN`, which scry's Workers
44
- * AI token goes by in the same store.
45
- */
46
- export declare const API_TOKEN = "SPLATES_CLOUDFLARE_API_TOKEN";
47
- /** What the API token has to be allowed, as the dashboard names each. */
48
- export declare const TOKEN_PERMISSIONS: string[];
49
- /** Where an API token is made. */
50
- export declare const TOKENS_PAGE = "https://dash.cloudflare.com/profile/api-tokens";
51
- declare const Zone: z.ZodObject<{
52
- id: z.ZodString;
53
- name: z.ZodString;
54
- account: z.ZodObject<{
55
- id: z.ZodString;
56
- }, z.core.$strip>;
57
- }, z.core.$strip>;
58
- declare const Tunnel: z.ZodObject<{
59
- id: z.ZodString;
60
- name: z.ZodString;
61
- }, z.core.$strip>;
62
- export declare const App: z.ZodObject<{
63
- id: z.ZodString;
64
- domain: z.ZodOptional<z.ZodString>;
65
- aud: z.ZodString;
66
- policies: z.ZodDefault<z.ZodArray<z.ZodObject<{
67
- id: z.ZodString;
68
- }, z.core.$strip>>>;
69
- }, z.core.$strip>;
70
- /**
71
- * The Cloudflare account `splates tunnel` works in, through the API with the
72
- * token kept as `API_TOKEN`, reporting what it makes to `log`.
73
- */
74
- export declare class CloudflareTunnels {
75
- readonly api: CloudflareApi;
76
- private readonly log;
77
- private constructor();
78
- /**
79
- * Opens the account with the token kept as `API_TOKEN`. Without it,
80
- * requests it with instructions for making it, and refuses with
81
- * `requested`, to run again once it is saved.
82
- */
83
- static open(creds: Creds, host: string, task: string | null, log: Logger, fetch?: typeof globalThis.fetch): Promise<CloudflareTunnels>;
84
- /** The zone serving `host`: the longest of its suffixes the account has. */
85
- findZone(host: string): Promise<z.infer<typeof Zone>>;
86
- /**
87
- * The tunnel called `name`, made when there is none. Configured locally, so
88
- * `cloudflared` carries the host to whichever port `splates server` bound, which
89
- * its `--url` says, rather than to one the dashboard pins.
90
- */
91
- ensureTunnel(account: string, name: string): Promise<z.infer<typeof Tunnel>>;
92
- /**
93
- * The proxied CNAME routing `host` to the tunnel. One already pointing at
94
- * another tunnel is moved to this one; any other record for `host` is someone
95
- * else's, and refused rather than replaced.
96
- */
97
- ensureRoute(zone: string, host: string, tunnel: string): Promise<void>;
98
- /**
99
- * The self-hosted Access application in front of `host`, guarded by
100
- * `policy` alone, and its AUD tag, which Cloudflare assigns when it is made.
101
- */
102
- ensureApp(account: string, name: string, host: string, policy: string): Promise<string>;
103
- }
104
- export {};
@@ -1,23 +0,0 @@
1
- import type { AsyncResource } from "webappwiz/disposable";
2
- import { type Eventful } from "webappwiz/events";
3
- import type { Fs } from "webappwiz/system";
4
- import { UnixWorkerSocket } from "./unix-worker-socket.js";
5
- /** What a `UnixWorkerListener` hears: a worker dialed in. */
6
- export interface UnixWorkerListenerEvents extends Record<string, unknown> {
7
- socket: UnixWorkerSocket;
8
- }
9
- /**
10
- * Where the local worker dials its coordinator: a Unix socket only this
11
- * user may open. Listening takes the path over from a coordinator that died
12
- * without cleaning up, and refuses one still answering there.
13
- */
14
- export declare class UnixWorkerListener implements Eventful<UnixWorkerListenerEvents>, AsyncResource {
15
- readonly path: string;
16
- private readonly listener;
17
- private readonly fs;
18
- private readonly dispatcher;
19
- readonly events: import("webappwiz/events").Events<UnixWorkerListenerEvents>;
20
- private constructor();
21
- static listen(path: string, fs: Fs): Promise<UnixWorkerListener>;
22
- disposeAsync(): Promise<void>;
23
- }
@@ -1,30 +0,0 @@
1
- import type { WorkerSocket, WorkerSocketEvents } from "./worker-socket.js";
2
- /** Bun's socket, whose handlers hand each event to the `UnixWorkerSocket` it carries. */
3
- export type UnixSocket = Bun.Socket<UnixWorkerSocket>;
4
- /** The handlers `Bun.listen` and `Bun.connect` take, the same at both ends. */
5
- export declare const UNIX_HANDLERS: Bun.SocketHandler<UnixWorkerSocket>;
6
- /**
7
- * A `WorkerSocket` over a Unix socket, how the local worker speaks to the
8
- * coordinator on its machine. Dial one with `connect`; a `UnixWorkerListener`
9
- * hands over the other end.
10
- */
11
- export declare class UnixWorkerSocket implements WorkerSocket {
12
- private readonly dispatcher;
13
- readonly events: import("webappwiz/events").Events<WorkerSocketEvents>;
14
- private socket;
15
- private pending;
16
- /** What the kernel would not take yet, sent on the next drain. */
17
- private unsent;
18
- private open;
19
- /** Dials the coordinator listening at `path`. */
20
- static connect(path: string): Promise<UnixWorkerSocket>;
21
- /** Takes the Bun socket it speaks over, as a listener or `connect` hands it. */
22
- attach(socket: UnixSocket): void;
23
- send(frame: string | Uint8Array): void;
24
- dispose(): void;
25
- /** Bun's `data` handler calls this with each chunk it read. */
26
- received(chunk: Uint8Array): void;
27
- /** Sends what the kernel has room for now. */
28
- flush(): void;
29
- closed(): void;
30
- }
package/update.d.ts DELETED
@@ -1,29 +0,0 @@
1
- import { type Logger } from "webappwiz/log";
2
- import type { Fs, Ps } from "webappwiz/system";
3
- /**
4
- * Set in the environment of the splates `update` hands itself to, so that one
5
- * refreshes rather than looking for a newer one again: npm can name a version
6
- * a moment before `bunx` can fetch it.
7
- */
8
- export declare const UPDATING = "SPLATES_UPDATING";
9
- /**
10
- * Brings this repository up to the newest splates: when npm has a newer release
11
- * than the one running, runs `update` again on that one, which does the rest
12
- * itself; otherwise moves todos saved with tags into lanes, installs this
13
- * one's skill over whatever copy is there, through `bunx skills add` from
14
- * this release's tag, and moves what an older config holds to where this
15
- * one reads it. Offline, the running release is the newest there is to
16
- * have. `wiz update` names the release instead, as it pins every webappwiz
17
- * package to one. Answers with the exit code to end on.
18
- */
19
- export declare function update({ root, fs, ps, log, newest, release, }: {
20
- /** The repository's main tree. */
21
- root: string;
22
- fs: Fs;
23
- ps: Ps;
24
- log: Logger;
25
- /** The latest splates on npm, or null when it cannot say; unasked given `release`. */
26
- newest?: () => Promise<string | null>;
27
- /** The release whose skill to install, rather than the newest. */
28
- release?: string;
29
- }): Promise<number>;
package/update.js DELETED
@@ -1,10 +0,0 @@
1
- import {
2
- UPDATING2,
3
- update2
4
- } from "./index-vcv9m93e.js";
5
- import"./index-4776671w.js";
6
- import"./index-k73tsw5g.js";
7
- export {
8
- UPDATING2 as UPDATING,
9
- update2 as update
10
- };
package/vocabulary.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import type { System } from "./systems.js";
2
- /**
3
- * Every word a prompt to an agent in `project` may use that a speech model
4
- * would spell its own way: splates, the project's name, and each system's name
5
- * and aliases.
6
- */
7
- export declare function words(project: string, systems: Record<string, System>): string[];
8
- /** The prompt that gets the project's own words spelled its way. */
9
- export declare function vocabulary(project: string, systems: Record<string, System>): string;
package/wait.d.ts DELETED
@@ -1,36 +0,0 @@
1
- import { type Logger } from "webappwiz/log";
2
- import { Duration } from "webappwiz/time";
3
- import type { Todos } from "./todos.js";
4
- import type { WorktreeService } from "./worktree-service.js";
5
- /** How long `wait` gives a task before handing the wait back to its caller. */
6
- export declare const DEFAULT_TIMEOUT: Duration;
7
- /** When a wait begun now gives up after `timeout`, as an ISO time. */
8
- export declare function untilAfter(timeout: Duration): string;
9
- export interface WaitOptions {
10
- /** How long to wait before giving up. */
11
- timeout?: Duration;
12
- /** How long between reads of the record; the default suits a human's patience. */
13
- poll?: Duration;
14
- }
15
- /**
16
- * Blocks until a task stops moving: merged or removed (both leave the name
17
- * `removed`), escalated to a human, or broken. Waiting is for the agent whose
18
- * own work overlaps this one's and would rather rebase onto the result than
19
- * against it, which is why the timeout is short enough to come back and think
20
- * again rather than block a session for an afternoon.
21
- */
22
- export declare function wait({ service, log }: {
23
- service: WorktreeService;
24
- log: Logger;
25
- }, task: string, { timeout, poll }?: WaitOptions): Promise<void>;
26
- /**
27
- * Blocks until todo `id` leaves the list, which it does when the task that
28
- * took it merges (or it is removed): what an agent whose next todo comes
29
- * after it waits for, not knowing which task will take it. Ends early when
30
- * the task that has it is escalated, since that wait is on a person.
31
- */
32
- export declare function todoWait({ service, todos, log, }: {
33
- service: WorktreeService;
34
- todos: Todos;
35
- log: Logger;
36
- }, id: number, { timeout, poll }?: WaitOptions): Promise<void>;
package/watch.d.ts DELETED
@@ -1,46 +0,0 @@
1
- import type { Git } from "./git.js";
2
- import { Watched } from "./watched.js";
3
- /** The git `Watch` runs, on whichever machine the agent works: `Git` here, or a worker's. */
4
- export type WatchGit = Pick<Git, "root" | "run" | "interruptedOps">;
5
- /**
6
- * Something a command did to git that an agent should not have, judged by
7
- * what it did rather than what it said: one that stashes and pops again, or
8
- * commits and squashes, did nothing worth a flag.
9
- */
10
- export type Flag =
11
- /** Stashed `count` changes and left them there. */
12
- {
13
- type: "stashed";
14
- count: number;
15
- }
16
- /** Took commits off `branch` that its tree no longer holds. */
17
- | {
18
- type: "dropped";
19
- branch: string;
20
- }
21
- /** Checked out `now`, a branch or null for a detached HEAD, off `branch`. */
22
- | {
23
- type: "left";
24
- branch: string;
25
- now: string | null;
26
- }
27
- /** Pushed, updating these remote branches, in a command that says `push`. */
28
- | {
29
- type: "pushed";
30
- refs: string[];
31
- }
32
- /** Changed these files in the main tree, from a task's worktree. */
33
- | {
34
- type: "outside";
35
- paths: string[];
36
- };
37
- /**
38
- * Watches the commands agents run in one repository, `git.root` its main
39
- * tree, for what they did to git.
40
- */
41
- export declare class Watch {
42
- private readonly git;
43
- constructor(git: WatchGit);
44
- /** Starts watching a command run in `cwd`, looking at git as it stands. */
45
- command(cwd: string): Watched;
46
- }
package/watched.d.ts DELETED
@@ -1,43 +0,0 @@
1
- import type { Flag, WatchGit } from "./watch.js";
2
- /** A command being watched, from the look before it ran. */
3
- export declare class Watched {
4
- private readonly git;
5
- private readonly cwd;
6
- private readonly before;
7
- constructor(git: WatchGit, cwd: string, before: Promise<Look>);
8
- /** Starts watching a command run in `cwd`, looking at git as it stands. */
9
- static start(git: WatchGit, cwd: string): Watched;
10
- /** Settles once the look before the command is taken. */
11
- looked(): Promise<void>;
12
- /**
13
- * Looks at git again, now that `command` is over, and says what it did.
14
- * A push counts only in a command that says `push`.
15
- */
16
- done(command: string | null): Promise<Flag[]>;
17
- /**
18
- * Whether `branch` lost what it held at `tip`: merging that commit into
19
- * what the branch is now changes nothing in its commit or its tree, as it
20
- * would not after a squash or a rebase onto trunk.
21
- */
22
- private dropped;
23
- /** A rebase detaches HEAD until it is done, as `splates merge` leaves one. */
24
- private rebasing;
25
- /** The remote branches a push moved, as their reflogs say. */
26
- private pushed;
27
- }
28
- /** What git looked like around a command. */
29
- interface Look {
30
- /** The stash's entries, by commit. */
31
- stash: string[];
32
- /** The branch HEAD is on in the command's tree, null when detached. */
33
- branch: string | null;
34
- /** That branch's commit; null when detached or the tree is gone. */
35
- tip: string | null;
36
- /** Whether the tree is gone, as a merged task's is. */
37
- gone: boolean;
38
- /** Every remote branch but a symbolic one like `origin/HEAD`, with its commit. */
39
- remotes: Map<string, string>;
40
- /** The main tree's uncommitted paths; null for a command run in it. */
41
- dirty: Set<string> | null;
42
- }
43
- export {};
@@ -1,18 +0,0 @@
1
- import type { WorkerSocket, WorkerSocketEvents } from "./worker-socket.js";
2
- /**
3
- * A `WorkerSocket` over a WebSocket the worker dials, as a remote worker
4
- * reaches its coordinator's `/api/workers`: each frame is one message, text
5
- * or binary as the protocol has it.
6
- */
7
- export declare class WebSocketWorkerSocket implements WorkerSocket {
8
- private readonly socket;
9
- private readonly dispatcher;
10
- readonly events: import("webappwiz/events").Events<WorkerSocketEvents>;
11
- private open;
12
- private constructor();
13
- /** Dials `url`, settling once the socket is open. */
14
- static connect(url: string): Promise<WebSocketWorkerSocket>;
15
- send(frame: string | Uint8Array): void;
16
- dispose(): void;
17
- private closed;
18
- }
@@ -1,51 +0,0 @@
1
- import type { Resource } from "webappwiz/disposable";
2
- import { z } from "zod";
3
- import type { WorkerChannel } from "./worker-channel.js";
4
- import type { WorkerMachine } from "./worker-machine.js";
5
- /** A question a coordinator asks on a `calls` channel, answered by its id. */
6
- export declare const CallRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
7
- id: z.ZodNumber;
8
- method: z.ZodLiteral<"git">;
9
- cwd: z.ZodString;
10
- args: z.ZodArray<z.ZodString>;
11
- }, z.core.$strip>, z.ZodObject<{
12
- id: z.ZodNumber;
13
- method: z.ZodLiteral<"processes">;
14
- }, z.core.$strip>, z.ZodObject<{
15
- id: z.ZodNumber;
16
- method: z.ZodLiteral<"listening">;
17
- }, z.core.$strip>, z.ZodObject<{
18
- id: z.ZodNumber;
19
- method: z.ZodLiteral<"exists">;
20
- path: z.ZodString;
21
- }, z.core.$strip>, z.ZodObject<{
22
- id: z.ZodNumber;
23
- method: z.ZodLiteral<"read">;
24
- path: z.ZodString;
25
- from: z.ZodNumber;
26
- }, z.core.$strip>], "method">;
27
- export type CallRequest = z.infer<typeof CallRequest>;
28
- /** How a worker answers: `{ id, result }`, or `{ id, error }` saying what went wrong. */
29
- export declare const CallAnswer: z.ZodUnion<readonly [z.ZodObject<{
30
- id: z.ZodNumber;
31
- result: z.ZodUnknown;
32
- }, z.core.$strip>, z.ZodObject<{
33
- id: z.ZodNumber;
34
- error: z.ZodString;
35
- }, z.core.$strip>]>;
36
- /**
37
- * Answers a coordinator's calls on the machine a task runs on, each request
38
- * a message on a `calls` channel and each answer one back, in whatever order
39
- * they finish. A read's bytes go as base64.
40
- */
41
- export declare class WorkerCallHost implements Resource {
42
- private readonly channel;
43
- private readonly machine;
44
- private readonly unlisten;
45
- constructor(channel: WorkerChannel, machine: WorkerMachine);
46
- /** Stops answering, leaving the channel to whoever closes it. */
47
- dispose(): void;
48
- private answer;
49
- private call;
50
- private reply;
51
- }