wogiflow 1.5.3 → 1.5.5
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.
|
@@ -305,6 +305,25 @@ You: [edits header.tsx] ← Tracked properly
|
|
|
305
305
|
```
|
|
306
306
|
|
|
307
307
|
**When in doubt, use `/wogi-start`.** It will route appropriately.
|
|
308
|
+
|
|
309
|
+
### When a Tool Call Is Blocked by the Routing Gate
|
|
310
|
+
|
|
311
|
+
If you attempt to use Bash or EnterPlanMode and receive a "BLOCKED" denial from WogiFlow's routing gate, here is the ONLY correct response:
|
|
312
|
+
|
|
313
|
+
1. **Invoke `/wogi-start`** immediately with the user's original request:
|
|
314
|
+
```
|
|
315
|
+
Skill(skill="wogi-start", args="<the user's original request>")
|
|
316
|
+
```
|
|
317
|
+
2. `/wogi-start` will classify the request and clear the routing gate
|
|
318
|
+
3. After `/wogi-start` routes the request, you can use Bash/EnterPlanMode normally
|
|
319
|
+
|
|
320
|
+
**NEVER do these when blocked:**
|
|
321
|
+
- Suggest the user run commands manually in their terminal
|
|
322
|
+
- Try alternative tools to work around the block
|
|
323
|
+
- Explain the block to the user and ask them what to do
|
|
324
|
+
- Give up and say "I can't do that"
|
|
325
|
+
|
|
326
|
+
The routing gate exists because EVERY request must be classified by `/wogi-start` first. The block is not an error — it's a reminder that you skipped a mandatory step. Fix it by invoking `/wogi-start`.
|
|
308
327
|
{{/if}}
|
|
309
328
|
|
|
310
329
|
## Session Startup
|
package/package.json
CHANGED
|
@@ -188,11 +188,21 @@ function checkRoutingGate(toolName) {
|
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
// Block: routing is pending and no active task
|
|
191
|
+
// NOTE: This message is shown to the AI as permissionDecisionReason.
|
|
192
|
+
// It must be prescriptive enough that the AI invokes /wogi-start instead of
|
|
193
|
+
// trying workarounds or suggesting the user run commands manually.
|
|
191
194
|
return {
|
|
192
195
|
allowed: false,
|
|
193
196
|
blocked: true,
|
|
194
197
|
reason: 'routing_pending',
|
|
195
|
-
message:
|
|
198
|
+
message: [
|
|
199
|
+
'BLOCKED: You must route through /wogi-start before using Bash or EnterPlanMode.',
|
|
200
|
+
'ACTION REQUIRED: Invoke the Skill tool with skill="wogi-start" and pass the user\'s request as args.',
|
|
201
|
+
'Example: Skill(skill="wogi-start", args="<the user\'s original request>")',
|
|
202
|
+
'/wogi-start will classify the request (operational, exploration, implementation) and unblock the appropriate tools.',
|
|
203
|
+
'Do NOT suggest the user run commands manually in their terminal.',
|
|
204
|
+
'Do NOT try alternative approaches to bypass this gate.'
|
|
205
|
+
].join(' ')
|
|
196
206
|
};
|
|
197
207
|
}
|
|
198
208
|
|
|
@@ -119,13 +119,22 @@ async function main() {
|
|
|
119
119
|
// v6.0: Set routing-pending flag for routing gate enforcement
|
|
120
120
|
// This blocks Bash calls until a /wogi-* skill is invoked
|
|
121
121
|
// Skipped when an active task exists (follow-ups during tracked work are allowed)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
// v6.1: Also skip when the prompt IS a /wogi-* command — the user is already routing.
|
|
123
|
+
// When users type "/wogi-start ..." directly, Claude Code expands the skill inline
|
|
124
|
+
// (not through the Skill tool), so clearRoutingPending() in PreToolUse never fires.
|
|
125
|
+
// Setting the flag here would create an uncleable block.
|
|
126
|
+
const isWogiCommand = typeof prompt === 'string' && /^\/(wogi-\S+)/i.test(prompt.trim());
|
|
127
|
+
if (!isWogiCommand) {
|
|
128
|
+
try {
|
|
129
|
+
setRoutingPending();
|
|
130
|
+
} catch (err) {
|
|
131
|
+
// Non-blocking - don't fail the hook if routing gate fails (fail-open)
|
|
132
|
+
if (process.env.DEBUG) {
|
|
133
|
+
console.error(`[Hook] Routing gate set failed: ${err.message}`);
|
|
134
|
+
}
|
|
128
135
|
}
|
|
136
|
+
} else if (process.env.DEBUG) {
|
|
137
|
+
console.error(`[Hook] Skipping routing flag — prompt is a /wogi-* command`);
|
|
129
138
|
}
|
|
130
139
|
|
|
131
140
|
// Check research gate first (before implementation gate)
|
package/scripts/postinstall.js
CHANGED
|
@@ -270,6 +270,24 @@ function copyScriptsFromPackage() {
|
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
+
/**
|
|
274
|
+
* Copy WogiFlow-managed .workflow/ subdirectories from package to project
|
|
275
|
+
* These are package-owned (bridges, templates, agents) and always overwritten on update.
|
|
276
|
+
* Without this, `npx flow bridge sync` fails because .workflow/bridges/ doesn't exist.
|
|
277
|
+
*/
|
|
278
|
+
function copyWorkflowManagedDirs() {
|
|
279
|
+
const managedDirs = ['bridges', 'templates', 'agents'];
|
|
280
|
+
|
|
281
|
+
for (const subdir of managedDirs) {
|
|
282
|
+
const src = path.join(PACKAGE_ROOT, '.workflow', subdir);
|
|
283
|
+
const dest = path.join(WORKFLOW_DIR, subdir);
|
|
284
|
+
|
|
285
|
+
if (fs.existsSync(src)) {
|
|
286
|
+
copyDir(src, dest, false);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
273
291
|
/**
|
|
274
292
|
* Check if we should be completely silent (CI only)
|
|
275
293
|
*/
|
|
@@ -301,6 +319,11 @@ function main() {
|
|
|
301
319
|
// This ensures scripts are updated when running npm install/update
|
|
302
320
|
copyScriptsFromPackage();
|
|
303
321
|
|
|
322
|
+
// Copy WogiFlow-managed .workflow/ subdirectories (bridges, templates, agents)
|
|
323
|
+
// These are needed for bridge sync, CLAUDE.md generation, and agent definitions.
|
|
324
|
+
// Always overwrite — these are package-managed, not user-customizable.
|
|
325
|
+
copyWorkflowManagedDirs();
|
|
326
|
+
|
|
304
327
|
// Create marker for AI to detect (unless already initialized)
|
|
305
328
|
createPendingSetupMarker();
|
|
306
329
|
|