@tablation/crew 0.162.0 → 0.163.0
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 +25 -22
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -9094,9 +9094,10 @@ function f(table2, name, contractPath, defaultColumn, kind, label, whatBreaks, e
|
|
|
9094
9094
|
return { role: `${table2}.${name}`, table: table2, contractPath, defaultColumn, kind, label, whatBreaks, ...extra };
|
|
9095
9095
|
}
|
|
9096
9096
|
var opt = { optional: true };
|
|
9097
|
+
var readOnly = { computed: "either" };
|
|
9097
9098
|
var FIELD_ENTRIES = [
|
|
9098
|
-
f("issues", "key", "columns.key", "issue_id", "any", "Ticket key", "Without it tickets cannot be named in branches, comments or logs."),
|
|
9099
|
-
f("issues", "tag", "columns.tag", "issue_tag", "any", "Per-project ticket tag", "Without it branches fall back to plain `issue-<number>` names.", opt),
|
|
9099
|
+
f("issues", "key", "columns.key", "issue_id", "any", "Ticket key", "Without it tickets cannot be named in branches, comments or logs.", readOnly),
|
|
9100
|
+
f("issues", "tag", "columns.tag", "issue_tag", "any", "Per-project ticket tag", "Without it branches fall back to plain `issue-<number>` names.", { ...opt, ...readOnly }),
|
|
9100
9101
|
f("issues", "title", "columns.title", "title", "text", "Title", "Without it crew cannot show or file a ticket."),
|
|
9101
9102
|
f("issues", "status", "columns.status", "status", "choice", "Status", "Without it crew cannot tell which tickets to work."),
|
|
9102
9103
|
f("issues", "assignee", "columns.assignee", "assignee_id", "link", "Assignee", "Without it crew cannot claim a ticket or see who holds one."),
|
|
@@ -9108,7 +9109,7 @@ var FIELD_ENTRIES = [
|
|
|
9108
9109
|
f("issues", "blockedBy", "columns.blockedBy", "blocked_by", "link", "Blocked by", "Without it crew cannot park a ticket behind its dependencies.", { multiple: "either" }),
|
|
9109
9110
|
f("issues", "updatedAt", "columns.updatedAt", "updated_at", "any", "Updated at", "Without it crew cannot tell what changed since the last poll.", { builtin: ["updated_at"] }),
|
|
9110
9111
|
f("issues", "needsDesign", "columns.needsDesign", "needs_design", "boolean", "Needs design", "Without it tickets cannot be split between the dev and design lanes.", opt),
|
|
9111
|
-
f("issues", "attachments", "columns.attachments", "attachments", "
|
|
9112
|
+
f("issues", "attachments", "columns.attachments", "attachments", "file", "Attachments", "Without it a seat cannot open a ticket\u2019s screenshots.", { ...opt, multiple: "either" }),
|
|
9112
9113
|
f("issues", "reportType", "columns.reportType", "report_type", "choice", "Report type", "Without it questions, investigations and coordinating tickets are treated as builds.", opt),
|
|
9113
9114
|
f("issues", "epic", "columns.epic", "epic_id", "link", "Epic", "Without it tickets cannot belong to an epic.", opt),
|
|
9114
9115
|
f("issues", "author", "columns.author", "filed_by_id", "link", "Filed by", "Without it a filed ticket does not name its filer.", opt),
|
|
@@ -9165,13 +9166,13 @@ var FIELD_ENTRIES = [
|
|
|
9165
9166
|
f("answers", "detail", "answers.detail", "detail", "text", "Answer detail", "Without it an answer has no full instruction to act on when chosen.", opt),
|
|
9166
9167
|
f("answers", "order", "answers.order", "position", "number", "Answer order", "Without it the answers show in the order they were created, not the order the seat intended.", opt),
|
|
9167
9168
|
f("epics", "status", "epics.statusColumn", "status", "choice", "Epic status", "Without it crew cannot keep an epic\u2019s status from its tickets.", opt),
|
|
9168
|
-
f("epics", "key", "epics.keyColumn", "epic_id", "any", "Epic key", "Without it an epic has no name in the log.", opt),
|
|
9169
|
+
f("epics", "key", "epics.keyColumn", "epic_id", "any", "Epic key", "Without it an epic has no name in the log.", { ...opt, ...readOnly }),
|
|
9169
9170
|
f("maps", "epic", "maps.epicColumn", "epic_id", "link", "Map epic", "Without it a Map cannot be matched to its epic.", opt),
|
|
9170
9171
|
f("maps", "title", "maps.titleColumn", "title", "text", "Map title", "Without it a Map has no name in a brief.", opt),
|
|
9171
9172
|
f("maps", "content", "maps.contentColumn", "content", "text", "Map content", "Without it a brief cannot carry the Map.", opt),
|
|
9172
9173
|
f("maps", "conversation", "maps.conversationColumn", "conversation", "text", "Map conversation", "Without it the interview record cannot be pointed at.", opt),
|
|
9173
9174
|
f("maps", "status", "maps.statusColumn", "status", "choice", "Map status", "Without it the active Map cannot be told from a draft.", opt),
|
|
9174
|
-
f("maps", "version", "maps.versionColumn", "version", "any", "Map version", "Without it a brief cannot name the Map\u2019s version.", opt)
|
|
9175
|
+
f("maps", "version", "maps.versionColumn", "version", "any", "Map version", "Without it a brief cannot name the Map\u2019s version.", { ...opt, ...readOnly })
|
|
9175
9176
|
];
|
|
9176
9177
|
var STATUS_MEANINGS = [
|
|
9177
9178
|
{ id: "new", label: "New", defaultValue: "new", open: true, resolved: false, meaning: "Filed, not yet approved by a person." },
|
|
@@ -9285,7 +9286,9 @@ function describeShape(roleId) {
|
|
|
9285
9286
|
if (t) return "a table";
|
|
9286
9287
|
const e = FIELD_ENTRIES.find((x) => x.role === roleId);
|
|
9287
9288
|
if (!e) return "unknown role";
|
|
9288
|
-
const
|
|
9289
|
+
const several = e.multiple === "either" ? " (one or several)" : "";
|
|
9290
|
+
const base = e.kind === "any" ? "any column" : e.kind === "link" || e.kind === "file" ? `a ${e.kind}${several} field` : `a ${e.kind} field`;
|
|
9291
|
+
const kind = e.computed === "either" ? `${base}, plain or computed` : base;
|
|
9289
9292
|
return `${kind} on the ${e.table} table${e.optional ? " (optional)" : ""}`;
|
|
9290
9293
|
}
|
|
9291
9294
|
function describeDifferences(unmet) {
|
|
@@ -13669,13 +13672,13 @@ async function syncPersonas(route2, opts) {
|
|
|
13669
13672
|
...opts.readOnly ? { readOnly: true } : {}
|
|
13670
13673
|
};
|
|
13671
13674
|
}
|
|
13672
|
-
async function linkReleaseSeat(route2, client2, agentsModel, userAgent,
|
|
13675
|
+
async function linkReleaseSeat(route2, client2, agentsModel, userAgent, readOnly2) {
|
|
13673
13676
|
const seatId = route2.resolved.releaseSeat;
|
|
13674
13677
|
if (!seatId) return {};
|
|
13675
13678
|
const rows = await client2.records.list(agentsModel.id, { limit: 200 });
|
|
13676
13679
|
let agentId = rows.find((r) => r.name === RELEASE_AGENT_NAME)?.id;
|
|
13677
13680
|
if (!agentId) {
|
|
13678
|
-
if (
|
|
13681
|
+
if (readOnly2) return { note: `Release: no "${RELEASE_AGENT_NAME}" Agents row in this workspace \u2014 writes as the ship until a workspace admin runs \`crew agents sync\`` };
|
|
13679
13682
|
try {
|
|
13680
13683
|
agentId = (await client2.records.create(agentsModel.id, {
|
|
13681
13684
|
name: RELEASE_AGENT_NAME,
|
|
@@ -13714,11 +13717,11 @@ var NO_WRITE_NOTE = "this key has no write access to the Agents table";
|
|
|
13714
13717
|
var CREW_FIELD_MISSING_NOTE = "Crew table has no Agent field yet \u2014 a workspace admin's `crew agents sync` adds it";
|
|
13715
13718
|
var CrewAgentFieldMissing = class extends Error {
|
|
13716
13719
|
};
|
|
13717
|
-
async function linkCrewSeats(route2, client2, agentsModelId, agentPersonas, userAgent,
|
|
13720
|
+
async function linkCrewSeats(route2, client2, agentsModelId, agentPersonas, userAgent, readOnly2) {
|
|
13718
13721
|
const seats2 = route2.resolved.seats;
|
|
13719
13722
|
const rolesWithSeats = ROLE_NAMES.filter((role) => seats2[role] && agentPersonas[role]);
|
|
13720
13723
|
if (rolesWithSeats.length === 0) {
|
|
13721
|
-
if (
|
|
13724
|
+
if (readOnly2) return ROLE_NAMES.map((role) => ({ role, action: seats2[role] ? "no_agents_row" : "no_seat" }));
|
|
13722
13725
|
return ROLE_NAMES.map((role) => ({ role, action: seats2[role] ? "persona_diverged" : "no_seat" }));
|
|
13723
13726
|
}
|
|
13724
13727
|
const crewModelId = route2.resolved.models.crew;
|
|
@@ -13741,7 +13744,7 @@ async function linkCrewSeats(route2, client2, agentsModelId, agentPersonas, user
|
|
|
13741
13744
|
continue;
|
|
13742
13745
|
}
|
|
13743
13746
|
if (!agentId) {
|
|
13744
|
-
outcomes.push({ role, action:
|
|
13747
|
+
outcomes.push({ role, action: readOnly2 ? "no_agents_row" : "persona_diverged" });
|
|
13745
13748
|
continue;
|
|
13746
13749
|
}
|
|
13747
13750
|
const seatRow = await getSeatRow(client2, crewModelId, seatId);
|
|
@@ -27712,14 +27715,14 @@ async function runAgentsSync(target, o) {
|
|
|
27712
27715
|
const dryRun = o.dryRun ?? false;
|
|
27713
27716
|
const force = o.force ?? false;
|
|
27714
27717
|
const keyRole = target.resolved?.role ?? await fetchKeyRole(target, o.userAgent);
|
|
27715
|
-
let
|
|
27718
|
+
let readOnly2 = !isAdminRole(keyRole);
|
|
27716
27719
|
const runPersonas = (ro) => syncPersonas(target, { userAgent: o.userAgent, dryRun, force, readOnly: ro });
|
|
27717
27720
|
let personaResult;
|
|
27718
27721
|
try {
|
|
27719
|
-
personaResult = await runPersonas(
|
|
27722
|
+
personaResult = await runPersonas(readOnly2);
|
|
27720
27723
|
} catch (e) {
|
|
27721
|
-
if (
|
|
27722
|
-
|
|
27724
|
+
if (readOnly2 || !isForbidden(e)) throw e;
|
|
27725
|
+
readOnly2 = true;
|
|
27723
27726
|
personaResult = await runPersonas(true);
|
|
27724
27727
|
}
|
|
27725
27728
|
o.say(`route: ${target.route}`);
|
|
@@ -27730,18 +27733,18 @@ async function runAgentsSync(target, o) {
|
|
|
27730
27733
|
const briefs = Object.fromEntries(ROLE_NAMES.map((r) => [r, personaDefaultPrompt(target.promptsDir, r)]));
|
|
27731
27734
|
for (const w of skillMarkerWarnings(target.promptsDir, briefs)) o.warn(`warning: ${w}`);
|
|
27732
27735
|
let skillResult;
|
|
27733
|
-
if (!
|
|
27736
|
+
if (!readOnly2) {
|
|
27734
27737
|
try {
|
|
27735
27738
|
skillResult = await syncSkills(target, { userAgent: o.userAgent, dryRun, force });
|
|
27736
27739
|
} catch (e) {
|
|
27737
|
-
if (isForbidden(e))
|
|
27740
|
+
if (isForbidden(e)) readOnly2 = true;
|
|
27738
27741
|
else throw e;
|
|
27739
27742
|
}
|
|
27740
27743
|
}
|
|
27741
27744
|
for (const l of summarizeOutcomes(skillResult?.outcomes ?? [], describeSkillSyncOutcome, (s) => s.action === "unchanged", "skill", o.verbose ?? false)) o.say(l);
|
|
27742
27745
|
for (const w of skillResult?.warnings ?? []) o.warn(`warning: ${w}`);
|
|
27743
27746
|
const avatarFailures2 = {};
|
|
27744
|
-
if (!
|
|
27747
|
+
if (!readOnly2 && !dryRun) {
|
|
27745
27748
|
for (const a of await syncPersonaAvatars(target, personaResult.agentPersonas, { userAgent: o.userAgent })) {
|
|
27746
27749
|
const line = describeAvatarOutcome(a, PERSONA_NAME[a.role]);
|
|
27747
27750
|
if (a.status === "failed") {
|
|
@@ -27755,7 +27758,7 @@ async function runAgentsSync(target, o) {
|
|
|
27755
27758
|
const raw = existsSync53(resolvedPath) ? JSON.parse(readFileSync51(resolvedPath, "utf8")) : {};
|
|
27756
27759
|
raw.agentPersonas = personaResult.agentPersonas;
|
|
27757
27760
|
if (skillResult) raw.agentSkills = skillResult.agentSkills;
|
|
27758
|
-
if (!
|
|
27761
|
+
if (!readOnly2) raw.avatarSyncFailures = avatarFailures2;
|
|
27759
27762
|
if (personaResult.releaseAgentId) raw.releaseAgentId = personaResult.releaseAgentId;
|
|
27760
27763
|
mkdirSync39(dirname32(resolvedPath), { recursive: true });
|
|
27761
27764
|
writeFileSync41(resolvedPath, `${JSON.stringify(raw, null, 2)}
|
|
@@ -27765,11 +27768,11 @@ async function runAgentsSync(target, o) {
|
|
|
27765
27768
|
if (personaResult.releaseAgentId) target.resolved.releaseAgentId = personaResult.releaseAgentId;
|
|
27766
27769
|
}
|
|
27767
27770
|
}
|
|
27768
|
-
if (
|
|
27771
|
+
if (readOnly2) {
|
|
27769
27772
|
o.say("personas and skills: not synced (this key is not a workspace admin; the workspace's rows are used as they are)");
|
|
27770
27773
|
}
|
|
27771
27774
|
const diverged = personaResult.outcomes.some((p) => p.action === "diverged") || (skillResult?.outcomes.some((s) => s.action === "diverged") ?? false);
|
|
27772
|
-
return { personaResult, skillResult, readOnly, diverged };
|
|
27775
|
+
return { personaResult, skillResult, readOnly: readOnly2, diverged };
|
|
27773
27776
|
}
|
|
27774
27777
|
|
|
27775
27778
|
// src/logbook.ts
|
|
@@ -29166,7 +29169,7 @@ import { dirname as dirOf2, resolve as resolvePath } from "path";
|
|
|
29166
29169
|
import { existsSync as existsSync56, readdirSync as readdirSync18, statSync as statSync17 } from "fs";
|
|
29167
29170
|
import { join as join60 } from "path";
|
|
29168
29171
|
function builtVersion() {
|
|
29169
|
-
return true ? "0.
|
|
29172
|
+
return true ? "0.163.0" : null;
|
|
29170
29173
|
}
|
|
29171
29174
|
var REBUILD_HINT = "rebuild with npm run build";
|
|
29172
29175
|
function newestMtime(path) {
|
package/package.json
CHANGED