@tablation/crew 0.152.3 → 0.152.4
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 +10 -7
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -25364,8 +25364,11 @@ async function listWorkspaces(o) {
|
|
|
25364
25364
|
return res.workspaces.map((w) => ({ slug: w.path ?? w.slug, name: w.name, role: w.role }));
|
|
25365
25365
|
}
|
|
25366
25366
|
var eq = (a, b) => (a ?? "").trim().toLowerCase() === b.trim().toLowerCase();
|
|
25367
|
-
function seatFor(rows, role) {
|
|
25368
|
-
const
|
|
25367
|
+
function seatFor(rows, role, agentId) {
|
|
25368
|
+
const linked = agentId ? rows.find((x) => x.agent_id === agentId) : void 0;
|
|
25369
|
+
if (linked) return linked.id;
|
|
25370
|
+
const byName = (x) => (x.name ?? "").toLowerCase().includes(role.toLowerCase());
|
|
25371
|
+
const r = rows.find((x) => !x.agent_id && byName(x)) ?? rows.find(byName);
|
|
25369
25372
|
return r?.id;
|
|
25370
25373
|
}
|
|
25371
25374
|
var REQUIRED_TABLES = ["Issues"];
|
|
@@ -25642,7 +25645,7 @@ async function discover(o) {
|
|
|
25642
25645
|
}
|
|
25643
25646
|
}
|
|
25644
25647
|
let agentIdFor = () => void 0;
|
|
25645
|
-
if (shipRowId) {
|
|
25648
|
+
if (shipRowId || o.ship) {
|
|
25646
25649
|
try {
|
|
25647
25650
|
const agentsModel = await get(o, `/data-models/agents?workspaceId=${ws.id}`);
|
|
25648
25651
|
const agentRows = await get(
|
|
@@ -25675,16 +25678,16 @@ async function discover(o) {
|
|
|
25675
25678
|
const unclaimed = seatShipId ? rows.filter((r) => !r.ship_id) : [];
|
|
25676
25679
|
for (const role of ["dev", "design", "qa", "triage"]) {
|
|
25677
25680
|
const searchTerm = role === "dev" ? "develop" : role;
|
|
25678
|
-
let id = seatFor(scoped, searchTerm);
|
|
25681
|
+
let id = seatFor(scoped, searchTerm, agentIdFor(role));
|
|
25679
25682
|
let seatAction = "matched";
|
|
25680
25683
|
if (!id && seatShipId && !shipRowId) {
|
|
25681
|
-
const legacyId = seatFor(unclaimed, searchTerm);
|
|
25684
|
+
const legacyId = seatFor(unclaimed, searchTerm, agentIdFor(role));
|
|
25682
25685
|
if (legacyId) {
|
|
25683
25686
|
id = legacyId;
|
|
25684
25687
|
seatAction = "claimed";
|
|
25685
25688
|
}
|
|
25686
25689
|
} else if (!id && shipRowId) {
|
|
25687
|
-
const legacyId = seatFor(unclaimed, searchTerm);
|
|
25690
|
+
const legacyId = seatFor(unclaimed, searchTerm, agentIdFor(role));
|
|
25688
25691
|
if (legacyId) {
|
|
25689
25692
|
await patch(o, `/data-models/${out.models.crew}/records/${legacyId}`, { ship_id: shipRowId });
|
|
25690
25693
|
id = legacyId;
|
|
@@ -27421,7 +27424,7 @@ import { dirname as dirOf2, resolve as resolvePath } from "path";
|
|
|
27421
27424
|
import { existsSync as existsSync56, readdirSync as readdirSync18, statSync as statSync17 } from "fs";
|
|
27422
27425
|
import { join as join59 } from "path";
|
|
27423
27426
|
function builtVersion() {
|
|
27424
|
-
return true ? "0.152.
|
|
27427
|
+
return true ? "0.152.4" : null;
|
|
27425
27428
|
}
|
|
27426
27429
|
var REBUILD_HINT = "rebuild with npm run build";
|
|
27427
27430
|
function newestMtime(path) {
|
package/package.json
CHANGED