@stringsync/splates 0.0.45 → 0.0.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/README.md +121 -9
  2. package/artifact.d.ts +3 -30
  3. package/budget.d.ts +3 -0
  4. package/coordinator.d.ts +3 -0
  5. package/creds.d.ts +3 -123
  6. package/flags.d.ts +37 -0
  7. package/index.js +826 -26419
  8. package/lane.d.ts +3 -55
  9. package/main.d.ts +6 -0
  10. package/package.json +3 -42
  11. package/projects.d.ts +3 -136
  12. package/queue.d.ts +3 -0
  13. package/setup.d.ts +16 -98
  14. package/slots.d.ts +3 -135
  15. package/splates.d.ts +1 -19
  16. package/todo.d.ts +3 -146
  17. package/{splates-tunnel.d.ts → tunnel.d.ts} +1 -1
  18. package/{splates-worker.d.ts → worker.d.ts} +1 -1
  19. package/acp-extensions.d.ts +0 -82
  20. package/add.d.ts +0 -53
  21. package/adherence.d.ts +0 -49
  22. package/age.d.ts +0 -2
  23. package/agent-connection.d.ts +0 -171
  24. package/agent-errors.d.ts +0 -2
  25. package/agent-process.d.ts +0 -65
  26. package/agent-stream.d.ts +0 -91
  27. package/agents.d.ts +0 -15
  28. package/artifact-room.d.ts +0 -47
  29. package/artifact-viewers.d.ts +0 -6
  30. package/artifacts.d.ts +0 -161
  31. package/asked.d.ts +0 -146
  32. package/asked.js +0 -7
  33. package/assumed.d.ts +0 -34
  34. package/attach.d.ts +0 -30
  35. package/attachments.d.ts +0 -43
  36. package/baselines.d.ts +0 -55
  37. package/claim.d.ts +0 -17
  38. package/cloudflare-api.d.ts +0 -25
  39. package/cloudflare-error.d.ts +0 -5
  40. package/cloudflared-tunnel-provider.d.ts +0 -27
  41. package/codex-limits.d.ts +0 -19
  42. package/compaction.d.ts +0 -17
  43. package/config-source.d.ts +0 -13
  44. package/config.d.ts +0 -98
  45. package/config.js +0 -7
  46. package/conversation-archive.d.ts +0 -6
  47. package/conversation-background.d.ts +0 -21
  48. package/conversation-choice.d.ts +0 -4
  49. package/conversation-files.d.ts +0 -51
  50. package/conversation-given.d.ts +0 -8
  51. package/conversation-host.d.ts +0 -102
  52. package/conversation-listing.d.ts +0 -15
  53. package/conversation-log.d.ts +0 -301
  54. package/conversation-messages.d.ts +0 -18
  55. package/conversation-name.d.ts +0 -28
  56. package/conversation-options.d.ts +0 -73
  57. package/conversation-reference.d.ts +0 -2
  58. package/conversation-state.d.ts +0 -472
  59. package/conversation-turns.d.ts +0 -115
  60. package/conversation.d.ts +0 -209
  61. package/conversations.d.ts +0 -140
  62. package/coordinator-state.d.ts +0 -28
  63. package/darwin-temperature.d.ts +0 -7
  64. package/decided.d.ts +0 -18
  65. package/demo.d.ts +0 -29
  66. package/dev/api.d.ts +0 -209
  67. package/dev/assets.d.ts +0 -24
  68. package/dev/conversation-address.d.ts +0 -47
  69. package/dev/conversation-feed.d.ts +0 -166
  70. package/dev/live-stream.d.ts +0 -29
  71. package/dev/worker.d.ts +0 -33
  72. package/dev-access.d.ts +0 -61
  73. package/dev-artifacts.d.ts +0 -22
  74. package/dev-budgets.d.ts +0 -18
  75. package/dev-conversation-events.d.ts +0 -39
  76. package/dev-conversation-routes.d.ts +0 -90
  77. package/dev-creds.d.ts +0 -17
  78. package/dev-dictation-connection.d.ts +0 -18
  79. package/dev-dictation.d.ts +0 -17
  80. package/dev-http.d.ts +0 -76
  81. package/dev-open.d.ts +0 -15
  82. package/dev-options.d.ts +0 -133
  83. package/dev-outcomes.d.ts +0 -21
  84. package/dev-pages.d.ts +0 -16
  85. package/dev-picker.d.ts +0 -57
  86. package/dev-port-socket.d.ts +0 -26
  87. package/dev-ports.d.ts +0 -11
  88. package/dev-project-watch.d.ts +0 -44
  89. package/dev-project.d.ts +0 -168
  90. package/dev-push.d.ts +0 -59
  91. package/dev-restart.d.ts +0 -141
  92. package/dev-servers.d.ts +0 -30
  93. package/dev-setup-native.d.ts +0 -23
  94. package/dev-setup-opencode.d.ts +0 -29
  95. package/dev-setup.d.ts +0 -16
  96. package/dev-shell.d.ts +0 -70
  97. package/dev-slot.d.ts +0 -28
  98. package/dev-sockets.d.ts +0 -13
  99. package/dev-task-ports.d.ts +0 -73
  100. package/dev-tasks.d.ts +0 -20
  101. package/dev-terminal-connection.d.ts +0 -19
  102. package/dev-terminal.d.ts +0 -42
  103. package/dev-todos.d.ts +0 -35
  104. package/dev-transcriber.d.ts +0 -15
  105. package/dev-tunnel.d.ts +0 -38
  106. package/dev-versions.d.ts +0 -53
  107. package/dev-workers.d.ts +0 -55
  108. package/dev.d.ts +0 -24
  109. package/diff.d.ts +0 -29
  110. package/dispatched.d.ts +0 -16
  111. package/editors.d.ts +0 -22
  112. package/escalate.d.ts +0 -27
  113. package/events.d.ts +0 -311
  114. package/everywhere.d.ts +0 -41
  115. package/exhibit.d.ts +0 -21
  116. package/exit.d.ts +0 -54
  117. package/fact-todos.d.ts +0 -18
  118. package/fake-agent.d.ts +0 -107
  119. package/fake-agent.js +0 -284
  120. package/finding-facts.d.ts +0 -38
  121. package/findings.d.ts +0 -84
  122. package/fold.d.ts +0 -43
  123. package/follow.d.ts +0 -41
  124. package/format.d.ts +0 -68
  125. package/git.d.ts +0 -112
  126. package/handed-out.d.ts +0 -79
  127. package/handoff.d.ts +0 -23
  128. package/heavy-run.d.ts +0 -12
  129. package/heavy.d.ts +0 -28
  130. package/heavy.js +0 -16
  131. package/held.d.ts +0 -22
  132. package/index-0tfvy823.js +0 -272
  133. package/index-43pq33n4.js +0 -157
  134. package/index-4776671w.js +0 -698
  135. package/index-d4hjrzaq.js +0 -464
  136. package/index-gcfq7awr.js +0 -740
  137. package/index-k73tsw5g.js +0 -101
  138. package/index-kaa44k7q.js +0 -59
  139. package/index-vcv9m93e.js +0 -1265
  140. package/index-xmfmy729.js +0 -249
  141. package/init.d.ts +0 -28
  142. package/journal.d.ts +0 -57
  143. package/landed.d.ts +0 -14
  144. package/lane-todos.d.ts +0 -44
  145. package/lanes-from-tags.d.ts +0 -17
  146. package/lanes.d.ts +0 -96
  147. package/legacy-names.d.ts +0 -70
  148. package/legacy-ps.d.ts +0 -31
  149. package/limits.d.ts +0 -32
  150. package/list.d.ts +0 -18
  151. package/load-config.d.ts +0 -44
  152. package/log.d.ts +0 -14
  153. package/machine.d.ts +0 -42
  154. package/merge.d.ts +0 -35
  155. package/migrate-config.d.ts +0 -31
  156. package/models.d.ts +0 -24
  157. package/needs.d.ts +0 -115
  158. package/notices.d.ts +0 -39
  159. package/offered.d.ts +0 -39
  160. package/opencode-usage.d.ts +0 -37
  161. package/outcomes.d.ts +0 -114
  162. package/path.d.ts +0 -13
  163. package/plan.d.ts +0 -236
  164. package/port-forward.d.ts +0 -22
  165. package/port-pipe.d.ts +0 -36
  166. package/ports-list.d.ts +0 -19
  167. package/probe-runtime.d.ts +0 -5
  168. package/probe-runtime.js +0 -13
  169. package/project-reaches.d.ts +0 -23
  170. package/prompts.d.ts +0 -128
  171. package/pty.d.ts +0 -39
  172. package/pulse.d.ts +0 -8
  173. package/recommend.d.ts +0 -31
  174. package/release.d.ts +0 -41
  175. package/remote-process.d.ts +0 -26
  176. package/remote-pty.d.ts +0 -29
  177. package/remote-worker.d.ts +0 -77
  178. package/remove.d.ts +0 -31
  179. package/repository.d.ts +0 -91
  180. package/retry.d.ts +0 -34
  181. package/roster.d.ts +0 -63
  182. package/saved-ports-host.d.ts +0 -25
  183. package/saved-tunnel.d.ts +0 -44
  184. package/server-worker-socket.d.ts +0 -21
  185. package/setup-areas.d.ts +0 -7
  186. package/setup-opencode-model-error.d.ts +0 -3
  187. package/setup-opencode-models.d.ts +0 -54
  188. package/setup-opencode-recipe.d.ts +0 -26
  189. package/setup-opencode.d.ts +0 -46
  190. package/shared-browser.d.ts +0 -50
  191. package/shell.d.ts +0 -17
  192. package/show.d.ts +0 -106
  193. package/skill-checks.d.ts +0 -73
  194. package/skill-checks.js +0 -10
  195. package/skills.d.ts +0 -16
  196. package/slot-tunnel.d.ts +0 -27
  197. package/snapshot.d.ts +0 -75
  198. package/splates-artifact.d.ts +0 -3
  199. package/splates-creds.d.ts +0 -3
  200. package/splates-dev.d.ts +0 -22
  201. package/splates-flags.d.ts +0 -34
  202. package/splates-lane.d.ts +0 -3
  203. package/splates-projects.d.ts +0 -3
  204. package/splates-setup.d.ts +0 -17
  205. package/splates-slots.d.ts +0 -3
  206. package/splates-todo.d.ts +0 -3
  207. package/stats.d.ts +0 -186
  208. package/supervise.d.ts +0 -50
  209. package/system-changes.d.ts +0 -67
  210. package/system.d.ts +0 -28
  211. package/systems.d.ts +0 -119
  212. package/systems.js +0 -21
  213. package/table.d.ts +0 -5
  214. package/task-log.d.ts +0 -35
  215. package/task-ports.d.ts +0 -25
  216. package/tell.d.ts +0 -47
  217. package/todo-edit.d.ts +0 -60
  218. package/todo-file.d.ts +0 -6
  219. package/todo-lanes.d.ts +0 -82
  220. package/todo-list.d.ts +0 -26
  221. package/todo-take.d.ts +0 -27
  222. package/todos.d.ts +0 -157
  223. package/tool-calls.d.ts +0 -18
  224. package/tunnel-provider.d.ts +0 -37
  225. package/tunnel-provider.js +0 -0
  226. package/tunnel-remove.d.ts +0 -28
  227. package/tunnel-setup.d.ts +0 -104
  228. package/unix-worker-listener.d.ts +0 -23
  229. package/unix-worker-socket.d.ts +0 -30
  230. package/update.d.ts +0 -29
  231. package/update.js +0 -10
  232. package/vocabulary.d.ts +0 -9
  233. package/wait.d.ts +0 -36
  234. package/watch.d.ts +0 -46
  235. package/watched.d.ts +0 -43
  236. package/websocket-worker-socket.d.ts +0 -18
  237. package/worker-call-host.d.ts +0 -51
  238. package/worker-channel.d.ts +0 -83
  239. package/worker-connection.d.ts +0 -24
  240. package/worker-daemon.d.ts +0 -64
  241. package/worker-git.d.ts +0 -18
  242. package/worker-list.d.ts +0 -49
  243. package/worker-machine.d.ts +0 -34
  244. package/worker-port-host.d.ts +0 -21
  245. package/worker-process-host.d.ts +0 -29
  246. package/worker-protocol.d.ts +0 -104
  247. package/worker-pty-host.d.ts +0 -34
  248. package/worker-registry.d.ts +0 -68
  249. package/worker-replay.d.ts +0 -25
  250. package/worker-run.d.ts +0 -20
  251. package/worker-session.d.ts +0 -189
  252. package/worker-socket.d.ts +0 -15
  253. package/worktree-service.d.ts +0 -113
  254. package/worktree.d.ts +0 -232
