omnicell-router 0.2.0 → 0.7.0
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 +70 -10
- package/README.zh-CN.md +57 -8
- package/RELEASING.md +6 -0
- package/RELEASING.zh-CN.md +5 -0
- package/backend/dist/auth/api-keys.d.ts +14 -2
- package/backend/dist/auth/api-keys.js +26 -14
- package/backend/dist/auth/model-access.d.ts +27 -10
- package/backend/dist/auth/model-access.js +34 -17
- package/backend/dist/capture/migrate/engine.d.ts +38 -0
- package/backend/dist/capture/migrate/engine.js +307 -0
- package/backend/dist/capture/migrate/index.d.ts +18 -0
- package/backend/dist/capture/migrate/index.js +18 -0
- package/backend/dist/capture/migrate/migrator.d.ts +113 -0
- package/backend/dist/capture/migrate/migrator.js +16 -0
- package/backend/dist/capture/migrate/registry.d.ts +16 -0
- package/backend/dist/capture/migrate/registry.js +19 -0
- package/backend/dist/capture/migrate/steps/v1-to-v2.d.ts +86 -0
- package/backend/dist/capture/migrate/steps/v1-to-v2.js +396 -0
- package/backend/dist/capture/recorder.d.ts +422 -272
- package/backend/dist/capture/recorder.js +873 -417
- package/backend/dist/capture/turn-boundary.d.ts +17 -0
- package/backend/dist/capture/turn-boundary.js +31 -0
- package/backend/dist/cli/clients/base.d.ts +158 -23
- package/backend/dist/cli/clients/base.js +150 -4
- package/backend/dist/cli/clients/claude.d.ts +3 -2
- package/backend/dist/cli/clients/claude.js +4 -3
- package/backend/dist/cli/clients/codex.d.ts +3 -2
- package/backend/dist/cli/clients/codex.js +4 -3
- package/backend/dist/cli/clients/core-adapters.d.ts +25 -0
- package/backend/dist/cli/clients/core-adapters.js +44 -0
- package/backend/dist/cli/clients/dsh.d.ts +5 -3
- package/backend/dist/cli/clients/dsh.js +29 -18
- package/backend/dist/cli/clients/grok.d.ts +53 -0
- package/backend/dist/cli/clients/grok.js +249 -0
- package/backend/dist/cli/clients/index.d.ts +28 -19
- package/backend/dist/cli/clients/index.js +156 -58
- package/backend/dist/cli/clients/kimi.d.ts +75 -0
- package/backend/dist/cli/clients/kimi.js +316 -0
- package/backend/dist/cli/clients/launcher.d.ts +48 -0
- package/backend/dist/cli/clients/launcher.js +41 -0
- package/backend/dist/cli/clients/omp.d.ts +43 -0
- package/backend/dist/cli/clients/omp.js +537 -0
- package/backend/dist/cli/clients/openclaw.d.ts +55 -0
- package/backend/dist/cli/clients/openclaw.js +525 -0
- package/backend/dist/cli/clients/opencode.d.ts +7 -20
- package/backend/dist/cli/clients/opencode.js +32 -159
- package/backend/dist/cli/clients/pi.d.ts +7 -21
- package/backend/dist/cli/clients/pi.js +87 -229
- package/backend/dist/cli/clients/plugin-adapters.d.ts +20 -0
- package/backend/dist/cli/clients/plugin-adapters.js +88 -0
- package/backend/dist/cli/clients/reserved.d.ts +51 -0
- package/backend/dist/cli/clients/reserved.js +53 -0
- package/backend/dist/cli/clients/workbuddy.d.ts +31 -0
- package/backend/dist/cli/clients/workbuddy.js +259 -0
- package/backend/dist/cli/daemon.d.ts +105 -27
- package/backend/dist/cli/daemon.js +509 -151
- package/backend/dist/cli/index.d.ts +6 -1
- package/backend/dist/cli/index.js +238 -22
- package/backend/dist/cli/paths.d.ts +86 -0
- package/backend/dist/cli/paths.js +269 -0
- package/backend/dist/cli/shim.d.ts +47 -1
- package/backend/dist/cli/shim.js +180 -13
- package/backend/dist/cli/types.d.ts +102 -16
- package/backend/dist/cli/types.js +5 -4
- package/backend/dist/compression/caveman-prompts.d.ts +1 -1
- package/backend/dist/compression/caveman.d.ts +2 -16
- package/backend/dist/compression/caveman.js +25 -37
- package/backend/dist/compression/headroom.d.ts +4 -3
- package/backend/dist/compression/headroom.js +2 -2
- package/backend/dist/compression/index.d.ts +5 -26
- package/backend/dist/compression/index.js +79 -17
- package/backend/dist/compression/tool-output.d.ts +2 -20
- package/backend/dist/compression/tool-output.js +40 -47
- package/backend/dist/config/comments-en.d.ts +17 -0
- package/backend/dist/config/comments-en.js +232 -0
- package/backend/dist/config/comments-zh.d.ts +10 -0
- package/backend/dist/config/comments-zh.js +217 -0
- package/backend/dist/config/defaults.d.ts +190 -2
- package/backend/dist/config/defaults.js +191 -2
- package/backend/dist/config/env-archive.js +77 -38
- package/backend/dist/config/env.d.ts +4 -0
- package/backend/dist/config/env.js +16 -0
- package/backend/dist/config/index.d.ts +48 -12
- package/backend/dist/config/index.js +794 -368
- package/backend/dist/config/layout.d.ts +29 -0
- package/backend/dist/config/layout.js +86 -0
- package/backend/dist/config/migrations/v0-to-v1.d.ts +105 -0
- package/backend/dist/config/migrations/v0-to-v1.js +78 -0
- package/backend/dist/config/migrations/v1-to-v2.d.ts +14 -0
- package/backend/dist/config/migrations/v1-to-v2.js +41 -0
- package/backend/dist/config/migrations/v2-to-v3.d.ts +34 -0
- package/backend/dist/config/migrations/v2-to-v3.js +66 -0
- package/backend/dist/config/migrations/v3-to-v4.d.ts +34 -0
- package/backend/dist/config/migrations/v3-to-v4.js +61 -0
- package/backend/dist/config/runtime.d.ts +13 -0
- package/backend/dist/config/runtime.js +26 -0
- package/backend/dist/config/schema.d.ts +28 -0
- package/backend/dist/config/schema.js +98 -0
- package/backend/dist/config/types.d.ts +501 -84
- package/backend/dist/forward-proxy/access-log.d.ts +173 -0
- package/backend/dist/forward-proxy/access-log.js +657 -0
- package/backend/dist/forward-proxy/ca-trust.d.ts +42 -0
- package/backend/dist/forward-proxy/ca-trust.js +242 -0
- package/backend/dist/forward-proxy/ca.d.ts +66 -2
- package/backend/dist/forward-proxy/ca.js +146 -11
- package/backend/dist/forward-proxy/caller-context.d.ts +18 -0
- package/backend/dist/forward-proxy/caller-context.js +20 -0
- package/backend/dist/forward-proxy/egress.d.ts +104 -0
- package/backend/dist/forward-proxy/egress.js +280 -0
- package/backend/dist/forward-proxy/h2-forward.d.ts +66 -0
- package/backend/dist/forward-proxy/h2-forward.js +526 -0
- package/backend/dist/forward-proxy/index.d.ts +13 -1
- package/backend/dist/forward-proxy/index.js +148 -7
- package/backend/dist/forward-proxy/interceptor.d.ts +16 -13
- package/backend/dist/forward-proxy/interceptor.js +35 -57
- package/backend/dist/forward-proxy/relay.d.ts +21 -1
- package/backend/dist/forward-proxy/relay.js +48 -1
- package/backend/dist/forward-proxy/rules.d.ts +148 -0
- package/backend/dist/forward-proxy/rules.js +280 -0
- package/backend/dist/forward-proxy/server.d.ts +102 -9
- package/backend/dist/forward-proxy/server.js +1310 -305
- package/backend/dist/forward-proxy/sni.d.ts +29 -7
- package/backend/dist/forward-proxy/sni.js +109 -47
- package/backend/dist/forward-proxy/system-proxy.d.ts +72 -0
- package/backend/dist/forward-proxy/system-proxy.js +303 -0
- package/backend/dist/forward-proxy/upstream-tls.d.ts +46 -0
- package/backend/dist/forward-proxy/upstream-tls.js +105 -0
- package/backend/dist/forward-proxy/ws-frames.d.ts +45 -0
- package/backend/dist/forward-proxy/ws-frames.js +153 -0
- package/backend/dist/harness/common/catalog-registry.d.ts +63 -0
- package/backend/dist/harness/common/catalog-registry.js +77 -0
- package/backend/dist/harness/common/github.d.ts +6 -0
- package/backend/dist/harness/common/github.js +13 -0
- package/backend/dist/harness/common/market.d.ts +590 -0
- package/backend/dist/harness/common/market.js +1079 -0
- package/backend/dist/harness/common/marketplace-rescan-scheduler.d.ts +24 -0
- package/backend/dist/harness/common/marketplace-rescan-scheduler.js +62 -0
- package/backend/dist/harness/{catalog-npm.d.ts → common/npm-catalog.d.ts} +5 -5
- package/backend/dist/harness/{catalog-npm.js → common/npm-catalog.js} +7 -7
- package/backend/dist/harness/common/npm-source.d.ts +29 -0
- package/backend/dist/harness/common/npm-source.js +121 -0
- package/backend/dist/harness/common/pypi-source.d.ts +28 -0
- package/backend/dist/harness/common/pypi-source.js +71 -0
- package/backend/dist/harness/common/source-views.d.ts +22 -0
- package/backend/dist/harness/common/source-views.js +25 -0
- package/backend/dist/harness/{stars.d.ts → common/stars.d.ts} +1 -1
- package/backend/dist/harness/{stars.js → common/stars.js} +2 -2
- package/backend/dist/harness/common/text.d.ts +11 -0
- package/backend/dist/harness/common/text.js +18 -0
- package/backend/dist/harness/config-file.d.ts +14 -1
- package/backend/dist/harness/config-file.js +38 -0
- package/backend/dist/harness/db-probe.d.ts +29 -0
- package/backend/dist/harness/db-probe.js +270 -0
- package/backend/dist/harness/detail.d.ts +10 -1
- package/backend/dist/harness/detail.js +144 -7
- package/backend/dist/harness/host/adapters/amp.d.ts +19 -0
- package/backend/dist/harness/host/adapters/amp.js +21 -0
- package/backend/dist/harness/host/adapters/antigravity.d.ts +18 -0
- package/backend/dist/harness/host/adapters/antigravity.js +21 -0
- package/backend/dist/harness/host/adapters/base.d.ts +225 -0
- package/backend/dist/harness/host/adapters/base.js +521 -0
- package/backend/dist/harness/host/adapters/claude.d.ts +54 -0
- package/backend/dist/harness/host/adapters/claude.js +145 -0
- package/backend/dist/harness/host/adapters/cline.d.ts +18 -0
- package/backend/dist/harness/host/adapters/cline.js +20 -0
- package/backend/dist/harness/host/adapters/codex.d.ts +54 -0
- package/backend/dist/harness/host/adapters/codex.js +133 -0
- package/backend/dist/harness/host/adapters/cursor.d.ts +18 -0
- package/backend/dist/harness/host/adapters/cursor.js +24 -0
- package/backend/dist/harness/host/adapters/declarative.d.ts +22 -0
- package/backend/dist/harness/host/adapters/declarative.js +38 -0
- package/backend/dist/harness/host/adapters/dsh.d.ts +76 -0
- package/backend/dist/harness/host/adapters/dsh.js +253 -0
- package/backend/dist/harness/host/adapters/factory.d.ts +36 -0
- package/backend/dist/harness/host/adapters/factory.js +34 -0
- package/backend/dist/harness/host/adapters/gemini-cli.d.ts +17 -0
- package/backend/dist/harness/host/adapters/gemini-cli.js +19 -0
- package/backend/dist/harness/host/adapters/grok.d.ts +66 -0
- package/backend/dist/harness/host/adapters/grok.js +136 -0
- package/backend/dist/harness/{adapters → host/adapters}/index.d.ts +18 -5
- package/backend/dist/harness/{adapters → host/adapters}/index.js +73 -5
- package/backend/dist/harness/host/adapters/kimi.d.ts +30 -0
- package/backend/dist/harness/host/adapters/kimi.js +59 -0
- package/backend/dist/harness/host/adapters/omp.d.ts +55 -0
- package/backend/dist/harness/host/adapters/omp.js +90 -0
- package/backend/dist/harness/host/adapters/openclaw.d.ts +54 -0
- package/backend/dist/harness/host/adapters/openclaw.js +141 -0
- package/backend/dist/harness/host/adapters/opencode.d.ts +24 -0
- package/backend/dist/harness/host/adapters/opencode.js +48 -0
- package/backend/dist/harness/host/adapters/pi.d.ts +27 -0
- package/backend/dist/harness/host/adapters/pi.js +58 -0
- package/backend/dist/harness/host/adapters/types.d.ts +395 -0
- package/backend/dist/harness/host/adapters/types.js +17 -0
- package/backend/dist/harness/host/adapters/universal.d.ts +14 -0
- package/backend/dist/harness/host/adapters/universal.js +18 -0
- package/backend/dist/harness/host/adapters/windsurf.d.ts +20 -0
- package/backend/dist/harness/host/adapters/windsurf.js +22 -0
- package/backend/dist/harness/host/adapters/zed.d.ts +12 -0
- package/backend/dist/harness/host/adapters/zed.js +14 -0
- package/backend/dist/harness/host/claude-mcp-runtime.d.ts +6 -0
- package/backend/dist/harness/host/claude-mcp-runtime.js +56 -0
- package/backend/dist/harness/{discover.d.ts → host/discover.d.ts} +54 -18
- package/backend/dist/harness/{discover.js → host/discover.js} +314 -53
- package/backend/dist/harness/{drift.d.ts → host/drift.d.ts} +1 -1
- package/backend/dist/harness/{drift.js → host/drift.js} +1 -1
- package/backend/dist/harness/host/grok-mcp-runtime.d.ts +6 -0
- package/backend/dist/harness/host/grok-mcp-runtime.js +56 -0
- package/backend/dist/harness/{hosts.d.ts → host/hosts.d.ts} +3 -3
- package/backend/dist/harness/{hosts.js → host/hosts.js} +7 -2
- package/backend/dist/harness/host/index.d.ts +10 -0
- package/backend/dist/harness/host/index.js +12 -0
- package/backend/dist/harness/host/install-log.d.ts +22 -0
- package/backend/dist/harness/host/install-log.js +106 -0
- package/backend/dist/harness/{install.d.ts → host/install.d.ts} +32 -13
- package/backend/dist/harness/{install.js → host/install.js} +133 -50
- package/backend/dist/harness/host/inventory.d.ts +30 -0
- package/backend/dist/harness/{inventory.js → host/inventory.js} +107 -16
- package/backend/dist/harness/host/kimi-mcp-runtime.d.ts +6 -0
- package/backend/dist/harness/host/kimi-mcp-runtime.js +84 -0
- package/backend/dist/harness/{ledger.d.ts → host/ledger.d.ts} +1 -1
- package/backend/dist/harness/{ledger.js → host/ledger.js} +3 -3
- package/backend/dist/harness/{maintenance.d.ts → host/maintenance.d.ts} +23 -6
- package/backend/dist/harness/{maintenance.js → host/maintenance.js} +355 -63
- package/backend/dist/harness/{manifest.d.ts → host/manifest.d.ts} +11 -2
- package/backend/dist/harness/{manifest.js → host/manifest.js} +76 -15
- package/backend/dist/harness/host/marketplace-sync.d.ts +64 -0
- package/backend/dist/harness/host/marketplace-sync.js +231 -0
- package/backend/dist/harness/host/mcp-cli.d.ts +44 -0
- package/backend/dist/harness/host/mcp-cli.js +545 -0
- package/backend/dist/harness/host/mcp-edit.d.ts +89 -0
- package/backend/dist/harness/host/mcp-edit.js +342 -0
- package/backend/dist/harness/host/mcp-entry.d.ts +100 -0
- package/backend/dist/harness/host/mcp-entry.js +435 -0
- package/backend/dist/harness/host/mcp-inspector.d.ts +125 -0
- package/backend/dist/harness/host/mcp-inspector.js +634 -0
- package/backend/dist/harness/host/mcp-registry.d.ts +66 -0
- package/backend/dist/harness/host/mcp-registry.js +331 -0
- package/backend/dist/harness/host/mcp-runtime.d.ts +19 -0
- package/backend/dist/harness/host/mcp-runtime.js +22 -0
- package/backend/dist/harness/host/opencode-mcp-runtime.d.ts +7 -0
- package/backend/dist/harness/host/opencode-mcp-runtime.js +73 -0
- package/backend/dist/harness/{probe.d.ts → host/probe.d.ts} +4 -4
- package/backend/dist/harness/{probe.js → host/probe.js} +8 -8
- package/backend/dist/harness/{registry.d.ts → host/registry.d.ts} +1 -1
- package/backend/dist/harness/host/registry.js +28 -0
- package/backend/dist/harness/host/request.d.ts +56 -0
- package/backend/dist/harness/host/request.js +1 -0
- package/backend/dist/harness/{sources → host/resolvers}/clawhub.d.ts +1 -1
- package/backend/dist/harness/{sources → host/resolvers}/clawhub.js +1 -1
- package/backend/dist/harness/host/resolvers/git-marketplace.d.ts +16 -0
- package/backend/dist/harness/host/resolvers/git-marketplace.js +53 -0
- package/backend/dist/harness/{sources → host/resolvers}/github.d.ts +1 -1
- package/backend/dist/harness/{sources → host/resolvers}/github.js +2 -2
- package/backend/dist/harness/host/resolvers/npm.d.ts +2 -0
- package/backend/dist/harness/{sources → host/resolvers}/npm.js +16 -10
- package/backend/dist/harness/host/resolvers/pypi.d.ts +2 -0
- package/backend/dist/harness/host/resolvers/pypi.js +100 -0
- package/backend/dist/harness/host/scopes.d.ts +11 -0
- package/backend/dist/harness/host/scopes.js +12 -0
- package/backend/dist/harness/host/timeouts.d.ts +8 -0
- package/backend/dist/harness/host/timeouts.js +8 -0
- package/backend/dist/harness/host/writers/kimi-web.d.ts +70 -0
- package/backend/dist/harness/host/writers/kimi-web.js +222 -0
- package/backend/dist/harness/host/writers/mcp.d.ts +119 -0
- package/backend/dist/harness/host/writers/mcp.js +359 -0
- package/backend/dist/harness/host/writers/plugin.d.ts +176 -0
- package/backend/dist/harness/host/writers/plugin.js +528 -0
- package/backend/dist/harness/{writers → host/writers}/skill.d.ts +3 -3
- package/backend/dist/harness/{writers → host/writers}/skill.js +6 -3
- package/backend/dist/harness/lang.d.ts +14 -0
- package/backend/dist/harness/lang.js +33 -0
- package/backend/dist/harness/net.d.ts +33 -0
- package/backend/dist/harness/net.js +63 -0
- package/backend/dist/harness/plugin/adapters/antigravity.d.ts +11 -0
- package/backend/dist/harness/plugin/adapters/antigravity.js +14 -0
- package/backend/dist/harness/plugin/adapters/base.d.ts +107 -0
- package/backend/dist/harness/plugin/adapters/base.js +454 -0
- package/backend/dist/harness/plugin/adapters/claude.d.ts +28 -0
- package/backend/dist/harness/plugin/adapters/claude.js +63 -0
- package/backend/dist/harness/plugin/adapters/codex.d.ts +13 -0
- package/backend/dist/harness/plugin/adapters/codex.js +16 -0
- package/backend/dist/harness/plugin/adapters/cursor.d.ts +13 -0
- package/backend/dist/harness/plugin/adapters/cursor.js +16 -0
- package/backend/dist/harness/plugin/adapters/dsh-plugin-net.d.ts +20 -0
- package/backend/dist/harness/plugin/adapters/dsh-plugin-net.js +371 -0
- package/backend/dist/harness/plugin/adapters/dsh.d.ts +22 -0
- package/backend/dist/harness/plugin/adapters/dsh.js +50 -0
- package/backend/dist/harness/plugin/adapters/factory.d.ts +11 -0
- package/backend/dist/harness/plugin/adapters/factory.js +19 -0
- package/backend/dist/harness/plugin/adapters/gemini.d.ts +12 -0
- package/backend/dist/harness/plugin/adapters/gemini.js +22 -0
- package/backend/dist/harness/plugin/adapters/grok.d.ts +15 -0
- package/backend/dist/harness/plugin/adapters/grok.js +23 -0
- package/backend/dist/harness/plugin/adapters/index.d.ts +41 -0
- package/backend/dist/harness/plugin/adapters/index.js +143 -0
- package/backend/dist/harness/plugin/adapters/kimi.d.ts +6 -0
- package/backend/dist/harness/plugin/adapters/kimi.js +35 -0
- package/backend/dist/harness/plugin/adapters/omp.d.ts +19 -0
- package/backend/dist/harness/plugin/adapters/omp.js +26 -0
- package/backend/dist/harness/plugin/adapters/openclaw.d.ts +20 -0
- package/backend/dist/harness/plugin/adapters/openclaw.js +36 -0
- package/backend/dist/harness/plugin/adapters/pi-dev.d.ts +124 -0
- package/backend/dist/harness/plugin/adapters/pi-dev.js +420 -0
- package/backend/dist/harness/plugin/adapters/pi-github.d.ts +18 -0
- package/backend/dist/harness/plugin/adapters/pi-github.js +27 -0
- package/backend/dist/harness/plugin/adapters/universal.d.ts +11 -0
- package/backend/dist/harness/plugin/adapters/universal.js +18 -0
- package/backend/dist/harness/plugin/builtin.d.ts +13 -0
- package/backend/dist/harness/plugin/builtin.js +34 -0
- package/backend/dist/harness/plugin/catalog.d.ts +30 -0
- package/backend/dist/harness/plugin/catalog.js +200 -0
- package/backend/dist/harness/plugin/index.d.ts +9 -0
- package/backend/dist/harness/plugin/index.js +9 -0
- package/backend/dist/harness/plugin/types.d.ts +164 -0
- package/backend/dist/harness/plugin/types.js +1 -0
- package/backend/dist/harness/{clawhub.d.ts → skill/clawhub.d.ts} +28 -5
- package/backend/dist/harness/{clawhub.js → skill/clawhub.js} +170 -5
- package/backend/dist/harness/skill/skills-sh.d.ts +47 -0
- package/backend/dist/harness/skill/skills-sh.js +270 -0
- package/backend/dist/harness/skill/sources.d.ts +41 -0
- package/backend/dist/harness/skill/sources.js +131 -0
- package/backend/dist/harness/spi.d.ts +11 -7
- package/backend/dist/harness/tcp-reach.d.ts +30 -0
- package/backend/dist/harness/tcp-reach.js +61 -0
- package/backend/dist/harness/translation.d.ts +31 -13
- package/backend/dist/harness/translation.js +212 -62
- package/backend/dist/harness/types.d.ts +61 -16
- package/backend/dist/index.js +170 -16
- package/backend/dist/ir/adapters/anthropic-messages-stream.d.ts +18 -0
- package/backend/dist/ir/adapters/anthropic-messages-stream.js +266 -0
- package/backend/dist/ir/adapters/anthropic-messages.d.ts +30 -0
- package/backend/dist/ir/adapters/anthropic-messages.js +870 -0
- package/backend/dist/ir/adapters/google-gemini-stream.d.ts +22 -0
- package/backend/dist/ir/adapters/google-gemini-stream.js +246 -0
- package/backend/dist/ir/adapters/google-gemini.d.ts +9 -0
- package/backend/dist/ir/adapters/google-gemini.js +450 -0
- package/backend/dist/ir/adapters/openai-chat-stream.d.ts +41 -0
- package/backend/dist/ir/adapters/openai-chat-stream.js +369 -0
- package/backend/dist/ir/adapters/openai-chat.d.ts +17 -0
- package/backend/dist/ir/adapters/openai-chat.js +670 -0
- package/backend/dist/ir/adapters/openai-responses-output.d.ts +50 -0
- package/backend/dist/ir/adapters/openai-responses-output.js +353 -0
- package/backend/dist/ir/adapters/openai-responses-stream.d.ts +12 -0
- package/backend/dist/ir/adapters/openai-responses-stream.js +193 -0
- package/backend/dist/ir/adapters/openai-responses.d.ts +14 -0
- package/backend/dist/ir/adapters/openai-responses.js +670 -0
- package/backend/dist/ir/capabilities.d.ts +41 -0
- package/backend/dist/ir/capabilities.js +147 -0
- package/backend/dist/ir/errors.d.ts +23 -0
- package/backend/dist/ir/errors.js +31 -0
- package/backend/dist/ir/index.d.ts +5 -0
- package/backend/dist/ir/index.js +5 -0
- package/backend/dist/ir/media.d.ts +2 -0
- package/backend/dist/ir/media.js +2 -0
- package/backend/dist/ir/stream.d.ts +17 -0
- package/backend/dist/ir/stream.js +250 -0
- package/backend/dist/ir/types.d.ts +523 -0
- package/backend/dist/ir/types.js +19 -0
- package/backend/dist/ir/validate.d.ts +18 -0
- package/backend/dist/ir/validate.js +272 -0
- package/backend/dist/metrics/request-cost.d.ts +3 -11
- package/backend/dist/metrics/request-cost.js +9 -27
- package/backend/dist/observability/failure-events.d.ts +20 -4
- package/backend/dist/observability/failure-events.js +9 -1
- package/backend/dist/observability/http-exchange.d.ts +75 -27
- package/backend/dist/observability/http-exchange.js +136 -39
- package/backend/dist/observability/request-identity.d.ts +40 -0
- package/backend/dist/observability/request-identity.js +102 -0
- package/backend/dist/observability/traffic-live-hidden.d.ts +24 -0
- package/backend/dist/observability/traffic-live-hidden.js +82 -0
- package/backend/dist/observability/upstream-body-redaction.d.ts +23 -0
- package/backend/dist/observability/upstream-body-redaction.js +72 -0
- package/backend/dist/observability/upstream-events.d.ts +16 -10
- package/backend/dist/observability/upstream-events.js +17 -11
- package/backend/dist/opencode/agents.d.ts +10 -2
- package/backend/dist/opencode/agents.js +22 -3
- package/backend/dist/opencode/catalog/auto-pull.d.ts +35 -1
- package/backend/dist/opencode/catalog/auto-pull.js +169 -33
- package/backend/dist/opencode/catalog/ocr-store.d.ts +6 -6
- package/backend/dist/opencode/catalog/ocr-store.js +2 -2
- package/backend/dist/opencode/catalog/overrides-store.d.ts +6 -5
- package/backend/dist/opencode/catalog/overrides-store.js +28 -3
- package/backend/dist/opencode/catalog/repository.d.ts +4 -0
- package/backend/dist/opencode/catalog/repository.js +19 -0
- package/backend/dist/opencode/catalog/sources/models-dev.d.ts +4 -0
- package/backend/dist/opencode/catalog/sources/models-dev.js +15 -4
- package/backend/dist/opencode/catalog/types.d.ts +10 -7
- package/backend/dist/opencode/connector.d.ts +2 -2
- package/backend/dist/opencode/connector.js +2 -2
- package/backend/dist/opencode/credentials/def-materialize.d.ts +0 -5
- package/backend/dist/opencode/credentials/def-materialize.js +149 -11
- package/backend/dist/opencode/credentials/ocr-store.d.ts +18 -0
- package/backend/dist/opencode/credentials/ocr-store.js +88 -7
- package/backend/dist/opencode/credentials/opencode-v2-store.d.ts +24 -13
- package/backend/dist/opencode/credentials/opencode-v2-store.js +70 -29
- package/backend/dist/opencode/credentials/paths.d.ts +8 -0
- package/backend/dist/opencode/credentials/paths.js +10 -0
- package/backend/dist/opencode/credentials/sync.d.ts +1 -1
- package/backend/dist/opencode/credentials/sync.js +4 -4
- package/backend/dist/opencode/credentials/types.d.ts +40 -4
- package/backend/dist/opencode/probe.d.ts +9 -5
- package/backend/dist/opencode/probe.js +68 -15
- package/backend/dist/opencode/provider-defs.js +59 -2
- package/backend/dist/opencode/provider-package.d.ts +31 -0
- package/backend/dist/opencode/provider-package.js +70 -0
- package/backend/dist/opencode/user-config.d.ts +11 -17
- package/backend/dist/opencode/user-config.js +42 -66
- package/backend/dist/pipeline/credential-selection.d.ts +13 -0
- package/backend/dist/pipeline/credential-selection.js +29 -1
- package/backend/dist/pipeline/directives.d.ts +14 -22
- package/backend/dist/pipeline/directives.js +122 -68
- package/backend/dist/pipeline/orchestrator.d.ts +42 -7
- package/backend/dist/pipeline/orchestrator.js +736 -235
- package/backend/dist/pipeline/prompt-optimizer.d.ts +6 -13
- package/backend/dist/pipeline/prompt-optimizer.js +9 -52
- package/backend/dist/pipeline/streaming-posture.d.ts +29 -0
- package/backend/dist/pipeline/streaming-posture.js +27 -0
- package/backend/dist/pipeline/tool-pairing.d.ts +10 -0
- package/backend/dist/pipeline/tool-pairing.js +90 -0
- package/backend/dist/plugins/builtin/model-gateway.d.ts +30 -0
- package/backend/dist/plugins/builtin/model-gateway.js +98 -0
- package/backend/dist/plugins/config.d.ts +41 -0
- package/backend/dist/plugins/config.js +113 -0
- package/backend/dist/plugins/gateways.d.ts +98 -0
- package/backend/dist/plugins/gateways.js +151 -0
- package/backend/dist/plugins/host.d.ts +203 -0
- package/backend/dist/plugins/host.js +1310 -0
- package/backend/dist/plugins/manifest.d.ts +43 -0
- package/backend/dist/plugins/manifest.js +462 -0
- package/backend/dist/plugins/pack.d.ts +32 -0
- package/backend/dist/plugins/pack.js +222 -0
- package/backend/dist/plugins/seed.d.ts +53 -0
- package/backend/dist/plugins/seed.js +136 -0
- package/backend/dist/plugins/types.d.ts +721 -0
- package/backend/dist/plugins/types.js +1 -0
- package/backend/dist/projects/store.d.ts +56 -0
- package/backend/dist/projects/store.js +194 -0
- package/backend/dist/projects/types.d.ts +12 -0
- package/backend/dist/projects/types.js +1 -0
- package/backend/dist/protocols/chat-compat.d.ts +2 -0
- package/backend/dist/protocols/chat-compat.js +137 -0
- package/backend/dist/protocols/systemone/convert.d.ts +5 -4
- package/backend/dist/protocols/systemone/convert.js +72 -26
- package/backend/dist/protocols/systemone/decide.js +128 -51
- package/backend/dist/protocols/systemone/native.d.ts +1 -1
- package/backend/dist/protocols/systemone/native.js +6 -6
- package/backend/dist/providers/anthropic.js +6 -6
- package/backend/dist/providers/base.d.ts +8 -47
- package/backend/dist/providers/boot-direct.d.ts +20 -2
- package/backend/dist/providers/boot-direct.js +72 -23
- package/backend/dist/providers/compat/tool-markup-leak.d.ts +41 -0
- package/backend/dist/providers/compat/tool-markup-leak.js +57 -0
- package/backend/dist/providers/compat/tool-markup-recovery.d.ts +27 -0
- package/backend/dist/providers/compat/tool-markup-recovery.js +831 -0
- package/backend/dist/providers/dispatch.d.ts +5 -8
- package/backend/dist/providers/dispatch.js +18 -12
- package/backend/dist/providers/executors/anthropic-messages.d.ts +12 -0
- package/backend/dist/providers/executors/anthropic-messages.js +56 -0
- package/backend/dist/providers/executors/dispatch.d.ts +14 -0
- package/backend/dist/providers/executors/dispatch.js +71 -0
- package/backend/dist/providers/executors/google-gemini.d.ts +12 -0
- package/backend/dist/providers/executors/google-gemini.js +53 -0
- package/backend/dist/providers/executors/http-json.d.ts +19 -0
- package/backend/dist/providers/executors/http-json.js +125 -0
- package/backend/dist/providers/executors/http-stream.d.ts +53 -0
- package/backend/dist/providers/executors/http-stream.js +472 -0
- package/backend/dist/providers/executors/openai-chat.d.ts +13 -0
- package/backend/dist/providers/executors/openai-chat.js +89 -0
- package/backend/dist/providers/executors/openai-responses.d.ts +12 -0
- package/backend/dist/providers/executors/openai-responses.js +71 -0
- package/backend/dist/providers/executors/plugin-adapter.d.ts +9 -0
- package/backend/dist/providers/executors/plugin-adapter.js +31 -0
- package/backend/dist/providers/google.js +6 -6
- package/backend/dist/providers/openai-compatible.js +13 -13
- package/backend/dist/providers/opencode-proxy.js +6 -6
- package/backend/dist/providers/plugin-wires.d.ts +34 -0
- package/backend/dist/providers/plugin-wires.js +82 -0
- package/backend/dist/providers/pool-refresh.d.ts +14 -0
- package/backend/dist/providers/pool-refresh.js +13 -0
- package/backend/dist/providers/protocol.d.ts +4 -0
- package/backend/dist/providers/protocol.js +61 -0
- package/backend/dist/providers/provider-takedown.d.ts +59 -0
- package/backend/dist/providers/provider-takedown.js +135 -0
- package/backend/dist/providers/registry.d.ts +37 -21
- package/backend/dist/providers/registry.js +204 -109
- package/backend/dist/providers/responses.d.ts +4 -2
- package/backend/dist/providers/responses.js +12 -9
- package/backend/dist/providers/vocabulary.d.ts +24 -6
- package/backend/dist/providers/vocabulary.js +75 -33
- package/backend/dist/providers/wire.d.ts +12 -17
- package/backend/dist/providers/wire.js +43 -91
- package/backend/dist/proxy/manual-node-spec.d.ts +92 -0
- package/backend/dist/proxy/manual-node-spec.js +408 -0
- package/backend/dist/proxy/mihomo-binary.d.ts +39 -0
- package/backend/dist/proxy/mihomo-binary.js +267 -0
- package/backend/dist/proxy/mihomo-client.d.ts +94 -0
- package/backend/dist/proxy/mihomo-client.js +294 -0
- package/backend/dist/proxy/mihomo-config.d.ts +40 -0
- package/backend/dist/proxy/mihomo-config.js +152 -0
- package/backend/dist/proxy/mihomo-pac.d.ts +26 -0
- package/backend/dist/proxy/mihomo-pac.js +60 -0
- package/backend/dist/proxy/mihomo-rules-import.d.ts +43 -0
- package/backend/dist/proxy/mihomo-rules-import.js +193 -0
- package/backend/dist/proxy/mihomo-sidecar.d.ts +65 -0
- package/backend/dist/proxy/mihomo-sidecar.js +515 -0
- package/backend/dist/quota/engine.d.ts +9 -2
- package/backend/dist/quota/engine.js +19 -1
- package/backend/dist/quota/prober.d.ts +8 -4
- package/backend/dist/quota/prober.js +9 -10
- package/backend/dist/ratelimit/rate-limiter.d.ts +119 -6
- package/backend/dist/ratelimit/rate-limiter.js +358 -20
- package/backend/dist/ratelimit/window-store.d.ts +34 -0
- package/backend/dist/ratelimit/window-store.js +70 -0
- package/backend/dist/resilience/breaker-state.js +8 -1
- package/backend/dist/resilience/circuit-breaker-manager.d.ts +229 -132
- package/backend/dist/resilience/circuit-breaker-manager.js +566 -297
- package/backend/dist/resilience/circuit-breaker.d.ts +11 -0
- package/backend/dist/resilience/circuit-breaker.js +39 -7
- package/backend/dist/resilience/error-classifier.d.ts +31 -3
- package/backend/dist/resilience/error-classifier.js +159 -31
- package/backend/dist/resilience/health-prober.d.ts +21 -4
- package/backend/dist/resilience/health-prober.js +100 -18
- package/backend/dist/resilience/types.d.ts +56 -9
- package/backend/dist/resilience/types.js +1 -1
- package/backend/dist/router/index.d.ts +6 -29
- package/backend/dist/router/index.js +15 -61
- package/backend/dist/router/layer2-decision.d.ts +2 -2
- package/backend/dist/router/layer2-decision.js +22 -19
- package/backend/dist/router/request-traits.d.ts +4 -11
- package/backend/dist/router/request-traits.js +5 -13
- package/backend/dist/routes/console.js +1948 -253
- package/backend/dist/routes/environments.d.ts +3 -2
- package/backend/dist/routes/environments.js +8 -4
- package/backend/dist/routes/harness.d.ts +3 -1
- package/backend/dist/routes/harness.js +1164 -355
- package/backend/dist/routes/mihomo.d.ts +5 -0
- package/backend/dist/routes/mihomo.js +882 -0
- package/backend/dist/routes/projects.d.ts +2 -0
- package/backend/dist/routes/projects.js +90 -0
- package/backend/dist/routes/responses.d.ts +20 -1
- package/backend/dist/routes/responses.js +65 -3
- package/backend/dist/routes/translation.d.ts +9 -0
- package/backend/dist/routes/translation.js +155 -0
- package/backend/dist/server.d.ts +0 -15
- package/backend/dist/server.js +388 -105
- package/backend/dist/session/resp-store.d.ts +18 -49
- package/backend/dist/session/resp-store.js +114 -122
- package/backend/dist/session/session-manager.d.ts +237 -81
- package/backend/dist/session/session-manager.js +445 -180
- package/backend/dist/session/session-row.d.ts +157 -0
- package/backend/dist/session/session-row.js +120 -0
- package/backend/dist/surfaces/anthropic.d.ts +1 -15
- package/backend/dist/surfaces/anthropic.js +63 -44
- package/backend/dist/surfaces/chat-pipeline.d.ts +8 -4
- package/backend/dist/surfaces/chat-pipeline.js +102 -35
- package/backend/dist/surfaces/chat.d.ts +1 -9
- package/backend/dist/surfaces/chat.js +52 -29
- package/backend/dist/surfaces/decision-pipeline.js +26 -18
- package/backend/dist/surfaces/gateway-chat.d.ts +53 -0
- package/backend/dist/surfaces/gateway-chat.js +204 -0
- package/backend/dist/surfaces/ocr-headers.d.ts +25 -4
- package/backend/dist/surfaces/ocr-headers.js +52 -6
- package/backend/dist/surfaces/responses.d.ts +9 -1
- package/backend/dist/surfaces/responses.js +141 -141
- package/backend/dist/surfaces/systemone-probe.js +1 -1
- package/backend/dist/surfaces/systemone.d.ts +1 -1
- package/backend/dist/surfaces/systemone.js +1 -1
- package/backend/dist/surfaces/table.d.ts +15 -0
- package/backend/dist/surfaces/table.js +15 -0
- package/backend/dist/surfaces/transport-backpressure.d.ts +46 -0
- package/backend/dist/surfaces/transport-backpressure.js +122 -0
- package/backend/dist/surfaces/transport-fastify.js +92 -21
- package/backend/dist/surfaces/transport-node-http.js +92 -18
- package/backend/dist/surfaces/types.d.ts +74 -12
- package/backend/dist/trace/persist.d.ts +5 -0
- package/backend/dist/trace/persist.js +185 -24
- package/backend/dist/trace/tracker.d.ts +153 -16
- package/backend/dist/trace/tracker.js +77 -27
- package/backend/dist/translation/index.d.ts +151 -0
- package/backend/dist/translation/index.js +735 -0
- package/backend/dist/types/openai.d.ts +82 -1
- package/backend/dist/types/router.d.ts +71 -6
- package/backend/dist/types/router.js +33 -1
- package/backend/dist/update/check.d.ts +43 -0
- package/backend/dist/update/check.js +126 -0
- package/backend/dist/utils/chat-sse.d.ts +2 -22
- package/backend/dist/utils/chat-sse.js +1 -69
- package/backend/dist/utils/chat-stream.d.ts +2 -1
- package/backend/dist/utils/client-envelope.d.ts +108 -0
- package/backend/dist/utils/client-envelope.js +305 -0
- package/backend/dist/utils/event-ring.d.ts +8 -1
- package/backend/dist/utils/event-ring.js +13 -5
- package/backend/dist/utils/harness-profiles.d.ts +51 -0
- package/backend/dist/utils/harness-profiles.js +70 -0
- package/backend/dist/utils/percentile.d.ts +16 -0
- package/backend/dist/utils/percentile.js +29 -0
- package/backend/dist/utils/popularity.d.ts +4 -0
- package/backend/dist/utils/popularity.js +33 -0
- package/backend/dist/utils/probe-interval.d.ts +12 -0
- package/backend/dist/utils/probe-interval.js +16 -0
- package/backend/dist/utils/proxy-node.d.ts +13 -0
- package/backend/dist/utils/proxy-node.js +471 -0
- package/backend/dist/utils/proxy.d.ts +12 -0
- package/backend/dist/utils/proxy.js +44 -4
- package/backend/dist/utils/run-command.d.ts +42 -0
- package/backend/dist/utils/run-command.js +93 -0
- package/backend/dist/utils/self-url.d.ts +13 -0
- package/backend/dist/utils/self-url.js +90 -2
- package/backend/dist/utils/semver.d.ts +22 -0
- package/backend/dist/utils/semver.js +75 -0
- package/backend/dist/utils/stream-relay.d.ts +35 -0
- package/backend/dist/utils/stream-relay.js +1 -0
- package/backend/dist/utils/upstream-url-guard.d.ts +15 -0
- package/backend/dist/utils/upstream-url-guard.js +107 -0
- package/backend/dist/validator/parser.d.ts +2 -5
- package/backend/dist/validator/parser.js +12 -16
- package/backend/dist/validator/schema-assertion.d.ts +3 -2
- package/backend/dist/validator/schema-assertion.js +53 -8
- package/bin/ocr.js +2 -2
- package/frontend/dist/assets/index-CLvxJjp_.js +1476 -0
- package/frontend/dist/assets/index-CQSLGFTV.css +1 -0
- package/frontend/dist/assets/qoder.color-tVX5GCcD.svg +5 -0
- package/frontend/dist/index.html +2 -2
- package/frontend/dist/provider-logos/302ai.svg +7 -0
- package/frontend/dist/provider-logos/NOTICE.txt +39 -0
- package/frontend/dist/provider-logos/abacus.svg +14 -0
- package/frontend/dist/provider-logos/abliteration-ai.svg +6 -0
- package/frontend/dist/provider-logos/above.svg +3 -0
- package/frontend/dist/provider-logos/agentrouter.svg +4 -0
- package/frontend/dist/provider-logos/agnes.svg +1 -0
- package/frontend/dist/provider-logos/ai-router.svg +5 -0
- package/frontend/dist/provider-logos/ai21.svg +3 -0
- package/frontend/dist/provider-logos/aiand.svg +4 -0
- package/frontend/dist/provider-logos/aihubmix.svg +3 -0
- package/frontend/dist/provider-logos/aimlapi.svg +3 -0
- package/frontend/dist/provider-logos/ainetcafe.svg +1 -0
- package/frontend/dist/provider-logos/aixy.svg +4 -0
- package/frontend/dist/provider-logos/aki-io.svg +8 -0
- package/frontend/dist/provider-logos/alibaba-cn.svg +3 -0
- package/frontend/dist/provider-logos/alibaba-coding-plan-cn.svg +3 -0
- package/frontend/dist/provider-logos/alibaba-coding-plan.svg +3 -0
- package/frontend/dist/provider-logos/alibaba-token-plan-cn.svg +1 -0
- package/frontend/dist/provider-logos/alibaba-token-plan.svg +1 -0
- package/frontend/dist/provider-logos/alibaba.svg +3 -0
- package/frontend/dist/provider-logos/amazon-bedrock.svg +3 -0
- package/frontend/dist/provider-logos/ambient.svg +3 -0
- package/frontend/dist/provider-logos/amd.svg +3 -0
- package/frontend/dist/provider-logos/anthropic.svg +3 -0
- package/frontend/dist/provider-logos/anyapi.svg +3 -0
- package/frontend/dist/provider-logos/arcee.svg +3 -0
- package/frontend/dist/provider-logos/atomic-chat.svg +1 -0
- package/frontend/dist/provider-logos/auriko.svg +6 -0
- package/frontend/dist/provider-logos/azure-cognitive-services.svg +3 -0
- package/frontend/dist/provider-logos/azure.svg +3 -0
- package/frontend/dist/provider-logos/bailing.svg +3 -0
- package/frontend/dist/provider-logos/baseten.svg +3 -0
- package/frontend/dist/provider-logos/bee.svg +1 -0
- package/frontend/dist/provider-logos/berget.svg +3 -0
- package/frontend/dist/provider-logos/blueclaw.svg +3 -0
- package/frontend/dist/provider-logos/bothub.svg +33 -0
- package/frontend/dist/provider-logos/boundless.svg +12 -0
- package/frontend/dist/provider-logos/cerebras.svg +4 -0
- package/frontend/dist/provider-logos/chutes.svg +24 -0
- package/frontend/dist/provider-logos/clarifai.svg +3 -0
- package/frontend/dist/provider-logos/claudinio.svg +19 -0
- package/frontend/dist/provider-logos/cline-pass.svg +24 -0
- package/frontend/dist/provider-logos/cloudferro-sherlock.svg +5 -0
- package/frontend/dist/provider-logos/cloudflare-ai-gateway.svg +4 -0
- package/frontend/dist/provider-logos/cloudflare-workers-ai.svg +4 -0
- package/frontend/dist/provider-logos/cohere.svg +5 -0
- package/frontend/dist/provider-logos/commandcode.svg +11 -0
- package/frontend/dist/provider-logos/coralbricks.svg +6 -0
- package/frontend/dist/provider-logos/cortecs.svg +24 -0
- package/frontend/dist/provider-logos/crossmodel.svg +5 -0
- package/frontend/dist/provider-logos/crusoe.svg +23 -0
- package/frontend/dist/provider-logos/daoxe.svg +3 -0
- package/frontend/dist/provider-logos/databricks.svg +3 -0
- package/frontend/dist/provider-logos/deepinfra.svg +4 -0
- package/frontend/dist/provider-logos/deepseek.svg +3 -0
- package/frontend/dist/provider-logos/digitalocean.svg +6 -0
- package/frontend/dist/provider-logos/dinference.svg +1 -0
- package/frontend/dist/provider-logos/drun.svg +8 -0
- package/frontend/dist/provider-logos/ebcloud.svg +8 -0
- package/frontend/dist/provider-logos/echo.svg +7 -0
- package/frontend/dist/provider-logos/edenai.svg +8 -0
- package/frontend/dist/provider-logos/empiriolabs.svg +1 -0
- package/frontend/dist/provider-logos/engy.svg +1 -0
- package/frontend/dist/provider-logos/evroc.svg +3 -0
- package/frontend/dist/provider-logos/fastrouter.svg +3 -0
- package/frontend/dist/provider-logos/fireworks-ai.svg +3 -0
- package/frontend/dist/provider-logos/freemodel.svg +3 -0
- package/frontend/dist/provider-logos/friendli.svg +3 -0
- package/frontend/dist/provider-logos/frogbot.svg +36 -0
- package/frontend/dist/provider-logos/github-copilot.svg +3 -0
- package/frontend/dist/provider-logos/gitlab.svg +3 -0
- package/frontend/dist/provider-logos/gmicloud.svg +24 -0
- package/frontend/dist/provider-logos/google-vertex-anthropic.svg +10 -0
- package/frontend/dist/provider-logos/google-vertex.svg +10 -0
- package/frontend/dist/provider-logos/google.svg +3 -0
- package/frontend/dist/provider-logos/greenpt.svg +6 -0
- package/frontend/dist/provider-logos/groq.svg +3 -0
- package/frontend/dist/provider-logos/helicone.svg +6 -0
- package/frontend/dist/provider-logos/hetzner.svg +3 -0
- package/frontend/dist/provider-logos/hopper.svg +4 -0
- package/frontend/dist/provider-logos/hpc-ai.svg +446 -0
- package/frontend/dist/provider-logos/huggingface.svg +3 -0
- package/frontend/dist/provider-logos/hyper.svg +20 -0
- package/frontend/dist/provider-logos/impossibl.svg +3 -0
- package/frontend/dist/provider-logos/inception.svg +14 -0
- package/frontend/dist/provider-logos/inceptron.svg +14 -0
- package/frontend/dist/provider-logos/inco.svg +3 -0
- package/frontend/dist/provider-logos/infer.svg +4 -0
- package/frontend/dist/provider-logos/inference.svg +3 -0
- package/frontend/dist/provider-logos/inferx.svg +5 -0
- package/frontend/dist/provider-logos/infomaniak.svg +3 -0
- package/frontend/dist/provider-logos/io-net.svg +5 -0
- package/frontend/dist/provider-logos/iteracompute.svg +7 -0
- package/frontend/dist/provider-logos/jalapeno.svg +8 -0
- package/frontend/dist/provider-logos/jiekou.svg +4 -0
- package/frontend/dist/provider-logos/kenari.svg +4 -0
- package/frontend/dist/provider-logos/kilo.svg +4 -0
- package/frontend/dist/provider-logos/kimi-code-plan-cn.svg +3 -0
- package/frontend/dist/provider-logos/kimi-code-plan-global.svg +3 -0
- package/frontend/dist/provider-logos/klokintegration.svg +11 -0
- package/frontend/dist/provider-logos/kosmik.svg +28 -0
- package/frontend/dist/provider-logos/kuae-cloud-coding-plan.svg +3 -0
- package/frontend/dist/provider-logos/lilac.svg +6 -0
- package/frontend/dist/provider-logos/liquid.svg +1 -0
- package/frontend/dist/provider-logos/llmgateway-providers.svg +6 -0
- package/frontend/dist/provider-logos/llmgateway.svg +6 -0
- package/frontend/dist/provider-logos/llmtech.svg +6 -0
- package/frontend/dist/provider-logos/llmtr.svg +12 -0
- package/frontend/dist/provider-logos/lmstudio.svg +3 -0
- package/frontend/dist/provider-logos/longcat.svg +6 -0
- package/frontend/dist/provider-logos/lowrouter.svg +8 -0
- package/frontend/dist/provider-logos/lucidquery.svg +3 -0
- package/frontend/dist/provider-logos/lynkr.svg +1 -0
- package/frontend/dist/provider-logos/meganova.svg +3 -0
- package/frontend/dist/provider-logos/melious.svg +3 -0
- package/frontend/dist/provider-logos/merge-gateway.svg +4 -0
- package/frontend/dist/provider-logos/meta.svg +3 -0
- package/frontend/dist/provider-logos/minimax-cn-coding-plan.svg +3 -0
- package/frontend/dist/provider-logos/minimax-cn.svg +3 -0
- package/frontend/dist/provider-logos/minimax-coding-plan.svg +3 -0
- package/frontend/dist/provider-logos/minimax.svg +3 -0
- package/frontend/dist/provider-logos/mistral.svg +3 -0
- package/frontend/dist/provider-logos/mixlayer.svg +9 -0
- package/frontend/dist/provider-logos/moark.svg +3 -0
- package/frontend/dist/provider-logos/modal.svg +3 -0
- package/frontend/dist/provider-logos/model-oracle-ai.svg +11 -0
- package/frontend/dist/provider-logos/modelis.svg +1 -0
- package/frontend/dist/provider-logos/modelscope.svg +5 -0
- package/frontend/dist/provider-logos/modular.svg +3 -0
- package/frontend/dist/provider-logos/moonshotai-cn.svg +3 -0
- package/frontend/dist/provider-logos/moonshotai.svg +3 -0
- package/frontend/dist/provider-logos/morph.svg +24 -0
- package/frontend/dist/provider-logos/munito-eu.svg +1 -0
- package/frontend/dist/provider-logos/munito.svg +1 -0
- package/frontend/dist/provider-logos/nan.svg +1 -0
- package/frontend/dist/provider-logos/nano-gpt.svg +3 -0
- package/frontend/dist/provider-logos/nearai.svg +1 -0
- package/frontend/dist/provider-logos/nebius.svg +4 -0
- package/frontend/dist/provider-logos/neon.svg +3 -0
- package/frontend/dist/provider-logos/neosmith.svg +6 -0
- package/frontend/dist/provider-logos/neuralwatt.svg +27 -0
- package/frontend/dist/provider-logos/nova.svg +3 -0
- package/frontend/dist/provider-logos/novita-ai.svg +10 -0
- package/frontend/dist/provider-logos/nvidia.svg +3 -0
- package/frontend/dist/provider-logos/oci.svg +3 -0
- package/frontend/dist/provider-logos/ofox.svg +5 -0
- package/frontend/dist/provider-logos/ollama-cloud.svg +7 -0
- package/frontend/dist/provider-logos/openai.svg +3 -0
- package/frontend/dist/provider-logos/opencode-go.svg +4 -0
- package/frontend/dist/provider-logos/opencode.svg +4 -0
- package/frontend/dist/provider-logos/openreason.svg +8 -0
- package/frontend/dist/provider-logos/openrouter.svg +5 -0
- package/frontend/dist/provider-logos/opper.svg +3 -0
- package/frontend/dist/provider-logos/orcarouter.svg +2 -0
- package/frontend/dist/provider-logos/ovhcloud.svg +3 -0
- package/frontend/dist/provider-logos/pareto.svg +5 -0
- package/frontend/dist/provider-logos/pendra.svg +10 -0
- package/frontend/dist/provider-logos/perplexity-agent.svg +3 -0
- package/frontend/dist/provider-logos/perplexity.svg +3 -0
- package/frontend/dist/provider-logos/pioneer.svg +3 -0
- package/frontend/dist/provider-logos/poe.svg +7 -0
- package/frontend/dist/provider-logos/poolside.svg +3 -0
- package/frontend/dist/provider-logos/prime.svg +7 -0
- package/frontend/dist/provider-logos/privatemode-ai.svg +5 -0
- package/frontend/dist/provider-logos/qihang-ai.svg +9 -0
- package/frontend/dist/provider-logos/qiniu-ai.svg +7 -0
- package/frontend/dist/provider-logos/qvac.svg +6 -0
- package/frontend/dist/provider-logos/reflection.svg +3 -0
- package/frontend/dist/provider-logos/regolo-ai.svg +46 -0
- package/frontend/dist/provider-logos/requesty.svg +24 -0
- package/frontend/dist/provider-logos/routing-run.svg +4 -0
- package/frontend/dist/provider-logos/runinfra.svg +10 -0
- package/frontend/dist/provider-logos/sakana.svg +24 -0
- package/frontend/dist/provider-logos/salad-cloud.svg +15 -0
- package/frontend/dist/provider-logos/sambanova.svg +26 -0
- package/frontend/dist/provider-logos/sap-ai-core.svg +24 -0
- package/frontend/dist/provider-logos/sarvam.svg +24 -0
- package/frontend/dist/provider-logos/scaleway.svg +5 -0
- package/frontend/dist/provider-logos/scnet-token-plan.svg +8 -0
- package/frontend/dist/provider-logos/scx-ai.svg +1 -0
- package/frontend/dist/provider-logos/sensenova.svg +18 -0
- package/frontend/dist/provider-logos/siliconflow-cn.svg +3 -0
- package/frontend/dist/provider-logos/siliconflow.svg +3 -0
- package/frontend/dist/provider-logos/snowflake-cortex.svg +3 -0
- package/frontend/dist/provider-logos/stackit.svg +4 -0
- package/frontend/dist/provider-logos/standardcompute.svg +5 -0
- package/frontend/dist/provider-logos/stepfun-ai-step-plan.svg +16 -0
- package/frontend/dist/provider-logos/stepfun-ai.svg +16 -0
- package/frontend/dist/provider-logos/stepfun-step-plan.svg +16 -0
- package/frontend/dist/provider-logos/stepfun.svg +16 -0
- package/frontend/dist/provider-logos/subconscious.svg +3 -0
- package/frontend/dist/provider-logos/submodel.svg +3 -0
- package/frontend/dist/provider-logos/synthetic.svg +24 -0
- package/frontend/dist/provider-logos/tempr.svg +4 -0
- package/frontend/dist/provider-logos/tencent-coding-plan.svg +5 -0
- package/frontend/dist/provider-logos/tencent-token-plan.svg +3 -0
- package/frontend/dist/provider-logos/tencent-tokenhub.svg +3 -0
- package/frontend/dist/provider-logos/tensorx.svg +6 -0
- package/frontend/dist/provider-logos/the-grid-ai.svg +14 -0
- package/frontend/dist/provider-logos/thinkingmachines.svg +3 -0
- package/frontend/dist/provider-logos/tinfoil.svg +3 -0
- package/frontend/dist/provider-logos/togetherai.svg +4 -0
- package/frontend/dist/provider-logos/tokengo.svg +3 -0
- package/frontend/dist/provider-logos/tokenrouter.svg +4 -0
- package/frontend/dist/provider-logos/trustedrouter.svg +4 -0
- package/frontend/dist/provider-logos/umans-ai-coding-plan.svg +29 -0
- package/frontend/dist/provider-logos/umans-ai.svg +29 -0
- package/frontend/dist/provider-logos/unorouter.svg +7 -0
- package/frontend/dist/provider-logos/upstage.svg +24 -0
- package/frontend/dist/provider-logos/vancine.svg +6 -0
- package/frontend/dist/provider-logos/venice.svg +4 -0
- package/frontend/dist/provider-logos/vercel.svg +3 -0
- package/frontend/dist/provider-logos/vispark.svg +3 -0
- package/frontend/dist/provider-logos/vivgrid.svg +4 -0
- package/frontend/dist/provider-logos/volcengine-coding-plan.svg +1 -0
- package/frontend/dist/provider-logos/volcengine.svg +1 -0
- package/frontend/dist/provider-logos/vultr.svg +6 -0
- package/frontend/dist/provider-logos/wafer.ai.svg +3 -0
- package/frontend/dist/provider-logos/wallaby.svg +4 -0
- package/frontend/dist/provider-logos/wally.svg +1 -0
- package/frontend/dist/provider-logos/wandb.svg +6 -0
- package/frontend/dist/provider-logos/watsonx.svg +5 -0
- package/frontend/dist/provider-logos/xai.svg +3 -0
- package/frontend/dist/provider-logos/xiaomi-token-plan-ams.svg +3 -0
- package/frontend/dist/provider-logos/xiaomi-token-plan-cn.svg +3 -0
- package/frontend/dist/provider-logos/xiaomi-token-plan-sgp.svg +3 -0
- package/frontend/dist/provider-logos/xiaomi.svg +3 -0
- package/frontend/dist/provider-logos/xpersona.svg +8 -0
- package/frontend/dist/provider-logos/zai-coding-plan.svg +3 -0
- package/frontend/dist/provider-logos/zai.svg +3 -0
- package/frontend/dist/provider-logos/zeldoc.svg +3 -0
- package/frontend/dist/provider-logos/zenifra.svg +4 -0
- package/frontend/dist/provider-logos/zenmux.svg +4 -0
- package/frontend/dist/provider-logos/zhipuai-coding-plan.svg +3 -0
- package/frontend/dist/provider-logos/zhipuai.svg +3 -0
- package/package.json +13 -5
- package/backend/dist/cli/clients/opencode-proxy.d.ts +0 -16
- package/backend/dist/cli/clients/opencode-proxy.js +0 -372
- package/backend/dist/forward-proxy/bypass.d.ts +0 -20
- package/backend/dist/forward-proxy/bypass.js +0 -28
- package/backend/dist/harness/adapters/amp.d.ts +0 -2
- package/backend/dist/harness/adapters/amp.js +0 -7
- package/backend/dist/harness/adapters/claude.d.ts +0 -2
- package/backend/dist/harness/adapters/claude.js +0 -7
- package/backend/dist/harness/adapters/cline.d.ts +0 -2
- package/backend/dist/harness/adapters/cline.js +0 -6
- package/backend/dist/harness/adapters/codex.d.ts +0 -2
- package/backend/dist/harness/adapters/codex.js +0 -6
- package/backend/dist/harness/adapters/cursor.d.ts +0 -5
- package/backend/dist/harness/adapters/cursor.js +0 -10
- package/backend/dist/harness/adapters/declarative.d.ts +0 -62
- package/backend/dist/harness/adapters/declarative.js +0 -202
- package/backend/dist/harness/adapters/dsh.d.ts +0 -5
- package/backend/dist/harness/adapters/dsh.js +0 -6
- package/backend/dist/harness/adapters/gemini-cli.d.ts +0 -2
- package/backend/dist/harness/adapters/gemini-cli.js +0 -7
- package/backend/dist/harness/adapters/github-copilot.d.ts +0 -5
- package/backend/dist/harness/adapters/github-copilot.js +0 -10
- package/backend/dist/harness/adapters/opencode.d.ts +0 -2
- package/backend/dist/harness/adapters/opencode.js +0 -55
- package/backend/dist/harness/adapters/pi.d.ts +0 -1
- package/backend/dist/harness/adapters/pi.js +0 -22
- package/backend/dist/harness/adapters/types.d.ts +0 -174
- package/backend/dist/harness/adapters/types.js +0 -12
- package/backend/dist/harness/adapters/universal.d.ts +0 -6
- package/backend/dist/harness/adapters/universal.js +0 -10
- package/backend/dist/harness/adapters/windsurf.d.ts +0 -2
- package/backend/dist/harness/adapters/windsurf.js +0 -10
- package/backend/dist/harness/adapters/zed.d.ts +0 -2
- package/backend/dist/harness/adapters/zed.js +0 -6
- package/backend/dist/harness/awesome-opencode.d.ts +0 -40
- package/backend/dist/harness/awesome-opencode.js +0 -75
- package/backend/dist/harness/browse.d.ts +0 -202
- package/backend/dist/harness/browse.js +0 -1214
- package/backend/dist/harness/inventory.d.ts +0 -10
- package/backend/dist/harness/opencode-cafe.d.ts +0 -40
- package/backend/dist/harness/opencode-cafe.js +0 -85
- package/backend/dist/harness/opencode-ecosystem.d.ts +0 -34
- package/backend/dist/harness/opencode-ecosystem.js +0 -246
- package/backend/dist/harness/pi-dev.d.ts +0 -81
- package/backend/dist/harness/pi-dev.js +0 -187
- package/backend/dist/harness/registry.js +0 -26
- package/backend/dist/harness/scopes.d.ts +0 -21
- package/backend/dist/harness/scopes.js +0 -22
- package/backend/dist/harness/skills-sh.d.ts +0 -109
- package/backend/dist/harness/skills-sh.js +0 -178
- package/backend/dist/harness/smithery.d.ts +0 -64
- package/backend/dist/harness/smithery.js +0 -146
- package/backend/dist/harness/sources/awesome-opencode.d.ts +0 -11
- package/backend/dist/harness/sources/awesome-opencode.js +0 -39
- package/backend/dist/harness/sources/mcp-official.d.ts +0 -2
- package/backend/dist/harness/sources/mcp-official.js +0 -110
- package/backend/dist/harness/sources/npm.d.ts +0 -2
- package/backend/dist/harness/sources/opencode-cafe.d.ts +0 -11
- package/backend/dist/harness/sources/opencode-cafe.js +0 -41
- package/backend/dist/harness/sources/smithery.d.ts +0 -2
- package/backend/dist/harness/sources/smithery.js +0 -81
- package/backend/dist/harness/writers/extension.d.ts +0 -116
- package/backend/dist/harness/writers/extension.js +0 -219
- package/backend/dist/harness/writers/mcp.d.ts +0 -72
- package/backend/dist/harness/writers/mcp.js +0 -195
- package/backend/dist/observability/trace-id.d.ts +0 -40
- package/backend/dist/observability/trace-id.js +0 -134
- package/frontend/dist/assets/index-1o7qI-KJ.css +0 -1
- package/frontend/dist/assets/index-DvXKvNxl.js +0 -962
- package/frontend/dist/assets/inter-cyrillic-800-normal-C7MGvYyJ.woff2 +0 -0
- package/frontend/dist/assets/inter-cyrillic-800-normal-CCHyn08d.woff +0 -0
- package/frontend/dist/assets/inter-cyrillic-ext-800-normal-BZOjs1Xv.woff2 +0 -0
- package/frontend/dist/assets/inter-cyrillic-ext-800-normal-Ca-gJeZY.woff +0 -0
- package/frontend/dist/assets/inter-greek-800-normal-BU00tryP.woff +0 -0
- package/frontend/dist/assets/inter-greek-800-normal-CLIouy3y.woff2 +0 -0
- package/frontend/dist/assets/inter-greek-ext-800-normal-B--PVpEC.woff2 +0 -0
- package/frontend/dist/assets/inter-greek-ext-800-normal-DUe57HfS.woff +0 -0
- package/frontend/dist/assets/inter-latin-800-normal-BYj_oED-.woff2 +0 -0
- package/frontend/dist/assets/inter-latin-800-normal-D1mf63XC.woff +0 -0
- package/frontend/dist/assets/inter-latin-ext-800-normal-BOMpwxm3.woff +0 -0
- package/frontend/dist/assets/inter-latin-ext-800-normal-DZJjya6U.woff2 +0 -0
- package/frontend/dist/assets/inter-vietnamese-800-normal-Cm7tD1pz.woff2 +0 -0
- package/frontend/dist/assets/inter-vietnamese-800-normal-DDlpr_Ee.woff +0 -0
- /package/backend/dist/harness/{adapters → host/adapters}/skills-paths.d.ts +0 -0
- /package/backend/dist/harness/{adapters → host/adapters}/skills-paths.js +0 -0
- /package/backend/dist/harness/{skill-md.d.ts → skill/skill-md.d.ts} +0 -0
- /package/backend/dist/harness/{skill-md.js → skill/skill-md.js} +0 -0
|
@@ -4,10 +4,183 @@
|
|
|
4
4
|
* runtime fallbacks, CLI fallbacks, cross-cutting guards). Import from here;
|
|
5
5
|
* never re-declare the literal locally.
|
|
6
6
|
*/
|
|
7
|
-
/**
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Gateway listen port when neither the `PORT` env lever nor a config.yaml
|
|
9
|
+
* `port:` names one. Matches the packaged/desktop sidecar default
|
|
10
|
+
* (`OCR_DEFAULT_PORT`, the Rust shell's `PORT`) so a bare CLI boot, the
|
|
11
|
+
* install, and the console's own snippets all advertise the same number.
|
|
12
|
+
* Deliberately NOT 3000: that is the default of half the JS dev tooling on a
|
|
13
|
+
* workstation (Grafana, CRA, Next, Rails…) and squats the port a gateway needs.
|
|
14
|
+
*/
|
|
15
|
+
export const DEFAULT_GATEWAY_PORT = 4000;
|
|
16
|
+
/**
|
|
17
|
+
* Listen port for `bun run dev` (scripts/dev.ts), pinned for the backend AND
|
|
18
|
+
* the Vite proxy so the two can never disagree. Kept apart from
|
|
19
|
+
* DEFAULT_GATEWAY_PORT on purpose: the dev stack must be able to run beside an
|
|
20
|
+
* installed desktop gateway, and 4700 sits outside the crowded 3000/4000/
|
|
21
|
+
* 5000/8000 dev ranges. Override with `PORT=` (bare `bun run dev` keeps this).
|
|
22
|
+
*/
|
|
23
|
+
export const DEFAULT_DEV_PORT = 4700;
|
|
24
|
+
/**
|
|
25
|
+
* BUFFERED provider call (`createCompletion`) wall-clock cap when
|
|
26
|
+
* `provider.timeoutMs` is unset — 30 MINUTES.
|
|
27
|
+
*
|
|
28
|
+
* Why 30 and not 2 h: a buffered call has NO progress signal, so the wall clock
|
|
29
|
+
* is its only bound — and while it runs it holds the request, a credential's
|
|
30
|
+
* concurrency/quota and the client's patience. A timeout is retriable, so the
|
|
31
|
+
* retry budget multiplies it (`retry.inplace.maxAttempts` + the failover hops
|
|
32
|
+
* ≈ 3 attempts worst case = 90 min for ONE client request). 30 min is already
|
|
33
|
+
* ~3× the ceiling vendors impose on non-stream calls (Anthropic's SDK floors
|
|
34
|
+
* its dynamic timeout at 10 min for a non-streaming large-max_tokens request),
|
|
35
|
+
* so it never truncates a legitimate answer while it still caps a dead socket.
|
|
36
|
+
* Override per provider with `provider.timeoutMs`.
|
|
37
|
+
*/
|
|
38
|
+
export const DEFAULT_PROVIDER_TIMEOUT_MS = 30 * 60 * 1000;
|
|
39
|
+
/**
|
|
40
|
+
* STREAMED provider leg (`createStream`) wall-clock cap when
|
|
41
|
+
* `provider.streamTimeoutMs` is unset — 60 MINUTES.
|
|
42
|
+
*
|
|
43
|
+
* Deliberately larger than the buffered cap: the streamed leg carries a
|
|
44
|
+
* progress signal, so liveness is enforced by `DEFAULT_STREAM_IDLE_TIMEOUT_MS`
|
|
45
|
+
* (silence), and the only thing this cap must clear is the largest legitimate
|
|
46
|
+
* single answer — about 128 k output tokens at a slow 50 tok/s ≈ 43 min. A
|
|
47
|
+
* stream still trickling bytes past an hour is a runaway loop, not an answer.
|
|
48
|
+
*/
|
|
49
|
+
export const DEFAULT_STREAM_TIMEOUT_MS = 60 * 60 * 1000;
|
|
50
|
+
/**
|
|
51
|
+
* SSE idle watchdog for the streamed provider leg: abort after this long
|
|
52
|
+
* WITHOUT A SINGLE BYTE (keep-alive comments and `ping` frames count as
|
|
53
|
+
* progress). Five minutes of total silence means a dead connection, while a
|
|
54
|
+
* long thinking phase that streams deltas never trips it — which is what lets
|
|
55
|
+
* the TOTAL cap above be an hour without letting a hung socket linger.
|
|
56
|
+
* Override per provider with `provider.streamIdleTimeoutMs`.
|
|
57
|
+
*/
|
|
58
|
+
export const DEFAULT_STREAM_IDLE_TIMEOUT_MS = 300_000;
|
|
59
|
+
/**
|
|
60
|
+
* Synthetic health-probe wall-clock bound (backend/src/resilience/health-prober.ts).
|
|
61
|
+
* A 1-token liveness ping should answer in seconds, and one hung upstream must
|
|
62
|
+
* never stall the whole sweep (the sweep's re-entry guard would otherwise stay
|
|
63
|
+
* held). Deliberately much shorter than DEFAULT_PROVIDER_TIMEOUT_MS: a probe is
|
|
64
|
+
* evidence, not serving work. Known consequence — a provider that legitimately
|
|
65
|
+
* needs longer than this for a 1-token completion (long prefill / cold queue)
|
|
66
|
+
* fails every probe; and because a probe timeout classifies SERVICE_UNAVAILABLE
|
|
67
|
+
* at model scope, every such cycle re-OPENs EVERY existing tuple of that model
|
|
68
|
+
* with a fresh escalated cooldown (not just the probed one).
|
|
69
|
+
* `circuitBreaker.activeProbing` stays off by default for exactly that reason.
|
|
70
|
+
*/
|
|
71
|
+
export const DEFAULT_PROBE_TIMEOUT_MS = 30_000;
|
|
9
72
|
/** Forward-proxy listen port when `forwardProxy.port` is unset. */
|
|
10
73
|
export const DEFAULT_FORWARD_PROXY_PORT = 4555;
|
|
74
|
+
/** Forward-proxy listen host when `forwardProxy.host` is unset (loopback only). */
|
|
75
|
+
export const DEFAULT_FORWARD_PROXY_HOST = '127.0.0.1';
|
|
76
|
+
/**
|
|
77
|
+
* Fresh-install rule table (ADR-0018, Revision 4): one catch-all — blind-tunnel
|
|
78
|
+
* every host and send it through the outbound proxy policy. Inert until BOTH
|
|
79
|
+
* `forwardProxy.enabled` and `proxy.enabled` are on (the listener ships
|
|
80
|
+
* disabled, so this seed routes nothing by itself).
|
|
81
|
+
*
|
|
82
|
+
* The seed is PASSTHROUGH, not intercept: interception is decided by the
|
|
83
|
+
* capability set (the hosts a live client-gateway plugin claims, plus rows an
|
|
84
|
+
* operator writes `ingress: intercept`), so a seed that decrypted everything
|
|
85
|
+
* made ~92% of a real machine's TLS a side effect of installing a gateway —
|
|
86
|
+
* with the trust store of every non-Bun TLS stack (IDEA's per-host
|
|
87
|
+
* `<config>/ssl/cacerts`, pinned clients) as the blast radius. `reject` is
|
|
88
|
+
* never seeded — shipping a blocklist would break traffic nobody asked to
|
|
89
|
+
* block.
|
|
90
|
+
*/
|
|
91
|
+
export const DEFAULT_FORWARD_PROXY_RULES = [
|
|
92
|
+
{ match: '*', ingress: 'passthrough', egress: 'proxy' },
|
|
93
|
+
];
|
|
94
|
+
/**
|
|
95
|
+
* Forward-proxy interception posture when `forwardProxy.intercept` is unset or
|
|
96
|
+
* unreadable (ADR-0018 Revision 4): decrypt only what a capability declares
|
|
97
|
+
* (plugin claims + explicit `ingress: intercept` rows); everything else is a
|
|
98
|
+
* blind tunnel. `'all'` is the explicit audit posture and is never a default.
|
|
99
|
+
*/
|
|
100
|
+
export const DEFAULT_FORWARD_PROXY_INTERCEPT = 'claims';
|
|
101
|
+
/** Forward-proxy access log: day-file retention for the persisted JSONL (auto-cleanup). */
|
|
102
|
+
export const DEFAULT_PROXY_ACCESS_LOG_PERSIST_DAYS = 7;
|
|
103
|
+
/**
|
|
104
|
+
* Forward-proxy access log: per-side INLINE capture cap when
|
|
105
|
+
* `forwardProxy.accessLog.bodyBytes` is unset (1 MiB). Bounds the memory ring
|
|
106
|
+
* and the JSONL rows — a browsing proxy otherwise buffers whole downloads in
|
|
107
|
+
* the heap. A body that outgrows the cap spills to a raw body file while
|
|
108
|
+
* persistence is on, so the default costs no captured bytes.
|
|
109
|
+
*/
|
|
110
|
+
export const DEFAULT_PROXY_ACCESS_LOG_BODY_BYTES = 1_048_576;
|
|
111
|
+
/** Day-file retention clamp bounds (config input is clamped into this range). */
|
|
112
|
+
export const PROXY_ACCESS_LOG_PERSIST_DAYS_MIN = 1;
|
|
113
|
+
export const PROXY_ACCESS_LOG_PERSIST_DAYS_MAX = 365;
|
|
114
|
+
/**
|
|
115
|
+
* Forward-proxy concurrent-socket cap when `forwardProxy.maxConnections` is
|
|
116
|
+
* unset. Every accepted socket holds an fd and, once MITM'd, a loopback peer —
|
|
117
|
+
* an unbounded listener is a local fd-exhaustion vector (one client can open
|
|
118
|
+
* CONNECTs faster than the OS reclaims them).
|
|
119
|
+
*/
|
|
120
|
+
export const DEFAULT_FORWARD_PROXY_MAX_CONNECTIONS = 512;
|
|
121
|
+
/** Connection-cap clamp bounds (config input is clamped into this range). */
|
|
122
|
+
export const FORWARD_PROXY_MAX_CONNECTIONS_MIN = 16;
|
|
123
|
+
export const FORWARD_PROXY_MAX_CONNECTIONS_MAX = 8192;
|
|
124
|
+
/**
|
|
125
|
+
* Mihomo (Clash Meta) mixed-port when `proxy.mihomo.mixedPort` is unset.
|
|
126
|
+
* The gateway's outbound calls use `http://127.0.0.1:<mixedPort>` while
|
|
127
|
+
* `proxy.mode` is `mihomo` (ADR-0022). 7890 is mihomo's own default.
|
|
128
|
+
*/
|
|
129
|
+
export const DEFAULT_MIHOMO_MIXED_PORT = 7890;
|
|
130
|
+
/** External-controller port when `proxy.mihomo.controllerPort` is unset. */
|
|
131
|
+
export const DEFAULT_MIHOMO_CONTROLLER_PORT = 9090;
|
|
132
|
+
/** Selector group written into the generated mihomo config. */
|
|
133
|
+
export const DEFAULT_MIHOMO_GROUP = 'PROXY';
|
|
134
|
+
/**
|
|
135
|
+
* Subscription refresh interval (seconds) when a subscription omits `interval`.
|
|
136
|
+
* Mihomo's proxy-provider `interval` is seconds. Clamped on load.
|
|
137
|
+
*/
|
|
138
|
+
export const DEFAULT_MIHOMO_SUB_INTERVAL_SEC = 3600;
|
|
139
|
+
export const MIHOMO_SUB_INTERVAL_MIN_SEC = 300;
|
|
140
|
+
export const MIHOMO_SUB_INTERVAL_MAX_SEC = 86_400;
|
|
141
|
+
/**
|
|
142
|
+
* Delay-test cadence (seconds) for an automatic group (`url-test` / `fallback`)
|
|
143
|
+
* when `proxy.mihomo.groupInterval` is unset. The interval is the failure
|
|
144
|
+
* DETECTION window, not just a display refresh: a member that dies stays
|
|
145
|
+
* selected — and its latency reading stays stale — until the next cycle, so a
|
|
146
|
+
* dead node costs up to one interval of real traffic. Mihomo's own 300 s
|
|
147
|
+
* default leaves that window at five minutes; the gateway ships one minute.
|
|
148
|
+
*/
|
|
149
|
+
export const DEFAULT_MIHOMO_GROUP_INTERVAL_SEC = 60;
|
|
150
|
+
/**
|
|
151
|
+
* Bounds for `proxy.mihomo.groupInterval`. Every cycle issues one real request
|
|
152
|
+
* per member THROUGH that member, so 30 s is the fastest cadence that still
|
|
153
|
+
* leaves a subscription-sized node list alone (mihomo's runner up is 10 s).
|
|
154
|
+
*/
|
|
155
|
+
export const MIHOMO_GROUP_INTERVAL_MIN_SEC = 30;
|
|
156
|
+
export const MIHOMO_GROUP_INTERVAL_MAX_SEC = 86_400;
|
|
157
|
+
/** How much faster (ms) a candidate must be before `url-test` switches. */
|
|
158
|
+
export const DEFAULT_MIHOMO_GROUP_TOLERANCE_MS = 50;
|
|
159
|
+
/** Upper bound for `proxy.mihomo.groupTolerance`: past a few seconds the
|
|
160
|
+
* tolerance stops describing jitter and starts describing an outage. */
|
|
161
|
+
export const MIHOMO_GROUP_TOLERANCE_MAX_MS = 5000;
|
|
162
|
+
/**
|
|
163
|
+
* URL mihomo fetches for group health checks and console delay tests. This is
|
|
164
|
+
* mihomo's own `DefaultTestURL` — a 204 endpoint (no body, one RTT) and the
|
|
165
|
+
* de-facto Clash-ecosystem convention — and it is configurable because it must
|
|
166
|
+
* be reachable from the machine AND through the nodes (a global default is not
|
|
167
|
+
* reachable everywhere).
|
|
168
|
+
*/
|
|
169
|
+
export const DEFAULT_MIHOMO_TEST_URL = 'https://www.gstatic.com/generate_204';
|
|
170
|
+
/**
|
|
171
|
+
* TCP reachability probe budget for the console's add-node dialog (ms). This
|
|
172
|
+
* is a connect() deadline, not a delay measurement: the node is not in the
|
|
173
|
+
* running config yet, so the core cannot route through it.
|
|
174
|
+
*/
|
|
175
|
+
export const MIHOMO_NODE_PROBE_TIMEOUT_MS = 5000;
|
|
176
|
+
/**
|
|
177
|
+
* Budget for one delay measurement through the core (ms), shared by the
|
|
178
|
+
* console's per-node, batch and URL probes and by the controller client's own
|
|
179
|
+
* default. It is the round-trip deadline AND the cut-off for calling a row
|
|
180
|
+
* "timeout": mihomo answers a dead node with delay 0, so a measurement can
|
|
181
|
+
* only be trusted when it finishes inside this budget.
|
|
182
|
+
*/
|
|
183
|
+
export const MIHOMO_DELAY_TIMEOUT_MS = 5000;
|
|
11
184
|
/** Headroom sidecar port (and base URL) when `compression.headroom.url` is unset. */
|
|
12
185
|
export const DEFAULT_HEADROOM_PORT = 8787;
|
|
13
186
|
export const DEFAULT_HEADROOM_URL = `http://127.0.0.1:${DEFAULT_HEADROOM_PORT}`;
|
|
@@ -19,6 +192,12 @@ export const DEFAULT_MAX_BODY_BYTES = 16_777_216;
|
|
|
19
192
|
/** Forward-proxy hang protection: upstream socket timeout applied until
|
|
20
193
|
* response headers arrive (blackholed-peer guard). */
|
|
21
194
|
export const FORWARD_PROXY_HANG_TIMEOUT_MS = 60_000;
|
|
195
|
+
/** Forward-proxy tunnel keepalive: TCP probe interval armed on both sides of
|
|
196
|
+
* every relayed connection (blind tunnels and `Upgrade:` relays). There is no
|
|
197
|
+
* application-level idle timeout — a tunnel may legitimately carry a silent
|
|
198
|
+
* protocol (IMAP IDLE) — so this is what reaps a peer that vanished without
|
|
199
|
+
* FIN/RST. */
|
|
200
|
+
export const FORWARD_PROXY_KEEPALIVE_MS = 60_000;
|
|
22
201
|
/** Layer-2 decision layer timeout when `classifier.layer2.timeoutMs` is unset. */
|
|
23
202
|
export const DEFAULT_LAYER2_TIMEOUT_MS = 5000;
|
|
24
203
|
/**
|
|
@@ -36,3 +215,13 @@ export const SMART_ASSIGN_TIMEOUT_MS = 60_000;
|
|
|
36
215
|
export const DEFAULT_DIRECTIVE_PREFIX = '@ocr-';
|
|
37
216
|
/** Route-entries LRU capacity when `routeEntries.maxEntries` is unset. */
|
|
38
217
|
export const DEFAULT_ROUTE_ENTRIES_MAX = 5000;
|
|
218
|
+
/** Capture-replay one-shot upstream hard deadline — streaming thinking
|
|
219
|
+
* models legitimately run minutes; 30s aborted healthy generations. */
|
|
220
|
+
export const DEFAULT_REPLAY_TIMEOUT_MS = 300_000;
|
|
221
|
+
/** Upper bound for a per-credential spread weight (integers >= 1; absence = 1).
|
|
222
|
+
* Weights only shape the NEW-session hash spread — they never touch the
|
|
223
|
+
* ratchet, failover order, or the sync boundary. */
|
|
224
|
+
export const CREDENTIAL_WEIGHT_MAX = 100;
|
|
225
|
+
/** Plugin package (.zip) upload cap — route bodyLimit and the handler's
|
|
226
|
+
* 413 check both read this so they can never desync. */
|
|
227
|
+
export const PLUGIN_PACKAGE_MAX_BYTES = 64 * 1024 * 1024;
|
|
@@ -20,10 +20,13 @@ configure({ useWebWorkers: false });
|
|
|
20
20
|
* a new machine a head start; data starts empty for
|
|
21
21
|
* everything else (book-set intuition: export carries KNOWLEDGE, not state).
|
|
22
22
|
*
|
|
23
|
-
* Redaction (default): values at
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
23
|
+
* Redaction (default): values at the admin key, apiKeys[*].key, credentialed
|
|
24
|
+
* proxy.url, the mihomo controller secret, subscription URLs and
|
|
25
|
+
* opencode.password become the sentinel '__REDACTED__' and
|
|
26
|
+
* their paths are listed in redactedPaths. Both the v1 grouped layout
|
|
27
|
+
* (client.adminKey / upstream.proxy.url / …) and the legacy flat v0 shape
|
|
28
|
+
* (adminApiKey / proxy.url / …) are covered. `?secrets=include` exports real
|
|
29
|
+
* values instead — an explicit operator decision, never the default.
|
|
27
30
|
*
|
|
28
31
|
* Import HARD guard — sentinel stripping: a redacted archive must not mint
|
|
29
32
|
* credentials with the literal apiKey "__REDACTED__", so parseAndValidate
|
|
@@ -48,10 +51,10 @@ export const ZIP_MAX_TOTAL_BYTES = 128 * 1024 * 1024;
|
|
|
48
51
|
export const IMPORT_BODY_LIMIT_BYTES = 64 * 1024 * 1024;
|
|
49
52
|
/** Envelope key → on-disk file within the env (relative to the env root).
|
|
50
53
|
*
|
|
51
|
-
* This is the
|
|
52
|
-
* custom model store
|
|
53
|
-
*
|
|
54
|
-
*
|
|
54
|
+
* This is the ONLY payload set, export and import alike. `catalog/custom.json`
|
|
55
|
+
* is gone with the custom model store it belonged to (ADR-0010 unification
|
|
56
|
+
* amendment): the file is read by nothing, so an archive carrying it is refused
|
|
57
|
+
* outright rather than half-imported.
|
|
55
58
|
*/
|
|
56
59
|
const PAYLOAD_EXPORT_FILES = [
|
|
57
60
|
{ key: 'data/layer2-decisions.jsonl', resolve: (p) => path.join(p.dataDir, 'layer2-decisions.jsonl') },
|
|
@@ -60,15 +63,6 @@ const PAYLOAD_EXPORT_FILES = [
|
|
|
60
63
|
// ocr.json itself stays excluded: a sig-keyed cache that rebuilds on boot.
|
|
61
64
|
{ key: 'catalog/overrides.json', resolve: (p) => path.join(p.catalogDir, 'overrides.json') },
|
|
62
65
|
];
|
|
63
|
-
/**
|
|
64
|
-
* Retired payload keys still accepted on IMPORT (never exported again).
|
|
65
|
-
*
|
|
66
|
-
* A book-set written before the model-book unification carries the custom
|
|
67
|
-
* store's `catalog/custom.json`; refusing it would make every such archive
|
|
68
|
-
* un-importable. Accepting it is inert (no code reads the file) and the next
|
|
69
|
-
* export drops it — a one-way migration, not a supported payload.
|
|
70
|
-
*/
|
|
71
|
-
const LEGACY_IMPORT_ONLY_KEYS = ['catalog/custom.json'];
|
|
72
66
|
/**
|
|
73
67
|
* The ONLY payload keys an envelope may carry (v1). Import enforces this
|
|
74
68
|
* WHITELIST, not merely traversal safety: `config.yaml` / `env.json` /
|
|
@@ -76,7 +70,7 @@ const LEGACY_IMPORT_ONLY_KEYS = ['catalog/custom.json'];
|
|
|
76
70
|
* config, flip the env type, or plant a valid session secret — a backdoored
|
|
77
71
|
* book-set (L3 review P1-1).
|
|
78
72
|
*/
|
|
79
|
-
export const PAYLOAD_IMPORT_KEYS =
|
|
73
|
+
export const PAYLOAD_IMPORT_KEYS = PAYLOAD_EXPORT_FILES.map((f) => f.key);
|
|
80
74
|
/** Only these zip entries can ever be extracted — and therefore written. */
|
|
81
75
|
const ZIP_ALLOWED_ENTRIES = new Set([
|
|
82
76
|
ZIP_MANIFEST_ENTRY,
|
|
@@ -117,9 +111,15 @@ export function buildEnvelope(envName, opts) {
|
|
|
117
111
|
throw new EnvArchiveError(`Environment "${envName}" config.yaml must be an object`);
|
|
118
112
|
}
|
|
119
113
|
// Session/login material never travels: drop the passwordHash key entirely
|
|
120
|
-
// (both modes — the hash belongs to THIS install's webauth chain).
|
|
121
|
-
|
|
122
|
-
|
|
114
|
+
// (both modes — the hash belongs to THIS install's webauth chain). The v1
|
|
115
|
+
// grouped layout (ADR-0016) keeps it at client.webAuth; legacy flat files
|
|
116
|
+
// keep it at webAuth — both shapes are handled below.
|
|
117
|
+
const at = (root, path) => path.split('.').reduce((c, s) => (c == null ? undefined : c[s]), root);
|
|
118
|
+
for (const wpath of ['webAuth', 'client.webAuth']) {
|
|
119
|
+
const w = at(parsed, wpath);
|
|
120
|
+
if (w && typeof w === 'object')
|
|
121
|
+
delete w.passwordHash;
|
|
122
|
+
}
|
|
123
123
|
// Retired hand-written def surfaces (ADR-0010) are dead config — strip them
|
|
124
124
|
// from the envelope entirely. Legacy files may still carry `providers:` /
|
|
125
125
|
// `systemoneUpstreams:` sections with plaintext API keys, and the redaction
|
|
@@ -142,19 +142,65 @@ export function buildEnvelope(envName, opts) {
|
|
|
142
142
|
redactedPaths.push(at);
|
|
143
143
|
}
|
|
144
144
|
};
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
145
|
+
// Redact BOTH vocabularies (ADR-0016): the v1 grouped disk layout stores
|
|
146
|
+
// the same secrets under client.* / upstream.* / ops.* paths, while a
|
|
147
|
+
// not-yet-migrated legacy (v0) file still uses the flat runtime shape.
|
|
148
|
+
// Each redaction fires only when the path actually exists.
|
|
149
|
+
const redactAt = (root, path) => {
|
|
150
|
+
const i = path.lastIndexOf('.');
|
|
151
|
+
const parent = i === -1 ? root : at(root, path.slice(0, i));
|
|
152
|
+
if (parent && typeof parent === 'object')
|
|
153
|
+
redact(parent, path.slice(i + 1), path);
|
|
154
|
+
};
|
|
155
|
+
// proxy.url carries inline credentials only when the userinfo part has a
|
|
150
156
|
// password — redact exactly then, leave plain URLs untouched (P2-1b).
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
157
|
+
for (const proxyPath of ['proxy.url', 'upstream.proxy.url']) {
|
|
158
|
+
const u = at(parsed, proxyPath);
|
|
159
|
+
if (typeof u === 'string' && /:\/\/[^/@\s]+:[^/@\s]+@/.test(u)) {
|
|
160
|
+
const i = proxyPath.lastIndexOf('.');
|
|
161
|
+
at(parsed, proxyPath.slice(0, i))[proxyPath.slice(i + 1)] = REDACTION_SENTINEL;
|
|
162
|
+
redactedPaths.push(proxyPath);
|
|
163
|
+
}
|
|
155
164
|
}
|
|
156
165
|
// opencode connector password (P2-1b).
|
|
157
|
-
|
|
166
|
+
redactAt(parsed, 'opencode.password');
|
|
167
|
+
redactAt(parsed, 'ops.opencode.password');
|
|
168
|
+
// Mihomo external-controller secret and subscription URLs (ADR-0022).
|
|
169
|
+
// A subscription URL routinely embeds a long-lived token. Both disk
|
|
170
|
+
// shapes are covered: flat runtime and the v1 upstream.proxy group.
|
|
171
|
+
for (const secretPath of ['proxy.mihomo.controllerSecret', 'upstream.proxy.mihomo.controllerSecret']) {
|
|
172
|
+
redactAt(parsed, secretPath);
|
|
173
|
+
}
|
|
174
|
+
for (const listPath of ['proxy.mihomo.subscriptions', 'upstream.proxy.mihomo.subscriptions']) {
|
|
175
|
+
const list = at(parsed, listPath);
|
|
176
|
+
if (Array.isArray(list)) {
|
|
177
|
+
list.forEach((item, i) => redact(item, 'url', `${listPath}[${i}].url`));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
// Manual nodes carry a password (ss/trojan/hysteria2/http/socks5) or a
|
|
181
|
+
// uuid (vmess/vless) — both are credentials, neither belongs in an archive.
|
|
182
|
+
// A raw pasted mapping holds the same secrets inside YAML text, so the
|
|
183
|
+
// whole mapping is redacted rather than parsed key-by-key.
|
|
184
|
+
for (const listPath of ['proxy.mihomo.manualNodes', 'upstream.proxy.mihomo.manualNodes']) {
|
|
185
|
+
const list = at(parsed, listPath);
|
|
186
|
+
if (Array.isArray(list)) {
|
|
187
|
+
list.forEach((item, i) => {
|
|
188
|
+
redact(item, 'password', `${listPath}[${i}].password`);
|
|
189
|
+
redact(item, 'uuid', `${listPath}[${i}].uuid`);
|
|
190
|
+
// hysteria2 obfuscation password: a credential like the rest.
|
|
191
|
+
redact(item, 'obfsPassword', `${listPath}[${i}].obfsPassword`);
|
|
192
|
+
redact(item, 'yaml', `${listPath}[${i}].yaml`);
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
redactAt(parsed, 'adminApiKey');
|
|
197
|
+
redactAt(parsed, 'client.adminKey');
|
|
198
|
+
for (const listPath of ['apiKeys', 'client.apiKeys']) {
|
|
199
|
+
const list = at(parsed, listPath);
|
|
200
|
+
if (Array.isArray(list)) {
|
|
201
|
+
list.forEach((k, i) => redact(k, 'key', `${listPath}[${i}].key`));
|
|
202
|
+
}
|
|
203
|
+
}
|
|
158
204
|
}
|
|
159
205
|
const payload = {};
|
|
160
206
|
// includePayload selects a SUBSET of the known payload files (unknown keys
|
|
@@ -523,13 +569,6 @@ export function parseAndValidateEnvelope(body, opts = {}) {
|
|
|
523
569
|
if (err)
|
|
524
570
|
return { ok: false, code: 400, error: err };
|
|
525
571
|
}
|
|
526
|
-
// Retired payload keys ride the validation chain above (their checksums must
|
|
527
|
-
// still verify, or a tampered archive would slip through) and are then
|
|
528
|
-
// DROPPED — never materialized. The custom model store is gone (ADR-0010
|
|
529
|
-
// unification amendment), so writing the file back would only plant dead data
|
|
530
|
-
// in the new environment and re-create residue the next export has to remove.
|
|
531
|
-
for (const key of LEGACY_IMPORT_ONLY_KEYS)
|
|
532
|
-
delete payload[key];
|
|
533
572
|
// Sanitizing chain: strip sentinels, then never-importable login material.
|
|
534
573
|
const stripped = stripSentinels(parsedConfig);
|
|
535
574
|
let sanitized = stripped.value;
|
|
@@ -77,6 +77,10 @@ export declare function resolveEnvName(): string;
|
|
|
77
77
|
export declare function peekEnvName(): string;
|
|
78
78
|
/** Where every state file of an environment lives (name defaults to the active env). */
|
|
79
79
|
export declare function getEnvPaths(name?: string): EnvPaths;
|
|
80
|
+
/** Test hook: drop the per-process env-path cache so a test that moves
|
|
81
|
+
* OCR_HOME between cases re-resolves every state path. Production code never
|
|
82
|
+
* calls this (switch = restart, by design). */
|
|
83
|
+
export declare function resetEnvPathsForTests(): void;
|
|
80
84
|
/**
|
|
81
85
|
* Base directory for relative paths stored in config (dataset paths, model
|
|
82
86
|
* paths): the env root <home>/envs/<name>, so a default-shaped
|
|
@@ -188,6 +188,15 @@ function computeEnvPaths(name) {
|
|
|
188
188
|
modelsDir: path.join(dir, 'models'),
|
|
189
189
|
catalogDir: path.join(dir, 'catalog'),
|
|
190
190
|
tracesDir: path.join(dir, 'traces'),
|
|
191
|
+
// Capture root (ADR-0024). The root name carries no version — the schema
|
|
192
|
+
// rides on every line (`schema: 2`, `CAPTURE_SCHEMA`) and the archive-line
|
|
193
|
+
// validator rejects anything else. Schema-1 archives are upgraded in place
|
|
194
|
+
// by the migrator chain at boot (capture/migrate/), including archives
|
|
195
|
+
// written before the gateway request ids (request boundary rebuilt off the
|
|
196
|
+
// recorded span sequence); a sequence the chain cannot close is repaired
|
|
197
|
+
// in place (orphan request with NO_TURN) — nothing is ever sealed away, so
|
|
198
|
+
// the live root stays the only copy and the cutover has no reader-side
|
|
199
|
+
// compatibility path.
|
|
191
200
|
captureDir: path.join(dir, 'capture'),
|
|
192
201
|
webauthSecretPath: path.join(dir, 'webauth-secret'),
|
|
193
202
|
};
|
|
@@ -243,6 +252,13 @@ export function getEnvPaths(name) {
|
|
|
243
252
|
}
|
|
244
253
|
return paths;
|
|
245
254
|
}
|
|
255
|
+
/** Test hook: drop the per-process env-path cache so a test that moves
|
|
256
|
+
* OCR_HOME between cases re-resolves every state path. Production code never
|
|
257
|
+
* calls this (switch = restart, by design). */
|
|
258
|
+
export function resetEnvPathsForTests() {
|
|
259
|
+
cachedEnvName = undefined;
|
|
260
|
+
cachedEnvPaths.clear();
|
|
261
|
+
}
|
|
246
262
|
/**
|
|
247
263
|
* Base directory for relative paths stored in config (dataset paths, model
|
|
248
264
|
* paths): the env root <home>/envs/<name>, so a default-shaped
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { RouterConfig, WebAuthConfig
|
|
1
|
+
import type { ProxyConfig, RateLimitConfig, RouterConfig, WebAuthConfig } from './types.js';
|
|
2
|
+
import { getRuntimeConfigRef, registerRuntimeConfigRef } from './runtime.js';
|
|
3
|
+
export { getRuntimeConfigRef, registerRuntimeConfigRef };
|
|
2
4
|
/**
|
|
3
5
|
* Inbound grace defaults: on by default (a sub-second blip should not become
|
|
4
6
|
* a user-visible 429 for a coding agent) but hard-capped — beyond a couple of
|
|
@@ -9,6 +11,23 @@ import { RouterConfig, WebAuthConfig, RateLimitConfig } from './types.js';
|
|
|
9
11
|
*/
|
|
10
12
|
export declare const DEFAULT_INBOUND_GRACE_MS = 1000;
|
|
11
13
|
export declare const MAX_INBOUND_GRACE_MS = 2000;
|
|
14
|
+
/**
|
|
15
|
+
* Cap on concurrent inbound grace-wait sleepers. Each sleeper parks a request
|
|
16
|
+
* (and its socket) for up to MAX_INBOUND_GRACE_MS; under a retry storm the
|
|
17
|
+
* denied-path sleepers would otherwise accumulate without bound. Beyond this
|
|
18
|
+
* many, the gate skips the grace wait and fast-fails 429 like any other
|
|
19
|
+
* denial — the window contract is unchanged, only the absorb-burst courtesy
|
|
20
|
+
* is shed under pressure.
|
|
21
|
+
*/
|
|
22
|
+
export declare const MAX_GRACE_SLEEPERS = 64;
|
|
23
|
+
/**
|
|
24
|
+
* Period between the limiter's durable window checkpoints (rateLimit.persist).
|
|
25
|
+
* The checkpoint is also flushed on graceful shutdown, so this interval is
|
|
26
|
+
* only the crash-loss bound: a hard kill loses at most the last interval of
|
|
27
|
+
* window events (the same honest-loss-bound pattern as the session-manager
|
|
28
|
+
* debounce).
|
|
29
|
+
*/
|
|
30
|
+
export declare const RATE_LIMIT_CHECKPOINT_INTERVAL_MS = 30000;
|
|
12
31
|
export declare function getConfigPath(customPath?: string): string;
|
|
13
32
|
/**
|
|
14
33
|
* WebAuth sanitizer: shallow-copies and strips anything that must never
|
|
@@ -26,6 +45,18 @@ export declare function sanitizeWebAuthInput(input: unknown): WebAuthConfig | un
|
|
|
26
45
|
* only an explicit `false` disables the ledger store. Exported for tests.
|
|
27
46
|
*/
|
|
28
47
|
export declare function resolveRateLimit(parsed: any): RateLimitConfig;
|
|
48
|
+
/** The one rule-type whitelist: the sanitizer validates against it, the
|
|
49
|
+
* subscription importer maps against it, and the console offers exactly it. */
|
|
50
|
+
export declare const MIHOMO_CUSTOM_RULE_TYPES: readonly ['DOMAIN', 'DOMAIN-SUFFIX', 'DOMAIN-KEYWORD', 'IP-CIDR', 'IP-CIDR6', 'DST-PORT', 'SRC-PORT', 'PROCESS-NAME', 'PROCESS-PATH'];
|
|
51
|
+
export declare const MIHOMO_CUSTOM_RULES_MAX = 256;
|
|
52
|
+
export declare function sanitizeProxyConfig(raw: unknown): ProxyConfig;
|
|
53
|
+
/**
|
|
54
|
+
* Deep-merge a proxy patch onto the stored section so a save that only
|
|
55
|
+
* names `url` / `includes` cannot wipe subscriptions or the controller secret.
|
|
56
|
+
* An explicit `subscriptions` / `manualNodes` array or `selectedNodes` object
|
|
57
|
+
* replaces that field; omitting `mihomo` keeps the stored sidecar section.
|
|
58
|
+
*/
|
|
59
|
+
export declare function mergeProxyConfig(current: ProxyConfig | undefined, incoming: ProxyConfig): ProxyConfig;
|
|
29
60
|
export declare function loadConfig(configPath?: string): RouterConfig;
|
|
30
61
|
/**
|
|
31
62
|
* Annotated default-config template: DEFAULT_CONFIG serialized through the
|
|
@@ -48,23 +79,28 @@ export declare function ensureDefaultConfigFile(): {
|
|
|
48
79
|
created: boolean;
|
|
49
80
|
path: string;
|
|
50
81
|
};
|
|
82
|
+
/**
|
|
83
|
+
* Boot-time config schema upgrade (ADR-0016): the ONE place a legacy/older
|
|
84
|
+
* config.yaml is migrated. Runs before the first loadConfig of the process;
|
|
85
|
+
* on success the on-disk file IS the current schema — the runtime read path
|
|
86
|
+
* (loadConfig) never migrates, it only asserts the version.
|
|
87
|
+
* - file version < current → migrate the chain, rewrite in place
|
|
88
|
+
* (`.bak` snapshot first — the raw page's rollback promise), warn the
|
|
89
|
+
* change list once.
|
|
90
|
+
* - file version > current → BOOT ERROR ("upgrade OCR"), same contract as
|
|
91
|
+
* the env-container import gate; fail-fast, never silent fallback.
|
|
92
|
+
* Idempotent: a current-version file is untouched.
|
|
93
|
+
*/
|
|
94
|
+
export declare function upgradeConfigFile(): {
|
|
95
|
+
migrated: boolean;
|
|
96
|
+
fromVersion: number;
|
|
97
|
+
};
|
|
51
98
|
export declare function getRawConfig(): string;
|
|
52
99
|
export declare function saveRawConfig(yamlContent: string): {
|
|
53
100
|
success: boolean;
|
|
54
101
|
error?: string;
|
|
55
102
|
};
|
|
56
|
-
/** Called once by createServer so config saves can refresh the boot snapshot. */
|
|
57
|
-
export declare function registerRuntimeConfigRef(cfg: RouterConfig): void;
|
|
58
|
-
/**
|
|
59
|
-
* Live config snapshot (createServer's object, hot-synced by saveConfig for
|
|
60
|
-
* the fields the running gateway reads per request: apiKeys, webAuth).
|
|
61
|
-
* Console-auth endpoints prefer it over a disk re-read so the gate and the
|
|
62
|
-
* credential checks can never disagree.
|
|
63
|
-
*/
|
|
64
|
-
export declare function getRuntimeConfigRef(): RouterConfig | undefined;
|
|
65
103
|
export declare function saveConfig(newConfig: Partial<RouterConfig>): {
|
|
66
104
|
success: boolean;
|
|
67
105
|
error?: string;
|
|
68
106
|
};
|
|
69
|
-
/** Attach file header + per-field comments; returns input untouched if it can't be parsed as a mapping. */
|
|
70
|
-
export declare function annotateYamlComments(yamlText: string): string;
|