@bluecopa/harness 0.1.0-snapshot.128 → 0.1.0-snapshot.129
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/arc/transition-table.ts"],"names":[],"mappings":";AAyEO,SAAS,iBAAA,CACd,KAAA,EACA,OAAA,EACA,IAAA,EACA,GAAA,EACkB;AAClB,EAAA,KAAA,MAAW,IAAA,IAAQ,MAAM,KAAA,EAAO;AAC9B,IAAA,IAAI,IAAA,CAAK,SAAS,OAAA,EAAS;AAC3B,IAAA,IAAI,IAAA,CAAK,IAAA,KAAS,GAAA,IAAO,IAAA,CAAK,SAAS,IAAA,EAAM;AAC7C,IAAA,IAAI,KAAK,KAAA,IAAS,CAAC,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA,EAAG;AAEpC,IAAA,OAAO;AAAA,MACL,OAAA,EAAS,IAAA;AAAA,MACT,UAAA,EAAY,CAAC,IAAA,CAAK,QAAA,CAAS,GAAG,CAAC,CAAA;AAAA,MAC/B,OAAA,EAAS,IAAA,CAAK,OAAA,CAAQ,GAAG,CAAA;AAAA,MACzB,KAAA,EAAO;AAAA,KACT;AAAA,EACF;AAEA,EAAA,MAAM,WAAW,KAAA,CAAM,SAAA,CAAU,KAAK,CAAA,CAAA,KAAK,CAAA,CAAE,SAAS,OAAO,CAAA;AAC7D,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,KAAA;AAAA,IACT,YAAY,EAAC;AAAA,IACb,OAAA,EAAS,QAAA,EAAU,OAAA,CAAQ,GAAG,CAAA,IAAK,sEAAA;AAAA,IACnC,KAAA,EAAO,QAAA,EAAU,KAAA,IAAS,CAAA,EAAG,OAAO,CAAA,SAAA;AAAA,GACtC;AACF","file":"transition-table.js","sourcesContent":["/**\n * Declarative transition table for profile-to-profile routing.\n *\n * Replaces hand-written switch/case reducers with a table of rules.\n * Adding a new transition = adding an entry with from, next, dispatch mapper.\n */\n\nexport interface TransitionContext {\n processId: string;\n episodeId: string;\n /** Raw objective from the request (before user-request override). */\n objective: string;\n /** Parsed typed output from the completing profile. */\n output: Record<string, unknown>;\n /** Normalized targets from the completing profile. */\n targets: string[];\n /** Consumer options (e.g. userRequest). */\n options?: { userRequest?: string };\n /** Original request metadata. */\n request: { input?: Record<string, unknown>; expectedFiles?: string[] };\n}\n\nexport interface TransitionDispatch {\n profile: string;\n input: Record<string, unknown>;\n label?: string;\n expectedFiles?: string[];\n contextEpisodeIds?: string[];\n maxSteps?: number;\n}\n\nexport interface TransitionRule {\n from: string;\n /** Profile name to match, or `\"*\"` for wildcard (matches any `next` value). */\n next: string;\n /** Optional guard — rule only fires when guard returns true. */\n guard?: (ctx: TransitionContext) => boolean;\n /** Build the dispatch request from the transition context. */\n dispatch: (ctx: TransitionContext) => TransitionDispatch;\n /** Human-readable message for the orchestrator. */\n message: (ctx: TransitionContext) => string;\n}\n\nexport interface TransitionFallback {\n from: string;\n /** Label for the message header (e.g. \"scout complete\", \"investigation complete\"). */\n label: string;\n /** Build the fallback message when no transition matches. */\n message: (ctx: TransitionContext) => string;\n}\n\nexport interface TransitionTable {\n rules: TransitionRule[];\n fallbacks: TransitionFallback[];\n}\n\nexport interface TransitionResult {\n /** Whether a transition rule matched (vs. fallback). */\n matched: boolean;\n /** Dispatches to make (empty = synthesize instead). */\n dispatches: TransitionDispatch[];\n /** Message for the orchestrator context window. */\n message: string;\n /** Header label — \"routed deterministically\" or fallback label. */\n label: string;\n}\n\n/**\n * Resolve a transition from the table.\n *\n * Scans rules in order for the first match on (from, next, guard).\n * Falls back to profile-specific fallback or a generic synthesize message.\n */\nexport function resolveTransition(\n table: TransitionTable,\n profile: string,\n next: string,\n ctx: TransitionContext,\n): TransitionResult {\n for (const rule of table.rules) {\n if (rule.from !== profile) continue;\n if (rule.next !== '*' && rule.next !== next) continue;\n if (rule.guard && !rule.guard(ctx)) continue;\n\n return {\n matched: true,\n dispatches: [rule.dispatch(ctx)],\n message: rule.message(ctx),\n label: 'routed deterministically',\n };\n }\n\n const fallback = table.fallbacks.find(f => f.from === profile);\n return {\n matched: false,\n dispatches: [],\n message: fallback?.message(ctx) ?? 'Synthesize the final answer now instead of dispatching more threads.',\n label: fallback?.label ?? `${profile} complete`,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/arc/transition-table.ts"],"names":[],"mappings":";AAyEO,SAAS,iBAAA,CACd,KAAA,EACA,OAAA,EACA,IAAA,EACA,GAAA,EACkB;AAClB,EAAA,KAAA,MAAW,IAAA,IAAQ,MAAM,KAAA,EAAO;AAC9B,IAAA,IAAI,IAAA,CAAK,SAAS,OAAA,EAAS;AAC3B,IAAA,IAAI,IAAA,CAAK,IAAA,KAAS,GAAA,IAAO,IAAA,CAAK,SAAS,IAAA,EAAM;AAC7C,IAAA,IAAI,KAAK,KAAA,IAAS,CAAC,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA,EAAG;AAEpC,IAAA,OAAO;AAAA,MACL,OAAA,EAAS,IAAA;AAAA,MACT,UAAA,EAAY,CAAC,IAAA,CAAK,QAAA,CAAS,GAAG,CAAC,CAAA;AAAA,MAC/B,OAAA,EAAS,IAAA,CAAK,OAAA,CAAQ,GAAG,CAAA;AAAA,MACzB,KAAA,EAAO;AAAA,KACT;AAAA,EACF;AAEA,EAAA,MAAM,WAAW,KAAA,CAAM,SAAA,CAAU,KAAK,CAAA,CAAA,KAAK,CAAA,CAAE,SAAS,OAAO,CAAA;AAC7D,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,KAAA;AAAA,IACT,YAAY,EAAC;AAAA,IACb,OAAA,EAAS,QAAA,EAAU,OAAA,CAAQ,GAAG,CAAA,IAAK,sEAAA;AAAA,IACnC,KAAA,EAAO,QAAA,EAAU,KAAA,IAAS,CAAA,EAAG,OAAO,CAAA,SAAA;AAAA,GACtC;AACF","file":"transition-table.js","sourcesContent":["/**\n * Declarative transition table for profile-to-profile routing.\n *\n * Replaces hand-written switch/case reducers with a table of rules.\n * Adding a new transition = adding an entry with from, next, dispatch mapper.\n */\n\nexport interface TransitionContext {\n processId: string;\n episodeId: string;\n /** Raw objective from the request (before user-request override). */\n objective: string;\n /** Parsed typed output from the completing profile. */\n output: Record<string, unknown>;\n /** Normalized targets from the completing profile. */\n targets: string[];\n /** Consumer options (e.g. userRequest). */\n options?: { userRequest?: string };\n /** Original request metadata. */\n request: { input?: Record<string, unknown>; expectedFiles?: string[]; contextEpisodeIds?: string[] };\n}\n\nexport interface TransitionDispatch {\n profile: string;\n input: Record<string, unknown>;\n label?: string;\n expectedFiles?: string[];\n contextEpisodeIds?: string[];\n maxSteps?: number;\n}\n\nexport interface TransitionRule {\n from: string;\n /** Profile name to match, or `\"*\"` for wildcard (matches any `next` value). */\n next: string;\n /** Optional guard — rule only fires when guard returns true. */\n guard?: (ctx: TransitionContext) => boolean;\n /** Build the dispatch request from the transition context. */\n dispatch: (ctx: TransitionContext) => TransitionDispatch;\n /** Human-readable message for the orchestrator. */\n message: (ctx: TransitionContext) => string;\n}\n\nexport interface TransitionFallback {\n from: string;\n /** Label for the message header (e.g. \"scout complete\", \"investigation complete\"). */\n label: string;\n /** Build the fallback message when no transition matches. */\n message: (ctx: TransitionContext) => string;\n}\n\nexport interface TransitionTable {\n rules: TransitionRule[];\n fallbacks: TransitionFallback[];\n}\n\nexport interface TransitionResult {\n /** Whether a transition rule matched (vs. fallback). */\n matched: boolean;\n /** Dispatches to make (empty = synthesize instead). */\n dispatches: TransitionDispatch[];\n /** Message for the orchestrator context window. */\n message: string;\n /** Header label — \"routed deterministically\" or fallback label. */\n label: string;\n}\n\n/**\n * Resolve a transition from the table.\n *\n * Scans rules in order for the first match on (from, next, guard).\n * Falls back to profile-specific fallback or a generic synthesize message.\n */\nexport function resolveTransition(\n table: TransitionTable,\n profile: string,\n next: string,\n ctx: TransitionContext,\n): TransitionResult {\n for (const rule of table.rules) {\n if (rule.from !== profile) continue;\n if (rule.next !== '*' && rule.next !== next) continue;\n if (rule.guard && !rule.guard(ctx)) continue;\n\n return {\n matched: true,\n dispatches: [rule.dispatch(ctx)],\n message: rule.message(ctx),\n label: 'routed deterministically',\n };\n }\n\n const fallback = table.fallbacks.find(f => f.from === profile);\n return {\n matched: false,\n dispatches: [],\n message: fallback?.message(ctx) ?? 'Synthesize the final answer now instead of dispatching more threads.',\n label: fallback?.label ?? `${profile} complete`,\n };\n}\n"]}
|