moflo 4.13.0 → 4.13.2
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/.claude/guidance/shipped/moflo-yaml-reference.md +4 -2
- package/.claude/helpers/gate.cjs +285 -12
- package/.claude/helpers/prompt-hook.mjs +10 -0
- package/README.md +5 -2
- package/bin/gate.cjs +285 -12
- package/bin/prompt-hook.mjs +10 -0
- package/bin/session-start-launcher.mjs +31 -8
- package/dist/src/cli/config/moflo-config.js +2 -1
- package/dist/src/cli/init/embedded-helpers.js +2 -2
- package/dist/src/cli/services/spell-gate.js +24 -4
- package/dist/src/cli/version.js +1 -1
- package/package.json +2 -2
|
@@ -70,10 +70,18 @@ const DIRECTIVE_PATTERNS = [
|
|
|
70
70
|
/^(also|too|and also)\s+(for|with|on)\b/i,
|
|
71
71
|
/^(what about|how about)\s+(the\s+)?(other|rest|same)\b/i,
|
|
72
72
|
];
|
|
73
|
+
/**
|
|
74
|
+
* Phrased as observations, and each says out loud that the bracket comes from a
|
|
75
|
+
* turn count rather than measured tokens (#1487). This code path has no
|
|
76
|
+
* transcript to read — it is the legacy `npx flo gate prompt-reminder` CLI, not
|
|
77
|
+
* the hook — so the honest thing it can do is not sound like a measurement.
|
|
78
|
+
* Instruction-shaped text the model cannot verify gets obeyed: the old CRITICAL
|
|
79
|
+
* line had agents abandoning work over a nearly empty window.
|
|
80
|
+
*/
|
|
73
81
|
const BRACKET_MESSAGES = {
|
|
74
|
-
MODERATE: 'Context:
|
|
75
|
-
DEPLETED: 'Context:
|
|
76
|
-
CRITICAL: 'Context:
|
|
82
|
+
MODERATE: 'Context: 11-20 turns since session start (turn count, not measured token usage).',
|
|
83
|
+
DEPLETED: 'Context: 21-30 turns since session start (turn count, not measured token usage). Checkpointing progress is worth considering.',
|
|
84
|
+
CRITICAL: 'Context: 30+ turns since session start (turn count, not measured token usage). /compact or a fresh session is worth considering.',
|
|
77
85
|
};
|
|
78
86
|
/** Paths exempt from memory-first gate (they ARE the memory system) */
|
|
79
87
|
const EXEMPT_PATTERNS = [
|
|
@@ -329,8 +337,20 @@ export class GateService {
|
|
|
329
337
|
result.reminder = 'REMINDER: Use TaskCreate before spawning agents.';
|
|
330
338
|
}
|
|
331
339
|
if (this.config.context_tracking) {
|
|
340
|
+
// Edge-triggered (#1487): the old level-triggered form re-emitted the same
|
|
341
|
+
// line every turn once past the threshold, with no reset anywhere, so it
|
|
342
|
+
// read as a standing instruction long after it stopped being true.
|
|
343
|
+
//
|
|
344
|
+
// Derived from the counter rather than remembered in a field, deliberately.
|
|
345
|
+
// This file and bin/gate.cjs write the SAME .claude/workflow-state.json,
|
|
346
|
+
// and gate.cjs owns `contextBand` with a richer vocabulary (`tokens:400000`
|
|
347
|
+
// as well as the brackets). A second writer with an incompatible vocabulary
|
|
348
|
+
// would silently invalidate gate.cjs's edge-trigger on any project wired to
|
|
349
|
+
// both. Comparing this turn's bracket with the previous turn's is exactly
|
|
350
|
+
// the same edge, needs no state, and cannot collide.
|
|
332
351
|
const bracket = this.getContextBracket(state.interactionCount);
|
|
333
|
-
|
|
352
|
+
const previous = this.getContextBracket(state.interactionCount - 1);
|
|
353
|
+
if (bracket !== 'FRESH' && bracket !== previous) {
|
|
334
354
|
result.bracket = BRACKET_MESSAGES[bracket];
|
|
335
355
|
}
|
|
336
356
|
}
|
package/dist/src/cli/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "moflo",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.2",
|
|
4
4
|
"description": "MoFlo — AI agent orchestration for Claude Code. A standalone, opinionated toolkit with semantic memory, learned routing, gates, spells, and the /flo issue-execution skill.",
|
|
5
5
|
"main": "dist/src/cli/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"@typescript-eslint/parser": "^8.65.0",
|
|
100
100
|
"eslint": "^10.8.0",
|
|
101
101
|
"glob": "^11.1.0",
|
|
102
|
-
"moflo": "^4.
|
|
102
|
+
"moflo": "^4.13.1",
|
|
103
103
|
"tsx": "^4.21.0",
|
|
104
104
|
"typescript": "^5.9.3",
|
|
105
105
|
"vitest": "^4.0.0"
|