@tablation/crew 0.163.0 → 0.163.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.
Files changed (2) hide show
  1. package/dist/cli.js +39 -27
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1352,7 +1352,7 @@ var Emitter = class _Emitter {
1352
1352
  const e = {
1353
1353
  at: this.now().toISOString(),
1354
1354
  cycle: this.cycle,
1355
- route: this.opts.route,
1355
+ route: extra.route ?? this.opts.route,
1356
1356
  step: extra.step ?? this.step,
1357
1357
  level: extra.level ?? "info",
1358
1358
  message,
@@ -14530,7 +14530,7 @@ function streamShowsAllowanceRefusal(streamPath) {
14530
14530
  }
14531
14531
  return false;
14532
14532
  }
14533
- var digestPathFor = (stateDir, routeLabel, role, runId) => join34(stateDir, `digest-${routeLabel}-${role}${runId ? `-${runId}` : ""}.md`);
14533
+ var digestPathFor = (stateDir, routeLabel2, role, runId) => join34(stateDir, `digest-${routeLabel2}-${role}${runId ? `-${runId}` : ""}.md`);
14534
14534
  function codeBridgeFor(o, harness) {
14535
14535
  if (!o.ticket) return void 0;
14536
14536
  const number = /(\d+)$/.exec(o.ticket)?.[1];
@@ -14587,9 +14587,9 @@ function planAgentRun(o) {
14587
14587
  const commonPath = join34(o.route.promptsDir, "personas", "common.md");
14588
14588
  const usesCommon = !SELF_CONTAINED_ROLES.has(o.role) && existsSync29(commonPath);
14589
14589
  const now = o.now ?? (() => Date.now());
14590
- const routeLabel = routeSlug(o.route.route);
14591
- const ownDigest = o.runId ? digestPathFor(o.stateDir, routeLabel, o.role, o.runId) : void 0;
14592
- const digestPath2 = ownDigest && existsSync29(ownDigest) ? ownDigest : digestPathFor(o.stateDir, routeLabel, o.role);
14590
+ const routeLabel2 = routeSlug(o.route.route);
14591
+ const ownDigest = o.runId ? digestPathFor(o.stateDir, routeLabel2, o.role, o.runId) : void 0;
14592
+ const digestPath2 = ownDigest && existsSync29(ownDigest) ? ownDigest : digestPathFor(o.stateDir, routeLabel2, o.role);
14593
14593
  let digest;
14594
14594
  let ageSeconds;
14595
14595
  if (existsSync29(digestPath2)) {
@@ -14621,7 +14621,7 @@ function planAgentRun(o) {
14621
14621
  });
14622
14622
  const promptSha = createHash6("sha256").update(expanded.text).digest("hex");
14623
14623
  const streamsDir = join34(o.stateDir, "streams");
14624
- const base = `${routeLabel}-${o.role}-${o.cycle}${o.runId ? `-${o.runId}` : ""}`;
14624
+ const base = `${routeLabel2}-${o.role}-${o.cycle}${o.runId ? `-${o.runId}` : ""}`;
14625
14625
  const seat = resolveSeat(o.ship, o.route, o.role, o.agentPersona ?? (o.agentModel ? { model: o.agentModel } : {}), o.repo);
14626
14626
  const { model } = seat;
14627
14627
  let toolchain = seat.toolchain;
@@ -14679,7 +14679,7 @@ function planAgentRun(o) {
14679
14679
  } : void 0;
14680
14680
  return {
14681
14681
  role: o.role,
14682
- route: routeLabel,
14682
+ route: routeLabel2,
14683
14683
  // The route's directory, which is a STARTING POINT and not the
14684
14684
  // ticket's repo: the session picks its own working directory even when
14685
14685
  // the runner already selected a ticket (`o.repo` is known then, and
@@ -19594,6 +19594,9 @@ ${waiting.map((t) => `| ${displayKey2(t)} | ${t.status} | ${blockers(t, i)} |`).
19594
19594
  // src/tracker-interface-read.ts
19595
19595
  var INTERFACE_MISMATCH_KEY = "tracker_interface";
19596
19596
  var INTERFACE_UNDECLARED_KEY = "tracker_interface_undeclared";
19597
+ var INTERFACE_OVERRIDE_KEY = `${INTERFACE_MISMATCH_KEY}_override`;
19598
+ var interfaceKey = (base, route2) => `${base}:${route2}`;
19599
+ var routeLabel = (route2) => `route ${route2}: `;
19597
19600
  function statusOf2(e) {
19598
19601
  return typeof e?.status === "number" ? e.status : void 0;
19599
19602
  }
@@ -19651,14 +19654,14 @@ function blockingMessage(state, storedMappingKey) {
19651
19654
  if (storedMappingKey !== void 0 && storedMappingKey !== mappingKey(state.mapping)) return MAPPING_CHANGED_MESSAGE;
19652
19655
  return null;
19653
19656
  }
19654
- function mismatchItem(message, nowIso = (/* @__PURE__ */ new Date()).toISOString()) {
19655
- return { kind: "tracker_interface", key: INTERFACE_MISMATCH_KEY, since: nowIso, message };
19657
+ function mismatchItem(route2, message, nowIso = (/* @__PURE__ */ new Date()).toISOString()) {
19658
+ return { kind: "tracker_interface", key: interfaceKey(INTERFACE_MISMATCH_KEY, route2), since: nowIso, message: routeLabel(route2) + message };
19656
19659
  }
19657
- function undeclaredItem(nowIso = (/* @__PURE__ */ new Date()).toISOString()) {
19658
- return { kind: "tracker_interface", key: INTERFACE_UNDECLARED_KEY, since: nowIso, message: UNDECLARED_MESSAGE };
19660
+ function undeclaredItem(route2, nowIso = (/* @__PURE__ */ new Date()).toISOString()) {
19661
+ return { kind: "tracker_interface", key: interfaceKey(INTERFACE_UNDECLARED_KEY, route2), since: nowIso, message: routeLabel(route2) + UNDECLARED_MESSAGE };
19659
19662
  }
19660
- function overrideItem(nowIso = (/* @__PURE__ */ new Date()).toISOString()) {
19661
- return { kind: "tracker_interface", key: `${INTERFACE_MISMATCH_KEY}_override`, since: nowIso, message: OVERRIDE_IGNORED_MESSAGE };
19663
+ function overrideItem(route2, nowIso = (/* @__PURE__ */ new Date()).toISOString()) {
19664
+ return { kind: "tracker_interface", key: interfaceKey(INTERFACE_OVERRIDE_KEY, route2), since: nowIso, message: routeLabel(route2) + OVERRIDE_IGNORED_MESSAGE };
19662
19665
  }
19663
19666
  function open(state, key) {
19664
19667
  return state.shipAttention().previous().find((i) => i.key === key)?.message ?? null;
@@ -19666,28 +19669,33 @@ function open(state, key) {
19666
19669
  async function checkTrackerInterface(o, deps = {}) {
19667
19670
  const r = o.route.resolved;
19668
19671
  if (!r?.projectId) return null;
19672
+ const name = o.route.route;
19673
+ const mismatchKey = interfaceKey(INTERFACE_MISMATCH_KEY, name);
19674
+ const undeclaredKey = interfaceKey(INTERFACE_UNDECLARED_KEY, name);
19675
+ const overrideKey = interfaceKey(INTERFACE_OVERRIDE_KEY, name);
19676
+ for (const legacy of [INTERFACE_MISMATCH_KEY, INTERFACE_UNDECLARED_KEY, INTERFACE_OVERRIDE_KEY]) clearShipAttention(o.state, legacy);
19669
19677
  const state = await (deps.read ?? readForRoute)(o.route, o.ship);
19670
- if (state.kind === "unreadable") return open(o.state, INTERFACE_MISMATCH_KEY);
19678
+ if (state.kind === "unreadable") return open(o.state, mismatchKey);
19671
19679
  if (state.kind === "undeclared") {
19672
- clearShipAttention(o.state, INTERFACE_MISMATCH_KEY);
19673
- clearShipAttention(o.state, `${INTERFACE_MISMATCH_KEY}_override`);
19680
+ clearShipAttention(o.state, mismatchKey);
19681
+ clearShipAttention(o.state, overrideKey);
19674
19682
  if (ALLOW_UNDECLARED_TRACKER_APPS) {
19675
- await raiseShipAttention(o, undeclaredItem());
19683
+ await raiseShipAttention(o, undeclaredItem(name));
19676
19684
  return null;
19677
19685
  }
19678
19686
  const message2 = "the app declares no work-tracker interface and this crew requires one \u2014 no ticket will be picked. Update the app\u2019s Issues template. Resumes automatically once it declares one";
19679
- await raiseShipAttention(o, mismatchItem(message2));
19687
+ await raiseShipAttention(o, mismatchItem(name, message2));
19680
19688
  return message2;
19681
19689
  }
19682
- clearShipAttention(o.state, INTERFACE_UNDECLARED_KEY);
19683
- if (o.route.contractAuthored) await raiseShipAttention(o, overrideItem());
19684
- else clearShipAttention(o.state, `${INTERFACE_MISMATCH_KEY}_override`);
19690
+ clearShipAttention(o.state, undeclaredKey);
19691
+ if (o.route.contractAuthored) await raiseShipAttention(o, overrideItem(name));
19692
+ else clearShipAttention(o.state, overrideKey);
19685
19693
  const message = blockingMessage(state, r.trackerInterface?.mappingKey);
19686
19694
  if (message) {
19687
- await raiseShipAttention(o, mismatchItem(message));
19695
+ await raiseShipAttention(o, mismatchItem(name, message));
19688
19696
  return message;
19689
19697
  }
19690
- clearShipAttention(o.state, INTERFACE_MISMATCH_KEY);
19698
+ clearShipAttention(o.state, mismatchKey);
19691
19699
  return null;
19692
19700
  }
19693
19701
  async function readForRoute(route2, ship) {
@@ -29169,7 +29177,7 @@ import { dirname as dirOf2, resolve as resolvePath } from "path";
29169
29177
  import { existsSync as existsSync56, readdirSync as readdirSync18, statSync as statSync17 } from "fs";
29170
29178
  import { join as join60 } from "path";
29171
29179
  function builtVersion() {
29172
- return true ? "0.163.0" : null;
29180
+ return true ? "0.163.2" : null;
29173
29181
  }
29174
29182
  var REBUILD_HINT = "rebuild with npm run build";
29175
29183
  function newestMtime(path) {
@@ -31658,8 +31666,11 @@ if (command === "passenger-sync-daemon") {
31658
31666
  let routineLine = function(line) {
31659
31667
  if (flag("verbose")) process.stderr.write(`${line}
31660
31668
  `);
31669
+ }, failureScope = function() {
31670
+ const given = value("route") ?? positional[1];
31671
+ return { step: command ?? "crew", route: given !== void 0 && cfg.routes.some((r) => r.route === given) ? given : "" };
31661
31672
  }, die = function(command2, message, fix, code = 2) {
31662
- emit.error(withFix(`${command2}: ${message}`, fix));
31673
+ emit.error(withFix(`${command2}: ${message}`, fix), failureScope());
31663
31674
  return process.exit(code);
31664
31675
  }, requireArmed = function(what) {
31665
31676
  if (dryRun || route2.enabled) return;
@@ -31870,7 +31881,7 @@ if (command === "passenger-sync-daemon") {
31870
31881
  }
31871
31882
  };
31872
31883
  };
31873
- routineLine2 = routineLine, die2 = die, requireArmed2 = requireArmed, parseTicketNumber2 = parseTicketNumber, routeRelayUrl2 = routeRelayUrl, previewRelayFor2 = previewRelayFor, passengerApiKeys2 = passengerApiKeys, endpointApiFor2 = endpointApiFor, periscopeEndpointDeps2 = periscopeEndpointDeps, periscopeMcpDeps2 = periscopeMcpDeps, endpointReconcileDeps2 = endpointReconcileDeps, sweepStateDir2 = sweepStateDir, releaseRefused2 = releaseRefused, doctorMachineId2 = doctorMachineId, baseHealth2 = baseHealth, sandboxCacheRepos2 = sandboxCacheRepos, buildSandboxCachePass2 = buildSandboxCachePass, sandboxTickDeps2 = sandboxTickDeps;
31884
+ routineLine2 = routineLine, failureScope2 = failureScope, die2 = die, requireArmed2 = requireArmed, parseTicketNumber2 = parseTicketNumber, routeRelayUrl2 = routeRelayUrl, previewRelayFor2 = previewRelayFor, passengerApiKeys2 = passengerApiKeys, endpointApiFor2 = endpointApiFor, periscopeEndpointDeps2 = periscopeEndpointDeps, periscopeMcpDeps2 = periscopeMcpDeps, endpointReconcileDeps2 = endpointReconcileDeps, sweepStateDir2 = sweepStateDir, releaseRefused2 = releaseRefused, doctorMachineId2 = doctorMachineId, baseHealth2 = baseHealth, sandboxCacheRepos2 = sandboxCacheRepos, buildSandboxCachePass2 = buildSandboxCachePass, sandboxTickDeps2 = sandboxTickDeps;
31874
31885
  async function failDaemonStart(o) {
31875
31886
  const failEmit = new Emitter({
31876
31887
  route: "",
@@ -35354,7 +35365,7 @@ ${found.problems.map((p) => ` - ${p}`).join("\n")}`, "fix the problems above, t
35354
35365
  const apiKeyVar = "CREW_API_KEY";
35355
35366
  if (firstRunFromFlags && agentBinSearched && !dryRun && !isManagedShipKind(value("ship-kind"))) {
35356
35367
  const msg = `no agent binary: "claude" was not found on PATH or in ${agentBinSearched.join(", ")} \u2014 pass --agent-bin /absolute/path`;
35357
- emit.error(`crew connect: ${msg}`);
35368
+ emit.error(`crew connect: ${msg}`, failureScope());
35358
35369
  stopWithProblem(msg, "wizard");
35359
35370
  }
35360
35371
  const storeLabel = () => {
@@ -38287,6 +38298,7 @@ ${foreign.map((f2) => ` ${f2.trim()}`).join("\n")}
38287
38298
  lock?.release();
38288
38299
  }
38289
38300
  var routineLine2;
38301
+ var failureScope2;
38290
38302
  var die2;
38291
38303
  var requireArmed2;
38292
38304
  var parseTicketNumber2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tablation/crew",
3
- "version": "0.163.0",
3
+ "version": "0.163.2",
4
4
  "description": "A standing team of headless agents that picks work off a Tablation board, does it on a machine you control, and reports back.",
5
5
  "type": "module",
6
6
  "license": "MIT",