omk-agent-core 0.98.3 → 0.98.4

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/agent-loop.d.ts +1 -31
  3. package/dist/agent-loop.d.ts.map +1 -1
  4. package/dist/agent-loop.js +15 -70
  5. package/dist/agent-loop.js.map +1 -1
  6. package/dist/agent.d.ts +7 -0
  7. package/dist/agent.d.ts.map +1 -1
  8. package/dist/agent.js +10 -29
  9. package/dist/agent.js.map +1 -1
  10. package/dist/harness/reverse-skill-text.d.ts +3 -0
  11. package/dist/harness/reverse-skill-text.d.ts.map +1 -0
  12. package/dist/harness/reverse-skill-text.js +20 -0
  13. package/dist/harness/reverse-skill-text.js.map +1 -0
  14. package/dist/harness/reverse-skill-tool-aliases.d.ts +3 -0
  15. package/dist/harness/reverse-skill-tool-aliases.d.ts.map +1 -0
  16. package/dist/harness/reverse-skill-tool-aliases.js +47 -0
  17. package/dist/harness/reverse-skill-tool-aliases.js.map +1 -0
  18. package/dist/harness/reverse-skill-types.d.ts +76 -0
  19. package/dist/harness/reverse-skill-types.d.ts.map +1 -0
  20. package/dist/harness/reverse-skill-types.js +2 -0
  21. package/dist/harness/reverse-skill-types.js.map +1 -0
  22. package/dist/harness/reverse-skill.d.ts +4 -78
  23. package/dist/harness/reverse-skill.d.ts.map +1 -1
  24. package/dist/harness/reverse-skill.js +113 -61
  25. package/dist/harness/reverse-skill.js.map +1 -1
  26. package/dist/index.d.ts +3 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +3 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/pending-message-queue.d.ts +11 -0
  31. package/dist/pending-message-queue.d.ts.map +1 -0
  32. package/dist/pending-message-queue.js +29 -0
  33. package/dist/pending-message-queue.js.map +1 -0
  34. package/dist/provider-input.d.ts +8 -0
  35. package/dist/provider-input.d.ts.map +1 -0
  36. package/dist/provider-input.js +28 -0
  37. package/dist/provider-input.js.map +1 -0
  38. package/dist/provider-payload-contract.d.ts +6 -0
  39. package/dist/provider-payload-contract.d.ts.map +1 -0
  40. package/dist/provider-payload-contract.js +43 -0
  41. package/dist/provider-payload-contract.js.map +1 -0
  42. package/dist/provider-request-types.d.ts +46 -0
  43. package/dist/provider-request-types.d.ts.map +1 -0
  44. package/dist/provider-request-types.js +2 -0
  45. package/dist/provider-request-types.js.map +1 -0
  46. package/dist/provider-request.d.ts +17 -0
  47. package/dist/provider-request.d.ts.map +1 -0
  48. package/dist/provider-request.js +110 -0
  49. package/dist/provider-request.js.map +1 -0
  50. package/dist/run-model-contract.d.ts +11 -0
  51. package/dist/run-model-contract.d.ts.map +1 -0
  52. package/dist/run-model-contract.js +121 -0
  53. package/dist/run-model-contract.js.map +1 -0
  54. package/dist/types.d.ts +4 -1
  55. package/dist/types.d.ts.map +1 -1
  56. package/dist/types.js.map +1 -1
  57. package/dist/vision-route.d.ts +19 -0
  58. package/dist/vision-route.d.ts.map +1 -0
  59. package/dist/vision-route.js +19 -0
  60. package/dist/vision-route.js.map +1 -0
  61. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"reverse-skill.js","sourceRoot":"","sources":["../../src/harness/reverse-skill.ts"],"names":[],"mappings":"AAoFA,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAClC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AACrC,MAAM,4BAA4B,GAAG,CAAC,CAAC;AACvC,MAAM,kCAAkC,GAAG,EAAE,CAAC;AAE9C,MAAM,CAAC,MAAM,oBAAoB,GAAwB;IACxD;QACC,EAAE,EAAE,aAAa;QACjB,KAAK,EAAE,mCAAmC;QAC1C,SAAS,EAAE,6BAA6B;QACxC,cAAc,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EA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AAG,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC;IACnH,MAAM,cAAc,GACnB,KAAK,CAAC,cAAc;QACpB,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,mDAAmD,CAAC,CAAC;IACpG,MAAM,aAAa,GAAG;QACrB,6EAA6E;QAC7E,8DAA8D;QAC9D,6EAA6E;QAC7E,2DAA2D;KAC3D,CAAC;IAEF,OAAO,0BAA0B,CAAC;QACjC,IAAI;QACJ,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,cAAc;QACd,QAAQ;QACR,aAAa;QACb,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,UAAU,EAAE,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,UAAU,EAAE,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;KAC5E,CAAC,CAAC;AAAA,CACH","sourcesContent":["export type ReverseSkillPlatform = \"windows\" | \"linux\" | \"macos\" | \"kali\" | \"unknown\";\n\nexport type ReverseSkillRisk = \"passive-analysis\" | \"local-tooling\" | \"active-security\" | \"exploit-development\";\n\nexport interface ReverseSkillRoute {\n\tid: string;\n\tlabel: string;\n\tskillPath: string;\n\ttargetPatterns: string[];\n\tintentPatterns: string[];\n\ttoolPatterns: string[];\n\tkeywords: string[];\n\trequiredTools: string[];\n\toptionalTools: string[];\n\tskillHints: string[];\n\tmcpHints: string[];\n\thookHints: string[];\n\tacceptance: string[];\n\tfirstActions: string[];\n\trisk: ReverseSkillRisk;\n}\n\nexport interface ReverseSkillRouteInput {\n\tquery: string;\n\ttargetType?: string;\n\tintent?: string;\n\ttoolchain?: string;\n\tplatform?: ReverseSkillPlatform;\n\tmaxAlternatives?: number;\n}\n\nexport interface ReverseSkillRouteScore {\n\troute: ReverseSkillRoute;\n\tscore: number;\n\tconfidence: number;\n\tmatched: {\n\t\ttarget: string[];\n\t\tintent: string[];\n\t\ttoolchain: string[];\n\t\tkeywords: string[];\n\t};\n\tmissingDimensions: string[];\n}\n\nexport interface ReverseSkillRouteDecision {\n\tquery: string;\n\tplatform: ReverseSkillPlatform;\n\tnormalizedQuery: string;\n\tprimary?: ReverseSkillRouteScore;\n\talternatives: ReverseSkillRouteScore[];\n\tunmatched: boolean;\n\tnextAction: string;\n}\n\nexport interface ReverseSkillSpecInput {\n\tname: string;\n\tdescription?: string;\n\ttriggerSummary: string;\n\trouteIds?: string[];\n\tworkflowSteps?: string[];\n\ttools?: string[];\n\tmcpServers?: string[];\n\thooks?: string[];\n\tacceptance?: string[];\n\treferences?: string[];\n\tsafetyNotes?: string[];\n}\n\nexport interface ReverseSkillSourceFacts {\n\theadings: string[];\n\tskillPaths: string[];\n\tscriptPaths: string[];\n\ttools: string[];\n\tmcpServers: string[];\n\ttriggerTerms: string[];\n}\n\nexport interface ReverseSkillSourceInput {\n\tname?: string;\n\tdescription?: string;\n\tsourceText: string;\n\ttriggerSummary?: string;\n}\n\nconst ROUTE_SCORE_TARGET_WEIGHT = 4;\nconst ROUTE_SCORE_INTENT_WEIGHT = 3;\nconst ROUTE_SCORE_TOOL_WEIGHT = 2;\nconst ROUTE_SCORE_KEYWORD_WEIGHT = 1;\nconst ROUTE_SCORE_FULL_TRIAD_BONUS = 4;\nconst ROUTE_SCORE_CONFIDENCE_DENOMINATOR = 14;\n\nexport const REVERSE_SKILL_ROUTES: ReverseSkillRoute[] = [\n\t{\n\t\tid: \"apk-reverse\",\n\t\tlabel: \"APK / Android reverse engineering\",\n\t\tskillPath: \"skills/apk-reverse/SKILL.md\",\n\t\ttargetPatterns: [\"apk\", \"android\", \"aab\", \"smali\", \"jni\", \"dex\", \"안드로이드\", \"反编译\"],\n\t\tintentPatterns: [\n\t\t\t\"decompile\",\n\t\t\t\"unpack\",\n\t\t\t\"repack\",\n\t\t\t\"manifest\",\n\t\t\t\"frida\",\n\t\t\t\"hook\",\n\t\t\t\"ssl pinning\",\n\t\t\t\"root detection\",\n\t\t\t\"rebuild\",\n\t\t\t\"sign\",\n\t\t\t\"설치\",\n\t\t\t\"리패키징\",\n\t\t],\n\t\ttoolPatterns: [\"jadx\", \"apktool\", \"adb\", \"frida\", \"apksigner\", \"zipalign\", \"objection\"],\n\t\tkeywords: [\"classes.dex\", \"androidmanifest\", \"native library\", \"lib/\", \".so\", \"certificate pinning\", \"smali\"],\n\t\trequiredTools: [\"jadx\", \"apktool\"],\n\t\toptionalTools: [\"adb\", \"frida\", \"apksigner\", \"zipalign\", \"objection\"],\n\t\tskillHints: [\"apk-reverse\", \"reverse-engineering\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"playwright for app docs only\", \"idapro if native .so becomes dominant\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"subagent-stop-audit\"],\n\t\tacceptance: [\n\t\t\t\"Target package structure is identified\",\n\t\t\t\"Static findings cite class/method/file paths\",\n\t\t\t\"Any dynamic step is scoped to a local test device or emulator\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Confirm target artifact path\",\n\t\t\t\"Decode APK metadata\",\n\t\t\t\"Route native .so files to binary analysis when needed\",\n\t\t],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"ida-reverse\",\n\t\tlabel: \"Binary reverse engineering with decompiler-first workflow\",\n\t\tskillPath: \"skills/ida-reverse/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"exe\",\n\t\t\t\"dll\",\n\t\t\t\"elf\",\n\t\t\t\"so\",\n\t\t\t\"dylib\",\n\t\t\t\"macho\",\n\t\t\t\"pe\",\n\t\t\t\"binary\",\n\t\t\t\"firmware blob\",\n\t\t\t\"바이너리\",\n\t\t\t\"二进制\",\n\t\t],\n\t\tintentPatterns: [\n\t\t\t\"decompile\",\n\t\t\t\"disassemble\",\n\t\t\t\"xref\",\n\t\t\t\"call graph\",\n\t\t\t\"data flow\",\n\t\t\t\"rename\",\n\t\t\t\"symbol\",\n\t\t\t\"recover\",\n\t\t\t\"pseudocode\",\n\t\t\t\"함수\",\n\t\t\t\"反汇编\",\n\t\t],\n\t\ttoolPatterns: [\"ida\", \"idapro\", \"idalib\", \"ida-pro-mcp\", \"ghidra\", \"r2\", \"radare2\"],\n\t\tkeywords: [\"imports\", \"exports\", \"strings\", \"function\", \"offset\", \"xref\", \"pdb\", \"symbols\"],\n\t\trequiredTools: [\"idapro\"],\n\t\toptionalTools: [\"idalib-mcp\", \"ghidra\", \"radare2\", \"rabin2\"],\n\t\tskillHints: [\"ida-reverse\", \"radare2\", \"reverse-engineering\", \"binary-diff\"],\n\t\tmcpHints: [\"idapro\", \"filesystem\", \"serena\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Functions are cited by address/name\",\n\t\t\t\"Hypotheses cite disassembly, decompiler, xref, or string evidence\",\n\t\t\t\"Output distinguishes evidence from inference\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Collect file metadata\",\n\t\t\t\"Run strings/imports reconnaissance\",\n\t\t\t\"Choose IDA or CLI path based on available tools\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"radare2\",\n\t\tlabel: \"Binary reconnaissance with radare2 CLI\",\n\t\tskillPath: \"skills/radare2/SKILL.md\",\n\t\ttargetPatterns: [\"binary\", \"elf\", \"pe\", \"macho\", \"so\", \"dll\", \"firmware\", \"바이너리\"],\n\t\tintentPatterns: [\"quick recon\", \"strings\", \"imports\", \"exports\", \"patch\", \"offset\", \"cli\", \"headless\"],\n\t\ttoolPatterns: [\"radare2\", \"r2\", \"rabin2\", \"rasm2\", \"radiff2\"],\n\t\tkeywords: [\"entrypoint\", \"section\", \"symbol\", \"hex\", \"disassembly\", \"patch bytes\"],\n\t\trequiredTools: [\"radare2\", \"rabin2\"],\n\t\toptionalTools: [\"rasm2\", \"radiff2\", \"r2pipe\"],\n\t\tskillHints: [\"radare2\", \"ida-reverse\", \"reverse-engineering\"],\n\t\tmcpHints: [\"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Recon output names sections, imports, symbols, and notable strings\",\n\t\t\t\"Patch guidance includes offset and before/after bytes\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Run file metadata\",\n\t\t\t\"Run rabin2-style reconnaissance\",\n\t\t\t\"Escalate to decompiler if CLI evidence is insufficient\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"js-reverse\",\n\t\tlabel: \"Frontend JavaScript signature and request reconstruction\",\n\t\tskillPath: \"skills/js-reverse/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"javascript\",\n\t\t\t\"js\",\n\t\t\t\"frontend\",\n\t\t\t\"webpack\",\n\t\t\t\"source map\",\n\t\t\t\"sourcemap\",\n\t\t\t\"web\",\n\t\t\t\"browser\",\n\t\t\t\"前端\",\n\t\t\t\"프론트\",\n\t\t],\n\t\tintentPatterns: [\n\t\t\t\"signature\",\n\t\t\t\"encrypted params\",\n\t\t\t\"request replay\",\n\t\t\t\"token\",\n\t\t\t\"decrypt\",\n\t\t\t\"environment patch\",\n\t\t\t\"ast\",\n\t\t\t\"breakpoint\",\n\t\t\t\"hook\",\n\t\t\t\"서명\",\n\t\t\t\"암호화\",\n\t\t],\n\t\ttoolPatterns: [\"playwright\", \"chrome\", \"cdp\", \"jshook\", \"jshookmcp\", \"node\", \"anything-analyzer\"],\n\t\tkeywords: [\n\t\t\t\"sign\",\n\t\t\t\"nonce\",\n\t\t\t\"timestamp\",\n\t\t\t\"crypto\",\n\t\t\t\"axios\",\n\t\t\t\"fetch\",\n\t\t\t\"xhr\",\n\t\t\t\"webpackJsonp\",\n\t\t\t\"localStorage\",\n\t\t\t\"cookie\",\n\t\t],\n\t\trequiredTools: [\"node\"],\n\t\toptionalTools: [\"playwright\", \"jshookmcp\", \"anything-analyzer\", \"chrome\"],\n\t\tskillHints: [\"js-reverse\", \"browser-automation\", \"docs-generator\"],\n\t\tmcpHints: [\"chrome-devtools\", \"playwright\", \"fetch\", \"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"session-context\"],\n\t\tacceptance: [\n\t\t\t\"Target request and parameter names are identified\",\n\t\t\t\"Recovered algorithm has a local reproduction or explicit blocker\",\n\t\t\t\"Browser/runtime observations are tied to request evidence\",\n\t\t],\n\t\tfirstActions: [\"Identify target request\", \"Find producer function\", \"Rebuild the minimum local reproduction\"],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"browser-automation\",\n\t\tlabel: \"Browser or desktop evidence collection\",\n\t\tskillPath: \"skills/browser-automation/SKILL.md\",\n\t\ttargetPatterns: [\"website\", \"browser\", \"web app\", \"desktop app\", \"page\", \"form\", \"웹\", \"브라우저\"],\n\t\tintentPatterns: [\n\t\t\t\"open\",\n\t\t\t\"screenshot\",\n\t\t\t\"fill\",\n\t\t\t\"crawl\",\n\t\t\t\"capture\",\n\t\t\t\"network\",\n\t\t\t\"login\",\n\t\t\t\"observe\",\n\t\t\t\"click\",\n\t\t\t\"샷\",\n\t\t\t\"스크린샷\",\n\t\t],\n\t\ttoolPatterns: [\"playwright\", \"chrome-devtools\", \"agent-browser\", \"openreverse\", \"anything-analyzer\"],\n\t\tkeywords: [\"dom\", \"selector\", \"network log\", \"console\", \"cookie\", \"screenshot\", \"trace\"],\n\t\trequiredTools: [\"playwright\"],\n\t\toptionalTools: [\"chrome\", \"agent-browser\", \"anything-analyzer\"],\n\t\tskillHints: [\"browser-automation\", \"js-reverse\", \"docs-generator\"],\n\t\tmcpHints: [\"playwright\", \"chrome-devtools\", \"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Browser state is captured with URL and selector evidence\",\n\t\t\t\"Screenshots or logs are saved as artifacts when visual proof matters\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Open the target in an isolated browser context\",\n\t\t\t\"Capture visible state\",\n\t\t\t\"Record console/network evidence\",\n\t\t],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"gitreverse\",\n\t\tlabel: \"Repository-to-prompt reconstruction (GitReverse workflow)\",\n\t\tskillPath: \"skills/gitreverse/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"github\",\n\t\t\t\"gitlab\",\n\t\t\t\"gitee\",\n\t\t\t\"repository\",\n\t\t\t\"repo\",\n\t\t\t\"monorepo\",\n\t\t\t\"codebase\",\n\t\t\t\"레포지토리\",\n\t\t\t\"저장소\",\n\t\t],\n\t\tintentPatterns: [\n\t\t\t\"vibe code\",\n\t\t\t\"prompt\",\n\t\t\t\"paste into\",\n\t\t\t\"cursor\",\n\t\t\t\"claude code\",\n\t\t\t\"codex\",\n\t\t\t\"from scratch\",\n\t\t\t\"reconstruct\",\n\t\t\t\"synthesize\",\n\t\t\t\"프롬프트\",\n\t\t],\n\t\ttoolPatterns: [\"git\", \"gh\", \"github cli\", \"github api\", \"gitreverse\"],\n\t\tkeywords: [\n\t\t\t\"owner/repo\",\n\t\t\t\"file tree\",\n\t\t\t\"readme\",\n\t\t\t\"repo metadata\",\n\t\t\t\"shareable link\",\n\t\t\t\"synthetic prompt\",\n\t\t\t\"vibe coding\",\n\t\t],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"git\", \"gh\"],\n\t\tskillHints: [\"gitreverse\", \"clone-website\", \"docs-generator\"],\n\t\tmcpHints: [\"github\", \"filesystem\"],\n\t\thookHints: [\"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Repository owner/name is parsed from the URL or slug before any fetch\",\n\t\t\t\"The generated prompt is grounded in README and file-tree evidence\",\n\t\t\t\"Only public repository data is used; private or credential-bearing content is refused and redacted\",\n\t\t\t\"Observed repo facts and synthesized prompt text are clearly separated\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Parse owner/repo from the GitHub URL or `owner/repo` slug\",\n\t\t\t\"Fetch repo metadata, root file tree (depth 1), and README\",\n\t\t\t\"Synthesize one short conversational prompt grounded in that context\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"ctf-sandbox-orchestrator\",\n\t\tlabel: \"CTF challenge routing\",\n\t\tskillPath: \"../CTF-Sandbox-Orchestrator/ctf-sandbox-orchestrator/SKILL.md\",\n\t\ttargetPatterns: [\"ctf\", \"challenge\", \"flag\", \"pwn\", \"crypto challenge\", \"forensics\", \"misc\", \"rev\", \"대회\"],\n\t\tintentPatterns: [\"solve\", \"find flag\", \"exploit\", \"writeup\", \"sandbox\", \"analyze challenge\"],\n\t\ttoolPatterns: [\"pwntools\", \"gdb\", \"python\", \"sage\", \"z3\", \"binwalk\", \"wireshark\"],\n\t\tkeywords: [\"flag{\", \"ctf\", \"nc \", \"remote\", \"proof\", \"challenge files\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"python\", \"gdb\", \"pwntools\", \"z3\", \"binwalk\"],\n\t\tskillHints: [\"ctf-sandbox-orchestrator\", \"reverse-engineering\", \"pwn-chain\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"memory\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Challenge category is justified by evidence\",\n\t\t\t\"Solution artifacts are reproducible\",\n\t\t\t\"Writeup includes the shortest verified path\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Inventory challenge files\",\n\t\t\t\"Classify dominant evidence\",\n\t\t\t\"Dispatch to the narrowest CTF sub-skill\",\n\t\t],\n\t\trisk: \"exploit-development\",\n\t},\n\t{\n\t\tid: \"api-security\",\n\t\tlabel: \"API security review and authorized test planning\",\n\t\tskillPath: \"skills/api-security/SKILL.md\",\n\t\ttargetPatterns: [\"api\", \"rest\", \"graphql\", \"websocket\", \"jwt\", \"oauth\", \"endpoint\"],\n\t\tintentPatterns: [\"review\", \"test\", \"auth\", \"idor\", \"bola\", \"bfla\", \"rate limit\", \"schema\", \"권한\", \"越权\"],\n\t\ttoolPatterns: [\"burp\", \"postman\", \"nuclei\", \"zap\", \"curl\", \"graphql\"],\n\t\tkeywords: [\"authorization\", \"authentication\", \"tenant\", \"object id\", \"jwt\", \"scope\", \"graphql\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"burpsuite\", \"nuclei\", \"zap\", \"node\", \"python\"],\n\t\tskillHints: [\"api-security\", \"pentest-tools\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"github\", \"playwright\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Scope boundary is explicit\",\n\t\t\t\"Findings include request/response evidence or code references\",\n\t\t\t\"High-risk active steps require explicit target scope\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Identify API surface\",\n\t\t\t\"Map auth and tenant boundaries\",\n\t\t\t\"Choose static review or scoped dynamic testing\",\n\t\t],\n\t\trisk: \"active-security\",\n\t},\n\t{\n\t\tid: \"supply-chain-security\",\n\t\tlabel: \"Supply-chain and CI/CD security analysis\",\n\t\tskillPath: \"skills/supply-chain-security/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"dependency\",\n\t\t\t\"package\",\n\t\t\t\"sbom\",\n\t\t\t\"container\",\n\t\t\t\"docker\",\n\t\t\t\"ci\",\n\t\t\t\"workflow\",\n\t\t\t\"github actions\",\n\t\t\t\"supply chain\",\n\t\t],\n\t\tintentPatterns: [\"scan\", \"audit\", \"gitleaks\", \"trivy\", \"osv\", \"syft\", \"secret\", \"provenance\", \"attestation\"],\n\t\ttoolPatterns: [\"trivy\", \"syft\", \"gitleaks\", \"osv-scanner\", \"npm audit\", \"semgrep\"],\n\t\tkeywords: [\"package-lock\", \"npm-shrinkwrap\", \"dockerfile\", \"workflow\", \"actions\", \"secret\", \"sbom\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"trivy\", \"syft\", \"gitleaks\", \"osv-scanner\", \"semgrep\"],\n\t\tskillHints: [\"supply-chain-security\", \"security-review\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"github\"],\n\t\thookHints: [\"protect-secrets\", \"pre-shell-guard\", \"npm-audit-summary\"],\n\t\tacceptance: [\n\t\t\t\"Dependency, workflow, and secret surfaces are separated\",\n\t\t\t\"Findings cite exact files and lockfile evidence\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Inventory package managers and workflows\",\n\t\t\t\"Run non-mutating scans first\",\n\t\t\t\"Triangulate tool output with source evidence\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"docs-generator\",\n\t\tlabel: \"Security or reverse-engineering report generation\",\n\t\tskillPath: \"skills/docs-generator/SKILL.md\",\n\t\ttargetPatterns: [\"report\", \"writeup\", \"documentation\", \"diagram\", \"flowchart\", \"보고서\", \"문서\"],\n\t\tintentPatterns: [\"write\", \"summarize\", \"generate\", \"document\", \"explain\", \"diagram\", \"publish\"],\n\t\ttoolPatterns: [\"markdown\", \"mermaid\", \"graphviz\", \"plantuml\", \"pdf\"],\n\t\tkeywords: [\"executive summary\", \"reproduction\", \"impact\", \"timeline\", \"artifact\", \"evidence\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"graphviz\", \"plantuml\", \"pandoc\"],\n\t\tskillHints: [\"docs-generator\", \"diagram-generator\"],\n\t\tmcpHints: [\"filesystem\"],\n\t\thookHints: [\"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Report separates facts, analysis, and recommendations\",\n\t\t\t\"Artifacts and commands are reproducible\",\n\t\t\t\"Sensitive values are redacted\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Collect evidence paths\",\n\t\t\t\"Choose report template\",\n\t\t\t\"Add at least one flow or evidence diagram when useful\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n];\n\nconst TOOL_ALIASES: Record<string, string[]> = {\n\t\"anything-analyzer\": [\"anything-analyzer\"],\n\tadb: [\"adb\"],\n\tapktool: [\"apktool\"],\n\tapksigner: [\"apksigner\"],\n\tbinwalk: [\"binwalk\"],\n\tburpsuite: [\"burpsuite\"],\n\tchrome: [\"google-chrome\", \"chromium\", \"chrome\"],\n\tfrida: [\"frida\", \"frida-ps\"],\n\tgdb: [\"gdb\"],\n\tgh: [\"gh\"],\n\tgit: [\"git\"],\n\tghidra: [\"ghidraRun\", \"analyzeHeadless\"],\n\tgitleaks: [\"gitleaks\"],\n\tgraphviz: [\"dot\"],\n\tidapro: [\"ida\", \"idat\", \"idat64\"],\n\t\"idalib-mcp\": [\"ida-pro-mcp\", \"idalib-mcp\"],\n\tjadx: [\"jadx\"],\n\tjshookmcp: [\"jshook\", \"npx\"],\n\tnode: [\"node\"],\n\tnuclei: [\"nuclei\"],\n\tpandoc: [\"pandoc\"],\n\tplantuml: [\"plantuml\"],\n\tplaywright: [\"playwright\", \"npx\"],\n\tpwntools: [\"python\"],\n\tpython: [\"python3\", \"python\"],\n\tradare2: [\"radare2\", \"r2\"],\n\trabin2: [\"rabin2\"],\n\tradiff2: [\"radiff2\"],\n\trasm2: [\"rasm2\"],\n\tsemgrep: [\"semgrep\"],\n\tsyft: [\"syft\"],\n\ttrivy: [\"trivy\"],\n\tzap: [\"zap.sh\", \"zap-baseline.py\"],\n\tzipalign: [\"zipalign\"],\n\tz3: [\"z3\"],\n};\n\nexport function getReverseSkillToolAliases(tool: string): string[] {\n\treturn TOOL_ALIASES[tool] ?? [tool];\n}\n\nexport function normalizeReverseSkillText(text: string | undefined): string {\n\treturn (text ?? \"\")\n\t\t.normalize(\"NFKC\")\n\t\t.toLowerCase()\n\t\t.replace(/[\\u2018\\u2019]/g, \"'\")\n\t\t.replace(/[\\u201c\\u201d]/g, '\"')\n\t\t.replace(/[_./\\\\:-]+/g, \" \")\n\t\t.replace(/\\s+/g, \" \")\n\t\t.trim();\n}\n\nfunction findPatternMatches(text: string, patterns: string[]): string[] {\n\tconst matches: string[] = [];\n\tfor (const pattern of patterns) {\n\t\tconst normalizedPattern = normalizeReverseSkillText(pattern);\n\t\tif (!normalizedPattern) continue;\n\t\tif (text.includes(normalizedPattern)) matches.push(pattern);\n\t}\n\treturn matches;\n}\n\nfunction unique(items: string[]): string[] {\n\treturn Array.from(new Set(items.filter((item) => item.trim().length > 0)));\n}\n\nfunction clampConfidence(score: number): number {\n\tif (score <= 0) return 0;\n\treturn Math.min(0.99, Number((score / ROUTE_SCORE_CONFIDENCE_DENOMINATOR).toFixed(2)));\n}\n\nfunction scoreRoute(\n\troute: ReverseSkillRoute,\n\tinput: ReverseSkillRouteInput,\n\tnormalizedQuery: string,\n): ReverseSkillRouteScore {\n\tconst targetText = normalizeReverseSkillText(`${input.targetType ?? \"\"} ${normalizedQuery}`);\n\tconst intentText = normalizeReverseSkillText(`${input.intent ?? \"\"} ${normalizedQuery}`);\n\tconst toolText = normalizeReverseSkillText(`${input.toolchain ?? \"\"} ${normalizedQuery}`);\n\n\tconst target = findPatternMatches(targetText, route.targetPatterns);\n\tconst intent = findPatternMatches(intentText, route.intentPatterns);\n\tconst toolchain = findPatternMatches(toolText, route.toolPatterns);\n\tconst keywords = findPatternMatches(normalizedQuery, route.keywords);\n\n\tlet score =\n\t\ttarget.length * ROUTE_SCORE_TARGET_WEIGHT +\n\t\tintent.length * ROUTE_SCORE_INTENT_WEIGHT +\n\t\ttoolchain.length * ROUTE_SCORE_TOOL_WEIGHT +\n\t\tkeywords.length * ROUTE_SCORE_KEYWORD_WEIGHT;\n\n\tif (target.length > 0 && intent.length > 0 && toolchain.length > 0) {\n\t\tscore += ROUTE_SCORE_FULL_TRIAD_BONUS;\n\t}\n\n\tconst missingDimensions: string[] = [];\n\tif (target.length === 0) missingDimensions.push(\"target\");\n\tif (intent.length === 0) missingDimensions.push(\"intent\");\n\tif (toolchain.length === 0) missingDimensions.push(\"toolchain\");\n\n\treturn {\n\t\troute,\n\t\tscore,\n\t\tconfidence: clampConfidence(score),\n\t\tmatched: { target, intent, toolchain, keywords },\n\t\tmissingDimensions,\n\t};\n}\n\nexport function routeReverseSkill(input: ReverseSkillRouteInput): ReverseSkillRouteDecision {\n\tconst normalizedQuery = normalizeReverseSkillText(input.query);\n\tconst platform = input.platform ?? \"unknown\";\n\tconst maxAlternatives = input.maxAlternatives ?? 3;\n\tconst scored = REVERSE_SKILL_ROUTES.map((route) => scoreRoute(route, input, normalizedQuery))\n\t\t.filter((candidate) => candidate.score > 0)\n\t\t.sort(\n\t\t\t(a, b) => b.score - a.score || REVERSE_SKILL_ROUTES.indexOf(a.route) - REVERSE_SKILL_ROUTES.indexOf(b.route),\n\t\t);\n\n\tconst primary = scored[0];\n\tconst alternatives = scored.slice(1, maxAlternatives + 1);\n\tconst unmatched = !primary || primary.score < ROUTE_SCORE_TARGET_WEIGHT || primary.confidence < 0.18;\n\tconst nextAction = unmatched\n\t\t? \"No strong route matched. Create or extend a reverse-skill route before executing specialized tooling.\"\n\t\t: `Read ${primary.route.skillPath}, then execute first action: ${primary.route.firstActions[0] ?? \"classify target\"}.`;\n\n\treturn {\n\t\tquery: input.query,\n\t\tplatform,\n\t\tnormalizedQuery,\n\t\tprimary: unmatched ? undefined : primary,\n\t\talternatives,\n\t\tunmatched,\n\t\tnextAction,\n\t};\n}\n\nfunction formatMatches(score: ReverseSkillRouteScore): string {\n\tconst parts = [\n\t\t`target=${score.matched.target.join(\", \") || \"—\"}`,\n\t\t`intent=${score.matched.intent.join(\", \") || \"—\"}`,\n\t\t`toolchain=${score.matched.toolchain.join(\", \") || \"—\"}`,\n\t\t`keywords=${score.matched.keywords.join(\", \") || \"—\"}`,\n\t];\n\treturn parts.join(\"; \");\n}\n\nexport function formatReverseSkillRouteDecision(decision: ReverseSkillRouteDecision): string {\n\tif (decision.unmatched || !decision.primary) {\n\t\treturn [\n\t\t\t\"# Reverse Skill Route\",\n\t\t\t\"\",\n\t\t\t`Query: ${decision.query}`,\n\t\t\t\"\",\n\t\t\t\"No strong route matched.\",\n\t\t\t\"Next action: create or extend a route before specialized execution.\",\n\t\t].join(\"\\n\");\n\t}\n\n\tconst primary = decision.primary;\n\tconst lines = [\n\t\t\"# Reverse Skill Route\",\n\t\t\"\",\n\t\t`Query: ${decision.query}`,\n\t\t`Platform: ${decision.platform}`,\n\t\t\"\",\n\t\t`## Primary: ${primary.route.label}`,\n\t\t`- Route ID: ${primary.route.id}`,\n\t\t`- Skill path: ${primary.route.skillPath}`,\n\t\t`- Confidence: ${primary.confidence}`,\n\t\t`- Score: ${primary.score}`,\n\t\t`- Matches: ${formatMatches(primary)}`,\n\t\t`- Risk: ${primary.route.risk}`,\n\t\t`- Required tools: ${primary.route.requiredTools.join(\", \") || \"none\"}`,\n\t\t`- Optional tools: ${primary.route.optionalTools.join(\", \") || \"none\"}`,\n\t\t`- Skill hints: ${primary.route.skillHints.join(\", \")}`,\n\t\t`- MCP hints: ${primary.route.mcpHints.join(\", \")}`,\n\t\t`- Hooks: ${primary.route.hookHints.join(\", \")}`,\n\t\t\"\",\n\t\t\"## First actions\",\n\t\t...primary.route.firstActions.map((action, index) => `${index + 1}. ${action}`),\n\t\t\"\",\n\t\t\"## Acceptance\",\n\t\t...primary.route.acceptance.map((item) => `- ${item}`),\n\t];\n\n\tif (decision.alternatives.length > 0) {\n\t\tlines.push(\"\", \"## Alternatives\");\n\t\tfor (const alternative of decision.alternatives) {\n\t\t\tlines.push(`- ${alternative.route.id} (${alternative.confidence}): ${formatMatches(alternative)}`);\n\t\t}\n\t}\n\n\tlines.push(\"\", `Next action: ${decision.nextAction}`);\n\treturn lines.join(\"\\n\");\n}\n\nexport function planReverseSkillToolChecks(decision: ReverseSkillRouteDecision, maxTools = 12): string[] {\n\tconst routes = [decision.primary, ...decision.alternatives].filter((score): score is ReverseSkillRouteScore =>\n\t\tBoolean(score),\n\t);\n\tconst tools: string[] = [];\n\tfor (const score of routes) {\n\t\ttools.push(...score.route.requiredTools, ...score.route.optionalTools);\n\t}\n\treturn unique(tools).slice(0, maxTools);\n}\n\nexport function normalizeReverseSkillName(name: string): string {\n\tconst normalized = normalizeReverseSkillText(name)\n\t\t.replace(/[^a-z0-9-]+/g, \"-\")\n\t\t.replace(/-+/g, \"-\")\n\t\t.replace(/^-|-$/g, \"\")\n\t\t.slice(0, 64)\n\t\t.replace(/-$/g, \"\");\n\treturn normalized || \"reverse-skill\";\n}\n\nfunction yamlString(value: string): string {\n\treturn JSON.stringify(value);\n}\n\nfunction compactDescription(input: ReverseSkillSpecInput, routes: ReverseSkillRoute[]): string {\n\tconst fallback = `Use when ${input.triggerSummary}`;\n\tconst base = input.description?.trim() || fallback;\n\tconst routeNames = routes.map((route) => route.id).join(\", \");\n\tconst suffix = routeNames ? ` Routes through ${routeNames}.` : \"\";\n\tconst description = `${base}${suffix}`;\n\treturn description.length <= 1024 ? description : `${description.slice(0, 1021).trimEnd()}...`;\n}\n\nfunction routesFromIds(routeIds: string[] | undefined): ReverseSkillRoute[] {\n\tif (!routeIds) return [];\n\treturn routeIds\n\t\t.map((routeId) => REVERSE_SKILL_ROUTES.find((route) => route.id === routeId))\n\t\t.filter((route): route is ReverseSkillRoute => Boolean(route));\n}\n\nexport function formatReverseSkillMarkdown(input: ReverseSkillSpecInput): string {\n\tconst routes = routesFromIds(input.routeIds);\n\tconst name = normalizeReverseSkillName(input.name);\n\tconst description = compactDescription(input, routes);\n\tconst workflowSteps = input.workflowSteps?.length\n\t\t? input.workflowSteps\n\t\t: [\n\t\t\t\t\"Classify target, intent, and available toolchain before execution\",\n\t\t\t\t\"Read the routed sub-skill or reference\",\n\t\t\t\t\"Collect evidence and record blockers\",\n\t\t\t\t\"Verify output against acceptance criteria\",\n\t\t\t];\n\tconst tools = unique([\n\t\t...(input.tools ?? []),\n\t\t...routes.flatMap((route) => [...route.requiredTools, ...route.optionalTools]),\n\t]);\n\tconst mcpServers = unique([...(input.mcpServers ?? []), ...routes.flatMap((route) => route.mcpHints)]);\n\tconst hooks = unique([...(input.hooks ?? []), ...routes.flatMap((route) => route.hookHints)]);\n\tconst acceptance = unique([...(input.acceptance ?? []), ...routes.flatMap((route) => route.acceptance)]);\n\tconst safetyNotes = input.safetyNotes?.length\n\t\t? input.safetyNotes\n\t\t: [\n\t\t\t\t\"Operate only on user-provided local artifacts or explicitly scoped targets\",\n\t\t\t\t\"Do not write secrets, tokens, credentials, or raw private data into skill artifacts\",\n\t\t\t];\n\n\tconst lines = [\n\t\t\"---\",\n\t\t`name: ${name}`,\n\t\t`description: ${yamlString(description)}`,\n\t\t\"---\",\n\t\t\"\",\n\t\t`# ${name}`,\n\t\t\"\",\n\t\t\"## Routing contract\",\n\t\t\"\",\n\t\t`Trigger this skill when ${input.triggerSummary}.`,\n\t\t\"\",\n\t\t\"1. Classify the target type, user intent, and toolchain signals before choosing tools.\",\n\t\t\"2. Read the narrowest referenced sub-skill or reference before running specialized tooling.\",\n\t\t\"3. Prefer passive/local evidence collection first; escalate only when the task scope requires it.\",\n\t\t\"4. Save evidence paths and blockers in the final response.\",\n\t\t\"\",\n\t\t\"## Workflow\",\n\t\t\"\",\n\t\t...workflowSteps.map((step, index) => `${index + 1}. ${step}`),\n\t\t\"\",\n\t\t\"## Tool selection\",\n\t\t\"\",\n\t\t`- Tools: ${tools.join(\", \") || \"none required\"}`,\n\t\t`- MCP: ${mcpServers.join(\", \") || \"filesystem/read-only\"}`,\n\t\t`- Hooks: ${hooks.join(\", \") || \"pre-shell-guard, protect-secrets\"}`,\n\t\t\"\",\n\t\t\"## Acceptance\",\n\t\t\"\",\n\t\t...(acceptance.length > 0\n\t\t\t? acceptance.map((item) => `- ${item}`)\n\t\t\t: [\"- Output includes routed skill, evidence, commands, and remaining blockers\"]),\n\t\t\"\",\n\t\t\"## Safety constraints\",\n\t\t\"\",\n\t\t...safetyNotes.map((note) => `- ${note}`),\n\t];\n\n\tif (routes.length > 0) {\n\t\tlines.push(\"\", \"## Built-in routes\", \"\");\n\t\tfor (const route of routes) {\n\t\t\tlines.push(`- ${route.id}: ${route.skillPath}`);\n\t\t}\n\t}\n\n\tif (input.references?.length) {\n\t\tlines.push(\"\", \"## References\", \"\");\n\t\tfor (const reference of input.references) lines.push(`- ${reference}`);\n\t}\n\n\treturn `${lines.join(\"\\n\").trimEnd()}\\n`;\n}\n\nexport function extractReverseSkillFactsFromMarkdown(sourceText: string): ReverseSkillSourceFacts {\n\tconst headings = unique(\n\t\tArray.from(sourceText.matchAll(/^#{1,4}\\s+(.+)$/gm)).map((match) => match[1]?.trim() ?? \"\"),\n\t).slice(0, 24);\n\tconst skillPaths = unique(\n\t\tArray.from(sourceText.matchAll(/[`(\\s]([^`\\s)]+SKILL\\.md)/g)).map((match) => match[1] ?? \"\"),\n\t);\n\tconst scriptPaths = unique(\n\t\tArray.from(sourceText.matchAll(/[`(\\s]([^`\\s)]+\\.(?:ps1|sh|py|js|ts))/g)).map((match) => match[1] ?? \"\"),\n\t);\n\tconst knownTools = Object.keys(TOOL_ALIASES);\n\tconst normalizedSource = normalizeReverseSkillText(sourceText);\n\tconst tools = knownTools.filter((tool) => normalizedSource.includes(normalizeReverseSkillText(tool)));\n\tconst mcpServers = unique(\n\t\tArray.from(sourceText.matchAll(/\\b([a-z0-9-]+)\\s+MCP\\b/gi)).map((match) => match[1]?.toLowerCase() ?? \"\"),\n\t);\n\tconst triggerTerms = unique(\n\t\tREVERSE_SKILL_ROUTES.flatMap((route) => [\n\t\t\t...route.targetPatterns,\n\t\t\t...route.intentPatterns,\n\t\t\t...route.toolPatterns,\n\t\t]).filter((term) => normalizedSource.includes(normalizeReverseSkillText(term))),\n\t).slice(0, 40);\n\n\treturn { headings, skillPaths, scriptPaths, tools, mcpServers, triggerTerms };\n}\n\nexport function formatReverseSkillFromSource(input: ReverseSkillSourceInput): string {\n\tconst facts = extractReverseSkillFactsFromMarkdown(input.sourceText);\n\tconst query = [input.triggerSummary, facts.triggerTerms.slice(0, 12).join(\" \"), facts.headings.slice(0, 8).join(\" \")]\n\t\t.filter(Boolean)\n\t\t.join(\" \");\n\tconst decision = routeReverseSkill({ query: query || input.sourceText.slice(0, 500) });\n\tconst routeIds = [decision.primary?.route.id, ...decision.alternatives.map((item) => item.route.id)].filter(\n\t\t(routeId): routeId is string => Boolean(routeId),\n\t);\n\tconst name = input.name ?? (decision.primary ? `${decision.primary.route.id}-workflow` : \"reverse-skill-workflow\");\n\tconst triggerSummary =\n\t\tinput.triggerSummary ??\n\t\t(facts.triggerTerms.slice(0, 8).join(\", \") || \"reverse-engineering or security routing is needed\");\n\tconst workflowSteps = [\n\t\t\"Classify the incoming request against target, intent, and toolchain signals\",\n\t\t\"Load the routed sub-skill before running specialized tooling\",\n\t\t\"Check local tool availability only for tools required by the selected route\",\n\t\t\"Return evidence paths, commands, confidence, and blockers\",\n\t];\n\n\treturn formatReverseSkillMarkdown({\n\t\tname,\n\t\tdescription: input.description,\n\t\ttriggerSummary,\n\t\trouteIds,\n\t\tworkflowSteps,\n\t\ttools: facts.tools,\n\t\tmcpServers: facts.mcpServers,\n\t\treferences: unique([...facts.skillPaths, ...facts.scriptPaths]).slice(0, 20),\n\t});\n}\n"]}
