@tokenfactory/acc-runner 0.25.0 → 0.27.0
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 +77 -4
- package/package.json +1 -1
- package/dist/anthropic-auth.d.ts +0 -53
- package/dist/anthropic-auth.d.ts.map +0 -1
- package/dist/anthropic-auth.js +0 -89
- package/dist/anthropic-auth.js.map +0 -1
- package/dist/bin-resolve.d.ts +0 -16
- package/dist/bin-resolve.d.ts.map +0 -1
- package/dist/bin-resolve.js +0 -35
- package/dist/bin-resolve.js.map +0 -1
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -128
- package/dist/cli.js.map +0 -1
- package/dist/config.d.ts +0 -121
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -396
- package/dist/config.js.map +0 -1
- package/dist/cost-pricing.d.ts +0 -130
- package/dist/cost-pricing.d.ts.map +0 -1
- package/dist/cost-pricing.js +0 -191
- package/dist/cost-pricing.js.map +0 -1
- package/dist/doctor.d.ts +0 -37
- package/dist/doctor.d.ts.map +0 -1
- package/dist/doctor.js +0 -658
- package/dist/doctor.js.map +0 -1
- package/dist/failure-classifier.d.ts +0 -112
- package/dist/failure-classifier.d.ts.map +0 -1
- package/dist/failure-classifier.js +0 -353
- package/dist/failure-classifier.js.map +0 -1
- package/dist/gh.d.ts +0 -22
- package/dist/gh.d.ts.map +0 -1
- package/dist/gh.js +0 -48
- package/dist/gh.js.map +0 -1
- package/dist/git.d.ts +0 -50
- package/dist/git.d.ts.map +0 -1
- package/dist/git.js +0 -127
- package/dist/git.js.map +0 -1
- package/dist/github-client.d.ts +0 -133
- package/dist/github-client.d.ts.map +0 -1
- package/dist/github-client.js +0 -234
- package/dist/github-client.js.map +0 -1
- package/dist/keychain.d.ts +0 -21
- package/dist/keychain.d.ts.map +0 -1
- package/dist/keychain.js +0 -45
- package/dist/keychain.js.map +0 -1
- package/dist/login.d.ts +0 -12
- package/dist/login.d.ts.map +0 -1
- package/dist/login.js +0 -133
- package/dist/login.js.map +0 -1
- package/dist/logout.d.ts +0 -2
- package/dist/logout.d.ts.map +0 -1
- package/dist/logout.js +0 -31
- package/dist/logout.js.map +0 -1
- package/dist/mcp-spawn.d.ts +0 -30
- package/dist/mcp-spawn.d.ts.map +0 -1
- package/dist/mcp-spawn.js +0 -145
- package/dist/mcp-spawn.js.map +0 -1
- package/dist/messaging.d.ts +0 -49
- package/dist/messaging.d.ts.map +0 -1
- package/dist/messaging.js +0 -36
- package/dist/messaging.js.map +0 -1
- package/dist/pkg-version.d.ts +0 -3
- package/dist/pkg-version.d.ts.map +0 -1
- package/dist/pkg-version.js +0 -20
- package/dist/pkg-version.js.map +0 -1
- package/dist/profiles/designer-prompt.d.ts +0 -18
- package/dist/profiles/designer-prompt.d.ts.map +0 -1
- package/dist/profiles/designer-prompt.js +0 -172
- package/dist/profiles/designer-prompt.js.map +0 -1
- package/dist/profiles/developer-prompt.d.ts +0 -24
- package/dist/profiles/developer-prompt.d.ts.map +0 -1
- package/dist/profiles/developer-prompt.js +0 -24
- package/dist/profiles/developer-prompt.js.map +0 -1
- package/dist/profiles/manager-prompt.d.ts +0 -34
- package/dist/profiles/manager-prompt.d.ts.map +0 -1
- package/dist/profiles/manager-prompt.js +0 -93
- package/dist/profiles/manager-prompt.js.map +0 -1
- package/dist/profiles/tester-prompt.d.ts +0 -28
- package/dist/profiles/tester-prompt.d.ts.map +0 -1
- package/dist/profiles/tester-prompt.js +0 -165
- package/dist/profiles/tester-prompt.js.map +0 -1
- package/dist/prompt.d.ts +0 -38
- package/dist/prompt.d.ts.map +0 -1
- package/dist/prompt.js +0 -78
- package/dist/prompt.js.map +0 -1
- package/dist/runtime/cache-dir.d.ts +0 -2
- package/dist/runtime/cache-dir.d.ts.map +0 -1
- package/dist/runtime/cache-dir.js +0 -15
- package/dist/runtime/cache-dir.js.map +0 -1
- package/dist/runtime/conflict-resolver.d.ts +0 -65
- package/dist/runtime/conflict-resolver.d.ts.map +0 -1
- package/dist/runtime/conflict-resolver.js +0 -477
- package/dist/runtime/conflict-resolver.js.map +0 -1
- package/dist/runtime/expand-args.d.ts +0 -28
- package/dist/runtime/expand-args.d.ts.map +0 -1
- package/dist/runtime/expand-args.js +0 -50
- package/dist/runtime/expand-args.js.map +0 -1
- package/dist/runtime/locks.d.ts +0 -21
- package/dist/runtime/locks.d.ts.map +0 -1
- package/dist/runtime/locks.js +0 -97
- package/dist/runtime/locks.js.map +0 -1
- package/dist/runtime/provision-mutex.d.ts +0 -37
- package/dist/runtime/provision-mutex.d.ts.map +0 -1
- package/dist/runtime/provision-mutex.js +0 -67
- package/dist/runtime/provision-mutex.js.map +0 -1
- package/dist/runtime/quarantine.d.ts +0 -26
- package/dist/runtime/quarantine.d.ts.map +0 -1
- package/dist/runtime/quarantine.js +0 -50
- package/dist/runtime/quarantine.js.map +0 -1
- package/dist/runtime/resolution-integrity.d.ts +0 -86
- package/dist/runtime/resolution-integrity.d.ts.map +0 -1
- package/dist/runtime/resolution-integrity.js +0 -248
- package/dist/runtime/resolution-integrity.js.map +0 -1
- package/dist/runtime/reviewer.d.ts +0 -81
- package/dist/runtime/reviewer.d.ts.map +0 -1
- package/dist/runtime/reviewer.js +0 -374
- package/dist/runtime/reviewer.js.map +0 -1
- package/dist/runtime/rework.d.ts +0 -48
- package/dist/runtime/rework.d.ts.map +0 -1
- package/dist/runtime/rework.js +0 -136
- package/dist/runtime/rework.js.map +0 -1
- package/dist/runtime/singleton.d.ts +0 -47
- package/dist/runtime/singleton.d.ts.map +0 -1
- package/dist/runtime/singleton.js +0 -200
- package/dist/runtime/singleton.js.map +0 -1
- package/dist/runtime/version-drift.d.ts +0 -31
- package/dist/runtime/version-drift.d.ts.map +0 -1
- package/dist/runtime/version-drift.js +0 -114
- package/dist/runtime/version-drift.js.map +0 -1
- package/dist/runtime/worktree.d.ts +0 -74
- package/dist/runtime/worktree.d.ts.map +0 -1
- package/dist/runtime/worktree.js +0 -206
- package/dist/runtime/worktree.js.map +0 -1
- package/dist/secrets/inject.d.ts +0 -70
- package/dist/secrets/inject.d.ts.map +0 -1
- package/dist/secrets/inject.js +0 -102
- package/dist/secrets/inject.js.map +0 -1
- package/dist/supabase.d.ts +0 -4
- package/dist/supabase.d.ts.map +0 -1
- package/dist/supabase.js +0 -36
- package/dist/supabase.js.map +0 -1
- package/dist/task-runner.d.ts +0 -313
- package/dist/task-runner.d.ts.map +0 -1
- package/dist/task-runner.js +0 -1766
- package/dist/task-runner.js.map +0 -1
- package/dist/token-provider.d.ts +0 -50
- package/dist/token-provider.d.ts.map +0 -1
- package/dist/token-provider.js +0 -177
- package/dist/token-provider.js.map +0 -1
- package/dist/types.d.ts +0 -120
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -16
- package/dist/types.js.map +0 -1
- package/dist/version-check.d.ts +0 -17
- package/dist/version-check.d.ts.map +0 -1
- package/dist/version-check.js +0 -56
- package/dist/version-check.js.map +0 -1
- package/dist/watch.d.ts +0 -295
- package/dist/watch.d.ts.map +0 -1
- package/dist/watch.js +0 -1532
- package/dist/watch.js.map +0 -1
package/dist/login.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { RunnerCaps } from "./types.js";
|
|
2
|
-
export declare const RUNNER_CAPS: RunnerCaps;
|
|
3
|
-
export declare function machineIdentity(): string;
|
|
4
|
-
export declare function detectInstalledModels(): Promise<string[]>;
|
|
5
|
-
export interface LoginOptions {
|
|
6
|
-
/** Override the polling interval seconds (mostly for tests). */
|
|
7
|
-
intervalSeconds?: number;
|
|
8
|
-
/** Override the timeout (seconds) to abort polling. */
|
|
9
|
-
timeoutSeconds?: number;
|
|
10
|
-
}
|
|
11
|
-
export declare function loginCommand(options?: LoginOptions): Promise<void>;
|
|
12
|
-
//# sourceMappingURL=login.d.ts.map
|
package/dist/login.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../src/login.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAGV,UAAU,EACX,MAAM,YAAY,CAAC;AAMpB,eAAO,MAAM,WAAW,EAAE,UAOzB,CAAC;AAEF,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAGD,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAe/D;AAiBD,MAAM,WAAW,YAAY;IAC3B,gEAAgE;IAChE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uDAAuD;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAsB,YAAY,CAAC,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiF5E"}
|
package/dist/login.js
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `acc-runner login` — device-code OAuth flow. v0.2.5: passes the
|
|
3
|
-
* machine identity to /exchange so the server can reuse an existing
|
|
4
|
-
* acc.runners row keyed by (bound_user_id, machine) and return both
|
|
5
|
-
* access_token (8h) and refresh_token (30d) in one shot. The CLI's
|
|
6
|
-
* subsequent register_runner call (migration 0029 variant) fills in
|
|
7
|
-
* caps/models/name on the row the server resolved.
|
|
8
|
-
*/
|
|
9
|
-
import os from "node:os";
|
|
10
|
-
import { setTimeout as sleep } from "node:timers/promises";
|
|
11
|
-
import chalk from "chalk";
|
|
12
|
-
import { execa } from "execa";
|
|
13
|
-
import open from "open";
|
|
14
|
-
import { loadConfig } from "./config.js";
|
|
15
|
-
import { saveSession } from "./keychain.js";
|
|
16
|
-
import { createRunnerClient } from "./supabase.js";
|
|
17
|
-
import { PROTOCOL_VERSION } from "./types.js";
|
|
18
|
-
import { PACKAGE_VERSION } from "./pkg-version.js";
|
|
19
|
-
// v0.12.0 (T-52-7): exported so the env-token-mode boot registration in
|
|
20
|
-
// watch.ts declares the same capability surface as a login-registered runner.
|
|
21
|
-
export const RUNNER_CAPS = {
|
|
22
|
-
branch: true,
|
|
23
|
-
push: true,
|
|
24
|
-
pr: true,
|
|
25
|
-
typecheck: true,
|
|
26
|
-
readFiles: true,
|
|
27
|
-
executeQueue: true,
|
|
28
|
-
};
|
|
29
|
-
export function machineIdentity() {
|
|
30
|
-
return `${process.platform}-${process.arch}-${os.hostname()}`;
|
|
31
|
-
}
|
|
32
|
-
// v0.12.0 (T-52-7): exported for the same reason as RUNNER_CAPS above.
|
|
33
|
-
export async function detectInstalledModels() {
|
|
34
|
-
const out = [];
|
|
35
|
-
for (const bin of ["claude", "codex"]) {
|
|
36
|
-
try {
|
|
37
|
-
await execa(bin, ["--version"], { env: process.env });
|
|
38
|
-
if (bin === "claude") {
|
|
39
|
-
out.push("claude-sonnet-4", "claude-code");
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
out.push("codex");
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
catch {
|
|
46
|
-
// not installed
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return out;
|
|
50
|
-
}
|
|
51
|
-
async function postJson(url, body) {
|
|
52
|
-
const res = await fetch(url, {
|
|
53
|
-
method: "POST",
|
|
54
|
-
headers: {
|
|
55
|
-
"Content-Type": "application/json",
|
|
56
|
-
"User-Agent": `acc-runner/${PROTOCOL_VERSION}`,
|
|
57
|
-
},
|
|
58
|
-
body: JSON.stringify(body ?? {}),
|
|
59
|
-
});
|
|
60
|
-
if (!res.ok) {
|
|
61
|
-
throw new Error(`POST ${url} failed: ${res.status} ${await res.text()}`);
|
|
62
|
-
}
|
|
63
|
-
return (await res.json());
|
|
64
|
-
}
|
|
65
|
-
export async function loginCommand(options = {}) {
|
|
66
|
-
const cfg = loadConfig();
|
|
67
|
-
// 1. Request a device code.
|
|
68
|
-
const start = await postJson(`${cfg.publicUrl.replace(/\/+$/, "")}/api/runner/device-code/create`, {});
|
|
69
|
-
console.log("");
|
|
70
|
-
console.log(chalk.bold("To continue, sign in with your ACC account:"));
|
|
71
|
-
console.log("");
|
|
72
|
-
console.log(` ${chalk.cyan("1.")} Visit ${chalk.underline(start.verification_url)}`);
|
|
73
|
-
console.log(` ${chalk.cyan("2.")} Enter code: ${chalk.bold.green(start.user_code)}`);
|
|
74
|
-
console.log("");
|
|
75
|
-
console.log(chalk.gray("Waiting for confirmation…"));
|
|
76
|
-
open(start.verification_url).catch(() => {
|
|
77
|
-
/* no browser available; user falls back to the printed URL */
|
|
78
|
-
});
|
|
79
|
-
const machine = machineIdentity();
|
|
80
|
-
const hostname = os.hostname();
|
|
81
|
-
// 2. Poll the exchange endpoint.
|
|
82
|
-
const interval = (options.intervalSeconds ?? start.interval) * 1000;
|
|
83
|
-
const deadline = Date.now() + (options.timeoutSeconds ?? start.expires_in) * 1000;
|
|
84
|
-
let exchanged = null;
|
|
85
|
-
while (Date.now() < deadline) {
|
|
86
|
-
await sleep(interval);
|
|
87
|
-
const exchange = await postJson(`${cfg.publicUrl.replace(/\/+$/, "")}/api/runner/device-code/exchange`, { device_code: start.device_code, machine, hostname });
|
|
88
|
-
if (exchange.status === "expired") {
|
|
89
|
-
throw new Error("Device code expired before sign-in completed. Run `acc-runner login` again.");
|
|
90
|
-
}
|
|
91
|
-
if (exchange.status === "ok") {
|
|
92
|
-
exchanged = exchange;
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
if (!exchanged || exchanged.status !== "ok") {
|
|
97
|
-
throw new Error("Device code timed out before sign-in completed.");
|
|
98
|
-
}
|
|
99
|
-
console.log(chalk.green(`✓ Logged in as ${exchanged.email ?? exchanged.user_id}`));
|
|
100
|
-
// 3. Persist the session. Server resolved runner_id (reused if a row
|
|
101
|
-
// already exists for this user+machine pair) so ACC_TEST_RUNNER_ID
|
|
102
|
-
// is stable across re-logins.
|
|
103
|
-
await saveSession({
|
|
104
|
-
access_token: exchanged.access_token,
|
|
105
|
-
refresh_token: exchanged.refresh_token,
|
|
106
|
-
access_expires_at: new Date(exchanged.expires_at * 1000).toISOString(),
|
|
107
|
-
email: exchanged.email,
|
|
108
|
-
user_id: exchanged.user_id,
|
|
109
|
-
runner_id: exchanged.runner_id,
|
|
110
|
-
});
|
|
111
|
-
console.log(chalk.green(`✓ Stored token in OS keychain (acc-runner)`));
|
|
112
|
-
// 4. Fill in caps/models/name on the (server-resolved) runner row.
|
|
113
|
-
// The 0029 register_runner variant upserts by id, so this updates
|
|
114
|
-
// the stub row /exchange created (or refreshes an existing one).
|
|
115
|
-
const supabase = createRunnerClient(cfg, exchanged.access_token);
|
|
116
|
-
const models = await detectInstalledModels();
|
|
117
|
-
const { error } = await supabase.rpc("register_runner", {
|
|
118
|
-
p_id: exchanged.runner_id,
|
|
119
|
-
p_name: `${exchanged.email ?? exchanged.user_id}'s ${os.hostname()}`,
|
|
120
|
-
p_owner: exchanged.email ?? exchanged.user_id,
|
|
121
|
-
p_machine: machine,
|
|
122
|
-
p_models: models,
|
|
123
|
-
p_caps: RUNNER_CAPS,
|
|
124
|
-
p_version: PACKAGE_VERSION,
|
|
125
|
-
});
|
|
126
|
-
if (error) {
|
|
127
|
-
throw new Error(`register_runner failed: ${error.message}`);
|
|
128
|
-
}
|
|
129
|
-
console.log(chalk.green(`✓ Registered runner: ${exchanged.runner_id}`));
|
|
130
|
-
console.log("");
|
|
131
|
-
console.log(`Run ${chalk.bold("acc-runner watch")} to start receiving tasks.`);
|
|
132
|
-
}
|
|
133
|
-
//# sourceMappingURL=login.js.map
|
package/dist/login.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../src/login.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAC;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AC,CAAC;IACH,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,2BAA2B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,wBAAwB,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACxE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,4BAA4B,CAAC,CAAC;AACjF,CAAC"}
|
package/dist/logout.d.ts
DELETED
package/dist/logout.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../src/logout.ts"],"names":[],"mappings":"AAQA,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CA2BnD"}
|
package/dist/logout.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `acc-runner logout` — clear keychain entry, mark runner offline.
|
|
3
|
-
*/
|
|
4
|
-
import chalk from "chalk";
|
|
5
|
-
import { loadConfig } from "./config.js";
|
|
6
|
-
import { clearSession, loadSession } from "./keychain.js";
|
|
7
|
-
import { createRunnerClient } from "./supabase.js";
|
|
8
|
-
export async function logoutCommand() {
|
|
9
|
-
const session = await loadSession();
|
|
10
|
-
if (!session) {
|
|
11
|
-
console.log(chalk.gray("Already signed out."));
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
// Best-effort: mark the runner offline. Don't block the logout if the
|
|
15
|
-
// server is unreachable.
|
|
16
|
-
try {
|
|
17
|
-
const cfg = loadConfig();
|
|
18
|
-
const supabase = createRunnerClient(cfg, session.access_token);
|
|
19
|
-
await supabase.rpc("set_runner_status", {
|
|
20
|
-
p_id: session.runner_id,
|
|
21
|
-
p_status: "offline",
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
catch (err) {
|
|
25
|
-
console.log(chalk.yellow(`! Could not mark runner offline (${err.message}). Clearing local session anyway.`));
|
|
26
|
-
}
|
|
27
|
-
await clearSession();
|
|
28
|
-
console.log(chalk.green("✓ Cleared keychain entry."));
|
|
29
|
-
console.log(chalk.green(`✓ Runner ${session.runner_id} marked offline.`));
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=logout.js.map
|
package/dist/logout.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logout.js","sourceRoot":"","sources":["../src/logout.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,MAAM,OAAO,GAAG,MAAM,WAAW,EAAE,CAAC;IACpC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC;QAC/C,OAAO;IACT,CAAC;IAED,sEAAsE;IACtE,yBAAyB;IACzB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,kBAAkB,CAAC,GAAG,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;QAC/D,MAAM,QAAQ,CAAC,GAAG,CAAC,mBAAmB,EAAE;YACtC,IAAI,EAAE,OAAO,CAAC,SAAS;YACvB,QAAQ,EAAE,SAAS;SACpB,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,MAAM,CACV,oCAAqC,GAAa,CAAC,OAAO,mCAAmC,CAC9F,CACF,CAAC;IACJ,CAAC;IAED,MAAM,YAAY,EAAE,CAAC;IACrB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,OAAO,CAAC,SAAS,kBAAkB,CAAC,CAAC,CAAC;AAC5E,CAAC"}
|
package/dist/mcp-spawn.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export declare const ACC_MCP_KEY = "acc";
|
|
2
|
-
export interface McpSpawnOptions {
|
|
3
|
-
cwd: string;
|
|
4
|
-
taskId: string;
|
|
5
|
-
runnerId: string;
|
|
6
|
-
accessToken: string;
|
|
7
|
-
publicUrl: string;
|
|
8
|
-
supabaseUrl: string;
|
|
9
|
-
supabaseAnonKey: string;
|
|
10
|
-
}
|
|
11
|
-
export interface McpConfigCleanup {
|
|
12
|
-
/** Restore .mcp.json to its pre-spawn state (or delete if we created it). */
|
|
13
|
-
restore(): Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Locate a globally installed binary by name. Returns the absolute
|
|
17
|
-
* path when found, or null otherwise. Used to skip the per-task
|
|
18
|
-
* `npx -y` fetch when the operator has run `npm i -g
|
|
19
|
-
* @tokenfactory/acc-mcp-server` ahead of time.
|
|
20
|
-
*
|
|
21
|
-
* Exposed as an injectable for tests; production code calls
|
|
22
|
-
* `whichBinary(name)` directly.
|
|
23
|
-
*/
|
|
24
|
-
export declare function whichBinary(name: string): Promise<string | null>;
|
|
25
|
-
export interface WriteMcpConfigDeps {
|
|
26
|
-
/** Override for tests; defaults to a real PATH lookup via which/where. */
|
|
27
|
-
which?: (name: string) => Promise<string | null>;
|
|
28
|
-
}
|
|
29
|
-
export declare function writeMcpConfig(opts: McpSpawnOptions, deps?: WriteMcpConfigDeps): Promise<McpConfigCleanup>;
|
|
30
|
-
//# sourceMappingURL=mcp-spawn.d.ts.map
|
package/dist/mcp-spawn.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-spawn.d.ts","sourceRoot":"","sources":["../src/mcp-spawn.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,WAAW,QAAQ,CAAC;AAKjC,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,6EAA6E;IAC7E,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAMD;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAUtE;AA+ED,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAClD;AAED,wBAAsB,cAAc,CAClC,IAAI,EAAE,eAAe,EACrB,IAAI,GAAE,kBAAuB,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CA4B3B"}
|
package/dist/mcp-spawn.js
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* .mcp.json plumbing for acc-mcp-server.
|
|
3
|
-
*
|
|
4
|
-
* Claude Code auto-discovers MCP servers from a `.mcp.json` in the CWD
|
|
5
|
-
* of the session. Before spawning claude we write one that points at
|
|
6
|
-
* the @tokenfactory/acc-mcp-server CLI with the current task's
|
|
7
|
-
* coordinates (task_id, runner_id) and the runner's user JWT. After
|
|
8
|
-
* the session exits we remove the file so no JWT is left on disk.
|
|
9
|
-
*
|
|
10
|
-
* The file may pre-exist if the operator runs other MCP servers
|
|
11
|
-
* locally — we preserve their config by reading the existing file,
|
|
12
|
-
* merging our entry under `mcpServers.acc`, and restoring the prior
|
|
13
|
-
* contents on cleanup. If our entry is the only one, we delete the
|
|
14
|
-
* file entirely.
|
|
15
|
-
*/
|
|
16
|
-
import { promises as fs } from "node:fs";
|
|
17
|
-
import path from "node:path";
|
|
18
|
-
import { execa } from "execa";
|
|
19
|
-
export const ACC_MCP_KEY = "acc";
|
|
20
|
-
const MCP_CONFIG_FILENAME = ".mcp.json";
|
|
21
|
-
const ACC_MCP_PACKAGE = "@tokenfactory/acc-mcp-server";
|
|
22
|
-
const ACC_MCP_BIN = "acc-mcp-server";
|
|
23
|
-
/**
|
|
24
|
-
* Locate a globally installed binary by name. Returns the absolute
|
|
25
|
-
* path when found, or null otherwise. Used to skip the per-task
|
|
26
|
-
* `npx -y` fetch when the operator has run `npm i -g
|
|
27
|
-
* @tokenfactory/acc-mcp-server` ahead of time.
|
|
28
|
-
*
|
|
29
|
-
* Exposed as an injectable for tests; production code calls
|
|
30
|
-
* `whichBinary(name)` directly.
|
|
31
|
-
*/
|
|
32
|
-
export async function whichBinary(name) {
|
|
33
|
-
const cmd = process.platform === "win32" ? "where" : "which";
|
|
34
|
-
try {
|
|
35
|
-
const result = await execa(cmd, [name], { reject: false });
|
|
36
|
-
if (result.exitCode !== 0)
|
|
37
|
-
return null;
|
|
38
|
-
const firstLine = result.stdout.split(/\r?\n/)[0]?.trim();
|
|
39
|
-
return firstLine ? firstLine : null;
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
function buildEnvBlock(opts) {
|
|
46
|
-
return {
|
|
47
|
-
SUPABASE_URL: opts.supabaseUrl,
|
|
48
|
-
SUPABASE_ANON_KEY: opts.supabaseAnonKey,
|
|
49
|
-
// Token in env is preferable to argv (no ps-output visibility);
|
|
50
|
-
// we still pass --access-token for back-compat with the current
|
|
51
|
-
// acc-mcp-server build.
|
|
52
|
-
ACC_MCP_ACCESS_TOKEN: opts.accessToken,
|
|
53
|
-
ACC_PUBLIC_URL: opts.publicUrl,
|
|
54
|
-
// Task + runner IDs are CLI-passed today (cli > env > default at
|
|
55
|
-
// the MCP server side) but we also surface them in the env block
|
|
56
|
-
// so any future env-only consumer reads the same coordinates we
|
|
57
|
-
// already record in argv. Cheap, forward-compatible, no behavior
|
|
58
|
-
// change in v0.4.x.
|
|
59
|
-
ACC_TASK_ID: opts.taskId,
|
|
60
|
-
ACC_RUNNER_ID: opts.runnerId,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
async function buildEntry(opts, which) {
|
|
64
|
-
const globalBin = await which(ACC_MCP_BIN);
|
|
65
|
-
if (globalBin) {
|
|
66
|
-
return {
|
|
67
|
-
command: globalBin,
|
|
68
|
-
args: [
|
|
69
|
-
"--task-id",
|
|
70
|
-
opts.taskId,
|
|
71
|
-
"--runner-id",
|
|
72
|
-
opts.runnerId,
|
|
73
|
-
"--access-token",
|
|
74
|
-
opts.accessToken,
|
|
75
|
-
"--public-url",
|
|
76
|
-
opts.publicUrl,
|
|
77
|
-
],
|
|
78
|
-
env: buildEnvBlock(opts),
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
return {
|
|
82
|
-
command: "npx",
|
|
83
|
-
args: [
|
|
84
|
-
"-y",
|
|
85
|
-
ACC_MCP_PACKAGE,
|
|
86
|
-
"--task-id",
|
|
87
|
-
opts.taskId,
|
|
88
|
-
"--runner-id",
|
|
89
|
-
opts.runnerId,
|
|
90
|
-
"--access-token",
|
|
91
|
-
opts.accessToken,
|
|
92
|
-
"--public-url",
|
|
93
|
-
opts.publicUrl,
|
|
94
|
-
],
|
|
95
|
-
env: buildEnvBlock(opts),
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
async function readExisting(filePath) {
|
|
99
|
-
try {
|
|
100
|
-
const text = await fs.readFile(filePath, "utf8");
|
|
101
|
-
try {
|
|
102
|
-
const parsed = JSON.parse(text);
|
|
103
|
-
return { text, parsed };
|
|
104
|
-
}
|
|
105
|
-
catch {
|
|
106
|
-
// Malformed .mcp.json — preserve verbatim and don't merge; we'll
|
|
107
|
-
// overwrite with our config and put the original back on cleanup.
|
|
108
|
-
return { text, parsed: null };
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
catch (err) {
|
|
112
|
-
if (err.code === "ENOENT") {
|
|
113
|
-
return { text: null, parsed: null };
|
|
114
|
-
}
|
|
115
|
-
throw err;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
export async function writeMcpConfig(opts, deps = {}) {
|
|
119
|
-
const filePath = path.join(opts.cwd, MCP_CONFIG_FILENAME);
|
|
120
|
-
const existing = await readExisting(filePath);
|
|
121
|
-
const which = deps.which ?? whichBinary;
|
|
122
|
-
// Build merged config. If the existing file has a parseable mcpServers
|
|
123
|
-
// block, keep the operator's other servers and slot ours in.
|
|
124
|
-
const merged = existing.parsed ?? {};
|
|
125
|
-
const servers = { ...(merged.mcpServers ?? {}) };
|
|
126
|
-
servers[ACC_MCP_KEY] = await buildEntry(opts, which);
|
|
127
|
-
merged.mcpServers = servers;
|
|
128
|
-
await fs.writeFile(filePath, `${JSON.stringify(merged, null, 2)}\n`, { mode: 0o600 });
|
|
129
|
-
return {
|
|
130
|
-
async restore() {
|
|
131
|
-
if (existing.text === null) {
|
|
132
|
-
// We created the file — remove it entirely.
|
|
133
|
-
await fs.unlink(filePath).catch(() => {
|
|
134
|
-
/* already gone */
|
|
135
|
-
});
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
// Restore the original contents byte-for-byte. If the operator
|
|
139
|
-
// edited it mid-task, those changes are lost; that's preferable
|
|
140
|
-
// to leaving our JWT on disk.
|
|
141
|
-
await fs.writeFile(filePath, existing.text, { mode: 0o600 });
|
|
142
|
-
},
|
|
143
|
-
};
|
|
144
|
-
}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CAAC,OAAO;YACX,IAAI,QAAQ,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;gBAC3B,4CAA4C;gBAC5C,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;oBACnC,kBAAkB;gBACpB,CAAC,CAAC,CAAC;gBACH,OAAO;YACT,CAAC;YACD,+DAA+D;YAC/D,gEAAgE;YAChE,8BAA8B;YAC9B,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAC/D,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/messaging.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v0.14-MESSAGING-RUNTIME-WIRE — runner-side messaging helper.
|
|
3
|
-
*
|
|
4
|
-
* Thin wrapper around the 8-arg `acc.post_agent_message` RPC (added by
|
|
5
|
-
* v0.14-MESSAGING-PROTOCOLS, migration 0116). The runner posts a message
|
|
6
|
-
* on each Claude-state transition so the bus carries real runtime
|
|
7
|
-
* traffic (planner / manager subscribe via /messages).
|
|
8
|
-
*
|
|
9
|
-
* Validation is deliberately NOT duplicated here. The RPC re-validates
|
|
10
|
-
* the protocol enum in-body (defence-in-depth) and the `agent_messages_
|
|
11
|
-
* protocol_chk` CHECK constraint stops anything bogus at the DB wall;
|
|
12
|
-
* the typed Zod schemas live in api/_lib/messaging-protocols.ts and are
|
|
13
|
-
* not reachable from the runner package (tsconfig.build.json pins
|
|
14
|
-
* rootDir to ./src/). Failures are logged to stderr and swallowed —
|
|
15
|
-
* the bus is observability, not a critical dependency of the spawn.
|
|
16
|
-
*/
|
|
17
|
-
import type { RunnerSupabaseClient } from "./supabase.js";
|
|
18
|
-
/**
|
|
19
|
-
* Claude-state transitions the runner reports on the bus. Maps loosely
|
|
20
|
-
* to the lifecycle of a spawn: setup (planning) → spawn (coding) →
|
|
21
|
-
* inspect (testing) → publish (reviewing) → PR open (done); a failure
|
|
22
|
-
* at any phase short-circuits to blocked.
|
|
23
|
-
*/
|
|
24
|
-
export type MessagingState = "planning" | "coding" | "testing" | "reviewing" | "done" | "blocked";
|
|
25
|
-
/**
|
|
26
|
-
* Subset of the v0.14 protocol enum the runner emits. handoff is
|
|
27
|
-
* possible too but only when the runner has a target_capability to
|
|
28
|
-
* point at; v0.14 does not yet route those, so the helper accepts the
|
|
29
|
-
* three the runtime actually uses today and the integration test pins.
|
|
30
|
-
*/
|
|
31
|
-
export type RunnerProtocol = "info" | "handoff" | "error_context";
|
|
32
|
-
export interface PostRunnerStateArgs {
|
|
33
|
-
task_id: string;
|
|
34
|
-
/** The runner's id (`acc.runners.id`) — sender_id on the bus row. */
|
|
35
|
-
sender_id: string;
|
|
36
|
-
state: MessagingState;
|
|
37
|
-
protocol: RunnerProtocol;
|
|
38
|
-
payload: Record<string, unknown>;
|
|
39
|
-
/**
|
|
40
|
-
* Optional override for the v0.13 `kind` column. When omitted, falls
|
|
41
|
-
* back to a state-derived value so a planner subscribing to
|
|
42
|
-
* `kind = 'blocked'` still picks the failure case up. (`kind` is the
|
|
43
|
-
* human-readable axis; `protocol` is the schema-bound axis — both
|
|
44
|
-
* land on every row.)
|
|
45
|
-
*/
|
|
46
|
-
kind?: "blocked" | "reviewing" | "info";
|
|
47
|
-
}
|
|
48
|
-
export declare function postRunnerStateMessage(sb: RunnerSupabaseClient, args: PostRunnerStateArgs): Promise<void>;
|
|
49
|
-
//# sourceMappingURL=messaging.d.ts.map
|
package/dist/messaging.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../src/messaging.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GACtB,UAAU,GACV,QAAQ,GACR,SAAS,GACT,WAAW,GACX,MAAM,GACN,SAAS,CAAC;AAEd;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,eAAe,CAAC;AAElE,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,cAAc,CAAC;IACtB,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,MAAM,CAAC;CACzC;AAkBD,wBAAsB,sBAAsB,CAC1C,EAAE,EAAE,oBAAoB,EACxB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,IAAI,CAAC,CAoBf"}
|
package/dist/messaging.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
function kindFor(state) {
|
|
2
|
-
if (state === "blocked")
|
|
3
|
-
return "blocked";
|
|
4
|
-
if (state === "reviewing")
|
|
5
|
-
return "reviewing";
|
|
6
|
-
return "info";
|
|
7
|
-
}
|
|
8
|
-
function receiverTagFor(protocol) {
|
|
9
|
-
// error_context always targets the planner so score-boost-v2 / the
|
|
10
|
-
// failure-aware rewriter can find it on `receiver_tag = 'planner'`.
|
|
11
|
-
// info / handoff are addressed by the caller via the message subject
|
|
12
|
-
// and payload — leave the tag null so it shows up in operator
|
|
13
|
-
// /messages without competing with role-scoped drains.
|
|
14
|
-
if (protocol === "error_context")
|
|
15
|
-
return "planner";
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
export async function postRunnerStateMessage(sb, args) {
|
|
19
|
-
const kind = args.kind ?? kindFor(args.state);
|
|
20
|
-
const receiver_tag = receiverTagFor(args.protocol);
|
|
21
|
-
const subject = `Runner state: ${args.state}`;
|
|
22
|
-
const { error } = await sb.rpc("post_agent_message", {
|
|
23
|
-
p_sender_kind: "runner",
|
|
24
|
-
p_sender_id: args.sender_id,
|
|
25
|
-
p_receiver_tag: receiver_tag,
|
|
26
|
-
p_kind: kind,
|
|
27
|
-
p_subject: subject,
|
|
28
|
-
p_payload: args.payload,
|
|
29
|
-
p_task_id: args.task_id,
|
|
30
|
-
p_protocol: args.protocol,
|
|
31
|
-
});
|
|
32
|
-
if (error) {
|
|
33
|
-
process.stderr.write(`[acc-runner] postRunnerStateMessage(${args.state}/${args.protocol}) failed: ${error.message}\n`);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=messaging.js.map
|
package/dist/messaging.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messaging.js","sourceRoot":"","sources":["../src/messaging.ts"],"names":[],"mappings":"AAyDA,SAAS,OAAO,CAAC,KAAqB;IACpC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,IAAI,KAAK,KAAK,WAAW;QAAE,OAAO,WAAW,CAAC;IAC9C,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,cAAc,CAAC,QAAwB;IAC9C,mEAAmE;IACnE,oEAAoE;IACpE,qEAAqE;IACrE,8DAA8D;IAC9D,uDAAuD;IACvD,IAAI,QAAQ,KAAK,eAAe;QAAE,OAAO,SAAS,CAAC;IACnD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,EAAwB,EACxB,IAAyB;IAEzB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,YAAY,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,OAAO,GAAG,iBAAiB,IAAI,CAAC,KAAK,EAAE,CAAC;IAE9C,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,oBAAoB,EAAE;QACnD,aAAa,EAAE,QAAQ;QACvB,WAAW,EAAE,IAAI,CAAC,SAAS;QAC3B,cAAc,EAAE,YAAY;QAC5B,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,OAAO;QAClB,SAAS,EAAE,IAAI,CAAC,OAAO;QACvB,SAAS,EAAE,IAAI,CAAC,OAAO;QACvB,UAAU,EAAE,IAAI,CAAC,QAAQ;KAC1B,CAAC,CAAC;IACH,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,uCAAuC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,aAAa,KAAK,CAAC,OAAO,IAAI,CACjG,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/pkg-version.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pkg-version.d.ts","sourceRoot":"","sources":["../src/pkg-version.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,eAAe,QAAc,CAAC;AAC3C,eAAO,MAAM,gBAAgB,QAAc,CAAC"}
|
package/dist/pkg-version.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The CLI's own package.json version. We use the package version (not
|
|
3
|
-
* the protocol version) because that's what an operator actually
|
|
4
|
-
* upgrades via `npm install -g @tokenfactory/acc-runner@latest`; the
|
|
5
|
-
* server stores it on each heartbeat so fleet operators can spot stale
|
|
6
|
-
* runners in the UI.
|
|
7
|
-
*
|
|
8
|
-
* v0.6.3 (REG-309): PROTOCOL_VERSION is now derived from the same
|
|
9
|
-
* package.json instead of being hand-maintained in types.ts. The two
|
|
10
|
-
* used to drift — bumping package.json forgot to bump the constant, so
|
|
11
|
-
* published artifacts reported a stale version in their User-Agent and
|
|
12
|
-
* the server-side MIN_VERSION gate would 426-reject runners that were
|
|
13
|
-
* actually on the latest. Unifying the source makes drift impossible.
|
|
14
|
-
*/
|
|
15
|
-
import { createRequire } from "node:module";
|
|
16
|
-
const require = createRequire(import.meta.url);
|
|
17
|
-
const pkg = require("../package.json");
|
|
18
|
-
export const PACKAGE_VERSION = pkg.version;
|
|
19
|
-
export const PROTOCOL_VERSION = pkg.version;
|
|
20
|
-
//# sourceMappingURL=pkg-version.js.map
|
package/dist/pkg-version.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pkg-version.js","sourceRoot":"","sources":["../src/pkg-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAwB,CAAC;AAE9D,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC,OAAO,CAAC;AAC3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Designer agent prompt prelude.
|
|
3
|
-
*
|
|
4
|
-
* v0.14-DESIGNER-AGENT is the second fleet member after DEVELOPER and
|
|
5
|
-
* the FIRST non-empty prelude in the runner-profile system. The
|
|
6
|
-
* developer profile's prelude is the empty string (byte-identical
|
|
7
|
-
* v0.13 baseline); this string is what the prelude consumer prepends
|
|
8
|
-
* to the rendered task prompt when `ACC_RUNNER_PROFILE=designer`.
|
|
9
|
-
*
|
|
10
|
-
* Shape this set for tester and manager too. Keep it role-framing +
|
|
11
|
-
* surface map + output constraints, not a re-statement of CLAUDE.md.
|
|
12
|
-
* The task prompt itself still carries the per-track owned-files list,
|
|
13
|
-
* acceptance criteria, and HALT contract — this prelude only adds the
|
|
14
|
-
* lens through which a designer-profile runner should read it.
|
|
15
|
-
*/
|
|
16
|
-
declare const DESIGNER_PROMPT_PRELUDE = "# Designer agent prelude\n\nYou are the **designer agent** for Agent Control Center (ACC). You picked\nthis task up because it carries `required_capabilities: [\"design\"]`,\nand your profile (`runner-profiles/designer.json`) declares\n`capabilities: [\"design\"]` \u2014 the dispatch router paired them via the\nPostgreSQL array-subset operator. Read the task body below in that\nlight: it is a design-shaped problem that landed on a design-shaped\nrunner.\n\nThis prelude is appended in front of the rendered task prompt every\ntime. It does not replace CLAUDE.md or PHASE_2_CLAUDE_CODE_HANDOFF.md \u2014\nread those first per the task body's \"Read first\" section. It tells\nyou the *role-specific* posture to take while reading them.\n\n## Role\n\nYou are a UI/UX/visual specialist working inside the ACC implementation\nrepo. Your job is to translate intent into design \u2014 visual specs,\ndesign tokens, accessibility patterns, copy \u2014 that downstream\ndeveloper-profile runners can implement faithfully. You are NOT the\nimplementation agent. When a task mixes design + code, your default\noutput is a spec the developer can pick up via a handoff message; you\nonly edit TS/TSX yourself when the task body explicitly says \"both\ndesign and implementation in one PR.\"\n\n## Visual contract (read-only, non-negotiable)\n\n`public/design-reference/` holds the canonical HTML prototype\n(`Agent Control Center.html`) plus screenshots, components, and\npatterns. CLAUDE.md \u00A7Visual fidelity is the rule and v0.14-DESIGNER\nre-asserts it:\n\n- **Reproduce 1:1.** When a task asks you to specify a Phase 1 surface\n (Command Center, Tasks, Drawer, Queue, Agents, Models, Runners,\n GitHub, Reports, Contracts, Settings, Decisions, Files, Graph,\n Approvals, Tweaks), the design-reference prototype wins on class\n names, inline styles, spacing, and color tokens.\n- **No new tokens without Track A.** Phase 2 surfaces without a\n Phase 1 design (Cost tab, Runner device-code screen, /settings/halts)\n must reuse the existing token system. Proposing a new token requires\n a separate Track A PR \u2014 flag it in the report, do not unilaterally\n add one.\n- **Never modify the design export.** `/Users/priya/Desktop/Agent Auto/Agent Auto/`\n and its mirror `public/design-reference/` are frozen. If they look\n wrong, file a regression in the report; do not edit.\n\n## Code-side bridge\n\n`docs/acc/DESIGN_TO_CODE_MAPPING.md` is the section-by-section map\nbetween the design export and the implementation surfaces. When a task\nnames a route or component, read the matching row first:\n\n- \"Source\" tells you which design file is canonical.\n- \"Target\" tells you which TS/TSX file an implementation agent will\n edit. **You read this; you don't write to it** unless the task is\n explicitly design+code.\n- \"Reuses\" tells you which shared primitives are already on tap. Don't\n invent a new one when one is in the row.\n- \"Mock\" tells you which seed slice feeds the surface in demo mode.\n- \"Future\" tells you what's deferred to a later phase \u2014 out of scope\n for any v0.14 design work unless the task overrides it.\n\nWhen you write a spec, cite the row by number (\"\u00A74 Task Drawer\") so\nthe implementation agent can find the same row.\n\n## Skills you should reach for\n\nACC's runner system context lists four design-adjacent skills. Use\nthem when they fit; never re-derive from scratch what a skill encodes:\n\n- **design-critique** \u2014 heuristic review of an existing surface.\n Reach for it when the task is \"is this Phase-1 surface visually\n correct?\" or \"diff this against the prototype.\"\n- **design-system** \u2014 reasoning over the existing token /\n primitive set in `public/design-reference/components/`. Reach for\n it when the task asks \"which primitive should this use?\"\n- **accessibility-review** \u2014 WCAG / keyboard / contrast checks.\n Reach for it on any new interactive component or before signing off\n on a flow.\n- **ux-copy** \u2014 microcopy, empty states, error messages, toast\n wording. Reach for it when the task involves user-facing strings.\n\nIf a skill is unavailable in the active runner host (some environments\nstrip them), say so in the report and proceed with the best\nunaided approximation. Don't fail the task over a missing skill.\n\n## Output: prefer artifacts a developer can pick up\n\nIn priority order, your edits should produce:\n\n1. **`.pen` design files** when the project uses Pencil. Use the\n pencil MCP tools (`batch_get`, `batch_design`); do NOT `Read`\n or `Grep` `.pen` content \u2014 they are encrypted on disk.\n2. **Visual specs** as Markdown under `docs/acc/specs/` when the\n task body invites a written spec. Include: section name, source\n row from DESIGN_TO_CODE_MAPPING, components touched, token list,\n acceptance criteria the developer can paste into a follow-up task.\n3. **Design tokens** under the existing token JSON (when present).\n Tokens are an export contract; never invent values, only re-use or\n extend the existing scale.\n4. **Inline annotations** on the design-reference HTML \u2014 short\n comments inside the prototype calling out where the spec deviates.\n\nYou may also post an `agent_messages` row with\n`protocol: \"handoff\"` and\n`target_capability: \"code\"` so a developer-profile runner can pick\nthe implementation work up cleanly. See\n`docs/acc/MESSAGING_PROTOCOLS.md` \u00A7handoff for the payload shape.\n\n## What you do NOT do\n\n- **Don't edit `src/`, `api/`, `packages/`, or `tests/`**\n unless the task body explicitly says \"both design and code.\"\n Touching implementation surfaces from a design-only runner produces\n a PR that fails capability provenance review.\n- **Don't write Vitest or Playwright tests.** Coverage work is the\n tester-profile runner's job (`capabilities: [\"test\"]`).\n- **Don't author SQL migrations.** Migrations are the developer\n profile's surface (`capabilities: [\"migration\"]`). If your design\n needs a backing schema, write the spec; let the implementation\n handoff include \"needs migration NNNN_<slug>.sql\" in the\n acceptance criteria.\n- **Don't redesign Phase 1 surfaces.** \"Looks better\" is not a\n warrant. File a regression with a screenshot diff instead.\n- **Don't push secrets, design exports, or large binary uploads.**\n Treat `public/design-reference/` and the source design folder as\n read-only and out-of-scope for commits.\n\n## Halt early, halt cheaply\n\nCLAUDE.md says \"when in doubt, halt.\" For design-profile tasks the\ncommon doubt-triggers are:\n\n- The task names a surface that does not appear in\n DESIGN_TO_CODE_MAPPING.md (i.e., a brand-new screen with no Phase 1\n design). Halt, ask whether to design from scratch under existing\n tokens or wait for a Track A design pass.\n- The task requires a new color, spacing unit, or typographic ramp.\n Halt, ask for a Track A token PR first.\n- The task implies redesigning a Phase 1 surface. Halt, ask whether\n the operator wants a regression file instead.\n\nHalt early in the prompt loop, not after writing 200 lines you'll have\nto throw away.\n\n## Report posture\n\nEnd with the report format from PHASE_2_CLAUDE_CODE_HANDOFF.md \u00A77\naugmented for design work: list the specs you wrote, the rows of\nDESIGN_TO_CODE_MAPPING they reference, any handoffs you posted to\n`agent_messages`, and any tokens / primitives you proposed but did\nnot add yourself. The follow-ups list should name the developer\nprofile as the next runner if implementation is needed.\n";
|
|
17
|
-
export default DESIGNER_PROMPT_PRELUDE;
|
|
18
|
-
//# sourceMappingURL=designer-prompt.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"designer-prompt.d.ts","sourceRoot":"","sources":["../../src/profiles/designer-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,uBAAuB,q7OA0J5B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|