@tablation/crew 0.12.0 → 0.12.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.
Files changed (2) hide show
  1. package/dist/cli.js +9 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -3363,9 +3363,12 @@ function ticketHolderShipId(t, contract) {
3363
3363
  return typeof v === "string" && v ? v : null;
3364
3364
  }
3365
3365
  function heldByOtherShip(t, a) {
3366
- if (!a.myShipId) return false;
3367
3366
  const statuses = a.contract.statuses;
3368
3367
  if ([statuses.handoff, statuses.verifying].includes(t.status)) return false;
3368
+ return heldByLiveOtherShip(t, a);
3369
+ }
3370
+ function heldByLiveOtherShip(t, a) {
3371
+ if (!a.myShipId) return false;
3369
3372
  const holder = ticketHolderShipId(t, a.contract);
3370
3373
  if (!holder || holder === a.myShipId) return false;
3371
3374
  const owner = a.ships.find((s) => s.id === holder);
@@ -3421,7 +3424,7 @@ function affinityContext(i) {
3421
3424
  function withHoldCheck(affinity, i) {
3422
3425
  if (!affinity) return void 0;
3423
3426
  const a = affinityContext(i);
3424
- return a ? { ...affinity, isHeldElsewhere: (t) => heldByOtherShip(t, a) } : affinity;
3427
+ return a ? { ...affinity, isHeldElsewhere: (t) => heldByOtherShip(t, a), isLiveHoldElsewhere: (t) => heldByLiveOtherShip(t, a) } : affinity;
3425
3428
  }
3426
3429
  function notHeldByOtherShip(slice, i) {
3427
3430
  if (!i.ships) return slice;
@@ -4502,7 +4505,7 @@ async function stampResumption(tracker, t, affinity) {
4502
4505
  } catch {
4503
4506
  return { outcome: "unknown" };
4504
4507
  }
4505
- if (affinity.isHeldElsewhere?.(current)) return { outcome: "held" };
4508
+ if ((affinity.isLiveHoldElsewhere ?? affinity.isHeldElsewhere)?.(current)) return { outcome: "held" };
4506
4509
  if (current[affinity.column] === affinity.shipId) return { outcome: "stamped", ticket: current };
4507
4510
  }
4508
4511
  return { outcome: "unknown" };
@@ -4521,6 +4524,9 @@ async function resolveTopCandidate(tracker, candidates, seat, approvedStatus, bu
4521
4524
  continue;
4522
4525
  }
4523
4526
  if (t.status !== approvedStatus) {
4527
+ if (affinity?.isLiveHoldElsewhere?.(t)) {
4528
+ return { ticket: t, claimed: false, contended, unservable, held, reaccepted: false };
4529
+ }
4524
4530
  if (affinity && t[affinity.column] !== affinity.shipId) {
4525
4531
  const stamp = await stampResumption(tracker, t, affinity);
4526
4532
  if (stamp.outcome === "stamped") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tablation/crew",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
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",