@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/init.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type Logger } from "webappwiz/log";
|
|
2
|
+
import type { Fs, Ps } from "webappwiz/system";
|
|
3
|
+
import type { Git } from "./git.js";
|
|
4
|
+
import type { Projects } from "./projects.js";
|
|
5
|
+
/**
|
|
6
|
+
* Makes this repository a splates project: `repository` has set up its records
|
|
7
|
+
* by now, when it had none, so what is left is installing the skill that
|
|
8
|
+
* teaches its agents to work through splates, through `bunx skills add` from
|
|
9
|
+
* this release's tag, and joining the registry, which
|
|
10
|
+
* lets one `splates server` serve it beside every other. Run again, or in a
|
|
11
|
+
* project already under way, it changes nothing that is already so.
|
|
12
|
+
*/
|
|
13
|
+
export declare function init({ git, projects, fs, ps, log, }: {
|
|
14
|
+
git: Git;
|
|
15
|
+
projects: Projects;
|
|
16
|
+
fs: Fs;
|
|
17
|
+
ps: Ps;
|
|
18
|
+
log: Logger;
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Takes this repository off the registry, so `splates server` no longer offers it:
|
|
22
|
+
* its records stay, and `splates init` brings it back.
|
|
23
|
+
*/
|
|
24
|
+
export declare function forget({ git, projects, log, }: {
|
|
25
|
+
git: Git;
|
|
26
|
+
projects: Projects;
|
|
27
|
+
log: Logger;
|
|
28
|
+
}): Promise<void>;
|
package/journal.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type Fs, type Ps } from "webappwiz/system";
|
|
2
|
+
import { type Action, type Event, type Facts, type FactsOf } from "./events.js";
|
|
3
|
+
/** How long a log file is kept once it fills, so a live conversation can still show the events in it. */
|
|
4
|
+
export declare const LOG_KEPT_MS: number;
|
|
5
|
+
/** What a `Journal` is stored through; the real filesystem and process by default. */
|
|
6
|
+
export interface JournalOptions {
|
|
7
|
+
fs?: Fs;
|
|
8
|
+
ps?: Ps;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* What has been done in this repo, oldest first. Events outlive their tasks:
|
|
12
|
+
* `merge` and `remove` take the record with them, so this is the only thing
|
|
13
|
+
* that remembers a task existed at all.
|
|
14
|
+
*
|
|
15
|
+
* Each event is appended, never rewritten, so two agents writing at once both
|
|
16
|
+
* keep theirs. Once the file holds `capacity` events it is moved into the
|
|
17
|
+
* `log` directory beside it, under a name that sorts by when, and a fresh one
|
|
18
|
+
* starts; moved files go once they are `LOG_KEPT_MS` old.
|
|
19
|
+
*/
|
|
20
|
+
export declare class Journal {
|
|
21
|
+
private readonly path;
|
|
22
|
+
private readonly capacity;
|
|
23
|
+
private readonly fs;
|
|
24
|
+
private readonly ps;
|
|
25
|
+
private readonly archive;
|
|
26
|
+
constructor(path: string, capacity: number, opts?: JournalOptions);
|
|
27
|
+
record<A extends Action, T>(action: A, task: string | null, run: () => Promise<T>, ...[facts]: FactsOf<A, T>): Promise<T>;
|
|
28
|
+
/**
|
|
29
|
+
* Logs a wait as it begins, then `record`s how it ended with `began`
|
|
30
|
+
* naming that first event, so the page can count it down while it runs.
|
|
31
|
+
*/
|
|
32
|
+
waiting<A extends "wait" | "todo wait" | "creds wait", T>(action: A, task: string | null, facts: Omit<Facts[A], "began">, run: () => Promise<T>): Promise<T>;
|
|
33
|
+
tail(count: number): Promise<Event[]>;
|
|
34
|
+
/**
|
|
35
|
+
* The events in the log and in the file moved aside last: every event
|
|
36
|
+
* written since a reader last looked, so long as it looks before the log
|
|
37
|
+
* fills twice over.
|
|
38
|
+
*/
|
|
39
|
+
recent(): Promise<Event[]>;
|
|
40
|
+
private append;
|
|
41
|
+
/**
|
|
42
|
+
* Moves the full file aside. Two writers rotating at once is harmless: the
|
|
43
|
+
* second either finds nothing to move or moves the few events written since,
|
|
44
|
+
* under a name of its own.
|
|
45
|
+
*/
|
|
46
|
+
private rotate;
|
|
47
|
+
/** The moved files, oldest first. */
|
|
48
|
+
private archived;
|
|
49
|
+
/**
|
|
50
|
+
* The events in `path` that carry every fact their action records now:
|
|
51
|
+
* one that went through before its action recorded them is left out,
|
|
52
|
+
* since a reader trusts an event's facts as its type gives them.
|
|
53
|
+
*/
|
|
54
|
+
private read;
|
|
55
|
+
/** Every event in `path`, whatever facts it carries. */
|
|
56
|
+
private parsed;
|
|
57
|
+
}
|
package/landed.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Baseline } from "./baselines.js";
|
|
2
|
+
import type { Outcome } from "./outcomes.js";
|
|
3
|
+
/** How a merged task went, beside how its project's tasks went the week before. */
|
|
4
|
+
export interface Landed {
|
|
5
|
+
outcome: Outcome;
|
|
6
|
+
/** Its project's tasks over the week to its merge, itself among them; null for none. */
|
|
7
|
+
baseline: Baseline | null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The last merge of `task` in `project`, held against the week up to it, so
|
|
11
|
+
* the comparison reads the same however long after it is asked. Null when it
|
|
12
|
+
* never merged there.
|
|
13
|
+
*/
|
|
14
|
+
export declare function landed(outcomes: Outcome[], project: string, task: string): Landed | null;
|
package/lane-todos.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Fs } from "webappwiz/system";
|
|
2
|
+
import type { LaneRecord } from "./lanes.js";
|
|
3
|
+
import type { TodoState } from "./todo.js";
|
|
4
|
+
/** A todo in a lane, as a lane's orchestrator hears of it. */
|
|
5
|
+
export interface LaneTodo {
|
|
6
|
+
id: number;
|
|
7
|
+
/** Its lane, by number and name, the name kept for once the lane ends. */
|
|
8
|
+
lane: {
|
|
9
|
+
id: number;
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
/** Whether a task has taken it. */
|
|
13
|
+
taken: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** What became of a todo in a lane since it was last seen. */
|
|
16
|
+
export interface LaneTodoChange {
|
|
17
|
+
todo: number;
|
|
18
|
+
lane: {
|
|
19
|
+
id: number;
|
|
20
|
+
name: string;
|
|
21
|
+
};
|
|
22
|
+
/** `done` once it left the list, merged or removed; `open` once its task let it go. */
|
|
23
|
+
change: "done" | "open";
|
|
24
|
+
}
|
|
25
|
+
/** The todos in a lane, out of every todo and the lanes on the board. */
|
|
26
|
+
export declare function laneTodos(todos: TodoState[], lanes: LaneRecord[]): LaneTodo[];
|
|
27
|
+
/**
|
|
28
|
+
* What became of each todo in `before` by `now`: done for one gone from the
|
|
29
|
+
* list, open for one taken then and not now. One that moved lanes, or came
|
|
30
|
+
* into one, is neither.
|
|
31
|
+
*/
|
|
32
|
+
export declare function laneChanges(before: LaneTodo[], now: LaneTodo[], all: TodoState[]): LaneTodoChange[];
|
|
33
|
+
/**
|
|
34
|
+
* The lane todos as last seen, kept on disk, so what changed while `splates
|
|
35
|
+
* dev` was down is told once it is back.
|
|
36
|
+
*/
|
|
37
|
+
export declare class SeenLaneTodos {
|
|
38
|
+
private readonly fs;
|
|
39
|
+
private readonly path;
|
|
40
|
+
constructor(fs: Fs, path: string);
|
|
41
|
+
/** What was last seen, or null before anything was. */
|
|
42
|
+
read(): Promise<LaneTodo[] | null>;
|
|
43
|
+
write(seen: LaneTodo[]): Promise<void>;
|
|
44
|
+
}
|
package/lane.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type Logger } from "webappwiz/log";
|
|
2
|
+
import type { Facts } from "./events.js";
|
|
3
|
+
import type { Journal } from "./journal.js";
|
|
4
|
+
import { type LaneRecord } from "./lanes.js";
|
|
5
|
+
import type { Todos } from "./todos.js";
|
|
6
|
+
export interface LaneListOptions {
|
|
7
|
+
/** Print the lanes as JSON instead of a table. */
|
|
8
|
+
json?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** Every lane, with its todos in order, who is on it, and what blocks it. */
|
|
11
|
+
export declare function laneList({ todos, log }: {
|
|
12
|
+
todos: Todos;
|
|
13
|
+
log: Logger;
|
|
14
|
+
}, { json }?: LaneListOptions): Promise<void>;
|
|
15
|
+
export interface LaneShowOptions {
|
|
16
|
+
/** Print the lane as JSON instead of prose. */
|
|
17
|
+
json?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* One lane in full, step by step: what an agent handed `[SPLATES LANE N]`
|
|
21
|
+
* reads to know which todo is next, and whether it is blocked first. For
|
|
22
|
+
* null, the untriaged todos, and how to place them in lanes.
|
|
23
|
+
*/
|
|
24
|
+
export declare function laneShow({ todos, log }: {
|
|
25
|
+
todos: Todos;
|
|
26
|
+
log: Logger;
|
|
27
|
+
}, id: number | null, { json }?: LaneShowOptions): Promise<void>;
|
|
28
|
+
/** Starts an empty lane called `name`, after the others. */
|
|
29
|
+
export declare function laneAdd({ todos, log }: {
|
|
30
|
+
todos: Todos;
|
|
31
|
+
log: Logger;
|
|
32
|
+
}, name: string): Promise<LaneRecord>;
|
|
33
|
+
export interface LaneUpdateOptions {
|
|
34
|
+
/** What it is called from now on. */
|
|
35
|
+
name?: string;
|
|
36
|
+
/** Where it goes among the lanes, 1 the first; the others close up around it. */
|
|
37
|
+
position?: number;
|
|
38
|
+
}
|
|
39
|
+
/** Calls a lane by another name, or moves it among the others. */
|
|
40
|
+
export declare function laneUpdate({ todos, log }: {
|
|
41
|
+
todos: Todos;
|
|
42
|
+
log: Logger;
|
|
43
|
+
}, id: number, { name, position }?: LaneUpdateOptions): Promise<LaneRecord>;
|
|
44
|
+
/** What a lane update changed, for the event: only the parts it was asked to. */
|
|
45
|
+
export declare function laneUpdated(id: number, record: LaneRecord, { name, position }: LaneUpdateOptions): Facts["lane update"];
|
|
46
|
+
/**
|
|
47
|
+
* Runs `drop`, which removes lane `id`, and journals it with the lane's name
|
|
48
|
+
* and the todos it sent back to none, read before it went.
|
|
49
|
+
*/
|
|
50
|
+
export declare function recordLaneRemove(journal: Journal, todos: Todos, id: number, drop: () => Promise<void>): Promise<void>;
|
|
51
|
+
/** Removes a lane, putting its todos back with the untriaged ones. */
|
|
52
|
+
export declare function laneRemove({ todos, log }: {
|
|
53
|
+
todos: Todos;
|
|
54
|
+
log: Logger;
|
|
55
|
+
}, id: number): Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Logger } from "webappwiz/log";
|
|
2
|
+
import { type Fs, type Ps } from "webappwiz/system";
|
|
3
|
+
/** Where the repository at `dir` keeps its todos, and what to do it with. */
|
|
4
|
+
export interface LanesFromTagsOptions {
|
|
5
|
+
/** The root of a repository, or of one of its worktrees. */
|
|
6
|
+
dir: string;
|
|
7
|
+
log?: Logger;
|
|
8
|
+
fs?: Fs;
|
|
9
|
+
ps?: Ps;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Moves the todos of the repository at `dir` that still have tags, from
|
|
13
|
+
* before splates kept lanes instead, into a lane a tag, and says where each
|
|
14
|
+
* went; splates refuses to read them until then. Says nothing when `dir` is
|
|
15
|
+
* no repository, keeps no todos, or none has tags.
|
|
16
|
+
*/
|
|
17
|
+
export declare function lanesFromTags(opts: LanesFromTagsOptions): Promise<void>;
|
package/lanes.d.ts
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { TodoState } from "./todo.js";
|
|
2
|
+
/**
|
|
3
|
+
* What blocks which todos, and the lanes they run in, worked out from the
|
|
4
|
+
* todos alone. Nothing here reads or writes the disk, so the CLI and the
|
|
5
|
+
* `splates server` page draw the same lanes from the same list.
|
|
6
|
+
*/
|
|
7
|
+
/** A todo that has to merge first, and where it stands now. */
|
|
8
|
+
export interface Blocker {
|
|
9
|
+
id: number;
|
|
10
|
+
subject: string;
|
|
11
|
+
/** The lane it is in, or null when it is in none. */
|
|
12
|
+
lane: number | null;
|
|
13
|
+
/** The task working on it, or null while nobody has it. */
|
|
14
|
+
takenBy: string | null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A lane as stored: its number, never handed out again once it is gone, and
|
|
18
|
+
* what it is called. Lanes are kept in the order the board shows them.
|
|
19
|
+
*/
|
|
20
|
+
export interface LaneRecord {
|
|
21
|
+
id: number;
|
|
22
|
+
name: string;
|
|
23
|
+
}
|
|
24
|
+
/** A queue of todos that build on each other, worked top first. */
|
|
25
|
+
export interface LaneState {
|
|
26
|
+
id: number;
|
|
27
|
+
name: string;
|
|
28
|
+
todos: TodoState[];
|
|
29
|
+
/** The tasks at work on its todos now, top first: who is on the lane. */
|
|
30
|
+
agents: string[];
|
|
31
|
+
/** The first todo no task has taken: what the lane's orchestrator hands out next. */
|
|
32
|
+
next: TodoState | null;
|
|
33
|
+
/**
|
|
34
|
+
* Todos in other lanes, or in none, blocking `next` that have
|
|
35
|
+
* yet to merge: what the lane is waiting on before it can go on.
|
|
36
|
+
*/
|
|
37
|
+
blockers: Blocker[];
|
|
38
|
+
/** `next` can be taken now: nothing blocking it is left but in this lane's hands. */
|
|
39
|
+
ready: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Every lane, in the order `records` keeps them, each with its todos in list
|
|
43
|
+
* order. A lane some todo is in but `records` lacks, as one written before
|
|
44
|
+
* lanes had names, comes last, called by its number.
|
|
45
|
+
*/
|
|
46
|
+
export declare function lanes(todos: TodoState[], records: LaneRecord[]): LaneState[];
|
|
47
|
+
/** `records`, and after them a record for each lane a todo is in that they lack. */
|
|
48
|
+
export declare function named(todos: TodoState[], records: LaneRecord[]): LaneRecord[];
|
|
49
|
+
/** The lane `record` stands for, empty when no todo is in it. */
|
|
50
|
+
export declare function lane(todos: TodoState[], { id, name }: LaneRecord): LaneState;
|
|
51
|
+
/** What blocks `todo` and has yet to merge, in list order. */
|
|
52
|
+
export declare function blockersOf(todos: TodoState[], todo: TodoState): Blocker[];
|
|
53
|
+
/** The todos `id` blocks, in list order. */
|
|
54
|
+
export declare function followers(todos: TodoState[], id: number): TodoState[];
|
|
55
|
+
/** Nothing blocking it is still open, and nobody has it: free to start. */
|
|
56
|
+
export declare function isReady(todo: TodoState): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The todos that would form a loop if `blocker` blocked `id`, as the chain
|
|
59
|
+
* from `id` round to itself in merge order, or null when there is none. A
|
|
60
|
+
* loop is `id` already blocking `blocker`, however far down.
|
|
61
|
+
*/
|
|
62
|
+
export declare function cycle(todos: TodoState[], id: number, blocker: number): number[] | null;
|
|
63
|
+
/**
|
|
64
|
+
* `todos` in list order, but with each one below every todo in its own lane
|
|
65
|
+
* that blocks it: a todo that would come too soon is moved down to just
|
|
66
|
+
* below the last of them, and everything else keeps its place.
|
|
67
|
+
*/
|
|
68
|
+
export declare function settle(todos: TodoState[]): TodoState[];
|
|
69
|
+
/**
|
|
70
|
+
* The first pair in `todos`, in list order, where a todo sits above one in
|
|
71
|
+
* its own lane that blocks it; null when the lanes all keep to their
|
|
72
|
+
* links.
|
|
73
|
+
*/
|
|
74
|
+
export declare function misordered(todos: TodoState[]): {
|
|
75
|
+
todo: TodoState;
|
|
76
|
+
blockedBy: TodoState;
|
|
77
|
+
} | null;
|
|
78
|
+
/** A blocking todo, and the lane it is in by name: `#177 in Licensing`. */
|
|
79
|
+
export declare function blockerLabel({ id, lane }: {
|
|
80
|
+
id: number;
|
|
81
|
+
lane: number | null;
|
|
82
|
+
}, records: LaneRecord[]): string;
|
|
83
|
+
/**
|
|
84
|
+
* A name for a lane holding `todos`, none of `taken`: its first todo's
|
|
85
|
+
* subject, numbered past any lane already called that. The user renames it
|
|
86
|
+
* to what the run adds up to.
|
|
87
|
+
*/
|
|
88
|
+
export declare function aptName(todos: TodoState[], taken: string[]): string;
|
|
89
|
+
/**
|
|
90
|
+
* The todos a markdown text mentions as `#N`, once each, in the order
|
|
91
|
+
* mentioned. Code spans and blocks are left out, where `#3` means something
|
|
92
|
+
* else, as is `#N` inside a word or a link like `page#2`.
|
|
93
|
+
*/
|
|
94
|
+
export declare function mentioned(text: string): number[];
|
|
95
|
+
/** `#` and a number, standing on its own. */
|
|
96
|
+
export declare const MENTION: RegExp;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Logger } from "webappwiz/log";
|
|
2
|
+
import type { Fs, Ps } from "webappwiz/system";
|
|
3
|
+
/** splates's old name, as its command, its skill and its directories went by. */
|
|
4
|
+
export declare const LEGACY = "arbor";
|
|
5
|
+
/** The old name of a `SPLATES_*` variable or cred, or null for any other. */
|
|
6
|
+
export declare function legacyName(name: string): string | null;
|
|
7
|
+
/** The `SPLATES_*` name of an `ARBOR_*` variable or cred, or null for any other. */
|
|
8
|
+
export declare function renamed(old: string): string | null;
|
|
9
|
+
/** A task's notes file in a worktree made before the rename. */
|
|
10
|
+
export declare const LEGACY_PLAN_FILE = "ARBOR.md";
|
|
11
|
+
/** The state directory under `.git`, and the home directory's, before the rename. */
|
|
12
|
+
export declare const LEGACY_DIR = "arbor";
|
|
13
|
+
/** Says once per process, on stderr, that an old name was used. */
|
|
14
|
+
declare class Warnings {
|
|
15
|
+
#private;
|
|
16
|
+
once(name: string, instead: string): void;
|
|
17
|
+
}
|
|
18
|
+
export declare const legacyWarnings: Warnings;
|
|
19
|
+
/**
|
|
20
|
+
* `next`, or `old` while only the old directory is there: until `splates server`
|
|
21
|
+
* has moved it, every command reads records where arbor left them.
|
|
22
|
+
*/
|
|
23
|
+
export declare function unmigrated(next: string, old: string): string;
|
|
24
|
+
/** What `moveLegacyDir` works with. */
|
|
25
|
+
export interface MoveOptions {
|
|
26
|
+
fs: Fs;
|
|
27
|
+
log: Logger;
|
|
28
|
+
/** Makes `path` a symbolic link to `target`; the real one by default. */
|
|
29
|
+
link?: (target: string, path: string) => Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Moves arbor's directory `old` to `next` and leaves a link at `old`, so the
|
|
33
|
+
* absolute paths records hold, attachments named in plans, todos and
|
|
34
|
+
* conversations above all, still resolve. Does nothing once moved, or when
|
|
35
|
+
* `next` is already there. Answers whether it moved.
|
|
36
|
+
*/
|
|
37
|
+
export declare function moveLegacyDir(old: string, next: string, { fs, log, link }: MoveOptions): Promise<boolean>;
|
|
38
|
+
/** Renames a worktree's `ARBOR.md` to `planFile`, unless it has one already. */
|
|
39
|
+
export declare function movePlan(tree: string, planFile: string, fs: Fs): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* `path` under `.git/splates` when it names a file under `.git/arbor`, as
|
|
42
|
+
* plans, todos and conversations written before the move do.
|
|
43
|
+
*/
|
|
44
|
+
export declare function movedPath(path: string): string;
|
|
45
|
+
/** The old name of the file a repo keeps `file`'s settings in, or null. */
|
|
46
|
+
export declare function legacyFile(file: string): string | null;
|
|
47
|
+
/** What `renameLegacyFiles` and `removeLegacySkill` work with. */
|
|
48
|
+
export interface LegacyRepoOptions {
|
|
49
|
+
/** The repository's main tree. */
|
|
50
|
+
root: string;
|
|
51
|
+
fs: Fs;
|
|
52
|
+
ps: Ps;
|
|
53
|
+
log: Logger;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Renames `arbor.config.ts` and `arbor.systems.ts` to splates's names, through
|
|
57
|
+
* git when it tracks them so the rename is staged as one, and points their
|
|
58
|
+
* imports of `@webappwiz/arbor` at `@stringsync/splates`. Leaves a file alone when one
|
|
59
|
+
* under the new name is already there.
|
|
60
|
+
*/
|
|
61
|
+
export declare function renameLegacyFiles({ root, fs, ps, log, }: LegacyRepoOptions): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Takes arbor's skill at `path` out of its project, which splates's replaces.
|
|
64
|
+
* Leaves one that links to a copy kept by hand.
|
|
65
|
+
*/
|
|
66
|
+
export declare function removeLegacySkill(path: string, { fs, log }: {
|
|
67
|
+
fs: Fs;
|
|
68
|
+
log: Logger;
|
|
69
|
+
}): Promise<void>;
|
|
70
|
+
export {};
|
package/legacy-ps.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Resource } from "webappwiz/disposable";
|
|
2
|
+
import { type Child, type Ps, type SpawnCaptureResult, type SpawnOptions, type SpawnResult, type StartOptions, type TerminalChild, type TerminalOptions } from "webappwiz/system";
|
|
3
|
+
/**
|
|
4
|
+
* A `Ps` that reads each `SPLATES_*` variable under its `ARBOR_*` name too,
|
|
5
|
+
* warning once, and sets both names on every child, so a `wiz` or skill still
|
|
6
|
+
* reading the old ones sees what splates means.
|
|
7
|
+
*/
|
|
8
|
+
export declare class LegacyNamesPs implements Ps {
|
|
9
|
+
private readonly inner;
|
|
10
|
+
constructor(inner: Ps);
|
|
11
|
+
get platform(): NodeJS.Platform;
|
|
12
|
+
get pid(): number;
|
|
13
|
+
get hostname(): string;
|
|
14
|
+
get args(): string[];
|
|
15
|
+
get self(): string[];
|
|
16
|
+
env(name: string): string | undefined;
|
|
17
|
+
alive(pid: number): boolean;
|
|
18
|
+
spawn(argv: string[], opts?: SpawnOptions): Promise<SpawnResult>;
|
|
19
|
+
spawnCapture(argv: string[], opts?: SpawnOptions): Promise<SpawnCaptureResult>;
|
|
20
|
+
start(argv: string[], opts?: StartOptions): Child;
|
|
21
|
+
startOnTerminal(argv: string[], opts: TerminalOptions): TerminalChild;
|
|
22
|
+
processes(): ReturnType<Ps["processes"]>;
|
|
23
|
+
listening(): ReturnType<Ps["listening"]>;
|
|
24
|
+
cwd(): string;
|
|
25
|
+
cd(path: string): void;
|
|
26
|
+
exit(code: number): void;
|
|
27
|
+
on(signal: string, handler: (...args: unknown[]) => void): Resource;
|
|
28
|
+
once(event: "exit", handler: () => void): Resource;
|
|
29
|
+
}
|
|
30
|
+
/** The machine's processes, under both names. */
|
|
31
|
+
export declare function systemPs(): Ps;
|
package/limits.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Fs } from "webappwiz/system";
|
|
2
|
+
import { type Limit } from "./conversations.js";
|
|
3
|
+
/**
|
|
4
|
+
* Each agent's plan limits as it last said, from any project, kept under the
|
|
5
|
+
* user's home: a new conversation shows how much of the plan is left before
|
|
6
|
+
* any conversation in its project has said.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Limits {
|
|
9
|
+
/** `~/.splates/limits.json`, or a test's own. */
|
|
10
|
+
readonly path: string;
|
|
11
|
+
private readonly deps;
|
|
12
|
+
/** Read once, then kept: this process is the one writing it. */
|
|
13
|
+
private known;
|
|
14
|
+
/** Set when a newer splates wrote the file, which this one leaves alone. */
|
|
15
|
+
private newer;
|
|
16
|
+
/** Writes one after another, so none is lost to another. */
|
|
17
|
+
private writing;
|
|
18
|
+
constructor(
|
|
19
|
+
/** `~/.splates/limits.json`, or a test's own. */
|
|
20
|
+
path: string, deps: {
|
|
21
|
+
fs: Fs;
|
|
22
|
+
});
|
|
23
|
+
/** Every agent's limits, by its id; none for one that never said. */
|
|
24
|
+
all(): Promise<Record<string, Limit[]>>;
|
|
25
|
+
/**
|
|
26
|
+
* Keeps each of `limits` that is newer than what `agent` said of its
|
|
27
|
+
* window before: a log read back can be older than another project's.
|
|
28
|
+
*/
|
|
29
|
+
remember(agent: string, limits: Limit[]): Promise<void>;
|
|
30
|
+
private read;
|
|
31
|
+
private write;
|
|
32
|
+
}
|
package/list.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Logger } from "webappwiz/log";
|
|
2
|
+
import type { Fs } from "webappwiz/system";
|
|
3
|
+
import type { WorktreeService } from "./worktree-service.js";
|
|
4
|
+
export interface ListOptions {
|
|
5
|
+
/** Print the rows as JSON instead of a table. */
|
|
6
|
+
json?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Add each task's Goal and changed files, which is what an agent checks
|
|
9
|
+
* its own plan against before starting. Off by default: it costs git calls
|
|
10
|
+
* and a file read per task.
|
|
11
|
+
*/
|
|
12
|
+
files?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function list({ service, log, fs }: {
|
|
15
|
+
service: WorktreeService;
|
|
16
|
+
log: Logger;
|
|
17
|
+
fs: Fs;
|
|
18
|
+
}, { json, files }?: ListOptions): Promise<void>;
|
package/load-config.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type Fs } from "webappwiz/system";
|
|
2
|
+
import type { Config } from "./config.js";
|
|
3
|
+
import { Git } from "./git.js";
|
|
4
|
+
/** The file a repo's settings are in, at its root. */
|
|
5
|
+
export declare const CONFIG_FILE = "splates.config.ts";
|
|
6
|
+
export interface LoadConfigOptions {
|
|
7
|
+
/** What `splates.config.ts` is looked for through; the real one by default. */
|
|
8
|
+
fs?: Fs;
|
|
9
|
+
/** What the trunk is detected through; the repo's own git by default. */
|
|
10
|
+
git?: Git;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The settings splates runs a repo with: what `splates.config.ts` names, then the
|
|
14
|
+
* branch `origin/HEAD` points at for the trunk, then splates's own defaults.
|
|
15
|
+
* Throws when the config file is there but cannot be imported.
|
|
16
|
+
*/
|
|
17
|
+
export declare function loadConfig(root: string, opts?: LoadConfigOptions): Promise<Config>;
|
|
18
|
+
/** Reads the TypeScript files a repo keeps its settings in, through `fs`. */
|
|
19
|
+
export declare class ConfigFiles {
|
|
20
|
+
private readonly fs;
|
|
21
|
+
constructor(fs?: Fs);
|
|
22
|
+
/**
|
|
23
|
+
* What `root`'s `splates.config.ts` names, or nothing when there is no such
|
|
24
|
+
* file. Systems live in `splates.systems.ts` now: a config that still names
|
|
25
|
+
* them is read without them, so `splates update` can run to move them.
|
|
26
|
+
*/
|
|
27
|
+
read(root: string): Promise<Partial<Config>>;
|
|
28
|
+
/**
|
|
29
|
+
* Everything `root`'s `splates.config.ts` exports as its default, unchecked, or
|
|
30
|
+
* nothing when there is no such file.
|
|
31
|
+
*/
|
|
32
|
+
importConfig(root: string): Promise<Record<string, unknown>>;
|
|
33
|
+
/**
|
|
34
|
+
* Where `file` is at `root`, under arbor's old name for it until `splates
|
|
35
|
+
* update` renames it, or null when it is under neither.
|
|
36
|
+
*/
|
|
37
|
+
private found;
|
|
38
|
+
/**
|
|
39
|
+
* What the TypeScript file `file` at `root` exports as its default, unchecked,
|
|
40
|
+
* or nothing when there is no such file. Read afresh whenever the file has
|
|
41
|
+
* changed, so a long-running `splates server` sees an edit without a restart.
|
|
42
|
+
*/
|
|
43
|
+
importDefault(root: string, file: string): Promise<Record<string, unknown>>;
|
|
44
|
+
}
|
package/log.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Logger } from "webappwiz/log";
|
|
2
|
+
import type { Journal } from "./journal.js";
|
|
3
|
+
/** Enough to cover a session's worth of work without scrolling. */
|
|
4
|
+
export declare const DEFAULT_COUNT = 20;
|
|
5
|
+
export interface LogOptions {
|
|
6
|
+
/** How many of the most recent entries to show. */
|
|
7
|
+
count?: number;
|
|
8
|
+
/** Print the entries as JSON instead of a table. */
|
|
9
|
+
json?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function log({ journal, log }: {
|
|
12
|
+
journal: Journal;
|
|
13
|
+
log: Logger;
|
|
14
|
+
}, { count, json }?: LogOptions): Promise<void>;
|
package/machine.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Fs } from "webappwiz/system";
|
|
2
|
+
/** How hard the machine `splates server` runs on is working right now. */
|
|
3
|
+
export interface MachineReading {
|
|
4
|
+
/** What the page calls the machine: "Mac" on macOS, else "machine". */
|
|
5
|
+
kind: "Mac" | "machine";
|
|
6
|
+
/** The share of CPU time busy since the reading before, 0 to 1. */
|
|
7
|
+
cpu: number;
|
|
8
|
+
/** The share of memory in use, 0 to 1. */
|
|
9
|
+
memory: number;
|
|
10
|
+
/** The load average over the last minute. */
|
|
11
|
+
load: number;
|
|
12
|
+
cores: number;
|
|
13
|
+
/** The hottest CPU sensor in °C, or null where none can be read. */
|
|
14
|
+
temperature: number | null;
|
|
15
|
+
}
|
|
16
|
+
/** Where a reading comes from: the OS by default, a fake in tests. */
|
|
17
|
+
export interface MachineSensors {
|
|
18
|
+
platform: NodeJS.Platform;
|
|
19
|
+
cpus(): {
|
|
20
|
+
times: Record<"user" | "nice" | "sys" | "idle" | "irq", number>;
|
|
21
|
+
}[];
|
|
22
|
+
loadavg(): number[];
|
|
23
|
+
freemem(): number;
|
|
24
|
+
totalmem(): number;
|
|
25
|
+
temperature(): Promise<number | null>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Reads the machine on each ask, its CPU share taken over the time since the
|
|
29
|
+
* ask before, or since it was made for the first.
|
|
30
|
+
*/
|
|
31
|
+
export declare class Machine {
|
|
32
|
+
#private;
|
|
33
|
+
constructor(sensors: MachineSensors);
|
|
34
|
+
read(): Promise<MachineReading>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The machine this process runs on. Temperature is read from Linux's thermal
|
|
38
|
+
* zones, and from the CPU die sensors on Apple Silicon; null elsewhere.
|
|
39
|
+
*/
|
|
40
|
+
export declare function osSensors(fs: Fs): MachineSensors;
|
|
41
|
+
/** The hottest of Linux's thermal zones under `root`, in °C, or null for none. */
|
|
42
|
+
export declare function thermalZones(fs: Fs, root: string): Promise<number | null>;
|
package/merge.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type Logger } from "webappwiz/log";
|
|
2
|
+
import type { Fs, HeavyCap, Lock } from "webappwiz/system";
|
|
3
|
+
import type { Config } from "./config.js";
|
|
4
|
+
import type { Facts } from "./events.js";
|
|
5
|
+
import type { Git } from "./git.js";
|
|
6
|
+
import type { Shell } from "./shell.js";
|
|
7
|
+
import { type Slots } from "./slots.js";
|
|
8
|
+
import type { Todos } from "./todos.js";
|
|
9
|
+
import type { FailedTest } from "./worktree.js";
|
|
10
|
+
import type { WorktreeService } from "./worktree-service.js";
|
|
11
|
+
/**
|
|
12
|
+
* Lands the current worktree's branch on its base branch, trunk unless the
|
|
13
|
+
* task was created with `--base`. Never a merge commit: it rebases onto the
|
|
14
|
+
* base, runs the gate there, and fast-forwards the base with
|
|
15
|
+
* `git merge --ff-only`, in whichever worktree has the base checked out.
|
|
16
|
+
* History stays linear.
|
|
17
|
+
*/
|
|
18
|
+
export declare function merge({ service, git, lock, shell, config, log, todos, fs, slots, heavy, }: {
|
|
19
|
+
service: WorktreeService;
|
|
20
|
+
git: Git;
|
|
21
|
+
lock: Lock;
|
|
22
|
+
shell: Shell;
|
|
23
|
+
config: Config;
|
|
24
|
+
log: Logger;
|
|
25
|
+
todos: Todos;
|
|
26
|
+
fs: Fs;
|
|
27
|
+
slots: Slots;
|
|
28
|
+
heavy: HeavyCap;
|
|
29
|
+
}, cwd: string, facts?: Partial<Facts["merge"]>): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* The tests a runner reported as failing, each with what it said, which the
|
|
32
|
+
* tail cuts off. Another runner prints none, so the tail alone is what the
|
|
33
|
+
* agent gets.
|
|
34
|
+
*/
|
|
35
|
+
export declare function failedTests(output: string): FailedTest[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type Logger } from "webappwiz/log";
|
|
2
|
+
import type { Fs } from "webappwiz/system";
|
|
3
|
+
import { type SystemsFile } from "./systems.js";
|
|
4
|
+
/**
|
|
5
|
+
* Moves the systems an older `splates.config.ts` names into `splates.systems.ts`,
|
|
6
|
+
* taking the `systems` key out of the config. Does nothing when the config
|
|
7
|
+
* names none. Rewrites the config only once re-importing it shows the rest of
|
|
8
|
+
* it unchanged, and puts it back otherwise. Answers with the exit code to end
|
|
9
|
+
* on.
|
|
10
|
+
*/
|
|
11
|
+
export declare function moveSystems({ root, fs, log, }: {
|
|
12
|
+
/** The repository's main tree. */
|
|
13
|
+
root: string;
|
|
14
|
+
fs: Fs;
|
|
15
|
+
log: Logger;
|
|
16
|
+
}): Promise<number>;
|
|
17
|
+
/**
|
|
18
|
+
* Types an older `splates.config.ts` by a type-only import and `satisfies`
|
|
19
|
+
* rather than `defineConfig`, so a reader can import it without splates
|
|
20
|
+
* installed. Leaves a config it cannot rewrite as it is, since
|
|
21
|
+
* `defineConfig` still works. Rewrites it only once re-importing it shows it
|
|
22
|
+
* unchanged, and puts it back otherwise.
|
|
23
|
+
*/
|
|
24
|
+
export declare function typeConfig({ root, fs, log, }: {
|
|
25
|
+
/** The repository's main tree. */
|
|
26
|
+
root: string;
|
|
27
|
+
fs: Fs;
|
|
28
|
+
log: Logger;
|
|
29
|
+
}): Promise<void>;
|
|
30
|
+
/** A `splates.systems.ts` that names `systems`, keys unquoted where they can be. */
|
|
31
|
+
export declare function systemsSource(systems: SystemsFile): string;
|
package/models.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Fs } from "webappwiz/system";
|
|
2
|
+
import type { Setting } from "./conversations.js";
|
|
3
|
+
/**
|
|
4
|
+
* Where `model` is among `settings`: the model setting's id, and the value
|
|
5
|
+
* there whose value or name it is; null when none offers it. Provider-qualified
|
|
6
|
+
* values always require an exact ID; `exact` also disables all display aliases.
|
|
7
|
+
*/
|
|
8
|
+
export declare function modelOption(settings: Setting[], model: string, exact?: boolean): {
|
|
9
|
+
setting: string;
|
|
10
|
+
value: string;
|
|
11
|
+
} | null;
|
|
12
|
+
/**
|
|
13
|
+
* The model `settings` has picked, by its name, `Opus 5.5`; for a default,
|
|
14
|
+
* the model its description says it stands for. Null when none is offered.
|
|
15
|
+
*/
|
|
16
|
+
export declare function pickedModel(settings: Setting[]): string | null;
|
|
17
|
+
/**
|
|
18
|
+
* The agent the conversation logged at `log` runs, and the model it last had
|
|
19
|
+
* picked; null when there is no such log.
|
|
20
|
+
*/
|
|
21
|
+
export declare function ranWith(log: string, fs: Fs): Promise<{
|
|
22
|
+
agent: string;
|
|
23
|
+
model: string | null;
|
|
24
|
+
} | null>;
|