@tablation/crew 0.149.0 → 0.149.2
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 +73 -101
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -6624,12 +6624,13 @@ function repoPlatformUnreleasableItem(repo, detail, nowIso = (/* @__PURE__ */ ne
|
|
|
6624
6624
|
};
|
|
6625
6625
|
}
|
|
6626
6626
|
var agentLogRefusedKey = (route2) => `agent_log_refused:${route2}`;
|
|
6627
|
-
function agentLogRefusedItem(route2, role, status2, nowIso = (/* @__PURE__ */ new Date()).toISOString()) {
|
|
6627
|
+
function agentLogRefusedItem(route2, role, status2, request2, nowIso = (/* @__PURE__ */ new Date()).toISOString()) {
|
|
6628
|
+
const what = request2 ? request2.replace(/[0-9a-f]{8}-[0-9a-f-]{27}/gi, (id) => id.slice(0, 8)) : "the report";
|
|
6628
6629
|
return {
|
|
6629
6630
|
kind: "agent_log_refused",
|
|
6630
6631
|
key: agentLogRefusedKey(route2),
|
|
6631
6632
|
since: nowIso,
|
|
6632
|
-
message: `${route2}: the tracker refused
|
|
6633
|
+
message: `${route2}: the tracker refused ${what} (${status2}) for the ${role} seat \u2014 runs and ticket spend are not being recorded; update crew if a newer version exists, otherwise report this`
|
|
6633
6634
|
};
|
|
6634
6635
|
}
|
|
6635
6636
|
var workspaceAuthKey = (role) => `workspace_auth:${role}`;
|
|
@@ -11044,9 +11045,12 @@ var AgentLogHttpError = class extends Error {
|
|
|
11044
11045
|
status;
|
|
11045
11046
|
/** True when the refusal was of the Agent Log row itself (not a later cycle post): the tracker is not taking this seat's reports (CREW-2832). */
|
|
11046
11047
|
row = false;
|
|
11047
|
-
|
|
11048
|
+
/** The refused request as "METHOD /path", ids shortened, for the ship attention item (CREW-3273). */
|
|
11049
|
+
request;
|
|
11050
|
+
constructor(message, status2, request2) {
|
|
11048
11051
|
super(message);
|
|
11049
11052
|
this.status = status2;
|
|
11053
|
+
this.request = request2;
|
|
11050
11054
|
}
|
|
11051
11055
|
};
|
|
11052
11056
|
async function request(target, method, path, body) {
|
|
@@ -11060,7 +11064,7 @@ async function request(target, method, path, body) {
|
|
|
11060
11064
|
},
|
|
11061
11065
|
body: body === void 0 ? void 0 : JSON.stringify(body)
|
|
11062
11066
|
});
|
|
11063
|
-
if (!res.ok) throw new AgentLogHttpError(`${path}: ${res.status} ${res.statusText}`, res.status);
|
|
11067
|
+
if (!res.ok) throw new AgentLogHttpError(`${path}: ${res.status} ${res.statusText}`, res.status, `${method} ${path}`);
|
|
11064
11068
|
return await res.json();
|
|
11065
11069
|
}
|
|
11066
11070
|
var issueColumns = /* @__PURE__ */ new Map();
|
|
@@ -11134,7 +11138,6 @@ async function writeBeforeFirstEdit(target, rowId, b) {
|
|
|
11134
11138
|
} catch {
|
|
11135
11139
|
}
|
|
11136
11140
|
}
|
|
11137
|
-
var HANDOFF_BOUNCES_COLUMN = "handoff_bounces";
|
|
11138
11141
|
async function countAcceptanceBounces(target, issuesModelId, ticketRecordId) {
|
|
11139
11142
|
try {
|
|
11140
11143
|
const filters = encodeURIComponent(JSON.stringify([{ columnName: "event_type", operator: "EQ", value: "bounced" }]));
|
|
@@ -11150,13 +11153,7 @@ async function countAcceptanceBounces(target, issuesModelId, ticketRecordId) {
|
|
|
11150
11153
|
}
|
|
11151
11154
|
async function writeHandoffBounces(target, rowId, count) {
|
|
11152
11155
|
try {
|
|
11153
|
-
|
|
11154
|
-
target,
|
|
11155
|
-
"GET",
|
|
11156
|
-
`/data-models/agent_log?workspaceId=${encodeURIComponent(target.workspaceId)}`
|
|
11157
|
-
);
|
|
11158
|
-
if (!(await columnsOf(target, model.id)).has(HANDOFF_BOUNCES_COLUMN)) return;
|
|
11159
|
-
await request(target, "PATCH", `/data-models/${model.id}/records/${rowId}`, { [HANDOFF_BOUNCES_COLUMN]: count });
|
|
11156
|
+
await send(target, "PATCH", `/agents/log/${rowId}`, { handoffBounces: count });
|
|
11160
11157
|
} catch {
|
|
11161
11158
|
}
|
|
11162
11159
|
}
|
|
@@ -11175,14 +11172,23 @@ async function send(target, method, path, body) {
|
|
|
11175
11172
|
},
|
|
11176
11173
|
body: JSON.stringify(body)
|
|
11177
11174
|
});
|
|
11178
|
-
if (!res.ok) throw new AgentLogHttpError(`${path}: ${res.status} ${res.statusText}`, res.status);
|
|
11175
|
+
if (!res.ok) throw new AgentLogHttpError(`${path}: ${res.status} ${res.statusText}`, res.status, `${method} ${path}`);
|
|
11179
11176
|
return await res.json();
|
|
11180
11177
|
}
|
|
11181
11178
|
async function startAgentRunRow(target, s) {
|
|
11182
11179
|
if (!target.actor && !s.runId) return void 0;
|
|
11180
|
+
let workItem = {};
|
|
11181
|
+
if (target.tickets && s.ticketReference) {
|
|
11182
|
+
try {
|
|
11183
|
+
const recordId = await findTicketRecord(target, target.tickets, s.ticketReference);
|
|
11184
|
+
if (recordId) workItem = { workItemTable: target.tickets.issuesModelId, workItemRecordId: recordId };
|
|
11185
|
+
} catch {
|
|
11186
|
+
}
|
|
11187
|
+
}
|
|
11183
11188
|
const body = {
|
|
11184
11189
|
agentId: target.agentId,
|
|
11185
11190
|
ticketReference: s.ticketReference,
|
|
11191
|
+
...workItem,
|
|
11186
11192
|
startedAt: s.startedAt,
|
|
11187
11193
|
source: "client",
|
|
11188
11194
|
client: "crew",
|
|
@@ -11217,38 +11223,24 @@ async function startAgentRunRow(target, s) {
|
|
|
11217
11223
|
return void 0;
|
|
11218
11224
|
}
|
|
11219
11225
|
}
|
|
11220
|
-
function finishedRowBody(run4
|
|
11226
|
+
function finishedRowBody(run4) {
|
|
11221
11227
|
const values = {
|
|
11222
|
-
ticket_reference: run4.ticketReference,
|
|
11223
11228
|
outcome: run4.outcome,
|
|
11224
|
-
|
|
11229
|
+
finishedAt: run4.finishedAt,
|
|
11225
11230
|
model: run4.model,
|
|
11226
|
-
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
|
|
11230
|
-
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
prompt_version: run4.promptVersion,
|
|
11234
|
-
prompt_sha: run4.promptSha,
|
|
11235
|
-
harness: run4.harness,
|
|
11236
|
-
provider: run4.provider,
|
|
11237
|
-
work_item_table: workItem.workItemTable,
|
|
11238
|
-
work_item_record_id: workItem.workItemRecordId
|
|
11231
|
+
tokensIn: run4.tokensIn,
|
|
11232
|
+
tokensOut: run4.tokensOut,
|
|
11233
|
+
cacheReadTokens: run4.cacheReadTokens,
|
|
11234
|
+
cacheWriteTokens: run4.cacheWriteTokens,
|
|
11235
|
+
costUsd: run4.costUsd,
|
|
11236
|
+
numTurns: run4.numTurns,
|
|
11237
|
+
prefixTokens: run4.prefixTokens
|
|
11239
11238
|
};
|
|
11240
11239
|
return Object.fromEntries(Object.entries(values).filter(([, v]) => v !== void 0));
|
|
11241
11240
|
}
|
|
11242
11241
|
async function updateStartedRow(target, rowId, body) {
|
|
11243
11242
|
try {
|
|
11244
|
-
|
|
11245
|
-
target,
|
|
11246
|
-
"GET",
|
|
11247
|
-
`/data-models/agent_log?workspaceId=${encodeURIComponent(target.workspaceId)}`
|
|
11248
|
-
);
|
|
11249
|
-
const have = await columnsOf(target, model.id);
|
|
11250
|
-
const values = Object.fromEntries(Object.entries(body).filter(([column]) => have.has(column)));
|
|
11251
|
-
await request(target, "PATCH", `/data-models/${model.id}/records/${rowId}`, values);
|
|
11243
|
+
await send(target, "PATCH", `/agents/log/${rowId}`, body);
|
|
11252
11244
|
return true;
|
|
11253
11245
|
} catch (e) {
|
|
11254
11246
|
if (!(e instanceof AgentLogHttpError)) throw new AgentLogUnreachableError(e.message);
|
|
@@ -11439,7 +11431,7 @@ async function reportAgentRun(target, run4) {
|
|
|
11439
11431
|
const { runId, ...legacyBody } = { ...body, runId: run4.runId };
|
|
11440
11432
|
const workItem = target.tickets && ticketRecordId ? { workItemTable: target.tickets.issuesModelId, workItemRecordId: ticketRecordId } : {};
|
|
11441
11433
|
let entry;
|
|
11442
|
-
if (run4.rowId && await updateStartedRow(target, run4.rowId, finishedRowBody(run4
|
|
11434
|
+
if (run4.rowId && await updateStartedRow(target, run4.rowId, finishedRowBody(run4))) entry = { id: run4.rowId };
|
|
11443
11435
|
if (!entry) {
|
|
11444
11436
|
try {
|
|
11445
11437
|
entry = await post(target, "/agents/log", { ...body, ...runId ? { runId } : {}, ...workItem, harness: run4.harness, provider: run4.provider });
|
|
@@ -14183,7 +14175,7 @@ async function finishRun(id, obs, emit, startedAt, end, agentLogKey, hintMoved)
|
|
|
14183
14175
|
try {
|
|
14184
14176
|
await raiseShipAttention(
|
|
14185
14177
|
{ state: new State(stateDirOfStream(id.streamPath)), emit },
|
|
14186
|
-
agentLogRefusedItem(id.route, id.role, e.status)
|
|
14178
|
+
agentLogRefusedItem(id.route, id.role, e.status, e.request)
|
|
14187
14179
|
);
|
|
14188
14180
|
} catch {
|
|
14189
14181
|
}
|
|
@@ -25594,6 +25586,20 @@ function routeAvatarFailures(stateDir, route2) {
|
|
|
25594
25586
|
// src/agents-sync-run.ts
|
|
25595
25587
|
import { existsSync as existsSync53, mkdirSync as mkdirSync39, readFileSync as readFileSync51, writeFileSync as writeFileSync41 } from "fs";
|
|
25596
25588
|
import { dirname as dirname31 } from "path";
|
|
25589
|
+
|
|
25590
|
+
// src/cli-output.ts
|
|
25591
|
+
function summarizeOutcomes(outcomes, describe2, isRoutine, noun, verbose) {
|
|
25592
|
+
if (verbose) return outcomes.map(describe2);
|
|
25593
|
+
const lines2 = outcomes.filter((o) => !isRoutine(o)).map(describe2);
|
|
25594
|
+
const routine = outcomes.length - lines2.length;
|
|
25595
|
+
if (routine > 0) lines2.push(`${routine} ${noun}${routine === 1 ? "" : "s"} already in sync`);
|
|
25596
|
+
return lines2;
|
|
25597
|
+
}
|
|
25598
|
+
function withFix(message, fix) {
|
|
25599
|
+
return `${message.replace(/[.\s]+$/, "")} \u2014 try: ${fix}`;
|
|
25600
|
+
}
|
|
25601
|
+
|
|
25602
|
+
// src/agents-sync-run.ts
|
|
25597
25603
|
async function runAgentsSync(target, o) {
|
|
25598
25604
|
const dryRun = o.dryRun ?? false;
|
|
25599
25605
|
const force = o.force ?? false;
|
|
@@ -25609,7 +25615,7 @@ async function runAgentsSync(target, o) {
|
|
|
25609
25615
|
personaResult = await runPersonas(true);
|
|
25610
25616
|
}
|
|
25611
25617
|
o.say(`route: ${target.route}`);
|
|
25612
|
-
for (const
|
|
25618
|
+
for (const l of summarizeOutcomes(personaResult.outcomes, describeSyncOutcome, (p) => p.action === "unchanged", "persona", o.verbose ?? false)) o.say(l);
|
|
25613
25619
|
for (const l of personaResult.crewLinks) o.say(describeCrewLink(l));
|
|
25614
25620
|
if (personaResult.releaseNote) o.say(personaResult.releaseNote);
|
|
25615
25621
|
if (personaResult.chatNote) o.say(personaResult.chatNote);
|
|
@@ -25624,7 +25630,7 @@ async function runAgentsSync(target, o) {
|
|
|
25624
25630
|
else throw e;
|
|
25625
25631
|
}
|
|
25626
25632
|
}
|
|
25627
|
-
for (const
|
|
25633
|
+
for (const l of summarizeOutcomes(skillResult?.outcomes ?? [], describeSkillSyncOutcome, (s) => s.action === "unchanged", "skill", o.verbose ?? false)) o.say(l);
|
|
25628
25634
|
for (const w of skillResult?.warnings ?? []) o.warn(`warning: ${w}`);
|
|
25629
25635
|
const avatarFailures2 = {};
|
|
25630
25636
|
if (!readOnly && !dryRun) {
|
|
@@ -26788,7 +26794,7 @@ import { dirname as dirOf2, resolve as resolvePath } from "path";
|
|
|
26788
26794
|
import { existsSync as existsSync56, readdirSync as readdirSync18, statSync as statSync17 } from "fs";
|
|
26789
26795
|
import { join as join58 } from "path";
|
|
26790
26796
|
function builtVersion() {
|
|
26791
|
-
return true ? "0.149.
|
|
26797
|
+
return true ? "0.149.2" : null;
|
|
26792
26798
|
}
|
|
26793
26799
|
var REBUILD_HINT = "rebuild with npm run build";
|
|
26794
26800
|
function newestMtime(path) {
|
|
@@ -29179,7 +29185,10 @@ if (command === "passenger-sync-daemon") {
|
|
|
29179
29185
|
}
|
|
29180
29186
|
await runBridge(stateDir, bridgeRoute, bridgeTicket);
|
|
29181
29187
|
} else {
|
|
29182
|
-
let
|
|
29188
|
+
let die = function(command2, message, fix, code = 2) {
|
|
29189
|
+
emit.error(withFix(`${command2}: ${message}`, fix));
|
|
29190
|
+
return process.exit(code);
|
|
29191
|
+
}, requireArmed = function(what) {
|
|
29183
29192
|
if (dryRun || route2.enabled) return;
|
|
29184
29193
|
process.stderr.write(
|
|
29185
29194
|
`crew: route "${route2.route}" is not enabled in ${cfg.configFile} \u2014 refusing to ${what}.
|
|
@@ -29373,7 +29382,7 @@ if (command === "passenger-sync-daemon") {
|
|
|
29373
29382
|
log: (m) => emit2.emit(m)
|
|
29374
29383
|
};
|
|
29375
29384
|
};
|
|
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;
|
|
29385
|
+
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
29386
|
async function failDaemonStart(o) {
|
|
29378
29387
|
const failEmit = new Emitter({
|
|
29379
29388
|
route: "",
|
|
@@ -29818,8 +29827,7 @@ if (command === "passenger-sync-daemon") {
|
|
|
29818
29827
|
try {
|
|
29819
29828
|
ensureImage(image);
|
|
29820
29829
|
} catch (e) {
|
|
29821
|
-
|
|
29822
|
-
`);
|
|
29830
|
+
emit.warn(withFix(`crew install: could not pull Host Passengers image ${image}: ${e.message}`, "`crew doctor`"));
|
|
29823
29831
|
process.exitCode = 1;
|
|
29824
29832
|
}
|
|
29825
29833
|
}
|
|
@@ -31666,18 +31674,10 @@ ${f.tail.trimEnd()}
|
|
|
31666
31674
|
try {
|
|
31667
31675
|
target = findSyncRoute(cfg, positional[2]);
|
|
31668
31676
|
} catch (e) {
|
|
31669
|
-
if (e instanceof ConfigError)
|
|
31670
|
-
process.stderr.write(`crew: ${e.message}
|
|
31671
|
-
`);
|
|
31672
|
-
process.exit(2);
|
|
31673
|
-
}
|
|
31677
|
+
if (e instanceof ConfigError) die("crew agents sync", e.message, "`crew doctor`");
|
|
31674
31678
|
throw e;
|
|
31675
31679
|
}
|
|
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
|
-
}
|
|
31680
|
+
if (!target.resolved) die("crew agents sync", `route "${target.route}" has no resolved ids`, "`crew connect`");
|
|
31681
31681
|
let run4;
|
|
31682
31682
|
try {
|
|
31683
31683
|
run4 = await runAgentsSync(target, {
|
|
@@ -31685,17 +31685,13 @@ ${f.tail.trimEnd()}
|
|
|
31685
31685
|
stateDir: cfg.ship.stateDir,
|
|
31686
31686
|
dryRun,
|
|
31687
31687
|
force,
|
|
31688
|
+
verbose: flag("verbose"),
|
|
31688
31689
|
say: (l) => process.stdout.write(`${l}
|
|
31689
31690
|
`),
|
|
31690
|
-
warn: (l) =>
|
|
31691
|
-
`)
|
|
31691
|
+
warn: (l) => emit.warn(`crew agents sync: ${l}`)
|
|
31692
31692
|
});
|
|
31693
31693
|
} 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
|
-
}
|
|
31694
|
+
if (e instanceof AgentsSyncError || e instanceof SkillSyncError) die("crew agents sync", e.message, "`crew doctor`, then `crew agents sync --verbose`");
|
|
31699
31695
|
throw e;
|
|
31700
31696
|
}
|
|
31701
31697
|
const { personaResult, skillResult } = run4;
|
|
@@ -31732,35 +31728,22 @@ ${f.tail.trimEnd()}
|
|
|
31732
31728
|
try {
|
|
31733
31729
|
target = findSyncRoute(cfg, positional[2]);
|
|
31734
31730
|
} catch (e) {
|
|
31735
|
-
if (e instanceof ConfigError)
|
|
31736
|
-
process.stderr.write(`crew: ${e.message}
|
|
31737
|
-
`);
|
|
31738
|
-
process.exit(2);
|
|
31739
|
-
}
|
|
31731
|
+
if (e instanceof ConfigError) die("crew skills sync", e.message, "`crew doctor`");
|
|
31740
31732
|
throw e;
|
|
31741
31733
|
}
|
|
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
|
-
}
|
|
31734
|
+
if (!target.resolved) die("crew skills sync", `route "${target.route}" has no resolved ids`, "`crew connect`");
|
|
31747
31735
|
let result;
|
|
31748
31736
|
try {
|
|
31749
31737
|
result = await syncSkills(target, { userAgent: cfg.ship.userAgent, dryRun });
|
|
31750
31738
|
} catch (e) {
|
|
31751
|
-
if (e instanceof SkillSyncError)
|
|
31752
|
-
process.stderr.write(`crew skills sync: ${e.message}
|
|
31753
|
-
`);
|
|
31754
|
-
process.exit(2);
|
|
31755
|
-
}
|
|
31739
|
+
if (e instanceof SkillSyncError) die("crew skills sync", e.message, "`crew doctor`, then `crew skills sync --verbose`");
|
|
31756
31740
|
throw e;
|
|
31757
31741
|
}
|
|
31758
31742
|
process.stdout.write(`route: ${target.route}
|
|
31759
31743
|
`);
|
|
31760
|
-
for (const
|
|
31761
|
-
`);
|
|
31762
|
-
for (const w of result.warnings) process.stderr.write(`warning: ${w}
|
|
31744
|
+
for (const l of summarizeOutcomes(result.outcomes, describeSkillSyncOutcome, (o) => o.action === "unchanged", "skill", flag("verbose"))) process.stdout.write(`${l}
|
|
31763
31745
|
`);
|
|
31746
|
+
for (const w of result.warnings) emit.warn(w);
|
|
31764
31747
|
if (!dryRun) {
|
|
31765
31748
|
const resolvedPath = resolvedPathFor(cfg.ship.stateDir, target.route);
|
|
31766
31749
|
const raw = existsSync60(resolvedPath) ? JSON.parse(readFileSync56(resolvedPath, "utf8")) : {};
|
|
@@ -33293,8 +33276,7 @@ Signed in as ${result.identity.email} \u2014 minted an API key in workspace "${r
|
|
|
33293
33276
|
const raw = positional[2] ?? positional[1];
|
|
33294
33277
|
const n = raw ? parseTicketNumber(raw) : null;
|
|
33295
33278
|
if (!n) {
|
|
33296
|
-
|
|
33297
|
-
process.exit(2);
|
|
33279
|
+
die("crew drop", "need a ticket number (326, ISSUE-326, or TABL-326)", "`crew drop 326`");
|
|
33298
33280
|
}
|
|
33299
33281
|
const num2 = Number(n);
|
|
33300
33282
|
const repos = await resolvedRepos(route2);
|
|
@@ -33419,8 +33401,7 @@ Signed in as ${result.identity.email} \u2014 minted an API key in workspace "${r
|
|
|
33419
33401
|
const rawWt = worktreeArgs?.ticket;
|
|
33420
33402
|
const nWt = rawWt ? parseTicketNumber(rawWt) : null;
|
|
33421
33403
|
if (!nWt) {
|
|
33422
|
-
|
|
33423
|
-
process.exit(2);
|
|
33404
|
+
die("crew worktree", "need a ticket number (326, ISSUE-326, or TABL-326)", "`crew worktree 326`");
|
|
33424
33405
|
}
|
|
33425
33406
|
const candidatesWt = !named && cfg.routes.length > 1 ? cfg.routes.filter((r) => r.enabled) : [route2];
|
|
33426
33407
|
let ticketWt;
|
|
@@ -33438,17 +33419,14 @@ Signed in as ${result.identity.email} \u2014 minted an API key in workspace "${r
|
|
|
33438
33419
|
}
|
|
33439
33420
|
const pickedWt = pickWorktreeRoute(Number(nWt), lookedWt);
|
|
33440
33421
|
if ("error" in pickedWt) {
|
|
33441
|
-
|
|
33442
|
-
`);
|
|
33443
|
-
process.exit(2);
|
|
33422
|
+
die("crew worktree", pickedWt.error, "`crew doctor`");
|
|
33444
33423
|
}
|
|
33445
33424
|
const routeWt = candidatesWt.find((r) => r.route === pickedWt.route) ?? route2;
|
|
33446
33425
|
ticketWt = hitsWt.get(pickedWt.route);
|
|
33447
33426
|
if (!ticketWt) process.exit(2);
|
|
33448
33427
|
const repoWt = (await resolvedRepos(routeWt)).find((r) => r.id === ticketWt.repo_id) ?? (await resolvedRepos(routeWt))[0];
|
|
33449
33428
|
if (!repoWt) {
|
|
33450
|
-
|
|
33451
|
-
process.exit(2);
|
|
33429
|
+
die("crew worktree", "this route has no repository", "`crew repos add`");
|
|
33452
33430
|
}
|
|
33453
33431
|
const roleWt = positional.find((p) => p === "dev" || p === "design" || p === "qa");
|
|
33454
33432
|
let resumeWt = false;
|
|
@@ -33951,8 +33929,7 @@ ${where.join("\n")}`);
|
|
|
33951
33929
|
const rawUnassign = positional[2] ?? positional[1];
|
|
33952
33930
|
const n = rawUnassign ? parseTicketNumber(rawUnassign) : null;
|
|
33953
33931
|
if (!n) {
|
|
33954
|
-
|
|
33955
|
-
process.exit(2);
|
|
33932
|
+
die("crew unassign", "need a ticket number (326, ISSUE-326, or TABL-326)", "`crew unassign 326`");
|
|
33956
33933
|
}
|
|
33957
33934
|
const tracker3 = new Tracker(route2, cfg.ship);
|
|
33958
33935
|
const c = tracker3.contract;
|
|
@@ -34406,9 +34383,7 @@ ${where.join("\n")}`);
|
|
|
34406
34383
|
process.exit(2);
|
|
34407
34384
|
}
|
|
34408
34385
|
if (!route2.resolved) {
|
|
34409
|
-
|
|
34410
|
-
`);
|
|
34411
|
-
process.exit(2);
|
|
34386
|
+
die("crew selftest", `route ${route2.route} is not connected`, "`crew connect`");
|
|
34412
34387
|
}
|
|
34413
34388
|
const seatKey = await resolveSeatKey(route2, "dev");
|
|
34414
34389
|
const keychainDown = seatKey.kind === "ship" && /keychain/i.test(seatKey.reason);
|
|
@@ -34462,9 +34437,7 @@ ${where.join("\n")}`);
|
|
|
34462
34437
|
const only = value("route") ?? positional[1];
|
|
34463
34438
|
const wanted = only ? cfg.routes.filter((r) => r.route === only) : cfg.routes;
|
|
34464
34439
|
if (only && wanted.length === 0) {
|
|
34465
|
-
|
|
34466
|
-
`);
|
|
34467
|
-
process.exit(2);
|
|
34440
|
+
die("crew whoami", `no route "${only}" (have: ${cfg.routes.map((r) => r.route).join(", ")})`, "`crew status`");
|
|
34468
34441
|
}
|
|
34469
34442
|
const report = await buildWhoami(wanted, {
|
|
34470
34443
|
userAgent: cfg.ship.userAgent,
|
|
@@ -34479,9 +34452,7 @@ ${where.join("\n")}`);
|
|
|
34479
34452
|
const only = value("route") ?? positional[1];
|
|
34480
34453
|
const wanted = only ? cfg.routes.filter((r) => r.route === only) : cfg.routes;
|
|
34481
34454
|
if (only && wanted.length === 0) {
|
|
34482
|
-
|
|
34483
|
-
`);
|
|
34484
|
-
process.exit(2);
|
|
34455
|
+
die("crew projects", `no route "${only}" (have: ${cfg.routes.map((r) => r.route).join(", ")})`, "`crew status`");
|
|
34485
34456
|
}
|
|
34486
34457
|
const report = await buildProjectsReport(
|
|
34487
34458
|
wanted.map((r) => ({ route: r.route, areaId: r.resolved?.areaId })),
|
|
@@ -35519,6 +35490,7 @@ ${foreign.join("\n")}
|
|
|
35519
35490
|
}
|
|
35520
35491
|
lock?.release();
|
|
35521
35492
|
}
|
|
35493
|
+
var die2;
|
|
35522
35494
|
var requireArmed2;
|
|
35523
35495
|
var parseTicketNumber2;
|
|
35524
35496
|
var routeRelayUrl2;
|
package/package.json
CHANGED