1
+ {"version":3,"file":"reverse-skill.js","sourceRoot":"","sources":["../../src/harness/reverse-skill.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAC/F,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAE/F,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,yBAAyB,GA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AM,QAAQ,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,GAAG,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAC1G,CAAC,OAAO,EAAqB,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAChD,CAAC;IACF,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC;IACnH,MAAM,cAAc,GACnB,KAAK,CAAC,cAAc;QACpB,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,mDAAmD,CAAC,CAAC;IACpG,MAAM,aAAa,GAAG;QACrB,6EAA6E;QAC7E,8DAA8D;QAC9D,6EAA6E;QAC7E,2DAA2D;KAC3D,CAAC;IAEF,OAAO,0BAA0B,CAAC;QACjC,IAAI;QACJ,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,cAAc;QACd,QAAQ;QACR,aAAa;QACb,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,UAAU,EAAE,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,UAAU,EAAE,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;KAC5E,CAAC,CAAC;AAAA,CACH","sourcesContent":["import type {\n\tReverseSkillRoute,\n\tReverseSkillRouteDecision,\n\tReverseSkillRouteInput,\n\tReverseSkillRouteScore,\n\tReverseSkillSourceFacts,\n\tReverseSkillSourceInput,\n\tReverseSkillSpecInput,\n} from \"./reverse-skill-types.ts\";\n\nexport type {\n\tReverseSkillPlatform,\n\tReverseSkillRisk,\n\tReverseSkillRoute,\n\tReverseSkillRouteDecision,\n\tReverseSkillRouteInput,\n\tReverseSkillRouteScore,\n\tReverseSkillSourceFacts,\n\tReverseSkillSourceInput,\n\tReverseSkillSpecInput,\n} from \"./reverse-skill-types.ts\";\n\nimport { normalizeReverseSkillName, normalizeReverseSkillText } from \"./reverse-skill-text.ts\";\nimport { TOOL_ALIASES } from \"./reverse-skill-tool-aliases.ts\";\n\nexport { normalizeReverseSkillName, normalizeReverseSkillText } from \"./reverse-skill-text.ts\";\n\nexport { getReverseSkillToolAliases } from \"./reverse-skill-tool-aliases.ts\";\n\nconst ROUTE_SCORE_TARGET_WEIGHT = 4;\nconst ROUTE_SCORE_INTENT_WEIGHT = 3;\nconst ROUTE_SCORE_TOOL_WEIGHT = 2;\nconst ROUTE_SCORE_KEYWORD_WEIGHT = 1;\nconst ROUTE_SCORE_FULL_TRIAD_BONUS = 4;\nconst ROUTE_SCORE_CONFIDENCE_DENOMINATOR = 14;\n\nexport const REVERSE_SKILL_ROUTES: ReverseSkillRoute[] = [\n\t{\n\t\tid: \"api-spec-recover\",\n\t\tlabel: \"Recover OpenAPI specs from mitmproxy flows or HAR\",\n\t\tskillPath: \"skills/omk-reverse-skill/packs/api-spec-recover/SKILL.md\",\n\t\ttargetPatterns: [\"mitmproxy\", \"mitmweb\", \"mitmdump\", \"har\", \"openapi\", \"swagger\", \"flow file\"],\n\t\tintentPatterns: [\"convert\", \"specification\", \"spec\", \"recover\", \"reverse-engineer rest\", \"generate spec\"],\n\t\ttoolPatterns: [\"mitmproxy2swagger\", \"mitmproxy\", \"mitmweb\", \"mitmdump\"],\n\t\tkeywords: [\"x-path-templates\", \"api prefix\", \"openapi 3\", \"ignore:\", \"swagger.yml\"],\n\t\trequiredTools: [\"mitmproxy2swagger\"],\n\t\toptionalTools: [\"mitmproxy\", \"mitmweb\"],\n\t\tskillHints: [\"omk-reverse-skill\", \"api-security\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"playwright\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Input is a local mitmproxy flow or HAR path\",\n\t\t\t\"api_prefix is justified from observed URLs\",\n\t\t\t\"OpenAPI YAML has selected paths un-ignored and secrets redacted\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Confirm flow/HAR path\",\n\t\t\t\"Infer api_prefix from captured URLs\",\n\t\t\t\"Run mitmproxy2swagger first pass, then edit ignore: prefixes\",\n\t\t],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"api-client-gen\",\n\t\tlabel: \"HAR capture to Python API client\",\n\t\tskillPath: \"skills/omk-reverse-skill/packs/api-client-gen/SKILL.md\",\n\t\ttargetPatterns: [\"har\", \"website api\", \"undocumented api\", \"api client\"],\n\t\tintentPatterns: [\"generate\", \"client\", \"capture\", \"python\", \"recorded traffic\", \"automate website\"],\n\t\ttoolPatterns: [\"playwright\", \"har_filter\", \"har_analyze\", \"python\"],\n\t\tkeywords: [\"har file\", \"api client\", \"pagination\", \"auth pattern\", \"coverage\"],\n\t\trequiredTools: [\"python\"],\n\t\toptionalTools: [\"playwright\", \"node\"],\n\t\tskillHints: [\"omk-reverse-skill\", \"api-security\", \"browser-automation\"],\n\t\tmcpHints: [\"playwright\", \"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"HAR path is local and cited\",\n\t\t\t\"Generated client methods map to analyzed endpoints\",\n\t\t\t\"Validation coverage is >= 90 or blockers are listed\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Obtain or capture a HAR\",\n\t\t\t\"Filter with har_filter.py\",\n\t\t\t\"Analyze then generate from the api_client.py template\",\n\t\t],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"protocol-re\",\n\t\tlabel: \"Network protocol reverse engineering\",\n\t\tskillPath: \"skills/omk-reverse-skill/packs/protocol-re/SKILL.md\",\n\t\ttargetPatterns: [\"pcap\", \"pcapng\", \"protocol\", \"proprietary protocol\", \"custom protocol\"],\n\t\tintentPatterns: [\"dissect\", \"decode\", \"parse\", \"document protocol\", \"lua dissector\", \"fuzz\"],\n\t\ttoolPatterns: [\"tshark\", \"tcpdump\", \"wireshark\", \"scapy\", \"mitmdump\", \"mitmproxy\"],\n\t\tkeywords: [\"tlv\", \"length prefix\", \"magic\", \"entropy\", \"sslkeylogfile\", \"framing\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"tshark\", \"tcpdump\", \"python\"],\n\t\tskillHints: [\"omk-reverse-skill\", \"ida-reverse\"],\n\t\tmcpHints: [\"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Capture path is cited\",\n\t\t\t\"Framing is evidenced from bytes, not guessed\",\n\t\t\t\"Spec table includes offsets and sizes\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Confirm pcap/flow path\",\n\t\t\t\"Identify transport and magic/length framing\",\n\t\t\t\"Write a header layout table before implementing a parser\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"ghidra-ida-re\",\n\t\tlabel: \"Ghidra headless and IDAPython binary analysis\",\n\t\tskillPath: \"skills/omk-reverse-skill/packs/ghidra-ida-re/SKILL.md\",\n\t\ttargetPatterns: [\"ghidra\", \"idapython\", \"ghidra project\", \"malware sample\"],\n\t\tintentPatterns: [\n\t\t\t\"analyzeheadless\",\n\t\t\t\"headless\",\n\t\t\t\"idapython\",\n\t\t\t\"function signatures\",\n\t\t\t\"ghidra_bridge\",\n\t\t\t\"batch analysis\",\n\t\t],\n\t\ttoolPatterns: [\"analyzeheadless\", \"ghidra\", \"idapython\", \"ghidra_bridge\", \"ghidrathon\"],\n\t\tkeywords: [\"postscript\", \"exportevidence\", \"flirt\", \"call graph export\"],\n\t\trequiredTools: [\"ghidra\"],\n\t\toptionalTools: [\"idapro\", \"idalib-mcp\", \"python\"],\n\t\tskillHints: [\"omk-reverse-skill\", \"ida-reverse\", \"reverse-engineering-binary\"],\n\t\tmcpHints: [\"filesystem\", \"idapro\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Binary path and format are recorded\",\n\t\t\t\"Functions are cited by address or recovered name\",\n\t\t\t\"Evidence is separated from inference\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Collect file metadata\",\n\t\t\t\"Run analyzeHeadless with an evidence post-script\",\n\t\t\t\"Escalate selected functions to interactive Ghidra or IDA\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"apk-reverse\",\n\t\tlabel: \"APK / Android reverse engineering\",\n\t\tskillPath: \"skills/omk-reverse-skill/packs/android-re/SKILL.md\",\n\t\ttargetPatterns: [\"apk\", \"android\", \"aab\", \"smali\", \"jni\", \"dex\", \"안드로이드\", \"反编译\"],\n\t\tintentPatterns: [\n\t\t\t\"decompile\",\n\t\t\t\"unpack\",\n\t\t\t\"repack\",\n\t\t\t\"manifest\",\n\t\t\t\"frida\",\n\t\t\t\"hook\",\n\t\t\t\"ssl pinning\",\n\t\t\t\"root detection\",\n\t\t\t\"rebuild\",\n\t\t\t\"sign\",\n\t\t\t\"설치\",\n\t\t\t\"리패키징\",\n\t\t],\n\t\ttoolPatterns: [\"jadx\", \"apktool\", \"adb\", \"frida\", \"apksigner\", \"zipalign\", \"objection\"],\n\t\tkeywords: [\"classes.dex\", \"androidmanifest\", \"native library\", \"lib/\", \".so\", \"certificate pinning\", \"smali\"],\n\t\trequiredTools: [\"jadx\", \"apktool\"],\n\t\toptionalTools: [\"adb\", \"frida\", \"apksigner\", \"zipalign\", \"objection\"],\n\t\tskillHints: [\"omk-reverse-skill\", \"apk-reverse\", \"reverse-engineering\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"playwright for app docs only\", \"idapro if native .so becomes dominant\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"subagent-stop-audit\"],\n\t\tacceptance: [\n\t\t\t\"Target package structure is identified\",\n\t\t\t\"Static findings cite class/method/file paths\",\n\t\t\t\"Any dynamic step is scoped to a local test device or emulator\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Confirm target artifact path\",\n\t\t\t\"Decode APK metadata\",\n\t\t\t\"Route native .so files to binary analysis when needed\",\n\t\t],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"ida-reverse\",\n\t\tlabel: \"Binary reverse engineering with decompiler-first workflow\",\n\t\tskillPath: \"skills/ida-reverse/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"exe\",\n\t\t\t\"dll\",\n\t\t\t\"elf\",\n\t\t\t\"so\",\n\t\t\t\"dylib\",\n\t\t\t\"macho\",\n\t\t\t\"pe\",\n\t\t\t\"binary\",\n\t\t\t\"firmware blob\",\n\t\t\t\"바이너리\",\n\t\t\t\"二进制\",\n\t\t],\n\t\tintentPatterns: [\n\t\t\t\"decompile\",\n\t\t\t\"disassemble\",\n\t\t\t\"xref\",\n\t\t\t\"call graph\",\n\t\t\t\"data flow\",\n\t\t\t\"rename\",\n\t\t\t\"symbol\",\n\t\t\t\"recover\",\n\t\t\t\"pseudocode\",\n\t\t\t\"함수\",\n\t\t\t\"反汇编\",\n\t\t],\n\t\ttoolPatterns: [\"ida\", \"idapro\", \"idalib\", \"ida-pro-mcp\", \"ghidra\", \"r2\", \"radare2\"],\n\t\tkeywords: [\"imports\", \"exports\", \"strings\", \"function\", \"offset\", \"xref\", \"pdb\", \"symbols\"],\n\t\trequiredTools: [\"idapro\"],\n\t\toptionalTools: [\"idalib-mcp\", \"ghidra\", \"radare2\", \"rabin2\"],\n\t\tskillHints: [\"ida-reverse\", \"radare2\", \"reverse-engineering\", \"binary-diff\"],\n\t\tmcpHints: [\"idapro\", \"filesystem\", \"serena\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Functions are cited by address/name\",\n\t\t\t\"Hypotheses cite disassembly, decompiler, xref, or string evidence\",\n\t\t\t\"Output distinguishes evidence from inference\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Collect file metadata\",\n\t\t\t\"Run strings/imports reconnaissance\",\n\t\t\t\"Choose IDA or CLI path based on available tools\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"radare2\",\n\t\tlabel: \"Binary reconnaissance with radare2 CLI\",\n\t\tskillPath: \"skills/radare2/SKILL.md\",\n\t\ttargetPatterns: [\"binary\", \"elf\", \"pe\", \"macho\", \"so\", \"dll\", \"firmware\", \"바이너리\"],\n\t\tintentPatterns: [\"quick recon\", \"strings\", \"imports\", \"exports\", \"patch\", \"offset\", \"cli\", \"headless\"],\n\t\ttoolPatterns: [\"radare2\", \"r2\", \"rabin2\", \"rasm2\", \"radiff2\"],\n\t\tkeywords: [\"entrypoint\", \"section\", \"symbol\", \"hex\", \"disassembly\", \"patch bytes\"],\n\t\trequiredTools: [\"radare2\", \"rabin2\"],\n\t\toptionalTools: [\"rasm2\", \"radiff2\", \"r2pipe\"],\n\t\tskillHints: [\"radare2\", \"ida-reverse\", \"reverse-engineering\"],\n\t\tmcpHints: [\"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Recon output names sections, imports, symbols, and notable strings\",\n\t\t\t\"Patch guidance includes offset and before/after bytes\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Run file metadata\",\n\t\t\t\"Run rabin2-style reconnaissance\",\n\t\t\t\"Escalate to decompiler if CLI evidence is insufficient\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"js-reverse\",\n\t\tlabel: \"Frontend JavaScript signature and request reconstruction\",\n\t\tskillPath: \"skills/js-reverse/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"javascript\",\n\t\t\t\"js\",\n\t\t\t\"frontend\",\n\t\t\t\"webpack\",\n\t\t\t\"source map\",\n\t\t\t\"sourcemap\",\n\t\t\t\"web\",\n\t\t\t\"browser\",\n\t\t\t\"前端\",\n\t\t\t\"프론트\",\n\t\t],\n\t\tintentPatterns: [\n\t\t\t\"signature\",\n\t\t\t\"encrypted params\",\n\t\t\t\"request replay\",\n\t\t\t\"token\",\n\t\t\t\"decrypt\",\n\t\t\t\"environment patch\",\n\t\t\t\"ast\",\n\t\t\t\"breakpoint\",\n\t\t\t\"hook\",\n\t\t\t\"서명\",\n\t\t\t\"암호화\",\n\t\t],\n\t\ttoolPatterns: [\"playwright\", \"chrome\", \"cdp\", \"jshook\", \"jshookmcp\", \"node\", \"anything-analyzer\"],\n\t\tkeywords: [\n\t\t\t\"sign\",\n\t\t\t\"nonce\",\n\t\t\t\"timestamp\",\n\t\t\t\"crypto\",\n\t\t\t\"axios\",\n\t\t\t\"fetch\",\n\t\t\t\"xhr\",\n\t\t\t\"webpackJsonp\",\n\t\t\t\"localStorage\",\n\t\t\t\"cookie\",\n\t\t],\n\t\trequiredTools: [\"node\"],\n\t\toptionalTools: [\"playwright\", \"jshookmcp\", \"anything-analyzer\", \"chrome\"],\n\t\tskillHints: [\"js-reverse\", \"browser-automation\", \"docs-generator\"],\n\t\tmcpHints: [\"chrome-devtools\", \"playwright\", \"fetch\", \"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"session-context\"],\n\t\tacceptance: [\n\t\t\t\"Target request and parameter names are identified\",\n\t\t\t\"Recovered algorithm has a local reproduction or explicit blocker\",\n\t\t\t\"Browser/runtime observations are tied to request evidence\",\n\t\t],\n\t\tfirstActions: [\"Identify target request\", \"Find producer function\", \"Rebuild the minimum local reproduction\"],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"browser-automation\",\n\t\tlabel: \"Browser or desktop evidence collection\",\n\t\tskillPath: \"skills/browser-automation/SKILL.md\",\n\t\ttargetPatterns: [\"website\", \"browser\", \"web app\", \"desktop app\", \"page\", \"form\", \"웹\", \"브라우저\"],\n\t\tintentPatterns: [\n\t\t\t\"open\",\n\t\t\t\"screenshot\",\n\t\t\t\"fill\",\n\t\t\t\"crawl\",\n\t\t\t\"capture\",\n\t\t\t\"network\",\n\t\t\t\"login\",\n\t\t\t\"observe\",\n\t\t\t\"click\",\n\t\t\t\"샷\",\n\t\t\t\"스크린샷\",\n\t\t],\n\t\ttoolPatterns: [\"playwright\", \"chrome-devtools\", \"agent-browser\", \"openreverse\", \"anything-analyzer\"],\n\t\tkeywords: [\"dom\", \"selector\", \"network log\", \"console\", \"cookie\", \"screenshot\", \"trace\"],\n\t\trequiredTools: [\"playwright\"],\n\t\toptionalTools: [\"chrome\", \"agent-browser\", \"anything-analyzer\"],\n\t\tskillHints: [\"browser-automation\", \"js-reverse\", \"docs-generator\"],\n\t\tmcpHints: [\"playwright\", \"chrome-devtools\", \"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Browser state is captured with URL and selector evidence\",\n\t\t\t\"Screenshots or logs are saved as artifacts when visual proof matters\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Open the target in an isolated browser context\",\n\t\t\t\"Capture visible state\",\n\t\t\t\"Record console/network evidence\",\n\t\t],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"gitreverse\",\n\t\tlabel: \"Repository-to-prompt reconstruction (GitReverse workflow)\",\n\t\tskillPath: \"skills/gitreverse/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"github\",\n\t\t\t\"gitlab\",\n\t\t\t\"gitee\",\n\t\t\t\"repository\",\n\t\t\t\"repo\",\n\t\t\t\"monorepo\",\n\t\t\t\"codebase\",\n\t\t\t\"레포지토리\",\n\t\t\t\"저장소\",\n\t\t],\n\t\tintentPatterns: [\n\t\t\t\"vibe code\",\n\t\t\t\"prompt\",\n\t\t\t\"paste into\",\n\t\t\t\"cursor\",\n\t\t\t\"claude code\",\n\t\t\t\"codex\",\n\t\t\t\"from scratch\",\n\t\t\t\"reconstruct\",\n\t\t\t\"synthesize\",\n\t\t\t\"프롬프트\",\n\t\t],\n\t\ttoolPatterns: [\"git\", \"gh\", \"github cli\", \"github api\", \"gitreverse\"],\n\t\tkeywords: [\n\t\t\t\"owner/repo\",\n\t\t\t\"file tree\",\n\t\t\t\"readme\",\n\t\t\t\"repo metadata\",\n\t\t\t\"shareable link\",\n\t\t\t\"synthetic prompt\",\n\t\t\t\"vibe coding\",\n\t\t],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"git\", \"gh\"],\n\t\tskillHints: [\"gitreverse\", \"clone-website\", \"docs-generator\"],\n\t\tmcpHints: [\"github\", \"filesystem\"],\n\t\thookHints: [\"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Repository owner/name is parsed from the URL or slug before any fetch\",\n\t\t\t\"The generated prompt is grounded in README and file-tree evidence\",\n\t\t\t\"Only public repository data is used; private or credential-bearing content is refused and redacted\",\n\t\t\t\"Observed repo facts and synthesized prompt text are clearly separated\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Parse owner/repo from the GitHub URL or `owner/repo` slug\",\n\t\t\t\"Fetch repo metadata, root file tree (depth 1), and README\",\n\t\t\t\"Synthesize one short conversational prompt grounded in that context\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"ctf-sandbox-orchestrator\",\n\t\tlabel: \"CTF challenge routing\",\n\t\tskillPath: \"../CTF-Sandbox-Orchestrator/ctf-sandbox-orchestrator/SKILL.md\",\n\t\ttargetPatterns: [\"ctf\", \"challenge\", \"flag\", \"pwn\", \"crypto challenge\", \"forensics\", \"misc\", \"rev\", \"대회\"],\n\t\tintentPatterns: [\"solve\", \"find flag\", \"exploit\", \"writeup\", \"sandbox\", \"analyze challenge\"],\n\t\ttoolPatterns: [\"pwntools\", \"gdb\", \"python\", \"sage\", \"z3\", \"binwalk\", \"wireshark\"],\n\t\tkeywords: [\"flag{\", \"ctf\", \"nc \", \"remote\", \"proof\", \"challenge files\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"python\", \"gdb\", \"pwntools\", \"z3\", \"binwalk\"],\n\t\tskillHints: [\"ctf-sandbox-orchestrator\", \"reverse-engineering\", \"pwn-chain\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"memory\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Challenge category is justified by evidence\",\n\t\t\t\"Solution artifacts are reproducible\",\n\t\t\t\"Writeup includes the shortest verified path\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Inventory challenge files\",\n\t\t\t\"Classify dominant evidence\",\n\t\t\t\"Dispatch to the narrowest CTF sub-skill\",\n\t\t],\n\t\trisk: \"exploit-development\",\n\t},\n\t{\n\t\tid: \"api-security\",\n\t\tlabel: \"API security review and authorized test planning\",\n\t\tskillPath: \"skills/api-security/SKILL.md\",\n\t\ttargetPatterns: [\"api\", \"rest\", \"graphql\", \"websocket\", \"jwt\", \"oauth\", \"endpoint\"],\n\t\tintentPatterns: [\"review\", \"test\", \"auth\", \"idor\", \"bola\", \"bfla\", \"rate limit\", \"schema\", \"권한\", \"越权\"],\n\t\ttoolPatterns: [\"burp\", \"postman\", \"nuclei\", \"zap\", \"curl\", \"graphql\"],\n\t\tkeywords: [\"authorization\", \"authentication\", \"tenant\", \"object id\", \"jwt\", \"scope\", \"graphql\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"burpsuite\", \"nuclei\", \"zap\", \"node\", \"python\"],\n\t\tskillHints: [\"api-security\", \"pentest-tools\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"github\", \"playwright\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Scope boundary is explicit\",\n\t\t\t\"Findings include request/response evidence or code references\",\n\t\t\t\"High-risk active steps require explicit target scope\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Identify API surface\",\n\t\t\t\"Map auth and tenant boundaries\",\n\t\t\t\"Choose static review or scoped dynamic testing\",\n\t\t],\n\t\trisk: \"active-security\",\n\t},\n\t{\n\t\tid: \"supply-chain-security\",\n\t\tlabel: \"Supply-chain and CI/CD security analysis\",\n\t\tskillPath: \"skills/supply-chain-security/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"dependency\",\n\t\t\t\"package\",\n\t\t\t\"sbom\",\n\t\t\t\"container\",\n\t\t\t\"docker\",\n\t\t\t\"ci\",\n\t\t\t\"workflow\",\n\t\t\t\"github actions\",\n\t\t\t\"supply chain\",\n\t\t],\n\t\tintentPatterns: [\"scan\", \"audit\", \"gitleaks\", \"trivy\", \"osv\", \"syft\", \"secret\", \"provenance\", \"attestation\"],\n\t\ttoolPatterns: [\"trivy\", \"syft\", \"gitleaks\", \"osv-scanner\", \"npm audit\", \"semgrep\"],\n\t\tkeywords: [\"package-lock\", \"npm-shrinkwrap\", \"dockerfile\", \"workflow\", \"actions\", \"secret\", \"sbom\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"trivy\", \"syft\", \"gitleaks\", \"osv-scanner\", \"semgrep\"],\n\t\tskillHints: [\"supply-chain-security\", \"security-review\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"github\"],\n\t\thookHints: [\"protect-secrets\", \"pre-shell-guard\", \"npm-audit-summary\"],\n\t\tacceptance: [\n\t\t\t\"Dependency, workflow, and secret surfaces are separated\",\n\t\t\t\"Findings cite exact files and lockfile evidence\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Inventory package managers and workflows\",\n\t\t\t\"Run non-mutating scans first\",\n\t\t\t\"Triangulate tool output with source evidence\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"docs-generator\",\n\t\tlabel: \"Security or reverse-engineering report generation\",\n\t\tskillPath: \"skills/docs-generator/SKILL.md\",\n\t\ttargetPatterns: [\"report\", \"writeup\", \"documentation\", \"diagram\", \"flowchart\", \"보고서\", \"문서\"],\n\t\tintentPatterns: [\"write\", \"summarize\", \"generate\", \"document\", \"explain\", \"diagram\", \"publish\"],\n\t\ttoolPatterns: [\"markdown\", \"mermaid\", \"graphviz\", \"plantuml\", \"pdf\"],\n\t\tkeywords: [\"executive summary\", \"reproduction\", \"impact\", \"timeline\", \"artifact\", \"evidence\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"graphviz\", \"plantuml\", \"pandoc\"],\n\t\tskillHints: [\"docs-generator\", \"diagram-generator\"],\n\t\tmcpHints: [\"filesystem\"],\n\t\thookHints: [\"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Report separates facts, analysis, and recommendations\",\n\t\t\t\"Artifacts and commands are reproducible\",\n\t\t\t\"Sensitive values are redacted\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Collect evidence paths\",\n\t\t\t\"Choose report template\",\n\t\t\t\"Add at least one flow or evidence diagram when useful\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n];\n\nfunction findPatternMatches(text: string, patterns: string[]): string[] {\n\tconst matches: string[] = [];\n\tfor (const pattern of patterns) {\n\t\tconst normalizedPattern = normalizeReverseSkillText(pattern);\n\t\tif (!normalizedPattern) continue;\n\t\tif (text.includes(normalizedPattern)) matches.push(pattern);\n\t}\n\treturn matches;\n}\n\nfunction unique(items: string[]): string[] {\n\treturn Array.from(new Set(items.filter((item) => item.trim().length > 0)));\n}\n\nfunction clampConfidence(score: number): number {\n\tif (score <= 0) return 0;\n\treturn Math.min(0.99, Number((score / ROUTE_SCORE_CONFIDENCE_DENOMINATOR).toFixed(2)));\n}\n\nfunction scoreRoute(\n\troute: ReverseSkillRoute,\n\tinput: ReverseSkillRouteInput,\n\tnormalizedQuery: string,\n): ReverseSkillRouteScore {\n\tconst targetText = normalizeReverseSkillText(`${input.targetType ?? \"\"} ${normalizedQuery}`);\n\tconst intentText = normalizeReverseSkillText(`${input.intent ?? \"\"} ${normalizedQuery}`);\n\tconst toolText = normalizeReverseSkillText(`${input.toolchain ?? \"\"} ${normalizedQuery}`);\n\n\tconst target = findPatternMatches(targetText, route.targetPatterns);\n\tconst intent = findPatternMatches(intentText, route.intentPatterns);\n\tconst toolchain = findPatternMatches(toolText, route.toolPatterns);\n\tconst keywords = findPatternMatches(normalizedQuery, route.keywords);\n\n\tlet score =\n\t\ttarget.length * ROUTE_SCORE_TARGET_WEIGHT +\n\t\tintent.length * ROUTE_SCORE_INTENT_WEIGHT +\n\t\ttoolchain.length * ROUTE_SCORE_TOOL_WEIGHT +\n\t\tkeywords.length * ROUTE_SCORE_KEYWORD_WEIGHT;\n\n\tif (target.length > 0 && intent.length > 0 && toolchain.length > 0) {\n\t\tscore += ROUTE_SCORE_FULL_TRIAD_BONUS;\n\t}\n\n\tconst missingDimensions: string[] = [];\n\tif (target.length === 0) missingDimensions.push(\"target\");\n\tif (intent.length === 0) missingDimensions.push(\"intent\");\n\tif (toolchain.length === 0) missingDimensions.push(\"toolchain\");\n\n\treturn {\n\t\troute,\n\t\tscore,\n\t\tconfidence: clampConfidence(score),\n\t\tmatched: { target, intent, toolchain, keywords },\n\t\tmissingDimensions,\n\t};\n}\n\nexport function routeReverseSkill(input: ReverseSkillRouteInput): ReverseSkillRouteDecision {\n\tconst normalizedQuery = normalizeReverseSkillText(input.query);\n\tconst platform = input.platform ?? \"unknown\";\n\tconst maxAlternatives = input.maxAlternatives ?? 3;\n\tconst scored = REVERSE_SKILL_ROUTES.map((route) => scoreRoute(route, input, normalizedQuery))\n\t\t.filter((candidate) => candidate.score > 0)\n\t\t.sort(\n\t\t\t(a, b) => b.score - a.score || REVERSE_SKILL_ROUTES.indexOf(a.route) - REVERSE_SKILL_ROUTES.indexOf(b.route),\n\t\t);\n\n\tconst primary = scored[0];\n\tconst alternatives = scored.slice(1, maxAlternatives + 1);\n\tconst unmatched = !primary || primary.score < ROUTE_SCORE_TARGET_WEIGHT || primary.confidence < 0.18;\n\tconst nextAction = unmatched\n\t\t? \"No strong route matched. Create or extend a reverse-skill route before executing specialized tooling.\"\n\t\t: `Read ${primary.route.skillPath}, then execute first action: ${primary.route.firstActions[0] ?? \"classify target\"}.`;\n\n\treturn {\n\t\tquery: input.query,\n\t\tplatform,\n\t\tnormalizedQuery,\n\t\tprimary: unmatched ? undefined : primary,\n\t\talternatives,\n\t\tunmatched,\n\t\tnextAction,\n\t};\n}\n\nfunction formatMatches(score: ReverseSkillRouteScore): string {\n\tconst parts = [\n\t\t`target=${score.matched.target.join(\", \") || \"—\"}`,\n\t\t`intent=${score.matched.intent.join(\", \") || \"—\"}`,\n\t\t`toolchain=${score.matched.toolchain.join(\", \") || \"—\"}`,\n\t\t`keywords=${score.matched.keywords.join(\", \") || \"—\"}`,\n\t];\n\treturn parts.join(\"; \");\n}\n\nexport function formatReverseSkillRouteDecision(decision: ReverseSkillRouteDecision): string {\n\tif (decision.unmatched || !decision.primary) {\n\t\treturn [\n\t\t\t\"# Reverse Skill Route\",\n\t\t\t\"\",\n\t\t\t`Query: ${decision.query}`,\n\t\t\t\"\",\n\t\t\t\"No strong route matched.\",\n\t\t\t\"Next action: create or extend a route before specialized execution.\",\n\t\t].join(\"\\n\");\n\t}\n\n\tconst primary = decision.primary;\n\tconst lines = [\n\t\t\"# Reverse Skill Route\",\n\t\t\"\",\n\t\t`Query: ${decision.query}`,\n\t\t`Platform: ${decision.platform}`,\n\t\t\"\",\n\t\t`## Primary: ${primary.route.label}`,\n\t\t`- Route ID: ${primary.route.id}`,\n\t\t`- Skill path: ${primary.route.skillPath}`,\n\t\t`- Confidence: ${primary.confidence}`,\n\t\t`- Score: ${primary.score}`,\n\t\t`- Matches: ${formatMatches(primary)}`,\n\t\t`- Risk: ${primary.route.risk}`,\n\t\t`- Required tools: ${primary.route.requiredTools.join(\", \") || \"none\"}`,\n\t\t`- Optional tools: ${primary.route.optionalTools.join(\", \") || \"none\"}`,\n\t\t`- Skill hints: ${primary.route.skillHints.join(\", \")}`,\n\t\t`- MCP hints: ${primary.route.mcpHints.join(\", \")}`,\n\t\t`- Hooks: ${primary.route.hookHints.join(\", \")}`,\n\t\t\"\",\n\t\t\"## First actions\",\n\t\t...primary.route.firstActions.map((action, index) => `${index + 1}. ${action}`),\n\t\t\"\",\n\t\t\"## Acceptance\",\n\t\t...primary.route.acceptance.map((item) => `- ${item}`),\n\t];\n\n\tif (decision.alternatives.length > 0) {\n\t\tlines.push(\"\", \"## Alternatives\");\n\t\tfor (const alternative of decision.alternatives) {\n\t\t\tlines.push(`- ${alternative.route.id} (${alternative.confidence}): ${formatMatches(alternative)}`);\n\t\t}\n\t}\n\n\tlines.push(\"\", `Next action: ${decision.nextAction}`);\n\treturn lines.join(\"\\n\");\n}\n\nexport function planReverseSkillToolChecks(decision: ReverseSkillRouteDecision, maxTools = 12): string[] {\n\tconst routes = [decision.primary, ...decision.alternatives].filter((score): score is ReverseSkillRouteScore =>\n\t\tBoolean(score),\n\t);\n\tconst tools: string[] = [];\n\tfor (const score of routes) {\n\t\ttools.push(...score.route.requiredTools, ...score.route.optionalTools);\n\t}\n\treturn unique(tools).slice(0, maxTools);\n}\n\nfunction yamlString(value: string): string {\n\treturn JSON.stringify(value);\n}\n\nfunction compactDescription(input: ReverseSkillSpecInput, routes: ReverseSkillRoute[]): string {\n\tconst fallback = `Use when ${input.triggerSummary}`;\n\tconst base = input.description?.trim() || fallback;\n\tconst routeNames = routes.map((route) => route.id).join(\", \");\n\tconst suffix = routeNames ? ` Routes through ${routeNames}.` : \"\";\n\tconst description = `${base}${suffix}`;\n\treturn description.length <= 1024 ? description : `${description.slice(0, 1021).trimEnd()}...`;\n}\n\nfunction routesFromIds(routeIds: string[] | undefined): ReverseSkillRoute[] {\n\tif (!routeIds) return [];\n\treturn routeIds\n\t\t.map((routeId) => REVERSE_SKILL_ROUTES.find((route) => route.id === routeId))\n\t\t.filter((route): route is ReverseSkillRoute => Boolean(route));\n}\n\nexport function formatReverseSkillMarkdown(input: ReverseSkillSpecInput): string {\n\tconst routes = routesFromIds(input.routeIds);\n\tconst name = normalizeReverseSkillName(input.name);\n\tconst description = compactDescription(input, routes);\n\tconst workflowSteps = input.workflowSteps?.length\n\t\t? input.workflowSteps\n\t\t: [\n\t\t\t\t\"Classify target, intent, and available toolchain before execution\",\n\t\t\t\t\"Read the routed sub-skill or reference\",\n\t\t\t\t\"Collect evidence and record blockers\",\n\t\t\t\t\"Verify output against acceptance criteria\",\n\t\t\t];\n\tconst tools = unique([\n\t\t...(input.tools ?? []),\n\t\t...routes.flatMap((route) => [...route.requiredTools, ...route.optionalTools]),\n\t]);\n\tconst mcpServers = unique([...(input.mcpServers ?? []), ...routes.flatMap((route) => route.mcpHints)]);\n\tconst hooks = unique([...(input.hooks ?? []), ...routes.flatMap((route) => route.hookHints)]);\n\tconst acceptance = unique([...(input.acceptance ?? []), ...routes.flatMap((route) => route.acceptance)]);\n\tconst safetyNotes = input.safetyNotes?.length\n\t\t? input.safetyNotes\n\t\t: [\n\t\t\t\t\"Operate only on user-provided local artifacts or explicitly scoped targets\",\n\t\t\t\t\"Do not write secrets, tokens, credentials, or raw private data into skill artifacts\",\n\t\t\t];\n\n\tconst lines = [\n\t\t\"---\",\n\t\t`name: ${name}`,\n\t\t`description: ${yamlString(description)}`,\n\t\t\"---\",\n\t\t\"\",\n\t\t`# ${name}`,\n\t\t\"\",\n\t\t\"## Routing contract\",\n\t\t\"\",\n\t\t`Trigger this skill when ${input.triggerSummary}.`,\n\t\t\"\",\n\t\t\"1. Classify the target type, user intent, and toolchain signals before choosing tools.\",\n\t\t\"2. Read the narrowest referenced sub-skill or reference before running specialized tooling.\",\n\t\t\"3. Prefer passive/local evidence collection first; escalate only when the task scope requires it.\",\n\t\t\"4. Save evidence paths and blockers in the final response.\",\n\t\t\"\",\n\t\t\"## Workflow\",\n\t\t\"\",\n\t\t...workflowSteps.map((step, index) => `${index + 1}. ${step}`),\n\t\t\"\",\n\t\t\"## Tool selection\",\n\t\t\"\",\n\t\t`- Tools: ${tools.join(\", \") || \"none required\"}`,\n\t\t`- MCP: ${mcpServers.join(\", \") || \"filesystem/read-only\"}`,\n\t\t`- Hooks: ${hooks.join(\", \") || \"pre-shell-guard, protect-secrets\"}`,\n\t\t\"\",\n\t\t\"## Acceptance\",\n\t\t\"\",\n\t\t...(acceptance.length > 0\n\t\t\t? acceptance.map((item) => `- ${item}`)\n\t\t\t: [\"- Output includes routed skill, evidence, commands, and remaining blockers\"]),\n\t\t\"\",\n\t\t\"## Safety constraints\",\n\t\t\"\",\n\t\t...safetyNotes.map((note) => `- ${note}`),\n\t];\n\n\tif (routes.length > 0) {\n\t\tlines.push(\"\", \"## Built-in routes\", \"\");\n\t\tfor (const route of routes) {\n\t\t\tlines.push(`- ${route.id}: ${route.skillPath}`);\n\t\t}\n\t}\n\n\tif (input.references?.length) {\n\t\tlines.push(\"\", \"## References\", \"\");\n\t\tfor (const reference of input.references) lines.push(`- ${reference}`);\n\t}\n\n\treturn `${lines.join(\"\\n\").trimEnd()}\\n`;\n}\n\nexport function extractReverseSkillFactsFromMarkdown(sourceText: string): ReverseSkillSourceFacts {\n\tconst headings = unique(\n\t\tArray.from(sourceText.matchAll(/^#{1,4}\\s+(.+)$/gm)).map((match) => match[1]?.trim() ?? \"\"),\n\t).slice(0, 24);\n\tconst skillPaths = unique(\n\t\tArray.from(sourceText.matchAll(/[`(\\s]([^`\\s)]+SKILL\\.md)/g)).map((match) => match[1] ?? \"\"),\n\t);\n\tconst scriptPaths = unique(\n\t\tArray.from(sourceText.matchAll(/[`(\\s]([^`\\s)]+\\.(?:ps1|sh|py|js|ts))/g)).map((match) => match[1] ?? \"\"),\n\t);\n\tconst knownTools = Object.keys(TOOL_ALIASES);\n\tconst normalizedSource = normalizeReverseSkillText(sourceText);\n\tconst tools = knownTools.filter((tool) => normalizedSource.includes(normalizeReverseSkillText(tool)));\n\tconst mcpServers = unique(\n\t\tArray.from(sourceText.matchAll(/\\b([a-z0-9-]+)\\s+MCP\\b/gi)).map((match) => match[1]?.toLowerCase() ?? \"\"),\n\t);\n\tconst triggerTerms = unique(\n\t\tREVERSE_SKILL_ROUTES.flatMap((route) => [\n\t\t\t...route.targetPatterns,\n\t\t\t...route.intentPatterns,\n\t\t\t...route.toolPatterns,\n\t\t]).filter((term) => normalizedSource.includes(normalizeReverseSkillText(term))),\n\t).slice(0, 40);\n\n\treturn { headings, skillPaths, scriptPaths, tools, mcpServers, triggerTerms };\n}\n\nexport function formatReverseSkillFromSource(input: ReverseSkillSourceInput): string {\n\tconst facts = extractReverseSkillFactsFromMarkdown(input.sourceText);\n\tconst query = [input.triggerSummary, facts.triggerTerms.slice(0, 12).join(\" \"), facts.headings.slice(0, 8).join(\" \")]\n\t\t.filter(Boolean)\n\t\t.join(\" \");\n\tconst decision = routeReverseSkill({ query: query || input.sourceText.slice(0, 500) });\n\tconst routeIds = [decision.primary?.route.id, ...decision.alternatives.map((item) => item.route.id)].filter(\n\t\t(routeId): routeId is string => Boolean(routeId),\n\t);\n\tconst name = input.name ?? (decision.primary ? `${decision.primary.route.id}-workflow` : \"reverse-skill-workflow\");\n\tconst triggerSummary =\n\t\tinput.triggerSummary ??\n\t\t(facts.triggerTerms.slice(0, 8).join(\", \") || \"reverse-engineering or security routing is needed\");\n\tconst workflowSteps = [\n\t\t\"Classify the incoming request against target, intent, and toolchain signals\",\n\t\t\"Load the routed sub-skill before running specialized tooling\",\n\t\t\"Check local tool availability only for tools required by the selected route\",\n\t\t\"Return evidence paths, commands, confidence, and blockers\",\n\t];\n\n\treturn formatReverseSkillMarkdown({\n\t\tname,\n\t\tdescription: input.description,\n\t\ttriggerSummary,\n\t\trouteIds,\n\t\tworkflowSteps,\n\t\ttools: facts.tools,\n\t\tmcpServers: facts.mcpServers,\n\t\treferences: unique([...facts.skillPaths, ...facts.scriptPaths]).slice(0, 20),\n\t});\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -19,7 +19,10 @@ export * from "./harness/types.ts";
19
19
  export * from "./harness/utils/shell-output.ts";
20
20
  export * from "./harness/utils/truncate.ts";
21
21
  export { NEVER_PARALLEL_TOOLS, PARALLEL_SAFE_TOOLS, PATH_SCOPED_TOOLS, partitionToolBatchWaves, pathsOverlap, shouldParallelizeToolBatch, } from "./parallel-tool-batch.ts";
22
+ export { type ProviderInputProjection, projectToolImagesForModel } from "./provider-input.ts";
23
+ export { applyModelContract, type ProviderRequestEvent } from "./provider-request.ts";
22
24
  export * from "./proxy.ts";
25
+ export * from "./run-model-contract.ts";
23
26
  export { applyConcurrencyCap, assignDagLevels, computePlanKey, type DagSchedulePlan, type ResolvedClaimEntry, resolveBatchClaims, type ScheduleDagLevelsOptions, scheduleDagLevels, } from "./tool-dag-scheduler.ts";
24
27
  export { type ClaimableToolCall, canonicalizeClaims, claimsConflict, compareClaims, type ResolveToolClaimsOptions, resolutionsConflict, resolvePathClaimKey, resolveToolClaims, type ToolClaimResolution, type ToolResourceAccess, type ToolResourceClaim, } from "./tool-resource-claims.ts";
25
28
  export { createAbortedToolResult, createTimeoutToolResult, resolveToolExecutionPolicy, resolveToolTimeoutMs, type ToolDispositionEnvelope, type ToolLateSettlement, } from "./tool-timeout.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAC;AAE3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,8BAA8B,EAC9B,qBAAqB,EACrB,oBAAoB,GACpB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACN,sBAAsB,EACtB,OAAO,EACP,2BAA2B,EAC3B,qBAAqB,EACrB,c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A0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,GAC9B,MAAM,gCAAgC,CAAC;AAExC,cAAc,YAAY,CAAC","sourcesContent":["// Core Agent\nexport * from \"./agent.ts\";\n// Loop functions\nexport * from \"./agent-loop.ts\";\nexport * from \"./harness/abort-delivery.ts\";\nexport * from \"./harness/agent-harness.ts\";\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryDetails,\n\ttype CollectEntriesResult,\n\tcollectEntriesForBranchSummary,\n\tgenerateBranchSummary,\n\tprepareBranchEntries,\n} from \"./harness/compaction/branch-summarization.ts\";\nexport {\n\tcalculateContextTokens,\n\tcompact,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateContextTokens,\n\testimateTokens,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\tgenerateSummary,\n\tgetLastAssistantUsage,\n\tprepareCompaction,\n\tserializeConversation,\n\tshouldCompact,\n} from \"./harness/compaction/compaction.ts\";\nexport * from \"./harness/deferred-commands.ts\";\nexport * from \"./harness/messages.ts\";\nexport * from \"./harness/prompt-templates.ts\";\nexport * from \"./harness/reverse-skill.ts\";\nexport * from \"./harness/session/jsonl-repo.ts\";\nexport * from \"./harness/session/memory-repo.ts\";\nexport * from \"./harness/session/repo-utils.ts\";\nexport * from \"./harness/session/session.ts\";\nexport { uuidv7 } from \"./harness/session/uuid.ts\";\nexport * from \"./harness/skills.ts\";\nexport * from \"./harness/system-prompt.ts\";\n// Harness\nexport * from \"./harness/types.ts\";\nexport * from \"./harness/utils/shell-output.ts\";\nexport * from \"./harness/utils/truncate.ts\";\n// Parallel tool batch policy\nexport {\n\tNEVER_PARALLEL_TOOLS,\n\tPARALLEL_SAFE_TOOLS,\n\tPATH_SCOPED_TOOLS,\n\tpartitionToolBatchWaves,\n\tpathsOverlap,\n\tshouldParallelizeToolBatch,\n} from \"./parallel-tool-batch.ts\";\n// Proxy utilities\nexport * from \"./proxy.ts\";\n// Deterministic resource-claim DAG scheduler (dag-v2)\nexport {\n\tapplyConcurrencyCap,\n\tassignDagLevels,\n\tcomputePlanKey,\n\ttype DagSchedulePlan,\n\ttype ResolvedClaimEntry,\n\tresolveBatchClaims,\n\ttype ScheduleDagLevelsOptions,\n\tscheduleDagLevels,\n} from \"./tool-dag-scheduler.ts\";\n// Resource-claim model (dag-v2)\nexport {\n\ttype ClaimableToolCall,\n\tcanonicalizeClaims,\n\tclaimsConflict,\n\tcompareClaims,\n\ttype ResolveToolClaimsOptions,\n\tresolutionsConflict,\n\tresolvePathClaimKey,\n\tresolveToolClaims,\n\ttype ToolClaimResolution,\n\ttype ToolResourceAccess,\n\ttype ToolResourceClaim,\n} from \"./tool-resource-claims.ts\";\n// Per-call timeout / cancellation / late settlement (ALG-004)\nexport {\n\tcreateAbortedToolResult,\n\tcreateTimeoutToolResult,\n\tresolveToolExecutionPolicy,\n\tresolveToolTimeoutMs,\n\ttype ToolDispositionEnvelope,\n\ttype ToolLateSettlement,\n} from \"./tool-timeout.ts\";\nexport {\n\tcreateSyntheticToolResult,\n\tinspectTranscriptIntegrity,\n\trepairTranscriptIntegrity,\n\tTranscriptIntegrityError,\n\ttype TranscriptIntegrityIssue,\n\ttype TranscriptIntegrityIssueKind,\n\ttype TranscriptIntegrityReport,\n} from \"./tool-transcript-integrity.ts\";\n// Types\nexport * from \"./types.ts\";\n"]}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAC;AAE3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,8BAA8B,EAC9B,qBAAqB,EACrB,oBAAoB,GACpB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACN,sBAAsB,EACtB,OAAO,EAC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BAAiB,GACtB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACN,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,GAC9B,MAAM,gCAAgC,CAAC;AAExC,cAAc,YAAY,CAAC","sourcesContent":["// Core Agent\nexport * from \"./agent.ts\";\n// Loop functions\nexport * from \"./agent-loop.ts\";\nexport * from \"./harness/abort-delivery.ts\";\nexport * from \"./harness/agent-harness.ts\";\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryDetails,\n\ttype CollectEntriesResult,\n\tcollectEntriesForBranchSummary,\n\tgenerateBranchSummary,\n\tprepareBranchEntries,\n} from \"./harness/compaction/branch-summarization.ts\";\nexport {\n\tcalculateContextTokens,\n\tcompact,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateContextTokens,\n\testimateTokens,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\tgenerateSummary,\n\tgetLastAssistantUsage,\n\tprepareCompaction,\n\tserializeConversation,\n\tshouldCompact,\n} from \"./harness/compaction/compaction.ts\";\nexport * from \"./harness/deferred-commands.ts\";\nexport * from \"./harness/messages.ts\";\nexport * from \"./harness/prompt-templates.ts\";\nexport * from \"./harness/reverse-skill.ts\";\nexport * from \"./harness/session/jsonl-repo.ts\";\nexport * from \"./harness/session/memory-repo.ts\";\nexport * from \"./harness/session/repo-utils.ts\";\nexport * from \"./harness/session/session.ts\";\nexport { uuidv7 } from \"./harness/session/uuid.ts\";\nexport * from \"./harness/skills.ts\";\nexport * from \"./harness/system-prompt.ts\";\n// Harness\nexport * from \"./harness/types.ts\";\nexport * from \"./harness/utils/shell-output.ts\";\nexport * from \"./harness/utils/truncate.ts\";\n// Parallel tool batch policy\nexport {\n\tNEVER_PARALLEL_TOOLS,\n\tPARALLEL_SAFE_TOOLS,\n\tPATH_SCOPED_TOOLS,\n\tpartitionToolBatchWaves,\n\tpathsOverlap,\n\tshouldParallelizeToolBatch,\n} from \"./parallel-tool-batch.ts\";\nexport { type ProviderInputProjection, projectToolImagesForModel } from \"./provider-input.ts\";\nexport { applyModelContract, type ProviderRequestEvent } from \"./provider-request.ts\";\n// Proxy utilities\nexport * from \"./proxy.ts\";\nexport * from \"./run-model-contract.ts\";\n// Deterministic resource-claim DAG scheduler (dag-v2)\nexport {\n\tapplyConcurrencyCap,\n\tassignDagLevels,\n\tcomputePlanKey,\n\ttype DagSchedulePlan,\n\ttype ResolvedClaimEntry,\n\tresolveBatchClaims,\n\ttype ScheduleDagLevelsOptions,\n\tscheduleDagLevels,\n} from \"./tool-dag-scheduler.ts\";\n// Resource-claim model (dag-v2)\nexport {\n\ttype ClaimableToolCall,\n\tcanonicalizeClaims,\n\tclaimsConflict,\n\tcompareClaims,\n\ttype ResolveToolClaimsOptions,\n\tresolutionsConflict,\n\tresolvePathClaimKey,\n\tresolveToolClaims,\n\ttype ToolClaimResolution,\n\ttype ToolResourceAccess,\n\ttype ToolResourceClaim,\n} from \"./tool-resource-claims.ts\";\n// Per-call timeout / cancellation / late settlement (ALG-004)\nexport {\n\tcreateAbortedToolResult,\n\tcreateTimeoutToolResult,\n\tresolveToolExecutionPolicy,\n\tresolveToolTimeoutMs,\n\ttype ToolDispositionEnvelope,\n\ttype ToolLateSettlement,\n} from \"./tool-timeout.ts\";\nexport {\n\tcreateSyntheticToolResult,\n\tinspectTranscriptIntegrity,\n\trepairTranscriptIntegrity,\n\tTranscriptIntegrityError,\n\ttype TranscriptIntegrityIssue,\n\ttype TranscriptIntegrityIssueKind,\n\ttype TranscriptIntegrityReport,\n} from \"./tool-transcript-integrity.ts\";\n// Types\nexport * from \"./types.ts\";\n"]}
package/dist/index.js CHANGED
@@ -23,8 +23,11 @@ export * from "./harness/utils/shell-output.js";
23
23
  export * from "./harness/utils/truncate.js";
24
24
  // Parallel tool batch policy
25
25
  export { NEVER_PARALLEL_TOOLS, PARALLEL_SAFE_TOOLS, PATH_SCOPED_TOOLS, partitionToolBatchWaves, pathsOverlap, shouldParallelizeToolBatch, } from "./parallel-tool-batch.js";
26
+ export { projectToolImagesForModel } from "./provider-input.js";
27
+ export { applyModelContract } from "./provider-request.js";
26
28
  // Proxy utilities
27
29
  export * from "./proxy.js";
30
+ export * from "./run-model-contract.js";
28
31
  // Deterministic resource-claim DAG scheduler (dag-v2)
29
32
  export { applyConcurrencyCap, assignDagLevels, computePlanKey, resolveBatchClaims, scheduleDagLevels, } from "./tool-dag-scheduler.js";
30
33
  // Resource-claim model (dag-v2)
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,cAAc,YAAY,CAAC;AAC3B,iBAAiB;AACjB,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAIN,8BAA8B,EAC9B,qBAAqB,EACrB,oBAAoB,GACpB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACN,sBAAsB,EACtB,OAAO,EACP,2BAA2B,EAC3B,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,GACb,MAAM,oCAAoC,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,UAAU;AACV,cAAc,oBAAoB,CAAC;AACnC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,6BAA6B;AAC7B,OAAO,EACN,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,EACZ,0BAA0B,GAC1B,MAAM,0BAA0B,CAAC;AAClC,kBAAkB;AAClB,cAAc,YAAY,CAAC;AAC3B,sDAAsD;AACtD,OAAO,EACN,mBAAmB,EACnB,eAAe,EACf,cAAc,EAGd,kBAAkB,EAElB,iBAAiB,GACjB,MAAM,yBAAyB,CAAC;AACjC,gCAAgC;AAChC,OAAO,EAEN,kBAAkB,EAClB,cAAc,EACd,aAAa,EAEb,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,GAIjB,MAAM,2BAA2B,CAAC;AACnC,8DAA8D;AAC9D,OAAO,EACN,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,GAGpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,GAIxB,MAAM,gCAAgC,CAAC;AACxC,QAAQ;AACR,cAAc,YAAY,CAAC","sourcesContent":["// Core Agent\nexport * from \"./agent.ts\";\n// Loop functions\nexport * from \"./agent-loop.ts\";\nexport * from \"./harness/abort-delivery.ts\";\nexport * from \"./harness/agent-harness.ts\";\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryDetails,\n\ttype CollectEntriesResult,\n\tcollectEntriesForBranchSummary,\n\tgenerateBranchSummary,\n\tprepareBranchEntries,\n} from \"./harness/compaction/branch-summarization.ts\";\nexport {\n\tcalculateContextTokens,\n\tcompact,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateContextTokens,\n\testimateTokens,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\tgenerateSummary,\n\tgetLastAssistantUsage,\n\tprepareCompaction,\n\tserializeConversation,\n\tshouldCompact,\n} from \"./harness/compaction/compaction.ts\";\nexport * from \"./harness/deferred-commands.ts\";\nexport * from \"./harness/messages.ts\";\nexport * from \"./harness/prompt-templates.ts\";\nexport * from \"./harness/reverse-skill.ts\";\nexport * from \"./harness/session/jsonl-repo.ts\";\nexport * from \"./harness/session/memory-repo.ts\";\nexport * from \"./harness/session/repo-utils.ts\";\nexport * from \"./harness/session/session.ts\";\nexport { uuidv7 } from \"./harness/session/uuid.ts\";\nexport * from \"./harness/skills.ts\";\nexport * from \"./harness/system-prompt.ts\";\n// Harness\nexport * from \"./harness/types.ts\";\nexport * from \"./harness/utils/shell-output.ts\";\nexport * from \"./harness/utils/truncate.ts\";\n// Parallel tool batch policy\nexport {\n\tNEVER_PARALLEL_TOOLS,\n\tPARALLEL_SAFE_TOOLS,\n\tPATH_SCOPED_TOOLS,\n\tpartitionToolBatchWaves,\n\tpathsOverlap,\n\tshouldParallelizeToolBatch,\n} from \"./parallel-tool-batch.ts\";\n// Proxy utilities\nexport * from \"./proxy.ts\";\n// Deterministic resource-claim DAG scheduler (dag-v2)\nexport {\n\tapplyConcurrencyCap,\n\tassignDagLevels,\n\tcomputePlanKey,\n\ttype DagSchedulePlan,\n\ttype ResolvedClaimEntry,\n\tresolveBatchClaims,\n\ttype ScheduleDagLevelsOptions,\n\tscheduleDagLevels,\n} from \"./tool-dag-scheduler.ts\";\n// Resource-claim model (dag-v2)\nexport {\n\ttype ClaimableToolCall,\n\tcanonicalizeClaims,\n\tclaimsConflict,\n\tcompareClaims,\n\ttype ResolveToolClaimsOptions,\n\tresolutionsConflict,\n\tresolvePathClaimKey,\n\tresolveToolClaims,\n\ttype ToolClaimResolution,\n\ttype ToolResourceAccess,\n\ttype ToolResourceClaim,\n} from \"./tool-resource-claims.ts\";\n// Per-call timeout / cancellation / late settlement (ALG-004)\nexport {\n\tcreateAbortedToolResult,\n\tcreateTimeoutToolResult,\n\tresolveToolExecutionPolicy,\n\tresolveToolTimeoutMs,\n\ttype ToolDispositionEnvelope,\n\ttype ToolLateSettlement,\n} from \"./tool-timeout.ts\";\nexport {\n\tcreateSyntheticToolResult,\n\tinspectTranscriptIntegrity,\n\trepairTranscriptIntegrity,\n\tTranscriptIntegrityError,\n\ttype TranscriptIntegrityIssue,\n\ttype TranscriptIntegrityIssueKind,\n\ttype TranscriptIntegrityReport,\n} from \"./tool-transcript-integrity.ts\";\n// Types\nexport * from \"./types.ts\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,cAAc,YAAY,CAAC;AAC3B,iBAAiB;AACjB,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAIN,8BAA8B,EAC9B,qBAAqB,EACrB,oBAAoB,GACpB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACN,sBAAsB,EACtB,OAAO,EACP,2BAA2B,EAC3B,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,GACb,MAAM,oCAAoC,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,UAAU;AACV,cAAc,oBAAoB,CAAC;AACnC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,6BAA6B;AAC7B,OAAO,EACN,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,EACZ,0BAA0B,GAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAgC,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAA6B,MAAM,uBAAuB,CAAC;AACtF,kBAAkB;AAClB,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,sDAAsD;AACtD,OAAO,EACN,mBAAmB,EACnB,eAAe,EACf,cAAc,EAGd,kBAAkB,EAElB,iBAAiB,GACjB,MAAM,yBAAyB,CAAC;AACjC,gCAAgC;AAChC,OAAO,EAEN,kBAAkB,EAClB,cAAc,EACd,aAAa,EAEb,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,GAIjB,MAAM,2BAA2B,CAAC;AACnC,8DAA8D;AAC9D,OAAO,EACN,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,GAGpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,GAIxB,MAAM,gCAAgC,CAAC;AACxC,QAAQ;AACR,cAAc,YAAY,CAAC","sourcesContent":["// Core Agent\nexport * from \"./agent.ts\";\n// Loop functions\nexport * from \"./agent-loop.ts\";\nexport * from \"./harness/abort-delivery.ts\";\nexport * from \"./harness/agent-harness.ts\";\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryDetails,\n\ttype CollectEntriesResult,\n\tcollectEntriesForBranchSummary,\n\tgenerateBranchSummary,\n\tprepareBranchEntries,\n} from \"./harness/compaction/branch-summarization.ts\";\nexport {\n\tcalculateContextTokens,\n\tcompact,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateContextTokens,\n\testimateTokens,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\tgenerateSummary,\n\tgetLastAssistantUsage,\n\tprepareCompaction,\n\tserializeConversation,\n\tshouldCompact,\n} from \"./harness/compaction/compaction.ts\";\nexport * from \"./harness/deferred-commands.ts\";\nexport * from \"./harness/messages.ts\";\nexport * from \"./harness/prompt-templates.ts\";\nexport * from \"./harness/reverse-skill.ts\";\nexport * from \"./harness/session/jsonl-repo.ts\";\nexport * from \"./harness/session/memory-repo.ts\";\nexport * from \"./harness/session/repo-utils.ts\";\nexport * from \"./harness/session/session.ts\";\nexport { uuidv7 } from \"./harness/session/uuid.ts\";\nexport * from \"./harness/skills.ts\";\nexport * from \"./harness/system-prompt.ts\";\n// Harness\nexport * from \"./harness/types.ts\";\nexport * from \"./harness/utils/shell-output.ts\";\nexport * from \"./harness/utils/truncate.ts\";\n// Parallel tool batch policy\nexport {\n\tNEVER_PARALLEL_TOOLS,\n\tPARALLEL_SAFE_TOOLS,\n\tPATH_SCOPED_TOOLS,\n\tpartitionToolBatchWaves,\n\tpathsOverlap,\n\tshouldParallelizeToolBatch,\n} from \"./parallel-tool-batch.ts\";\nexport { type ProviderInputProjection, projectToolImagesForModel } from \"./provider-input.ts\";\nexport { applyModelContract, type ProviderRequestEvent } from \"./provider-request.ts\";\n// Proxy utilities\nexport * from \"./proxy.ts\";\nexport * from \"./run-model-contract.ts\";\n// Deterministic resource-claim DAG scheduler (dag-v2)\nexport {\n\tapplyConcurrencyCap,\n\tassignDagLevels,\n\tcomputePlanKey,\n\ttype DagSchedulePlan,\n\ttype ResolvedClaimEntry,\n\tresolveBatchClaims,\n\ttype ScheduleDagLevelsOptions,\n\tscheduleDagLevels,\n} from \"./tool-dag-scheduler.ts\";\n// Resource-claim model (dag-v2)\nexport {\n\ttype ClaimableToolCall,\n\tcanonicalizeClaims,\n\tclaimsConflict,\n\tcompareClaims,\n\ttype ResolveToolClaimsOptions,\n\tresolutionsConflict,\n\tresolvePathClaimKey,\n\tresolveToolClaims,\n\ttype ToolClaimResolution,\n\ttype ToolResourceAccess,\n\ttype ToolResourceClaim,\n} from \"./tool-resource-claims.ts\";\n// Per-call timeout / cancellation / late settlement (ALG-004)\nexport {\n\tcreateAbortedToolResult,\n\tcreateTimeoutToolResult,\n\tresolveToolExecutionPolicy,\n\tresolveToolTimeoutMs,\n\ttype ToolDispositionEnvelope,\n\ttype ToolLateSettlement,\n} from \"./tool-timeout.ts\";\nexport {\n\tcreateSyntheticToolResult,\n\tinspectTranscriptIntegrity,\n\trepairTranscriptIntegrity,\n\tTranscriptIntegrityError,\n\ttype TranscriptIntegrityIssue,\n\ttype TranscriptIntegrityIssueKind,\n\ttype TranscriptIntegrityReport,\n} from \"./tool-transcript-integrity.ts\";\n// Types\nexport * from \"./types.ts\";\n"]}
@@ -0,0 +1,11 @@
1
+ import type { AgentMessage, QueueMode } from "./types.ts";
2
+ export declare class PendingMessageQueue {
3
+ private messages;
4
+ mode: QueueMode;
5
+ constructor(mode: QueueMode);
6
+ enqueue(message: AgentMessage): void;
7
+ hasItems(): boolean;
8
+ drain(): AgentMessage[];
9
+ clear(): void;
10
+ }
11
+ //# sourceMappingURL=pending-message-queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pending-message-queue.d.ts","sourceRoot":"","sources":["../src/pending-message-queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE1D,qBAAa,mBAAmB;IAC/B,OAAO,CAAC,QAAQ,CAAsB;IAC/B,IAAI,EAAE,SAAS,CAAC;IAEvB,YAAY,IAAI,EAAE,SAAS,EAE1B;IAED,OAAO,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAEnC;IAED,QAAQ,IAAI,OAAO,CAElB;IAED,KAAK,IAAI,YAAY,EAAE,CAUtB;IAED,KAAK,IAAI,IAAI,CAEZ;CACD","sourcesContent":["import type { AgentMessage, QueueMode } from \"./types.ts\";\n\nexport class PendingMessageQueue {\n\tprivate messages: AgentMessage[] = [];\n\tpublic mode: QueueMode;\n\n\tconstructor(mode: QueueMode) {\n\t\tthis.mode = mode;\n\t}\n\n\tenqueue(message: AgentMessage): void {\n\t\tthis.messages.push(message);\n\t}\n\n\thasItems(): boolean {\n\t\treturn this.messages.length > 0;\n\t}\n\n\tdrain(): AgentMessage[] {\n\t\tif (this.mode === \"all\") {\n\t\t\tconst drained = this.messages.slice();\n\t\t\tthis.messages = [];\n\t\t\treturn drained;\n\t\t}\n\t\tconst first = this.messages[0];\n\t\tif (!first) return [];\n\t\tthis.messages = this.messages.slice(1);\n\t\treturn [first];\n\t}\n\n\tclear(): void {\n\t\tthis.messages = [];\n\t}\n}\n"]}
@@ -0,0 +1,29 @@
1
+ export class PendingMessageQueue {
2
+ messages = [];
3
+ mode;
4
+ constructor(mode) {
5
+ this.mode = mode;
6
+ }
7
+ enqueue(message) {
8
+ this.messages.push(message);
9
+ }
10
+ hasItems() {
11
+ return this.messages.length > 0;
12
+ }
13
+ drain() {
14
+ if (this.mode === "all") {
15
+ const drained = this.messages.slice();
16
+ this.messages = [];
17
+ return drained;
18
+ }
19
+ const first = this.messages[0];
20
+ if (!first)
21
+ return [];
22
+ this.messages = this.messages.slice(1);
23
+ return [first];
24
+ }
25
+ clear() {
26
+ this.messages = [];
27
+ }
28
+ }
29
+ //# sourceMappingURL=pending-message-queue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pending-message-queue.js","sourceRoot":"","sources":["../src/pending-message-queue.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,mBAAmB;IACvB,QAAQ,GAAmB,EAAE,CAAC;IAC/B,IAAI,CAAY;IAEvB,YAAY,IAAe,EAAE;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAAA,CACjB;IAED,OAAO,CAAC,OAAqB,EAAQ;QACpC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAAA,CAC5B;IAED,QAAQ,GAAY;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAAA,CAChC;IAED,KAAK,GAAmB;QACvB,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;YACzB,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YACtC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;YACnB,OAAO,OAAO,CAAC;QAChB,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC/B,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACvC,OAAO,CAAC,KAAK,CAAC,CAAC;IAAA,CACf;IAED,KAAK,GAAS;QACb,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;IAAA,CACnB;CACD","sourcesContent":["import type { AgentMessage, QueueMode } from \"./types.ts\";\n\nexport class PendingMessageQueue {\n\tprivate messages: AgentMessage[] = [];\n\tpublic mode: QueueMode;\n\n\tconstructor(mode: QueueMode) {\n\t\tthis.mode = mode;\n\t}\n\n\tenqueue(message: AgentMessage): void {\n\t\tthis.messages.push(message);\n\t}\n\n\thasItems(): boolean {\n\t\treturn this.messages.length > 0;\n\t}\n\n\tdrain(): AgentMessage[] {\n\t\tif (this.mode === \"all\") {\n\t\t\tconst drained = this.messages.slice();\n\t\t\tthis.messages = [];\n\t\t\treturn drained;\n\t\t}\n\t\tconst first = this.messages[0];\n\t\tif (!first) return [];\n\t\tthis.messages = this.messages.slice(1);\n\t\treturn [first];\n\t}\n\n\tclear(): void {\n\t\tthis.messages = [];\n\t}\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import type { Api, Context, Model } from "omk-ai";
2
+ export interface ProviderInputProjection {
3
+ readonly context: Context;
4
+ readonly omittedToolImages: number;
5
+ }
6
+ /** A provider view, not a transcript rewrite or visual interpretation. User attachments stay intact. */
7
+ export declare function projectToolImagesForModel(context: Context, model: Pick<Model<Api>, "input">): ProviderInputProjection;
8
+ //# sourceMappingURL=provider-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-input.d.ts","sourceRoot":"","sources":["../src/provider-input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAElD,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACnC;AAED,wGAAwG;AACxG,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,GAAG,uBAAuB,CA4BrH","sourcesContent":["import type { Api, Context, Model } from \"omk-ai\";\n\nexport interface ProviderInputProjection {\n\treadonly context: Context;\n\treadonly omittedToolImages: number;\n}\n\n/** A provider view, not a transcript rewrite or visual interpretation. User attachments stay intact. */\nexport function projectToolImagesForModel(context: Context, model: Pick<Model<Api>, \"input\">): ProviderInputProjection {\n\tif (\n\t\tmodel.input.includes(\"image\") ||\n\t\t!context.messages.some(\n\t\t\t(message) => message.role === \"toolResult\" && message.content.some((part) => part.type === \"image\"),\n\t\t)\n\t) {\n\t\treturn { context, omittedToolImages: 0 };\n\t}\n\tlet omittedToolImages = 0;\n\tconst messages = context.messages.map((message) => {\n\t\tif (message.role !== \"toolResult\" || !message.content.some((part) => part.type === \"image\")) return message;\n\t\treturn {\n\t\t\t...message,\n\t\t\tcontent: message.content.map((part) => {\n\t\t\t\tif (part.type !== \"image\") return part;\n\t\t\t\tomittedToolImages++;\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"text\" as const,\n\t\t\t\t\ttext:\n\t\t\t\t\t\t\"[Tool image omitted from this model request: the selected model accepts text only. \" +\n\t\t\t\t\t\t\"The image contents were not inspected. The original attachment remains in the session/tool source. \" +\n\t\t\t\t\t\t\"Use permitted local tools to inspect or extract text from the source artifact; do not infer its visual contents.]\",\n\t\t\t\t};\n\t\t\t}),\n\t\t};\n\t});\n\treturn { context: { ...context, messages }, omittedToolImages };\n}\n"]}
@@ -0,0 +1,28 @@
1
+ /** A provider view, not a transcript rewrite or visual interpretation. User attachments stay intact. */
2
+ export function projectToolImagesForModel(context, model) {
3
+ if (model.input.includes("image") ||
4
+ !context.messages.some((message) => message.role === "toolResult" && message.content.some((part) => part.type === "image"))) {
5
+ return { context, omittedToolImages: 0 };
6
+ }
7
+ let omittedToolImages = 0;
8
+ const messages = context.messages.map((message) => {
9
+ if (message.role !== "toolResult" || !message.content.some((part) => part.type === "image"))
10
+ return message;
11
+ return {
12
+ ...message,
13
+ content: message.content.map((part) => {
14
+ if (part.type !== "image")
15
+ return part;
16
+ omittedToolImages++;
17
+ return {
18
+ type: "text",
19
+ text: "[Tool image omitted from this model request: the selected model accepts text only. " +
20
+ "The image contents were not inspected. The original attachment remains in the session/tool source. " +
21
+ "Use permitted local tools to inspect or extract text from the source artifact; do not infer its visual contents.]",
22
+ };
23
+ }),
24
+ };
25
+ });
26
+ return { context: { ...context, messages }, omittedToolImages };
27
+ }
28
+ //# sourceMappingURL=provider-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-input.js","sourceRoot":"","sources":["../src/provider-input.ts"],"names":[],"mappings":"AAOA,wGAAwG;AACxG,MAAM,UAAU,yBAAyB,CAAC,OAAgB,EAAE,KAAgC,EAA2B;IACtH,IACC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC;QAC7B,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CACrB,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CACnG,EACA,CAAC;QACF,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC;IAC1C,CAAC;IACD,IAAI,iBAAiB,GAAG,CAAC,CAAC;IAC1B,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;QAClD,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC;YAAE,OAAO,OAAO,CAAC;QAC5G,OAAO;YACN,GAAG,OAAO;YACV,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;gBACtC,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO;oBAAE,OAAO,IAAI,CAAC;gBACvC,iBAAiB,EAAE,CAAC;gBACpB,OAAO;oBACN,IAAI,EAAE,MAAe;oBACrB,IAAI,EACH,qFAAqF;wBACrF,qGAAqG;wBACrG,mHAAmH;iBACpH,CAAC;YAAA,CACF,CAAC;SACF,CAAC;IAAA,CACF,CAAC,CAAC;IACH,OAAO,EAAE,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,EAAE,iBAAiB,EAAE,CAAC;AAAA,CAChE","sourcesContent":["import type { Api, Context, Model } from \"omk-ai\";\n\nexport interface ProviderInputProjection {\n\treadonly context: Context;\n\treadonly omittedToolImages: number;\n}\n\n/** A provider view, not a transcript rewrite or visual interpretation. User attachments stay intact. */\nexport function projectToolImagesForModel(context: Context, model: Pick<Model<Api>, \"input\">): ProviderInputProjection {\n\tif (\n\t\tmodel.input.includes(\"image\") ||\n\t\t!context.messages.some(\n\t\t\t(message) => message.role === \"toolResult\" && message.content.some((part) => part.type === \"image\"),\n\t\t)\n\t) {\n\t\treturn { context, omittedToolImages: 0 };\n\t}\n\tlet omittedToolImages = 0;\n\tconst messages = context.messages.map((message) => {\n\t\tif (message.role !== \"toolResult\" || !message.content.some((part) => part.type === \"image\")) return message;\n\t\treturn {\n\t\t\t...message,\n\t\t\tcontent: message.content.map((part) => {\n\t\t\t\tif (part.type !== \"image\") return part;\n\t\t\t\tomittedToolImages++;\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"text\" as const,\n\t\t\t\t\ttext:\n\t\t\t\t\t\t\"[Tool image omitted from this model request: the selected model accepts text only. \" +\n\t\t\t\t\t\t\"The image contents were not inspected. The original attachment remains in the session/tool source. \" +\n\t\t\t\t\t\t\"Use permitted local tools to inspect or extract text from the source artifact; do not infer its visual contents.]\",\n\t\t\t\t};\n\t\t\t}),\n\t\t};\n\t});\n\treturn { context: { ...context, messages }, omittedToolImages };\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import type { Api, Model, SimpleStreamOptions } from "omk-ai";
2
+ type PayloadHook = NonNullable<SimpleStreamOptions["onPayload"]>;
3
+ /** Validate supported final payloads and preserve immutable user observation. */
4
+ export declare function createContractPayloadHook(model: Pick<Model<Api>, "api" | "id">, maxTokens: number, observer?: PayloadHook): PayloadHook;
5
+ export {};
6
+ //# sourceMappingURL=provider-payload-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-payload-contract.d.ts","sourceRoot":"","sources":["../src/provider-payload-contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAI9D,KAAK,WAAW,GAAG,WAAW,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC,CAAC;AAoBjE,iFAAiF;AACjF,wBAAgB,yBAAyB,CACxC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,EACrC,SAAS,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,WAAW,GACpB,WAAW,CAgBb","sourcesContent":["import type { Api, Model, SimpleStreamOptions } from \"omk-ai\";\nimport { createImmutableSnapshot } from \"./plain-data.ts\";\nimport { ModelContractViolation } from \"./run-model-contract.ts\";\n\ntype PayloadHook = NonNullable<SimpleStreamOptions[\"onPayload\"]>;\nconst contractHooks = new WeakSet<PayloadHook>();\n\nfunction assertCompletionPayload(payload: unknown, modelId: string, maxTokens: number): void {\n\tif (typeof payload !== \"object\" || payload === null || Array.isArray(payload) || !(\"model\" in payload)) {\n\t\tthrow new ModelContractViolation(\"invalid-request\");\n\t}\n\tif (payload.model !== modelId) throw new ModelContractViolation(\"model-not-allowed\");\n\tconst legacyLimit = \"max_tokens\" in payload ? payload.max_tokens : undefined;\n\tconst completionLimit = \"max_completion_tokens\" in payload ? payload.max_completion_tokens : undefined;\n\tif (legacyLimit !== undefined && completionLimit !== undefined) {\n\t\tthrow new ModelContractViolation(\"invalid-request-limit\");\n\t}\n\tconst limit = legacyLimit !== undefined ? legacyLimit : completionLimit;\n\tif (typeof limit !== \"number\" || !Number.isSafeInteger(limit) || limit <= 0) {\n\t\tthrow new ModelContractViolation(\"invalid-request-limit\");\n\t}\n\tif (limit > maxTokens) throw new ModelContractViolation(\"output-limit-exceeded\");\n}\n\n/** Validate supported final payloads and preserve immutable user observation. */\nexport function createContractPayloadHook(\n\tmodel: Pick<Model<Api>, \"api\" | \"id\">,\n\tmaxTokens: number,\n\tobserver?: PayloadHook,\n): PayloadHook {\n\tconst { api, id } = model;\n\tconst hook: PayloadHook = async (payload, requestModel) => {\n\t\tif (api === \"openai-completions\") assertCompletionPayload(payload, id, maxTokens);\n\t\tif (!observer) return;\n\t\t// The core and SDK both enforce contracts. Only the innermost user hook needs a snapshot.\n\t\tif (contractHooks.has(observer)) return observer(payload, requestModel);\n\t\tconst original = createImmutableSnapshot(payload);\n\t\tconst result = (await observer(original, createImmutableSnapshot(requestModel))) ?? original;\n\t\tif (JSON.stringify(result) !== JSON.stringify(original)) {\n\t\t\tthrow new TypeError(\"Model contract forbids payload replacement\");\n\t\t}\n\t\treturn structuredClone(original);\n\t};\n\tcontractHooks.add(hook);\n\treturn hook;\n}\n"]}
@@ -0,0 +1,43 @@
1
+ import { createImmutableSnapshot } from "./plain-data.js";
2
+ import { ModelContractViolation } from "./run-model-contract.js";
3
+ const contractHooks = new WeakSet();
4
+ function assertCompletionPayload(payload, modelId, maxTokens) {
5
+ if (typeof payload !== "object" || payload === null || Array.isArray(payload) || !("model" in payload)) {
6
+ throw new ModelContractViolation("invalid-request");
7
+ }
8
+ if (payload.model !== modelId)
9
+ throw new ModelContractViolation("model-not-allowed");
10
+ const legacyLimit = "max_tokens" in payload ? payload.max_tokens : undefined;
11
+ const completionLimit = "max_completion_tokens" in payload ? payload.max_completion_tokens : undefined;
12
+ if (legacyLimit !== undefined && completionLimit !== undefined) {
13
+ throw new ModelContractViolation("invalid-request-limit");
14
+ }
15
+ const limit = legacyLimit !== undefined ? legacyLimit : completionLimit;
16
+ if (typeof limit !== "number" || !Number.isSafeInteger(limit) || limit <= 0) {
17
+ throw new ModelContractViolation("invalid-request-limit");
18
+ }
19
+ if (limit > maxTokens)
20
+ throw new ModelContractViolation("output-limit-exceeded");
21
+ }
22
+ /** Validate supported final payloads and preserve immutable user observation. */
23
+ export function createContractPayloadHook(model, maxTokens, observer) {
24
+ const { api, id } = model;
25
+ const hook = async (payload, requestModel) => {
26
+ if (api === "openai-completions")
27
+ assertCompletionPayload(payload, id, maxTokens);
28
+ if (!observer)
29
+ return;
30
+ // The core and SDK both enforce contracts. Only the innermost user hook needs a snapshot.
31
+ if (contractHooks.has(observer))
32
+ return observer(payload, requestModel);
33
+ const original = createImmutableSnapshot(payload);
34
+ const result = (await observer(original, createImmutableSnapshot(requestModel))) ?? original;
35
+ if (JSON.stringify(result) !== JSON.stringify(original)) {
36
+ throw new TypeError("Model contract forbids payload replacement");
37
+ }
38
+ return structuredClone(original);
39
+ };
40
+ contractHooks.add(hook);
41
+ return hook;
42
+ }
43
+ //# sourceMappingURL=provider-payload-contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-payload-contract.js","sourceRoot":"","sources":["../src/provider-payload-contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,MAAM,aAAa,GAAG,IAAI,OAAO,EAAe,CAAC;AAEjD,SAAS,uBAAuB,CAAC,OAAgB,EAAE,OAAe,EAAE,SAAiB,EAAQ;IAC5F,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,EAAE,CAAC;QACxG,MAAM,IAAI,sBAAsB,CAAC,iBAAiB,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,OAAO,CAAC,KAAK,KAAK,OAAO;QAAE,MAAM,IAAI,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;IACrF,MAAM,WAAW,GAAG,YAAY,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7E,MAAM,eAAe,GAAG,uBAAuB,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,CAAC;IACvG,IAAI,WAAW,KAAK,SAAS,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;QAChE,MAAM,IAAI,sBAAsB,CAAC,uBAAuB,CAAC,CAAC;IAC3D,CAAC;IACD,MAAM,KAAK,GAAG,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC;IACxE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QAC7E,MAAM,IAAI,sBAAsB,CAAC,uBAAuB,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,KAAK,GAAG,SAAS;QAAE,MAAM,IAAI,sBAAsB,CAAC,uBAAuB,CAAC,CAAC;AAAA,CACjF;AAED,iFAAiF;AACjF,MAAM,UAAU,yBAAyB,CACxC,KAAqC,EACrC,SAAiB,EACjB,QAAsB,EACR;IACd,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;IAC1B,MAAM,IAAI,GAAgB,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,CAAC;QAC1D,IAAI,GAAG,KAAK,oBAAoB;YAAE,uBAAuB,CAAC,OAAO,EAAE,EAAE,EAAE,SAAS,CAAC,CAAC;QAClF,IAAI,CAAC,QAAQ;YAAE,OAAO;QACtB,0FAA0F;QAC1F,IAAI,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC;YAAE,OAAO,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;QAClD,MAAM,MAAM,GAAG,CAAC,MAAM,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC;QAC7F,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;YACzD,MAAM,IAAI,SAAS,CAAC,4CAA4C,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,eAAe,CAAC,QAAQ,CAAC,CAAC;IAAA,CACjC,CAAC;IACF,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACxB,OAAO,IAAI,CAAC;AAAA,CACZ","sourcesContent":["import type { Api, Model, SimpleStreamOptions } from \"omk-ai\";\nimport { createImmutableSnapshot } from \"./plain-data.ts\";\nimport { ModelContractViolation } from \"./run-model-contract.ts\";\n\ntype PayloadHook = NonNullable<SimpleStreamOptions[\"onPayload\"]>;\nconst contractHooks = new WeakSet<PayloadHook>();\n\nfunction assertCompletionPayload(payload: unknown, modelId: string, maxTokens: number): void {\n\tif (typeof payload !== \"object\" || payload === null || Array.isArray(payload) || !(\"model\" in payload)) {\n\t\tthrow new ModelContractViolation(\"invalid-request\");\n\t}\n\tif (payload.model !== modelId) throw new ModelContractViolation(\"model-not-allowed\");\n\tconst legacyLimit = \"max_tokens\" in payload ? payload.max_tokens : undefined;\n\tconst completionLimit = \"max_completion_tokens\" in payload ? payload.max_completion_tokens : undefined;\n\tif (legacyLimit !== undefined && completionLimit !== undefined) {\n\t\tthrow new ModelContractViolation(\"invalid-request-limit\");\n\t}\n\tconst limit = legacyLimit !== undefined ? legacyLimit : completionLimit;\n\tif (typeof limit !== \"number\" || !Number.isSafeInteger(limit) || limit <= 0) {\n\t\tthrow new ModelContractViolation(\"invalid-request-limit\");\n\t}\n\tif (limit > maxTokens) throw new ModelContractViolation(\"output-limit-exceeded\");\n}\n\n/** Validate supported final payloads and preserve immutable user observation. */\nexport function createContractPayloadHook(\n\tmodel: Pick<Model<Api>, \"api\" | \"id\">,\n\tmaxTokens: number,\n\tobserver?: PayloadHook,\n): PayloadHook {\n\tconst { api, id } = model;\n\tconst hook: PayloadHook = async (payload, requestModel) => {\n\t\tif (api === \"openai-completions\") assertCompletionPayload(payload, id, maxTokens);\n\t\tif (!observer) return;\n\t\t// The core and SDK both enforce contracts. Only the innermost user hook needs a snapshot.\n\t\tif (contractHooks.has(observer)) return observer(payload, requestModel);\n\t\tconst original = createImmutableSnapshot(payload);\n\t\tconst result = (await observer(original, createImmutableSnapshot(requestModel))) ?? original;\n\t\tif (JSON.stringify(result) !== JSON.stringify(original)) {\n\t\t\tthrow new TypeError(\"Model contract forbids payload replacement\");\n\t\t}\n\t\treturn structuredClone(original);\n\t};\n\tcontractHooks.add(hook);\n\treturn hook;\n}\n"]}