agenticreplay 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -13
- package/bin/agenticreplay.js +2 -0
- package/node_modules/@agenticreplay/adapters/dist/claude-code.d.ts +37 -0
- package/node_modules/@agenticreplay/adapters/dist/claude-code.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/claude-code.js +103 -0
- package/node_modules/@agenticreplay/adapters/dist/claude-code.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/codex.d.ts +36 -0
- package/node_modules/@agenticreplay/adapters/dist/codex.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/codex.js +130 -0
- package/node_modules/@agenticreplay/adapters/dist/codex.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/contract.d.ts +65 -0
- package/node_modules/@agenticreplay/adapters/dist/contract.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/contract.js +460 -0
- package/node_modules/@agenticreplay/adapters/dist/contract.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/cursor.d.ts +40 -0
- package/node_modules/@agenticreplay/adapters/dist/cursor.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/cursor.js +71 -0
- package/node_modules/@agenticreplay/adapters/dist/cursor.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/detect.d.ts +47 -0
- package/node_modules/@agenticreplay/adapters/dist/detect.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/detect.js +123 -0
- package/node_modules/@agenticreplay/adapters/dist/detect.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/env.d.ts +60 -0
- package/node_modules/@agenticreplay/adapters/dist/env.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/env.js +99 -0
- package/node_modules/@agenticreplay/adapters/dist/env.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/exec.d.ts +25 -0
- package/node_modules/@agenticreplay/adapters/dist/exec.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/exec.js +51 -0
- package/node_modules/@agenticreplay/adapters/dist/exec.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/generic-openai.d.ts +8 -0
- package/node_modules/@agenticreplay/adapters/dist/generic-openai.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/generic-openai.js +31 -0
- package/node_modules/@agenticreplay/adapters/dist/generic-openai.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/goose.d.ts +39 -0
- package/node_modules/@agenticreplay/adapters/dist/goose.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/goose.js +81 -0
- package/node_modules/@agenticreplay/adapters/dist/goose.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/grok.d.ts +23 -0
- package/node_modules/@agenticreplay/adapters/dist/grok.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/grok.js +50 -0
- package/node_modules/@agenticreplay/adapters/dist/grok.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/hermes.d.ts +70 -0
- package/node_modules/@agenticreplay/adapters/dist/hermes.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/hermes.js +88 -0
- package/node_modules/@agenticreplay/adapters/dist/hermes.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/index.d.ts +25 -0
- package/node_modules/@agenticreplay/adapters/dist/index.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/index.js +25 -0
- package/node_modules/@agenticreplay/adapters/dist/index.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/indexrag.d.ts +27 -0
- package/node_modules/@agenticreplay/adapters/dist/indexrag.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/indexrag.js +236 -0
- package/node_modules/@agenticreplay/adapters/dist/indexrag.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/kilo.d.ts +21 -0
- package/node_modules/@agenticreplay/adapters/dist/kilo.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/kilo.js +35 -0
- package/node_modules/@agenticreplay/adapters/dist/kilo.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/mcode.d.ts +81 -0
- package/node_modules/@agenticreplay/adapters/dist/mcode.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/mcode.js +368 -0
- package/node_modules/@agenticreplay/adapters/dist/mcode.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/mcp-config.d.ts +17 -0
- package/node_modules/@agenticreplay/adapters/dist/mcp-config.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/mcp-config.js +62 -0
- package/node_modules/@agenticreplay/adapters/dist/mcp-config.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/mimo.d.ts +26 -0
- package/node_modules/@agenticreplay/adapters/dist/mimo.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/mimo.js +40 -0
- package/node_modules/@agenticreplay/adapters/dist/mimo.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/node.d.ts +19 -0
- package/node_modules/@agenticreplay/adapters/dist/node.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/node.js +59 -0
- package/node_modules/@agenticreplay/adapters/dist/node.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/openclaw.d.ts +19 -0
- package/node_modules/@agenticreplay/adapters/dist/openclaw.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/openclaw.js +43 -0
- package/node_modules/@agenticreplay/adapters/dist/openclaw.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode-api-bases.d.ts +2 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode-api-bases.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode-api-bases.js +201 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode-api-bases.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode-capture.d.ts +26 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode-capture.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode-capture.js +132 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode-capture.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode-catalog.d.ts +5 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode-catalog.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode-catalog.js +43 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode-catalog.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode-config.d.ts +40 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode-config.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode-config.js +185 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode-config.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode.d.ts +10 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode.js +243 -0
- package/node_modules/@agenticreplay/adapters/dist/opencode.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/qwen.d.ts +51 -0
- package/node_modules/@agenticreplay/adapters/dist/qwen.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/qwen.js +105 -0
- package/node_modules/@agenticreplay/adapters/dist/qwen.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/registry.d.ts +19 -0
- package/node_modules/@agenticreplay/adapters/dist/registry.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/registry.js +110 -0
- package/node_modules/@agenticreplay/adapters/dist/registry.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/scaffold.d.ts +26 -0
- package/node_modules/@agenticreplay/adapters/dist/scaffold.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/scaffold.js +125 -0
- package/node_modules/@agenticreplay/adapters/dist/scaffold.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/session.d.ts +47 -0
- package/node_modules/@agenticreplay/adapters/dist/session.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/session.js +112 -0
- package/node_modules/@agenticreplay/adapters/dist/session.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/zcode.d.ts +60 -0
- package/node_modules/@agenticreplay/adapters/dist/zcode.d.ts.map +1 -0
- package/node_modules/@agenticreplay/adapters/dist/zcode.js +424 -0
- package/node_modules/@agenticreplay/adapters/dist/zcode.js.map +1 -0
- package/node_modules/@agenticreplay/adapters/package.json +29 -0
- package/node_modules/@agenticreplay/core/dist/blobs.d.ts +21 -0
- package/node_modules/@agenticreplay/core/dist/blobs.d.ts.map +1 -0
- package/node_modules/@agenticreplay/core/dist/blobs.js +102 -0
- package/node_modules/@agenticreplay/core/dist/blobs.js.map +1 -0
- package/node_modules/@agenticreplay/core/dist/fetch.d.ts +38 -0
- package/node_modules/@agenticreplay/core/dist/fetch.d.ts.map +1 -0
- package/node_modules/@agenticreplay/core/dist/fetch.js +47 -0
- package/node_modules/@agenticreplay/core/dist/fetch.js.map +1 -0
- package/node_modules/@agenticreplay/core/dist/graph.d.ts +106 -0
- package/node_modules/@agenticreplay/core/dist/graph.d.ts.map +1 -0
- package/node_modules/@agenticreplay/core/dist/graph.js +394 -0
- package/node_modules/@agenticreplay/core/dist/graph.js.map +1 -0
- package/node_modules/@agenticreplay/core/dist/index.d.ts +9 -0
- package/node_modules/@agenticreplay/core/dist/index.d.ts.map +1 -0
- package/node_modules/@agenticreplay/core/dist/index.js +9 -0
- package/node_modules/@agenticreplay/core/dist/index.js.map +1 -0
- package/node_modules/@agenticreplay/core/dist/paths.d.ts +45 -0
- package/node_modules/@agenticreplay/core/dist/paths.d.ts.map +1 -0
- package/node_modules/@agenticreplay/core/dist/paths.js +149 -0
- package/node_modules/@agenticreplay/core/dist/paths.js.map +1 -0
- package/node_modules/@agenticreplay/core/dist/private-files.d.ts +37 -0
- package/node_modules/@agenticreplay/core/dist/private-files.d.ts.map +1 -0
- package/node_modules/@agenticreplay/core/dist/private-files.js +353 -0
- package/node_modules/@agenticreplay/core/dist/private-files.js.map +1 -0
- package/node_modules/@agenticreplay/core/dist/reader.d.ts +45 -0
- package/node_modules/@agenticreplay/core/dist/reader.d.ts.map +1 -0
- package/node_modules/@agenticreplay/core/dist/reader.js +152 -0
- package/node_modules/@agenticreplay/core/dist/reader.js.map +1 -0
- package/node_modules/@agenticreplay/core/dist/redaction.d.ts +69 -0
- package/node_modules/@agenticreplay/core/dist/redaction.d.ts.map +1 -0
- package/node_modules/@agenticreplay/core/dist/redaction.js +768 -0
- package/node_modules/@agenticreplay/core/dist/redaction.js.map +1 -0
- package/node_modules/@agenticreplay/core/dist/writer.d.ts +75 -0
- package/node_modules/@agenticreplay/core/dist/writer.d.ts.map +1 -0
- package/node_modules/@agenticreplay/core/dist/writer.js +368 -0
- package/node_modules/@agenticreplay/core/dist/writer.js.map +1 -0
- package/node_modules/@agenticreplay/core/package.json +26 -0
- package/node_modules/@agenticreplay/fs-capture/dist/capture.d.ts +84 -0
- package/node_modules/@agenticreplay/fs-capture/dist/capture.d.ts.map +1 -0
- package/node_modules/@agenticreplay/fs-capture/dist/capture.js +147 -0
- package/node_modules/@agenticreplay/fs-capture/dist/capture.js.map +1 -0
- package/node_modules/@agenticreplay/fs-capture/dist/git.d.ts +25 -0
- package/node_modules/@agenticreplay/fs-capture/dist/git.d.ts.map +1 -0
- package/node_modules/@agenticreplay/fs-capture/dist/git.js +108 -0
- package/node_modules/@agenticreplay/fs-capture/dist/git.js.map +1 -0
- package/node_modules/@agenticreplay/fs-capture/dist/index.d.ts +4 -0
- package/node_modules/@agenticreplay/fs-capture/dist/index.d.ts.map +1 -0
- package/node_modules/@agenticreplay/fs-capture/dist/index.js +4 -0
- package/node_modules/@agenticreplay/fs-capture/dist/index.js.map +1 -0
- package/node_modules/@agenticreplay/fs-capture/dist/shadow.d.ts +271 -0
- package/node_modules/@agenticreplay/fs-capture/dist/shadow.d.ts.map +1 -0
- package/node_modules/@agenticreplay/fs-capture/dist/shadow.js +668 -0
- package/node_modules/@agenticreplay/fs-capture/dist/shadow.js.map +1 -0
- package/node_modules/@agenticreplay/fs-capture/package.json +25 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/cli.d.ts +100 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/cli.d.ts.map +1 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/cli.js +334 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/cli.js.map +1 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/framing.d.ts +41 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/framing.d.ts.map +1 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/framing.js +94 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/framing.js.map +1 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/index.d.ts +5 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/index.d.ts.map +1 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/index.js +5 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/index.js.map +1 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/mock.d.ts +70 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/mock.d.ts.map +1 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/mock.js +138 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/mock.js.map +1 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/shim.d.ts +24 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/shim.d.ts.map +1 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/shim.js +105 -0
- package/node_modules/@agenticreplay/mcp-shim/dist/shim.js.map +1 -0
- package/node_modules/@agenticreplay/mcp-shim/package.json +26 -0
- package/node_modules/@agenticreplay/node-instrument/dist/capture.d.ts +58 -0
- package/node_modules/@agenticreplay/node-instrument/dist/capture.d.ts.map +1 -0
- package/node_modules/@agenticreplay/node-instrument/dist/capture.js +404 -0
- package/node_modules/@agenticreplay/node-instrument/dist/capture.js.map +1 -0
- package/node_modules/@agenticreplay/node-instrument/dist/index.d.ts +4 -0
- package/node_modules/@agenticreplay/node-instrument/dist/index.d.ts.map +1 -0
- package/node_modules/@agenticreplay/node-instrument/dist/index.js +4 -0
- package/node_modules/@agenticreplay/node-instrument/dist/index.js.map +1 -0
- package/node_modules/@agenticreplay/node-instrument/dist/install.d.ts +47 -0
- package/node_modules/@agenticreplay/node-instrument/dist/install.d.ts.map +1 -0
- package/node_modules/@agenticreplay/node-instrument/dist/install.js +174 -0
- package/node_modules/@agenticreplay/node-instrument/dist/install.js.map +1 -0
- package/node_modules/@agenticreplay/node-instrument/dist/rewrite.d.ts +33 -0
- package/node_modules/@agenticreplay/node-instrument/dist/rewrite.d.ts.map +1 -0
- package/node_modules/@agenticreplay/node-instrument/dist/rewrite.js +61 -0
- package/node_modules/@agenticreplay/node-instrument/dist/rewrite.js.map +1 -0
- package/node_modules/@agenticreplay/node-instrument/package.json +23 -0
- package/node_modules/@agenticreplay/plugin-api/dist/canonical.d.ts +87 -0
- package/node_modules/@agenticreplay/plugin-api/dist/canonical.d.ts.map +1 -0
- package/node_modules/@agenticreplay/plugin-api/dist/canonical.js +10 -0
- package/node_modules/@agenticreplay/plugin-api/dist/canonical.js.map +1 -0
- package/node_modules/@agenticreplay/plugin-api/dist/index.d.ts +3 -0
- package/node_modules/@agenticreplay/plugin-api/dist/index.d.ts.map +1 -0
- package/node_modules/@agenticreplay/plugin-api/dist/index.js +3 -0
- package/node_modules/@agenticreplay/plugin-api/dist/index.js.map +1 -0
- package/node_modules/@agenticreplay/plugin-api/dist/plugins.d.ts +258 -0
- package/node_modules/@agenticreplay/plugin-api/dist/plugins.d.ts.map +1 -0
- package/node_modules/@agenticreplay/plugin-api/dist/plugins.js +2 -0
- package/node_modules/@agenticreplay/plugin-api/dist/plugins.js.map +1 -0
- package/node_modules/@agenticreplay/plugin-api/package.json +22 -0
- package/node_modules/@agenticreplay/providers/dist/index.d.ts +34 -0
- package/node_modules/@agenticreplay/providers/dist/index.d.ts.map +1 -0
- package/node_modules/@agenticreplay/providers/dist/index.js +34 -0
- package/node_modules/@agenticreplay/providers/dist/index.js.map +1 -0
- package/node_modules/@agenticreplay/providers/dist/pricing.d.ts +44 -0
- package/node_modules/@agenticreplay/providers/dist/pricing.d.ts.map +1 -0
- package/node_modules/@agenticreplay/providers/dist/pricing.js +126 -0
- package/node_modules/@agenticreplay/providers/dist/pricing.js.map +1 -0
- package/node_modules/@agenticreplay/providers/dist/translate/anthropic.d.ts +66 -0
- package/node_modules/@agenticreplay/providers/dist/translate/anthropic.d.ts.map +1 -0
- package/node_modules/@agenticreplay/providers/dist/translate/anthropic.js +569 -0
- package/node_modules/@agenticreplay/providers/dist/translate/anthropic.js.map +1 -0
- package/node_modules/@agenticreplay/providers/dist/translate/openai-responses.d.ts +51 -0
- package/node_modules/@agenticreplay/providers/dist/translate/openai-responses.d.ts.map +1 -0
- package/node_modules/@agenticreplay/providers/dist/translate/openai-responses.js +574 -0
- package/node_modules/@agenticreplay/providers/dist/translate/openai-responses.js.map +1 -0
- package/node_modules/@agenticreplay/providers/dist/translate/openai.d.ts +60 -0
- package/node_modules/@agenticreplay/providers/dist/translate/openai.d.ts.map +1 -0
- package/node_modules/@agenticreplay/providers/dist/translate/openai.js +577 -0
- package/node_modules/@agenticreplay/providers/dist/translate/openai.js.map +1 -0
- package/node_modules/@agenticreplay/providers/dist/translate/sse.d.ts +29 -0
- package/node_modules/@agenticreplay/providers/dist/translate/sse.d.ts.map +1 -0
- package/node_modules/@agenticreplay/providers/dist/translate/sse.js +97 -0
- package/node_modules/@agenticreplay/providers/dist/translate/sse.js.map +1 -0
- package/node_modules/@agenticreplay/providers/dist/translate/util.d.ts +34 -0
- package/node_modules/@agenticreplay/providers/dist/translate/util.d.ts.map +1 -0
- package/node_modules/@agenticreplay/providers/dist/translate/util.js +106 -0
- package/node_modules/@agenticreplay/providers/dist/translate/util.js.map +1 -0
- package/node_modules/@agenticreplay/providers/package.json +26 -0
- package/node_modules/@agenticreplay/proxy/dist/ca.d.ts +45 -0
- package/node_modules/@agenticreplay/proxy/dist/ca.d.ts.map +1 -0
- package/node_modules/@agenticreplay/proxy/dist/ca.js +264 -0
- package/node_modules/@agenticreplay/proxy/dist/ca.js.map +1 -0
- package/node_modules/@agenticreplay/proxy/dist/der.d.ts +51 -0
- package/node_modules/@agenticreplay/proxy/dist/der.d.ts.map +1 -0
- package/node_modules/@agenticreplay/proxy/dist/der.js +144 -0
- package/node_modules/@agenticreplay/proxy/dist/der.js.map +1 -0
- package/node_modules/@agenticreplay/proxy/dist/dialects.d.ts +81 -0
- package/node_modules/@agenticreplay/proxy/dist/dialects.d.ts.map +1 -0
- package/node_modules/@agenticreplay/proxy/dist/dialects.js +329 -0
- package/node_modules/@agenticreplay/proxy/dist/dialects.js.map +1 -0
- package/node_modules/@agenticreplay/proxy/dist/forward.d.ts +34 -0
- package/node_modules/@agenticreplay/proxy/dist/forward.d.ts.map +1 -0
- package/node_modules/@agenticreplay/proxy/dist/forward.js +44 -0
- package/node_modules/@agenticreplay/proxy/dist/forward.js.map +1 -0
- package/node_modules/@agenticreplay/proxy/dist/index.d.ts +9 -0
- package/node_modules/@agenticreplay/proxy/dist/index.d.ts.map +1 -0
- package/node_modules/@agenticreplay/proxy/dist/index.js +9 -0
- package/node_modules/@agenticreplay/proxy/dist/index.js.map +1 -0
- package/node_modules/@agenticreplay/proxy/dist/intercept.d.ts +234 -0
- package/node_modules/@agenticreplay/proxy/dist/intercept.d.ts.map +1 -0
- package/node_modules/@agenticreplay/proxy/dist/intercept.js +1258 -0
- package/node_modules/@agenticreplay/proxy/dist/intercept.js.map +1 -0
- package/node_modules/@agenticreplay/proxy/dist/matching.d.ts +109 -0
- package/node_modules/@agenticreplay/proxy/dist/matching.d.ts.map +1 -0
- package/node_modules/@agenticreplay/proxy/dist/matching.js +928 -0
- package/node_modules/@agenticreplay/proxy/dist/matching.js.map +1 -0
- package/node_modules/@agenticreplay/proxy/dist/retrieval.d.ts +93 -0
- package/node_modules/@agenticreplay/proxy/dist/retrieval.d.ts.map +1 -0
- package/node_modules/@agenticreplay/proxy/dist/retrieval.js +233 -0
- package/node_modules/@agenticreplay/proxy/dist/retrieval.js.map +1 -0
- package/node_modules/@agenticreplay/proxy/dist/server.d.ts +327 -0
- package/node_modules/@agenticreplay/proxy/dist/server.d.ts.map +1 -0
- package/node_modules/@agenticreplay/proxy/dist/server.js +2291 -0
- package/node_modules/@agenticreplay/proxy/dist/server.js.map +1 -0
- package/node_modules/@agenticreplay/proxy/dist/tls-hosts.d.ts +54 -0
- package/node_modules/@agenticreplay/proxy/dist/tls-hosts.d.ts.map +1 -0
- package/node_modules/@agenticreplay/proxy/dist/tls-hosts.js +178 -0
- package/node_modules/@agenticreplay/proxy/dist/tls-hosts.js.map +1 -0
- package/node_modules/@agenticreplay/proxy/package.json +28 -0
- package/node_modules/@agenticreplay/schema/dist/constants.d.ts +30 -0
- package/node_modules/@agenticreplay/schema/dist/constants.d.ts.map +1 -0
- package/node_modules/@agenticreplay/schema/dist/constants.js +66 -0
- package/node_modules/@agenticreplay/schema/dist/constants.js.map +1 -0
- package/node_modules/@agenticreplay/schema/dist/index.d.ts +4 -0
- package/node_modules/@agenticreplay/schema/dist/index.d.ts.map +1 -0
- package/node_modules/@agenticreplay/schema/dist/index.js +4 -0
- package/node_modules/@agenticreplay/schema/dist/index.js.map +1 -0
- package/node_modules/@agenticreplay/schema/dist/types.d.ts +97 -0
- package/node_modules/@agenticreplay/schema/dist/types.d.ts.map +1 -0
- package/node_modules/@agenticreplay/schema/dist/types.js +7 -0
- package/node_modules/@agenticreplay/schema/dist/types.js.map +1 -0
- package/node_modules/@agenticreplay/schema/dist/validate.d.ts +13 -0
- package/node_modules/@agenticreplay/schema/dist/validate.d.ts.map +1 -0
- package/node_modules/@agenticreplay/schema/dist/validate.js +44 -0
- package/node_modules/@agenticreplay/schema/dist/validate.js.map +1 -0
- package/node_modules/@agenticreplay/schema/package.json +28 -0
- package/node_modules/@agenticreplay/shell-shim/dist/index.d.ts +4 -0
- package/node_modules/@agenticreplay/shell-shim/dist/index.d.ts.map +1 -0
- package/node_modules/@agenticreplay/shell-shim/dist/index.js +4 -0
- package/node_modules/@agenticreplay/shell-shim/dist/index.js.map +1 -0
- package/node_modules/@agenticreplay/shell-shim/dist/install.d.ts +75 -0
- package/node_modules/@agenticreplay/shell-shim/dist/install.d.ts.map +1 -0
- package/node_modules/@agenticreplay/shell-shim/dist/install.js +353 -0
- package/node_modules/@agenticreplay/shell-shim/dist/install.js.map +1 -0
- package/node_modules/@agenticreplay/shell-shim/dist/resolve.d.ts +2 -0
- package/node_modules/@agenticreplay/shell-shim/dist/resolve.d.ts.map +1 -0
- package/node_modules/@agenticreplay/shell-shim/dist/resolve.js +97 -0
- package/node_modules/@agenticreplay/shell-shim/dist/resolve.js.map +1 -0
- package/node_modules/@agenticreplay/shell-shim/dist/runner-bin.d.ts +3 -0
- package/node_modules/@agenticreplay/shell-shim/dist/runner-bin.d.ts.map +1 -0
- package/node_modules/@agenticreplay/shell-shim/dist/runner-bin.js +4 -0
- package/node_modules/@agenticreplay/shell-shim/dist/runner-bin.js.map +1 -0
- package/node_modules/@agenticreplay/shell-shim/dist/runner.d.ts +45 -0
- package/node_modules/@agenticreplay/shell-shim/dist/runner.d.ts.map +1 -0
- package/node_modules/@agenticreplay/shell-shim/dist/runner.js +105 -0
- package/node_modules/@agenticreplay/shell-shim/dist/runner.js.map +1 -0
- package/node_modules/@agenticreplay/shell-shim/package.json +26 -0
- package/node_modules/@agenticreplay/viewer/dist/bundle.d.ts +11 -0
- package/node_modules/@agenticreplay/viewer/dist/bundle.d.ts.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/bundle.js +36 -0
- package/node_modules/@agenticreplay/viewer/dist/bundle.js.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/client/main.d.ts +12 -0
- package/node_modules/@agenticreplay/viewer/dist/client/main.d.ts.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/client/main.js +249 -0
- package/node_modules/@agenticreplay/viewer/dist/client/main.js.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/credit.d.ts +22 -0
- package/node_modules/@agenticreplay/viewer/dist/credit.d.ts.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/credit.js +22 -0
- package/node_modules/@agenticreplay/viewer/dist/credit.js.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/css.d.ts +11 -0
- package/node_modules/@agenticreplay/viewer/dist/css.d.ts.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/css.js +410 -0
- package/node_modules/@agenticreplay/viewer/dist/css.js.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/export.d.ts +21 -0
- package/node_modules/@agenticreplay/viewer/dist/export.d.ts.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/export.js +22 -0
- package/node_modules/@agenticreplay/viewer/dist/export.js.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/html.d.ts +32 -0
- package/node_modules/@agenticreplay/viewer/dist/html.d.ts.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/html.js +252 -0
- package/node_modules/@agenticreplay/viewer/dist/html.js.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/index.d.ts +16 -0
- package/node_modules/@agenticreplay/viewer/dist/index.d.ts.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/index.js +16 -0
- package/node_modules/@agenticreplay/viewer/dist/index.js.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/render.d.ts +126 -0
- package/node_modules/@agenticreplay/viewer/dist/render.d.ts.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/render.js +699 -0
- package/node_modules/@agenticreplay/viewer/dist/render.js.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/serve.d.ts +21 -0
- package/node_modules/@agenticreplay/viewer/dist/serve.d.ts.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/serve.js +122 -0
- package/node_modules/@agenticreplay/viewer/dist/serve.js.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/trace-dir.d.ts +28 -0
- package/node_modules/@agenticreplay/viewer/dist/trace-dir.d.ts.map +1 -0
- package/node_modules/@agenticreplay/viewer/dist/trace-dir.js +120 -0
- package/node_modules/@agenticreplay/viewer/dist/trace-dir.js.map +1 -0
- package/node_modules/@agenticreplay/viewer/package.json +25 -0
- package/node_modules/ajv/.runkit_example.js +23 -0
- package/node_modules/ajv/LICENSE +22 -0
- package/node_modules/ajv/README.md +207 -0
- package/node_modules/ajv/dist/2019.d.ts +19 -0
- package/node_modules/ajv/dist/2019.js +61 -0
- package/node_modules/ajv/dist/2019.js.map +1 -0
- package/node_modules/ajv/dist/2020.d.ts +19 -0
- package/node_modules/ajv/dist/2020.js +55 -0
- package/node_modules/ajv/dist/2020.js.map +1 -0
- package/node_modules/ajv/dist/ajv.d.ts +18 -0
- package/node_modules/ajv/dist/ajv.js +50 -0
- package/node_modules/ajv/dist/ajv.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/code.d.ts +40 -0
- package/node_modules/ajv/dist/compile/codegen/code.js +156 -0
- package/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/index.d.ts +79 -0
- package/node_modules/ajv/dist/compile/codegen/index.js +697 -0
- package/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/scope.d.ts +79 -0
- package/node_modules/ajv/dist/compile/codegen/scope.js +143 -0
- package/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
- package/node_modules/ajv/dist/compile/errors.d.ts +13 -0
- package/node_modules/ajv/dist/compile/errors.js +123 -0
- package/node_modules/ajv/dist/compile/errors.js.map +1 -0
- package/node_modules/ajv/dist/compile/index.d.ts +80 -0
- package/node_modules/ajv/dist/compile/index.js +242 -0
- package/node_modules/ajv/dist/compile/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/parse.d.ts +4 -0
- package/node_modules/ajv/dist/compile/jtd/parse.js +350 -0
- package/node_modules/ajv/dist/compile/jtd/parse.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.d.ts +4 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.js +236 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/types.d.ts +6 -0
- package/node_modules/ajv/dist/compile/jtd/types.js +14 -0
- package/node_modules/ajv/dist/compile/jtd/types.js.map +1 -0
- package/node_modules/ajv/dist/compile/names.d.ts +20 -0
- package/node_modules/ajv/dist/compile/names.js +28 -0
- package/node_modules/ajv/dist/compile/names.js.map +1 -0
- package/node_modules/ajv/dist/compile/ref_error.d.ts +6 -0
- package/node_modules/ajv/dist/compile/ref_error.js +12 -0
- package/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
- package/node_modules/ajv/dist/compile/resolve.d.ts +12 -0
- package/node_modules/ajv/dist/compile/resolve.js +155 -0
- package/node_modules/ajv/dist/compile/resolve.js.map +1 -0
- package/node_modules/ajv/dist/compile/rules.d.ts +28 -0
- package/node_modules/ajv/dist/compile/rules.js +26 -0
- package/node_modules/ajv/dist/compile/rules.js.map +1 -0
- package/node_modules/ajv/dist/compile/util.d.ts +40 -0
- package/node_modules/ajv/dist/compile/util.js +178 -0
- package/node_modules/ajv/dist/compile/util.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/applicability.d.ts +6 -0
- package/node_modules/ajv/dist/compile/validate/applicability.js +19 -0
- package/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.d.ts +4 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.js +50 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/dataType.d.ts +17 -0
- package/node_modules/ajv/dist/compile/validate/dataType.js +203 -0
- package/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/defaults.d.ts +2 -0
- package/node_modules/ajv/dist/compile/validate/defaults.js +35 -0
- package/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/index.d.ts +42 -0
- package/node_modules/ajv/dist/compile/validate/index.js +520 -0
- package/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/keyword.d.ts +8 -0
- package/node_modules/ajv/dist/compile/validate/keyword.js +124 -0
- package/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/subschema.d.ts +47 -0
- package/node_modules/ajv/dist/compile/validate/subschema.js +81 -0
- package/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
- package/node_modules/ajv/dist/core.d.ts +174 -0
- package/node_modules/ajv/dist/core.js +618 -0
- package/node_modules/ajv/dist/core.js.map +1 -0
- package/node_modules/ajv/dist/jtd.d.ts +47 -0
- package/node_modules/ajv/dist/jtd.js +72 -0
- package/node_modules/ajv/dist/jtd.js.map +1 -0
- package/node_modules/ajv/dist/refs/data.json +13 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts +2 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js +28 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map +1 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +17 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +57 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +14 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +39 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts +2 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +30 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map +1 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json +17 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json +51 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json +55 -0
- package/node_modules/ajv/dist/refs/json-schema-draft-06.json +137 -0
- package/node_modules/ajv/dist/refs/json-schema-draft-07.json +151 -0
- package/node_modules/ajv/dist/refs/json-schema-secure.json +88 -0
- package/node_modules/ajv/dist/refs/jtd-schema.d.ts +3 -0
- package/node_modules/ajv/dist/refs/jtd-schema.js +118 -0
- package/node_modules/ajv/dist/refs/jtd-schema.js.map +1 -0
- package/node_modules/ajv/dist/runtime/equal.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/equal.js +7 -0
- package/node_modules/ajv/dist/runtime/equal.js.map +1 -0
- package/node_modules/ajv/dist/runtime/parseJson.d.ts +18 -0
- package/node_modules/ajv/dist/runtime/parseJson.js +185 -0
- package/node_modules/ajv/dist/runtime/parseJson.js.map +1 -0
- package/node_modules/ajv/dist/runtime/quote.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/quote.js +30 -0
- package/node_modules/ajv/dist/runtime/quote.js.map +1 -0
- package/node_modules/ajv/dist/runtime/re2.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/re2.js +6 -0
- package/node_modules/ajv/dist/runtime/re2.js.map +1 -0
- package/node_modules/ajv/dist/runtime/timestamp.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/timestamp.js +42 -0
- package/node_modules/ajv/dist/runtime/timestamp.js.map +1 -0
- package/node_modules/ajv/dist/runtime/ucs2length.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/ucs2length.js +24 -0
- package/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
- package/node_modules/ajv/dist/runtime/uri.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/uri.js +6 -0
- package/node_modules/ajv/dist/runtime/uri.js.map +1 -0
- package/node_modules/ajv/dist/runtime/validation_error.d.ts +7 -0
- package/node_modules/ajv/dist/runtime/validation_error.js +11 -0
- package/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
- package/node_modules/ajv/dist/standalone/index.d.ts +6 -0
- package/node_modules/ajv/dist/standalone/index.js +90 -0
- package/node_modules/ajv/dist/standalone/index.js.map +1 -0
- package/node_modules/ajv/dist/standalone/instance.d.ts +12 -0
- package/node_modules/ajv/dist/standalone/instance.js +35 -0
- package/node_modules/ajv/dist/standalone/instance.js.map +1 -0
- package/node_modules/ajv/dist/types/index.d.ts +183 -0
- package/node_modules/ajv/dist/types/index.js +3 -0
- package/node_modules/ajv/dist/types/index.js.map +1 -0
- package/node_modules/ajv/dist/types/json-schema.d.ts +125 -0
- package/node_modules/ajv/dist/types/json-schema.js +3 -0
- package/node_modules/ajv/dist/types/json-schema.js.map +1 -0
- package/node_modules/ajv/dist/types/jtd-schema.d.ts +174 -0
- package/node_modules/ajv/dist/types/jtd-schema.js +3 -0
- package/node_modules/ajv/dist/types/jtd-schema.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +49 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +106 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.js +23 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +12 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +7 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.js +95 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +21 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +85 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +11 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.js +66 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +13 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.js +44 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.js +52 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.js +30 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.js +26 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +60 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +75 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +12 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.js +54 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +38 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +13 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/code.d.ts +17 -0
- package/node_modules/ajv/dist/vocabularies/code.js +131 -0
- package/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/id.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/core/id.js +10 -0
- package/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/core/index.js +16 -0
- package/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.js +122 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.js +104 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.js +9 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.js +23 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/draft7.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/draft7.js +17 -0
- package/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +30 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +51 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.js +9 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +16 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +10 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/errors.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/errors.js +3 -0
- package/node_modules/ajv/dist/vocabularies/errors.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/format/format.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/format/format.js +92 -0
- package/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/format/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/format/index.js +6 -0
- package/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js +71 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.js +24 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.js +43 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.js +20 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.js +29 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.js +25 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.js +22 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js +15 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +22 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.js +149 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.js +67 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.js +69 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.js +12 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.js +51 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/metadata.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/metadata.js +18 -0
- package/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/next.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/next.js +8 -0
- package/node_modules/ajv/dist/vocabularies/next.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.js +7 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +40 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +65 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.js +25 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +12 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.js +48 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.d.ts +16 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.js +33 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.js +15 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.js +27 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +11 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +27 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +26 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.js +33 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.js +79 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +64 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
- package/node_modules/ajv/lib/2019.ts +81 -0
- package/node_modules/ajv/lib/2020.ts +75 -0
- package/node_modules/ajv/lib/ajv.ts +70 -0
- package/node_modules/ajv/lib/compile/codegen/code.ts +169 -0
- package/node_modules/ajv/lib/compile/codegen/index.ts +852 -0
- package/node_modules/ajv/lib/compile/codegen/scope.ts +215 -0
- package/node_modules/ajv/lib/compile/errors.ts +184 -0
- package/node_modules/ajv/lib/compile/index.ts +324 -0
- package/node_modules/ajv/lib/compile/jtd/parse.ts +411 -0
- package/node_modules/ajv/lib/compile/jtd/serialize.ts +277 -0
- package/node_modules/ajv/lib/compile/jtd/types.ts +16 -0
- package/node_modules/ajv/lib/compile/names.ts +27 -0
- package/node_modules/ajv/lib/compile/ref_error.ts +13 -0
- package/node_modules/ajv/lib/compile/resolve.ts +149 -0
- package/node_modules/ajv/lib/compile/rules.ts +50 -0
- package/node_modules/ajv/lib/compile/util.ts +213 -0
- package/node_modules/ajv/lib/compile/validate/applicability.ts +22 -0
- package/node_modules/ajv/lib/compile/validate/boolSchema.ts +47 -0
- package/node_modules/ajv/lib/compile/validate/dataType.ts +230 -0
- package/node_modules/ajv/lib/compile/validate/defaults.ts +32 -0
- package/node_modules/ajv/lib/compile/validate/index.ts +582 -0
- package/node_modules/ajv/lib/compile/validate/keyword.ts +171 -0
- package/node_modules/ajv/lib/compile/validate/subschema.ts +135 -0
- package/node_modules/ajv/lib/core.ts +892 -0
- package/node_modules/ajv/lib/jtd.ts +132 -0
- package/node_modules/ajv/lib/refs/data.json +13 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts +28 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json +17 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json +57 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json +14 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json +39 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts +30 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json +17 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json +51 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json +55 -0
- package/node_modules/ajv/lib/refs/json-schema-draft-06.json +137 -0
- package/node_modules/ajv/lib/refs/json-schema-draft-07.json +151 -0
- package/node_modules/ajv/lib/refs/json-schema-secure.json +88 -0
- package/node_modules/ajv/lib/refs/jtd-schema.ts +130 -0
- package/node_modules/ajv/lib/runtime/equal.ts +7 -0
- package/node_modules/ajv/lib/runtime/parseJson.ts +177 -0
- package/node_modules/ajv/lib/runtime/quote.ts +31 -0
- package/node_modules/ajv/lib/runtime/re2.ts +6 -0
- package/node_modules/ajv/lib/runtime/timestamp.ts +46 -0
- package/node_modules/ajv/lib/runtime/ucs2length.ts +20 -0
- package/node_modules/ajv/lib/runtime/uri.ts +6 -0
- package/node_modules/ajv/lib/runtime/validation_error.ts +13 -0
- package/node_modules/ajv/lib/standalone/index.ts +100 -0
- package/node_modules/ajv/lib/standalone/instance.ts +36 -0
- package/node_modules/ajv/lib/types/index.ts +244 -0
- package/node_modules/ajv/lib/types/json-schema.ts +187 -0
- package/node_modules/ajv/lib/types/jtd-schema.ts +273 -0
- package/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts +56 -0
- package/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +118 -0
- package/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +22 -0
- package/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts +14 -0
- package/node_modules/ajv/lib/vocabularies/applicator/contains.ts +109 -0
- package/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts +112 -0
- package/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts +11 -0
- package/node_modules/ajv/lib/vocabularies/applicator/if.ts +80 -0
- package/node_modules/ajv/lib/vocabularies/applicator/index.ts +53 -0
- package/node_modules/ajv/lib/vocabularies/applicator/items.ts +59 -0
- package/node_modules/ajv/lib/vocabularies/applicator/items2020.ts +36 -0
- package/node_modules/ajv/lib/vocabularies/applicator/not.ts +38 -0
- package/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts +82 -0
- package/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts +91 -0
- package/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/applicator/properties.ts +57 -0
- package/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts +50 -0
- package/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts +13 -0
- package/node_modules/ajv/lib/vocabularies/code.ts +168 -0
- package/node_modules/ajv/lib/vocabularies/core/id.ts +10 -0
- package/node_modules/ajv/lib/vocabularies/core/index.ts +16 -0
- package/node_modules/ajv/lib/vocabularies/core/ref.ts +129 -0
- package/node_modules/ajv/lib/vocabularies/discriminator/index.ts +113 -0
- package/node_modules/ajv/lib/vocabularies/discriminator/types.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/draft2020.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/draft7.ts +17 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts +31 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts +51 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/index.ts +9 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts +14 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts +10 -0
- package/node_modules/ajv/lib/vocabularies/errors.ts +18 -0
- package/node_modules/ajv/lib/vocabularies/format/format.ts +120 -0
- package/node_modules/ajv/lib/vocabularies/format/index.ts +6 -0
- package/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts +89 -0
- package/node_modules/ajv/lib/vocabularies/jtd/elements.ts +32 -0
- package/node_modules/ajv/lib/vocabularies/jtd/enum.ts +45 -0
- package/node_modules/ajv/lib/vocabularies/jtd/error.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/jtd/index.ts +37 -0
- package/node_modules/ajv/lib/vocabularies/jtd/metadata.ts +24 -0
- package/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +21 -0
- package/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts +15 -0
- package/node_modules/ajv/lib/vocabularies/jtd/properties.ts +184 -0
- package/node_modules/ajv/lib/vocabularies/jtd/ref.ts +76 -0
- package/node_modules/ajv/lib/vocabularies/jtd/type.ts +75 -0
- package/node_modules/ajv/lib/vocabularies/jtd/union.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/jtd/values.ts +58 -0
- package/node_modules/ajv/lib/vocabularies/metadata.ts +17 -0
- package/node_modules/ajv/lib/vocabularies/next.ts +8 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/index.ts +7 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts +47 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +85 -0
- package/node_modules/ajv/lib/vocabularies/validation/const.ts +28 -0
- package/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/validation/enum.ts +54 -0
- package/node_modules/ajv/lib/vocabularies/validation/index.ts +49 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitContains.ts +16 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitItems.ts +26 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitLength.ts +30 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts +42 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +26 -0
- package/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts +34 -0
- package/node_modules/ajv/lib/vocabularies/validation/pattern.ts +39 -0
- package/node_modules/ajv/lib/vocabularies/validation/required.ts +98 -0
- package/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts +79 -0
- package/node_modules/ajv/package.json +126 -0
- package/node_modules/ajv-formats/LICENSE +21 -0
- package/node_modules/ajv-formats/README.md +125 -0
- package/node_modules/ajv-formats/dist/formats.d.ts +9 -0
- package/node_modules/ajv-formats/dist/formats.js +208 -0
- package/node_modules/ajv-formats/dist/formats.js.map +1 -0
- package/node_modules/ajv-formats/dist/index.d.ts +15 -0
- package/node_modules/ajv-formats/dist/index.js +37 -0
- package/node_modules/ajv-formats/dist/index.js.map +1 -0
- package/node_modules/ajv-formats/dist/limit.d.ts +10 -0
- package/node_modules/ajv-formats/dist/limit.js +69 -0
- package/node_modules/ajv-formats/dist/limit.js.map +1 -0
- package/node_modules/ajv-formats/package.json +74 -0
- package/node_modules/ajv-formats/src/formats.ts +269 -0
- package/node_modules/ajv-formats/src/index.ts +62 -0
- package/node_modules/ajv-formats/src/limit.ts +99 -0
- package/node_modules/fast-deep-equal/LICENSE +21 -0
- package/node_modules/fast-deep-equal/README.md +96 -0
- package/node_modules/fast-deep-equal/es6/index.d.ts +2 -0
- package/node_modules/fast-deep-equal/es6/index.js +72 -0
- package/node_modules/fast-deep-equal/es6/react.d.ts +2 -0
- package/node_modules/fast-deep-equal/es6/react.js +79 -0
- package/node_modules/fast-deep-equal/index.d.ts +4 -0
- package/node_modules/fast-deep-equal/index.js +46 -0
- package/node_modules/fast-deep-equal/package.json +61 -0
- package/node_modules/fast-deep-equal/react.d.ts +2 -0
- package/node_modules/fast-deep-equal/react.js +53 -0
- package/node_modules/fast-uri/.gitattributes +2 -0
- package/node_modules/fast-uri/.github/dependabot.yml +13 -0
- package/node_modules/fast-uri/.github/workflows/ci.yml +106 -0
- package/node_modules/fast-uri/.github/workflows/lock-threads.yml +19 -0
- package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +24 -0
- package/node_modules/fast-uri/LICENSE +30 -0
- package/node_modules/fast-uri/README.md +152 -0
- package/node_modules/fast-uri/benchmark/benchmark.mjs +159 -0
- package/node_modules/fast-uri/benchmark/equal.mjs +51 -0
- package/node_modules/fast-uri/benchmark/non-simple-domain.mjs +22 -0
- package/node_modules/fast-uri/benchmark/package.json +17 -0
- package/node_modules/fast-uri/benchmark/string-array-to-hex-stripped.mjs +24 -0
- package/node_modules/fast-uri/benchmark/ws-is-secure.mjs +65 -0
- package/node_modules/fast-uri/eslint.config.js +6 -0
- package/node_modules/fast-uri/index.js +631 -0
- package/node_modules/fast-uri/lib/schemes.js +272 -0
- package/node_modules/fast-uri/lib/utils.js +747 -0
- package/node_modules/fast-uri/package.json +68 -0
- package/node_modules/fast-uri/test/ajv.test.js +43 -0
- package/node_modules/fast-uri/test/component-safe-serialization.test.js +163 -0
- package/node_modules/fast-uri/test/equal.test.js +145 -0
- package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +503 -0
- package/node_modules/fast-uri/test/fixtures/uri-js-serialize.json +120 -0
- package/node_modules/fast-uri/test/ipv6-canonical.test.js +34 -0
- package/node_modules/fast-uri/test/ipv6-validation.test.js +124 -0
- package/node_modules/fast-uri/test/malformed-percent.test.js +77 -0
- package/node_modules/fast-uri/test/malformed-urn.test.js +61 -0
- package/node_modules/fast-uri/test/parse.test.js +327 -0
- package/node_modules/fast-uri/test/query-fragment-normalization.test.js +33 -0
- package/node_modules/fast-uri/test/reserved-path-normalization.test.js +109 -0
- package/node_modules/fast-uri/test/resolve.test.js +87 -0
- package/node_modules/fast-uri/test/rfc-3986.test.js +90 -0
- package/node_modules/fast-uri/test/scheme-validation.test.js +124 -0
- package/node_modules/fast-uri/test/security-normalization.test.js +178 -0
- package/node_modules/fast-uri/test/security.test.js +431 -0
- package/node_modules/fast-uri/test/serialize.test.js +151 -0
- package/node_modules/fast-uri/test/uri-js-compatibility.test.js +33 -0
- package/node_modules/fast-uri/test/uri-js.test.js +912 -0
- package/node_modules/fast-uri/test/urn-full-input.test.js +29 -0
- package/node_modules/fast-uri/test/util.test.js +38 -0
- package/node_modules/fast-uri/test/websocket-query-preservation.test.js +24 -0
- package/node_modules/fast-uri/tsconfig.json +9 -0
- package/node_modules/fast-uri/types/index.d.ts +60 -0
- package/node_modules/fast-uri/types/index.test-d.ts +17 -0
- package/node_modules/json-schema-traverse/.eslintrc.yml +27 -0
- package/node_modules/json-schema-traverse/.github/FUNDING.yml +2 -0
- package/node_modules/json-schema-traverse/.github/workflows/build.yml +28 -0
- package/node_modules/json-schema-traverse/.github/workflows/publish.yml +27 -0
- package/node_modules/json-schema-traverse/LICENSE +21 -0
- package/node_modules/json-schema-traverse/README.md +95 -0
- package/node_modules/json-schema-traverse/index.d.ts +40 -0
- package/node_modules/json-schema-traverse/index.js +93 -0
- package/node_modules/json-schema-traverse/package.json +43 -0
- package/node_modules/json-schema-traverse/spec/.eslintrc.yml +6 -0
- package/node_modules/json-schema-traverse/spec/fixtures/schema.js +125 -0
- package/node_modules/json-schema-traverse/spec/index.spec.js +171 -0
- package/node_modules/require-from-string/index.js +34 -0
- package/node_modules/require-from-string/license +21 -0
- package/node_modules/require-from-string/package.json +28 -0
- package/node_modules/require-from-string/readme.md +56 -0
- package/package.json +49 -2
- package/packages/cli/dist/agent-spans.d.ts +238 -0
- package/packages/cli/dist/agent-spans.d.ts.map +1 -0
- package/packages/cli/dist/agent-spans.js +677 -0
- package/packages/cli/dist/agent-spans.js.map +1 -0
- package/packages/cli/dist/api.d.ts +127 -0
- package/packages/cli/dist/api.d.ts.map +1 -0
- package/packages/cli/dist/api.js +159 -0
- package/packages/cli/dist/api.js.map +1 -0
- package/packages/cli/dist/archive.d.ts +24 -0
- package/packages/cli/dist/archive.d.ts.map +1 -0
- package/packages/cli/dist/archive.js +230 -0
- package/packages/cli/dist/archive.js.map +1 -0
- package/packages/cli/dist/args.d.ts +57 -0
- package/packages/cli/dist/args.d.ts.map +1 -0
- package/packages/cli/dist/args.js +180 -0
- package/packages/cli/dist/args.js.map +1 -0
- package/packages/cli/dist/attach.d.ts +48 -0
- package/packages/cli/dist/attach.d.ts.map +1 -0
- package/packages/cli/dist/attach.js +153 -0
- package/packages/cli/dist/attach.js.map +1 -0
- package/packages/cli/dist/capture-limits.d.ts +7 -0
- package/packages/cli/dist/capture-limits.d.ts.map +1 -0
- package/packages/cli/dist/capture-limits.js +13 -0
- package/packages/cli/dist/capture-limits.js.map +1 -0
- package/packages/cli/dist/cli.d.ts +3 -0
- package/packages/cli/dist/cli.d.ts.map +1 -0
- package/packages/cli/dist/cli.js +4 -0
- package/packages/cli/dist/cli.js.map +1 -0
- package/packages/cli/dist/commands/attach.d.ts +49 -0
- package/packages/cli/dist/commands/attach.d.ts.map +1 -0
- package/packages/cli/dist/commands/attach.js +350 -0
- package/packages/cli/dist/commands/attach.js.map +1 -0
- package/packages/cli/dist/commands/compare.d.ts +27 -0
- package/packages/cli/dist/commands/compare.d.ts.map +1 -0
- package/packages/cli/dist/commands/compare.js +187 -0
- package/packages/cli/dist/commands/compare.js.map +1 -0
- package/packages/cli/dist/commands/doctor.d.ts +24 -0
- package/packages/cli/dist/commands/doctor.d.ts.map +1 -0
- package/packages/cli/dist/commands/doctor.js +402 -0
- package/packages/cli/dist/commands/doctor.js.map +1 -0
- package/packages/cli/dist/commands/gc.d.ts +24 -0
- package/packages/cli/dist/commands/gc.d.ts.map +1 -0
- package/packages/cli/dist/commands/gc.js +326 -0
- package/packages/cli/dist/commands/gc.js.map +1 -0
- package/packages/cli/dist/commands/inspect.d.ts +45 -0
- package/packages/cli/dist/commands/inspect.d.ts.map +1 -0
- package/packages/cli/dist/commands/inspect.js +375 -0
- package/packages/cli/dist/commands/inspect.js.map +1 -0
- package/packages/cli/dist/commands/quickstart.d.ts +48 -0
- package/packages/cli/dist/commands/quickstart.d.ts.map +1 -0
- package/packages/cli/dist/commands/quickstart.js +413 -0
- package/packages/cli/dist/commands/quickstart.js.map +1 -0
- package/packages/cli/dist/commands/record.d.ts +31 -0
- package/packages/cli/dist/commands/record.d.ts.map +1 -0
- package/packages/cli/dist/commands/record.js +958 -0
- package/packages/cli/dist/commands/record.js.map +1 -0
- package/packages/cli/dist/commands/replay.d.ts +184 -0
- package/packages/cli/dist/commands/replay.d.ts.map +1 -0
- package/packages/cli/dist/commands/replay.js +2014 -0
- package/packages/cli/dist/commands/replay.js.map +1 -0
- package/packages/cli/dist/commands/scrub.d.ts +34 -0
- package/packages/cli/dist/commands/scrub.d.ts.map +1 -0
- package/packages/cli/dist/commands/scrub.js +765 -0
- package/packages/cli/dist/commands/scrub.js.map +1 -0
- package/packages/cli/dist/commands/setup.d.ts +23 -0
- package/packages/cli/dist/commands/setup.d.ts.map +1 -0
- package/packages/cli/dist/commands/setup.js +239 -0
- package/packages/cli/dist/commands/setup.js.map +1 -0
- package/packages/cli/dist/commands/sync.d.ts +236 -0
- package/packages/cli/dist/commands/sync.d.ts.map +1 -0
- package/packages/cli/dist/commands/sync.js +1270 -0
- package/packages/cli/dist/commands/sync.js.map +1 -0
- package/packages/cli/dist/config.d.ts +69 -0
- package/packages/cli/dist/config.d.ts.map +1 -0
- package/packages/cli/dist/config.js +144 -0
- package/packages/cli/dist/config.js.map +1 -0
- package/packages/cli/dist/exchange-events.d.ts +80 -0
- package/packages/cli/dist/exchange-events.d.ts.map +1 -0
- package/packages/cli/dist/exchange-events.js +296 -0
- package/packages/cli/dist/exchange-events.js.map +1 -0
- package/packages/cli/dist/flags.d.ts +41 -0
- package/packages/cli/dist/flags.d.ts.map +1 -0
- package/packages/cli/dist/flags.js +292 -0
- package/packages/cli/dist/flags.js.map +1 -0
- package/packages/cli/dist/fs-events.d.ts +19 -0
- package/packages/cli/dist/fs-events.d.ts.map +1 -0
- package/packages/cli/dist/fs-events.js +89 -0
- package/packages/cli/dist/fs-events.js.map +1 -0
- package/packages/cli/dist/index.d.ts +18 -0
- package/packages/cli/dist/index.d.ts.map +1 -0
- package/packages/cli/dist/index.js +18 -0
- package/packages/cli/dist/index.js.map +1 -0
- package/packages/cli/dist/main.d.ts +2 -0
- package/packages/cli/dist/main.d.ts.map +1 -0
- package/packages/cli/dist/main.js +404 -0
- package/packages/cli/dist/main.js.map +1 -0
- package/packages/cli/dist/mcp-server.d.ts +44 -0
- package/packages/cli/dist/mcp-server.d.ts.map +1 -0
- package/packages/cli/dist/mcp-server.js +250 -0
- package/packages/cli/dist/mcp-server.js.map +1 -0
- package/packages/cli/dist/mcp.d.ts +126 -0
- package/packages/cli/dist/mcp.d.ts.map +1 -0
- package/packages/cli/dist/mcp.js +290 -0
- package/packages/cli/dist/mcp.js.map +1 -0
- package/packages/cli/dist/out.d.ts +107 -0
- package/packages/cli/dist/out.d.ts.map +1 -0
- package/packages/cli/dist/out.js +280 -0
- package/packages/cli/dist/out.js.map +1 -0
- package/packages/cli/dist/rasterize.d.ts +62 -0
- package/packages/cli/dist/rasterize.d.ts.map +1 -0
- package/packages/cli/dist/rasterize.js +154 -0
- package/packages/cli/dist/rasterize.js.map +1 -0
- package/packages/cli/dist/serial.d.ts +19 -0
- package/packages/cli/dist/serial.d.ts.map +1 -0
- package/packages/cli/dist/serial.js +34 -0
- package/packages/cli/dist/serial.js.map +1 -0
- package/packages/cli/dist/share-card.d.ts +73 -0
- package/packages/cli/dist/share-card.d.ts.map +1 -0
- package/packages/cli/dist/share-card.js +413 -0
- package/packages/cli/dist/share-card.js.map +1 -0
- package/packages/cli/dist/snapshot.d.ts +39 -0
- package/packages/cli/dist/snapshot.d.ts.map +1 -0
- package/packages/cli/dist/snapshot.js +43 -0
- package/packages/cli/dist/snapshot.js.map +1 -0
- package/packages/cli/dist/tls-capture.d.ts +135 -0
- package/packages/cli/dist/tls-capture.d.ts.map +1 -0
- package/packages/cli/dist/tls-capture.js +586 -0
- package/packages/cli/dist/tls-capture.js.map +1 -0
- package/packages/cli/dist/upstream.d.ts +29 -0
- package/packages/cli/dist/upstream.d.ts.map +1 -0
- package/packages/cli/dist/upstream.js +41 -0
- package/packages/cli/dist/upstream.js.map +1 -0
- package/packages/cli/dist/version.d.ts +2 -0
- package/packages/cli/dist/version.d.ts.map +1 -0
- package/packages/cli/dist/version.js +18 -0
- package/packages/cli/dist/version.js.map +1 -0
- package/packages/cli/package.json +11 -11
- package/.dockerignore +0 -11
- package/.gitattributes +0 -19
- package/.github/workflows/ci.yml +0 -146
- package/.grok-plugin/plugin.json +0 -12
- package/.mcp.json +0 -8
- package/.prettierignore +0 -4
- package/.prettierrc.json +0 -1
- package/CONTRIBUTING.md +0 -106
- package/Dockerfile +0 -30
- package/MAINTAINERS.md +0 -24
- package/RELEASING.md +0 -183
- package/SECURITY.md +0 -149
- package/capture/CAPTURE-RUNBOOK.md +0 -271
- package/capture/CURSOR-HTTP2.md +0 -226
- package/capture/README.md +0 -349
- package/capture/capture-run.gif +0 -0
- package/capture/capture.mjs +0 -1883
- package/capture/fable-capture.gif +0 -0
- package/capture/fable-capture.mp4 +0 -0
- package/capture/muse-shim.mjs +0 -114
- package/capture/render-run.mjs +0 -125
- package/capture/render.mjs +0 -228
- package/companion-kiokuko-dsh.patch +0 -7806
- package/docs/agenticreplay-acceptance.md +0 -135
- package/docs/architecture.md +0 -160
- package/docs/chain-card.png +0 -0
- package/docs/compare-card.png +0 -0
- package/docs/demo-cli.gif +0 -0
- package/docs/demo-viewer.gif +0 -0
- package/docs/fidelity.md +0 -16
- package/docs/good-first-issues.md +0 -78
- package/docs/graph-card.png +0 -0
- package/docs/how-to/compare-models-on-the-same-failure.md +0 -58
- package/docs/how-to/debug-a-failing-agent-run.md +0 -127
- package/docs/how-to/why-did-my-agent-delete-my-file.md +0 -92
- package/docs/i18n/README.ar.md +0 -597
- package/docs/i18n/README.de.md +0 -648
- package/docs/i18n/README.es.md +0 -642
- package/docs/i18n/README.fr.md +0 -649
- package/docs/i18n/README.ja.md +0 -608
- package/docs/i18n/README.ko.md +0 -598
- package/docs/i18n/README.zh-CN.md +0 -574
- package/docs/integrations.md +0 -628
- package/docs/launch-path.md +0 -215
- package/docs/media/README.md +0 -101
- package/docs/media/sync-transcript.txt +0 -18
- package/docs/media/transcript.txt +0 -29
- package/docs/opencode-capture.md +0 -137
- package/docs/plugins.md +0 -250
- package/docs/proposals/action-graph-and-reasoning.md +0 -354
- package/docs/sync-card.png +0 -0
- package/docs/validation.md +0 -52
- package/docs/viewer-timeline.png +0 -0
- package/examples/traces/README.md +0 -50
- package/examples/traces/run_9f2c14a03b71/blobs/1b/1b694f32b8c582ace6b35ad64050e532fb3ee3ecc1a2763a82cf42ad0f2a3dd0 +0 -10
- package/examples/traces/run_9f2c14a03b71/blobs/51/517b5b8ec6c3b13121dbaec61784e2a024247c7c4efd9ba068b582ee57bd2764 +0 -4
- package/examples/traces/run_9f2c14a03b71/blobs/5b/5bba1bd069013d86363f69c00c1ae77c84c4e113aeeb7431c8141af4fed76860 +0 -7
- package/examples/traces/run_9f2c14a03b71/blobs/84/84247e7b385fd5f99a6728a509838e52ef963af92f44ef6eccbed6910de1438d +0 -10
- package/examples/traces/run_9f2c14a03b71/blobs/ac/ac9b4be9bdf7fe63c7b5135e2d14c4c0745a48771e733804869790590455f8e8 +0 -7
- package/examples/traces/run_9f2c14a03b71/events.jsonl +0 -31
- package/examples/traces/run_9f2c14a03b71/manifest.json +0 -46
- package/examples/traces/run_9f2c14a03b71/redactions.json +0 -17
- package/llms.txt +0 -26
- package/packages/adapters/fixtures/harness/claude-code.json +0 -12
- package/packages/adapters/fixtures/harness/codex.json +0 -10
- package/packages/adapters/fixtures/harness/cursor.json +0 -10
- package/packages/adapters/fixtures/harness/exec.json +0 -10
- package/packages/adapters/fixtures/harness/generic-openai.json +0 -14
- package/packages/adapters/fixtures/harness/goose.json +0 -14
- package/packages/adapters/fixtures/harness/grok.json +0 -18
- package/packages/adapters/fixtures/harness/hermes.json +0 -10
- package/packages/adapters/fixtures/harness/indexrag.json +0 -21
- package/packages/adapters/fixtures/harness/kilo.json +0 -10
- package/packages/adapters/fixtures/harness/mcode.json +0 -10
- package/packages/adapters/fixtures/harness/mimo.json +0 -10
- package/packages/adapters/fixtures/harness/node.json +0 -22
- package/packages/adapters/fixtures/harness/openclaw.json +0 -21
- package/packages/adapters/fixtures/harness/opencode.json +0 -20
- package/packages/adapters/fixtures/harness/qwen.json +0 -20
- package/packages/adapters/fixtures/harness/zcode.json +0 -10
- package/packages/adapters/package.json +0 -29
- package/packages/adapters/src/claude-code.ts +0 -109
- package/packages/adapters/src/codex.ts +0 -135
- package/packages/adapters/src/contract.ts +0 -531
- package/packages/adapters/src/cursor.ts +0 -76
- package/packages/adapters/src/detect.ts +0 -132
- package/packages/adapters/src/env.ts +0 -118
- package/packages/adapters/src/exec.ts +0 -59
- package/packages/adapters/src/generic-openai.ts +0 -36
- package/packages/adapters/src/goose.ts +0 -87
- package/packages/adapters/src/grok.ts +0 -60
- package/packages/adapters/src/hermes.ts +0 -92
- package/packages/adapters/src/index.ts +0 -24
- package/packages/adapters/src/indexrag.ts +0 -254
- package/packages/adapters/src/kilo.ts +0 -39
- package/packages/adapters/src/mcode.ts +0 -392
- package/packages/adapters/src/mcp-config.ts +0 -84
- package/packages/adapters/src/mimo.ts +0 -44
- package/packages/adapters/src/node.ts +0 -71
- package/packages/adapters/src/openclaw.ts +0 -50
- package/packages/adapters/src/opencode-api-bases.ts +0 -200
- package/packages/adapters/src/opencode-capture.ts +0 -164
- package/packages/adapters/src/opencode-catalog.ts +0 -44
- package/packages/adapters/src/opencode-config.ts +0 -209
- package/packages/adapters/src/opencode.ts +0 -257
- package/packages/adapters/src/qwen.ts +0 -113
- package/packages/adapters/src/registry.ts +0 -121
- package/packages/adapters/src/scaffold.ts +0 -173
- package/packages/adapters/src/session.ts +0 -138
- package/packages/adapters/src/zcode.ts +0 -440
- package/packages/adapters/test/adapters.test.ts +0 -666
- package/packages/adapters/test/contract.test.ts +0 -601
- package/packages/adapters/test/exec-adapter.test.ts +0 -114
- package/packages/adapters/test/harness-versions.test.ts +0 -220
- package/packages/adapters/test/indexrag.test.ts +0 -192
- package/packages/adapters/test/mcode.test.ts +0 -678
- package/packages/adapters/test/mcp-config.test.ts +0 -118
- package/packages/adapters/test/named-agents.test.ts +0 -262
- package/packages/adapters/test/node-adapter.test.ts +0 -98
- package/packages/adapters/test/opencode-capture.test.ts +0 -137
- package/packages/adapters/test/opencode-catalog.test.ts +0 -178
- package/packages/adapters/test/opencode-config.test.ts +0 -63
- package/packages/adapters/test/scaffold.test.ts +0 -156
- package/packages/adapters/test/session.test.ts +0 -368
- package/packages/adapters/test/zcode.test.ts +0 -497
- package/packages/adapters/tsconfig.json +0 -16
- package/packages/cli/README.md +0 -92
- package/packages/cli/src/agent-spans.ts +0 -752
- package/packages/cli/src/api.ts +0 -275
- package/packages/cli/src/archive.ts +0 -264
- package/packages/cli/src/args.ts +0 -207
- package/packages/cli/src/attach.ts +0 -178
- package/packages/cli/src/capture-limits.ts +0 -21
- package/packages/cli/src/cli.ts +0 -4
- package/packages/cli/src/commands/attach.ts +0 -441
- package/packages/cli/src/commands/compare.ts +0 -218
- package/packages/cli/src/commands/doctor.ts +0 -447
- package/packages/cli/src/commands/gc.ts +0 -372
- package/packages/cli/src/commands/inspect.ts +0 -482
- package/packages/cli/src/commands/quickstart.ts +0 -479
- package/packages/cli/src/commands/record.ts +0 -1069
- package/packages/cli/src/commands/replay.ts +0 -2289
- package/packages/cli/src/commands/scrub.ts +0 -865
- package/packages/cli/src/commands/setup.ts +0 -294
- package/packages/cli/src/commands/sync.ts +0 -1429
- package/packages/cli/src/config.ts +0 -182
- package/packages/cli/src/exchange-events.ts +0 -369
- package/packages/cli/src/flags.ts +0 -316
- package/packages/cli/src/fs-events.ts +0 -103
- package/packages/cli/src/index.ts +0 -17
- package/packages/cli/src/main.ts +0 -419
- package/packages/cli/src/mcp-server.ts +0 -314
- package/packages/cli/src/mcp.ts +0 -350
- package/packages/cli/src/out.ts +0 -350
- package/packages/cli/src/rasterize.ts +0 -205
- package/packages/cli/src/serial.ts +0 -38
- package/packages/cli/src/share-card.ts +0 -514
- package/packages/cli/src/snapshot.ts +0 -80
- package/packages/cli/src/tls-capture.ts +0 -688
- package/packages/cli/src/upstream.ts +0 -75
- package/packages/cli/src/version.ts +0 -21
- package/packages/cli/test/agent-spans-drain.test.ts +0 -157
- package/packages/cli/test/agent-spans-race.test.ts +0 -97
- package/packages/cli/test/agent-spans.test.ts +0 -1032
- package/packages/cli/test/api.test.ts +0 -178
- package/packages/cli/test/archive.test.ts +0 -143
- package/packages/cli/test/args.test.ts +0 -164
- package/packages/cli/test/attach-command.test.ts +0 -356
- package/packages/cli/test/attach.test.ts +0 -198
- package/packages/cli/test/capture-oracle.test.ts +0 -160
- package/packages/cli/test/capture-warning.test.ts +0 -215
- package/packages/cli/test/chain-card.test.ts +0 -190
- package/packages/cli/test/claude-capture.test.ts +0 -242
- package/packages/cli/test/compare.test.ts +0 -329
- package/packages/cli/test/config-permission-failure.test.ts +0 -41
- package/packages/cli/test/config.test.ts +0 -239
- package/packages/cli/test/declared-inside-replay.test.ts +0 -170
- package/packages/cli/test/doctor.test.ts +0 -276
- package/packages/cli/test/e2e.test.ts +0 -1230
- package/packages/cli/test/exchange-events.test.ts +0 -345
- package/packages/cli/test/failure-lines.test.ts +0 -47
- package/packages/cli/test/fixtures/deaf-agent.mjs +0 -11
- package/packages/cli/test/fixtures/embedding-agent.mjs +0 -32
- package/packages/cli/test/fixtures/fake-agent.mjs +0 -114
- package/packages/cli/test/fixtures/fake-model.mjs +0 -105
- package/packages/cli/test/fixtures/gateway-agent.mjs +0 -20
- package/packages/cli/test/fixtures/ide-parent.mjs +0 -34
- package/packages/cli/test/fixtures/mcp-agent.mjs +0 -64
- package/packages/cli/test/fixtures/proxy-call.mjs +0 -105
- package/packages/cli/test/fixtures/responses-agent.mjs +0 -82
- package/packages/cli/test/fixtures/responses-model.mjs +0 -94
- package/packages/cli/test/fixtures/tls-agent.mjs +0 -35
- package/packages/cli/test/fixtures/vercel-agent.mjs +0 -81
- package/packages/cli/test/flag-values.test.ts +0 -162
- package/packages/cli/test/flags.test.ts +0 -313
- package/packages/cli/test/fork-provenance.test.ts +0 -224
- package/packages/cli/test/fork-tls.test.ts +0 -190
- package/packages/cli/test/gateway-e2e.test.ts +0 -110
- package/packages/cli/test/gc.test.ts +0 -531
- package/packages/cli/test/generated-esm.test.ts +0 -87
- package/packages/cli/test/graph-card.test.ts +0 -249
- package/packages/cli/test/graph-command.test.ts +0 -258
- package/packages/cli/test/grok-bot-e2e.test.ts +0 -349
- package/packages/cli/test/inspect.test.ts +0 -412
- package/packages/cli/test/intercept-failures.test.ts +0 -74
- package/packages/cli/test/json-only.test.ts +0 -88
- package/packages/cli/test/json-output.test.ts +0 -221
- package/packages/cli/test/list-gateway.test.ts +0 -770
- package/packages/cli/test/mcp-capture.test.ts +0 -498
- package/packages/cli/test/mcp-server.test.ts +0 -315
- package/packages/cli/test/nested-repo-replay.test.ts +0 -972
- package/packages/cli/test/no-credential-in-attrs.test.ts +0 -255
- package/packages/cli/test/opencode-capture.test.ts +0 -422
- package/packages/cli/test/opencode-catalog-capture.test.ts +0 -175
- package/packages/cli/test/out.test.ts +0 -491
- package/packages/cli/test/pinned-fetch.test.ts +0 -154
- package/packages/cli/test/prompt-scrub.test.ts +0 -132
- package/packages/cli/test/publish-order.test.ts +0 -87
- package/packages/cli/test/quickstart.test.ts +0 -579
- package/packages/cli/test/rasterize.test.ts +0 -86
- package/packages/cli/test/record-detection.test.ts +0 -156
- package/packages/cli/test/record-teardown.test.ts +0 -203
- package/packages/cli/test/replay-putback.test.ts +0 -242
- package/packages/cli/test/replay-spill.test.ts +0 -116
- package/packages/cli/test/replay-teardown.test.ts +0 -143
- package/packages/cli/test/replay-trace.test.ts +0 -199
- package/packages/cli/test/replay-transport.test.ts +0 -113
- package/packages/cli/test/reset-roots.test.ts +0 -67
- package/packages/cli/test/responses-e2e.test.ts +0 -119
- package/packages/cli/test/retrieval-context.test.ts +0 -168
- package/packages/cli/test/review-regressions.test.ts +0 -168
- package/packages/cli/test/route-decision.test.ts +0 -134
- package/packages/cli/test/run-dir-sidecars.test.ts +0 -779
- package/packages/cli/test/scrub.test.ts +0 -936
- package/packages/cli/test/serial.test.ts +0 -65
- package/packages/cli/test/setup.test.ts +0 -535
- package/packages/cli/test/share-card.test.ts +0 -135
- package/packages/cli/test/shell-capture.test.ts +0 -184
- package/packages/cli/test/shell-frames-drain.test.ts +0 -91
- package/packages/cli/test/snapshot-retry.test.ts +0 -54
- package/packages/cli/test/support-claims.test.ts +0 -127
- package/packages/cli/test/sync-credentials.test.ts +0 -177
- package/packages/cli/test/sync.test.ts +0 -1709
- package/packages/cli/test/tls-intercept.test.ts +0 -548
- package/packages/cli/test/upstream-visible.test.ts +0 -314
- package/packages/cli/test/vercel-sdk-e2e.test.ts +0 -105
- package/packages/cli/test/version.test.ts +0 -20
- package/packages/cli/tsconfig.json +0 -40
- package/packages/core/package.json +0 -26
- package/packages/core/src/blobs.ts +0 -109
- package/packages/core/src/fetch.ts +0 -48
- package/packages/core/src/graph.ts +0 -450
- package/packages/core/src/index.ts +0 -8
- package/packages/core/src/paths.ts +0 -180
- package/packages/core/src/private-files.ts +0 -394
- package/packages/core/src/reader.ts +0 -175
- package/packages/core/src/redaction.ts +0 -826
- package/packages/core/src/writer.ts +0 -467
- package/packages/core/test/blobs.test.ts +0 -170
- package/packages/core/test/capture-contract.test.ts +0 -179
- package/packages/core/test/data-uri-redaction.test.ts +0 -758
- package/packages/core/test/graph.test.ts +0 -520
- package/packages/core/test/integration.test.ts +0 -148
- package/packages/core/test/paths-permission-failure.test.ts +0 -53
- package/packages/core/test/paths.test.ts +0 -339
- package/packages/core/test/private-files-owner.test.ts +0 -77
- package/packages/core/test/private-files-scratch-race.test.ts +0 -62
- package/packages/core/test/private-files.test.ts +0 -251
- package/packages/core/test/reader.test.ts +0 -271
- package/packages/core/test/redaction.test.ts +0 -525
- package/packages/core/test/writer.test.ts +0 -531
- package/packages/core/tsconfig.json +0 -6
- package/packages/fs-capture/package.json +0 -25
- package/packages/fs-capture/src/capture.ts +0 -193
- package/packages/fs-capture/src/git.ts +0 -131
- package/packages/fs-capture/src/index.ts +0 -3
- package/packages/fs-capture/src/shadow.ts +0 -751
- package/packages/fs-capture/test/capture.test.ts +0 -241
- package/packages/fs-capture/test/git.test.ts +0 -118
- package/packages/fs-capture/test/helpers.ts +0 -28
- package/packages/fs-capture/test/shadow.test.ts +0 -1058
- package/packages/fs-capture/tsconfig.json +0 -6
- package/packages/mcp-shim/package.json +0 -26
- package/packages/mcp-shim/src/cli.ts +0 -372
- package/packages/mcp-shim/src/framing.ts +0 -106
- package/packages/mcp-shim/src/index.ts +0 -4
- package/packages/mcp-shim/src/mock.ts +0 -194
- package/packages/mcp-shim/src/shim.ts +0 -126
- package/packages/mcp-shim/test/cli.test.ts +0 -489
- package/packages/mcp-shim/test/framing.test.ts +0 -143
- package/packages/mcp-shim/test/mock.test.ts +0 -200
- package/packages/mcp-shim/test/shim.test.ts +0 -287
- package/packages/mcp-shim/tsconfig.json +0 -5
- package/packages/node-instrument/package.json +0 -23
- package/packages/node-instrument/src/capture.ts +0 -505
- package/packages/node-instrument/src/index.ts +0 -3
- package/packages/node-instrument/src/install.ts +0 -186
- package/packages/node-instrument/src/rewrite.ts +0 -66
- package/packages/node-instrument/test/capture.test.ts +0 -423
- package/packages/node-instrument/test/install.test.ts +0 -427
- package/packages/node-instrument/test/rewrite.test.ts +0 -85
- package/packages/node-instrument/tsconfig.json +0 -9
- package/packages/plugin-api/package.json +0 -22
- package/packages/plugin-api/src/canonical.ts +0 -73
- package/packages/plugin-api/src/index.ts +0 -2
- package/packages/plugin-api/src/plugins.ts +0 -265
- package/packages/plugin-api/test/canonical.test.ts +0 -58
- package/packages/plugin-api/tsconfig.json +0 -5
- package/packages/providers/package.json +0 -26
- package/packages/providers/src/index.ts +0 -34
- package/packages/providers/src/pricing.ts +0 -140
- package/packages/providers/src/translate/anthropic.ts +0 -620
- package/packages/providers/src/translate/openai-responses.ts +0 -638
- package/packages/providers/src/translate/openai.ts +0 -630
- package/packages/providers/src/translate/sse.ts +0 -99
- package/packages/providers/src/translate/util.ts +0 -111
- package/packages/providers/test/anthropic-translate.test.ts +0 -687
- package/packages/providers/test/openai-responses-translate.test.ts +0 -377
- package/packages/providers/test/openai-translate.test.ts +0 -884
- package/packages/providers/test/pricing.test.ts +0 -171
- package/packages/providers/tsconfig.json +0 -6
- package/packages/proxy/package.json +0 -28
- package/packages/proxy/src/ca.ts +0 -376
- package/packages/proxy/src/der.ts +0 -152
- package/packages/proxy/src/dialects.ts +0 -413
- package/packages/proxy/src/forward.ts +0 -64
- package/packages/proxy/src/index.ts +0 -8
- package/packages/proxy/src/intercept.ts +0 -1554
- package/packages/proxy/src/matching.ts +0 -1056
- package/packages/proxy/src/retrieval.ts +0 -290
- package/packages/proxy/src/server.ts +0 -2875
- package/packages/proxy/src/tls-hosts.ts +0 -205
- package/packages/proxy/test/beta-headers.test.ts +0 -39
- package/packages/proxy/test/ca.test.ts +0 -146
- package/packages/proxy/test/forward.test.ts +0 -306
- package/packages/proxy/test/hop-by-hop.test.ts +0 -118
- package/packages/proxy/test/image-matching.test.ts +0 -129
- package/packages/proxy/test/indexing-concurrency.test.ts +0 -224
- package/packages/proxy/test/lookahead.test.ts +0 -160
- package/packages/proxy/test/malformed-body.test.ts +0 -73
- package/packages/proxy/test/matching.test.ts +0 -822
- package/packages/proxy/test/passthrough.test.ts +0 -599
- package/packages/proxy/test/recorded-upstream.test.ts +0 -253
- package/packages/proxy/test/responses-dialect.test.ts +0 -239
- package/packages/proxy/test/retrieval.test.ts +0 -589
- package/packages/proxy/test/server.test.ts +0 -1281
- package/packages/proxy/test/tls-hosts.test.ts +0 -190
- package/packages/proxy/test/tls-intercept.test.ts +0 -1769
- package/packages/proxy/tsconfig.json +0 -22
- package/packages/schema/package.json +0 -28
- package/packages/schema/src/constants.ts +0 -73
- package/packages/schema/src/index.ts +0 -3
- package/packages/schema/src/types.ts +0 -103
- package/packages/schema/src/validate.ts +0 -60
- package/packages/schema/test/schema-parity.test.ts +0 -116
- package/packages/schema/tsconfig.json +0 -5
- package/packages/shell-shim/package.json +0 -26
- package/packages/shell-shim/src/index.ts +0 -3
- package/packages/shell-shim/src/install.ts +0 -406
- package/packages/shell-shim/src/resolve.ts +0 -98
- package/packages/shell-shim/src/runner-bin.ts +0 -4
- package/packages/shell-shim/src/runner.ts +0 -149
- package/packages/shell-shim/test/resolve.test.ts +0 -125
- package/packages/shell-shim/test/shim.test.ts +0 -548
- package/packages/shell-shim/test/transport-race.test.ts +0 -109
- package/packages/shell-shim/tsconfig.json +0 -13
- package/packages/viewer/package.json +0 -25
- package/packages/viewer/src/bundle.ts +0 -36
- package/packages/viewer/src/client/main.ts +0 -248
- package/packages/viewer/src/credit.ts +0 -24
- package/packages/viewer/src/css.ts +0 -409
- package/packages/viewer/src/export.ts +0 -38
- package/packages/viewer/src/html.ts +0 -356
- package/packages/viewer/src/index.ts +0 -16
- package/packages/viewer/src/render.ts +0 -791
- package/packages/viewer/src/serve.ts +0 -150
- package/packages/viewer/src/trace-dir.ts +0 -140
- package/packages/viewer/test/bundle.test.ts +0 -47
- package/packages/viewer/test/client.test.ts +0 -378
- package/packages/viewer/test/export.test.ts +0 -131
- package/packages/viewer/test/fixtures.ts +0 -69
- package/packages/viewer/test/html.test.ts +0 -453
- package/packages/viewer/test/playback.test.ts +0 -54
- package/packages/viewer/test/render.test.ts +0 -714
- package/packages/viewer/test/serve.test.ts +0 -125
- package/packages/viewer/tsconfig.json +0 -6
- package/prompt/AIDER/deepseek-v4-1-flash-system-prompt.md +0 -29
- package/prompt/CLAUDECODE/claude-fable-5-1-print-system-prompt.md +0 -127
- package/prompt/CLAUDECODE/claude-fable-5-1-system-prompt.md +0 -169
- package/prompt/CLAUDECODE/claude-opus-4-8-system-prompt.md +0 -131
- package/prompt/CLAUDECODE/claude-opus-5-system-prompt.md +0 -149
- package/prompt/CLINE/openai-gpt-4o-mini-system-prompt.md +0 -37
- package/prompt/CODEX/gpt-5-6-luna-system-prompt.md +0 -183
- package/prompt/CODEX/gpt-5-6-sol-system-prompt.md +0 -218
- package/prompt/CODEX/gpt-6-1-sol-system-prompt.md +0 -242
- package/prompt/CODEX/gpt-6-astra-system-prompt.md +0 -170
- package/prompt/CODEX/gpt-6-luna-system-prompt.md +0 -223
- package/prompt/CODEX/gpt-6-sol-system-prompt.md +0 -226
- package/prompt/CRUSH/deepseek-v4-1-flash-system-prompt.md +0 -472
- package/prompt/CURSOR/grok-4-5-high-system-prompt.md +0 -40
- package/prompt/DSH/deepseek-flash-system-prompt.md +0 -31
- package/prompt/GEMINICLI/gemini-3-5-flash-system-prompt.md +0 -168
- package/prompt/GOOSE/deepseek-v4-1-flash-system-prompt.md +0 -180
- package/prompt/HACKERAI/openai-gpt-4o-mini-system-prompt.md +0 -70
- package/prompt/HERMES/nemotron-3-5-lightning-free-system-prompt.md +0 -111
- package/prompt/KILOCODE/kilo-auto-free-system-prompt.md +0 -129
- package/prompt/MCODE/deepseek-deepseek-v4-flash-free-coding-system-prompt.md +0 -128
- package/prompt/MCODE/deepseek-deepseek-v4-flash-free-tui-system-prompt.md +0 -119
- package/prompt/MCODE/deepseek-deepseek-v4-flash-free-work-system-prompt.md +0 -140
- package/prompt/MIMOCODE/mimo-v2-5-pro-system-prompt.md +0 -411
- package/prompt/MIMOCODE/mimo-v2-5-system-prompt.md +0 -411
- package/prompt/MUSECODE/muse-spark-1-3-system-prompt.md +0 -78
- package/prompt/OPENCLAW/gpt-5-6-sol-system-prompt.md +0 -333
- package/prompt/OPENCODE/big-pickle-system-prompt.md +0 -114
- package/prompt/OPENCODE/gpt-5-6-sol-system-prompt.md +0 -126
- package/prompt/OPENCODE/ling-3-0-flash-fin-free-system-prompt.md +0 -114
- package/prompt/OPENCODE/mimo-v2-5-free-system-prompt.md +0 -114
- package/prompt/OPENCODE/muse-spark-1-2-contributor-free-system-prompt.md +0 -84
- package/prompt/OPENCODE/nemotron-3-5-lightning-free-system-prompt.md +0 -114
- package/prompt/OPENCODE/nemotron-3-ultra-free-system-prompt.md +0 -114
- package/prompt/PI/openai-gpt-4o-mini-system-prompt.md +0 -31
- package/prompt/QWENCODE/gpt-5-6-sol-system-prompt.md +0 -290
- package/prompt/ZCODE/glm-4-6-system-prompt.md +0 -91
- package/python/README.md +0 -132
- package/python/agenticreplay_trace/__init__.py +0 -58
- package/python/agenticreplay_trace/graph.py +0 -137
- package/python/agenticreplay_trace/models.py +0 -491
- package/python/agenticreplay_trace/py.typed +0 -0
- package/python/agenticreplay_trace/reader.py +0 -295
- package/python/conftest.py +0 -12
- package/python/examples/analyze.py +0 -114
- package/python/pyproject.toml +0 -45
- package/python/tests/conftest.py +0 -102
- package/python/tests/test_capture_contract.py +0 -24
- package/python/tests/test_conformance.py +0 -235
- package/python/tests/test_examples.py +0 -60
- package/python/tests/test_graph.py +0 -247
- package/python/tests/test_models.py +0 -342
- package/python/tests/test_reader.py +0 -423
- package/python-langgraph/README.md +0 -159
- package/python-langgraph/agenticreplay_langgraph/__init__.py +0 -21
- package/python-langgraph/agenticreplay_langgraph/handler.py +0 -317
- package/python-langgraph/agenticreplay_langgraph/hook.py +0 -168
- package/python-langgraph/pyproject.toml +0 -35
- package/python-langgraph/tests/test_handler.py +0 -370
- package/python-langgraph/tests/test_integration.py +0 -484
- package/python-openai-agents/README.md +0 -145
- package/python-openai-agents/agenticreplay_openai_agents/__init__.py +0 -11
- package/python-openai-agents/agenticreplay_openai_agents/processor.py +0 -331
- package/python-openai-agents/pyproject.toml +0 -34
- package/python-openai-agents/tests/test_processor.py +0 -457
- package/scripts/check-neutrality.mjs +0 -62
- package/scripts/codex-client-acceptance.mjs +0 -133
- package/scripts/conformance.mjs +0 -245
- package/scripts/fidelity.mjs +0 -170
- package/scripts/hermes-client-acceptance.mjs +0 -158
- package/scripts/host-client-acceptance.mjs +0 -732
- package/scripts/installed-smoke.mjs +0 -316
- package/scripts/publish-order.mjs +0 -96
- package/scripts/regenerate-quickstart.mjs +0 -79
- package/scripts/render-cards.mjs +0 -178
- package/scripts/render-demo.mjs +0 -139
- package/scripts/render-sync-card.mjs +0 -96
- package/scripts/set-version.mjs +0 -152
- package/scripts/set-version.test.ts +0 -220
- package/scripts/sync-server-json.mjs +0 -13
- package/scripts/update-opencode-api-bases.mjs +0 -29
- package/server.json +0 -28
- package/skills/agenticreplay-replay/SKILL.md +0 -211
- package/spec/agenticreplay-trace-v0.md +0 -223
- package/test/integrations/README.md +0 -133
- package/test/integrations/agents/ai_sdk_openai.mjs +0 -24
- package/test/integrations/agents/anthropic_sdk.py +0 -10
- package/test/integrations/agents/browser_use_agent.py +0 -24
- package/test/integrations/agents/crewai_agent.py +0 -44
- package/test/integrations/agents/crewai_model_names.py +0 -72
- package/test/integrations/agents/hardcoded_origin.mjs +0 -13
- package/test/integrations/agents/haystack_pipeline.py +0 -28
- package/test/integrations/agents/haystack_rag.py +0 -35
- package/test/integrations/agents/langgraph_agent.py +0 -54
- package/test/integrations/agents/langgraph_nodes.py +0 -62
- package/test/integrations/agents/litellm_agent.py +0 -11
- package/test/integrations/agents/llama_index_agent.py +0 -27
- package/test/integrations/agents/llama_index_model_names.py +0 -67
- package/test/integrations/agents/mastra_agent.mjs +0 -20
- package/test/integrations/agents/mcp_agent.py +0 -44
- package/test/integrations/agents/mcp_server.py +0 -20
- package/test/integrations/agents/openai_agents_handoff.py +0 -52
- package/test/integrations/agents/openai_agents_sdk.py +0 -29
- package/test/integrations/agents/openai_async.py +0 -17
- package/test/integrations/agents/openai_sdk.py +0 -10
- package/test/integrations/agents/openhands_agent.py +0 -34
- package/test/integrations/agents/rag_pipeline.py +0 -79
- package/test/integrations/agents/vision_agent.py +0 -63
- package/test/integrations/run.mjs +0 -719
- package/test/integrations/stub-origin.mjs +0 -229
- package/tsconfig.base.json +0 -20
- package/tsconfig.json +0 -41
- package/vitest.config.ts +0 -39
- package/vitest.setup.ts +0 -25
- /package/{packages → node_modules/@agenticreplay}/schema/schema/event.schema.json +0 -0
- /package/{packages → node_modules/@agenticreplay}/schema/schema/manifest.schema.json +0 -0
|
@@ -0,0 +1,1258 @@
|
|
|
1
|
+
import { createServer as createHttpServer, } from 'node:http';
|
|
2
|
+
import { connect as http2Connect, createSecureServer as createHttp2SecureServer, constants as H2, } from 'node:http2';
|
|
3
|
+
import { Agent, request as httpsRequest } from 'node:https';
|
|
4
|
+
import { connect as netConnect, isIP } from 'node:net';
|
|
5
|
+
import { createSecureContext, rootCertificates, TLSSocket } from 'node:tls';
|
|
6
|
+
import { randomUUID } from 'node:crypto';
|
|
7
|
+
import * as zlib from 'node:zlib';
|
|
8
|
+
import { AUTH_REQUEST_HEADERS, AUTH_RESPONSE_HEADERS, BINARY_BODY_PREFIX, } from '@agenticreplay/core';
|
|
9
|
+
import { HostPolicy } from './tls-hosts.js';
|
|
10
|
+
/**
|
|
11
|
+
* HTTP CONNECT: tunnel it, or terminate it and look inside.
|
|
12
|
+
*
|
|
13
|
+
* Capture is normally base-URL injection — point an environment variable at a local origin server
|
|
14
|
+
* and the agent's traffic arrives in plaintext. A harness that reads no such variable (a Codex CLI
|
|
15
|
+
* signed in with a ChatGPT subscription is the case that forced this) is invisible to that
|
|
16
|
+
* mechanism, because it talks to its own backend over TLS it established itself.
|
|
17
|
+
*
|
|
18
|
+
* So: a proxy the child is pointed at with `HTTPS_PROXY`, a CA minted for this run alone, and a
|
|
19
|
+
* certificate for exactly the hosts the operator named. Everything else is copied byte for byte
|
|
20
|
+
* between two sockets, which is the difference between a debugger and a wiretap.
|
|
21
|
+
*/
|
|
22
|
+
/** Described by this connection rather than by the message, so never forwarded. */
|
|
23
|
+
const HOP_BY_HOP = new Set([
|
|
24
|
+
'connection',
|
|
25
|
+
'proxy-connection',
|
|
26
|
+
'keep-alive',
|
|
27
|
+
'transfer-encoding',
|
|
28
|
+
'upgrade',
|
|
29
|
+
'te',
|
|
30
|
+
'trailer',
|
|
31
|
+
// Stripped so the origin answers in plaintext. A recorded gzip frame is a recording nobody can
|
|
32
|
+
// read, and the agent is no worse off for receiving the bytes uncompressed.
|
|
33
|
+
'accept-encoding',
|
|
34
|
+
]);
|
|
35
|
+
/**
|
|
36
|
+
* Forwarded upstream, never written down. Same rule the origin-server path already applies: an
|
|
37
|
+
* agent that cannot authenticate cannot run, and spec §7 forbids writing auth material, which is
|
|
38
|
+
* a different requirement from relaying it.
|
|
39
|
+
*/
|
|
40
|
+
const SECRET_REQUEST_HEADERS = new Set(AUTH_REQUEST_HEADERS);
|
|
41
|
+
/** A response can hand out credentials too. `set-cookie` is a session, not metadata. */
|
|
42
|
+
const SECRET_RESPONSE_HEADERS = new Set(AUTH_RESPONSE_HEADERS);
|
|
43
|
+
/**
|
|
44
|
+
* Enough to hold any model exchange; short of enough to hold somebody's video download.
|
|
45
|
+
*
|
|
46
|
+
* Exported because a run that hits it has to be able to say so in the number the operator will
|
|
47
|
+
* measure their conversation against. A warning that says "too large" without saying how large is
|
|
48
|
+
* a warning nobody can act on.
|
|
49
|
+
*/
|
|
50
|
+
export const DEFAULT_MAX_CAPTURED_BYTES = 64 * 1024 * 1024;
|
|
51
|
+
export const DEFAULT_MAX_BUFFERED_BYTES = 256 * 1024 * 1024;
|
|
52
|
+
export function isInterceptResponse(decision) {
|
|
53
|
+
return 'status' in decision;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A rewritten body is uncompressed JSON even when the client sent gzip/zstd. The origin must not
|
|
57
|
+
* be told the old encoding, or it will try to inflate plaintext and the substitution is lost.
|
|
58
|
+
*/
|
|
59
|
+
function applyRewrittenBody(headers, body) {
|
|
60
|
+
delete headers['content-encoding'];
|
|
61
|
+
delete headers['content-length'];
|
|
62
|
+
headers['content-length'] = String(body.length);
|
|
63
|
+
}
|
|
64
|
+
/** Decode a recorded body, whichever of the two forms it was stored in. */
|
|
65
|
+
export function readRecordedBody(body) {
|
|
66
|
+
return body.startsWith(BINARY_BODY_PREFIX)
|
|
67
|
+
? Buffer.from(body.slice(BINARY_BODY_PREFIX.length), 'base64')
|
|
68
|
+
: Buffer.from(body, 'utf8');
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Decode a body for reading while forwarding stays byte-for-byte.
|
|
72
|
+
*
|
|
73
|
+
* Named for the body, not for the half of the exchange: responses arrive compressed too, and a
|
|
74
|
+
* function called `decodeRequestBody` decoding one would be a name that has to be read past.
|
|
75
|
+
*/
|
|
76
|
+
export function decodeBody(bytes, contentEncoding, maxOutputBytes) {
|
|
77
|
+
const encodings = (contentEncoding ?? '')
|
|
78
|
+
.split(',')
|
|
79
|
+
.map((value) => value.trim().toLowerCase())
|
|
80
|
+
.filter((value) => value !== '' && value !== 'identity');
|
|
81
|
+
let decoded = bytes;
|
|
82
|
+
for (const encoding of encodings.reverse()) {
|
|
83
|
+
const limits = maxOutputBytes === undefined ? undefined : { maxOutputLength: maxOutputBytes };
|
|
84
|
+
if (encoding === 'gzip')
|
|
85
|
+
decoded = zlib.gunzipSync(decoded, limits);
|
|
86
|
+
else if (encoding === 'deflate')
|
|
87
|
+
decoded = zlib.inflateSync(decoded, limits);
|
|
88
|
+
else if (encoding === 'br')
|
|
89
|
+
decoded = zlib.brotliDecompressSync(decoded, limits);
|
|
90
|
+
else if (encoding === 'zstd') {
|
|
91
|
+
const decompress = zlib.zstdDecompressSync;
|
|
92
|
+
if (!decompress)
|
|
93
|
+
throw new Error('zstd request encoding requires a Node runtime with zstd support');
|
|
94
|
+
decoded = decompress(decoded, maxOutputBytes === undefined ? undefined : { maxOutputLength: maxOutputBytes });
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
throw new Error(`unsupported content encoding: ${encoding}`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return recordableBody(decoded);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The response body as the client saw it, plus the encoding agenticreplay took off to get there.
|
|
104
|
+
*
|
|
105
|
+
* Not attempted on a capture that is a prefix rather than the whole stream: half a deflate member
|
|
106
|
+
* cannot be inflated, and `truncated` / `abandoned` already say the record is incomplete. Nor on a
|
|
107
|
+
* response that carried no body -- RFC 7232 asks a 304 to send the header fields a 200 would have
|
|
108
|
+
* sent, `content-encoding` among them, and 204 and HEAD arrive the same way; every decoder throws
|
|
109
|
+
* "unexpected end of file" on an empty buffer, which would have reported an opaque body where
|
|
110
|
+
* there was no body at all. Failing to decode a body that *is* there is not fatal either -- the
|
|
111
|
+
* wire bytes are kept and the reason is reported, the same way an undecodable request body is.
|
|
112
|
+
*/
|
|
113
|
+
function recordableResponseBody(captured, contentEncoding, whole) {
|
|
114
|
+
const encoding = contentEncoding
|
|
115
|
+
?.split(',')
|
|
116
|
+
.map((value) => value.trim().toLowerCase())
|
|
117
|
+
.filter((value) => value !== '' && value !== 'identity')
|
|
118
|
+
.join(', ');
|
|
119
|
+
if (encoding === undefined ||
|
|
120
|
+
encoding === '' ||
|
|
121
|
+
encoding === 'identity' ||
|
|
122
|
+
captured.bytes === 0 ||
|
|
123
|
+
!whole) {
|
|
124
|
+
return { body: captured.text() };
|
|
125
|
+
}
|
|
126
|
+
try {
|
|
127
|
+
return {
|
|
128
|
+
body: decodeBody(captured.buffer(), contentEncoding, captured.limit),
|
|
129
|
+
decodedFrom: encoding,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
catch (err) {
|
|
133
|
+
return { body: captured.text(), error: String(err) };
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* The headers that describe the body actually recorded.
|
|
138
|
+
*
|
|
139
|
+
* `content-encoding: gzip` beside a decoded body is a claim the recording no longer supports, and
|
|
140
|
+
* a `content-length` counting compressed bytes is another. Neither fact is lost: the wire size is
|
|
141
|
+
* already on the event as `bytes`, and what agenticreplay removed is recorded as `decoded_from`. Only the
|
|
142
|
+
* recorded copy is touched -- the client is served the origin's own header set, from `outHeaders`
|
|
143
|
+
* on HTTP/1.1 and `downstream` on h2.
|
|
144
|
+
*/
|
|
145
|
+
function normalizeHeaderValue(value) {
|
|
146
|
+
if (typeof value === 'string')
|
|
147
|
+
return value;
|
|
148
|
+
if (Array.isArray(value))
|
|
149
|
+
return value.slice();
|
|
150
|
+
if (typeof value === 'number')
|
|
151
|
+
return String(value);
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
function headerText(value) {
|
|
155
|
+
if (value === undefined)
|
|
156
|
+
return undefined;
|
|
157
|
+
return Array.isArray(value) ? value.join(', ') : value;
|
|
158
|
+
}
|
|
159
|
+
function headersWithoutEncoding(headers) {
|
|
160
|
+
const out = {};
|
|
161
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
162
|
+
if (key === 'content-encoding' || key === 'content-length')
|
|
163
|
+
continue;
|
|
164
|
+
out[key] = value;
|
|
165
|
+
}
|
|
166
|
+
return out;
|
|
167
|
+
}
|
|
168
|
+
/** Text when the bytes are text, base64 behind a marker when they are not. */
|
|
169
|
+
function recordableBody(bytes) {
|
|
170
|
+
const asText = bytes.toString('utf8');
|
|
171
|
+
if (Buffer.compare(Buffer.from(asText, 'utf8'), bytes) === 0)
|
|
172
|
+
return asText;
|
|
173
|
+
return `${BINARY_BODY_PREFIX}${bytes.toString('base64')}`;
|
|
174
|
+
}
|
|
175
|
+
function binaryBodyTransformation(location, body) {
|
|
176
|
+
if (!body.startsWith(BINARY_BODY_PREFIX))
|
|
177
|
+
return [];
|
|
178
|
+
return [
|
|
179
|
+
{
|
|
180
|
+
kind: 'encoding',
|
|
181
|
+
location,
|
|
182
|
+
rule: 'binary-body-base64-persistence',
|
|
183
|
+
count: 1,
|
|
184
|
+
reason: 'invalid UTF-8 preserved as base64 because the transport body is binary',
|
|
185
|
+
},
|
|
186
|
+
];
|
|
187
|
+
}
|
|
188
|
+
function normalizeLimit(value, fallback) {
|
|
189
|
+
return value !== undefined && Number.isSafeInteger(value) && value > 0 ? value : fallback;
|
|
190
|
+
}
|
|
191
|
+
class CaptureBudget {
|
|
192
|
+
limit;
|
|
193
|
+
#used = 0;
|
|
194
|
+
constructor(limit) {
|
|
195
|
+
this.limit = limit;
|
|
196
|
+
}
|
|
197
|
+
reserve(requested) {
|
|
198
|
+
const available = Math.max(0, this.limit - this.#used);
|
|
199
|
+
const reserved = Math.min(requested, available);
|
|
200
|
+
this.#used += reserved;
|
|
201
|
+
return reserved;
|
|
202
|
+
}
|
|
203
|
+
release(bytes) {
|
|
204
|
+
this.#used = Math.max(0, this.#used - bytes);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/** `host:port` from a CONNECT request line, with the default HTTPS port when it is omitted. */
|
|
208
|
+
function parseTarget(authority) {
|
|
209
|
+
const trimmed = authority.trim();
|
|
210
|
+
const colon = trimmed.lastIndexOf(':');
|
|
211
|
+
// A colon inside brackets belongs to an IPv6 literal, not to a port.
|
|
212
|
+
const hasPort = colon > trimmed.lastIndexOf(']');
|
|
213
|
+
const hostText = hasPort ? trimmed.slice(0, colon) : trimmed;
|
|
214
|
+
const host = hostText.replace(/^\[|\]$/g, '');
|
|
215
|
+
if (host.length === 0)
|
|
216
|
+
return undefined;
|
|
217
|
+
if (!hasPort)
|
|
218
|
+
return { host, port: 443 };
|
|
219
|
+
const port = Number(trimmed.slice(colon + 1));
|
|
220
|
+
if (!Number.isInteger(port) || port <= 0 || port > 65535)
|
|
221
|
+
return undefined;
|
|
222
|
+
return { host, port };
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Attach CONNECT handling to an existing origin server.
|
|
226
|
+
*
|
|
227
|
+
* Only ever called when interception was asked for. With no `'connect'` listener Node destroys
|
|
228
|
+
* the socket, which is the right answer for a proxy that was not asked to be one — so "off" is
|
|
229
|
+
* the absence of this function, not a branch inside it.
|
|
230
|
+
*/
|
|
231
|
+
export function attachTlsIntercept(server, options, counters) {
|
|
232
|
+
const policy = HostPolicy.from(options.hosts ?? []);
|
|
233
|
+
const maxCaptured = normalizeLimit(options.maxCapturedBytes, DEFAULT_MAX_CAPTURED_BYTES);
|
|
234
|
+
const budget = new CaptureBudget(normalizeLimit(options.maxBufferedBytes, DEFAULT_MAX_BUFFERED_BYTES));
|
|
235
|
+
const extraRoots = options.trustedOriginCerts ?? [];
|
|
236
|
+
// `ca` replaces the default store rather than adding to it, so an extra root has to be supplied
|
|
237
|
+
// alongside the whole bundle or the proxy would stop trusting the public web.
|
|
238
|
+
const originTrust = extraRoots.length > 0 ? [...rootCertificates, ...extraRoots] : undefined;
|
|
239
|
+
const agent = new Agent({ keepAlive: true, maxSockets: 64 });
|
|
240
|
+
/** One secure context per intercepted host; minting is cheap but not free. */
|
|
241
|
+
const contexts = new Map();
|
|
242
|
+
/**
|
|
243
|
+
* Which origin a decrypted request was destined for, keyed by the socket we created for it.
|
|
244
|
+
*
|
|
245
|
+
* Keyed on `object` rather than `TLSSocket` so a lookup from `req.socket` needs no cast: a
|
|
246
|
+
* socket this map does not know is simply a miss, which is exactly the answer wanted.
|
|
247
|
+
*/
|
|
248
|
+
const targets = new WeakMap();
|
|
249
|
+
/**
|
|
250
|
+
* The same answer as `targets`, reachable from an h2 session.
|
|
251
|
+
*
|
|
252
|
+
* `session.socket` is a Proxy standing in for the real socket, so it is never a key `targets`
|
|
253
|
+
* knows -- the lookup silently missed and every h2 stream was rejected as arriving on an unknown
|
|
254
|
+
* connection. A property on the socket survives the Proxy, which forwards unknown reads through.
|
|
255
|
+
*/
|
|
256
|
+
const TARGET = Symbol('agenticreplay.intercept.target');
|
|
257
|
+
/**
|
|
258
|
+
* Which origin a decrypted request was destined for.
|
|
259
|
+
*
|
|
260
|
+
* Two indirections to get through, both of them somebody else's wrapper. The h2 server hands out
|
|
261
|
+
* a Proxy in place of the socket, which forwards unknown property reads to the real one; and the
|
|
262
|
+
* socket it terminated is a `TLSSocket` wrapping the socket we tagged, reachable as `_parent`.
|
|
263
|
+
*/
|
|
264
|
+
const targetOf = (socket) => {
|
|
265
|
+
let cursor = socket;
|
|
266
|
+
for (let depth = 0; depth < 4 && typeof cursor === 'object' && cursor !== null; depth += 1) {
|
|
267
|
+
const own = cursor[TARGET] ?? targets.get(cursor);
|
|
268
|
+
if (own)
|
|
269
|
+
return own;
|
|
270
|
+
cursor = cursor._parent;
|
|
271
|
+
}
|
|
272
|
+
return undefined;
|
|
273
|
+
};
|
|
274
|
+
const open = new Set();
|
|
275
|
+
/**
|
|
276
|
+
* A protocol switch inside a session we decrypted — a WebSocket, usually.
|
|
277
|
+
*
|
|
278
|
+
* Not relayed: this proxy understands request/response exchanges and nothing else, and a
|
|
279
|
+
* half-implemented WebSocket relay would drop frames rather than fail. Refusing outright and
|
|
280
|
+
* saying so leaves the operator with a message instead of a hang, and the remedy is to take the
|
|
281
|
+
* host off the allowlist so the whole connection is tunnelled untouched instead.
|
|
282
|
+
*/
|
|
283
|
+
const onUpgrade = (req, socket) => {
|
|
284
|
+
const target = targetOf(req.socket);
|
|
285
|
+
options.onFailure?.({
|
|
286
|
+
host: target?.host ?? 'unknown',
|
|
287
|
+
port: target?.port ?? 0,
|
|
288
|
+
reason: `agenticreplay cannot relay an ${String(req.headers.upgrade)} upgrade through an intercepted connection`,
|
|
289
|
+
kind: 'upgrade_refused',
|
|
290
|
+
});
|
|
291
|
+
socket.end('HTTP/1.1 501 Not Implemented\r\nconnection: close\r\n\r\n');
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* One upstream h2 session per origin, reused across streams the way `Agent` is for HTTP/1.1.
|
|
295
|
+
*
|
|
296
|
+
* `ALPNProtocols: ['h2']` on purpose: this session exists only because the client asked for h2,
|
|
297
|
+
* and an origin answering `http/1.1` here would leave us holding a session that cannot carry the
|
|
298
|
+
* request. Failing loudly beats forwarding into a protocol mismatch.
|
|
299
|
+
*/
|
|
300
|
+
const h2Upstreams = new Map();
|
|
301
|
+
function upstreamH2(target) {
|
|
302
|
+
const key = `${target.host}:${target.port}`;
|
|
303
|
+
const existing = h2Upstreams.get(key);
|
|
304
|
+
if (existing && !existing.closed && !existing.destroyed)
|
|
305
|
+
return existing;
|
|
306
|
+
const session = http2Connect(`https://${target.host}:${target.port}`, {
|
|
307
|
+
ALPNProtocols: ['h2'],
|
|
308
|
+
...(originTrust ? { ca: originTrust } : {}),
|
|
309
|
+
});
|
|
310
|
+
session.on('error', (err) => {
|
|
311
|
+
options.onFailure?.({
|
|
312
|
+
host: target.host,
|
|
313
|
+
port: target.port,
|
|
314
|
+
reason: String(err),
|
|
315
|
+
kind: 'upstream_session',
|
|
316
|
+
});
|
|
317
|
+
h2Upstreams.delete(key);
|
|
318
|
+
});
|
|
319
|
+
session.on('close', () => h2Upstreams.delete(key));
|
|
320
|
+
h2Upstreams.set(key, session);
|
|
321
|
+
return session;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* One TLS-terminating server per intercepted host, and the reason it is a server rather than a
|
|
325
|
+
* socket we terminate ourselves.
|
|
326
|
+
*
|
|
327
|
+
* The obvious shape -- `new TLSSocket({ isServer: true })`, then hand the decrypted socket to an
|
|
328
|
+
* HTTP server -- works for HTTP/1.1 and silently does not for h2. An `Http2Session` takes over
|
|
329
|
+
* the socket's handle rather than reading the stream, so the client's connection preface and its
|
|
330
|
+
* first PING, already buffered by the time the handshake callback runs, are never seen: the
|
|
331
|
+
* session establishes, nothing flows, and the client gives up with a keepalive timeout. Verified
|
|
332
|
+
* on a loopback with no agent involved. Letting the h2 server do the TLS itself is what fixes
|
|
333
|
+
* it, and `allowHTTP1` keeps one server able to serve both.
|
|
334
|
+
*
|
|
335
|
+
* Per host rather than one server with `SNICallback`, so the certificate is still chosen by the
|
|
336
|
+
* CONNECT target exactly as before. SNI would work for every client that sends it and quietly
|
|
337
|
+
* pick the wrong certificate for one that does not.
|
|
338
|
+
*/
|
|
339
|
+
const h2Servers = new Map();
|
|
340
|
+
function serverFor(host) {
|
|
341
|
+
const cached = h2Servers.get(host);
|
|
342
|
+
if (cached)
|
|
343
|
+
return cached;
|
|
344
|
+
const issued = options.ca.issue(host);
|
|
345
|
+
const server = createHttp2SecureServer({
|
|
346
|
+
key: issued.keyPem,
|
|
347
|
+
cert: issued.certPem,
|
|
348
|
+
allowHTTP1: true,
|
|
349
|
+
ALPNProtocols: ['h2', 'http/1.1'],
|
|
350
|
+
});
|
|
351
|
+
// An h2 request emits both `stream` and `request` when `allowHTTP1` is set, so `request` has
|
|
352
|
+
// to serve HTTP/1.1 only or the same exchange is answered twice and the second attempt throws
|
|
353
|
+
// ERR_HTTP2_HEADERS_SENT.
|
|
354
|
+
server.on('request', (req, res) => {
|
|
355
|
+
// The event is typed for h2 because the server can serve it, but `allowHTTP1` means an
|
|
356
|
+
// HTTP/1.1 session delivers the node:http pair instead. The version check above is what
|
|
357
|
+
// makes the cast true rather than hopeful.
|
|
358
|
+
if (req.httpVersionMajor >= 2)
|
|
359
|
+
return;
|
|
360
|
+
const req1 = req;
|
|
361
|
+
const res1 = res;
|
|
362
|
+
void forward(req1, res1).catch((err) => {
|
|
363
|
+
if (!res.headersSent)
|
|
364
|
+
res.writeHead(502, { 'content-type': 'application/json' });
|
|
365
|
+
res.end(JSON.stringify({ error: { message: `agenticreplay tls-intercept: ${String(err)}` } }));
|
|
366
|
+
});
|
|
367
|
+
});
|
|
368
|
+
server.on('stream', (stream, headers) => {
|
|
369
|
+
void forwardH2(stream, headers).catch((err) => {
|
|
370
|
+
// Reported as well as answered, because the guard below returns without writing anything
|
|
371
|
+
// when the client has already gone -- and a failure nobody is left to receive is exactly
|
|
372
|
+
// the one worth having in the run's failure list.
|
|
373
|
+
reportH2(stream.session?.socket, err, 'forward');
|
|
374
|
+
// Guarded for the same reason as the response path: by the time a failure surfaces the
|
|
375
|
+
// client may be gone, and respond/end would then throw out of a rejection handler.
|
|
376
|
+
if (stream.destroyed)
|
|
377
|
+
return;
|
|
378
|
+
try {
|
|
379
|
+
if (!stream.headersSent)
|
|
380
|
+
stream.respond({ ':status': 502 });
|
|
381
|
+
stream.end(JSON.stringify({
|
|
382
|
+
error: { message: `agenticreplay tls-intercept h2: ${String(err)}` },
|
|
383
|
+
}));
|
|
384
|
+
}
|
|
385
|
+
catch {
|
|
386
|
+
stream.destroy();
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
});
|
|
390
|
+
server.on('upgrade', onUpgrade);
|
|
391
|
+
// The one that was worth telling apart: the client refused OUR certificate.
|
|
392
|
+
server.on('tlsClientError', (err, socket) => reportH2(socket, err, 'handshake', 'client_handshake'));
|
|
393
|
+
server.on('sessionError', (err, session) => reportH2(session?.socket, err));
|
|
394
|
+
server.on('clientError', (err, socket) => reportH2(socket, err));
|
|
395
|
+
server.on('error', (err) => reportH2(undefined, err));
|
|
396
|
+
server.on('session', (session) => {
|
|
397
|
+
session.on('error', (err) => reportH2(session.socket, err));
|
|
398
|
+
});
|
|
399
|
+
h2Servers.set(host, server);
|
|
400
|
+
return server;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Errors inside an h2 session, reported rather than swallowed.
|
|
404
|
+
*
|
|
405
|
+
* Without these the only symptom of a session that never became usable was the *client*
|
|
406
|
+
* complaining -- "HTTP/2 keepalive ping timed out" -- with nothing on this side saying why, which
|
|
407
|
+
* is the same blindness the HTTP/1.1 path avoids by reporting handshake failures.
|
|
408
|
+
*/
|
|
409
|
+
const reportH2 = (socket, reason, what = 'session', kind = 'session') => {
|
|
410
|
+
const target = targetOf(socket);
|
|
411
|
+
options.onFailure?.({
|
|
412
|
+
host: target?.host ?? 'unknown',
|
|
413
|
+
port: target?.port ?? 0,
|
|
414
|
+
reason: `h2 ${what}: ${String(reason)}`,
|
|
415
|
+
kind,
|
|
416
|
+
});
|
|
417
|
+
};
|
|
418
|
+
/**
|
|
419
|
+
* The h2 twin of `forward`, recording the same exchange.
|
|
420
|
+
*
|
|
421
|
+
* Two differences from HTTP/1.1, both protocol rules rather than choices: the method, path and
|
|
422
|
+
* authority arrive as `:`-prefixed pseudo-headers and have to be rebuilt rather than copied, and
|
|
423
|
+
* h2 forbids the hop-by-hop headers outright, so passing one through is an error rather than
|
|
424
|
+
* merely being wrong.
|
|
425
|
+
*/
|
|
426
|
+
async function forwardH2(stream, headers) {
|
|
427
|
+
// `session` is optional on the type because a stream outlives a destroyed session; a stream
|
|
428
|
+
// being served cannot have lost it, but the lookup needs a socket either way.
|
|
429
|
+
const target = stream.session ? targetOf(stream.session.socket) : undefined;
|
|
430
|
+
if (!target)
|
|
431
|
+
throw new Error('decrypted h2 stream arrived on an unknown connection');
|
|
432
|
+
const startedAt = Date.now();
|
|
433
|
+
const requestId = randomUUID();
|
|
434
|
+
const method = String(headers[H2.HTTP2_HEADER_METHOD] ?? 'GET');
|
|
435
|
+
const path = String(headers[H2.HTTP2_HEADER_PATH] ?? '/');
|
|
436
|
+
const outbound = {
|
|
437
|
+
[H2.HTTP2_HEADER_METHOD]: method,
|
|
438
|
+
[H2.HTTP2_HEADER_PATH]: path,
|
|
439
|
+
[H2.HTTP2_HEADER_SCHEME]: 'https',
|
|
440
|
+
[H2.HTTP2_HEADER_AUTHORITY]: String(headers[H2.HTTP2_HEADER_AUTHORITY] ?? `${target.host}:${target.port}`),
|
|
441
|
+
};
|
|
442
|
+
const recordableHeaders = {};
|
|
443
|
+
for (const [name, value] of Object.entries(headers)) {
|
|
444
|
+
const key = name.toLowerCase();
|
|
445
|
+
if (key.startsWith(':') || HOP_BY_HOP.has(key) || value === undefined)
|
|
446
|
+
continue;
|
|
447
|
+
outbound[key] = value;
|
|
448
|
+
const recorded = normalizeHeaderValue(value);
|
|
449
|
+
if (!SECRET_REQUEST_HEADERS.has(key) && recorded !== undefined) {
|
|
450
|
+
recordableHeaders[key] = recorded;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
const requestBody = new Capture(maxCaptured, budget);
|
|
454
|
+
const responseBody = new Capture(maxCaptured, budget);
|
|
455
|
+
const contentEncoding = headerText(normalizeHeaderValue(headers['content-encoding']));
|
|
456
|
+
let rewrittenBody;
|
|
457
|
+
const requestStart = {
|
|
458
|
+
requestId,
|
|
459
|
+
requestStartedAt: startedAt,
|
|
460
|
+
host: target.host,
|
|
461
|
+
port: target.port,
|
|
462
|
+
method,
|
|
463
|
+
path,
|
|
464
|
+
requestHeaders: recordableHeaders,
|
|
465
|
+
requestBytes: Buffer.alloc(0),
|
|
466
|
+
requestTruncated: false,
|
|
467
|
+
};
|
|
468
|
+
try {
|
|
469
|
+
await options.onRequestStart?.(requestStart);
|
|
470
|
+
}
|
|
471
|
+
catch (err) {
|
|
472
|
+
// A recorder failure happens before dispatch. Preserve that fact as an incomplete terminal
|
|
473
|
+
// attempt so a failed append cannot look like a missing request or a successful capture.
|
|
474
|
+
try {
|
|
475
|
+
options.onNetExchange?.({
|
|
476
|
+
...requestStart,
|
|
477
|
+
requestBody: '',
|
|
478
|
+
requestBytes: 0,
|
|
479
|
+
status: 0,
|
|
480
|
+
responseHeaders: {},
|
|
481
|
+
responseBody: '',
|
|
482
|
+
responseTruncated: false,
|
|
483
|
+
responseComplete: false,
|
|
484
|
+
responseError: `request-start recorder failed: ${String(err)}`,
|
|
485
|
+
responseBytes: 0,
|
|
486
|
+
durationMs: Date.now() - startedAt,
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
catch {
|
|
490
|
+
// The persistence callback failed too; the original failure remains the one surfaced.
|
|
491
|
+
}
|
|
492
|
+
throw err;
|
|
493
|
+
}
|
|
494
|
+
// Replay answers from the recording and must never reach the origin. The HTTP/1.1 twin has
|
|
495
|
+
// consulted this hook since interception existed; without the same call here, a run recorded
|
|
496
|
+
// over HTTP/1.1 and replayed by a client that now negotiates h2 would be forwarded live --
|
|
497
|
+
// real model calls, on the caller's own credential, during what the operator ran offline.
|
|
498
|
+
if (options.onRequest) {
|
|
499
|
+
try {
|
|
500
|
+
for await (const chunk of stream)
|
|
501
|
+
requestBody.add(Buffer.from(chunk));
|
|
502
|
+
}
|
|
503
|
+
catch (err) {
|
|
504
|
+
requestBody.release();
|
|
505
|
+
responseBody.release();
|
|
506
|
+
throw err;
|
|
507
|
+
}
|
|
508
|
+
const request = {
|
|
509
|
+
requestId,
|
|
510
|
+
requestStartedAt: startedAt,
|
|
511
|
+
host: target.host,
|
|
512
|
+
port: target.port,
|
|
513
|
+
method,
|
|
514
|
+
path,
|
|
515
|
+
requestHeaders: recordableHeaders,
|
|
516
|
+
requestBytes: requestBody.buffer(),
|
|
517
|
+
requestTruncated: requestBody.truncated,
|
|
518
|
+
};
|
|
519
|
+
const decision = await options.onRequest(request);
|
|
520
|
+
if (decision && isInterceptResponse(decision)) {
|
|
521
|
+
requestBody.release();
|
|
522
|
+
if (stream.destroyed)
|
|
523
|
+
return;
|
|
524
|
+
stream.respond({ ':status': decision.status, ...(decision.headers ?? {}) });
|
|
525
|
+
stream.end(decision.body);
|
|
526
|
+
counters.intercepted += 1;
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
if (decision) {
|
|
530
|
+
rewrittenBody = decision.outboundBody;
|
|
531
|
+
applyRewrittenBody(outbound, rewrittenBody);
|
|
532
|
+
}
|
|
533
|
+
// The bounded capture size is also the maximum replayable request size: forwarding a
|
|
534
|
+
// truncated body upstream is worse than refusing clearly, which is what HTTP/1.1 does.
|
|
535
|
+
if (requestBody.truncated) {
|
|
536
|
+
requestBody.release();
|
|
537
|
+
throw new Error(`request exceeded capture limit of ${maxCaptured} bytes`);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
await new Promise((resolve, reject) => {
|
|
541
|
+
const upstream = upstreamH2(target).request(outbound);
|
|
542
|
+
let settled = false;
|
|
543
|
+
const finish = () => {
|
|
544
|
+
if (settled)
|
|
545
|
+
return;
|
|
546
|
+
settled = true;
|
|
547
|
+
resolve();
|
|
548
|
+
};
|
|
549
|
+
/**
|
|
550
|
+
* Response state, hoisted so an abandoned exchange is still recorded.
|
|
551
|
+
*
|
|
552
|
+
* Same gap the HTTP/1.1 path had: recording happened only in `upstream.on('end')`, so a
|
|
553
|
+
* client that stopped reading a streaming reply mid-flight left no trace of a request agenticreplay
|
|
554
|
+
* had already decrypted. `status` stays 0 until the origin answers, which is what tells
|
|
555
|
+
* `onDecrypted` this one has no response to replay.
|
|
556
|
+
*/
|
|
557
|
+
let status = 0;
|
|
558
|
+
let recorded = false;
|
|
559
|
+
let responseError;
|
|
560
|
+
const recordableResponse = {};
|
|
561
|
+
const emit = (abandoned) => {
|
|
562
|
+
if (recorded)
|
|
563
|
+
return;
|
|
564
|
+
recorded = true;
|
|
565
|
+
counters.intercepted += 1;
|
|
566
|
+
// A body agenticreplay cannot decode is still an exchange worth having. `decodeBody` throws
|
|
567
|
+
// for zstd on a runtime without it -- inside `engines`, and why the repo's own zstd test is
|
|
568
|
+
// skipped there -- and an exception in this callback would take the process down with the
|
|
569
|
+
// exchange unrecorded. server.ts already decodes inside a try/catch for the same reason.
|
|
570
|
+
let recordedRequest;
|
|
571
|
+
if (rewrittenBody) {
|
|
572
|
+
recordedRequest = recordableBody(rewrittenBody);
|
|
573
|
+
}
|
|
574
|
+
else {
|
|
575
|
+
try {
|
|
576
|
+
recordedRequest = decodeBody(requestBody.buffer(), contentEncoding, requestBody.limit);
|
|
577
|
+
}
|
|
578
|
+
catch (err) {
|
|
579
|
+
options.onFailure?.({
|
|
580
|
+
host: target.host,
|
|
581
|
+
port: target.port,
|
|
582
|
+
reason: `request body left opaque: ${String(err)}`,
|
|
583
|
+
kind: 'body_opaque',
|
|
584
|
+
});
|
|
585
|
+
recordedRequest = requestBody.text();
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
const decoded = recordableResponseBody(responseBody, headerText(recordableResponse['content-encoding']), !abandoned);
|
|
589
|
+
if (decoded.error !== undefined) {
|
|
590
|
+
options.onFailure?.({
|
|
591
|
+
host: target.host,
|
|
592
|
+
port: target.port,
|
|
593
|
+
reason: `response body left opaque: ${decoded.error}`,
|
|
594
|
+
kind: 'body_opaque',
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
const transformations = [];
|
|
598
|
+
if (decoded.decodedFrom !== undefined) {
|
|
599
|
+
transformations.push({
|
|
600
|
+
kind: 'decompression',
|
|
601
|
+
location: 'response.body',
|
|
602
|
+
rule: 'content-encoding',
|
|
603
|
+
count: decoded.decodedFrom.split(',').length,
|
|
604
|
+
reason: decoded.decodedFrom,
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
if (contentEncoding !== undefined) {
|
|
608
|
+
transformations.push({
|
|
609
|
+
kind: 'decompression',
|
|
610
|
+
location: 'request.body',
|
|
611
|
+
rule: 'content-encoding',
|
|
612
|
+
count: contentEncoding.split(',').length,
|
|
613
|
+
reason: contentEncoding,
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
transformations.push(...binaryBodyTransformation('request.body', recordedRequest));
|
|
617
|
+
transformations.push(...binaryBodyTransformation('response.body', decoded.body));
|
|
618
|
+
try {
|
|
619
|
+
options.onNetExchange?.({
|
|
620
|
+
requestId,
|
|
621
|
+
requestStartedAt: startedAt,
|
|
622
|
+
host: target.host,
|
|
623
|
+
port: target.port,
|
|
624
|
+
method,
|
|
625
|
+
path,
|
|
626
|
+
requestHeaders: recordableHeaders,
|
|
627
|
+
requestBody: recordedRequest,
|
|
628
|
+
requestBytes: requestBody.bytes,
|
|
629
|
+
requestTruncated: requestBody.truncated,
|
|
630
|
+
status,
|
|
631
|
+
alpn: 'h2',
|
|
632
|
+
responseHeaders: decoded.decodedFrom === undefined
|
|
633
|
+
? recordableResponse
|
|
634
|
+
: headersWithoutEncoding(recordableResponse),
|
|
635
|
+
responseBody: decoded.body,
|
|
636
|
+
...(decoded.decodedFrom === undefined
|
|
637
|
+
? {}
|
|
638
|
+
: { responseDecodedFrom: decoded.decodedFrom }),
|
|
639
|
+
responseTruncated: responseBody.truncated,
|
|
640
|
+
responseComplete: !abandoned && responseError === undefined && !responseBody.truncated,
|
|
641
|
+
...(responseError === undefined ? {} : { responseError }),
|
|
642
|
+
...(transformations.length === 0 ? {} : { transformations }),
|
|
643
|
+
responseBytes: responseBody.bytes,
|
|
644
|
+
abandoned,
|
|
645
|
+
durationMs: Date.now() - startedAt,
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
finally {
|
|
649
|
+
requestBody.release();
|
|
650
|
+
responseBody.release();
|
|
651
|
+
}
|
|
652
|
+
};
|
|
653
|
+
/**
|
|
654
|
+
* The client can go at any point, and every write after that throws.
|
|
655
|
+
*
|
|
656
|
+
* `stream.respond` on a destroyed stream raises ERR_HTTP2_INVALID_STREAM synchronously from
|
|
657
|
+
* inside an upstream event callback, where nothing catches it: the promise is already
|
|
658
|
+
* constructed, so the throw is an uncaught exception and the proxy exits. Reproduced against
|
|
659
|
+
* Node 22 with a client RST at 60 ms and an origin answering at 400 ms.
|
|
660
|
+
*/
|
|
661
|
+
const abandon = () => {
|
|
662
|
+
emit(true);
|
|
663
|
+
upstream.destroy();
|
|
664
|
+
finish();
|
|
665
|
+
};
|
|
666
|
+
stream.on('aborted', abandon);
|
|
667
|
+
stream.on('close', abandon);
|
|
668
|
+
if (options.onRequest) {
|
|
669
|
+
// The hook above consumed the body, so replay the bytes it read rather than the stream.
|
|
670
|
+
upstream.end(rewrittenBody ?? requestBody.buffer());
|
|
671
|
+
}
|
|
672
|
+
else {
|
|
673
|
+
stream.on('data', (chunk) => {
|
|
674
|
+
requestBody.add(chunk);
|
|
675
|
+
if (!upstream.write(chunk)) {
|
|
676
|
+
stream.pause();
|
|
677
|
+
upstream.once('drain', () => stream.resume());
|
|
678
|
+
}
|
|
679
|
+
});
|
|
680
|
+
// Without this, a client that aborts mid-upload never emits `end`, `upstream.end()` is
|
|
681
|
+
// never called, and the origin waits for a body that will not arrive.
|
|
682
|
+
stream.on('end', () => upstream.end());
|
|
683
|
+
}
|
|
684
|
+
stream.on('error', (err) => {
|
|
685
|
+
responseError = String(err);
|
|
686
|
+
emit(false);
|
|
687
|
+
reject(err);
|
|
688
|
+
});
|
|
689
|
+
upstream.on('error', (err) => {
|
|
690
|
+
responseError = String(err);
|
|
691
|
+
emit(false);
|
|
692
|
+
reject(err);
|
|
693
|
+
});
|
|
694
|
+
upstream.on('response', (responseHeaders) => {
|
|
695
|
+
status = Number(responseHeaders[H2.HTTP2_HEADER_STATUS] ?? 0);
|
|
696
|
+
const downstream = { ':status': status };
|
|
697
|
+
for (const [name, value] of Object.entries(responseHeaders)) {
|
|
698
|
+
const key = name.toLowerCase();
|
|
699
|
+
if (key.startsWith(':') || HOP_BY_HOP.has(key) || value === undefined)
|
|
700
|
+
continue;
|
|
701
|
+
downstream[key] = value;
|
|
702
|
+
const recorded = normalizeHeaderValue(value);
|
|
703
|
+
if (!SECRET_RESPONSE_HEADERS.has(key) && recorded !== undefined) {
|
|
704
|
+
recordableResponse[key] = recorded;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
if (stream.destroyed) {
|
|
708
|
+
abandon();
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
stream.respond(downstream);
|
|
712
|
+
// Tee, never buffer, for the same reason as HTTP/1.1: a model reply arrives over seconds
|
|
713
|
+
// and the agent renders it as it lands.
|
|
714
|
+
upstream.on('data', (chunk) => {
|
|
715
|
+
responseBody.add(chunk);
|
|
716
|
+
if (stream.destroyed) {
|
|
717
|
+
abandon();
|
|
718
|
+
return;
|
|
719
|
+
}
|
|
720
|
+
if (!stream.write(chunk)) {
|
|
721
|
+
// `drain` never fires on a destroyed stream, so a client that goes mid-response would
|
|
722
|
+
// otherwise leave upstream paused for good and the exchange never recorded.
|
|
723
|
+
upstream.pause();
|
|
724
|
+
stream.once('drain', () => upstream.resume());
|
|
725
|
+
}
|
|
726
|
+
});
|
|
727
|
+
upstream.on('end', () => {
|
|
728
|
+
if (settled)
|
|
729
|
+
return;
|
|
730
|
+
// Recorded before the stream is closed out, so the `close` listener above cannot win the
|
|
731
|
+
// race and file the same exchange as abandoned.
|
|
732
|
+
emit(false);
|
|
733
|
+
if (!stream.destroyed)
|
|
734
|
+
stream.end();
|
|
735
|
+
finish();
|
|
736
|
+
});
|
|
737
|
+
});
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
/** The negotiated protocol, looked up through the TLS wrapper the server put in place. */
|
|
741
|
+
const alpnOf = (socket) => {
|
|
742
|
+
let cursor = socket;
|
|
743
|
+
for (let depth = 0; depth < 4 && typeof cursor === 'object' && cursor !== null; depth += 1) {
|
|
744
|
+
const value = cursor.alpnProtocol;
|
|
745
|
+
if (typeof value === 'string')
|
|
746
|
+
return value;
|
|
747
|
+
cursor = cursor._parent;
|
|
748
|
+
}
|
|
749
|
+
return undefined;
|
|
750
|
+
};
|
|
751
|
+
function contextFor(host) {
|
|
752
|
+
const cached = contexts.get(host);
|
|
753
|
+
if (cached)
|
|
754
|
+
return cached;
|
|
755
|
+
const issued = options.ca.issue(host);
|
|
756
|
+
const context = createSecureContext({ key: issued.keyPem, cert: issued.certPem });
|
|
757
|
+
contexts.set(host, context);
|
|
758
|
+
return context;
|
|
759
|
+
}
|
|
760
|
+
async function forward(req, res) {
|
|
761
|
+
const target = targetOf(req.socket);
|
|
762
|
+
if (!target)
|
|
763
|
+
throw new Error('decrypted request arrived on an unknown connection');
|
|
764
|
+
const startedAt = Date.now();
|
|
765
|
+
const requestId = randomUUID();
|
|
766
|
+
const path = req.url ?? '/';
|
|
767
|
+
const outboundHeaders = {};
|
|
768
|
+
const recordableHeaders = {};
|
|
769
|
+
for (const [name, value] of Object.entries(req.headers)) {
|
|
770
|
+
const key = name.toLowerCase();
|
|
771
|
+
if (HOP_BY_HOP.has(key) || value === undefined)
|
|
772
|
+
continue;
|
|
773
|
+
outboundHeaders[name] = value;
|
|
774
|
+
const recorded = normalizeHeaderValue(value);
|
|
775
|
+
if (!SECRET_REQUEST_HEADERS.has(key) && recorded !== undefined) {
|
|
776
|
+
recordableHeaders[key] = recorded;
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
// Node lower-cases every incoming header name, so this replaces the client's own `host`
|
|
780
|
+
// rather than adding a second one. Forwarded as the client wrote it, because virtual hosting
|
|
781
|
+
// depends on it; the CONNECT target is the fallback for an HTTP/1.0 client that sent none.
|
|
782
|
+
outboundHeaders.host = req.headers.host ?? target.host;
|
|
783
|
+
const requestBody = new Capture(maxCaptured, budget);
|
|
784
|
+
let rewrittenBody;
|
|
785
|
+
const requestStart = {
|
|
786
|
+
requestId,
|
|
787
|
+
requestStartedAt: startedAt,
|
|
788
|
+
host: target.host,
|
|
789
|
+
port: target.port,
|
|
790
|
+
method: req.method ?? 'GET',
|
|
791
|
+
path,
|
|
792
|
+
requestHeaders: recordableHeaders,
|
|
793
|
+
requestBytes: Buffer.alloc(0),
|
|
794
|
+
requestTruncated: false,
|
|
795
|
+
};
|
|
796
|
+
try {
|
|
797
|
+
await options.onRequestStart?.(requestStart);
|
|
798
|
+
}
|
|
799
|
+
catch (err) {
|
|
800
|
+
try {
|
|
801
|
+
options.onNetExchange?.({
|
|
802
|
+
...requestStart,
|
|
803
|
+
requestBody: '',
|
|
804
|
+
requestBytes: 0,
|
|
805
|
+
status: 0,
|
|
806
|
+
responseHeaders: {},
|
|
807
|
+
responseBody: '',
|
|
808
|
+
responseTruncated: false,
|
|
809
|
+
responseComplete: false,
|
|
810
|
+
responseError: `request-start recorder failed: ${String(err)}`,
|
|
811
|
+
responseBytes: 0,
|
|
812
|
+
durationMs: Date.now() - startedAt,
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
catch {
|
|
816
|
+
// Preserve the recorder failure when terminal evidence cannot itself be persisted.
|
|
817
|
+
}
|
|
818
|
+
throw err;
|
|
819
|
+
}
|
|
820
|
+
// Replay has to decide before opening an origin connection. Buffer only when that hook is in
|
|
821
|
+
// use; the recording path below retains the original streaming behaviour and bounded capture.
|
|
822
|
+
if (options.onRequest) {
|
|
823
|
+
try {
|
|
824
|
+
for await (const chunk of req)
|
|
825
|
+
requestBody.add(Buffer.from(chunk));
|
|
826
|
+
}
|
|
827
|
+
catch (err) {
|
|
828
|
+
requestBody.release();
|
|
829
|
+
throw err;
|
|
830
|
+
}
|
|
831
|
+
const request = {
|
|
832
|
+
requestId,
|
|
833
|
+
requestStartedAt: startedAt,
|
|
834
|
+
host: target.host,
|
|
835
|
+
port: target.port,
|
|
836
|
+
method: req.method ?? 'GET',
|
|
837
|
+
path,
|
|
838
|
+
requestHeaders: recordableHeaders,
|
|
839
|
+
requestBytes: requestBody.buffer(),
|
|
840
|
+
requestTruncated: requestBody.truncated,
|
|
841
|
+
};
|
|
842
|
+
const decision = await options.onRequest(request);
|
|
843
|
+
if (decision && isInterceptResponse(decision)) {
|
|
844
|
+
res.writeHead(decision.status, decision.headers ?? {});
|
|
845
|
+
res.end(decision.body);
|
|
846
|
+
counters.intercepted += 1;
|
|
847
|
+
requestBody.release();
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
850
|
+
if (decision) {
|
|
851
|
+
rewrittenBody = decision.outboundBody;
|
|
852
|
+
applyRewrittenBody(outboundHeaders, rewrittenBody);
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
const upstream = httpsRequest({
|
|
856
|
+
host: target.host,
|
|
857
|
+
port: target.port,
|
|
858
|
+
method: req.method ?? 'GET',
|
|
859
|
+
path,
|
|
860
|
+
headers: outboundHeaders,
|
|
861
|
+
agent,
|
|
862
|
+
// SNI is a name, never an address.
|
|
863
|
+
...(isIP(target.host) === 0 ? { servername: target.host } : {}),
|
|
864
|
+
...(originTrust ? { ca: originTrust } : {}),
|
|
865
|
+
});
|
|
866
|
+
if (options.onRequest) {
|
|
867
|
+
// The hook consumed the request. The bounded size is deliberately also the maximum replay
|
|
868
|
+
// request size; sending a truncated body upstream would be worse than a clear failure.
|
|
869
|
+
if (requestBody.truncated) {
|
|
870
|
+
upstream.destroy(new Error(`request exceeded capture limit of ${maxCaptured} bytes`));
|
|
871
|
+
}
|
|
872
|
+
else {
|
|
873
|
+
upstream.end(rewrittenBody ?? requestBody.buffer());
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
else {
|
|
877
|
+
req.on('data', (chunk) => requestBody.add(chunk));
|
|
878
|
+
req.pipe(upstream);
|
|
879
|
+
}
|
|
880
|
+
const finished = new Promise((resolve, reject) => {
|
|
881
|
+
/**
|
|
882
|
+
* What has been read so far, hoisted out of the response handler so that an exchange the
|
|
883
|
+
* client walks away from is still recorded.
|
|
884
|
+
*
|
|
885
|
+
* Streaming is the normal case for a model API, and a harness that stops reading the moment
|
|
886
|
+
* it has what it needs leaves the rest of the stream on the floor. `onNetExchange` used to
|
|
887
|
+
* fire only from `end`, so those runs recorded nothing at all: the request had been
|
|
888
|
+
* decrypted and the response headers were in hand, and the run still reported
|
|
889
|
+
* `capture.empty` with "the agent never called the proxy" -- the opposite of what happened.
|
|
890
|
+
* Hermes is the harness that showed it; the shape is not specific to Hermes.
|
|
891
|
+
*/
|
|
892
|
+
let recorded = false;
|
|
893
|
+
let status = 0;
|
|
894
|
+
let responseError;
|
|
895
|
+
const responseHeaders = {};
|
|
896
|
+
const responseBody = new Capture(maxCaptured, budget);
|
|
897
|
+
const emit = (abandoned) => {
|
|
898
|
+
if (recorded)
|
|
899
|
+
return;
|
|
900
|
+
recorded = true;
|
|
901
|
+
counters.intercepted += 1;
|
|
902
|
+
// A body agenticreplay cannot decode is still an exchange worth having, and an exception thrown in
|
|
903
|
+
// this callback would take the process down with it. Same guard, same reason, as h2.
|
|
904
|
+
let recordedRequest;
|
|
905
|
+
if (rewrittenBody) {
|
|
906
|
+
recordedRequest = recordableBody(rewrittenBody);
|
|
907
|
+
}
|
|
908
|
+
else {
|
|
909
|
+
try {
|
|
910
|
+
recordedRequest = decodeBody(requestBody.buffer(), typeof req.headers['content-encoding'] === 'string'
|
|
911
|
+
? req.headers['content-encoding']
|
|
912
|
+
: undefined, requestBody.limit);
|
|
913
|
+
}
|
|
914
|
+
catch (err) {
|
|
915
|
+
options.onFailure?.({
|
|
916
|
+
host: target.host,
|
|
917
|
+
port: target.port,
|
|
918
|
+
reason: `request body left opaque: ${String(err)}`,
|
|
919
|
+
kind: 'body_opaque',
|
|
920
|
+
});
|
|
921
|
+
recordedRequest = requestBody.text();
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
const decoded = recordableResponseBody(responseBody, headerText(responseHeaders['content-encoding']), !abandoned);
|
|
925
|
+
if (decoded.error !== undefined) {
|
|
926
|
+
options.onFailure?.({
|
|
927
|
+
host: target.host,
|
|
928
|
+
port: target.port,
|
|
929
|
+
reason: `response body left opaque: ${decoded.error}`,
|
|
930
|
+
kind: 'body_opaque',
|
|
931
|
+
});
|
|
932
|
+
}
|
|
933
|
+
const transformations = [];
|
|
934
|
+
const requestEncoding = typeof req.headers['content-encoding'] === 'string'
|
|
935
|
+
? req.headers['content-encoding']
|
|
936
|
+
: undefined;
|
|
937
|
+
if (decoded.decodedFrom !== undefined) {
|
|
938
|
+
transformations.push({
|
|
939
|
+
kind: 'decompression',
|
|
940
|
+
location: 'response.body',
|
|
941
|
+
rule: 'content-encoding',
|
|
942
|
+
count: decoded.decodedFrom.split(',').length,
|
|
943
|
+
reason: decoded.decodedFrom,
|
|
944
|
+
});
|
|
945
|
+
}
|
|
946
|
+
if (requestEncoding !== undefined) {
|
|
947
|
+
transformations.push({
|
|
948
|
+
kind: 'decompression',
|
|
949
|
+
location: 'request.body',
|
|
950
|
+
rule: 'content-encoding',
|
|
951
|
+
count: requestEncoding.split(',').length,
|
|
952
|
+
reason: requestEncoding,
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
transformations.push(...binaryBodyTransformation('request.body', recordedRequest));
|
|
956
|
+
transformations.push(...binaryBodyTransformation('response.body', decoded.body));
|
|
957
|
+
try {
|
|
958
|
+
options.onNetExchange?.({
|
|
959
|
+
requestId,
|
|
960
|
+
requestStartedAt: startedAt,
|
|
961
|
+
host: target.host,
|
|
962
|
+
port: target.port,
|
|
963
|
+
method: req.method ?? 'GET',
|
|
964
|
+
path,
|
|
965
|
+
requestHeaders: recordableHeaders,
|
|
966
|
+
requestBody: recordedRequest,
|
|
967
|
+
requestBytes: requestBody.bytes,
|
|
968
|
+
requestTruncated: requestBody.truncated,
|
|
969
|
+
status,
|
|
970
|
+
alpn: alpnOf(req.socket),
|
|
971
|
+
responseHeaders: decoded.decodedFrom === undefined
|
|
972
|
+
? responseHeaders
|
|
973
|
+
: headersWithoutEncoding(responseHeaders),
|
|
974
|
+
responseBody: decoded.body,
|
|
975
|
+
...(decoded.decodedFrom === undefined
|
|
976
|
+
? {}
|
|
977
|
+
: { responseDecodedFrom: decoded.decodedFrom }),
|
|
978
|
+
responseTruncated: responseBody.truncated,
|
|
979
|
+
responseComplete: !abandoned && responseError === undefined && !responseBody.truncated,
|
|
980
|
+
...(responseError === undefined ? {} : { responseError }),
|
|
981
|
+
...(transformations.length === 0 ? {} : { transformations }),
|
|
982
|
+
responseBytes: responseBody.bytes,
|
|
983
|
+
abandoned,
|
|
984
|
+
durationMs: Date.now() - startedAt,
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
finally {
|
|
988
|
+
requestBody.release();
|
|
989
|
+
responseBody.release();
|
|
990
|
+
}
|
|
991
|
+
};
|
|
992
|
+
/** The client is gone: keep what was read, stop pulling from the origin, and settle. */
|
|
993
|
+
const abandon = () => {
|
|
994
|
+
emit(true);
|
|
995
|
+
upstream.destroy();
|
|
996
|
+
resolve();
|
|
997
|
+
};
|
|
998
|
+
res.on('close', () => {
|
|
999
|
+
if (!recorded)
|
|
1000
|
+
abandon();
|
|
1001
|
+
});
|
|
1002
|
+
upstream.on('error', (err) => {
|
|
1003
|
+
// A client that has already left is not an upstream failure to report. Asked of `res`
|
|
1004
|
+
// only: `req` destroys itself once its body has been read, so a request with no body has
|
|
1005
|
+
// `req.destroyed` set long before anything went wrong, and reading it here turned every
|
|
1006
|
+
// upstream failure -- an origin certificate agenticreplay refuses to trust, most of all -- into a
|
|
1007
|
+
// silent abandonment with no 502 for the client to see.
|
|
1008
|
+
if (res.destroyed) {
|
|
1009
|
+
responseError = String(err);
|
|
1010
|
+
abandon();
|
|
1011
|
+
return;
|
|
1012
|
+
}
|
|
1013
|
+
responseError = String(err);
|
|
1014
|
+
emit(false);
|
|
1015
|
+
reject(err);
|
|
1016
|
+
});
|
|
1017
|
+
upstream.on('response', (originRes) => {
|
|
1018
|
+
const outHeaders = {};
|
|
1019
|
+
const responseHeaderPairs = originRes.rawHeaders;
|
|
1020
|
+
for (let index = 0; index < responseHeaderPairs.length; index += 2) {
|
|
1021
|
+
const name = responseHeaderPairs[index];
|
|
1022
|
+
const value = responseHeaderPairs[index + 1];
|
|
1023
|
+
const key = name.toLowerCase();
|
|
1024
|
+
if (HOP_BY_HOP.has(key))
|
|
1025
|
+
continue;
|
|
1026
|
+
const previousForwarded = outHeaders[name];
|
|
1027
|
+
outHeaders[name] =
|
|
1028
|
+
previousForwarded === undefined
|
|
1029
|
+
? value
|
|
1030
|
+
: Array.isArray(previousForwarded)
|
|
1031
|
+
? [...previousForwarded, value]
|
|
1032
|
+
: [previousForwarded, value];
|
|
1033
|
+
if (!SECRET_RESPONSE_HEADERS.has(key)) {
|
|
1034
|
+
const previousRecorded = responseHeaders[key];
|
|
1035
|
+
responseHeaders[key] =
|
|
1036
|
+
previousRecorded === undefined
|
|
1037
|
+
? value
|
|
1038
|
+
: Array.isArray(previousRecorded)
|
|
1039
|
+
? [...previousRecorded, value]
|
|
1040
|
+
: [previousRecorded, value];
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
status = originRes.statusCode ?? 0;
|
|
1044
|
+
if (res.destroyed) {
|
|
1045
|
+
abandon();
|
|
1046
|
+
return;
|
|
1047
|
+
}
|
|
1048
|
+
res.writeHead(originRes.statusCode ?? 502, outHeaders);
|
|
1049
|
+
// Tee, never buffer. A model reply arrives over seconds and the agent renders it as it
|
|
1050
|
+
// lands; reading it to completion first would make every turn appear to hang.
|
|
1051
|
+
originRes.on('data', (chunk) => {
|
|
1052
|
+
responseBody.add(chunk);
|
|
1053
|
+
if (res.destroyed) {
|
|
1054
|
+
abandon();
|
|
1055
|
+
return;
|
|
1056
|
+
}
|
|
1057
|
+
if (!res.write(chunk)) {
|
|
1058
|
+
originRes.pause();
|
|
1059
|
+
// `drain` never fires on a destroyed response, so a client that goes mid-stream would
|
|
1060
|
+
// otherwise leave the origin paused for good and the exchange unrecorded.
|
|
1061
|
+
res.once('drain', () => originRes.resume());
|
|
1062
|
+
}
|
|
1063
|
+
});
|
|
1064
|
+
/**
|
|
1065
|
+
* The origin going away and the client going away arrive on the same two events here, and
|
|
1066
|
+
* they need opposite handling.
|
|
1067
|
+
*
|
|
1068
|
+
* If the client left, this is abandonment: keep the prefix, stop pulling from the origin,
|
|
1069
|
+
* settle. If the *origin* died, the client is still connected and waiting for a stream
|
|
1070
|
+
* agenticreplay has already started forwarding -- and abandoning there settles this promise, so the
|
|
1071
|
+
* caller's `.catch`, the only thing that ends the client's response, never runs. The agent
|
|
1072
|
+
* then waits for a continuation that will never come. `originRes.on('aborted', abandon)`
|
|
1073
|
+
* did exactly that: a crashing origin or a dropped network hung every in-flight call on
|
|
1074
|
+
* this path, where before it produced a prompt answer.
|
|
1075
|
+
*
|
|
1076
|
+
* Both are recorded, because a response the origin cut short is still evidence. Only the
|
|
1077
|
+
* first is `abandoned`: that field says the agent stopped reading, and here it did not.
|
|
1078
|
+
*
|
|
1079
|
+
* The h2 path needs none of this -- there `aborted` is on the client's own stream and the
|
|
1080
|
+
* origin reports through `upstream.on('error')`, so the two are already separate objects.
|
|
1081
|
+
*/
|
|
1082
|
+
const originGone = (err) => {
|
|
1083
|
+
if (res.destroyed) {
|
|
1084
|
+
abandon();
|
|
1085
|
+
return;
|
|
1086
|
+
}
|
|
1087
|
+
responseError = String(err);
|
|
1088
|
+
emit(false);
|
|
1089
|
+
reject(err);
|
|
1090
|
+
};
|
|
1091
|
+
originRes.on('aborted', () => originGone(new Error('origin aborted mid-response')));
|
|
1092
|
+
originRes.on('error', originGone);
|
|
1093
|
+
originRes.on('end', () => {
|
|
1094
|
+
if (recorded)
|
|
1095
|
+
return;
|
|
1096
|
+
// Recorded before the response is closed out, so that the `close` listener above cannot
|
|
1097
|
+
// win the race and file the same exchange as abandoned.
|
|
1098
|
+
emit(false);
|
|
1099
|
+
res.end();
|
|
1100
|
+
resolve();
|
|
1101
|
+
});
|
|
1102
|
+
});
|
|
1103
|
+
});
|
|
1104
|
+
await finished;
|
|
1105
|
+
}
|
|
1106
|
+
function intercept(clientSocket, head, target) {
|
|
1107
|
+
clientSocket.write('HTTP/1.1 200 Connection Established\r\n\r\n');
|
|
1108
|
+
if (head.length > 0)
|
|
1109
|
+
clientSocket.unshift(head);
|
|
1110
|
+
// Tagged before the handover, because the server wraps this socket in a TLSSocket of its own
|
|
1111
|
+
// and the request that comes back out carries the wrapper, not this.
|
|
1112
|
+
clientSocket[TARGET] = target;
|
|
1113
|
+
serverFor(target.host).emit('connection', clientSocket);
|
|
1114
|
+
}
|
|
1115
|
+
function tunnel(clientSocket, head, target) {
|
|
1116
|
+
const startedAt = Date.now();
|
|
1117
|
+
let bytesToOrigin = head.length;
|
|
1118
|
+
let bytesToClient = 0;
|
|
1119
|
+
let settled = false;
|
|
1120
|
+
// Counted at the decision, not at the close. The number an operator wants is "how many
|
|
1121
|
+
// connections did agenticreplay refuse to look inside", and a connection still open when the run ends
|
|
1122
|
+
// was refused just as firmly as one that closed.
|
|
1123
|
+
counters.tunnelled += 1;
|
|
1124
|
+
const origin = netConnect(target.port, target.host);
|
|
1125
|
+
open.add(origin);
|
|
1126
|
+
const finish = (error) => {
|
|
1127
|
+
if (settled)
|
|
1128
|
+
return;
|
|
1129
|
+
settled = true;
|
|
1130
|
+
options.onTunnel?.({
|
|
1131
|
+
host: target.host,
|
|
1132
|
+
port: target.port,
|
|
1133
|
+
bytesToOrigin,
|
|
1134
|
+
bytesToClient,
|
|
1135
|
+
durationMs: Date.now() - startedAt,
|
|
1136
|
+
...(error === undefined ? {} : { error }),
|
|
1137
|
+
});
|
|
1138
|
+
};
|
|
1139
|
+
origin.on('connect', () => {
|
|
1140
|
+
clientSocket.write('HTTP/1.1 200 Connection Established\r\n\r\n');
|
|
1141
|
+
if (head.length > 0)
|
|
1142
|
+
origin.write(head);
|
|
1143
|
+
// Byte counts only. Nothing here inspects, decodes or stores what passes through — that is
|
|
1144
|
+
// the entire promise a tunnel makes.
|
|
1145
|
+
clientSocket.on('data', (chunk) => void (bytesToOrigin += chunk.length));
|
|
1146
|
+
origin.on('data', (chunk) => void (bytesToClient += chunk.length));
|
|
1147
|
+
clientSocket.pipe(origin);
|
|
1148
|
+
origin.pipe(clientSocket);
|
|
1149
|
+
});
|
|
1150
|
+
origin.on('error', (err) => {
|
|
1151
|
+
if (!clientSocket.destroyed && !settled) {
|
|
1152
|
+
clientSocket.write('HTTP/1.1 502 Bad Gateway\r\n\r\n');
|
|
1153
|
+
}
|
|
1154
|
+
finish(String(err));
|
|
1155
|
+
clientSocket.destroy();
|
|
1156
|
+
origin.destroy();
|
|
1157
|
+
});
|
|
1158
|
+
origin.on('close', () => {
|
|
1159
|
+
open.delete(origin);
|
|
1160
|
+
finish();
|
|
1161
|
+
clientSocket.destroy();
|
|
1162
|
+
});
|
|
1163
|
+
clientSocket.on('error', () => origin.destroy());
|
|
1164
|
+
clientSocket.on('close', () => origin.destroy());
|
|
1165
|
+
}
|
|
1166
|
+
server.on('connect', (req, clientSocket, head) => {
|
|
1167
|
+
open.add(clientSocket);
|
|
1168
|
+
clientSocket.on('close', () => open.delete(clientSocket));
|
|
1169
|
+
clientSocket.on('error', () => clientSocket.destroy());
|
|
1170
|
+
const target = parseTarget(req.url ?? '');
|
|
1171
|
+
if (!target) {
|
|
1172
|
+
clientSocket.write('HTTP/1.1 400 Bad Request\r\n\r\n');
|
|
1173
|
+
clientSocket.destroy();
|
|
1174
|
+
return;
|
|
1175
|
+
}
|
|
1176
|
+
if (policy.allows(target.host, target.port)) {
|
|
1177
|
+
intercept(clientSocket, head, target);
|
|
1178
|
+
}
|
|
1179
|
+
else {
|
|
1180
|
+
tunnel(clientSocket, head, target);
|
|
1181
|
+
}
|
|
1182
|
+
});
|
|
1183
|
+
return {
|
|
1184
|
+
policy,
|
|
1185
|
+
close: () => {
|
|
1186
|
+
agent.destroy();
|
|
1187
|
+
for (const session of h2Upstreams.values())
|
|
1188
|
+
session.destroy();
|
|
1189
|
+
h2Upstreams.clear();
|
|
1190
|
+
for (const server of h2Servers.values())
|
|
1191
|
+
server.close();
|
|
1192
|
+
h2Servers.clear();
|
|
1193
|
+
for (const socket of open)
|
|
1194
|
+
socket.destroy();
|
|
1195
|
+
open.clear();
|
|
1196
|
+
},
|
|
1197
|
+
};
|
|
1198
|
+
}
|
|
1199
|
+
/** A bounded copy of a stream, so recording a large upload cannot exhaust memory. */
|
|
1200
|
+
class Capture {
|
|
1201
|
+
limit;
|
|
1202
|
+
budget;
|
|
1203
|
+
#chunks = [];
|
|
1204
|
+
#captured = 0;
|
|
1205
|
+
#total = 0;
|
|
1206
|
+
#truncated = false;
|
|
1207
|
+
#released = false;
|
|
1208
|
+
constructor(limit, budget) {
|
|
1209
|
+
this.limit = limit;
|
|
1210
|
+
this.budget = budget;
|
|
1211
|
+
}
|
|
1212
|
+
add(chunk) {
|
|
1213
|
+
this.#total += chunk.length;
|
|
1214
|
+
const room = this.limit - this.#captured;
|
|
1215
|
+
if (room <= 0) {
|
|
1216
|
+
this.#truncated = true;
|
|
1217
|
+
return;
|
|
1218
|
+
}
|
|
1219
|
+
const reserved = this.budget.reserve(Math.min(chunk.length, room));
|
|
1220
|
+
if (reserved < chunk.length) {
|
|
1221
|
+
if (reserved > 0)
|
|
1222
|
+
this.#chunks.push(chunk.subarray(0, reserved));
|
|
1223
|
+
this.#captured += reserved;
|
|
1224
|
+
this.#truncated = true;
|
|
1225
|
+
return;
|
|
1226
|
+
}
|
|
1227
|
+
this.#chunks.push(chunk);
|
|
1228
|
+
this.#captured += chunk.length;
|
|
1229
|
+
}
|
|
1230
|
+
/**
|
|
1231
|
+
* The captured bytes as something a trace can hold.
|
|
1232
|
+
*
|
|
1233
|
+
* Text when the bytes are text, and base64 behind a marker when they are not. `toString('utf8')`
|
|
1234
|
+
* on a binary body replaces every invalid sequence with U+FFFD and is not reversible: a Connect
|
|
1235
|
+
* protobuf body came back with 974 replacement characters in 8,459 bytes, which is enough to
|
|
1236
|
+
* make the payload undecodable while still looking like it was captured. The round-trip test is
|
|
1237
|
+
* what tells the two cases apart.
|
|
1238
|
+
*/
|
|
1239
|
+
text() {
|
|
1240
|
+
return recordableBody(Buffer.concat(this.#chunks));
|
|
1241
|
+
}
|
|
1242
|
+
buffer() {
|
|
1243
|
+
return Buffer.concat(this.#chunks);
|
|
1244
|
+
}
|
|
1245
|
+
get truncated() {
|
|
1246
|
+
return this.#truncated;
|
|
1247
|
+
}
|
|
1248
|
+
get bytes() {
|
|
1249
|
+
return this.#total;
|
|
1250
|
+
}
|
|
1251
|
+
release() {
|
|
1252
|
+
if (this.#released)
|
|
1253
|
+
return;
|
|
1254
|
+
this.#released = true;
|
|
1255
|
+
this.budget.release(this.#captured);
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
//# sourceMappingURL=intercept.js.map
|