@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
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// legacy-names.ts
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { symlink } from "node:fs/promises";
|
|
4
|
+
import { basename } from "node:path";
|
|
5
|
+
var LEGACY = "arbor";
|
|
6
|
+
var NEW_ENV = "SPLATES_";
|
|
7
|
+
var OLD_ENV = "ARBOR_";
|
|
8
|
+
function legacyName(name) {
|
|
9
|
+
return name.startsWith(NEW_ENV) ? `${OLD_ENV}${name.slice(NEW_ENV.length)}` : null;
|
|
10
|
+
}
|
|
11
|
+
function renamed(old) {
|
|
12
|
+
return old.startsWith(OLD_ENV) ? `${NEW_ENV}${old.slice(OLD_ENV.length)}` : null;
|
|
13
|
+
}
|
|
14
|
+
var LEGACY_CONFIG_FILE = "arbor.config.ts";
|
|
15
|
+
var LEGACY_SYSTEMS_FILE = "arbor.systems.ts";
|
|
16
|
+
var LEGACY_PLAN_FILE = "ARBOR.md";
|
|
17
|
+
var LEGACY_DIR = "arbor";
|
|
18
|
+
|
|
19
|
+
class Warnings {
|
|
20
|
+
#said = new Set;
|
|
21
|
+
once(name, instead) {
|
|
22
|
+
if (this.#said.has(name)) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
this.#said.add(name);
|
|
26
|
+
process.stderr.write(`splates: ${name} is an old name, kept for one more release: use ${instead}
|
|
27
|
+
`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
var legacyWarnings = new Warnings;
|
|
31
|
+
function unmigrated(next, old) {
|
|
32
|
+
return !existsSync(next) && existsSync(old) ? old : next;
|
|
33
|
+
}
|
|
34
|
+
async function moveLegacyDir(old, next, { fs, log, link = symlink }) {
|
|
35
|
+
if (await fs.exists(next) || !await fs.exists(old) || await fs.isSymlink(old)) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
await fs.rename(old, next);
|
|
40
|
+
} catch (error) {
|
|
41
|
+
if (await fs.exists(next)) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
await link(basename(next), old);
|
|
47
|
+
log.info(`moved ${old} to ${next}, left a link behind`);
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
async function movePlan(tree, planFile, fs) {
|
|
51
|
+
const old = `${tree}/${LEGACY_PLAN_FILE}`;
|
|
52
|
+
const next = `${tree}/${planFile}`;
|
|
53
|
+
if (await fs.exists(old) && !await fs.exists(next)) {
|
|
54
|
+
await fs.rename(old, next);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function movedPath(path) {
|
|
58
|
+
return path.replace(`/.git/${LEGACY_DIR}/`, "/.git/splates/");
|
|
59
|
+
}
|
|
60
|
+
function legacyFile(file) {
|
|
61
|
+
const old = {
|
|
62
|
+
"splates.config.ts": LEGACY_CONFIG_FILE,
|
|
63
|
+
"splates.systems.ts": LEGACY_SYSTEMS_FILE
|
|
64
|
+
};
|
|
65
|
+
return old[file] ?? null;
|
|
66
|
+
}
|
|
67
|
+
async function renameLegacyFiles({
|
|
68
|
+
root,
|
|
69
|
+
fs,
|
|
70
|
+
ps,
|
|
71
|
+
log
|
|
72
|
+
}) {
|
|
73
|
+
for (const next of ["splates.config.ts", "splates.systems.ts"]) {
|
|
74
|
+
const old = legacyFile(next);
|
|
75
|
+
if (old === null || !await fs.exists(`${root}/${old}`) || await fs.exists(`${root}/${next}`)) {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
const { exitCode } = await ps.spawnCapture(["git", "mv", old, next], {
|
|
79
|
+
cwd: root
|
|
80
|
+
});
|
|
81
|
+
if (exitCode !== 0) {
|
|
82
|
+
await fs.rename(`${root}/${old}`, `${root}/${next}`);
|
|
83
|
+
}
|
|
84
|
+
const path = `${root}/${next}`;
|
|
85
|
+
await fs.write(path, (await fs.read(path)).replaceAll("@webappwiz/arbor", "@stringsync/splates"));
|
|
86
|
+
log.info(`renamed ${old} to ${next}`);
|
|
87
|
+
}
|
|
88
|
+
const manifest = await fs.read(`${root}/package.json`).catch(() => "");
|
|
89
|
+
if (manifest.includes('"@webappwiz/arbor"')) {
|
|
90
|
+
log.info("package.json names @webappwiz/arbor: install @stringsync/splates in its place");
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async function removeLegacySkill(path, { fs, log }) {
|
|
94
|
+
if (!await fs.exists(path) || await fs.isSymlink(path)) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
await fs.rm(path, { recursive: true });
|
|
98
|
+
log.info(`removed arbor's skill at ${path}: the splates skill replaces it`);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export { LEGACY, legacyName, renamed, LEGACY_PLAN_FILE, LEGACY_DIR, legacyWarnings, unmigrated, moveLegacyDir, movePlan, movedPath, legacyFile, renameLegacyFiles, removeLegacySkill };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// exit.ts
|
|
2
|
+
var EXIT = {
|
|
3
|
+
usage: 1,
|
|
4
|
+
conflict: 2,
|
|
5
|
+
tests_failed: 3,
|
|
6
|
+
lease_lost: 4,
|
|
7
|
+
budget_exhausted: 5,
|
|
8
|
+
lease_held: 6,
|
|
9
|
+
dirty: 7,
|
|
10
|
+
not_found: 8,
|
|
11
|
+
hook_failed: 9,
|
|
12
|
+
exists: 10,
|
|
13
|
+
orphaned: 11,
|
|
14
|
+
merge_failed: 12,
|
|
15
|
+
already_removed: 13,
|
|
16
|
+
timeout: 14,
|
|
17
|
+
blocked: 16,
|
|
18
|
+
cycle: 18,
|
|
19
|
+
outdated: 19,
|
|
20
|
+
uninitialized: 20,
|
|
21
|
+
too_large: 21,
|
|
22
|
+
dismissed: 22,
|
|
23
|
+
no_secret_store: 23,
|
|
24
|
+
cloudflare: 24,
|
|
25
|
+
requested: 25,
|
|
26
|
+
slots_full: 26,
|
|
27
|
+
slot_running: 27,
|
|
28
|
+
not_granted: 28,
|
|
29
|
+
agents_full: 29
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
class Exit extends Error {
|
|
33
|
+
reason;
|
|
34
|
+
data;
|
|
35
|
+
constructor(reason, message, data = {}) {
|
|
36
|
+
super(message);
|
|
37
|
+
this.reason = reason;
|
|
38
|
+
this.data = data;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function fail(reason, message, data = {}) {
|
|
42
|
+
throw new Exit(reason, message, data);
|
|
43
|
+
}
|
|
44
|
+
function exits() {
|
|
45
|
+
return async (ctx, next) => {
|
|
46
|
+
try {
|
|
47
|
+
await next(ctx);
|
|
48
|
+
} catch (e) {
|
|
49
|
+
if (!(e instanceof Exit)) {
|
|
50
|
+
throw e;
|
|
51
|
+
}
|
|
52
|
+
ctx.log.info(JSON.stringify({ reason: e.reason, ...e.data }));
|
|
53
|
+
ctx.log.error(e.message);
|
|
54
|
+
ctx.ps.exit(EXIT[e.reason]);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { EXIT, Exit, fail, exits };
|