buildPattern (route/route-task.ts)

ruflo · plugins/ruflo-mods/hooks/route/route-task.ts · typescript · MIT
infra

Generic keyword router that maps task descriptions to agent types.

// Source: https://github.com/ruvnet/ruflo | License: MIT | Copyright 2024-2026 ruvnet
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * The static keyword router, in-process.
 *
 * A hooks module may import nothing outside its plugin folder, so this is a
 * copy of `.claude/helpers/router.cjs` (TASK_PATTERNS, word-boundary
 * matching, first match wins). It is not a fork: the parity test in
 * `v3/@claude-flow/cli/__tests__/mods/route-parity.test.ts` fails CI when the
 * table or the matching drifts from router.cjs.
 *
 * The one deliberate difference is #3567: a prompt nothing matched says so
 * (`matched: false`, `reason: "no-match-default"`) and carries the
 * NO_MATCH_CONFIDENCE prior that `hooks_route` uses, never a real match's.
 */

export type RouteResult = {

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key