(snapshot)
| 35 | } |
| 36 | |
| 37 | function routeAction(snapshot) { |
| 38 | const needsReviewPackage = snapshot.campaigns.find((campaign) => campaign.status === 'needs-review-package'); |
| 39 | if (needsReviewPackage) { |
| 40 | return { |
| 41 | kind: 'local-command', |
| 42 | label: `Package ${needsReviewPackage.slug} for review`, |
| 43 | command: `node scripts/package-delivery.js ${needsReviewPackage.slug}`, |
| 44 | args: [path.join(__dirname, 'package-delivery.js'), needsReviewPackage.slug], |
| 45 | why: 'The campaign is ready for review packaging, but review-package evidence is not resolved yet.', |
| 46 | runbook: 'docs/CAMPAIGNS.md#repair-states', |
| 47 | }; |
| 48 | } |
| 49 | |
| 50 | const activeCampaign = snapshot.campaigns.find((campaign) => campaign.status === 'active' || campaign.status === 'needs-continue'); |
| 51 | if (activeCampaign) { |
| 52 | return { |
| 53 | kind: 'skill-route', |
| 54 | label: `Resume ${activeCampaign.slug}`, |
| 55 | command: '/archon continue', |
| 56 | why: 'An active campaign is available and should continue through Archon.', |
| 57 | runbook: 'skills/archon/SKILL.md', |
| 58 | }; |
| 59 | } |
| 60 | |
| 61 | const fleetSession = snapshot.fleetSessions.find((session) => { |
| 62 | return /^(active|needs-continue)$/i.test(String(session.status || '')); |
| 63 | }); |
| 64 | if (fleetSession) { |
| 65 | return { |
| 66 | kind: 'skill-route', |
| 67 | label: `Resume fleet session ${fleetSession.slug}`, |
| 68 | command: '/fleet continue', |
| 69 | why: 'A Fleet session is active or marked needs-continue.', |
| 70 | runbook: 'skills/fleet/SKILL.md', |
| 71 | }; |
| 72 | } |
| 73 | |
| 74 | return { |
| 75 | kind: 'none', |
| 76 | label: 'No active campaign or fleet session found', |
| 77 | command: '', |
| 78 | why: 'Nothing requires /do continue right now.', |
| 79 | runbook: 'skills/do/SKILL.md', |
| 80 | }; |
| 81 | } |
| 82 | |
| 83 | function runLocalCommand(projectRoot, action) { |
| 84 | if (action.kind !== 'local-command') { |
no outgoing calls
no test coverage detected