@stringsync/splates 0.0.45 → 0.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +121 -9
- package/artifact.d.ts +3 -30
- package/budget.d.ts +3 -0
- package/coordinator.d.ts +3 -0
- package/creds.d.ts +3 -123
- package/flags.d.ts +37 -0
- package/index.js +826 -26419
- package/lane.d.ts +3 -55
- package/main.d.ts +6 -0
- package/package.json +3 -42
- package/projects.d.ts +3 -136
- package/queue.d.ts +3 -0
- package/setup.d.ts +16 -98
- package/slots.d.ts +3 -135
- package/splates.d.ts +1 -19
- package/todo.d.ts +3 -146
- package/{splates-tunnel.d.ts → tunnel.d.ts} +1 -1
- package/{splates-worker.d.ts → worker.d.ts} +1 -1
- package/acp-extensions.d.ts +0 -82
- package/add.d.ts +0 -53
- package/adherence.d.ts +0 -49
- package/age.d.ts +0 -2
- package/agent-connection.d.ts +0 -171
- package/agent-errors.d.ts +0 -2
- package/agent-process.d.ts +0 -65
- package/agent-stream.d.ts +0 -91
- package/agents.d.ts +0 -15
- package/artifact-room.d.ts +0 -47
- package/artifact-viewers.d.ts +0 -6
- package/artifacts.d.ts +0 -161
- package/asked.d.ts +0 -146
- package/asked.js +0 -7
- package/assumed.d.ts +0 -34
- package/attach.d.ts +0 -30
- package/attachments.d.ts +0 -43
- package/baselines.d.ts +0 -55
- package/claim.d.ts +0 -17
- package/cloudflare-api.d.ts +0 -25
- package/cloudflare-error.d.ts +0 -5
- package/cloudflared-tunnel-provider.d.ts +0 -27
- package/codex-limits.d.ts +0 -19
- package/compaction.d.ts +0 -17
- package/config-source.d.ts +0 -13
- package/config.d.ts +0 -98
- package/config.js +0 -7
- package/conversation-archive.d.ts +0 -6
- package/conversation-background.d.ts +0 -21
- package/conversation-choice.d.ts +0 -4
- package/conversation-files.d.ts +0 -51
- package/conversation-given.d.ts +0 -8
- package/conversation-host.d.ts +0 -102
- package/conversation-listing.d.ts +0 -15
- package/conversation-log.d.ts +0 -301
- package/conversation-messages.d.ts +0 -18
- package/conversation-name.d.ts +0 -28
- package/conversation-options.d.ts +0 -73
- package/conversation-reference.d.ts +0 -2
- package/conversation-state.d.ts +0 -472
- package/conversation-turns.d.ts +0 -115
- package/conversation.d.ts +0 -209
- package/conversations.d.ts +0 -140
- package/coordinator-state.d.ts +0 -28
- package/darwin-temperature.d.ts +0 -7
- package/decided.d.ts +0 -18
- package/demo.d.ts +0 -29
- package/dev/api.d.ts +0 -209
- package/dev/assets.d.ts +0 -24
- package/dev/conversation-address.d.ts +0 -47
- package/dev/conversation-feed.d.ts +0 -166
- package/dev/live-stream.d.ts +0 -29
- package/dev/worker.d.ts +0 -33
- package/dev-access.d.ts +0 -61
- package/dev-artifacts.d.ts +0 -22
- package/dev-budgets.d.ts +0 -18
- package/dev-conversation-events.d.ts +0 -39
- package/dev-conversation-routes.d.ts +0 -90
- package/dev-creds.d.ts +0 -17
- package/dev-dictation-connection.d.ts +0 -18
- package/dev-dictation.d.ts +0 -17
- package/dev-http.d.ts +0 -76
- package/dev-open.d.ts +0 -15
- package/dev-options.d.ts +0 -133
- package/dev-outcomes.d.ts +0 -21
- package/dev-pages.d.ts +0 -16
- package/dev-picker.d.ts +0 -57
- package/dev-port-socket.d.ts +0 -26
- package/dev-ports.d.ts +0 -11
- package/dev-project-watch.d.ts +0 -44
- package/dev-project.d.ts +0 -168
- package/dev-push.d.ts +0 -59
- package/dev-restart.d.ts +0 -141
- package/dev-servers.d.ts +0 -30
- package/dev-setup-native.d.ts +0 -23
- package/dev-setup-opencode.d.ts +0 -29
- package/dev-setup.d.ts +0 -16
- package/dev-shell.d.ts +0 -70
- package/dev-slot.d.ts +0 -28
- package/dev-sockets.d.ts +0 -13
- package/dev-task-ports.d.ts +0 -73
- package/dev-tasks.d.ts +0 -20
- package/dev-terminal-connection.d.ts +0 -19
- package/dev-terminal.d.ts +0 -42
- package/dev-todos.d.ts +0 -35
- package/dev-transcriber.d.ts +0 -15
- package/dev-tunnel.d.ts +0 -38
- package/dev-versions.d.ts +0 -53
- package/dev-workers.d.ts +0 -55
- package/dev.d.ts +0 -24
- package/diff.d.ts +0 -29
- package/dispatched.d.ts +0 -16
- package/editors.d.ts +0 -22
- package/escalate.d.ts +0 -27
- package/events.d.ts +0 -311
- package/everywhere.d.ts +0 -41
- package/exhibit.d.ts +0 -21
- package/exit.d.ts +0 -54
- package/fact-todos.d.ts +0 -18
- package/fake-agent.d.ts +0 -107
- package/fake-agent.js +0 -284
- package/finding-facts.d.ts +0 -38
- package/findings.d.ts +0 -84
- package/fold.d.ts +0 -43
- package/follow.d.ts +0 -41
- package/format.d.ts +0 -68
- package/git.d.ts +0 -112
- package/handed-out.d.ts +0 -79
- package/handoff.d.ts +0 -23
- package/heavy-run.d.ts +0 -12
- package/heavy.d.ts +0 -28
- package/heavy.js +0 -16
- package/held.d.ts +0 -22
- package/index-0tfvy823.js +0 -272
- package/index-43pq33n4.js +0 -157
- package/index-4776671w.js +0 -698
- package/index-d4hjrzaq.js +0 -464
- package/index-gcfq7awr.js +0 -740
- package/index-k73tsw5g.js +0 -101
- package/index-kaa44k7q.js +0 -59
- package/index-vcv9m93e.js +0 -1265
- package/index-xmfmy729.js +0 -249
- package/init.d.ts +0 -28
- package/journal.d.ts +0 -57
- package/landed.d.ts +0 -14
- package/lane-todos.d.ts +0 -44
- package/lanes-from-tags.d.ts +0 -17
- package/lanes.d.ts +0 -96
- package/legacy-names.d.ts +0 -70
- package/legacy-ps.d.ts +0 -31
- package/limits.d.ts +0 -32
- package/list.d.ts +0 -18
- package/load-config.d.ts +0 -44
- package/log.d.ts +0 -14
- package/machine.d.ts +0 -42
- package/merge.d.ts +0 -35
- package/migrate-config.d.ts +0 -31
- package/models.d.ts +0 -24
- package/needs.d.ts +0 -115
- package/notices.d.ts +0 -39
- package/offered.d.ts +0 -39
- package/opencode-usage.d.ts +0 -37
- package/outcomes.d.ts +0 -114
- package/path.d.ts +0 -13
- package/plan.d.ts +0 -236
- package/port-forward.d.ts +0 -22
- package/port-pipe.d.ts +0 -36
- package/ports-list.d.ts +0 -19
- package/probe-runtime.d.ts +0 -5
- package/probe-runtime.js +0 -13
- package/project-reaches.d.ts +0 -23
- package/prompts.d.ts +0 -128
- package/pty.d.ts +0 -39
- package/pulse.d.ts +0 -8
- package/recommend.d.ts +0 -31
- package/release.d.ts +0 -41
- package/remote-process.d.ts +0 -26
- package/remote-pty.d.ts +0 -29
- package/remote-worker.d.ts +0 -77
- package/remove.d.ts +0 -31
- package/repository.d.ts +0 -91
- package/retry.d.ts +0 -34
- package/roster.d.ts +0 -63
- package/saved-ports-host.d.ts +0 -25
- package/saved-tunnel.d.ts +0 -44
- package/server-worker-socket.d.ts +0 -21
- package/setup-areas.d.ts +0 -7
- package/setup-opencode-model-error.d.ts +0 -3
- package/setup-opencode-models.d.ts +0 -54
- package/setup-opencode-recipe.d.ts +0 -26
- package/setup-opencode.d.ts +0 -46
- package/shared-browser.d.ts +0 -50
- package/shell.d.ts +0 -17
- package/show.d.ts +0 -106
- package/skill-checks.d.ts +0 -73
- package/skill-checks.js +0 -10
- package/skills.d.ts +0 -16
- package/slot-tunnel.d.ts +0 -27
- package/snapshot.d.ts +0 -75
- package/splates-artifact.d.ts +0 -3
- package/splates-creds.d.ts +0 -3
- package/splates-dev.d.ts +0 -22
- package/splates-flags.d.ts +0 -34
- package/splates-lane.d.ts +0 -3
- package/splates-projects.d.ts +0 -3
- package/splates-setup.d.ts +0 -17
- package/splates-slots.d.ts +0 -3
- package/splates-todo.d.ts +0 -3
- package/stats.d.ts +0 -186
- package/supervise.d.ts +0 -50
- package/system-changes.d.ts +0 -67
- package/system.d.ts +0 -28
- package/systems.d.ts +0 -119
- package/systems.js +0 -21
- package/table.d.ts +0 -5
- package/task-log.d.ts +0 -35
- package/task-ports.d.ts +0 -25
- package/tell.d.ts +0 -47
- package/todo-edit.d.ts +0 -60
- package/todo-file.d.ts +0 -6
- package/todo-lanes.d.ts +0 -82
- package/todo-list.d.ts +0 -26
- package/todo-take.d.ts +0 -27
- package/todos.d.ts +0 -157
- package/tool-calls.d.ts +0 -18
- package/tunnel-provider.d.ts +0 -37
- package/tunnel-provider.js +0 -0
- package/tunnel-remove.d.ts +0 -28
- package/tunnel-setup.d.ts +0 -104
- package/unix-worker-listener.d.ts +0 -23
- package/unix-worker-socket.d.ts +0 -30
- package/update.d.ts +0 -29
- package/update.js +0 -10
- package/vocabulary.d.ts +0 -9
- package/wait.d.ts +0 -36
- package/watch.d.ts +0 -46
- package/watched.d.ts +0 -43
- package/websocket-worker-socket.d.ts +0 -18
- package/worker-call-host.d.ts +0 -51
- package/worker-channel.d.ts +0 -83
- package/worker-connection.d.ts +0 -24
- package/worker-daemon.d.ts +0 -64
- package/worker-git.d.ts +0 -18
- package/worker-list.d.ts +0 -49
- package/worker-machine.d.ts +0 -34
- package/worker-port-host.d.ts +0 -21
- package/worker-process-host.d.ts +0 -29
- package/worker-protocol.d.ts +0 -104
- package/worker-pty-host.d.ts +0 -34
- package/worker-registry.d.ts +0 -68
- package/worker-replay.d.ts +0 -25
- package/worker-run.d.ts +0 -20
- package/worker-session.d.ts +0 -189
- package/worker-socket.d.ts +0 -15
- package/worktree-service.d.ts +0 -113
- package/worktree.d.ts +0 -232
package/fake-agent.d.ts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import * as acp from "@agentclientprotocol/sdk";
|
|
2
|
-
import type { Agent, AgentProcess } from "./conversations.js";
|
|
3
|
-
import type { RosterAgent } from "./roster.js";
|
|
4
|
-
/** What the agent does with each prompt, given the connection back to splates. */
|
|
5
|
-
export type Turn = (client: acp.AgentSideConnection, session: string, text: string) => Promise<acp.StopReason>;
|
|
6
|
-
export declare const AGENT: Agent;
|
|
7
|
-
/** `AGENT` as the roster lists it, with the models its Model setting offers. */
|
|
8
|
-
export declare const ROSTERED: RosterAgent;
|
|
9
|
-
/**
|
|
10
|
-
* An ACP agent in this process, joined to the conversation by two pipes in
|
|
11
|
-
* place of a child's stdio, and played by `turn`.
|
|
12
|
-
*/
|
|
13
|
-
export declare class FakeAgent {
|
|
14
|
-
turn: Turn;
|
|
15
|
-
cancelled: number;
|
|
16
|
-
/** The sessions resumed, by id, in order. */
|
|
17
|
-
resumed: string[];
|
|
18
|
-
/**
|
|
19
|
-
* What `_session/steering` answers, or null for an agent that does not
|
|
20
|
-
* offer it, the default: `startedNewTurn` as Codex does when it finds no
|
|
21
|
-
* turn, whatever splates asked, and `failed` as it does on an error.
|
|
22
|
-
*/
|
|
23
|
-
steering: "injected" | "promptRequired" | "startedNewTurn" | "failed" | null;
|
|
24
|
-
/** What was steered into a turn, in order. */
|
|
25
|
-
steered: string[];
|
|
26
|
-
/** What it does before it answers a steer, as ending the turn it would steer into. */
|
|
27
|
-
beforeSteer: () => Promise<void>;
|
|
28
|
-
/** Whether it offers its session list to subscribe to, as Codex does. */
|
|
29
|
-
lists: boolean;
|
|
30
|
-
/** The working directories its session list was subscribed for, in order. */
|
|
31
|
-
subscribed: string[];
|
|
32
|
-
/** What splates said it can take, as it started the last process. */
|
|
33
|
-
capabilities: acp.ClientCapabilities | null;
|
|
34
|
-
/** The background commands stopped, by id, in order. */
|
|
35
|
-
stoppedBackground: string[];
|
|
36
|
-
/** Whether it says it takes images in a prompt. */
|
|
37
|
-
sees: boolean;
|
|
38
|
-
/** The tokens it says each turn used; none, the default, says nothing. */
|
|
39
|
-
usage: acp.Usage | null;
|
|
40
|
-
/**
|
|
41
|
-
* The sessions it holds from before, as its CLI would, to list and load;
|
|
42
|
-
* none, the default, for an agent that does not offer either.
|
|
43
|
-
*/
|
|
44
|
-
held: (acp.SessionInfo & {
|
|
45
|
-
replay: acp.SessionUpdate[];
|
|
46
|
-
})[] | null;
|
|
47
|
-
/** The sessions loaded, by id, in order. */
|
|
48
|
-
loaded: string[];
|
|
49
|
-
/** The `_meta` each session was opened, loaded or resumed with, in order. */
|
|
50
|
-
opened: unknown[];
|
|
51
|
-
/** Whether it takes MCP servers over HTTP, as Claude's adapter does. */
|
|
52
|
-
http: boolean;
|
|
53
|
-
/** The MCP servers each session was opened, loaded or resumed with, in order. */
|
|
54
|
-
mcp: acp.McpServer[][];
|
|
55
|
-
/** Every prompt it was sent, block by block, in order. */
|
|
56
|
-
prompts: acp.ContentBlock[][];
|
|
57
|
-
/** The settings set, in order. */
|
|
58
|
-
chosen: {
|
|
59
|
-
configId: string;
|
|
60
|
-
value: unknown;
|
|
61
|
-
}[];
|
|
62
|
-
options: acp.SessionConfigOption[];
|
|
63
|
-
/** Negotiated resume support; absent capabilities must never imply it. */
|
|
64
|
-
resumes: boolean;
|
|
65
|
-
protocolVersion: number;
|
|
66
|
-
disconnect: () => void;
|
|
67
|
-
/** Simulate an agent refusing to apply a model choice. */
|
|
68
|
-
ignoreChoices: boolean;
|
|
69
|
-
/** What each start's `initialize` waits on; null, the default, answers at once. */
|
|
70
|
-
hold: Promise<void> | null;
|
|
71
|
-
/** How many starts to come die before answering `initialize`. */
|
|
72
|
-
dying: number;
|
|
73
|
-
stderr: string;
|
|
74
|
-
launched: {
|
|
75
|
-
argv: string[];
|
|
76
|
-
cwd: string;
|
|
77
|
-
env: Record<string, string>;
|
|
78
|
-
}[];
|
|
79
|
-
killed: number;
|
|
80
|
-
/** The pid each process it launches says it has. */
|
|
81
|
-
pid: number | null;
|
|
82
|
-
private exit;
|
|
83
|
-
launch: (argv: string[], cwd: string, env: Record<string, string>) => AgentProcess;
|
|
84
|
-
/** Dies as a crashed agent would, on its own. */
|
|
85
|
-
crash(): void;
|
|
86
|
-
/** Says `update` outside any turn, as Claude does of a background command. */
|
|
87
|
-
say(update: acp.SessionUpdate): Promise<void>;
|
|
88
|
-
/**
|
|
89
|
-
* Says on its session list that session `s1` is in `state`, its last turn
|
|
90
|
-
* ended at `endedAt`, as Codex does as a turn starts and ends.
|
|
91
|
-
*/
|
|
92
|
-
list(state: "running" | "idle" | "error", endedAt?: string): Promise<void>;
|
|
93
|
-
private client;
|
|
94
|
-
private agent;
|
|
95
|
-
}
|
|
96
|
-
/** What the person said, as an agent replays it. */
|
|
97
|
-
export declare function heard(text: string): acp.SessionUpdate;
|
|
98
|
-
export declare function say(text: string): acp.SessionUpdate;
|
|
99
|
-
/**
|
|
100
|
-
* Claude's adapter saying it left a command running in the background as
|
|
101
|
-
* `id`, started by tool call `tool`: a draft the SDK's types leave out.
|
|
102
|
-
*/
|
|
103
|
-
export declare function backgroundStarted(id: string, description: string, tool: string, taskType?: string, output?: string): acp.SessionUpdate;
|
|
104
|
-
/** Claude's adapter saying background command `id` ended as `state`. */
|
|
105
|
-
export declare function backgroundEnded(id: string, state: "completed" | "failed" | "stopped"): acp.SessionUpdate;
|
|
106
|
-
/** Claude's adapter saying where background command `id` writes its output. */
|
|
107
|
-
export declare function backgroundWrites(id: string, output: string): acp.SessionUpdate;
|
package/fake-agent.js
DELETED
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
framed2
|
|
3
|
-
} from "./index-d4hjrzaq.js";
|
|
4
|
-
import"./index-k73tsw5g.js";
|
|
5
|
-
|
|
6
|
-
// fake-agent.ts
|
|
7
|
-
import * as acp from "@agentclientprotocol/sdk";
|
|
8
|
-
var AGENT = { id: "fake", name: "Fake", argv: ["fake-acp"] };
|
|
9
|
-
var ROSTERED = {
|
|
10
|
-
...AGENT,
|
|
11
|
-
models: [
|
|
12
|
-
{ id: "big", name: "Big", strengths: "hard problems", cost: "high" },
|
|
13
|
-
{ id: "small", name: "Small", strengths: "quick edits", cost: "low" }
|
|
14
|
-
]
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
class FakeAgent {
|
|
18
|
-
turn = async () => "end_turn";
|
|
19
|
-
cancelled = 0;
|
|
20
|
-
resumed = [];
|
|
21
|
-
steering = null;
|
|
22
|
-
steered = [];
|
|
23
|
-
beforeSteer = async () => {};
|
|
24
|
-
lists = false;
|
|
25
|
-
subscribed = [];
|
|
26
|
-
capabilities = null;
|
|
27
|
-
stoppedBackground = [];
|
|
28
|
-
sees = false;
|
|
29
|
-
usage = null;
|
|
30
|
-
held = null;
|
|
31
|
-
loaded = [];
|
|
32
|
-
opened = [];
|
|
33
|
-
http = false;
|
|
34
|
-
mcp = [];
|
|
35
|
-
prompts = [];
|
|
36
|
-
chosen = [];
|
|
37
|
-
options = structuredClone(OPTIONS);
|
|
38
|
-
resumes = true;
|
|
39
|
-
protocolVersion = acp.PROTOCOL_VERSION;
|
|
40
|
-
disconnect = () => {};
|
|
41
|
-
ignoreChoices = false;
|
|
42
|
-
hold = null;
|
|
43
|
-
dying = 0;
|
|
44
|
-
stderr = "fake agent fell over";
|
|
45
|
-
launched = [];
|
|
46
|
-
killed = 0;
|
|
47
|
-
pid = null;
|
|
48
|
-
exit = () => {};
|
|
49
|
-
launch = (argv, cwd, env) => {
|
|
50
|
-
this.launched.push({ argv, cwd, env });
|
|
51
|
-
const toAgent = new TransformStream;
|
|
52
|
-
const toClient = new TransformStream({
|
|
53
|
-
start: (controller) => {
|
|
54
|
-
this.disconnect = () => controller.terminate();
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
new acp.AgentSideConnection((client) => this.agent(client), acp.ndJsonStream(toClient.writable, toAgent.readable));
|
|
58
|
-
const exited = new Promise((resolve) => {
|
|
59
|
-
this.exit = resolve;
|
|
60
|
-
});
|
|
61
|
-
return {
|
|
62
|
-
pid: this.pid,
|
|
63
|
-
input: toAgent.writable,
|
|
64
|
-
output: framed2(toClient.readable),
|
|
65
|
-
ack: () => {},
|
|
66
|
-
handle: null,
|
|
67
|
-
stderr: () => this.stderr,
|
|
68
|
-
exited,
|
|
69
|
-
kill: () => {
|
|
70
|
-
this.killed++;
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
crash() {
|
|
75
|
-
this.exit(1);
|
|
76
|
-
}
|
|
77
|
-
async say(update) {
|
|
78
|
-
await this.client?.sessionUpdate({ sessionId: "s1", update });
|
|
79
|
-
}
|
|
80
|
-
async list(state, endedAt) {
|
|
81
|
-
await this.client?.extNotification("_session/list/changes", {
|
|
82
|
-
subscriptionId: "list-1",
|
|
83
|
-
sessions: [
|
|
84
|
-
{
|
|
85
|
-
sessionId: "s1",
|
|
86
|
-
cwd: this.subscribed.at(-1) ?? "/",
|
|
87
|
-
_meta: {
|
|
88
|
-
jetbrains: {
|
|
89
|
-
air: {
|
|
90
|
-
state,
|
|
91
|
-
...endedAt === undefined ? {} : { lastTurnEndedAt: endedAt }
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
]
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
client = null;
|
|
100
|
-
agent(client) {
|
|
101
|
-
this.client = client;
|
|
102
|
-
return {
|
|
103
|
-
initialize: async ({ clientCapabilities }) => {
|
|
104
|
-
if (this.dying > 0) {
|
|
105
|
-
this.dying--;
|
|
106
|
-
this.exit(1);
|
|
107
|
-
throw new Error("ACP connection closed");
|
|
108
|
-
}
|
|
109
|
-
await this.hold;
|
|
110
|
-
this.capabilities = clientCapabilities ?? null;
|
|
111
|
-
return {
|
|
112
|
-
protocolVersion: this.protocolVersion,
|
|
113
|
-
agentCapabilities: {
|
|
114
|
-
...this.http ? { mcpCapabilities: { http: true } } : {},
|
|
115
|
-
...this.sees ? { promptCapabilities: { image: true } } : {},
|
|
116
|
-
loadSession: this.held !== null,
|
|
117
|
-
sessionCapabilities: {
|
|
118
|
-
...this.resumes ? { resume: {} } : {},
|
|
119
|
-
...this.held === null ? {} : { list: {} }
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
_meta: {
|
|
123
|
-
...this.steering === null ? {} : { steering: { supported: true } },
|
|
124
|
-
...this.lists ? {
|
|
125
|
-
jetbrains: {
|
|
126
|
-
air: { version: 1, capabilities: ["sessionListSubscribe"] }
|
|
127
|
-
}
|
|
128
|
-
} : {}
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
},
|
|
132
|
-
extMethod: async (method, params) => {
|
|
133
|
-
if (method === "_session/async_task/stop") {
|
|
134
|
-
const id = String(params.asyncTaskId);
|
|
135
|
-
this.stoppedBackground.push(id);
|
|
136
|
-
await client.sessionUpdate({
|
|
137
|
-
sessionId: String(params.sessionId),
|
|
138
|
-
update: backgroundEnded(id, "stopped")
|
|
139
|
-
});
|
|
140
|
-
return { stopped: true };
|
|
141
|
-
}
|
|
142
|
-
if (method === "_session/list/subscribe" && this.lists) {
|
|
143
|
-
this.subscribed.push(String(params.cwd));
|
|
144
|
-
return { subscriptionId: "list-1" };
|
|
145
|
-
}
|
|
146
|
-
if (method !== "_session/steering" || this.steering === null) {
|
|
147
|
-
throw acp.RequestError.methodNotFound(method);
|
|
148
|
-
}
|
|
149
|
-
const prompt = params.prompt;
|
|
150
|
-
await this.beforeSteer();
|
|
151
|
-
if (this.steering === "injected" || this.steering === "startedNewTurn") {
|
|
152
|
-
this.steered.push(prompt.map((block) => block.type === "text" ? block.text : "").join(""));
|
|
153
|
-
}
|
|
154
|
-
return { outcome: this.steering };
|
|
155
|
-
},
|
|
156
|
-
newSession: async ({ _meta, mcpServers }) => {
|
|
157
|
-
this.opened.push(_meta);
|
|
158
|
-
this.mcp.push(mcpServers);
|
|
159
|
-
return { sessionId: "s1", configOptions: this.options };
|
|
160
|
-
},
|
|
161
|
-
listSessions: async ({ cwd }) => ({
|
|
162
|
-
sessions: (this.held ?? []).filter((each) => cwd == null || each.cwd === cwd).map(({ replay: _, ...info }) => info)
|
|
163
|
-
}),
|
|
164
|
-
loadSession: async ({ sessionId, _meta, mcpServers }) => {
|
|
165
|
-
this.opened.push(_meta);
|
|
166
|
-
this.mcp.push(mcpServers);
|
|
167
|
-
const session = this.held?.find((each) => each.sessionId === sessionId);
|
|
168
|
-
if (session === undefined) {
|
|
169
|
-
throw acp.RequestError.resourceNotFound(sessionId);
|
|
170
|
-
}
|
|
171
|
-
this.loaded.push(sessionId);
|
|
172
|
-
for (const update of session.replay) {
|
|
173
|
-
await client.sessionUpdate({ sessionId, update });
|
|
174
|
-
}
|
|
175
|
-
return { configOptions: this.options };
|
|
176
|
-
},
|
|
177
|
-
resumeSession: async ({ sessionId, _meta, mcpServers }) => {
|
|
178
|
-
this.opened.push(_meta);
|
|
179
|
-
this.mcp.push(mcpServers ?? []);
|
|
180
|
-
this.resumed.push(sessionId);
|
|
181
|
-
return { configOptions: this.options };
|
|
182
|
-
},
|
|
183
|
-
authenticate: async () => ({}),
|
|
184
|
-
setSessionConfigOption: async ({ configId, value }) => {
|
|
185
|
-
this.chosen.push({ configId, value });
|
|
186
|
-
this.options = this.options.map((option) => option.id === configId && !this.ignoreChoices ? {
|
|
187
|
-
...option,
|
|
188
|
-
currentValue: typeof value === "boolean" ? value : String(value)
|
|
189
|
-
} : option);
|
|
190
|
-
return { configOptions: this.options };
|
|
191
|
-
},
|
|
192
|
-
prompt: async ({ sessionId, prompt }) => {
|
|
193
|
-
this.prompts.push(prompt);
|
|
194
|
-
return {
|
|
195
|
-
stopReason: await this.turn(client, sessionId, prompt.map((block) => block.type === "text" ? block.text : "").join("")),
|
|
196
|
-
usage: this.usage
|
|
197
|
-
};
|
|
198
|
-
},
|
|
199
|
-
cancel: async () => {
|
|
200
|
-
this.cancelled++;
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
function heard(text) {
|
|
206
|
-
return {
|
|
207
|
-
sessionUpdate: "user_message_chunk",
|
|
208
|
-
content: { type: "text", text }
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
function say(text) {
|
|
212
|
-
return {
|
|
213
|
-
sessionUpdate: "agent_message_chunk",
|
|
214
|
-
content: { type: "text", text }
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
function backgroundStarted(id, description, tool, taskType = "shell", output) {
|
|
218
|
-
return {
|
|
219
|
-
sessionUpdate: "async_task_spawned",
|
|
220
|
-
asyncTaskId: id,
|
|
221
|
-
name: description,
|
|
222
|
-
taskType,
|
|
223
|
-
description,
|
|
224
|
-
showInTranscript: true,
|
|
225
|
-
canStop: true,
|
|
226
|
-
toolCallId: tool,
|
|
227
|
-
...output === undefined ? {} : { outputFilePath: output }
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
function backgroundEnded(id, state) {
|
|
231
|
-
return {
|
|
232
|
-
sessionUpdate: "async_task_state_update",
|
|
233
|
-
asyncTaskId: id,
|
|
234
|
-
state
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
function backgroundWrites(id, output) {
|
|
238
|
-
return {
|
|
239
|
-
sessionUpdate: "async_task_progress",
|
|
240
|
-
asyncTaskId: id,
|
|
241
|
-
outputFilePath: output
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
var OPTIONS = [
|
|
245
|
-
{
|
|
246
|
-
id: "mode",
|
|
247
|
-
name: "Mode",
|
|
248
|
-
category: "mode",
|
|
249
|
-
type: "select",
|
|
250
|
-
currentValue: "ask",
|
|
251
|
-
options: [
|
|
252
|
-
{ value: "ask", name: "Ask" },
|
|
253
|
-
{ value: "auto", name: "Auto" }
|
|
254
|
-
]
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
id: "model",
|
|
258
|
-
name: "Model",
|
|
259
|
-
category: "model",
|
|
260
|
-
type: "select",
|
|
261
|
-
currentValue: "big",
|
|
262
|
-
options: [
|
|
263
|
-
{ value: "big", name: "Big" },
|
|
264
|
-
{ value: "small", name: "Small", description: "Fast" }
|
|
265
|
-
]
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
id: "fast",
|
|
269
|
-
name: "Fast mode",
|
|
270
|
-
category: "model_config",
|
|
271
|
-
type: "boolean",
|
|
272
|
-
currentValue: false
|
|
273
|
-
}
|
|
274
|
-
];
|
|
275
|
-
export {
|
|
276
|
-
AGENT,
|
|
277
|
-
FakeAgent,
|
|
278
|
-
ROSTERED,
|
|
279
|
-
backgroundEnded,
|
|
280
|
-
backgroundStarted,
|
|
281
|
-
backgroundWrites,
|
|
282
|
-
heard,
|
|
283
|
-
say
|
|
284
|
-
};
|
package/finding-facts.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { Finding } from "./findings.js";
|
|
2
|
-
import type { Landed } from "./landed.js";
|
|
3
|
-
/** One thing that went worse than it could have, as the merged card says it. */
|
|
4
|
-
export interface Fact {
|
|
5
|
-
text: string;
|
|
6
|
-
/** "3rd time this week" when it came up before in its project; null otherwise. */
|
|
7
|
-
again: string | null;
|
|
8
|
-
/** What it was found from; null for an older outcome's count of failed merges. */
|
|
9
|
-
finding: Finding | null;
|
|
10
|
-
}
|
|
11
|
-
/** What went worse in a merged task: the gate's turn-aways, and the rest. */
|
|
12
|
-
export interface FoundFacts {
|
|
13
|
-
/** Null when the gate passed it the first time. */
|
|
14
|
-
gate: Fact[] | null;
|
|
15
|
-
/** Most severe first. */
|
|
16
|
-
findings: Fact[];
|
|
17
|
-
}
|
|
18
|
-
/** A todo made of a fact: its line, and what more there is to say. */
|
|
19
|
-
export interface FactTodo {
|
|
20
|
-
subject: string;
|
|
21
|
-
text: string;
|
|
22
|
-
}
|
|
23
|
-
/** The findings that are not the gate's, the most worth acting on first. */
|
|
24
|
-
export declare const SEVERITY: Finding["kind"][];
|
|
25
|
-
/** What went worse in `landed`, from what its outcome kept. */
|
|
26
|
-
export declare function foundFacts({ outcome, baseline }: Landed): FoundFacts;
|
|
27
|
-
/**
|
|
28
|
-
* Findings the merged card lists but no todo is made of: the person's own
|
|
29
|
-
* calls on the agent's picks, which are asking working as meant.
|
|
30
|
-
*/
|
|
31
|
-
export declare const UNTODOED: Finding["kind"][];
|
|
32
|
-
/**
|
|
33
|
-
* The todos `splates merge` adds for what went worse in `landed`, the gate's
|
|
34
|
-
* first: one a fact, as the merged card lists them, but for `UNTODOED`.
|
|
35
|
-
*/
|
|
36
|
-
export declare function factTodos(landed: Landed): FactTodo[];
|
|
37
|
-
/** The todo made of `fact`, found in `task` as it merged. */
|
|
38
|
-
export declare function deferred(task: string, fact: Fact): FactTodo;
|
package/findings.d.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import type { Judged } from "./adherence.js";
|
|
2
|
-
import type { TaskLog } from "./task-log.js";
|
|
3
|
-
import type { GateFailure } from "./worktree.js";
|
|
4
|
-
/** What went worse than it could have, in the order `Finding` lists the kinds. */
|
|
5
|
-
export declare function findings(evidence: Evidence): Finding[];
|
|
6
|
-
/**
|
|
7
|
-
* Where a finding starts: each tuned here, so a finding that fires too often
|
|
8
|
-
* or too rarely is one number to change.
|
|
9
|
-
*/
|
|
10
|
-
export declare const FINDING_THRESHOLDS: {
|
|
11
|
-
/** A command failing this many times in one task. */
|
|
12
|
-
readonly repeatedFailures: 3;
|
|
13
|
-
/** Lines edited this many times over the lines that landed. */
|
|
14
|
-
readonly churnRatio: 4;
|
|
15
|
-
/** And at least this many lines edited, so a small task's retouching is not churn. */
|
|
16
|
-
readonly churnLines: 300;
|
|
17
|
-
/** A skill check passed less than this share of the times it applied. */
|
|
18
|
-
readonly adherenceBelow: 0.5;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Something that went worse than it could have in one task, kept with what it
|
|
22
|
-
* names, so a later count can tell how often each kind recurs.
|
|
23
|
-
*/
|
|
24
|
-
export type Finding =
|
|
25
|
-
/** The gate turned it away, even once. */
|
|
26
|
-
({
|
|
27
|
-
kind: "gate";
|
|
28
|
-
} & GateFailure)
|
|
29
|
-
/** `splates retry` granted it more merge attempts. */
|
|
30
|
-
| {
|
|
31
|
-
kind: "retried";
|
|
32
|
-
times: number;
|
|
33
|
-
}
|
|
34
|
-
/** The person stopped the agent's turn. */
|
|
35
|
-
| {
|
|
36
|
-
kind: "stopped";
|
|
37
|
-
at: string;
|
|
38
|
-
}
|
|
39
|
-
/** A lost connection cut the agent's turn short. */
|
|
40
|
-
| {
|
|
41
|
-
kind: "interrupted";
|
|
42
|
-
at: string;
|
|
43
|
-
}
|
|
44
|
-
/** The person answered picks with another choice than the agent's. */
|
|
45
|
-
| {
|
|
46
|
-
kind: "overturned";
|
|
47
|
-
picks: number;
|
|
48
|
-
}
|
|
49
|
-
/** The person challenged assumptions the agent made. */
|
|
50
|
-
| {
|
|
51
|
-
kind: "challenged";
|
|
52
|
-
assumptions: number;
|
|
53
|
-
}
|
|
54
|
-
/** One command failed again and again. */
|
|
55
|
-
| {
|
|
56
|
-
kind: "repeated_failure";
|
|
57
|
-
command: string;
|
|
58
|
-
times: number;
|
|
59
|
-
}
|
|
60
|
-
/** Far more lines edited than landed. */
|
|
61
|
-
| {
|
|
62
|
-
kind: "churn";
|
|
63
|
-
edited: number;
|
|
64
|
-
landed: number;
|
|
65
|
-
}
|
|
66
|
-
/** A skill check its conversation mostly failed. */
|
|
67
|
-
| {
|
|
68
|
-
kind: "adherence";
|
|
69
|
-
check: string;
|
|
70
|
-
passed: number;
|
|
71
|
-
failed: number;
|
|
72
|
-
};
|
|
73
|
-
/** What a task leaves to find in, each part absent when it was not kept. */
|
|
74
|
-
export interface Evidence {
|
|
75
|
-
gateFailures: GateFailure[];
|
|
76
|
-
retries: number;
|
|
77
|
-
picksOverturned: number;
|
|
78
|
-
assumptionsChallenged: number;
|
|
79
|
-
log: TaskLog | null;
|
|
80
|
-
/** Lines the landed diff added and removed; null when unknown. */
|
|
81
|
-
landedLines: number | null;
|
|
82
|
-
/** Its conversation's skill checks as last judged; null when unjudged. */
|
|
83
|
-
adherence: Judged | null;
|
|
84
|
-
}
|
package/fold.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type * as acp from "@agentclientprotocol/sdk";
|
|
2
|
-
import type { ConversationState, Field, Limit, Message, Setting } from "./conversation-state.js";
|
|
3
|
-
/**
|
|
4
|
-
* Folds one ACP update, sent `at`, into the messages: text runs on in the
|
|
5
|
-
* message it started, and a tool call is one part that fills in as it runs.
|
|
6
|
-
*/
|
|
7
|
-
export declare function fold(state: ConversationState, update: acp.SessionUpdate, at?: string | null): void;
|
|
8
|
-
/**
|
|
9
|
-
* The windows Claude's rate limit info in `update` tells of: every one in
|
|
10
|
-
* `unifiedWindows` when it sends them, else the one it names. Its
|
|
11
|
-
* `utilization` runs from 0 to 1, and `resetsAt` is in seconds.
|
|
12
|
-
*/
|
|
13
|
-
export declare function limitsIn(update: acp.UsageUpdate, at: string | null): Limit[];
|
|
14
|
-
/** `limits`, each window in `news` replaced by what it says now. */
|
|
15
|
-
export declare function heard(limits: Limit[], news: Limit[]): Limit[];
|
|
16
|
-
/** Adds the tokens a turn used to those of the turns before it. */
|
|
17
|
-
export declare function tally(state: ConversationState, usage: acp.Usage): void;
|
|
18
|
-
/**
|
|
19
|
-
* The agent's message at the end, started if the person spoke last, marked
|
|
20
|
-
* as having moved `at`. Queued messages stay below it: the agent has yet to
|
|
21
|
-
* hear them, so nothing it says meanwhile answers them.
|
|
22
|
-
*/
|
|
23
|
-
export declare function agentTurn(state: ConversationState, at: string | null): Message;
|
|
24
|
-
/** Marks the agent's message at the end, if it is the last, as having moved `at`. */
|
|
25
|
-
export declare function moved(state: ConversationState, at: string | null): void;
|
|
26
|
-
/** Whether `update` is the agent at work, as it is only in a turn. */
|
|
27
|
-
export declare function starts(update: acp.SessionUpdate): boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Whether `update` ends a turn: Claude says where each turn came from in the
|
|
30
|
-
* usage it sends at the turn's end, and only then.
|
|
31
|
-
*/
|
|
32
|
-
export declare function result(update: acp.SessionUpdate): boolean;
|
|
33
|
-
/** The session's settings the agent lets the person pick from, in its order. */
|
|
34
|
-
export declare function settingsIn(options: acp.SessionConfigOption[] | null | undefined): Setting[];
|
|
35
|
-
/** `value` for `setting` as ACP sets it: a toggle's as a boolean. */
|
|
36
|
-
export declare function configValue(setting: Setting, value: string): {
|
|
37
|
-
type: "boolean";
|
|
38
|
-
value: boolean;
|
|
39
|
-
} | {
|
|
40
|
-
value: string;
|
|
41
|
-
};
|
|
42
|
-
/** A form an agent asks with, as the fields the page shows. */
|
|
43
|
-
export declare function fieldsIn(schema: unknown): Field[];
|
package/follow.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { Logger } from "webappwiz/log";
|
|
2
|
-
import type { Ps } from "webappwiz/system";
|
|
3
|
-
import type { Git } from "./git.js";
|
|
4
|
-
import type { Projects } from "./projects.js";
|
|
5
|
-
/** What `fetch` is used for here, so a test can stand in for it. */
|
|
6
|
-
type Send = (url: string, init: RequestInit) => Promise<Response>;
|
|
7
|
-
/**
|
|
8
|
-
* Tells `splates server` that the agent in a conversation took or left a task, so
|
|
9
|
-
* the conversation follows it into that worktree, or back to the main tree.
|
|
10
|
-
* An agent started from the page runs with its conversation and the server
|
|
11
|
-
* in its env; any other `splates` has neither, and says nothing. A server that
|
|
12
|
-
* cannot be reached is worth a line, never a failure: the task command has
|
|
13
|
-
* done its work.
|
|
14
|
-
*/
|
|
15
|
-
export declare function follow({ ps, log, send }: {
|
|
16
|
-
ps: Ps;
|
|
17
|
-
log: Logger;
|
|
18
|
-
send?: Send;
|
|
19
|
-
}, task: string | null, { from, base, }?: {
|
|
20
|
-
/** The task being left; given, the conversation moves only out of it. */
|
|
21
|
-
from?: string;
|
|
22
|
-
/**
|
|
23
|
-
* The branch `task` lands on, for an add to send before the task's
|
|
24
|
-
* record names it, so the server can tell a part from a task to follow.
|
|
25
|
-
*/
|
|
26
|
-
base?: string;
|
|
27
|
-
}): Promise<void>;
|
|
28
|
-
/**
|
|
29
|
-
* Asks `splates server` to serve the project `git` is in, so the agent a task
|
|
30
|
-
* there was just handed to from another project starts: the server opens a
|
|
31
|
-
* project only once something asks for it. Outside `splates server` it says
|
|
32
|
-
* nothing; a server that cannot be reached is worth a line.
|
|
33
|
-
*/
|
|
34
|
-
export declare function serveProject({ ps, log, git, projects, send, }: {
|
|
35
|
-
ps: Ps;
|
|
36
|
-
log: Logger;
|
|
37
|
-
git: Git;
|
|
38
|
-
projects: Projects;
|
|
39
|
-
send?: Send;
|
|
40
|
-
}): Promise<void>;
|
|
41
|
-
export {};
|
package/format.d.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { Logger } from "webappwiz/log";
|
|
2
|
-
import type { Fs, Lock } from "webappwiz/system";
|
|
3
|
-
/**
|
|
4
|
-
* One step forward in the format of the records under `.git/splates`: from the
|
|
5
|
-
* version before it to its own. A step can be interrupted and run again, and
|
|
6
|
-
* finds no records to change in a repository that has none yet.
|
|
7
|
-
*/
|
|
8
|
-
export interface Migration {
|
|
9
|
-
/** What the step changes, said as it runs: "moves lanes into their own files". */
|
|
10
|
-
does: string;
|
|
11
|
-
run(splatesDir: string, fs: Fs): Promise<void>;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Every step from version 1, in order: the one at index 0 takes records from
|
|
15
|
-
* version 1 to 2. Forward only; splates never writes an older format.
|
|
16
|
-
*/
|
|
17
|
-
export declare const MIGRATIONS: readonly Migration[];
|
|
18
|
-
/**
|
|
19
|
-
* The version of the records under `.git/splates` this splates reads and writes:
|
|
20
|
-
* tasks, todos, lanes, the journal and conversations, as one. A change an
|
|
21
|
-
* older splates would misread adds a step to `MIGRATIONS`, which moves it on.
|
|
22
|
-
*/
|
|
23
|
-
export declare const FORMAT: number;
|
|
24
|
-
/** What a `Format` works with. */
|
|
25
|
-
export interface FormatOptions {
|
|
26
|
-
fs: Fs;
|
|
27
|
-
/** Held while migrating, so two commands never run the same step at once. */
|
|
28
|
-
lock: Lock;
|
|
29
|
-
log: Logger;
|
|
30
|
-
/** The steps from version 1; a test passes its own. */
|
|
31
|
-
migrations?: readonly Migration[];
|
|
32
|
-
}
|
|
33
|
-
/** The format of one repository's records, kept in `<splatesDir>/format`. */
|
|
34
|
-
export declare class Format {
|
|
35
|
-
readonly splatesDir: string;
|
|
36
|
-
private readonly fs;
|
|
37
|
-
private readonly lock;
|
|
38
|
-
private readonly log;
|
|
39
|
-
private readonly migrations;
|
|
40
|
-
private readonly path;
|
|
41
|
-
constructor(splatesDir: string, { fs, lock, log, migrations }: FormatOptions);
|
|
42
|
-
/** The version this splates reads and writes. */
|
|
43
|
-
get current(): number;
|
|
44
|
-
/**
|
|
45
|
-
* Makes the repository a splates project, as only `splates init` does: stamps
|
|
46
|
-
* records from before formats were stamped as version 1, and a repository
|
|
47
|
-
* with none yet as this splates's. Leaves stamped records alone.
|
|
48
|
-
*/
|
|
49
|
-
create(): Promise<void>;
|
|
50
|
-
/**
|
|
51
|
-
* Refuses records in any format but this splates's, which it would misread or
|
|
52
|
-
* overwrite: a newer one until splates is updated, an older one until
|
|
53
|
-
* `splates server` has migrated it. Refuses a repository with none stamped
|
|
54
|
-
* until `splates init` has made it a splates project.
|
|
55
|
-
*/
|
|
56
|
-
check(): Promise<void>;
|
|
57
|
-
/**
|
|
58
|
-
* Moves older records forward to this splates's format, a step at a time,
|
|
59
|
-
* then checks them as `check` does.
|
|
60
|
-
*/
|
|
61
|
-
migrate(): Promise<void>;
|
|
62
|
-
/**
|
|
63
|
-
* The stored version, or null for records from before formats were
|
|
64
|
-
* stamped, which are version 1. Refuses one this splates cannot read.
|
|
65
|
-
*/
|
|
66
|
-
private stored;
|
|
67
|
-
private write;
|
|
68
|
-
}
|