@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-tasks.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Conversations } from "./conversations.js";
|
|
2
|
+
import type { Project } from "./dev-project.js";
|
|
3
|
+
import type { ProjectWatch } from "./dev-project-watch.js";
|
|
4
|
+
/**
|
|
5
|
+
* What a project's page reads of its tasks, and what it does to them. Each
|
|
6
|
+
* handler is a property, so `serveProject` spreads them into the project's
|
|
7
|
+
* routes; what they work on stays private, out of the spread.
|
|
8
|
+
*/
|
|
9
|
+
export declare class TaskRoutes {
|
|
10
|
+
#private;
|
|
11
|
+
constructor(project: Project, conversations: Conversations | null, watch: ProjectWatch);
|
|
12
|
+
readonly file: (request: Request) => Promise<Response>;
|
|
13
|
+
readonly open: (request: Request) => Promise<Response>;
|
|
14
|
+
readonly paths: (request: Request) => Promise<Response>;
|
|
15
|
+
readonly systems: (request: Request) => Promise<Response>;
|
|
16
|
+
readonly systemChanges: () => Promise<Response>;
|
|
17
|
+
readonly diff: (request: Request) => Promise<Response>;
|
|
18
|
+
readonly retryTask: (request: Request) => Promise<Response>;
|
|
19
|
+
readonly removeTask: (request: Request) => Promise<Response>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Shell } from "./dev-shell.js";
|
|
2
|
+
import type { Connection } from "./dev-sockets.js";
|
|
3
|
+
/**
|
|
4
|
+
* One terminal's socket, which shows a `Shell`: bytes both ways are the
|
|
5
|
+
* shell's own; text is for what is not, as JSON: a resize or a question
|
|
6
|
+
* from the page, the shell's exit code and the job in front, null at a
|
|
7
|
+
* prompt, from here.
|
|
8
|
+
*/
|
|
9
|
+
export declare class TerminalConnection implements Connection {
|
|
10
|
+
private readonly shell;
|
|
11
|
+
/** Whether the page comes back to a shell it had, which redraws for it. */
|
|
12
|
+
private readonly back;
|
|
13
|
+
constructor(shell: Shell,
|
|
14
|
+
/** Whether the page comes back to a shell it had, which redraws for it. */
|
|
15
|
+
back: boolean);
|
|
16
|
+
open(socket: Bun.ServerWebSocket<Connection>): void;
|
|
17
|
+
message(socket: Bun.ServerWebSocket<Connection>, message: string | Buffer<ArrayBuffer>): void;
|
|
18
|
+
closed(socket: Bun.ServerWebSocket<Connection>): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type Timer } from "webappwiz/time";
|
|
2
|
+
import { type HostGate } from "./dev-http.js";
|
|
3
|
+
import type { Served } from "./dev-project.js";
|
|
4
|
+
import { type KeptShell, type ShellHost } from "./dev-shell.js";
|
|
5
|
+
import type { Connection } from "./dev-sockets.js";
|
|
6
|
+
/** How a terminal finds the project its request names. */
|
|
7
|
+
export interface TerminalProjects {
|
|
8
|
+
projectFor(request: Request): Promise<Served>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The shells a page opens over `/api/terminal`, each in the main tree or a
|
|
12
|
+
* task's worktree. Open one with `?terminal=<key>` to come back to it by
|
|
13
|
+
* that key after a reload or a restart of `splates server`; `handOver` and
|
|
14
|
+
* `takeBack` carry keyed shells across the restart, and `disposeAsync`
|
|
15
|
+
* hangs up on them all.
|
|
16
|
+
*/
|
|
17
|
+
export declare class Terminals {
|
|
18
|
+
private readonly gate;
|
|
19
|
+
private readonly shell;
|
|
20
|
+
private readonly projects;
|
|
21
|
+
/** The worker the shells run on, whose process table says their jobs in front. */
|
|
22
|
+
private readonly worker;
|
|
23
|
+
private readonly shells;
|
|
24
|
+
private readonly timer;
|
|
25
|
+
constructor(gate: HostGate, shell: string[] | null, projects: TerminalProjects,
|
|
26
|
+
/** The worker the shells run on, whose process table says their jobs in front. */
|
|
27
|
+
worker: ShellHost, { timer }?: {
|
|
28
|
+
timer?: Timer;
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* Takes back the shells the last run let go of, each waiting for its page
|
|
32
|
+
* to come back; before the worker joins, whose hello says which it kept.
|
|
33
|
+
*/
|
|
34
|
+
takeBack(kept: KeptShell[]): void;
|
|
35
|
+
/**
|
|
36
|
+
* Lets go of every keyed shell for the next run to take back, and says
|
|
37
|
+
* which; the rest end with the server.
|
|
38
|
+
*/
|
|
39
|
+
handOver(): KeptShell[];
|
|
40
|
+
readonly open: (request: Request, server: Bun.Server<Connection>) => Promise<Response | undefined>;
|
|
41
|
+
disposeAsync(): Promise<void>;
|
|
42
|
+
}
|
package/dev-todos.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ConversationRoutes } from "./dev-conversation-routes.js";
|
|
2
|
+
import type { Project } from "./dev-project.js";
|
|
3
|
+
import type { ProjectWatch } from "./dev-project-watch.js";
|
|
4
|
+
/**
|
|
5
|
+
* How a project's page writes its todos and lanes, each write journaled and
|
|
6
|
+
* read back for the pages listening. Each handler is a property, so
|
|
7
|
+
* `serveProject` spreads them into the project's routes; what they work on
|
|
8
|
+
* stays private, out of the spread.
|
|
9
|
+
*/
|
|
10
|
+
export declare class TodoRoutes {
|
|
11
|
+
#private;
|
|
12
|
+
constructor(project: Project, conversations: ConversationRoutes, watch: ProjectWatch);
|
|
13
|
+
readonly addTodo: (request: Request) => Promise<Response>;
|
|
14
|
+
readonly updateTodo: (request: Request) => Promise<Response>;
|
|
15
|
+
readonly moveTodo: (request: Request) => Promise<Response>;
|
|
16
|
+
readonly linkTodo: (request: Request) => Promise<Response>;
|
|
17
|
+
readonly arrangeTodo: (request: Request) => Promise<Response>;
|
|
18
|
+
readonly joinLane: (request: Request) => Promise<Response>;
|
|
19
|
+
readonly addLane: (request: Request) => Promise<Response>;
|
|
20
|
+
readonly updateLane: (request: Request) => Promise<Response>;
|
|
21
|
+
readonly assignTodo: (request: Request) => Promise<Response>;
|
|
22
|
+
readonly dropLane: (request: Request) => Promise<Response>;
|
|
23
|
+
readonly removeTodo: (request: Request) => Promise<Response>;
|
|
24
|
+
/** Puts back a todo the page removed, under its id, where it stood. */
|
|
25
|
+
readonly restoreTodo: (request: Request) => Promise<Response>;
|
|
26
|
+
/** The todo a `/api/todos/<id>` path names, or `/api/todos/<id>/position`. */
|
|
27
|
+
private todoAt;
|
|
28
|
+
/** The id a `/api/todos/<id>` path names, or `/api/todos/<id>/restore`. */
|
|
29
|
+
private idAt;
|
|
30
|
+
/**
|
|
31
|
+
* The agent a body names, `{ agent, model }`, off the roster the page's
|
|
32
|
+
* conversations start from; null for `{ agent: null }`, for none.
|
|
33
|
+
*/
|
|
34
|
+
private assigneeIn;
|
|
35
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Transcriber } from "webappwiz/dictate";
|
|
2
|
+
import type { Project } from "./dev-project.js";
|
|
3
|
+
/** The cred a dictation transcribes with. */
|
|
4
|
+
export declare const OPENAI_KEY = "OPENAI_API_KEY";
|
|
5
|
+
/** What a dictation in a project transcribes with, null once it asked for a key. */
|
|
6
|
+
export type TranscriberFor = (project: Project,
|
|
7
|
+
/** Tells the project's pages that its records moved, as a new request does. */
|
|
8
|
+
tick: () => Promise<void>) => Promise<Transcriber | null>;
|
|
9
|
+
/**
|
|
10
|
+
* What a dictation in `project` transcribes with: OpenAI on the key the
|
|
11
|
+
* project's or the device's store keeps, told the project's own words so it
|
|
12
|
+
* spells them its way, read afresh for each take. Null, after asking for the
|
|
13
|
+
* key on the Creds page, when neither store keeps one.
|
|
14
|
+
*/
|
|
15
|
+
export declare const transcriberFor: TranscriberFor;
|
package/dev-tunnel.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { AsyncResource } from "webappwiz/disposable";
|
|
2
|
+
import type { Logger } from "webappwiz/log";
|
|
3
|
+
import type { Ps } from "webappwiz/system";
|
|
4
|
+
import { type AccessConfig } from "./dev-access.js";
|
|
5
|
+
import type { SavedTunnel } from "./saved-tunnel.js";
|
|
6
|
+
import type { TunnelProvider } from "./tunnel-provider.js";
|
|
7
|
+
/** The tunnel `splates server` runs to reach the page from elsewhere. */
|
|
8
|
+
export interface TunnelConfig {
|
|
9
|
+
/** The public hostname the tunnel carries to the page. */
|
|
10
|
+
host: string;
|
|
11
|
+
provider: TunnelProvider;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The tunnel `--tunnel` and `--tunnel-name` ask for, or null when no host is
|
|
15
|
+
* given, run by `custom`, the provider `splates.config.ts` names, or else by
|
|
16
|
+
* `cloudflared`. Refused without `access`, so a tunnel never exposes the page
|
|
17
|
+
* to anyone Cloudflare Access has not let in.
|
|
18
|
+
*/
|
|
19
|
+
export declare function tunnelConfig(host: string, name: string, access: AccessConfig | null, custom: TunnelProvider | null, ps: Ps): TunnelConfig | null;
|
|
20
|
+
/** `host`, lowercased, refused unless it is a host name. */
|
|
21
|
+
export declare function hostName(host: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* The tunnel `splates tunnel setup` saved, and the Access application in front
|
|
24
|
+
* of it, which a bare `splates server` runs; null when none was saved. One whose
|
|
25
|
+
* token the secret store cannot give is logged and left off, never fatal: the
|
|
26
|
+
* page still answers on this machine.
|
|
27
|
+
*/
|
|
28
|
+
export declare function savedTunnelConfig(saved: SavedTunnel, ps: Ps, log: Logger): Promise<{
|
|
29
|
+
access: AccessConfig;
|
|
30
|
+
tunnel: TunnelConfig;
|
|
31
|
+
} | null>;
|
|
32
|
+
/**
|
|
33
|
+
* Starts `tunnel` carrying its host to `url`, once the page listens. A provider
|
|
34
|
+
* that is not ready, or that cannot start, is logged and skipped, never fatal:
|
|
35
|
+
* the page still answers on this machine. The run is what to dispose of with
|
|
36
|
+
* the server, or null when there is none.
|
|
37
|
+
*/
|
|
38
|
+
export declare function startTunnel(tunnel: TunnelConfig, url: string, log: Logger): Promise<AsyncResource | null>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Resource } from "webappwiz/disposable";
|
|
2
|
+
import type { Logger } from "webappwiz/log";
|
|
3
|
+
import type { Duration } from "webappwiz/time";
|
|
4
|
+
import type { Served } from "./dev-project.js";
|
|
5
|
+
import { type Behind, type Release } from "./release.js";
|
|
6
|
+
/** What `Versions` takes from `dev`'s options. */
|
|
7
|
+
export interface VersionsOptions {
|
|
8
|
+
/** The version serving. */
|
|
9
|
+
running: string;
|
|
10
|
+
/** The latest splates on npm, or null when it cannot say. */
|
|
11
|
+
newest: () => Promise<string | null>;
|
|
12
|
+
checkEvery: Duration;
|
|
13
|
+
/** The last commit to splates's own source, or null outside a checkout. */
|
|
14
|
+
source: () => Promise<string | null>;
|
|
15
|
+
sourceEvery: Duration;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Whether this run of `splates server` is stale: a newer splates on npm, or, run
|
|
19
|
+
* from a checkout, commits to splates's own source since it started. Each
|
|
20
|
+
* project's pages are told as a check finds one.
|
|
21
|
+
*/
|
|
22
|
+
export declare class Versions {
|
|
23
|
+
private readonly served;
|
|
24
|
+
private readonly log;
|
|
25
|
+
/**
|
|
26
|
+
* The last commit to splates's own source as this run started, or null
|
|
27
|
+
* when it does not run from a checkout of it.
|
|
28
|
+
*/
|
|
29
|
+
private readonly started;
|
|
30
|
+
private readonly opts;
|
|
31
|
+
/** A newer splates on npm, once a check has found one; every page says so. */
|
|
32
|
+
private newer;
|
|
33
|
+
/** Commits to that source since, once a check has seen one. */
|
|
34
|
+
private ahead;
|
|
35
|
+
/**
|
|
36
|
+
* Versions for this run, reading splates's source now, so a later commit
|
|
37
|
+
* to it is what makes this run stale.
|
|
38
|
+
*/
|
|
39
|
+
static start(served: Map<string, Promise<Served>>, log: Logger, opts: VersionsOptions): Promise<Versions>;
|
|
40
|
+
private constructor();
|
|
41
|
+
get running(): string;
|
|
42
|
+
get release(): Release | null;
|
|
43
|
+
get behind(): Behind | null;
|
|
44
|
+
/**
|
|
45
|
+
* Checks for a newer splates, or, run from a checkout, for commits to its
|
|
46
|
+
* source, until disposed.
|
|
47
|
+
*/
|
|
48
|
+
check(): Resource;
|
|
49
|
+
private checkNpm;
|
|
50
|
+
private checkSource;
|
|
51
|
+
/** Tells each project's pages to read it again. */
|
|
52
|
+
private refresh;
|
|
53
|
+
}
|
package/dev-workers.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { AsyncResource } from "webappwiz/disposable";
|
|
2
|
+
import type { Logger } from "webappwiz/log";
|
|
3
|
+
import type { Fs } from "webappwiz/system";
|
|
4
|
+
import type { Connection } from "./dev-sockets.js";
|
|
5
|
+
import type { RemoteWorker } from "./remote-worker.js";
|
|
6
|
+
import { WorkerRegistry } from "./worker-registry.js";
|
|
7
|
+
/** What the worker the supervisor starts beside the server is known by. */
|
|
8
|
+
export declare const LOCAL_WORKER = "local";
|
|
9
|
+
/** What `DevWorkers` answers workers as. */
|
|
10
|
+
export interface DevWorkersOptions {
|
|
11
|
+
/**
|
|
12
|
+
* The session id every worker hears in its welcome: the same across
|
|
13
|
+
* restarts, so a worker keeps what it runs for the next run to take
|
|
14
|
+
* back; new by default, which ends what the worker held.
|
|
15
|
+
*/
|
|
16
|
+
session?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Where `splates server` takes its workers in, as their coordinator: the local
|
|
20
|
+
* worker through a Unix socket only this user may open, and others through
|
|
21
|
+
* `/api/workers`. Nothing places work on them yet; the registry keeps them
|
|
22
|
+
* for what comes next.
|
|
23
|
+
*/
|
|
24
|
+
export declare class DevWorkers implements AsyncResource {
|
|
25
|
+
private readonly log;
|
|
26
|
+
readonly registry: WorkerRegistry;
|
|
27
|
+
/** This machine's worker, which agents run on; work waits for it to join. */
|
|
28
|
+
readonly local: RemoteWorker;
|
|
29
|
+
private listener;
|
|
30
|
+
/** Whether a worker may join: not while what the last run let go of is being taken back. */
|
|
31
|
+
private ready;
|
|
32
|
+
constructor(log: Logger, { session }?: DevWorkersOptions);
|
|
33
|
+
/**
|
|
34
|
+
* Turns workers away until `serving`, while the conversations the last
|
|
35
|
+
* run let go of take their processes back, since a worker's hello
|
|
36
|
+
* settles which channels live on.
|
|
37
|
+
*/
|
|
38
|
+
takingBack(): void;
|
|
39
|
+
/** Lets workers join again. */
|
|
40
|
+
serving(): void;
|
|
41
|
+
/** Hangs up on every worker for a restart, keeping what each runs (see `WorkerRegistry.detach`). */
|
|
42
|
+
detach(): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Listens at `path`, logging rather than failing when it cannot, as when
|
|
45
|
+
* another `splates server` with the same home already does: the page works
|
|
46
|
+
* without workers.
|
|
47
|
+
*/
|
|
48
|
+
listen(path: string, fs: Fs): Promise<void>;
|
|
49
|
+
readonly open: (request: Request, server: Bun.Server<Connection>) => Response | undefined;
|
|
50
|
+
/** `GET /api/workers`: each worker and each refusal, as `splates worker list` shows them. */
|
|
51
|
+
readonly list: () => Promise<Response>;
|
|
52
|
+
/** A worker upgrades; anyone else is asking who has joined, and `guard` decides who may. */
|
|
53
|
+
readonly route: (request: Request, server: Bun.Server<Connection>, guard: (handle: (request: Request) => Promise<Response>) => (request: Request) => Promise<Response>) => Response | undefined | Promise<Response>;
|
|
54
|
+
disposeAsync(): Promise<void>;
|
|
55
|
+
}
|
package/dev.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type AsyncResource } from "webappwiz/disposable";
|
|
2
|
+
import type { DevOptions } from "./dev-options.js";
|
|
3
|
+
import { type DevMachine } from "./dev-project.js";
|
|
4
|
+
export type { DevOptions } from "./dev-options.js";
|
|
5
|
+
export { DEFAULT_PORT, devPorts, PORT_SPAN } from "./dev-ports.js";
|
|
6
|
+
/**
|
|
7
|
+
* Serves what `todo list`, `list` and `show` print as one page that refetches
|
|
8
|
+
* when the repo changes, where a person adds, edits, reorders and removes
|
|
9
|
+
* todos. Anything that moves a task (merge, claim) stays in the CLI, and
|
|
10
|
+
* removing one answers only to this machine's own names, so a page that
|
|
11
|
+
* should not have been reachable can at worst change a todo.
|
|
12
|
+
*
|
|
13
|
+
* Given `conversations`, the page also talks to agents, which run commands on
|
|
14
|
+
* this machine. Those routes answer only to this machine's own names, or,
|
|
15
|
+
* given `access`, to a host `hosts` lets in once Cloudflare Access verified
|
|
16
|
+
* who is asking; without it, a tunnel still reaches no further than the todos.
|
|
17
|
+
*/
|
|
18
|
+
export declare function dev(deps: DevMachine, { ports, hosts, access, tunnel, conversations: converse, shell, transcriber, newest, running, checkEvery, // how often to ask npm for a newer splates
|
|
19
|
+
source, sourceEvery, // how often to read a checkout's last commit
|
|
20
|
+
unbuilt, slot, servers, exit, sensors, heavy, workerSocket, workers: givenWorkers, worker, coordinator, portsHost, pusher, open, }?: DevOptions): Promise<DevServer>;
|
|
21
|
+
/** A running server, and the one thing a caller ever wants to do with it. */
|
|
22
|
+
export interface DevServer extends AsyncResource {
|
|
23
|
+
port: number;
|
|
24
|
+
}
|
package/diff.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** A line of a diff, as assistant-ui's `CodeDiff` draws one. */
|
|
2
|
+
export interface DiffLine {
|
|
3
|
+
kind: "context" | "added" | "removed";
|
|
4
|
+
text: string;
|
|
5
|
+
}
|
|
6
|
+
/** A run of changed lines and the context around them. */
|
|
7
|
+
export interface Hunk {
|
|
8
|
+
/** Where it is, as git heads it: `@@ -10,6 +10,8 @@`. */
|
|
9
|
+
range: string;
|
|
10
|
+
lines: DiffLine[];
|
|
11
|
+
}
|
|
12
|
+
/** One file's changes. */
|
|
13
|
+
export interface FileDiff {
|
|
14
|
+
path: string;
|
|
15
|
+
/** Where it was, for a file that moved; null otherwise. */
|
|
16
|
+
from: string | null;
|
|
17
|
+
status: "added" | "deleted" | "renamed" | "modified";
|
|
18
|
+
added: number;
|
|
19
|
+
removed: number;
|
|
20
|
+
/** Git says only that it differs, with no lines to show. */
|
|
21
|
+
binary: boolean;
|
|
22
|
+
/** Some of it is not committed yet. */
|
|
23
|
+
uncommitted: boolean;
|
|
24
|
+
hunks: Hunk[];
|
|
25
|
+
}
|
|
26
|
+
/** `git diff` output as files, hunks and lines. */
|
|
27
|
+
export declare function parseDiff(text: string): FileDiff[];
|
|
28
|
+
/** An edit as lines: what it took out, then what it put in. */
|
|
29
|
+
export declare function editLines(old: string | null, now: string): DiffLine[];
|
package/dispatched.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Logger } from "webappwiz/log";
|
|
2
|
+
import type { Conversations } from "./conversations.js";
|
|
3
|
+
import type { WorktreeService } from "./worktree-service.js";
|
|
4
|
+
/**
|
|
5
|
+
* Starts the agent of each task `splates add --agent` or `splates handoff` handed
|
|
6
|
+
* to one and that has none yet, in the task's tree, on the model asked for,
|
|
7
|
+
* told to claim it, or to take it over for a handoff. The
|
|
8
|
+
* conversation it starts goes on the record before the agent is told
|
|
9
|
+
* anything, so a task is started once however often this runs, as long as
|
|
10
|
+
* no two runs overlap. Answers once each is started, not told.
|
|
11
|
+
*/
|
|
12
|
+
export declare function startDispatched({ service, conversations, log, }: {
|
|
13
|
+
service: WorktreeService;
|
|
14
|
+
conversations: Conversations;
|
|
15
|
+
log: Logger;
|
|
16
|
+
}): Promise<void>;
|
package/editors.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The editors a file the page names opens in: the link the browser hands it,
|
|
3
|
+
* and the command `dev` runs on this machine to open the file inside the
|
|
4
|
+
* tree it belongs to, which a link cannot say.
|
|
5
|
+
*/
|
|
6
|
+
export interface Editor {
|
|
7
|
+
id: string;
|
|
8
|
+
/** What the Settings dialog calls it. */
|
|
9
|
+
label: string;
|
|
10
|
+
/** The scheme of its `<scheme>://file/<path>:<line>` links. */
|
|
11
|
+
scheme: string;
|
|
12
|
+
/**
|
|
13
|
+
* The command that opens `tree` as its window and `file` in it, at `line`
|
|
14
|
+
* when there is one; the window alone when `file` is the tree.
|
|
15
|
+
*/
|
|
16
|
+
argv(tree: string, file: string, line: number | null): string[];
|
|
17
|
+
}
|
|
18
|
+
export declare const ZED: Editor;
|
|
19
|
+
/** Every editor, in the order the Settings dialog offers them. */
|
|
20
|
+
export declare const EDITORS: readonly [Editor, Editor, Editor];
|
|
21
|
+
/** The editor `id` names, or null for one this splates does not know. */
|
|
22
|
+
export declare function editorOf(id: string): Editor | null;
|
package/escalate.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type Logger } from "webappwiz/log";
|
|
2
|
+
import type { Fs, Lock } from "webappwiz/system";
|
|
3
|
+
import type { Facts } from "./events.js";
|
|
4
|
+
import type { Git } from "./git.js";
|
|
5
|
+
import type { WorktreeService } from "./worktree-service.js";
|
|
6
|
+
export interface EscalateOptions {
|
|
7
|
+
/** Task to escalate. Defaults to the one `cwd` is a worktree for. */
|
|
8
|
+
task?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Ask a person to approve merging, rather than to answer questions, with
|
|
11
|
+
* the reason as what to look at. Refused until the task is ready to merge:
|
|
12
|
+
* every question under `## Blocked` and step under `## Next` checked.
|
|
13
|
+
*/
|
|
14
|
+
review?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The way out that is not "resolve the conflict badly to finish the task".
|
|
18
|
+
* When both sides restructured the same logic there is no correct merge, only
|
|
19
|
+
* a decision, and that belongs to a human.
|
|
20
|
+
*/
|
|
21
|
+
export declare function escalate({ service, git, lock, log, fs, }: {
|
|
22
|
+
service: WorktreeService;
|
|
23
|
+
git: Git;
|
|
24
|
+
lock: Lock;
|
|
25
|
+
log: Logger;
|
|
26
|
+
fs: Fs;
|
|
27
|
+
}, reason: string, cwd: string, { task, review }?: EscalateOptions): Promise<Facts["escalate"]>;
|