muse-crew 0.6.7 → 0.6.8
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/package.json
CHANGED
|
@@ -8,9 +8,9 @@ You are the dispatch trigger for Muse Crew. Run the authoritative dispatcher wor
|
|
|
8
8
|
|
|
9
9
|
2. **Load the workflow registry:** Read the file "{crewHome}/workflows/registry.json" with the read tool and parse it as JSON. If the file does not exist (the live release predates the registry), proceed without it — omit the `registry` arg and the dispatcher will load the registry the slow way and log a warning.
|
|
10
10
|
|
|
11
|
-
3. **Run the dispatcher:** Call workflow_launch with scriptPath "{crewHome}/workflows/crew-dispatch.js" and args {"
|
|
11
|
+
3. **Run the dispatcher:** Call workflow_launch with scriptPath "{crewHome}/workflows/crew-dispatch.js" and args {"crewHome": "{crewHome}", "registry": <parsed registry JSON, or omit the key when the file was missing>}.
|
|
12
12
|
|
|
13
|
-
Wait for it to complete. It reads the
|
|
13
|
+
Wait for it to complete. It reads the crew's task state, determines eligibility, claims tasks, acknowledges the poll, and returns structured results.
|
|
14
14
|
|
|
15
15
|
4. **Report claims:** Extract the `claims` array from the dispatcher result. For each claim, emit one line:
|
|
16
16
|
LAUNCH: script={claim.scriptPath} args={JSON.stringify(claim.args)}
|
package/workflows/crew-init.js
CHANGED
|
@@ -12,10 +12,13 @@ export const meta = {
|
|
|
12
12
|
const inputs = args ?? {};
|
|
13
13
|
const crewRepoPath = inputs.crewRepoPath;
|
|
14
14
|
const crewHome = inputs.crewHome;
|
|
15
|
+
const dashboardSlug = inputs.dashboardSlug;
|
|
16
|
+
const dashboardName = inputs.dashboardName || "Muse Crew";
|
|
15
17
|
const cronIds = inputs.cronIds || {};
|
|
16
18
|
|
|
17
19
|
if (!crewRepoPath) throw new Error("crewRepoPath is required — path to muse-crew (git checkout or npm install)");
|
|
18
20
|
if (!crewHome) throw new Error("crewHome is required — e.g. ~/workspace/.crew (must be inside the workspace)");
|
|
21
|
+
if (!dashboardSlug) throw new Error("dashboardSlug is required — slug of the task service artifact (must already exist)");
|
|
19
22
|
|
|
20
23
|
const orchDir = crewHome + "/.orchestration";
|
|
21
24
|
|
|
@@ -188,6 +191,7 @@ try {
|
|
|
188
191
|
"Ensure the Muse Crew cron jobs match the repo's declarative manifest.\n\n" +
|
|
189
192
|
"Manifest: " + crewRepoPath + "/seed/crons.json\n" +
|
|
190
193
|
"crewHome: " + crewHome + "\n" +
|
|
194
|
+
"dashboardSlug: " + dashboardSlug + "\n" +
|
|
191
195
|
"Id overrides (manifest id -> live id): " + JSON.stringify(cronIds) + "\n\n" +
|
|
192
196
|
"Steps:\n" +
|
|
193
197
|
"1. Read the manifest at " + crewRepoPath + "/seed/crons.json and parse it as JSON.\n" +
|
|
@@ -198,12 +202,13 @@ try {
|
|
|
198
202
|
" a. The live id is the override for entry.id when present, else entry.id.\n" +
|
|
199
203
|
" b. Read the body template at " + crewRepoPath + "/seed/<entry.body_template>.\n" +
|
|
200
204
|
" c. Replace all occurrences of {crewHome} with: " + crewHome + ".\n" +
|
|
205
|
+
" Replace all occurrences of {dashboardSlug} with: " + dashboardSlug + ".\n" +
|
|
201
206
|
" d. Call cron_list and look for a job with the live id.\n" +
|
|
202
207
|
" e. If missing, call cron_add with:\n" +
|
|
203
208
|
" - id: the live id\n" +
|
|
204
209
|
" - title, enabled, mode from the entry\n" +
|
|
205
210
|
" - schedule: the entry's schedule object\n" +
|
|
206
|
-
" - owner: the entry's owner\n" +
|
|
211
|
+
" - owner: the entry's owner with {dashboardSlug} replaced by: " + dashboardSlug + "\n" +
|
|
207
212
|
" - timeout_secs: the entry's timeout_secs when present\n" +
|
|
208
213
|
" - body: the resolved template text\n" +
|
|
209
214
|
" Record action 'created' with no updated fields.\n" +
|
|
@@ -262,6 +267,8 @@ log("Crons: " + cronsResult.summary.crons.map(function (c) { return c.id + "=" +
|
|
|
262
267
|
return {
|
|
263
268
|
message: "Muse Crew initialized.",
|
|
264
269
|
crewHome: crewHome,
|
|
270
|
+
dashboardSlug: dashboardSlug,
|
|
271
|
+
dashboardName: dashboardName,
|
|
265
272
|
releaseHash: releaseResult.hash,
|
|
266
273
|
scaffold: { created: scaffoldCreated, skipped: scaffoldSkipped },
|
|
267
274
|
crons: cronsResult.summary.crons
|