@stringsync/splates 0.0.0-stage → 0.0.45
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.
- package/LICENSE +21 -0
- package/README.md +308 -2
- package/acp-extensions.d.ts +82 -0
- package/add.d.ts +53 -0
- package/adherence.d.ts +49 -0
- package/age.d.ts +2 -0
- package/agent-connection.d.ts +171 -0
- package/agent-errors.d.ts +2 -0
- package/agent-process.d.ts +65 -0
- package/agent-stream.d.ts +91 -0
- package/agents.d.ts +15 -0
- package/artifact-room.d.ts +47 -0
- package/artifact-viewers.d.ts +6 -0
- package/artifact.d.ts +30 -0
- package/artifacts.d.ts +161 -0
- package/asked.d.ts +146 -0
- package/asked.js +7 -0
- package/assumed.d.ts +34 -0
- package/attach.d.ts +30 -0
- package/attachments.d.ts +43 -0
- package/baselines.d.ts +55 -0
- package/claim.d.ts +17 -0
- package/cloudflare-api.d.ts +25 -0
- package/cloudflare-error.d.ts +5 -0
- package/cloudflared-tunnel-provider.d.ts +27 -0
- package/codex-limits.d.ts +19 -0
- package/compaction.d.ts +17 -0
- package/config-source.d.ts +13 -0
- package/config.d.ts +98 -0
- package/config.js +7 -0
- package/conversation-archive.d.ts +6 -0
- package/conversation-background.d.ts +21 -0
- package/conversation-choice.d.ts +4 -0
- package/conversation-files.d.ts +51 -0
- package/conversation-given.d.ts +8 -0
- package/conversation-host.d.ts +102 -0
- package/conversation-listing.d.ts +15 -0
- package/conversation-log.d.ts +301 -0
- package/conversation-messages.d.ts +18 -0
- package/conversation-name.d.ts +28 -0
- package/conversation-options.d.ts +73 -0
- package/conversation-reference.d.ts +2 -0
- package/conversation-state.d.ts +472 -0
- package/conversation-turns.d.ts +115 -0
- package/conversation.d.ts +209 -0
- package/conversations.d.ts +140 -0
- package/coordinator-state.d.ts +28 -0
- package/creds.d.ts +123 -0
- package/darwin-temperature.d.ts +7 -0
- package/decided.d.ts +18 -0
- package/demo.d.ts +29 -0
- package/dev/api.d.ts +209 -0
- package/dev/assets.d.ts +24 -0
- package/dev/conversation-address.d.ts +47 -0
- package/dev/conversation-feed.d.ts +166 -0
- package/dev/live-stream.d.ts +29 -0
- package/dev/worker.d.ts +33 -0
- package/dev-access.d.ts +61 -0
- package/dev-artifacts.d.ts +22 -0
- package/dev-budgets.d.ts +18 -0
- package/dev-conversation-events.d.ts +39 -0
- package/dev-conversation-routes.d.ts +90 -0
- package/dev-creds.d.ts +17 -0
- package/dev-dictation-connection.d.ts +18 -0
- package/dev-dictation.d.ts +17 -0
- package/dev-http.d.ts +76 -0
- package/dev-open.d.ts +15 -0
- package/dev-options.d.ts +133 -0
- package/dev-outcomes.d.ts +21 -0
- package/dev-pages.d.ts +16 -0
- package/dev-picker.d.ts +57 -0
- package/dev-port-socket.d.ts +26 -0
- package/dev-ports.d.ts +11 -0
- package/dev-project-watch.d.ts +44 -0
- package/dev-project.d.ts +168 -0
- package/dev-push.d.ts +59 -0
- package/dev-restart.d.ts +141 -0
- package/dev-servers.d.ts +30 -0
- package/dev-setup-native.d.ts +23 -0
- package/dev-setup-opencode.d.ts +29 -0
- package/dev-setup.d.ts +16 -0
- package/dev-shell.d.ts +70 -0
- package/dev-slot.d.ts +28 -0
- package/dev-sockets.d.ts +13 -0
- package/dev-task-ports.d.ts +73 -0
- package/dev-tasks.d.ts +20 -0
- package/dev-terminal-connection.d.ts +19 -0
- package/dev-terminal.d.ts +42 -0
- package/dev-todos.d.ts +35 -0
- package/dev-transcriber.d.ts +15 -0
- package/dev-tunnel.d.ts +38 -0
- package/dev-versions.d.ts +53 -0
- package/dev-workers.d.ts +55 -0
- package/dev.d.ts +24 -0
- package/diff.d.ts +29 -0
- package/dispatched.d.ts +16 -0
- package/editors.d.ts +22 -0
- package/escalate.d.ts +27 -0
- package/events.d.ts +311 -0
- package/everywhere.d.ts +41 -0
- package/exhibit.d.ts +21 -0
- package/exit.d.ts +54 -0
- package/fact-todos.d.ts +18 -0
- package/fake-agent.d.ts +107 -0
- package/fake-agent.js +284 -0
- package/finding-facts.d.ts +38 -0
- package/findings.d.ts +84 -0
- package/fold.d.ts +43 -0
- package/follow.d.ts +41 -0
- package/format.d.ts +68 -0
- package/git.d.ts +112 -0
- package/handed-out.d.ts +79 -0
- package/handoff.d.ts +23 -0
- package/heavy-run.d.ts +12 -0
- package/heavy.d.ts +28 -0
- package/heavy.js +16 -0
- package/held.d.ts +22 -0
- package/index-0tfvy823.js +272 -0
- package/index-43pq33n4.js +157 -0
- package/index-4776671w.js +698 -0
- package/index-d4hjrzaq.js +464 -0
- package/index-gcfq7awr.js +740 -0
- package/index-k73tsw5g.js +101 -0
- package/index-kaa44k7q.js +59 -0
- package/index-vcv9m93e.js +1265 -0
- package/index-xmfmy729.js +249 -0
- package/index.d.ts +2 -0
- package/index.js +26928 -0
- package/init.d.ts +28 -0
- package/journal.d.ts +57 -0
- package/landed.d.ts +14 -0
- package/lane-todos.d.ts +44 -0
- package/lane.d.ts +55 -0
- package/lanes-from-tags.d.ts +17 -0
- package/lanes.d.ts +96 -0
- package/legacy-names.d.ts +70 -0
- package/legacy-ps.d.ts +31 -0
- package/limits.d.ts +32 -0
- package/list.d.ts +18 -0
- package/load-config.d.ts +44 -0
- package/log.d.ts +14 -0
- package/machine.d.ts +42 -0
- package/merge.d.ts +35 -0
- package/migrate-config.d.ts +31 -0
- package/models.d.ts +24 -0
- package/needs.d.ts +115 -0
- package/notices.d.ts +39 -0
- package/offered.d.ts +39 -0
- package/opencode-usage.d.ts +37 -0
- package/outcomes.d.ts +114 -0
- package/package.json +74 -5
- package/path.d.ts +13 -0
- package/plan.d.ts +236 -0
- package/port-forward.d.ts +22 -0
- package/port-pipe.d.ts +36 -0
- package/ports-list.d.ts +19 -0
- package/probe-runtime.d.ts +5 -0
- package/probe-runtime.js +13 -0
- package/project-reaches.d.ts +23 -0
- package/projects.d.ts +136 -0
- package/prompts.d.ts +128 -0
- package/pty.d.ts +39 -0
- package/pulse.d.ts +8 -0
- package/recommend.d.ts +31 -0
- package/release.d.ts +41 -0
- package/remote-process.d.ts +26 -0
- package/remote-pty.d.ts +29 -0
- package/remote-worker.d.ts +77 -0
- package/remove.d.ts +31 -0
- package/repository.d.ts +91 -0
- package/retry.d.ts +34 -0
- package/roster.d.ts +63 -0
- package/saved-ports-host.d.ts +25 -0
- package/saved-tunnel.d.ts +44 -0
- package/server-worker-socket.d.ts +21 -0
- package/setup-areas.d.ts +7 -0
- package/setup-opencode-model-error.d.ts +3 -0
- package/setup-opencode-models.d.ts +54 -0
- package/setup-opencode-recipe.d.ts +26 -0
- package/setup-opencode.d.ts +46 -0
- package/setup.d.ts +102 -0
- package/shared-browser.d.ts +50 -0
- package/shell.d.ts +17 -0
- package/show.d.ts +106 -0
- package/skill-checks.d.ts +73 -0
- package/skill-checks.js +10 -0
- package/skills.d.ts +16 -0
- package/slot-tunnel.d.ts +27 -0
- package/slots.d.ts +135 -0
- package/snapshot.d.ts +75 -0
- package/splates-artifact.d.ts +3 -0
- package/splates-creds.d.ts +3 -0
- package/splates-dev.d.ts +22 -0
- package/splates-flags.d.ts +34 -0
- package/splates-lane.d.ts +3 -0
- package/splates-projects.d.ts +3 -0
- package/splates-setup.d.ts +17 -0
- package/splates-slots.d.ts +3 -0
- package/splates-todo.d.ts +3 -0
- package/splates-tunnel.d.ts +3 -0
- package/splates-worker.d.ts +3 -0
- package/splates.d.ts +28 -0
- package/stats.d.ts +186 -0
- package/supervise.d.ts +50 -0
- package/system-changes.d.ts +67 -0
- package/system.d.ts +28 -0
- package/systems.d.ts +119 -0
- package/systems.js +21 -0
- package/table.d.ts +5 -0
- package/task-log.d.ts +35 -0
- package/task-ports.d.ts +25 -0
- package/tell.d.ts +47 -0
- package/todo-edit.d.ts +60 -0
- package/todo-file.d.ts +6 -0
- package/todo-lanes.d.ts +82 -0
- package/todo-list.d.ts +26 -0
- package/todo-take.d.ts +27 -0
- package/todo.d.ts +146 -0
- package/todos.d.ts +157 -0
- package/tool-calls.d.ts +18 -0
- package/tunnel-provider.d.ts +37 -0
- package/tunnel-provider.js +0 -0
- package/tunnel-remove.d.ts +28 -0
- package/tunnel-setup.d.ts +104 -0
- package/unix-worker-listener.d.ts +23 -0
- package/unix-worker-socket.d.ts +30 -0
- package/update.d.ts +29 -0
- package/update.js +10 -0
- package/vocabulary.d.ts +9 -0
- package/wait.d.ts +36 -0
- package/watch.d.ts +46 -0
- package/watched.d.ts +43 -0
- package/websocket-worker-socket.d.ts +18 -0
- package/worker-call-host.d.ts +51 -0
- package/worker-channel.d.ts +83 -0
- package/worker-connection.d.ts +24 -0
- package/worker-daemon.d.ts +64 -0
- package/worker-git.d.ts +18 -0
- package/worker-list.d.ts +49 -0
- package/worker-machine.d.ts +34 -0
- package/worker-port-host.d.ts +21 -0
- package/worker-process-host.d.ts +29 -0
- package/worker-protocol.d.ts +104 -0
- package/worker-pty-host.d.ts +34 -0
- package/worker-registry.d.ts +68 -0
- package/worker-replay.d.ts +25 -0
- package/worker-run.d.ts +20 -0
- package/worker-session.d.ts +189 -0
- package/worker-socket.d.ts +15 -0
- package/worktree-service.d.ts +113 -0
- package/worktree.d.ts +232 -0
package/dev/api.d.ts
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The page's writes: the same core functions as `splates todo add`, `update`
|
|
3
|
+
* and `remove`, and the lanes' own.
|
|
4
|
+
* A refusal comes back as the CLI's own reason and message, thrown so the
|
|
5
|
+
* caller can show it.
|
|
6
|
+
*/
|
|
7
|
+
import type { HeavyJobsReading } from "webappwiz/system";
|
|
8
|
+
import type { KeptCred, Scope } from "../creds.js";
|
|
9
|
+
import type { PortLink } from "../dev-task-ports.js";
|
|
10
|
+
import type { FileDiff } from "../diff.js";
|
|
11
|
+
import type { Landed } from "../landed.js";
|
|
12
|
+
import type { MachineReading } from "../machine.js";
|
|
13
|
+
import type { Wants } from "../notices.js";
|
|
14
|
+
import type { AgentPick } from "../roster.js";
|
|
15
|
+
import type { SetupProgress } from "../setup.js";
|
|
16
|
+
import type { PeriodId, Stats } from "../stats.js";
|
|
17
|
+
import type { SystemsReport } from "../system-changes.js";
|
|
18
|
+
import type { NamedSystem } from "../systems.js";
|
|
19
|
+
export declare class ApiError extends Error {
|
|
20
|
+
readonly reason: string;
|
|
21
|
+
constructor(reason: string, message: string);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* `path` for the project this page shows: the one `?project=` names, or none
|
|
25
|
+
* for the one `splates server` started in, unless `path` names one itself. Every
|
|
26
|
+
* request the page makes goes through here.
|
|
27
|
+
*/
|
|
28
|
+
export declare function scoped(path: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* POSTs to `path` for this project, or as `init` says, answering with the
|
|
31
|
+
* body, or throwing the refusal as an `ApiError`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function send(path: string, init: RequestInit): Promise<unknown>;
|
|
34
|
+
/** A todo's files: new ones to add, and the stored ones to keep. */
|
|
35
|
+
export interface FilesForm {
|
|
36
|
+
files: File[];
|
|
37
|
+
/** Paths of files already stored to keep; the rest are dropped. */
|
|
38
|
+
keep: string[];
|
|
39
|
+
}
|
|
40
|
+
/** What a todo says: a line, and whatever more there is to say. */
|
|
41
|
+
export interface TodoForm {
|
|
42
|
+
subject: string;
|
|
43
|
+
text: string;
|
|
44
|
+
/** Where it goes in the list, 1 at the top; absent leaves it be. */
|
|
45
|
+
position?: number;
|
|
46
|
+
}
|
|
47
|
+
/** Adds a todo at the bottom of `lane`, or of the untriaged ones for null. */
|
|
48
|
+
export declare function addTodo({ subject, text, position }: TodoForm, files: File[], lane?: number | null): Promise<void>;
|
|
49
|
+
export declare function updateTodo(id: number, { subject, text, position, files, keep }: FilesForm & TodoForm): Promise<void>;
|
|
50
|
+
/** Puts a todo at `position`, 1 at the top, moving the rest around it. */
|
|
51
|
+
export declare function moveTodo(id: number, position: number): Promise<void>;
|
|
52
|
+
/** `send` with `body` as JSON, by `method`. */
|
|
53
|
+
export declare function sendJson(path: string, method: string, body: unknown): Promise<unknown>;
|
|
54
|
+
/** Says `id` is blocked by exactly the todos in `blockedBy`, no more and no fewer. */
|
|
55
|
+
export declare function linkTodo(id: number, blockedBy: number[]): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Puts a todo in `lane` (`"new"` for one of its own, null for none), just
|
|
58
|
+
* above the todo `before`, or at the bottom of the lane without one.
|
|
59
|
+
*/
|
|
60
|
+
export declare function arrangeTodo(id: number, lane: number | "new" | null, before?: number,
|
|
61
|
+
/** What to call a new lane; named after the todo without one. */
|
|
62
|
+
name?: string): Promise<void>;
|
|
63
|
+
/** Has `assignee` work todo `id`, or nobody in particular for null. */
|
|
64
|
+
export declare function assignTodo(id: number, assignee: AgentPick | null): Promise<void>;
|
|
65
|
+
/** Moves lane `from`'s todos to the bottom of lane `into`. */
|
|
66
|
+
export declare function joinLanes(from: number, into: number): Promise<void>;
|
|
67
|
+
/** Starts an empty lane called `name`, after the others. */
|
|
68
|
+
export declare function addLane(name: string): Promise<void>;
|
|
69
|
+
/** Calls lane `id` by another name. */
|
|
70
|
+
export declare function renameLane(id: number, name: string): Promise<void>;
|
|
71
|
+
/** Puts lane `id` at `position` among the lanes, 1 the first column. */
|
|
72
|
+
export declare function moveLane(id: number, position: number): Promise<void>;
|
|
73
|
+
/** Removes lane `id`, putting its todos back with the untriaged ones. */
|
|
74
|
+
export declare function dropLane(id: number): Promise<void>;
|
|
75
|
+
/** Removes a todo, kept for `restoreTodo` to put back. */
|
|
76
|
+
export declare function removeTodo(id: number): Promise<void>;
|
|
77
|
+
/** Puts back a todo `removeTodo` removed, under its id, where it stood. */
|
|
78
|
+
export declare function restoreTodo(id: number): Promise<void>;
|
|
79
|
+
/** Where the page loads a file a todo holds. */
|
|
80
|
+
export declare function fileUrl(path: string): string;
|
|
81
|
+
/**
|
|
82
|
+
* The files and directories (ending in `/`) a task's tree holds, or the main
|
|
83
|
+
* tree's for none: what `@` offers.
|
|
84
|
+
*/
|
|
85
|
+
export declare function paths(task?: string): Promise<string[]>;
|
|
86
|
+
/** Every system `task`'s worktree names, or the main tree's for none. */
|
|
87
|
+
export declare function systems(task?: string): Promise<NamedSystem[]>;
|
|
88
|
+
/** What each system holds on trunk, and the commits that lately changed it. */
|
|
89
|
+
export declare function systemChanges(): Promise<SystemsReport>;
|
|
90
|
+
/** What `task` changed against its base, uncommitted edits included. */
|
|
91
|
+
export declare function taskDiff(task: string): Promise<FileDiff[]>;
|
|
92
|
+
/**
|
|
93
|
+
* How `task` went once it merged, beside its project's week before; null
|
|
94
|
+
* when it never merged here.
|
|
95
|
+
*/
|
|
96
|
+
export declare function taskOutcome(task: string): Promise<Landed | null>;
|
|
97
|
+
/**
|
|
98
|
+
* Gives `task`, escalated once it spent its merge attempts, another round of
|
|
99
|
+
* them, as `splates retry` does.
|
|
100
|
+
*/
|
|
101
|
+
export declare function retryTask(task: string): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* `splates remove` for `task`, past any lease, stopping each conversation in
|
|
104
|
+
* its tree and moving it to the main tree.
|
|
105
|
+
*/
|
|
106
|
+
export declare function removeTask(task: string): Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* How tasks ended across every project, summed for the Stats page over
|
|
109
|
+
* `period`.
|
|
110
|
+
*/
|
|
111
|
+
export declare function stats(period: PeriodId): Promise<Stats>;
|
|
112
|
+
/**
|
|
113
|
+
* The email Cloudflare Access signed this page's visitor in with, or null
|
|
114
|
+
* when the page is opened on this machine or Access is off.
|
|
115
|
+
*/
|
|
116
|
+
export declare function identity(): Promise<string | null>;
|
|
117
|
+
/**
|
|
118
|
+
* Each port a task serves now, with its link through the ports host, if one
|
|
119
|
+
* is saved, and on the machine `splates server` runs on.
|
|
120
|
+
*/
|
|
121
|
+
export declare function taskPorts(): Promise<PortLink[]>;
|
|
122
|
+
/** What the page shows of the machine: its reading, and its heavy jobs. */
|
|
123
|
+
export type MachineStatus = MachineReading & {
|
|
124
|
+
heavy: HeavyJobsReading;
|
|
125
|
+
};
|
|
126
|
+
/** How hard the machine `splates server` runs on is working right now. */
|
|
127
|
+
export declare function machine(): Promise<MachineStatus>;
|
|
128
|
+
/** This machine's setup: every step checked, by area, and the one to do next. */
|
|
129
|
+
export declare function setup(): Promise<SetupProgress>;
|
|
130
|
+
/** Skips setup step `step`, or asks for it again, answering the fresh progress. */
|
|
131
|
+
export declare function skipSetupStep(step: string, skipped: boolean): Promise<SetupProgress>;
|
|
132
|
+
/** Marks setup seen on this machine, so the page stops nudging towards it. */
|
|
133
|
+
export declare function seeSetup(): Promise<SetupProgress>;
|
|
134
|
+
/** The public key this device subscribes to the server's pushes with. */
|
|
135
|
+
export declare function pushKey(): Promise<string>;
|
|
136
|
+
/** Has the server push this device the notices `wants` asks for, at `subscription`. */
|
|
137
|
+
export declare function subscribePush(subscription: PushSubscriptionJSON, wants: Wants & {
|
|
138
|
+
inFront: boolean;
|
|
139
|
+
}): Promise<void>;
|
|
140
|
+
/** Has the server stop pushing to the subscription `endpoint` names. */
|
|
141
|
+
export declare function unsubscribePush(endpoint: string): Promise<void>;
|
|
142
|
+
/** What the project's store and the device's keep, by name, and what each store is called. */
|
|
143
|
+
export interface KeptCreds {
|
|
144
|
+
kept: KeptCred[];
|
|
145
|
+
labels: Record<Scope, string>;
|
|
146
|
+
}
|
|
147
|
+
/** The creds kept for this project and this device; never a value. */
|
|
148
|
+
export declare function keptCreds(): Promise<KeptCreds>;
|
|
149
|
+
/**
|
|
150
|
+
* Keeps `value` as `name`: in the scope its open request asked for, else in
|
|
151
|
+
* `scope`. The value goes to the store and never comes back.
|
|
152
|
+
*/
|
|
153
|
+
export declare function saveCred(name: string, value: string, scope?: Scope): Promise<void>;
|
|
154
|
+
export declare function removeCred(name: string, scope: Scope): Promise<void>;
|
|
155
|
+
/** Turns down the open request for `name`, so the agent waiting on it stops. */
|
|
156
|
+
export declare function dismissCred(name: string): Promise<void>;
|
|
157
|
+
/**
|
|
158
|
+
* Where a project's scry budgets stand, as `splates dev scry budgets --format json`
|
|
159
|
+
* prints it; splates only passes it on, so this mirrors the CLI's type.
|
|
160
|
+
*/
|
|
161
|
+
export interface Budgets {
|
|
162
|
+
/** Whether any config or change declares budgets. */
|
|
163
|
+
declared: boolean;
|
|
164
|
+
roles: RoleBudget[];
|
|
165
|
+
}
|
|
166
|
+
/** Where one model's budget stands. */
|
|
167
|
+
export interface RoleBudget {
|
|
168
|
+
role: "som" | "llm";
|
|
169
|
+
/** Like `5m/day`, `nothing` or `unlimited`; none when undeclared. */
|
|
170
|
+
spend: string | null;
|
|
171
|
+
/** The config or file that declared it. */
|
|
172
|
+
from: string | null;
|
|
173
|
+
/** Whether it was set here, over the configs. */
|
|
174
|
+
set: boolean;
|
|
175
|
+
standing: {
|
|
176
|
+
/** Like `today` or `the last 7d`. */
|
|
177
|
+
window: string;
|
|
178
|
+
tokens: number;
|
|
179
|
+
raised: number;
|
|
180
|
+
spent: number;
|
|
181
|
+
left: number;
|
|
182
|
+
}[];
|
|
183
|
+
raises: {
|
|
184
|
+
id: number;
|
|
185
|
+
tokens: number;
|
|
186
|
+
from: number;
|
|
187
|
+
until: number;
|
|
188
|
+
}[];
|
|
189
|
+
/** The pause stopping it asking anything; none when it asks as it may. */
|
|
190
|
+
paused: {
|
|
191
|
+
from: number;
|
|
192
|
+
until: number;
|
|
193
|
+
} | null;
|
|
194
|
+
}
|
|
195
|
+
export declare function budgets(): Promise<Budgets>;
|
|
196
|
+
/** Sets what `role` may spend here, like `5m/day`; null gives it back to the configs. */
|
|
197
|
+
export declare function setBudget(role: RoleBudget["role"], spend: string | null): Promise<Budgets>;
|
|
198
|
+
/** Adds `tokens`, like `2m`, to each of `role`'s limits `span`, like `1d`. */
|
|
199
|
+
export declare function raiseBudget(role: RoleBudget["role"], tokens: string, span: string): Promise<Budgets>;
|
|
200
|
+
/** Stops `role` asking anything for `span`, like `1d`. */
|
|
201
|
+
export declare function pauseBudget(role: RoleBudget["role"], span: string): Promise<Budgets>;
|
|
202
|
+
/** Lets a paused `role` ask again before its pause ends. */
|
|
203
|
+
export declare function resumeBudget(role: RoleBudget["role"]): Promise<Budgets>;
|
|
204
|
+
export declare function endRaise(id: number): Promise<Budgets>;
|
|
205
|
+
/**
|
|
206
|
+
* Opens `path` in `editor` on this machine, inside the tree it belongs to,
|
|
207
|
+
* at `line` when there is one.
|
|
208
|
+
*/
|
|
209
|
+
export declare function openFile(editor: string, path: string, line: number | null): Promise<void>;
|
package/dev/assets.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** The files the browser asks for, as the server hands them over. */
|
|
2
|
+
export interface Assets {
|
|
3
|
+
/** The page, which asks for the rest. */
|
|
4
|
+
shell: string;
|
|
5
|
+
/** The React app, bundled for the browser. */
|
|
6
|
+
script: string;
|
|
7
|
+
/** The React app's source map, which DevTools asks for while open. */
|
|
8
|
+
scriptMap: string;
|
|
9
|
+
/** The stylesheet, with Tailwind already compiled. */
|
|
10
|
+
styles: string;
|
|
11
|
+
/** The service worker, through which a phone shows notifications. */
|
|
12
|
+
worker: string;
|
|
13
|
+
/** The service worker's source map. */
|
|
14
|
+
workerMap: string;
|
|
15
|
+
/** The web app manifest, which makes the page installable as an app. */
|
|
16
|
+
manifest: string;
|
|
17
|
+
/** The app icon as PNG, at 192px and 512px square. */
|
|
18
|
+
icons: {
|
|
19
|
+
192: Uint8Array<ArrayBuffer>;
|
|
20
|
+
512: Uint8Array<ArrayBuffer>;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/** The page this package ships. Serve each field's contents as-is. */
|
|
24
|
+
export declare const assets: Assets;
|
|
@@ -0,0 +1,47 @@
|
|
|
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;
|
|
@@ -0,0 +1,166 @@
|
|
|
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[];
|
|
@@ -0,0 +1,29 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
}
|