moflo 4.8.81 → 4.8.83
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 +2 -2
- package/src/modules/cli/dist/src/epic/spells/single-branch.yaml +46 -9
- package/src/modules/cli/dist/src/version.js +1 -1
- package/src/modules/cli/package.json +1 -1
- package/src/modules/spells/dist/core/interpolation.js +9 -2
- package/src/modules/spells/dist/core/runner.js +9 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "moflo",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.83",
|
|
4
4
|
"description": "MoFlo — AI agent orchestration for Claude Code. Forked from ruflo/claude-flow with patches applied to source, plus feature-level orchestration.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"@types/node": "^24.12.2",
|
|
118
118
|
"@xenova/transformers": "^2.17.0",
|
|
119
119
|
"eslint": "^8.0.0",
|
|
120
|
-
"moflo": "^4.8.
|
|
120
|
+
"moflo": "^4.8.82",
|
|
121
121
|
"tsx": "^4.21.0",
|
|
122
122
|
"typescript": "^5.9.3",
|
|
123
123
|
"vitest": "^4.0.0"
|
|
@@ -116,15 +116,40 @@ steps:
|
|
|
116
116
|
timeout: 600000
|
|
117
117
|
failOnError: true
|
|
118
118
|
|
|
119
|
-
# 2b:
|
|
119
|
+
# 2b: Flip `- [ ] #<story>` to `- [x] #<story>` on the epic body.
|
|
120
|
+
# The github `comment` action only appends a comment — it does NOT
|
|
121
|
+
# touch the task-list checkboxes. We read the body, substitute, and
|
|
122
|
+
# write it back so the epic reflects progress at a glance.
|
|
120
123
|
- id: check-off-story
|
|
121
|
-
type:
|
|
124
|
+
type: bash
|
|
125
|
+
permissionLevel: elevated
|
|
126
|
+
config:
|
|
127
|
+
command: |
|
|
128
|
+
set -e
|
|
129
|
+
STORY={loop.story_number}
|
|
130
|
+
EPIC={args.epic_number}
|
|
131
|
+
BODY=$(gh issue view "$EPIC" --json body -q .body)
|
|
132
|
+
UPDATED=$(printf '%s' "$BODY" | sed -E "s/- \[ \] #${STORY}\b/- [x] #${STORY}/")
|
|
133
|
+
if [ "$BODY" != "$UPDATED" ]; then
|
|
134
|
+
printf '%s' "$UPDATED" | gh issue edit "$EPIC" --body-file -
|
|
135
|
+
fi
|
|
136
|
+
timeout: 60000
|
|
137
|
+
failOnError: true
|
|
138
|
+
|
|
139
|
+
# 2c: Close the story issue explicitly. Single-branch defers to the
|
|
140
|
+
# consolidated PR's Closes-keywords on merge; if the PR never lands,
|
|
141
|
+
# stories would stay OPEN forever. Closing here makes the issue state
|
|
142
|
+
# track the commit, not the eventual merge.
|
|
143
|
+
- id: close-story
|
|
144
|
+
type: bash
|
|
145
|
+
permissionLevel: elevated
|
|
122
146
|
config:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
147
|
+
command: |
|
|
148
|
+
gh issue close {loop.story_number} --reason completed --comment "Closed by epic #{args.epic_number}: commits landed on epic branch."
|
|
149
|
+
timeout: 60000
|
|
150
|
+
failOnError: true
|
|
126
151
|
|
|
127
|
-
#
|
|
152
|
+
# 2d: Record completion in memory
|
|
128
153
|
- id: record-completion
|
|
129
154
|
type: memory
|
|
130
155
|
config:
|
|
@@ -149,17 +174,29 @@ steps:
|
|
|
149
174
|
timeout: 120000
|
|
150
175
|
failOnError: true
|
|
151
176
|
|
|
152
|
-
# Step 4:
|
|
177
|
+
# Step 4: Build the 'Closes #<story>' fragment for the PR body so that
|
|
178
|
+
# merging the consolidated PR auto-closes each individual story issue,
|
|
179
|
+
# not just the epic. Without this, only the epic would close on merge
|
|
180
|
+
# and story issues would linger open indefinitely.
|
|
181
|
+
- id: build-closes-list
|
|
182
|
+
type: bash
|
|
183
|
+
config:
|
|
184
|
+
command: |
|
|
185
|
+
echo {args.stories} | tr ',' '\n' | awk 'NF {printf "Closes #%s ", $0}'
|
|
186
|
+
timeout: 30000
|
|
187
|
+
failOnError: true
|
|
188
|
+
|
|
189
|
+
# Step 5: Create consolidated PR
|
|
153
190
|
- id: create-pr
|
|
154
191
|
type: github
|
|
155
192
|
config:
|
|
156
193
|
action: "pr-create"
|
|
157
194
|
title: "epic(#{args.epic_number}): consolidated epic PR"
|
|
158
|
-
body: "## Epic #{args.epic_number}\n\nConsolidated PR for all stories.\n\
|
|
195
|
+
body: "## Epic #{args.epic_number}\n\nConsolidated PR for all stories.\n\n{build-closes-list.stdout} Closes #{args.epic_number}"
|
|
159
196
|
base: "{args.base_branch}"
|
|
160
197
|
head: "epic/{args.epic_number}-{args.epic_slug}"
|
|
161
198
|
|
|
162
|
-
# Step
|
|
199
|
+
# Step 6: Mark epic as completed in memory
|
|
163
200
|
- id: finalize-state
|
|
164
201
|
type: memory
|
|
165
202
|
config:
|
|
@@ -4,8 +4,15 @@
|
|
|
4
4
|
* Resolves `{stepId.outputKey}` placeholders in spell step configs.
|
|
5
5
|
* Nested property access is supported: `{step1.data.nested.value}`.
|
|
6
6
|
*/
|
|
7
|
-
/**
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Matches `{path}` variable references in spell step configs.
|
|
9
|
+
*
|
|
10
|
+
* The `(?<!\$)` negative lookbehind skips `${VAR}` — that's bash parameter
|
|
11
|
+
* expansion inside shell steps, not a spell template reference. Without it,
|
|
12
|
+
* a bash command like `sed "s/#${STORY}/.../"` would try to resolve `STORY`
|
|
13
|
+
* as a spell variable and fail.
|
|
14
|
+
*/
|
|
15
|
+
export const VAR_REF_PATTERN = /(?<!\$)\{([^}]+)\}/g;
|
|
9
16
|
/**
|
|
10
17
|
* Resolve a dot-separated path against the context variables.
|
|
11
18
|
* Returns undefined if any segment is missing.
|
|
@@ -74,25 +74,27 @@ export class SpellCaster {
|
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
76
76
|
const reason = acceptance.reason === 'hash-mismatch'
|
|
77
|
-
? 'Spell permissions have changed
|
|
78
|
-
: 'First run —
|
|
77
|
+
? 'Spell permissions have changed — please re-review'
|
|
78
|
+
: 'First run — please review permissions before running this spell';
|
|
79
79
|
const report = formatSpellPermissionReport(permReport);
|
|
80
80
|
console.log(`[spell] ${reason}`);
|
|
81
|
-
console.log(
|
|
81
|
+
console.log('');
|
|
82
82
|
console.log(report);
|
|
83
|
-
//
|
|
83
|
+
// Also run dry-run validation so genuine definition issues surface
|
|
84
|
+
// alongside the permission review — but keep them cleanly separated
|
|
85
|
+
// from the acceptance prompt (not having accepted is not an error).
|
|
84
86
|
const dryResult = await dryRunValidate(definition, resolvedArgs, defValidation, options, this.registry, (variables, wfId, stepIndex) => this.buildContext(variables, resolvedArgs, wfId, stepIndex, options.signal));
|
|
85
87
|
if (!dryResult.valid) {
|
|
86
|
-
console.log('\n[spell]
|
|
88
|
+
console.log('\n[spell] Issues found while validating the spell definition:');
|
|
87
89
|
for (const err of [...dryResult.definitionErrors, ...dryResult.argumentErrors]) {
|
|
88
90
|
console.log(` - ${err.message}`);
|
|
89
91
|
}
|
|
90
92
|
}
|
|
91
93
|
// Block — user must explicitly accept
|
|
92
|
-
console.log(`\n[spell] To
|
|
94
|
+
console.log(`\n[spell] To run this spell, ask Claude to accept it, or call the spell_accept tool with name "${definition.name}".`);
|
|
93
95
|
return this.failureResult(spellId, startTime, [{
|
|
94
96
|
code: 'ACCEPTANCE_REQUIRED',
|
|
95
|
-
message: `${reason}. Review the
|
|
97
|
+
message: `${reason}. Review the permissions above, then accept the spell "${definition.name}" to continue.`,
|
|
96
98
|
}], definition.name);
|
|
97
99
|
}
|
|
98
100
|
}
|