@ionivetech/mugiwara 0.6.2 → 0.6.3
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.cursor-plugin/plugin.json +1 -1
- package/.kimi-plugin/plugin.json +1 -1
- package/.opencode/commands/mugiwara-continue.md +42 -10
- package/.opencode/commands/mugiwara-execute.md +1 -1
- package/.opencode/commands/mugiwara-heal.md +1 -1
- package/.opencode/commands/mugiwara-plan.md +1 -1
- package/.opencode/commands/mugiwara-review.md +1 -1
- package/.opencode/commands/mugiwara-security.md +1 -1
- package/.opencode/commands/mugiwara-ship.md +1 -1
- package/.opencode/mugiwara-helpers.mjs +0 -1
- package/.opencode/plugins/mugiwara.mjs +27 -17
- package/AGENTS.md +16 -5
- package/README.md +66 -15
- package/content/agents/brook-healing.md +1 -1
- package/content/agents/chopper-checkpoint.md +1 -1
- package/content/agents/eval-runner.md +1 -1
- package/content/agents/franky-gates.md +1 -1
- package/content/agents/jinbe-security.md +1 -1
- package/content/agents/memory-keeper.md +1 -1
- package/content/agents/nami-planner.md +2 -2
- package/content/agents/resume-coordinator.md +11 -11
- package/content/agents/robin-reviewer.md +1 -1
- package/content/agents/sanji-quality.md +1 -1
- package/content/agents/skeptic-verifier.md +1 -1
- package/content/agents/usopp-brainstorm.md +2 -2
- package/content/agents/zoro-execution.md +2 -2
- package/content/skills/mugiwara-agent-security/SKILL.md +1 -18
- package/content/skills/mugiwara-agent-security/references/checklist.md +20 -0
- package/content/skills/mugiwara-brainstorm/SKILL.md +7 -1
- package/content/skills/mugiwara-execution/SKILL.md +2 -2
- package/content/skills/mugiwara-execution/references/resume-batching.md +4 -4
- package/content/skills/mugiwara-healing/SKILL.md +2 -37
- package/content/skills/mugiwara-healing/references/workers.md +38 -0
- package/content/skills/mugiwara-orchestration/SKILL.md +5 -5
- package/content/skills/mugiwara-orchestration/references/check-ins.md +11 -3
- package/content/skills/mugiwara-orchestration/references/triage-escalation.md +9 -12
- package/content/skills/mugiwara-planning/SKILL.md +7 -11
- package/content/skills/mugiwara-planning/references/plan-template.md +4 -4
- package/content/skills/mugiwara-pr/SKILL.md +0 -1
- package/content/skills/mugiwara-resume/SKILL.md +37 -22
- package/content/skills/mugiwara-ship/SKILL.md +1 -23
- package/content/skills/mugiwara-ship/references/cleanup.md +25 -0
- package/content/skills/mugiwara-workflow/SKILL.md +2 -2
- package/content/skills/mugiwara-workflow/references/workspace-layout.md +11 -3
- package/content/skills/using-mugiwara/SKILL.md +1 -1
- package/dist/mugiwara.js +102 -25
- package/gemini-extension.json +1 -1
- package/hooks/session-start.ts +113 -2
- package/package.json +3 -3
- package/plugin.json +1 -1
- package/references/multi-actor.md +39 -14
- package/references/skill-versioning.md +3 -3
- package/references/token-budget.md +1 -1
- package/scripts/evidence.sh +9 -0
- package/scripts/gate-selftest.ts +123 -0
- package/scripts/lane-base.ts +114 -0
- package/scripts/lane.sh +4 -2
- package/scripts/lib/lane-base.sh +19 -0
- package/scripts/lib/patterns.sh +15 -0
- package/scripts/mission-report.sh +21 -5
- package/scripts/savepoint.sh +170 -56
- package/scripts/setup-fixtures.ts +108 -0
- package/scripts/validate-content.ts +61 -0
- package/src/cli.ts +5 -1
- package/src/installer.ts +70 -8
- package/src/mission.ts +37 -19
package/src/mission.ts
CHANGED
|
@@ -4,12 +4,23 @@ import { existsSync, rmSync, readFileSync, readdirSync, mkdirSync, appendFileSyn
|
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
|
|
6
6
|
function activeActor(projectDir: string): string | null {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
// state now lives at .mugiwara/state/<mission>/[member].json — scan the
|
|
8
|
+
// latest state file for its actor
|
|
9
|
+
const stateDir = join(projectDir, '.mugiwara', 'state');
|
|
10
|
+
if (!existsSync(stateDir)) return null;
|
|
11
|
+
const missions = readdirSync(stateDir, { withFileTypes: true }).filter(e => e.isDirectory()).map(e => e.name);
|
|
12
|
+
let latest: { actor: string; updated: number } | null = null;
|
|
13
|
+
for (const mission of missions) {
|
|
14
|
+
const d = join(stateDir, mission);
|
|
15
|
+
for (const f of readdirSync(d).filter(f => f.endsWith('.json'))) {
|
|
16
|
+
try {
|
|
17
|
+
const s = JSON.parse(readFileSync(join(d, f), 'utf8'));
|
|
18
|
+
const t = Date.parse(s.updated_at || '') || 0;
|
|
19
|
+
if (!latest || t > latest.updated) latest = { actor: s.actor || null, updated: t };
|
|
20
|
+
} catch { /* corrupt — skip */ }
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return latest ? latest.actor : null;
|
|
13
24
|
}
|
|
14
25
|
|
|
15
26
|
export function resetMission(projectDir: string, keepLogs: boolean, force?: boolean): { removed: string[]; kept: string[]; blocked?: string } {
|
|
@@ -30,7 +41,12 @@ export function resetMission(projectDir: string, keepLogs: boolean, force?: bool
|
|
|
30
41
|
const p = join(root, dir);
|
|
31
42
|
if (existsSync(p)) { rmSync(p, { recursive: true, force: true }); removed.push(dir); }
|
|
32
43
|
}
|
|
33
|
-
// mission state
|
|
44
|
+
// mission state + continue folders — state/<mission>/, continue/<mission>/
|
|
45
|
+
for (const dir of ['state', 'continue']) {
|
|
46
|
+
const p = join(root, dir);
|
|
47
|
+
if (existsSync(p)) { rmSync(p, { recursive: true, force: true }); removed.push(dir); }
|
|
48
|
+
}
|
|
49
|
+
// legacy flat state files — state.json + branch-specific state-*.json
|
|
34
50
|
for (const f of readdirSync(root)) {
|
|
35
51
|
if (/^state(-.+)?\.json$/.test(f)) {
|
|
36
52
|
const p = join(root, f);
|
|
@@ -81,7 +97,8 @@ export function archiveMission(projectDir: string, mission: string, opts: { dryR
|
|
|
81
97
|
}
|
|
82
98
|
|
|
83
99
|
// step results 01..05 + todos.md are evidence — kept; archive removes
|
|
84
|
-
//
|
|
100
|
+
// step results 01..05 + todos.md are evidence — kept; archive removes
|
|
101
|
+
// only spec/review/issues/logs + continue/<mission>/ + state/<mission>/
|
|
85
102
|
const resultsDir = join(root, 'results', mission);
|
|
86
103
|
if (existsSync(resultsDir)) {
|
|
87
104
|
for (const f of readdirSync(resultsDir)) {
|
|
@@ -121,21 +138,22 @@ export function archiveMission(projectDir: string, mission: string, opts: { dryR
|
|
|
121
138
|
}
|
|
122
139
|
}
|
|
123
140
|
|
|
124
|
-
// continue
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
141
|
+
// continue/<mission>/ is a session handoff — remove this mission's folder
|
|
142
|
+
const contDir = join(root, 'continue', mission);
|
|
143
|
+
if (existsSync(contDir)) {
|
|
144
|
+
if (!dryRun) rmSync(contDir, { recursive: true, force: true });
|
|
145
|
+
removed.push(join('continue', mission));
|
|
146
|
+
}
|
|
147
|
+
// state/<mission>/ — remove this mission's computed state (archived)
|
|
148
|
+
const stateDir = join(root, 'state', mission);
|
|
149
|
+
if (existsSync(stateDir)) {
|
|
150
|
+
if (!dryRun) rmSync(stateDir, { recursive: true, force: true });
|
|
151
|
+
removed.push(join('state', mission));
|
|
134
152
|
}
|
|
135
153
|
|
|
136
154
|
// kept: report + the audit-trail survivors
|
|
137
155
|
if (report) kept.push(report);
|
|
138
|
-
for (const k of ['plans', 'config',
|
|
156
|
+
for (const k of ['plans', 'config', join('logs', 'lessons.md')]) {
|
|
139
157
|
if (existsSync(join(root, k))) kept.push(k);
|
|
140
158
|
}
|
|
141
159
|
|