@@ -1,47 +0,0 @@
1
- import type { ConversationState, Setting } from "../conversations.js";
2
- import type { Needing } from "../needs.js";
3
- import type { AgentChoice } from "./conversation-feed.js";
4
- /** What `#conversations/task/<name>` opens: a task whose agent runs outside the page. */
5
- export declare const TASK = "task/";
6
- /** What opens `row`: its conversation's id, or its external agent's task. */
7
- export declare function openedBy(row: Needing): string;
8
- /** What `#conversations/archived` opens: every archived conversation. */
9
- export declare const ARCHIVED = "archived";
10
- /**
11
- * In place of an id in the address: the screen that starts a conversation,
12
- * with the agent after it, as `new/codex`, else the agent last used, and
13
- * after that the task whose tree it starts in, as `new/codex/fix-upload`,
14
- * else the main tree.
15
- */
16
- export declare const NEW = "new";
17
- /**
18
- * The conversation a `#conversations/<id>` address names, `ARCHIVED` for the
19
- * archived ones, or null.
20
- */
21
- export declare function conversationIn(hash: string): string | null;
22
- /**
23
- * After a conversation's id in the address, as `<id>/terminal`: its terminal
24
- * on a page of its own, as one of the main tree's is.
25
- */
26
- export declare const TERMINAL = "/terminal";
27
- /** The address of `conversation`'s terminal on a page of its own. */
28
- export declare function terminalAddress(conversation: string): string;
29
- /**
30
- * The conversation whose terminal `open` shows on a page of its own, or null.
31
- * No id has a `/`, unlike the addresses of a task, a new conversation, or a
32
- * main-tree terminal.
33
- */
34
- export declare function terminalOf(open: string | null): string | null;
35
- /** Whether `open` is the screen that starts a conversation, with any agent. */
36
- export declare function startsOne(open: string | null): boolean;
37
- /**
38
- * The agent a new conversation starts with: the one `open` names, else the
39
- * newest conversation's the person picked, else the newest's, else the first.
40
- */
41
- export declare function agentFor(open: string | null, agents: AgentChoice[], conversations: ConversationState[]): string;
42
- /** The user's saved defaults, independent of live session settings. */
43
- export declare function settingsFor(agent: string, agents: AgentChoice[], _conversations: ConversationState[]): Setting[];
44
- /** The task a new conversation starts in, from `open`; null for the main tree. */
45
- export declare function taskFor(open: string | null): string | null;
46
- /** The model a new conversation starts on, `?model=` in `open`, or null. */
47
- export declare function modelFor(open: string | null): string | null;
@@ -1,166 +0,0 @@
1
- import type { Resource } from "webappwiz/disposable";
2
- import { type Eventful } from "webappwiz/events";
3
- import { type IdProvider } from "webappwiz/id";
4
- import { Duration, type Timer, type WallClock } from "webappwiz/time";
5
- import type { Attached, ConversationState, Image, Limit, Message, Setting } from "../conversations.js";
6
- /** How long a message goes unanswered before the page says it is still sending. */
7
- export declare const STILL_SENDING: Duration;
8
- export type ConversationFeedEvents = {
9
- changed: undefined;
10
- };
11
- /** A message on its way: its words, and its files read from the page's own copies. */
12
- export interface Sending {
13
- /**
14
- * The page's id for it, sent with it for the server to keep on its own
15
- * copy, which is how the page knows that copy when it comes back.
16
- */
17
- id: string;
18
- text: string;
19
- images: Image[];
20
- files: Attached[];
21
- /** Whether it waits for the running turn's end, as the server will record it. */
22
- queued: boolean;
23
- /** What the person wrote and attached, to send again or take back. */
24
- typed: string;
25
- attached: File[];
26
- /** Whether the person said it into the mic. */
27
- dictated: boolean;
28
- /** When it was sent, as epoch ms, to tell when it has gone unanswered for `STILL_SENDING`. */
29
- at: number;
30
- }
31
- /** A message the server refused, with why: shown until sent again or taken back. */
32
- export interface Unsent {
33
- message: Sending;
34
- why: string;
35
- }
36
- /**
37
- * The page's copy of every conversation, each replaced whole as the server
38
- * streams it. `available` stays false when the server holds no
39
- * conversations. The phone still keeps its Inbox as home.
40
- */
41
- export declare class ConversationFeed implements Eventful<ConversationFeedEvents>, Resource {
42
- readonly timer: Timer;
43
- readonly wall: WallClock;
44
- private readonly ids;
45
- private readonly dispatcher;
46
- readonly events: import("webappwiz/events").Events<ConversationFeedEvents>;
47
- /** Whether the first listing is still on its way. */
48
- loading: boolean;
49
- available: boolean;
50
- agents: AgentChoice[];
51
- /** Newest first, each with the messages on their way (see `send`) as said. */
52
- conversations: ConversationState[];
53
- /** Each conversation's messages on their way, by id, in the order sent. */
54
- readonly sending: Map<string, Sending[]>;
55
- /** Each conversation's refused messages, in the order refused, replaced whole as they change. */
56
- readonly unsent: Map<string, readonly Unsent[]>;
57
- /** As the server last said, without what is on its way. */
58
- private recorded;
59
- /**
60
- * How many changes `put` and `drop` have made, and the count at each
61
- * conversation's last, so a listing knows what moved while it was on its
62
- * way.
63
- */
64
- private changes;
65
- private readonly changedAt;
66
- private stream;
67
- /**
68
- * `timer` and `wall` are what the thread waits and reads the date by;
69
- * `ids` names each message on its way.
70
- */
71
- constructor(timer?: Timer, wall?: WallClock, ids?: IdProvider);
72
- start(): void;
73
- dispose(): void;
74
- /** Puts `state` in place of what the page had of it, or first when new. */
75
- put(state: ConversationState): void;
76
- /** Drops conversation `id`, deleted as an older archived one. */
77
- drop(id: string): void;
78
- /**
79
- * Shows `text` and `files` as said in conversation `id` before its server
80
- * records them, which waits on the way there and, while the agent starts
81
- * or resumes, until it is up, so the thread does not sit as it was
82
- * meanwhile. Said while a turn runs, or behind another on its way, it shows
83
- * as queued, as the server records it unless the agent takes it into the
84
- * turn, when its echo moves it into the thread. Each goes once the server
85
- * has recorded a message with its id, whatever else it records meanwhile,
86
- * or `refused` keeps it as unsent. The files show from the page's own, as the server
87
- * has yet to keep them. `typed` is the text as the person wrote it, before
88
- * the notes on its images were added.
89
- */
90
- send(id: string, text: string, files?: File[], typed?: string, dictated?: boolean): Sending;
91
- /**
92
- * Where a message said now to conversation `id` would go, as the server
93
- * last said it will take one. Every place a message is put asks here, so
94
- * what decides it stays in one spot.
95
- */
96
- private placed;
97
- /**
98
- * How many of conversation `id`'s queued messages are still on their way,
99
- * the last ones: the server has nothing of them to take back yet.
100
- */
101
- unrecorded(id: string): number;
102
- /**
103
- * Keeps `message`, which `send` showed in conversation `id`, as unsent at
104
- * the thread's foot, since the server refused it with `error`.
105
- */
106
- refused(id: string, message: Sending, error: unknown): void;
107
- /**
108
- * Settles `message`, which `send` showed in conversation `id`, by the
109
- * server's answer `state` to it: when that holds the message, the server
110
- * has it, so the page takes `state` in at once if the stream has yet to
111
- * bring it, and gives up any unsent copy of it.
112
- */
113
- answered(id: string, message: Sending, state: ConversationState): void;
114
- /** Stops showing `message`, unsent in conversation `id`, to send again or edit. */
115
- take(id: string, message: Sending): void;
116
- /**
117
- * When a message of conversation `id` next passes `STILL_SENDING`
118
- * unanswered, as epoch ms; null when none will.
119
- */
120
- nextSlow(id: string): number | null;
121
- /** Shows what is on its way afresh, as the clock now reads. */
122
- recheck(): void;
123
- /** Takes `message` off conversation `id`'s on their way; false when it was not. */
124
- private withdraw;
125
- private show;
126
- private load;
127
- /**
128
- * Reads every conversation afresh after the stream opens, `reconnect` when it
129
- * had before. Messages sent before it dropped that the listing still lacks are given up as unsent:
130
- * their requests may have died with the connection, and none would say so.
131
- */
132
- private reopened;
133
- /**
134
- * Has the server ask the agents that do not send their limits for them,
135
- * then reads the agents afresh, so the page shows what they said.
136
- */
137
- refreshLimits(): Promise<void>;
138
- /** Reads every conversation afresh; false when they are off. */
139
- private list;
140
- }
141
- /** An agent a conversation can be started with. */
142
- export interface AgentChoice {
143
- id: string;
144
- name: string;
145
- /** The models the roster lists for it, by the ids its Model setting takes. */
146
- models?: {
147
- id: string;
148
- name: string;
149
- }[];
150
- /**
151
- * What its sessions last offered, from any project, each where it was
152
- * left; none until it has had one on this machine.
153
- */
154
- settings: Setting[];
155
- /**
156
- * The plan's windows of use, as it last said in any project; none until
157
- * it has, and never from an agent that does not say.
158
- */
159
- limits: Limit[];
160
- }
161
- /** What to call agent `id`: its name, or its id once it is off the roster. */
162
- export declare function agentName(agents: AgentChoice[], id: string): string;
163
- /** `message` as the thread shows it, from the page's own copies of its files. */
164
- export declare function messageOf(message: Sending, now?: number): Message;
165
- /** The images an agent that takes images is sent as such, as the server keeps them. */
166
- export declare const SEEN: string[];
@@ -1,29 +0,0 @@
1
- import type { Resource } from "webappwiz/disposable";
2
- import { type Timer } from "webappwiz/time";
3
- /** What a stream's events go to, each named event by its name. */
4
- export interface StreamHandlers {
5
- message: (event: MessageEvent<string>) => void;
6
- /**
7
- * On each open, `again` once it has opened before, when what moved while
8
- * it was away was never said.
9
- */
10
- open?: (again: boolean) => void;
11
- error?: () => void;
12
- named?: Record<string, (event: MessageEvent<string>) => void>;
13
- }
14
- /**
15
- * An `EventSource` that opens again once it has heard nothing, not even the
16
- * server's pulse, for two pulses. Across a sleep a stream can sit open with
17
- * no error and no news, and the page would miss every change until a reload;
18
- * `open` runs again on each new one, to read afresh what moved meanwhile.
19
- */
20
- export declare class LiveStream implements Resource {
21
- private readonly url;
22
- private readonly handlers;
23
- private source;
24
- private opened;
25
- private readonly silence;
26
- constructor(url: string, handlers: StreamHandlers, timer?: Timer);
27
- dispose(): void;
28
- private open;
29
- }
package/dev/worker.d.ts DELETED
@@ -1,33 +0,0 @@
1
- /**
2
- * The page's service worker, which exists only to show notifications: a
3
- * phone's browser shows one only through a worker's registration, and hears
4
- * of one the server pushes while the page is frozen only through a worker.
5
- * It caches nothing, since the page is only of use live.
6
- *
7
- * Clicking a notification focuses a window on the row's project and tells it
8
- * which row to open, or, with none on that project, opens one at the row's
9
- * address.
10
- */
11
- /** What a notification carries for its click, as `Notifier.show` and a push set it. */
12
- export interface Opening {
13
- /** The row's key, which the page looks up among its rows. */
14
- key: string;
15
- /** The page's address with the row open, for when no window is. */
16
- url: string;
17
- }
18
- /** What the server pushes for a notice, as `Pushes` sends it. */
19
- export interface Pushed {
20
- title: string;
21
- body: string;
22
- /** The row's key, which tags its notification and opens it. */
23
- key: string;
24
- /** The row's address, from the page's own: its `?project=` and hash. */
25
- url: string;
26
- /** Whether to show it even while a window of the page is in front. */
27
- inFront: boolean;
28
- }
29
- /** The message a window gets when one of its notifications is clicked. */
30
- export interface Opened {
31
- type: "splates:open";
32
- key: string;
33
- }
package/dev-access.d.ts DELETED
@@ -1,61 +0,0 @@
1
- import { type WallClock } from "webappwiz/time";
2
- /**
3
- * The Cloudflare Access application in front of `splates server`: the team it
4
- * belongs to, as the issuer its tokens name, and its AUD tag. The one place
5
- * both live, so whatever exposes the page beyond this machine can ask whether
6
- * Access stands in front of it.
7
- */
8
- export interface AccessConfig {
9
- /** The team's own origin, `https://<team>.cloudflareaccess.com`. */
10
- issuer: string;
11
- /** The application's AUD tag, which each of its tokens names. */
12
- aud: string;
13
- }
14
- /**
15
- * The Access application `--access-team` and `--access-aud` name, or null
16
- * when neither is given. The team is its name, its domain or its URL alike.
17
- */
18
- export declare function accessConfig(team: string, aud: string): AccessConfig | null;
19
- /** Who a verified token says is asking. */
20
- export interface Identity {
21
- email: string | null;
22
- sub: string;
23
- }
24
- /** A request's token, verified or refused with why. */
25
- export type Verified = {
26
- identity: Identity;
27
- refused?: undefined;
28
- } | {
29
- identity?: undefined;
30
- refused: string;
31
- };
32
- /** The header Access sets on each request it lets through to the origin. */
33
- export declare const ACCESS_HEADER = "cf-access-jwt-assertion";
34
- /** The cookie a browser carries it in, which an upgrade may have alone. */
35
- export declare const ACCESS_COOKIE = "CF_Authorization";
36
- /**
37
- * Checks the token Cloudflare Access hands each request against the team's
38
- * signing keys, so a request that merely claims to come through Access, as
39
- * any process on this machine could, gets nowhere.
40
- */
41
- export declare class Access {
42
- readonly config: AccessConfig;
43
- private keys;
44
- private fetching;
45
- private fetchedAt;
46
- private readonly fetch;
47
- private readonly clock;
48
- constructor(config: AccessConfig, opts?: AccessOptions);
49
- /** Where the team publishes the keys its tokens are signed with. */
50
- get certs(): string;
51
- /** Who `request` comes from, by the token in its header or its cookie. */
52
- verify(request: Request): Promise<Verified>;
53
- private check;
54
- private key;
55
- private refetch;
56
- }
57
- /** What an `Access` reaches the world through, swapped in tests. */
58
- export interface AccessOptions {
59
- fetch?: typeof fetch;
60
- clock?: WallClock;
61
- }
@@ -1,22 +0,0 @@
1
- import type { Conversation } from "./conversation.js";
2
- /**
3
- * The version of an artifact that `request` names, `/api/conversations/<id>/
4
- * artifacts/<name>/<version>`, from `conversation`: 404 `not_found` for a
5
- * name or version its record lacks, and 404 `gone` for one whose bytes were
6
- * deleted, so the page shows a placeholder for it.
7
- */
8
- export declare function artifactResponse(request: Request, conversation: Conversation): Promise<Response>;
9
- /**
10
- * Deletes the bytes of the version that `request` names, `/api/conversations/
11
- * <id>/artifacts/<name>/<version>`, from `conversation`, keeping its record
12
- * so the page shows a placeholder.
13
- */
14
- export declare function deleteVersion(request: Request, conversation: Conversation): Promise<Response>;
15
- /**
16
- * The agent's own `splates artifact add`: a form with the artifact's `name`, its
17
- * `mimeType`, and its bytes as `file`. The conversation's own store keeps it,
18
- * so the page hears of it as it would of any change.
19
- */
20
- export declare function addVersion(request: Request, conversation: Conversation): Promise<Response>;
21
- /** The agent's own `splates artifact remove`, `/api/conversations/<id>/artifacts/<name>`. */
22
- export declare function removeNamed(request: Request, conversation: Conversation): Promise<Response>;
package/dev-budgets.d.ts DELETED
@@ -1,18 +0,0 @@
1
- import type { Project } from "./dev-project.js";
2
- /**
3
- * The routes a project's Budget page reads and changes its scry budgets
4
- * through, each answering with the report `scry budgets` prints. Spread one
5
- * into a project's routes.
6
- */
7
- export declare class BudgetRoutes {
8
- #private;
9
- constructor(project: Project);
10
- readonly listBudgets: () => Promise<Response>;
11
- /** Sets a role's spend, or with none, gives it back to the configs. */
12
- readonly setBudget: (request: Request) => Promise<Response>;
13
- readonly raiseBudget: (request: Request) => Promise<Response>;
14
- /** Stops a role asking anything for a while, like `1d`. */
15
- readonly pauseBudget: (request: Request) => Promise<Response>;
16
- readonly resumeBudget: (request: Request) => Promise<Response>;
17
- readonly endRaise: (request: Request) => Promise<Response>;
18
- }
@@ -1,39 +0,0 @@
1
- import type { Resource } from "webappwiz/disposable";
2
- import type { Logger } from "webappwiz/log";
3
- import type { Fs } from "webappwiz/system";
4
- import { type Timer } from "webappwiz/time";
5
- import type { Conversations } from "./conversations.js";
6
- import type { Journal } from "./journal.js";
7
- /**
8
- * Hands each conversation the events its agent's splates commands logged: all
9
- * of them as the server opens the project, then each new one as the journal
10
- * takes it, so the page shows it in that conversation's thread at once. An
11
- * event no conversation ran, an external agent's or the page's own, goes
12
- * nowhere.
13
- */
14
- export declare class ConversationEvents implements Resource {
15
- #private;
16
- private readonly journal;
17
- private readonly conversations;
18
- private readonly log;
19
- private constructor();
20
- /**
21
- * Hands each conversation in `conversations` its events, then follows
22
- * `splatesDir`, where the journal writes, for more.
23
- */
24
- static follow({ journal, conversations, fs, splatesDir, log, timer, }: {
25
- journal: Journal;
26
- conversations: Conversations;
27
- fs: Fs;
28
- splatesDir: string;
29
- log: Logger;
30
- timer?: Timer;
31
- }): Promise<ConversationEvents>;
32
- /**
33
- * Hands out what the journal took since the last look, for when it may
34
- * have changed; settles once it has.
35
- */
36
- changed(): Promise<void>;
37
- dispose(): void;
38
- private take;
39
- }
@@ -1,90 +0,0 @@
1
- import { type Conversations } from "./conversations.js";
2
- import type { Project } from "./dev-project.js";
3
- import { Everywhere } from "./everywhere.js";
4
- /**
5
- * How a project's page talks to agents: starting, prompting and steering its
6
- * conversations, and hearing each change to them as it streams. Each handler
7
- * is a property, so `serveProject` spreads them into the project's routes;
8
- * what they work on stays private, out of the spread.
9
- */
10
- export declare class ConversationRoutes {
11
- #private;
12
- constructor(project: Project, conversations: Conversations | null, everywhere?: Everywhere | null);
13
- held(): Conversations;
14
- /**
15
- * Asks every conversation at work for a checkpoint, or only those `only`
16
- * names by id, without waiting on the agents, passing over the idle ones,
17
- * whose turn has ended already: one whose task is merging
18
- * gets to finish the merge first. While one is still asked, the
19
- * checkpoint under way stands, and nothing is asked again. Answers with
20
- * what settles as each asked answers.
21
- */
22
- readonly checkpoint: (only?: string[]) => Promise<Promise<void>[]>;
23
- /** Asks the agents that do not send their limits for them, now and then. */
24
- readonly refreshLimits: () => Promise<Response>;
25
- readonly listConversations: () => Promise<Response>;
26
- /** The tree a terminal opens in: `?task=`'s worktree, or the main tree. */
27
- readonly terminalTree: (request: Request) => Promise<string>;
28
- readonly startConversation: (request: Request) => Promise<Response>;
29
- /**
30
- * The sessions the agents hold in `?task=`'s tree that no conversation
31
- * does, such as ones started in their CLI, to bring in.
32
- */
33
- readonly listSessions: (request: Request) => Promise<Response>;
34
- /** Brings in a session an agent holds, as a conversation in `task`'s tree. */
35
- readonly bringSession: (request: Request) => Promise<Response>;
36
- readonly moveConversation: (request: Request) => Promise<Response>;
37
- readonly promptConversation: (request: Request) => Promise<Response>;
38
- readonly conversationAttachment: (request: Request) => Promise<Response>;
39
- readonly conversationArtifact: (request: Request) => Promise<Response>;
40
- readonly answerConversation: (request: Request) => Promise<Response>;
41
- readonly cancelConversation: (request: Request) => Promise<Response>;
42
- /**
43
- * Checkpoints a running agent for the person and leaves it stopped,
44
- * answering without waiting on the agent; one whose task is merging gets
45
- * to finish the merge first.
46
- */
47
- readonly pauseConversation: (request: Request) => Promise<Response>;
48
- /** What a background command prints, as it prints it, until it ends. */
49
- readonly backgroundOutput: (request: Request) => Promise<Response>;
50
- readonly stopBackground: (request: Request) => Promise<Response>;
51
- readonly unqueueConversation: (request: Request) => Promise<Response>;
52
- readonly sendQueuedNow: (request: Request) => Promise<Response>;
53
- readonly chooseSetting: (request: Request) => Promise<Response>;
54
- readonly renameConversation: (request: Request) => Promise<Response>;
55
- readonly markUnread: (request: Request) => Promise<Response>;
56
- readonly pinConversation: (request: Request) => Promise<Response>;
57
- readonly reparentConversation: (request: Request) => Promise<Response>;
58
- readonly archiveConversation: (request: Request) => Promise<Response>;
59
- /**
60
- * Says `text` in a conversation as the person would, for the conversation
61
- * that handed it its task, as `splates tell` does: the one way in to one
62
- * that answers to it, and how a lane's orchestrator wakes or stops one it
63
- * started. With `stop`, the running turn stops first.
64
- */
65
- readonly tellConversation: (request: Request) => Promise<Response>;
66
- readonly addArtifact: (request: Request) => Promise<Response>;
67
- readonly removeArtifact: (request: Request) => Promise<Response>;
68
- readonly deleteArtifactVersion: (request: Request) => Promise<Response>;
69
- /**
70
- * The person's way out of a handed-out agent: stops its turn and its
71
- * process, and tells the conversation that handed it out, which decides
72
- * what becomes of the task. Its next word from that one resumes it.
73
- */
74
- readonly terminateConversation: (request: Request) => Promise<Response>;
75
- readonly conversationEvents: () => Promise<Response>;
76
- disposeAsync(): Promise<void>;
77
- /** Where a conversation for `task` runs: its worktree, or the main tree. */
78
- /**
79
- * `task`'s name, worktree, the branch it was cut from, and the
80
- * conversation whose agent added it.
81
- */
82
- private treeFor;
83
- /**
84
- * Whether a task landing on `base` is a part of `task`, or a part of one
85
- * of its parts, following each base back while it is a task's branch.
86
- */
87
- private isPartOf;
88
- /** The conversation a `/api/conversations/<id>` path names. */
89
- private conversationAt;
90
- }
package/dev-creds.d.ts DELETED
@@ -1,17 +0,0 @@
1
- import type { Project } from "./dev-project.js";
2
- import type { ProjectWatch } from "./dev-project-watch.js";
3
- /**
4
- * How a project's Creds page fills, replaces and removes creds, and turns
5
- * requests down. A value only ever comes in: no route answers with one.
6
- * Each handler is a property, so `serveProject` spreads them into the
7
- * project's routes.
8
- */
9
- export declare class CredRoutes {
10
- #private;
11
- constructor(project: Project, watch: ProjectWatch);
12
- /** What each store keeps, by name, and what the stores are called. */
13
- readonly listCreds: () => Promise<Response>;
14
- readonly saveCred: (request: Request) => Promise<Response>;
15
- readonly removeCred: (request: Request) => Promise<Response>;
16
- readonly dismissCred: (request: Request) => Promise<Response>;
17
- }
@@ -1,18 +0,0 @@
1
- import { type Transcriber } from "webappwiz/dictate";
2
- import type { Connection } from "./dev-sockets.js";
3
- /**
4
- * One dictation's socket, relaying the page's audio to a transcription and
5
- * its text back. A socket that closes takes its transcription with it: the
6
- * text heard so far is already in the composer.
7
- */
8
- export declare class DictationConnection implements Connection {
9
- /** Null when the project has no key, which the Creds page now asks for. */
10
- private readonly transcriber;
11
- private relay;
12
- constructor(
13
- /** Null when the project has no key, which the Creds page now asks for. */
14
- transcriber: Promise<Transcriber | null>);
15
- open(socket: Bun.ServerWebSocket<Connection>): void;
16
- message(_socket: Bun.ServerWebSocket<Connection>, message: string | Buffer<ArrayBuffer>): void;
17
- closed(): void;
18
- }
@@ -1,17 +0,0 @@
1
- import { type HostGate } from "./dev-http.js";
2
- import type { Served } from "./dev-project.js";
3
- import type { Connection } from "./dev-sockets.js";
4
- /** How a dictation finds the project its request names. */
5
- export interface DictationProjects {
6
- projectFor(request: Request): Promise<Served>;
7
- }
8
- /**
9
- * The composer's dictations, each over a WebSocket: the page streams the
10
- * mic's audio up, and the text comes back as it is heard.
11
- */
12
- export declare class Dictations {
13
- private readonly gate;
14
- private readonly projects;
15
- constructor(gate: HostGate, projects: DictationProjects);
16
- readonly open: (request: Request, server: Bun.Server<Connection>) => Promise<Response | undefined>;
17
- }
package/dev-http.d.ts DELETED
@@ -1,76 +0,0 @@
1
- import type { Resource } from "webappwiz/disposable";
2
- import type { Logger } from "webappwiz/log";
3
- import type { Attachment } from "./attachments.js";
4
- import type { Access, Identity } from "./dev-access.js";
5
- import { type Reason } from "./exit.js";
6
- /**
7
- * Which requests `splates server` answers at all: those to a host it may be
8
- * reached by, and writes only from its own page. Given `access`, a host
9
- * `hosts` lets in answers only to a request Cloudflare Access verified, and
10
- * such a request may use conversations and terminals too; without it,
11
- * those answer only to this machine's own names, so a tunnel still reaches
12
- * no further than the todos.
13
- */
14
- export declare class HostGate {
15
- private readonly log;
16
- readonly access: Access | null;
17
- private readonly allowed;
18
- constructor(hosts: string[], log: Logger, access?: Access | null);
19
- readonly guarded: <Answered extends Response | undefined>(handle: (request: Request) => Promise<Answered>) => (request: Request) => Promise<Answered | Response>;
20
- /**
21
- * Who Cloudflare Access says `request` comes from, or null when it comes
22
- * to this machine's own names or no Access stands in front.
23
- */
24
- readonly identity: (request: Request) => Promise<Identity | null>;
25
- readonly local: <Answered extends Response | undefined>(handle: (request: Request) => Promise<Answered>) => (request: Request) => Promise<Answered | Response>;
26
- }
27
- /** The one address the server binds: this machine, and nothing else. */
28
- export declare const LOOPBACK = "127.0.0.1";
29
- /** Names this machine answers to, which a page opened on it always may use. */
30
- export declare const LOCAL_HOSTS: string[];
31
- /** A phone photo or a short screen recording fits; a long video does not. */
32
- export declare const MAX_BODY_BYTES: number;
33
- /**
34
- * The images and recordings a todo or a task may hold, by extension, and how
35
- * each is served; `dev/media.tsx` shows the same ones inline.
36
- */
37
- export declare const MEDIA_TYPES: Record<string, string>;
38
- /** How a refusal from the core reads over HTTP. */
39
- export declare const STATUS: Partial<Record<Reason, number>>;
40
- /** An open server-sent event stream, as the server writes to it. */
41
- export type EventSink = ReadableStreamDefaultController<Uint8Array>;
42
- /** What a stream's owner does as pages join and leave it. */
43
- export interface StreamWatcher {
44
- /** Called once a page's stream has joined the set. */
45
- opened(): void;
46
- /** Called once a page's stream has left the set. */
47
- closed(): void;
48
- }
49
- /**
50
- * A server-sent event stream, in `listeners` while its page holds it open,
51
- * pulsing so the page can tell it went quiet, and telling `watcher` as it
52
- * joins and leaves.
53
- */
54
- export declare function eventStream(listeners: Set<EventSink>, watcher?: StreamWatcher): Response;
55
- /** The JSON a write sends, as an object. */
56
- export declare function body(request: Request): Promise<Record<string, unknown>>;
57
- /** The files a form carries under `file`, as bytes, each with its type. */
58
- export declare function uploads(form: FormData): Promise<(Attachment & {
59
- mimeType: string;
60
- })[]>;
61
- /**
62
- * `bytes`, served as `type`, or to download when it is not an image or a
63
- * recording, in the part `request` asks for: Safari plays a video only from a
64
- * server that hands out its parts.
65
- */
66
- export declare function fileResponse(request: Request, bytes: Uint8Array, type: string | undefined, headers: Record<string, string>): Response;
67
- /** The host a Host header names, without its port. */
68
- export declare function hostname(host: string): string;
69
- /** `text` as JSON, or null when it is not. */
70
- export declare function json(text: string): unknown;
71
- export declare function refuse(status: number, reason: string, message: string): Response;
72
- /**
73
- * Says to `stream`'s page, every pulse, that it is still there, so a page
74
- * whose stream went quiet, as across a sleep, opens it again.
75
- */
76
- export declare function pulsing(stream: EventSink): Resource;
package/dev-open.d.ts DELETED
@@ -1,15 +0,0 @@
1
- /** A file to open, and the tree its editor window should hold. */
2
- export interface InTree {
3
- tree: string;
4
- file: string;
5
- }
6
- /**
7
- * Where `path` opens: inside the task worktree under `worktrees` it is in,
8
- * or, once that worktree is gone, at the same place in the main tree `root`,
9
- * or inside `root` itself. Null for a path in neither, which the page may not
10
- * open.
11
- */
12
- export declare function inTree(path: string, { root, worktrees }: {
13
- root: string;
14
- worktrees: string;
15
- }, exists: (path: string) => Promise<boolean>): Promise<InTree | null>;