@automagik/genie 4.260504.13 → 4.260504.14
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/genie.js
CHANGED
|
@@ -550,7 +550,7 @@ ${bin} set-option -w pane-active-border-style "fg=$COLOR"
|
|
|
550
550
|
${a.repoPath??null}, ${null},
|
|
551
551
|
${a.startedAt??new Date().toISOString()}
|
|
552
552
|
) ON CONFLICT (id) DO NOTHING
|
|
553
|
-
`,await sql`UPDATE agents SET current_executor_id = ${executorId} WHERE id = ${a.id} AND current_executor_id IS NULL`}async function seedWorkers(sql){let filePath=workersJsonPath();if(!needsMigration(filePath))return{agents:0,templates:0};let data=await readJson(filePath);if(!data)return{agents:0,templates:0};let agentCount=0;for(let agent of Object.values(data.workers??{})){if(!agent.id)continue;await upsertAgent(sql,agent),await upsertExecutorFromAgent(sql,agent),agentCount++}let templateCount=0;for(let tpl of Object.values(data.templates??{})){if(!tpl.id)continue;await upsertTemplate(sql,tpl),templateCount++}return{agents:agentCount,templates:templateCount}}function deriveLeader(cfg){if(!cfg.leadAgentId)return null;let at=cfg.leadAgentId.indexOf("@");return at===-1?cfg.leadAgentId:cfg.leadAgentId.slice(0,at)}function isValidTeamMember(s){return MEMBER_UUID_RE.test(s)||s.startsWith("dir:")}async function upsertNativeTeam(sql,c){let rawMemberNames=(c.members??[]).map((m)=>m.name).filter((n)=>typeof n==="string"&&n.length>0),memberNames=rawMemberNames.filter(isValidTeamMember),dropped=rawMemberNames.length-memberNames.length;if(dropped>0&&process.env.DEBUG?.includes("pg-seed"))console.warn(`[pg-seed] team "${c.name}": dropped ${dropped} legacy member name(s) failing migration 061 constraint (UUID or dir: prefix required); kept ${memberNames.length}`);let rawLeader=deriveLeader(c),safeLeader=rawLeader&&isValidTeamMember(rawLeader)?rawLeader:null,leaderSanitized=rawLeader!==null&&safeLeader===null
|
|
553
|
+
`,await sql`UPDATE agents SET current_executor_id = ${executorId} WHERE id = ${a.id} AND current_executor_id IS NULL`}async function seedWorkers(sql){let filePath=workersJsonPath();if(!needsMigration(filePath))return{agents:0,templates:0};let data=await readJson(filePath);if(!data)return{agents:0,templates:0};let agentCount=0;for(let agent of Object.values(data.workers??{})){if(!agent.id)continue;await upsertAgent(sql,agent),await upsertExecutorFromAgent(sql,agent),agentCount++}let templateCount=0;for(let tpl of Object.values(data.templates??{})){if(!tpl.id)continue;await upsertTemplate(sql,tpl),templateCount++}return{agents:agentCount,templates:templateCount}}function deriveLeader(cfg){if(!cfg.leadAgentId)return null;let at=cfg.leadAgentId.indexOf("@");return at===-1?cfg.leadAgentId:cfg.leadAgentId.slice(0,at)}function isValidTeamMember(s){return MEMBER_UUID_RE.test(s)||s.startsWith("dir:")}async function upsertNativeTeam(sql,c){let rawMemberNames=(c.members??[]).map((m)=>m.name).filter((n)=>typeof n==="string"&&n.length>0),memberNames=rawMemberNames.filter(isValidTeamMember),dropped=rawMemberNames.length-memberNames.length;if(dropped>0&&process.env.DEBUG?.includes("pg-seed"))console.warn(`[pg-seed] team "${c.name}": dropped ${dropped} legacy member name(s) failing migration 061 constraint (UUID or dir: prefix required); kept ${memberNames.length}`);let rawLeader=deriveLeader(c),safeLeader=rawLeader&&isValidTeamMember(rawLeader)?rawLeader:null,leaderSanitized=rawLeader!==null&&safeLeader===null,inserted=await sql`
|
|
554
554
|
INSERT INTO teams (
|
|
555
555
|
name, repo, base_branch, worktree_path, leader,
|
|
556
556
|
members, status, native_team_parent_session_id,
|
|
@@ -563,7 +563,8 @@ ${bin} set-option -w pane-active-border-style "fg=$COLOR"
|
|
|
563
563
|
${c.tmuxSessionName??null}, ${c.wishSlug??null},
|
|
564
564
|
${new Date(c.createdAt??Date.now()).toISOString()}
|
|
565
565
|
) ON CONFLICT (name) DO NOTHING
|
|
566
|
-
|
|
566
|
+
RETURNING name
|
|
567
|
+
`;if(leaderSanitized&&inserted.length>0)await recordAuditEvent("team",c.name,"leader_sanitized","pg-seed",{dropped:rawLeader,reason:"fk_teams_leader_check"});return{droppedMembers:dropped,leaderSanitized}}function buildSeedSummary(count,teamsWithDroppedMembers,leadersSanitized){let summary=`[pg-seed] re-seeded ${count} team${count===1?"":"s"}`,notes=[];if(teamsWithDroppedMembers>0)notes.push(`${teamsWithDroppedMembers} had legacy member names dropped`);if(leadersSanitized>0)notes.push(`${leadersSanitized} leader${leadersSanitized===1?"":"s"} sanitized`);if(notes.length>0)summary+=` (${notes.join("; ")}; set DEBUG=pg-seed for detail)`;return summary}async function seedTeams(sql){let configs=await loadAllNativeTeamConfigs(),teamNames=[],count=0,teamsWithDroppedMembers=0,leadersSanitized=0,hadFailures=!1;for(let cfg of configs){if(!cfg?.name)continue;teamNames.push(cfg.name);try{let outcome=await upsertNativeTeam(sql,cfg);if(count++,outcome.droppedMembers>0)teamsWithDroppedMembers++;if(outcome.leaderSanitized)leadersSanitized++}catch(err){hadFailures=!0;let msg=err instanceof Error?err.message:String(err);if(!process.env.DEBUG?.includes("pg-seed-quiet"))console.warn(`[pg-seed] Failed to seed team "${cfg.name}": ${msg}`)}}if(count>0)process.stderr.write(`${buildSeedSummary(count,teamsWithDroppedMembers,leadersSanitized)}
|
|
567
568
|
`);return{count,teamNames,hadFailures}}async function upsertMailboxMessage(sql,msg,repoPath,fallbackTo){await sql`
|
|
568
569
|
INSERT INTO mailbox (
|
|
569
570
|
id, from_worker, to_worker, body, repo_path,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automagik/genie",
|
|
3
|
-
"version": "4.260504.
|
|
3
|
+
"version": "4.260504.14",
|
|
4
4
|
"description": "Collaborative terminal toolkit for human + AI workflows. NOTE: the npm distribution is being soft-deprecated — the canonical install is `curl -fsSL https://get.automagik.dev/genie | bash` (cosign + SLSA verified). See https://automagik.dev/genie/security/distribution-sovereignty",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "genie",
|
|
3
|
-
"version": "4.260504.
|
|
3
|
+
"version": "4.260504.14",
|
|
4
4
|
"description": "Human-AI partnership for Claude Code. Share a terminal, orchestrate workers, evolve together. Brainstorm ideas, turn them into wishes, execute with /work, validate with /review, and ship as one team.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Namastex Labs"
|