skill-autoroute 0.11.0 → 0.11.1
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 +2 -0
- package/hook/route.js +6 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -449,6 +449,8 @@ trusted project's `.hermes/skills` and `.agents/skills`.
|
|
|
449
449
|
the user message. No match prints nothing.
|
|
450
450
|
- **Subagents:** a second entry on `subagent_start` records each `delegate_task` child's session id, and the child's
|
|
451
451
|
turns get no hints. The parent already chose the work.
|
|
452
|
+
- **Gateway notices:** turns Hermes itself sends (a finished background process or delegation, marked
|
|
453
|
+
`[INTERNAL NOTIFICATION`) get no hints.
|
|
452
454
|
- **Config:** the first change backs up `config.yaml` to `config.yaml.bak-skill-autoroute`. Other hooks stay as they are.
|
|
453
455
|
|
|
454
456
|
</details>
|
package/hook/route.js
CHANGED
|
@@ -372,6 +372,11 @@ function markChild(udir, sid) {
|
|
|
372
372
|
try { mkdirSync(dirname(file), { recursive: true }); writeFileSync(file, ''); } catch { /* a read-only folder only loses the mark */ }
|
|
373
373
|
}
|
|
374
374
|
|
|
375
|
+
// Hermes delivers its own notices (a finished background process or delegation) as user turns. They are not the
|
|
376
|
+
// user's work, so they get no hints. The gateway marks them; these are its fixed openings and marker.
|
|
377
|
+
const HERMES_NOTICE = /^\s*\[(ASYNC DELEGATION|IMPORTANT: Background process)\b|\[INTERNAL NOTIFICATION\b/;
|
|
378
|
+
export const isHermesNotice = (text) => HERMES_NOTICE.test(text);
|
|
379
|
+
|
|
375
380
|
// What the tool sent, as {prompt, sid, base}; null when there is nothing to route.
|
|
376
381
|
// Claude Code and Codex send {prompt, session_id}. Hermes sends {hook_event_name, session_id, cwd, extra: {user_message}}.
|
|
377
382
|
export function readInput(input, tool, udir) {
|
|
@@ -382,7 +387,7 @@ export function readInput(input, tool, udir) {
|
|
|
382
387
|
const sid = input.session_id;
|
|
383
388
|
if (childFile(udir, sid) && existsSync(childFile(udir, sid))) return null;
|
|
384
389
|
const prompt = messageText(input.extra?.user_message);
|
|
385
|
-
if (prompt === null) return null;
|
|
390
|
+
if (prompt === null || isHermesNotice(prompt)) return null;
|
|
386
391
|
return { prompt, sid, base: typeof input.cwd === 'string' && input.cwd ? input.cwd : process.cwd() };
|
|
387
392
|
}
|
|
388
393
|
if (typeof input.prompt !== 'string') return null;
|