@tablation/crew 0.149.0 → 0.149.1
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/dist/cli.js +42 -62
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -25594,6 +25594,20 @@ function routeAvatarFailures(stateDir, route2) {
|
|
|
25594
25594
|
// src/agents-sync-run.ts
|
|
25595
25595
|
import { existsSync as existsSync53, mkdirSync as mkdirSync39, readFileSync as readFileSync51, writeFileSync as writeFileSync41 } from "fs";
|
|
25596
25596
|
import { dirname as dirname31 } from "path";
|
|
25597
|
+
|
|
25598
|
+
// src/cli-output.ts
|
|
25599
|
+
function summarizeOutcomes(outcomes, describe2, isRoutine, noun, verbose) {
|
|
25600
|
+
if (verbose) return outcomes.map(describe2);
|
|
25601
|
+
const lines2 = outcomes.filter((o) => !isRoutine(o)).map(describe2);
|
|
25602
|
+
const routine = outcomes.length - lines2.length;
|
|
25603
|
+
if (routine > 0) lines2.push(`${routine} ${noun}${routine === 1 ? "" : "s"} already in sync`);
|
|
25604
|
+
return lines2;
|
|
25605
|
+
}
|
|
25606
|
+
function withFix(message, fix) {
|
|
25607
|
+
return `${message.replace(/[.\s]+$/, "")} \u2014 try: ${fix}`;
|
|
25608
|
+
}
|
|
25609
|
+
|
|
25610
|
+
// src/agents-sync-run.ts
|
|
25597
25611
|
async function runAgentsSync(target, o) {
|
|
25598
25612
|
const dryRun = o.dryRun ?? false;
|
|
25599
25613
|
const force = o.force ?? false;
|
|
@@ -25609,7 +25623,7 @@ async function runAgentsSync(target, o) {
|
|
|
25609
25623
|
personaResult = await runPersonas(true);
|
|
25610
25624
|
}
|
|
25611
25625
|
o.say(`route: ${target.route}`);
|
|
25612
|
-
for (const
|
|
25626
|
+
for (const l of summarizeOutcomes(personaResult.outcomes, describeSyncOutcome, (p) => p.action === "unchanged", "persona", o.verbose ?? false)) o.say(l);
|
|
25613
25627
|
for (const l of personaResult.crewLinks) o.say(describeCrewLink(l));
|
|
25614
25628
|
if (personaResult.releaseNote) o.say(personaResult.releaseNote);
|
|
25615
25629
|
if (personaResult.chatNote) o.say(personaResult.chatNote);
|
|
@@ -25624,7 +25638,7 @@ async function runAgentsSync(target, o) {
|
|
|
25624
25638
|
else throw e;
|
|
25625
25639
|
}
|
|
25626
25640
|
}
|
|
25627
|
-
for (const
|
|
25641
|
+
for (const l of summarizeOutcomes(skillResult?.outcomes ?? [], describeSkillSyncOutcome, (s) => s.action === "unchanged", "skill", o.verbose ?? false)) o.say(l);
|
|
25628
25642
|
for (const w of skillResult?.warnings ?? []) o.warn(`warning: ${w}`);
|
|
25629
25643
|
const avatarFailures2 = {};
|
|
25630
25644
|
if (!readOnly && !dryRun) {
|
|
@@ -26788,7 +26802,7 @@ import { dirname as dirOf2, resolve as resolvePath } from "path";
|
|
|
26788
26802
|
import { existsSync as existsSync56, readdirSync as readdirSync18, statSync as statSync17 } from "fs";
|
|
26789
26803
|
import { join as join58 } from "path";
|
|
26790
26804
|
function builtVersion() {
|
|
26791
|
-
return true ? "0.149.
|
|
26805
|
+
return true ? "0.149.1" : null;
|
|
26792
26806
|
}
|
|
26793
26807
|
var REBUILD_HINT = "rebuild with npm run build";
|
|
26794
26808
|
function newestMtime(path) {
|
|
@@ -29179,7 +29193,10 @@ if (command === "passenger-sync-daemon") {
|
|
|
29179
29193
|
}
|
|
29180
29194
|
await runBridge(stateDir, bridgeRoute, bridgeTicket);
|
|
29181
29195
|
} else {
|
|
29182
|
-
let
|
|
29196
|
+
let die = function(command2, message, fix, code = 2) {
|
|
29197
|
+
emit.error(withFix(`${command2}: ${message}`, fix));
|
|
29198
|
+
return process.exit(code);
|
|
29199
|
+
}, requireArmed = function(what) {
|
|
29183
29200
|
if (dryRun || route2.enabled) return;
|
|
29184
29201
|
process.stderr.write(
|
|
29185
29202
|
`crew: route "${route2.route}" is not enabled in ${cfg.configFile} \u2014 refusing to ${what}.
|
|
@@ -29373,7 +29390,7 @@ if (command === "passenger-sync-daemon") {
|
|
|
29373
29390
|
log: (m) => emit2.emit(m)
|
|
29374
29391
|
};
|
|
29375
29392
|
};
|
|
29376
|
-
requireArmed2 = requireArmed, parseTicketNumber2 = parseTicketNumber, routeRelayUrl2 = routeRelayUrl, previewRelayFor2 = previewRelayFor, passengerApiKeys2 = passengerApiKeys, endpointApiFor2 = endpointApiFor, periscopeEndpointDeps2 = periscopeEndpointDeps, periscopeMcpDeps2 = periscopeMcpDeps, endpointReconcileDeps2 = endpointReconcileDeps, releaseRefused2 = releaseRefused, doctorMachineId2 = doctorMachineId, baseHealth2 = baseHealth, sandboxCacheRepos2 = sandboxCacheRepos, buildSandboxCachePass2 = buildSandboxCachePass, sandboxTickDeps2 = sandboxTickDeps;
|
|
29393
|
+
die2 = die, requireArmed2 = requireArmed, parseTicketNumber2 = parseTicketNumber, routeRelayUrl2 = routeRelayUrl, previewRelayFor2 = previewRelayFor, passengerApiKeys2 = passengerApiKeys, endpointApiFor2 = endpointApiFor, periscopeEndpointDeps2 = periscopeEndpointDeps, periscopeMcpDeps2 = periscopeMcpDeps, endpointReconcileDeps2 = endpointReconcileDeps, releaseRefused2 = releaseRefused, doctorMachineId2 = doctorMachineId, baseHealth2 = baseHealth, sandboxCacheRepos2 = sandboxCacheRepos, buildSandboxCachePass2 = buildSandboxCachePass, sandboxTickDeps2 = sandboxTickDeps;
|
|
29377
29394
|
async function failDaemonStart(o) {
|
|
29378
29395
|
const failEmit = new Emitter({
|
|
29379
29396
|
route: "",
|
|
@@ -29818,8 +29835,7 @@ if (command === "passenger-sync-daemon") {
|
|
|
29818
29835
|
try {
|
|
29819
29836
|
ensureImage(image);
|
|
29820
29837
|
} catch (e) {
|
|
29821
|
-
|
|
29822
|
-
`);
|
|
29838
|
+
emit.warn(withFix(`crew install: could not pull Host Passengers image ${image}: ${e.message}`, "`crew doctor`"));
|
|
29823
29839
|
process.exitCode = 1;
|
|
29824
29840
|
}
|
|
29825
29841
|
}
|
|
@@ -31666,18 +31682,10 @@ ${f.tail.trimEnd()}
|
|
|
31666
31682
|
try {
|
|
31667
31683
|
target = findSyncRoute(cfg, positional[2]);
|
|
31668
31684
|
} catch (e) {
|
|
31669
|
-
if (e instanceof ConfigError)
|
|
31670
|
-
process.stderr.write(`crew: ${e.message}
|
|
31671
|
-
`);
|
|
31672
|
-
process.exit(2);
|
|
31673
|
-
}
|
|
31685
|
+
if (e instanceof ConfigError) die("crew agents sync", e.message, "`crew doctor`");
|
|
31674
31686
|
throw e;
|
|
31675
31687
|
}
|
|
31676
|
-
if (!target.resolved) {
|
|
31677
|
-
process.stderr.write(`crew agents sync: route "${target.route}" has no resolved ids \u2014 run \`crew connect\` first
|
|
31678
|
-
`);
|
|
31679
|
-
process.exit(2);
|
|
31680
|
-
}
|
|
31688
|
+
if (!target.resolved) die("crew agents sync", `route "${target.route}" has no resolved ids`, "`crew connect`");
|
|
31681
31689
|
let run4;
|
|
31682
31690
|
try {
|
|
31683
31691
|
run4 = await runAgentsSync(target, {
|
|
@@ -31685,17 +31693,13 @@ ${f.tail.trimEnd()}
|
|
|
31685
31693
|
stateDir: cfg.ship.stateDir,
|
|
31686
31694
|
dryRun,
|
|
31687
31695
|
force,
|
|
31696
|
+
verbose: flag("verbose"),
|
|
31688
31697
|
say: (l) => process.stdout.write(`${l}
|
|
31689
31698
|
`),
|
|
31690
|
-
warn: (l) =>
|
|
31691
|
-
`)
|
|
31699
|
+
warn: (l) => emit.warn(`crew agents sync: ${l}`)
|
|
31692
31700
|
});
|
|
31693
31701
|
} catch (e) {
|
|
31694
|
-
if (e instanceof AgentsSyncError || e instanceof SkillSyncError)
|
|
31695
|
-
process.stderr.write(`crew agents sync: ${e.message}
|
|
31696
|
-
`);
|
|
31697
|
-
process.exit(2);
|
|
31698
|
-
}
|
|
31702
|
+
if (e instanceof AgentsSyncError || e instanceof SkillSyncError) die("crew agents sync", e.message, "`crew doctor`, then `crew agents sync --verbose`");
|
|
31699
31703
|
throw e;
|
|
31700
31704
|
}
|
|
31701
31705
|
const { personaResult, skillResult } = run4;
|
|
@@ -31732,35 +31736,22 @@ ${f.tail.trimEnd()}
|
|
|
31732
31736
|
try {
|
|
31733
31737
|
target = findSyncRoute(cfg, positional[2]);
|
|
31734
31738
|
} catch (e) {
|
|
31735
|
-
if (e instanceof ConfigError)
|
|
31736
|
-
process.stderr.write(`crew: ${e.message}
|
|
31737
|
-
`);
|
|
31738
|
-
process.exit(2);
|
|
31739
|
-
}
|
|
31739
|
+
if (e instanceof ConfigError) die("crew skills sync", e.message, "`crew doctor`");
|
|
31740
31740
|
throw e;
|
|
31741
31741
|
}
|
|
31742
|
-
if (!target.resolved) {
|
|
31743
|
-
process.stderr.write(`crew skills sync: route "${target.route}" has no resolved ids \u2014 run \`crew connect\` first
|
|
31744
|
-
`);
|
|
31745
|
-
process.exit(2);
|
|
31746
|
-
}
|
|
31742
|
+
if (!target.resolved) die("crew skills sync", `route "${target.route}" has no resolved ids`, "`crew connect`");
|
|
31747
31743
|
let result;
|
|
31748
31744
|
try {
|
|
31749
31745
|
result = await syncSkills(target, { userAgent: cfg.ship.userAgent, dryRun });
|
|
31750
31746
|
} catch (e) {
|
|
31751
|
-
if (e instanceof SkillSyncError)
|
|
31752
|
-
process.stderr.write(`crew skills sync: ${e.message}
|
|
31753
|
-
`);
|
|
31754
|
-
process.exit(2);
|
|
31755
|
-
}
|
|
31747
|
+
if (e instanceof SkillSyncError) die("crew skills sync", e.message, "`crew doctor`, then `crew skills sync --verbose`");
|
|
31756
31748
|
throw e;
|
|
31757
31749
|
}
|
|
31758
31750
|
process.stdout.write(`route: ${target.route}
|
|
31759
31751
|
`);
|
|
31760
|
-
for (const
|
|
31761
|
-
`);
|
|
31762
|
-
for (const w of result.warnings) process.stderr.write(`warning: ${w}
|
|
31752
|
+
for (const l of summarizeOutcomes(result.outcomes, describeSkillSyncOutcome, (o) => o.action === "unchanged", "skill", flag("verbose"))) process.stdout.write(`${l}
|
|
31763
31753
|
`);
|
|
31754
|
+
for (const w of result.warnings) emit.warn(w);
|
|
31764
31755
|
if (!dryRun) {
|
|
31765
31756
|
const resolvedPath = resolvedPathFor(cfg.ship.stateDir, target.route);
|
|
31766
31757
|
const raw = existsSync60(resolvedPath) ? JSON.parse(readFileSync56(resolvedPath, "utf8")) : {};
|
|
@@ -33293,8 +33284,7 @@ Signed in as ${result.identity.email} \u2014 minted an API key in workspace "${r
|
|
|
33293
33284
|
const raw = positional[2] ?? positional[1];
|
|
33294
33285
|
const n = raw ? parseTicketNumber(raw) : null;
|
|
33295
33286
|
if (!n) {
|
|
33296
|
-
|
|
33297
|
-
process.exit(2);
|
|
33287
|
+
die("crew drop", "need a ticket number (326, ISSUE-326, or TABL-326)", "`crew drop 326`");
|
|
33298
33288
|
}
|
|
33299
33289
|
const num2 = Number(n);
|
|
33300
33290
|
const repos = await resolvedRepos(route2);
|
|
@@ -33419,8 +33409,7 @@ Signed in as ${result.identity.email} \u2014 minted an API key in workspace "${r
|
|
|
33419
33409
|
const rawWt = worktreeArgs?.ticket;
|
|
33420
33410
|
const nWt = rawWt ? parseTicketNumber(rawWt) : null;
|
|
33421
33411
|
if (!nWt) {
|
|
33422
|
-
|
|
33423
|
-
process.exit(2);
|
|
33412
|
+
die("crew worktree", "need a ticket number (326, ISSUE-326, or TABL-326)", "`crew worktree 326`");
|
|
33424
33413
|
}
|
|
33425
33414
|
const candidatesWt = !named && cfg.routes.length > 1 ? cfg.routes.filter((r) => r.enabled) : [route2];
|
|
33426
33415
|
let ticketWt;
|
|
@@ -33438,17 +33427,14 @@ Signed in as ${result.identity.email} \u2014 minted an API key in workspace "${r
|
|
|
33438
33427
|
}
|
|
33439
33428
|
const pickedWt = pickWorktreeRoute(Number(nWt), lookedWt);
|
|
33440
33429
|
if ("error" in pickedWt) {
|
|
33441
|
-
|
|
33442
|
-
`);
|
|
33443
|
-
process.exit(2);
|
|
33430
|
+
die("crew worktree", pickedWt.error, "`crew doctor`");
|
|
33444
33431
|
}
|
|
33445
33432
|
const routeWt = candidatesWt.find((r) => r.route === pickedWt.route) ?? route2;
|
|
33446
33433
|
ticketWt = hitsWt.get(pickedWt.route);
|
|
33447
33434
|
if (!ticketWt) process.exit(2);
|
|
33448
33435
|
const repoWt = (await resolvedRepos(routeWt)).find((r) => r.id === ticketWt.repo_id) ?? (await resolvedRepos(routeWt))[0];
|
|
33449
33436
|
if (!repoWt) {
|
|
33450
|
-
|
|
33451
|
-
process.exit(2);
|
|
33437
|
+
die("crew worktree", "this route has no repository", "`crew repos add`");
|
|
33452
33438
|
}
|
|
33453
33439
|
const roleWt = positional.find((p) => p === "dev" || p === "design" || p === "qa");
|
|
33454
33440
|
let resumeWt = false;
|
|
@@ -33951,8 +33937,7 @@ ${where.join("\n")}`);
|
|
|
33951
33937
|
const rawUnassign = positional[2] ?? positional[1];
|
|
33952
33938
|
const n = rawUnassign ? parseTicketNumber(rawUnassign) : null;
|
|
33953
33939
|
if (!n) {
|
|
33954
|
-
|
|
33955
|
-
process.exit(2);
|
|
33940
|
+
die("crew unassign", "need a ticket number (326, ISSUE-326, or TABL-326)", "`crew unassign 326`");
|
|
33956
33941
|
}
|
|
33957
33942
|
const tracker3 = new Tracker(route2, cfg.ship);
|
|
33958
33943
|
const c = tracker3.contract;
|
|
@@ -34406,9 +34391,7 @@ ${where.join("\n")}`);
|
|
|
34406
34391
|
process.exit(2);
|
|
34407
34392
|
}
|
|
34408
34393
|
if (!route2.resolved) {
|
|
34409
|
-
|
|
34410
|
-
`);
|
|
34411
|
-
process.exit(2);
|
|
34394
|
+
die("crew selftest", `route ${route2.route} is not connected`, "`crew connect`");
|
|
34412
34395
|
}
|
|
34413
34396
|
const seatKey = await resolveSeatKey(route2, "dev");
|
|
34414
34397
|
const keychainDown = seatKey.kind === "ship" && /keychain/i.test(seatKey.reason);
|
|
@@ -34462,9 +34445,7 @@ ${where.join("\n")}`);
|
|
|
34462
34445
|
const only = value("route") ?? positional[1];
|
|
34463
34446
|
const wanted = only ? cfg.routes.filter((r) => r.route === only) : cfg.routes;
|
|
34464
34447
|
if (only && wanted.length === 0) {
|
|
34465
|
-
|
|
34466
|
-
`);
|
|
34467
|
-
process.exit(2);
|
|
34448
|
+
die("crew whoami", `no route "${only}" (have: ${cfg.routes.map((r) => r.route).join(", ")})`, "`crew status`");
|
|
34468
34449
|
}
|
|
34469
34450
|
const report = await buildWhoami(wanted, {
|
|
34470
34451
|
userAgent: cfg.ship.userAgent,
|
|
@@ -34479,9 +34460,7 @@ ${where.join("\n")}`);
|
|
|
34479
34460
|
const only = value("route") ?? positional[1];
|
|
34480
34461
|
const wanted = only ? cfg.routes.filter((r) => r.route === only) : cfg.routes;
|
|
34481
34462
|
if (only && wanted.length === 0) {
|
|
34482
|
-
|
|
34483
|
-
`);
|
|
34484
|
-
process.exit(2);
|
|
34463
|
+
die("crew projects", `no route "${only}" (have: ${cfg.routes.map((r) => r.route).join(", ")})`, "`crew status`");
|
|
34485
34464
|
}
|
|
34486
34465
|
const report = await buildProjectsReport(
|
|
34487
34466
|
wanted.map((r) => ({ route: r.route, areaId: r.resolved?.areaId })),
|
|
@@ -35519,6 +35498,7 @@ ${foreign.join("\n")}
|
|
|
35519
35498
|
}
|
|
35520
35499
|
lock?.release();
|
|
35521
35500
|
}
|
|
35501
|
+
var die2;
|
|
35522
35502
|
var requireArmed2;
|
|
35523
35503
|
var parseTicketNumber2;
|
|
35524
35504
|
var routeRelayUrl2;
|
package/package.json
CHANGED