muse-crew 0.4.7 → 0.5.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/docs/guide.md CHANGED
@@ -57,7 +57,7 @@ Required arguments:
57
57
  Optional arguments:
58
58
  - `dashboardName` — display name for the project registration (default: `"Muse Crew"`).
59
59
  - `cronId` — polling cron identifier (default: `"crew-poll"`).
60
- - `sweepCronId` — orphan sweep cron identifier (default: `"crew-sweep"`).
60
+ - `sweepCronId` — orphan sweep cron identifier (default: `"crew-orphan-sweep"`).
61
61
 
62
62
  ### What init creates
63
63
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muse-crew",
3
- "version": "0.4.7",
3
+ "version": "0.5.0",
4
4
  "description": "Opinionated orchestration for Muse \u2014 workflows, identities, and tooling for autonomous software development.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
package/seed/AGENTS.md CHANGED
@@ -3,6 +3,7 @@
3
3
  Init source data. Everything `crew-init.js` reads when setting up a new crew instance on a Muse account.
4
4
 
5
5
  - `cron-body-template.md` — template for creating the dispatch cron job
6
+ - `cron-sweep-body-template.md` — template for creating the orphan-sweep cron job
6
7
  - `posture.md` — PM posture that shapes the user's assistant for crew interaction
7
8
  - `feedback/` — feedback feature placeholder
8
9
  - `workflows/` — human-readable workflow definitions, copied to `$CREW_HOME/.orchestration/workflows/` during init
@@ -0,0 +1,11 @@
1
+ ## Muse Crew Orphan Sweep
2
+
3
+ 1. Call artifact_invoke_action on slug "{dashboardSlug}", action "getdispatchstate", args {}.
4
+ 2. From the response, extract the `id` field of each `ready_tasks` entry whose
5
+ latest_session.status is "running", verbatim — copy the full ID exactly
6
+ as it appears; do not shorten, truncate, or reformat it. Return them as a
7
+ JSON array of strings. Do NOT reproduce any other part of the response.
8
+ (Sessions older than 1h are already reclassified as timed_out by the dashboard — no extra math.)
9
+ 3. Run: CREW_ACTIVE_TASKS="<space-separated ids>" {crewHome}/lib/orphan-sweep.sh clean
10
+ If the list is empty, pass an empty string — do NOT omit the variable (the sweep fails closed without it).
11
+ 4. Report the output. If it says CLEAN, no action was needed.
@@ -17,7 +17,7 @@ const crewHome = inputs.crewHome;
17
17
  const dashboardSlug = inputs.dashboardSlug;
18
18
  const dashboardName = inputs.dashboardName || "Muse Crew";
19
19
  const cronId = inputs.cronId || "crew-poll";
20
- const sweepCronId = inputs.sweepCronId || "crew-sweep";
20
+ const sweepCronId = inputs.sweepCronId || "crew-orphan-sweep";
21
21
 
22
22
  if (!crewRepoPath) throw new Error("crewRepoPath is required — path to muse-crew (git checkout or npm install)");
23
23
  if (!crewHome) throw new Error("crewHome is required — e.g. ~/.crew");
@@ -198,35 +198,30 @@ phase("sweep-cron");
198
198
  var sweepResult;
199
199
  try {
200
200
  sweepResult = await agent(
201
- "Check if the sweep cron exists and create it if not.\n\n" +
201
+ "Check if the orphan sweep cron exists and create it if not.\n\n" +
202
202
  "Cron id: " + sweepCronId + "\n" +
203
+ "Template: " + crewRepoPath + "/seed/cron-sweep-body-template.md\n" +
203
204
  "crewHome: " + crewHome + "\n" +
204
205
  "Dashboard slug: " + dashboardSlug + "\n\n" +
205
206
  "Steps:\n" +
206
207
  "1. Call cron_list and look for a job with id '" + sweepCronId + "'\n" +
207
- "2. If it exists, return { existed: true }\n" +
208
- "3. If not found, call cron_add with:\n" +
209
- " - id: '" + sweepCronId + "'\n" +
210
- " - title: 'Muse Crew orphan sweep'\n" +
211
- " - enabled: true\n" +
212
- " - mode: 'task'\n" +
213
- " - schedule: { kind: 'interval', every: '30m' }\n" +
214
- " - owner: 'space:" + dashboardSlug + "'\n" +
215
- " - timeout_secs: 120\n" +
216
- " - body: the body text below\n" +
217
- " Return { existed: false }\n\n" +
218
- "Body text for the cron:\n" +
219
- "---\n" +
220
- "## Muse Crew Orphan Sweep\n\n" +
221
- "1. Call artifact_invoke_action on slug \"" + dashboardSlug + "\", action \"getdispatchstate\", args {}.\n" +
222
- "2. From the response, extract the `id` field of each `ready_tasks` entry whose\n" +
223
- " latest_session.status is \"running\", verbatim copy the full ID exactly\n" +
224
- " as it appears; do not shorten, truncate, or reformat it. Return them as a\n" +
225
- " JSON array of strings. Do NOT reproduce any other part of the response.\n" +
226
- "3. Run: CREW_ACTIVE_TASKS=\"<space-separated ids>\" " + crewHome + "/lib/orphan-sweep.sh clean\n" +
227
- " If the list is empty, pass an empty string — do NOT omit the variable (the sweep fails closed without it).\n" +
228
- "4. Report the output. If it says CLEAN, no action was needed.\n" +
229
- "---\n\n" +
208
+ "2. If it exists, return { existed: true } WITHOUT touching it — adopt means\n" +
209
+ " adopt: do not enable it, rewrite its body, or change its schedule.\n" +
210
+ "3. If not found:\n" +
211
+ " a. Read the template at " + crewRepoPath + "/seed/cron-sweep-body-template.md\n" +
212
+ " b. Replace all occurrences of {crewHome} with: " + crewHome + "\n" +
213
+ " Replace all occurrences of {dashboardSlug} with: " + dashboardSlug + "\n" +
214
+ " c. Call cron_add with:\n" +
215
+ " - id: '" + sweepCronId + "'\n" +
216
+ " - title: 'Muse Crew orphan sweep'\n" +
217
+ " - enabled: false (deliberate holding state — the sweep stays disabled\n" +
218
+ " until explicitly enabled by a human; never resurrect it enabled)\n" +
219
+ " - mode: 'task'\n" +
220
+ " - schedule: { kind: 'interval', every: '30m' }\n" +
221
+ " - owner: 'space:" + dashboardSlug + "'\n" +
222
+ " - timeout_secs: 120\n" +
223
+ " - body: the processed template text\n" +
224
+ " d. Return { existed: false }\n\n" +
230
225
  "Return JSON with existed (boolean).",
231
226
  {
232
227
  key: "sweep-cron-1",