moflo 4.8.47 → 4.8.49
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/README.md +11 -0
- package/bin/gate.cjs +19 -4
- package/package.json +2 -3
- package/src/@claude-flow/cli/dist/src/commands/plugins.js +0 -1
- package/src/@claude-flow/cli/dist/src/init/claudemd-generator.js +45 -45
- package/src/@claude-flow/cli/dist/src/init/moflo-init.js +764 -764
- package/src/@claude-flow/cli/dist/src/plugins/store/discovery.js +0 -30
- package/src/@claude-flow/cli/dist/src/version.js +1 -1
- package/src/@claude-flow/cli/package.json +1 -1
package/README.md
CHANGED
|
@@ -233,6 +233,17 @@ The memory-first gate doesn't blindly block every request. It classifies each pr
|
|
|
233
233
|
- **Simple directives** (e.g., "commit", "yes", "continue", "looks good") — skip the gate entirely, no memory search required
|
|
234
234
|
- **Task-oriented prompts** (e.g., "fix the auth bug", "add pagination to the API") — gate enforced, must search memory first
|
|
235
235
|
|
|
236
|
+
### Escape hatch
|
|
237
|
+
|
|
238
|
+
Prefix any prompt with `@@` to bypass the memory-first gate for that turn. Useful for conversational questions, thinking out loud, or discussions that don't need prior context:
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
@@ what do you think about this approach?
|
|
242
|
+
@@ question — is there a better way to handle auth tokens?
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
The `@@` prefix is stripped before Claude sees the prompt, so it won't affect the response.
|
|
246
|
+
|
|
236
247
|
### Disabling gates
|
|
237
248
|
|
|
238
249
|
All gates are configurable in `moflo.yaml`:
|
package/bin/gate.cjs
CHANGED
|
@@ -41,7 +41,14 @@ var command = process.argv[2];
|
|
|
41
41
|
|
|
42
42
|
var EXEMPT = ['.claude/', '.claude\\', 'CLAUDE.md', 'MEMORY.md', 'workflow-state', 'node_modules'];
|
|
43
43
|
var DANGEROUS = ['rm -rf /', 'format c:', 'del /s /q c:\\', ':(){:|:&};:', 'mkfs.', '> /dev/sda'];
|
|
44
|
+
// Short replies starting with directive words ("ok", "yes", etc.) bypass the
|
|
45
|
+
// memory gate — but only if the prompt is under 20 chars. Longer prompts that
|
|
46
|
+
// start with a directive but contain a real question/task still get gated.
|
|
44
47
|
var DIRECTIVE_RE = /^(yes|no|yeah|yep|nope|sure|ok|okay|correct|right|exactly|perfect)\b/i;
|
|
48
|
+
var DIRECTIVE_MAX_LEN = 20;
|
|
49
|
+
// @@ prefix = explicit escape hatch. User signals "this is conversational,
|
|
50
|
+
// skip the memory gate." Strips the prefix before Claude sees the prompt.
|
|
51
|
+
var ESCAPE_PREFIX = '@@';
|
|
45
52
|
var TASK_RE = /\b(fix|bug|error|implement|add|create|build|write|refactor|debug|test|feature|issue|security|optimi)\b/i;
|
|
46
53
|
|
|
47
54
|
switch (command) {
|
|
@@ -65,17 +72,22 @@ switch (command) {
|
|
|
65
72
|
if (s.memorySearched || !s.memoryRequired) break;
|
|
66
73
|
var target = (process.env.TOOL_INPUT_pattern || '') + ' ' + (process.env.TOOL_INPUT_path || '');
|
|
67
74
|
if (EXEMPT.some(function(p) { return target.indexOf(p) >= 0; })) break;
|
|
68
|
-
process.stderr.write('BLOCKED: Search memory before exploring files. Use mcp__moflo__memory_search.\n');
|
|
75
|
+
process.stderr.write('BLOCKED: Search memory before exploring files. Use mcp__moflo__memory_search with namespace "code-map", "patterns", "knowledge", or "guidance".\n');
|
|
69
76
|
process.exit(2);
|
|
77
|
+
break; // unreachable but prevents fall-through lint warnings
|
|
70
78
|
}
|
|
71
79
|
case 'check-before-read': {
|
|
72
80
|
if (!config.memory_first) break;
|
|
73
81
|
var s = readState();
|
|
74
82
|
if (s.memorySearched || !s.memoryRequired) break;
|
|
75
83
|
var fp = process.env.TOOL_INPUT_file_path || '';
|
|
76
|
-
|
|
77
|
-
|
|
84
|
+
// Exempt: node_modules, CLAUDE.md, MEMORY.md, workflow-state
|
|
85
|
+
// NOT exempt: .claude/guidance/ (guidance files must require memory search)
|
|
86
|
+
var isGuidance = fp.indexOf('.claude/guidance/') >= 0 || fp.indexOf('.claude\\guidance\\') >= 0;
|
|
87
|
+
if (!isGuidance && EXEMPT.some(function(p) { return fp.indexOf(p) >= 0; })) break;
|
|
88
|
+
process.stderr.write('BLOCKED: Search memory before reading files. Use mcp__moflo__memory_search with namespace "code-map", "patterns", "knowledge", or "guidance".\n');
|
|
78
89
|
process.exit(2);
|
|
90
|
+
break; // unreachable but prevents fall-through lint warnings
|
|
79
91
|
}
|
|
80
92
|
case 'record-task-created': {
|
|
81
93
|
var s = readState();
|
|
@@ -113,7 +125,10 @@ switch (command) {
|
|
|
113
125
|
var s = readState();
|
|
114
126
|
s.memorySearched = false;
|
|
115
127
|
var prompt = process.env.CLAUDE_USER_PROMPT || '';
|
|
116
|
-
|
|
128
|
+
var isEscaped = prompt.indexOf(ESCAPE_PREFIX) === 0;
|
|
129
|
+
if (isEscaped) prompt = prompt.slice(ESCAPE_PREFIX.length).trimStart();
|
|
130
|
+
var isShortDirective = DIRECTIVE_RE.test(prompt) && prompt.length < DIRECTIVE_MAX_LEN;
|
|
131
|
+
s.memoryRequired = !isEscaped && prompt.length >= 4 && !isShortDirective && (TASK_RE.test(prompt) || prompt.length > DIRECTIVE_MAX_LEN);
|
|
117
132
|
s.interactionCount = (s.interactionCount || 0) + 1;
|
|
118
133
|
writeState(s);
|
|
119
134
|
if (!s.tasksCreated) console.log('REMINDER: Use TaskCreate before spawning agents. Task tool is blocked until then.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "moflo",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.49",
|
|
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",
|
|
@@ -86,10 +86,9 @@
|
|
|
86
86
|
"hono": ">=4.11.4"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@types/bcrypt": "^5.0.2",
|
|
90
89
|
"@types/node": "^20.19.37",
|
|
91
90
|
"eslint": "^8.0.0",
|
|
92
|
-
"moflo": "^4.8.
|
|
91
|
+
"moflo": "^4.8.47",
|
|
93
92
|
"tsx": "^4.21.0",
|
|
94
93
|
"typescript": "^5.9.3",
|
|
95
94
|
"vitest": "^4.0.0"
|
|
@@ -807,7 +807,6 @@ export const pluginsCommand = {
|
|
|
807
807
|
'@claude-flow/security - Security scanning and CVE detection',
|
|
808
808
|
'@claude-flow/embeddings - Vector embeddings with hyperbolic support',
|
|
809
809
|
'@claude-flow/claims - Claims-based authorization',
|
|
810
|
-
'@claude-flow/performance - Performance profiling and benchmarks',
|
|
811
810
|
'@claude-flow/plugin-gastown-bridge - Gas Town orchestrator integration (WASM-accelerated)',
|
|
812
811
|
]);
|
|
813
812
|
output.writeln();
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLAUDE.md Generator
|
|
3
|
-
*
|
|
4
|
-
* Generates ONLY the MoFlo section to inject into a project's CLAUDE.md.
|
|
5
|
-
* This must be minimal — just enough for Claude to work with moflo.
|
|
6
|
-
* All detailed docs live in .claude/guidance/shipped/moflo
|
|
7
|
-
*
|
|
8
|
-
* Principle: we are guests in the user's CLAUDE.md. Keep it small.
|
|
9
|
-
*/
|
|
10
|
-
const MARKER_START = '<!-- MOFLO:INJECTED:START -->';
|
|
11
|
-
const MARKER_END = '<!-- MOFLO:INJECTED:END -->';
|
|
12
|
-
/**
|
|
13
|
-
* The single moflo section injected into CLAUDE.md.
|
|
14
|
-
* ~40 lines. Points to moflo
|
|
15
|
-
*/
|
|
16
|
-
function mofloSection() {
|
|
1
|
+
/**
|
|
2
|
+
* CLAUDE.md Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates ONLY the MoFlo section to inject into a project's CLAUDE.md.
|
|
5
|
+
* This must be minimal — just enough for Claude to work with moflo.
|
|
6
|
+
* All detailed docs live in .claude/guidance/shipped/moflo.md (copied at install).
|
|
7
|
+
*
|
|
8
|
+
* Principle: we are guests in the user's CLAUDE.md. Keep it small.
|
|
9
|
+
*/
|
|
10
|
+
const MARKER_START = '<!-- MOFLO:INJECTED:START -->';
|
|
11
|
+
const MARKER_END = '<!-- MOFLO:INJECTED:END -->';
|
|
12
|
+
/**
|
|
13
|
+
* The single moflo section injected into CLAUDE.md.
|
|
14
|
+
* ~40 lines. Points to moflo.md for everything else.
|
|
15
|
+
*/
|
|
16
|
+
function mofloSection() {
|
|
17
17
|
return `${MARKER_START}
|
|
18
18
|
## MoFlo — AI Agent Orchestration
|
|
19
19
|
|
|
@@ -58,33 +58,33 @@ npx flo doctor --fix # Health check
|
|
|
58
58
|
|
|
59
59
|
- **Subagents protocol:** \`.claude/guidance/shipped/moflo-subagents.md\`
|
|
60
60
|
- **Task + swarm coordination:** \`.claude/guidance/shipped/moflo-claude-swarm-cohesion.md\`
|
|
61
|
-
- **CLI, hooks, swarm, memory, moflo.yaml:** \`.claude/guidance/shipped/moflo
|
|
62
|
-
${MARKER_END}`;
|
|
63
|
-
}
|
|
64
|
-
// --- Public API ---
|
|
65
|
-
export { MARKER_START, MARKER_END };
|
|
66
|
-
/**
|
|
67
|
-
* Generate the MoFlo section to inject into CLAUDE.md.
|
|
68
|
-
* Template parameter is accepted for backward compatibility but ignored —
|
|
69
|
-
* all templates now produce the same minimal injection.
|
|
70
|
-
*/
|
|
71
|
-
export function generateClaudeMd(_options, _template) {
|
|
72
|
-
return mofloSection() + '\n';
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Generate minimal CLAUDE.md content (backward-compatible alias).
|
|
76
|
-
*/
|
|
77
|
-
export function generateMinimalClaudeMd(options) {
|
|
78
|
-
return generateClaudeMd(options, 'minimal');
|
|
79
|
-
}
|
|
80
|
-
/** Available template names for CLI wizard (kept for backward compat, all produce same output) */
|
|
81
|
-
export const CLAUDE_MD_TEMPLATES = [
|
|
82
|
-
{ name: 'minimal', description: 'Recommended — memory search, workflow gates, MCP tools (~40 lines injected)' },
|
|
83
|
-
{ name: 'standard', description: 'Same as minimal (detailed docs in .claude/guidance/shipped/moflo
|
|
84
|
-
{ name: 'full', description: 'Same as minimal (detailed docs in .claude/guidance/shipped/moflo
|
|
85
|
-
{ name: 'security', description: 'Same as minimal (detailed docs in .claude/guidance/shipped/moflo
|
|
86
|
-
{ name: 'performance', description: 'Same as minimal (detailed docs in .claude/guidance/shipped/moflo
|
|
87
|
-
{ name: 'solo', description: 'Same as minimal (detailed docs in .claude/guidance/shipped/moflo
|
|
88
|
-
];
|
|
89
|
-
export default generateClaudeMd;
|
|
61
|
+
- **CLI, hooks, swarm, memory, moflo.yaml:** \`.claude/guidance/shipped/moflo.md\`
|
|
62
|
+
${MARKER_END}`;
|
|
63
|
+
}
|
|
64
|
+
// --- Public API ---
|
|
65
|
+
export { MARKER_START, MARKER_END };
|
|
66
|
+
/**
|
|
67
|
+
* Generate the MoFlo section to inject into CLAUDE.md.
|
|
68
|
+
* Template parameter is accepted for backward compatibility but ignored —
|
|
69
|
+
* all templates now produce the same minimal injection.
|
|
70
|
+
*/
|
|
71
|
+
export function generateClaudeMd(_options, _template) {
|
|
72
|
+
return mofloSection() + '\n';
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Generate minimal CLAUDE.md content (backward-compatible alias).
|
|
76
|
+
*/
|
|
77
|
+
export function generateMinimalClaudeMd(options) {
|
|
78
|
+
return generateClaudeMd(options, 'minimal');
|
|
79
|
+
}
|
|
80
|
+
/** Available template names for CLI wizard (kept for backward compat, all produce same output) */
|
|
81
|
+
export const CLAUDE_MD_TEMPLATES = [
|
|
82
|
+
{ name: 'minimal', description: 'Recommended — memory search, workflow gates, MCP tools (~40 lines injected)' },
|
|
83
|
+
{ name: 'standard', description: 'Same as minimal (detailed docs in .claude/guidance/shipped/moflo.md)' },
|
|
84
|
+
{ name: 'full', description: 'Same as minimal (detailed docs in .claude/guidance/shipped/moflo.md)' },
|
|
85
|
+
{ name: 'security', description: 'Same as minimal (detailed docs in .claude/guidance/shipped/moflo.md)' },
|
|
86
|
+
{ name: 'performance', description: 'Same as minimal (detailed docs in .claude/guidance/shipped/moflo.md)' },
|
|
87
|
+
{ name: 'solo', description: 'Same as minimal (detailed docs in .claude/guidance/shipped/moflo.md)' },
|
|
88
|
+
];
|
|
89
|
+
export default generateClaudeMd;
|
|
90
90
|
//# sourceMappingURL=claudemd-generator.js.map
|