omnicell-router 0.3.1 → 0.8.1
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 +172 -26
- package/backend/dist/cli/clients/base.js +150 -4
- package/backend/dist/cli/clients/claude.d.ts +2 -1
- package/backend/dist/cli/clients/claude.js +4 -3
- package/backend/dist/cli/clients/codex.d.ts +2 -1
- package/backend/dist/cli/clients/codex.js +4 -3
- package/backend/dist/cli/clients/core-adapters.d.ts +24 -0
- package/backend/dist/cli/clients/core-adapters.js +43 -0
- package/backend/dist/cli/clients/cursor-proxy.d.ts +88 -0
- package/backend/dist/cli/clients/cursor-proxy.js +421 -0
- package/backend/dist/cli/clients/dsh.d.ts +4 -2
- 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 +35 -19
- package/backend/dist/cli/clients/index.js +196 -72
- 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 +56 -0
- package/backend/dist/cli/clients/launcher.js +41 -0
- package/backend/dist/cli/clients/model-meta.js +1 -1
- package/backend/dist/cli/clients/omp.d.ts +9 -19
- package/backend/dist/cli/clients/omp.js +28 -155
- 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-proxy.d.ts +5 -10
- package/backend/dist/cli/clients/opencode-proxy.js +37 -58
- package/backend/dist/cli/clients/opencode.d.ts +6 -19
- package/backend/dist/cli/clients/opencode.js +32 -159
- package/backend/dist/cli/clients/pi.d.ts +6 -20
- package/backend/dist/cli/clients/pi.js +32 -221
- package/backend/dist/cli/clients/plugin-adapters.d.ts +22 -0
- package/backend/dist/cli/clients/plugin-adapters.js +65 -0
- package/backend/dist/cli/clients/qoder-proxy.d.ts +84 -0
- package/backend/dist/cli/clients/qoder-proxy.js +497 -0
- package/backend/dist/cli/clients/reserved.d.ts +47 -0
- package/backend/dist/cli/clients/reserved.js +55 -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 +289 -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 +114 -16
- package/backend/dist/cli/types.js +5 -4
- 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 +226 -0
- package/backend/dist/config/comments-zh.d.ts +10 -0
- package/backend/dist/config/comments-zh.js +211 -0
- package/backend/dist/config/defaults.d.ts +245 -2
- package/backend/dist/config/defaults.js +259 -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 +55 -12
- package/backend/dist/config/index.js +817 -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 +540 -121
- 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 +112 -0
- package/backend/dist/forward-proxy/egress.js +318 -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/ordered-relay.d.ts +29 -0
- package/backend/dist/forward-proxy/ordered-relay.js +46 -0
- 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 +195 -0
- package/backend/dist/forward-proxy/rules.js +327 -0
- package/backend/dist/forward-proxy/server.d.ts +102 -9
- package/backend/dist/forward-proxy/server.js +1504 -350
- 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 +112 -0
- package/backend/dist/forward-proxy/system-proxy.js +480 -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 +9 -4
- package/backend/dist/harness/{adapters → host/adapters}/index.js +31 -10
- 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 -3
- 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 +265 -80
- package/backend/dist/harness/types.d.ts +62 -17
- package/backend/dist/harness/types.js +1 -1
- package/backend/dist/index.js +183 -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/anthropic-stream.d.ts +18 -0
- package/backend/dist/ir/adapters/anthropic-stream.js +247 -0
- package/backend/dist/ir/adapters/anthropic.d.ts +29 -0
- package/backend/dist/ir/adapters/anthropic.js +788 -0
- package/backend/dist/ir/adapters/chat.d.ts +15 -0
- package/backend/dist/ir/adapters/chat.js +602 -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/google-stream.d.ts +22 -0
- package/backend/dist/ir/adapters/google-stream.js +242 -0
- package/backend/dist/ir/adapters/google.d.ts +9 -0
- package/backend/dist/ir/adapters/google.js +317 -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 +356 -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 +29 -0
- package/backend/dist/ir/adapters/openai-responses.js +695 -0
- package/backend/dist/ir/adapters/responses-output.d.ts +50 -0
- package/backend/dist/ir/adapters/responses-output.js +348 -0
- package/backend/dist/ir/adapters/responses-stream.d.ts +12 -0
- package/backend/dist/ir/adapters/responses-stream.js +178 -0
- package/backend/dist/ir/adapters/responses.d.ts +14 -0
- package/backend/dist/ir/adapters/responses.js +646 -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 +524 -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 +11 -10
- package/backend/dist/metrics/request-cost.js +18 -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 +90 -62
- package/backend/dist/observability/upstream-events.js +145 -64
- package/backend/dist/opencode/agents.d.ts +3 -2
- 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 +19 -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 +38 -2
- package/backend/dist/opencode/probe.d.ts +33 -6
- package/backend/dist/opencode/probe.js +96 -19
- 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 +16 -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 +18 -22
- package/backend/dist/pipeline/directives.js +129 -71
- package/backend/dist/pipeline/orchestrator.d.ts +70 -34
- package/backend/dist/pipeline/orchestrator.js +901 -405
- 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/pipeline/unresolved-model.d.ts +33 -0
- package/backend/dist/pipeline/unresolved-model.js +43 -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/catalog-def.d.ts +143 -0
- package/backend/dist/plugins/catalog-def.js +177 -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 +157 -0
- package/backend/dist/plugins/gateways.js +288 -0
- package/backend/dist/plugins/host.d.ts +240 -0
- package/backend/dist/plugins/host.js +1726 -0
- package/backend/dist/plugins/manifest.d.ts +152 -0
- package/backend/dist/plugins/manifest.js +713 -0
- package/backend/dist/plugins/pack.d.ts +32 -0
- package/backend/dist/plugins/pack.js +248 -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 +887 -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 +6 -4
- package/backend/dist/protocols/systemone/convert.js +78 -27
- package/backend/dist/protocols/systemone/decide.js +144 -57
- package/backend/dist/protocols/systemone/native.d.ts +1 -1
- package/backend/dist/protocols/systemone/native.js +6 -6
- package/backend/dist/providers/anthropic-messages.d.ts +12 -0
- package/backend/dist/providers/anthropic-messages.js +53 -0
- package/backend/dist/providers/anthropic.d.ts +7 -8
- package/backend/dist/providers/anthropic.js +36 -324
- package/backend/dist/providers/base.d.ts +18 -45
- package/backend/dist/providers/boot-direct.d.ts +20 -2
- package/backend/dist/providers/boot-direct.js +140 -61
- 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 -22
- package/backend/dist/providers/dispatch.js +49 -55
- package/backend/dist/providers/executors/anthropic-messages.d.ts +13 -0
- package/backend/dist/providers/executors/anthropic-messages.js +59 -0
- package/backend/dist/providers/executors/dispatch.d.ts +28 -0
- package/backend/dist/providers/executors/dispatch.js +101 -0
- package/backend/dist/providers/executors/google-gemini.d.ts +13 -0
- package/backend/dist/providers/executors/google-gemini.js +56 -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 +485 -0
- package/backend/dist/providers/executors/openai-chat.d.ts +14 -0
- package/backend/dist/providers/executors/openai-chat.js +92 -0
- package/backend/dist/providers/executors/openai-responses.d.ts +13 -0
- package/backend/dist/providers/executors/openai-responses.js +74 -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-gemini.d.ts +12 -0
- package/backend/dist/providers/google-gemini.js +50 -0
- package/backend/dist/providers/google.d.ts +7 -8
- package/backend/dist/providers/google.js +35 -308
- package/backend/dist/providers/http-json.d.ts +19 -0
- package/backend/dist/providers/http-json.js +104 -0
- package/backend/dist/providers/http-stream.d.ts +52 -0
- package/backend/dist/providers/http-stream.js +423 -0
- package/backend/dist/providers/member-match.d.ts +4 -5
- package/backend/dist/providers/member-match.js +4 -5
- package/backend/dist/providers/openai-chat.d.ts +13 -0
- package/backend/dist/providers/openai-chat.js +99 -0
- package/backend/dist/providers/openai-compatible.d.ts +7 -4
- package/backend/dist/providers/openai-compatible.js +71 -368
- package/backend/dist/providers/openai-responses.d.ts +12 -0
- package/backend/dist/providers/openai-responses.js +68 -0
- package/backend/dist/providers/opencode-proxy.d.ts +5 -5
- package/backend/dist/providers/opencode-proxy.js +49 -125
- package/backend/dist/providers/plugin-adapter.d.ts +9 -0
- package/backend/dist/providers/plugin-adapter.js +31 -0
- 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 +85 -44
- package/backend/dist/providers/registry.js +299 -162
- package/backend/dist/providers/responses.d.ts +7 -26
- package/backend/dist/providers/responses.js +45 -250
- package/backend/dist/providers/tool-markup-leak.d.ts +41 -0
- package/backend/dist/providers/tool-markup-leak.js +57 -0
- package/backend/dist/providers/tool-markup-recovery.d.ts +27 -0
- package/backend/dist/providers/tool-markup-recovery.js +786 -0
- package/backend/dist/providers/virtual-meta.d.ts +21 -2
- package/backend/dist/providers/virtual-meta.js +49 -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/asset-download.d.ts +54 -0
- package/backend/dist/proxy/asset-download.js +420 -0
- 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 +54 -0
- package/backend/dist/proxy/mihomo-binary.js +278 -0
- package/backend/dist/proxy/mihomo-client.d.ts +94 -0
- package/backend/dist/proxy/mihomo-client.js +308 -0
- package/backend/dist/proxy/mihomo-config.d.ts +40 -0
- package/backend/dist/proxy/mihomo-config.js +161 -0
- package/backend/dist/proxy/mihomo-geo.d.ts +87 -0
- package/backend/dist/proxy/mihomo-geo.js +213 -0
- package/backend/dist/proxy/mihomo-logs.d.ts +27 -0
- package/backend/dist/proxy/mihomo-logs.js +70 -0
- package/backend/dist/proxy/mihomo-pac.d.ts +37 -0
- package/backend/dist/proxy/mihomo-pac.js +75 -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 +81 -0
- package/backend/dist/proxy/mihomo-sidecar.js +637 -0
- package/backend/dist/quota/adapters/minimax.js +36 -13
- package/backend/dist/quota/cli-login.d.ts +8 -0
- package/backend/dist/quota/cli-login.js +18 -0
- package/backend/dist/quota/declarations.js +10 -0
- package/backend/dist/quota/dsl.js +18 -5
- package/backend/dist/quota/engine.d.ts +31 -3
- package/backend/dist/quota/engine.js +189 -30
- package/backend/dist/quota/prober.d.ts +13 -4
- package/backend/dist/quota/prober.js +20 -12
- package/backend/dist/quota/types.d.ts +87 -8
- package/backend/dist/quota/verdict.d.ts +35 -0
- package/backend/dist/quota/verdict.js +135 -0
- package/backend/dist/ratelimit/admission.d.ts +131 -0
- package/backend/dist/ratelimit/admission.js +233 -0
- package/backend/dist/ratelimit/rate-limiter.d.ts +119 -6
- package/backend/dist/ratelimit/rate-limiter.js +364 -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 +54 -7
- 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 +3 -3
- package/backend/dist/router/layer2-decision.js +26 -26
- 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 +2145 -259
- 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 +1162 -356
- package/backend/dist/routes/mihomo.d.ts +7 -0
- package/backend/dist/routes/mihomo.js +1187 -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 +107 -9
- package/backend/dist/routes/responses.js +378 -35
- package/backend/dist/routes/translation.d.ts +9 -0
- package/backend/dist/routes/translation.js +155 -0
- package/backend/dist/server.js +379 -73
- 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 +228 -81
- package/backend/dist/session/session-manager.js +449 -190
- package/backend/dist/session/session-row.d.ts +81 -2
- package/backend/dist/session/session-row.js +69 -1
- 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 +10 -6
- package/backend/dist/surfaces/chat-pipeline.js +119 -42
- package/backend/dist/surfaces/chat.d.ts +1 -9
- package/backend/dist/surfaces/chat.js +67 -29
- package/backend/dist/surfaces/decision-pipeline.js +32 -27
- package/backend/dist/surfaces/direct-forward.d.ts +3 -0
- package/backend/dist/surfaces/direct-forward.js +206 -0
- 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/rate-limit-response.d.ts +17 -0
- package/backend/dist/surfaces/rate-limit-response.js +57 -0
- 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 +85 -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 +185 -17
- package/backend/dist/trace/tracker.js +106 -31
- 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 +104 -17
- package/backend/dist/types/router.js +68 -7
- 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 +23 -9
- package/backend/dist/utils/chat-stream.js +46 -9
- 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 +12 -1
- package/backend/dist/utils/event-ring.js +17 -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 +58 -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 +19 -0
- package/backend/dist/utils/proxy.js +79 -14
- package/backend/dist/utils/retry-after.d.ts +21 -0
- package/backend/dist/utils/retry-after.js +36 -0
- 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-Cn3QMOQx.js +1487 -0
- package/frontend/dist/assets/index-DxZ9MHKB.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/budget/budget-manager.d.ts +0 -25
- package/backend/dist/budget/budget-manager.js +0 -54
- package/backend/dist/config/governance-limits.d.ts +0 -68
- package/backend/dist/config/governance-limits.js +0 -261
- package/backend/dist/flywheel/collector.d.ts +0 -74
- package/backend/dist/flywheel/collector.js +0 -235
- package/backend/dist/flywheel/dataset.d.ts +0 -130
- package/backend/dist/flywheel/dataset.js +0 -638
- package/backend/dist/flywheel/decision-capture.d.ts +0 -68
- package/backend/dist/flywheel/decision-capture.js +0 -85
- package/backend/dist/flywheel/prune.d.ts +0 -133
- package/backend/dist/flywheel/prune.js +0 -495
- package/backend/dist/flywheel/schema.d.ts +0 -108
- package/backend/dist/flywheel/schema.js +0 -117
- package/backend/dist/flywheel/trainer.d.ts +0 -84
- package/backend/dist/flywheel/trainer.js +0 -198
- 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 -8
- package/backend/dist/harness/adapters/claude.d.ts +0 -2
- package/backend/dist/harness/adapters/claude.js +0 -8
- package/backend/dist/harness/adapters/cline.d.ts +0 -2
- package/backend/dist/harness/adapters/cline.js +0 -8
- package/backend/dist/harness/adapters/codex.d.ts +0 -2
- package/backend/dist/harness/adapters/codex.js +0 -8
- package/backend/dist/harness/adapters/cursor.d.ts +0 -5
- package/backend/dist/harness/adapters/cursor.js +0 -11
- package/backend/dist/harness/adapters/declarative.d.ts +0 -64
- package/backend/dist/harness/adapters/declarative.js +0 -216
- 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 -8
- package/backend/dist/harness/adapters/github-copilot.d.ts +0 -5
- package/backend/dist/harness/adapters/github-copilot.js +0 -11
- package/backend/dist/harness/adapters/omp.d.ts +0 -11
- package/backend/dist/harness/adapters/omp.js +0 -22
- package/backend/dist/harness/adapters/opencode.d.ts +0 -2
- package/backend/dist/harness/adapters/opencode.js +0 -56
- package/backend/dist/harness/adapters/pi.d.ts +0 -1
- package/backend/dist/harness/adapters/pi.js +0 -23
- package/backend/dist/harness/adapters/types.d.ts +0 -189
- 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 -11
- package/backend/dist/harness/adapters/zed.d.ts +0 -2
- package/backend/dist/harness/adapters/zed.js +0 -8
- 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/opencode/catalog/custom-store.d.ts +0 -50
- package/backend/dist/opencode/catalog/custom-store.js +0 -144
- package/backend/dist/opencode/credentials/push.d.ts +0 -38
- package/backend/dist/opencode/credentials/push.js +0 -116
- package/backend/dist/opencode/credentials/reconcile.d.ts +0 -49
- package/backend/dist/opencode/credentials/reconcile.js +0 -216
- package/backend/dist/opencode/sync.d.ts +0 -29
- package/backend/dist/opencode/sync.js +0 -186
- package/backend/dist/pipeline/account-selection.d.ts +0 -101
- package/backend/dist/pipeline/account-selection.js +0 -112
- package/backend/dist/providers/systemone.d.ts +0 -29
- package/backend/dist/providers/systemone.js +0 -170
- package/backend/dist/ratelimit/duration.d.ts +0 -24
- package/backend/dist/ratelimit/duration.js +0 -43
- package/backend/dist/ratelimit/governance-runtime.d.ts +0 -121
- package/backend/dist/ratelimit/governance-runtime.js +0 -183
- package/backend/dist/ratelimit/index.d.ts +0 -4
- package/backend/dist/ratelimit/index.js +0 -4
- package/backend/dist/ratelimit/limiter.d.ts +0 -157
- package/backend/dist/ratelimit/limiter.js +0 -244
- package/backend/dist/ratelimit/sliding-window-counter.d.ts +0 -63
- package/backend/dist/ratelimit/sliding-window-counter.js +0 -103
- package/backend/dist/ratelimit/subject.d.ts +0 -26
- package/backend/dist/ratelimit/subject.js +0 -28
- package/backend/dist/resilience/account-state.d.ts +0 -84
- package/backend/dist/resilience/account-state.js +0 -228
- package/backend/dist/router/layer1-classifier.d.ts +0 -111
- package/backend/dist/router/layer1-classifier.js +0 -467
- package/backend/dist/router/layer2-judge.d.ts +0 -111
- package/backend/dist/router/layer2-judge.js +0 -373
- package/backend/dist/router/retry-escalation.d.ts +0 -89
- package/backend/dist/router/retry-escalation.js +0 -99
- package/backend/dist/routes/flywheel.d.ts +0 -3
- package/backend/dist/routes/flywheel.js +0 -268
- package/backend/dist/routes/systemone.d.ts +0 -3
- package/backend/dist/routes/systemone.js +0 -90
- package/backend/dist/surfaces/governance-envelope.d.ts +0 -34
- package/backend/dist/surfaces/governance-envelope.js +0 -47
- package/backend/dist/utils/token-estimator.d.ts +0 -7
- package/backend/dist/utils/token-estimator.js +0 -20
- package/frontend/dist/assets/index-B7GKsUyU.js +0 -982
- package/frontend/dist/assets/index-DLKLOkQJ.css +0 -1
- 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
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { MihomoCustomRule, MihomoGroupType, MihomoManualNode, MihomoSubscription } from '../config/types.js';
|
|
2
|
+
export { MANUAL_NODE_FORM_KEYS, manualNodeFields, manualNodeMapping } from './manual-node-spec.js';
|
|
3
|
+
export interface RenderMihomoInput {
|
|
4
|
+
mixedPort: number;
|
|
5
|
+
/** mihomo outbound mode; omitted = 'rule'. */
|
|
6
|
+
routingMode?: 'rule' | 'global' | 'direct';
|
|
7
|
+
controllerPort: number;
|
|
8
|
+
/** Required. Written into the file, never into a log line. */
|
|
9
|
+
secret: string;
|
|
10
|
+
group?: string;
|
|
11
|
+
/** Group picker mode; omitted = 'select' (the console's manual picker). */
|
|
12
|
+
groupType?: MihomoGroupType;
|
|
13
|
+
/** Delay-test cadence (seconds) for automatic groups; omitted = 300. */
|
|
14
|
+
groupInterval?: number;
|
|
15
|
+
/** `url-test` tolerance (ms); omitted = 50. */
|
|
16
|
+
groupTolerance?: number;
|
|
17
|
+
/** Health-check / delay-test URL; omitted = the factory default. */
|
|
18
|
+
testUrl?: string;
|
|
19
|
+
subscriptions?: MihomoSubscription[];
|
|
20
|
+
/** Hand-authored nodes, rendered into `proxies:` and added to the group. */
|
|
21
|
+
manualNodes?: MihomoManualNode[];
|
|
22
|
+
/** Operator-authored rules, rendered before the final MATCH. */
|
|
23
|
+
rules?: MihomoCustomRule[];
|
|
24
|
+
}
|
|
25
|
+
export interface RenderedMihomoConfig {
|
|
26
|
+
yaml: string;
|
|
27
|
+
group: string;
|
|
28
|
+
providerNames: string[];
|
|
29
|
+
}
|
|
30
|
+
/** Origin + path only. Query tokens and userinfo are dropped. */
|
|
31
|
+
export declare function redactSubscriptionUrl(url: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* One-line description safe for logs and the boot banner. Contains ports,
|
|
34
|
+
* the group name and the provider count — never the secret or a subscription URL.
|
|
35
|
+
*/
|
|
36
|
+
export declare function mihomoConfigSummary(rendered: RenderedMihomoConfig, ports: {
|
|
37
|
+
mixedPort: number;
|
|
38
|
+
controllerPort: number;
|
|
39
|
+
}): string;
|
|
40
|
+
export declare function renderMihomoConfig(input: RenderMihomoInput): RenderedMihomoConfig;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated mihomo (Clash Meta) config (ADR-0022).
|
|
3
|
+
*
|
|
4
|
+
* The file is the sidecar's runtime config, not the gateway's config.yaml.
|
|
5
|
+
* Subscription URLs and the controller secret belong in that file — mihomo
|
|
6
|
+
* cannot fetch a provider or authenticate its controller without them — and
|
|
7
|
+
* must not be copied into logs. `mihomoConfigSummary` is the only string
|
|
8
|
+
* that is safe to log.
|
|
9
|
+
*/
|
|
10
|
+
import { parse, stringify } from 'yaml';
|
|
11
|
+
import { DEFAULT_MIHOMO_GROUP, DEFAULT_MIHOMO_GROUP_INTERVAL_SEC, DEFAULT_MIHOMO_GROUP_TOLERANCE_MS, DEFAULT_MIHOMO_SUB_INTERVAL_SEC, DEFAULT_MIHOMO_TEST_URL, MIHOMO_GROUP_INTERVAL_MAX_SEC, MIHOMO_GROUP_INTERVAL_MIN_SEC, } from '../config/defaults.js';
|
|
12
|
+
import { manualNodeMapping } from './manual-node-spec.js';
|
|
13
|
+
// The field table in `manual-node-spec` owns both directions; these names stay
|
|
14
|
+
// re-exported here because the generated-config module is where callers look.
|
|
15
|
+
export { MANUAL_NODE_FORM_KEYS, manualNodeFields, manualNodeMapping } from './manual-node-spec.js';
|
|
16
|
+
/** Origin + path only. Query tokens and userinfo are dropped. */
|
|
17
|
+
export function redactSubscriptionUrl(url) {
|
|
18
|
+
try {
|
|
19
|
+
const parsed = new URL(url);
|
|
20
|
+
return `${parsed.origin}${parsed.pathname}`;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return 'invalid-subscription-url';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* One-line description safe for logs and the boot banner. Contains ports,
|
|
28
|
+
* the group name and the provider count — never the secret or a subscription URL.
|
|
29
|
+
*/
|
|
30
|
+
export function mihomoConfigSummary(rendered, ports) {
|
|
31
|
+
return `mixed=${ports.mixedPort} controller=${ports.controllerPort} group=${rendered.group} providers=${rendered.providerNames.length} secret=set`;
|
|
32
|
+
}
|
|
33
|
+
/** A raw pasted mapping is the operator's whole proxy definition: emit it
|
|
34
|
+
* verbatim (the sanitizer already canonicalized and validated its identity). */
|
|
35
|
+
function renderRawProxy(node) {
|
|
36
|
+
if (!node.yaml)
|
|
37
|
+
return null;
|
|
38
|
+
try {
|
|
39
|
+
const parsed = parse(node.yaml);
|
|
40
|
+
return parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : null;
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function renderManualProxy(node) {
|
|
47
|
+
return renderRawProxy(node) ?? manualNodeMapping(node);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Cadence written into the generated group AND its provider health-check. The
|
|
51
|
+
* interval bounds the failure-detection window (a dead member keeps serving
|
|
52
|
+
* traffic until the next cycle), so an explicit value is clamped to the same
|
|
53
|
+
* bounds the loader enforces — a hand-built input must not smuggle 0 s.
|
|
54
|
+
*/
|
|
55
|
+
function resolveGroupInterval(input) {
|
|
56
|
+
const raw = input.groupInterval;
|
|
57
|
+
if (typeof raw === 'number' && Number.isFinite(raw)) {
|
|
58
|
+
return Math.min(MIHOMO_GROUP_INTERVAL_MAX_SEC, Math.max(MIHOMO_GROUP_INTERVAL_MIN_SEC, Math.round(raw)));
|
|
59
|
+
}
|
|
60
|
+
return DEFAULT_MIHOMO_GROUP_INTERVAL_SEC;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The one proxy group the gateway generates. `select` keeps `DIRECT` as a
|
|
64
|
+
* manual escape hatch; the automatic modes must NOT — a direct route measures
|
|
65
|
+
* ~0 ms, so `url-test` would pick it every cycle and silently bypass the
|
|
66
|
+
* tunnel, and `fallback` would hand everything to it the moment a node failed.
|
|
67
|
+
* Manual nodes are concrete proxies, so they join every group type.
|
|
68
|
+
*/
|
|
69
|
+
function renderGroup(input, group, use, manualNames) {
|
|
70
|
+
const type = input.groupType ?? 'select';
|
|
71
|
+
if (type === 'select') {
|
|
72
|
+
return {
|
|
73
|
+
name: group,
|
|
74
|
+
type: 'select',
|
|
75
|
+
...(use.length ? { use } : {}),
|
|
76
|
+
proxies: [...manualNames, 'DIRECT'],
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
name: group,
|
|
81
|
+
type,
|
|
82
|
+
...(use.length ? { use } : {}),
|
|
83
|
+
...(manualNames.length ? { proxies: manualNames } : {}),
|
|
84
|
+
url: input.testUrl ?? DEFAULT_MIHOMO_TEST_URL,
|
|
85
|
+
interval: resolveGroupInterval(input),
|
|
86
|
+
...(type === 'url-test' ? { tolerance: input.groupTolerance ?? DEFAULT_MIHOMO_GROUP_TOLERANCE_MS } : {}),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* `TYPE,payload,target` rows, emitted BEFORE the catch-all so they can actually
|
|
91
|
+
* win. `PROXY` is a symbolic target here and becomes the live group name, so
|
|
92
|
+
* renaming the group never orphans a rule. IP rules carry `no-resolve`: without
|
|
93
|
+
* it every IP rule forces mihomo to resolve a candidate hostname first, which
|
|
94
|
+
* both costs a DNS round-trip and lets a resolved IP match a rule that the
|
|
95
|
+
* operator wrote against literal addresses. `GEOIP` deliberately does NOT carry
|
|
96
|
+
* it — matching a CONNECT hostname against the country database is the whole
|
|
97
|
+
* point. Geo payloads are normalized to the spelling mihomo expects (country
|
|
98
|
+
* codes upper-case, geosite categories lower-case) whatever casing the operator
|
|
99
|
+
* typed.
|
|
100
|
+
*/
|
|
101
|
+
function renderCustomRules(input) {
|
|
102
|
+
const group = input.group || DEFAULT_MIHOMO_GROUP;
|
|
103
|
+
const out = [];
|
|
104
|
+
for (const rule of input.rules ?? []) {
|
|
105
|
+
const target = rule.target === 'PROXY' ? group : rule.target;
|
|
106
|
+
const noResolve = rule.type === 'IP-CIDR' || rule.type === 'IP-CIDR6' ? ',no-resolve' : '';
|
|
107
|
+
const payload = rule.type === 'GEOIP'
|
|
108
|
+
? rule.payload.toUpperCase()
|
|
109
|
+
: rule.type === 'GEOSITE' ? rule.payload.toLowerCase() : rule.payload;
|
|
110
|
+
out.push(`${rule.type},${payload},${target}${noResolve}`);
|
|
111
|
+
}
|
|
112
|
+
return out;
|
|
113
|
+
}
|
|
114
|
+
export function renderMihomoConfig(input) {
|
|
115
|
+
if (!input.secret)
|
|
116
|
+
throw new Error('mihomo controller secret is required');
|
|
117
|
+
if (input.mixedPort === input.controllerPort) {
|
|
118
|
+
throw new Error('mihomo mixedPort and controllerPort must differ');
|
|
119
|
+
}
|
|
120
|
+
const group = input.group && input.group.trim() ? input.group.trim() : DEFAULT_MIHOMO_GROUP;
|
|
121
|
+
const providers = {};
|
|
122
|
+
const use = [];
|
|
123
|
+
for (const sub of input.subscriptions ?? []) {
|
|
124
|
+
if (sub.enabled === false)
|
|
125
|
+
continue;
|
|
126
|
+
providers[sub.id] = {
|
|
127
|
+
type: 'http',
|
|
128
|
+
url: sub.url,
|
|
129
|
+
interval: sub.interval ?? DEFAULT_MIHOMO_SUB_INTERVAL_SEC,
|
|
130
|
+
path: `./providers/${sub.id}.yaml`,
|
|
131
|
+
// Forces the download through one proxy/group instead of the rule set.
|
|
132
|
+
...(sub.proxy ? { proxy: sub.proxy } : {}),
|
|
133
|
+
// Disabled on purpose: the group's own url-test already walks every
|
|
134
|
+
// member, so a second provider-level probe would only double the test
|
|
135
|
+
// traffic. The cadence still comes from the shared resolver — the old
|
|
136
|
+
// literal 300 was a drift twin of the default constant.
|
|
137
|
+
'health-check': { enable: false, url: input.testUrl ?? DEFAULT_MIHOMO_TEST_URL, interval: resolveGroupInterval(input) },
|
|
138
|
+
};
|
|
139
|
+
use.push(sub.id);
|
|
140
|
+
}
|
|
141
|
+
const manual = input.manualNodes ?? [];
|
|
142
|
+
const proxies = manual.map(renderManualProxy);
|
|
143
|
+
const doc = {
|
|
144
|
+
'mixed-port': input.mixedPort,
|
|
145
|
+
'allow-lan': false,
|
|
146
|
+
'bind-address': '127.0.0.1',
|
|
147
|
+
mode: input.routingMode ?? 'rule',
|
|
148
|
+
'log-level': 'warning',
|
|
149
|
+
ipv6: false,
|
|
150
|
+
'external-controller': `127.0.0.1:${input.controllerPort}`,
|
|
151
|
+
secret: input.secret,
|
|
152
|
+
'unified-delay': true,
|
|
153
|
+
profile: { 'store-selected': true },
|
|
154
|
+
...(proxies.length ? { proxies } : {}),
|
|
155
|
+
'proxy-groups': [renderGroup(input, group, use, manual.map(node => node.name))],
|
|
156
|
+
rules: [...renderCustomRules(input), `MATCH,${group}`],
|
|
157
|
+
};
|
|
158
|
+
if (use.length)
|
|
159
|
+
doc['proxy-providers'] = providers;
|
|
160
|
+
return { yaml: stringify(doc), group, providerNames: use };
|
|
161
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { MihomoCustomRule } from '../config/types.js';
|
|
2
|
+
import type { OsProxyEndpoint } from '../forward-proxy/system-proxy.js';
|
|
3
|
+
export declare const MIHOMO_GEO_ASSETS: readonly [{
|
|
4
|
+
readonly key: "geoip";
|
|
5
|
+
readonly file: "geoip.metadb";
|
|
6
|
+
readonly url: "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.metadb";
|
|
7
|
+
}, {
|
|
8
|
+
readonly key: "geosite";
|
|
9
|
+
readonly file: "GeoSite.dat";
|
|
10
|
+
readonly url: "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat";
|
|
11
|
+
}];
|
|
12
|
+
export type MihomoGeoKey = typeof MIHOMO_GEO_ASSETS[number]['key'];
|
|
13
|
+
export interface MihomoGeoFileInfo {
|
|
14
|
+
key: MihomoGeoKey;
|
|
15
|
+
file: string;
|
|
16
|
+
exists: boolean;
|
|
17
|
+
size: number;
|
|
18
|
+
/** mtime (epoch ms) of the installed copy; absent while the file does not. */
|
|
19
|
+
updatedAt?: number;
|
|
20
|
+
/** Installed but older than `MIHOMO_GEO_STALE_DAYS` — advisory only. */
|
|
21
|
+
stale: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface MihomoGeoReport {
|
|
24
|
+
/** Both files exist and are non-empty — everything a geo rule needs. */
|
|
25
|
+
present: boolean;
|
|
26
|
+
files: MihomoGeoFileInfo[];
|
|
27
|
+
}
|
|
28
|
+
/** True when any row needs the geo databases. */
|
|
29
|
+
export declare function rulesNeedGeo(rules: MihomoCustomRule[] | undefined): boolean;
|
|
30
|
+
export declare function geoReport(dir: string): MihomoGeoReport;
|
|
31
|
+
export declare function geoAssetsPresent(dir: string): boolean;
|
|
32
|
+
/** Which egress the download takes (ADR-0022): the machine's own network or
|
|
33
|
+
* the Clash core's selected node. */
|
|
34
|
+
export type MihomoGeoLeg = 'machine' | 'node';
|
|
35
|
+
export interface GeoLegFetchOptions {
|
|
36
|
+
/** `node` leg only: the core's mixed port — the exit it already listens on. */
|
|
37
|
+
mixedPort?: number;
|
|
38
|
+
/** Test seam — a CI box's own OS settings are not the fixture. */
|
|
39
|
+
osProxyReader?: () => Promise<OsProxyEndpoint | undefined>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The proxy URL the machine leg should dial for `url`: the OS system proxy
|
|
43
|
+
* unless the host sits on its bypass list. `undefined` means connect directly.
|
|
44
|
+
*/
|
|
45
|
+
export declare function machineLegProxy(endpoint: OsProxyEndpoint | undefined, url: string): string | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* The fetch implementation the geo download runs on.
|
|
48
|
+
*
|
|
49
|
+
* - `machine` — the way this box's other applications leave: through the OS
|
|
50
|
+
* system proxy when one is enabled (bypass list honoured), directly when
|
|
51
|
+
* none is. Needs no running core. The check runs per request, so the
|
|
52
|
+
* redirect to `objects.githubusercontent.com` is judged on its own host.
|
|
53
|
+
* - `node` — through the core's mixed port, i.e. the operator's selected
|
|
54
|
+
* node. The caller must refuse this leg while the core is down; by the time
|
|
55
|
+
* a request lands here the core is expected to be listening.
|
|
56
|
+
*/
|
|
57
|
+
export declare function geoFetchForLeg(leg: MihomoGeoLeg, opts?: GeoLegFetchOptions): Promise<typeof fetch>;
|
|
58
|
+
export interface DownloadMihomoGeoOptions {
|
|
59
|
+
/** Test seam — suites never touch GitHub. */
|
|
60
|
+
fetchImpl?: typeof fetch;
|
|
61
|
+
/** Re-fetch files that already exist (the console's "sync" action). Without
|
|
62
|
+
* it a present file is kept, so a retry after a partial failure only
|
|
63
|
+
* fetches the missing one. */
|
|
64
|
+
refresh?: boolean;
|
|
65
|
+
/** Per-file byte progress of the WHOLE asset (resumed prefix included);
|
|
66
|
+
* `total` is 0 when the host sends no Content-Length. */
|
|
67
|
+
onProgress?: (file: MihomoGeoKey, downloaded: number, total: number) => void;
|
|
68
|
+
/** Cancels the transfer. The bytes written so far are kept for the next
|
|
69
|
+
* attempt, so closing the console tab pauses a geo sync rather than
|
|
70
|
+
* discarding it. */
|
|
71
|
+
signal?: AbortSignal;
|
|
72
|
+
}
|
|
73
|
+
export interface DownloadMihomoGeoResult {
|
|
74
|
+
ok: boolean;
|
|
75
|
+
present: boolean;
|
|
76
|
+
files: MihomoGeoFileInfo[];
|
|
77
|
+
error?: string;
|
|
78
|
+
code?: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Install the geo databases into the core's work directory. Existing non-empty
|
|
82
|
+
* files are kept unless `refresh` asks for replacement (a retry after a partial
|
|
83
|
+
* failure only fetches the missing one); a file that fails to download or write
|
|
84
|
+
* never replaces a working copy. Each asset is one critical section (ADR-0022):
|
|
85
|
+
* a second click waits instead of writing the same part file underneath it.
|
|
86
|
+
*/
|
|
87
|
+
export declare function downloadMihomoGeoAssets(dir: string, opts?: DownloadMihomoGeoOptions): Promise<DownloadMihomoGeoResult>;
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Geo databases for `GEOIP` / `GEOSITE` rules (ADR-0022).
|
|
3
|
+
*
|
|
4
|
+
* mihomo evaluates both types from data files in its work directory and
|
|
5
|
+
* downloads them itself while parsing its config — but a failed download
|
|
6
|
+
* (offline machine, blocked GitHub host) makes the core exit fatally, and the
|
|
7
|
+
* core is exactly the thing this gateway needs for its own outbound traffic.
|
|
8
|
+
* The gateway therefore installs the two files as an EXPLICIT action and both
|
|
9
|
+
* the rule save and the core start refuse a geo-rule config while they are
|
|
10
|
+
* missing, so the failure is a clear console message instead of a dead core.
|
|
11
|
+
* Once installed the files are used offline; mihomo never re-fetches them
|
|
12
|
+
* (the generated config leaves `geo-auto-update` off). Refreshing is an
|
|
13
|
+
* operator action with two egress legs: the machine's own network (OS system
|
|
14
|
+
* proxy when one is enabled, bypass list honoured) or the Clash node itself.
|
|
15
|
+
* Each asset streams through the shared resumable downloader
|
|
16
|
+
* (`proxy/asset-download.ts`), so an interrupted 8 MB database continues on the
|
|
17
|
+
* next click instead of starting from zero.
|
|
18
|
+
*/
|
|
19
|
+
import fs from 'node:fs';
|
|
20
|
+
import path from 'node:path';
|
|
21
|
+
import { MIHOMO_GEO_STALE_DAYS } from '../config/defaults.js';
|
|
22
|
+
import { osProxyBypasses, readOsProxyEndpoint } from '../forward-proxy/system-proxy.js';
|
|
23
|
+
import { renameWithRetry } from '../utils/atomic-write.js';
|
|
24
|
+
import { fetchViaProxy } from '../utils/proxy.js';
|
|
25
|
+
import { assetPartPaths, cleanupAssetPart, downloadAssetToFile, parseAssetDigest, withAssetLock } from './asset-download.js';
|
|
26
|
+
/** Release host shared with the binary installer (MetaCubeX publishes both). */
|
|
27
|
+
const GEO_DOWNLOAD_BASE = 'https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest';
|
|
28
|
+
const MAX_GEO_BYTES = 64 * 1024 * 1024;
|
|
29
|
+
const USER_AGENT = 'omnicell-router';
|
|
30
|
+
/** MetaDB/GeoSite release host: `…/latest/geoip.metadb.sha256sum` is a
|
|
31
|
+
* ~70-byte text file beside each database. The published digest comes from the
|
|
32
|
+
* same host as the database itself, so verification costs no API quota and
|
|
33
|
+
* stays as fresh as the asset. */
|
|
34
|
+
const SHA256SUM_SUFFIX = '.sha256sum';
|
|
35
|
+
export const MIHOMO_GEO_ASSETS = [
|
|
36
|
+
// mihomo's default `geoip.metadb` (mmdb mode) — what `GEOIP` reads.
|
|
37
|
+
{ key: 'geoip', file: 'geoip.metadb', url: `${GEO_DOWNLOAD_BASE}/geoip.metadb` },
|
|
38
|
+
// Saved under the capitalized name mihomo looks for in its work dir.
|
|
39
|
+
{ key: 'geosite', file: 'GeoSite.dat', url: `${GEO_DOWNLOAD_BASE}/geosite.dat` },
|
|
40
|
+
];
|
|
41
|
+
/** True when any row needs the geo databases. */
|
|
42
|
+
export function rulesNeedGeo(rules) {
|
|
43
|
+
return (rules ?? []).some((rule) => rule.type === 'GEOIP' || rule.type === 'GEOSITE');
|
|
44
|
+
}
|
|
45
|
+
function fileInfo(dir, asset) {
|
|
46
|
+
try {
|
|
47
|
+
const stat = fs.statSync(path.join(dir, asset.file));
|
|
48
|
+
const exists = stat.isFile() && stat.size > 0;
|
|
49
|
+
const stale = exists && Date.now() - stat.mtimeMs > MIHOMO_GEO_STALE_DAYS * 86_400_000;
|
|
50
|
+
return {
|
|
51
|
+
key: asset.key,
|
|
52
|
+
file: asset.file,
|
|
53
|
+
exists,
|
|
54
|
+
size: stat.size,
|
|
55
|
+
...(exists ? { updatedAt: stat.mtimeMs } : {}),
|
|
56
|
+
stale,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return { key: asset.key, file: asset.file, exists: false, size: 0, stale: false };
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export function geoReport(dir) {
|
|
64
|
+
const files = MIHOMO_GEO_ASSETS.map((asset) => fileInfo(dir, asset));
|
|
65
|
+
return { present: files.every((file) => file.exists), files };
|
|
66
|
+
}
|
|
67
|
+
export function geoAssetsPresent(dir) {
|
|
68
|
+
return geoReport(dir).present;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The proxy URL the machine leg should dial for `url`: the OS system proxy
|
|
72
|
+
* unless the host sits on its bypass list. `undefined` means connect directly.
|
|
73
|
+
*/
|
|
74
|
+
export function machineLegProxy(endpoint, url) {
|
|
75
|
+
if (!endpoint)
|
|
76
|
+
return undefined;
|
|
77
|
+
let host;
|
|
78
|
+
try {
|
|
79
|
+
host = new URL(url).hostname.replace(/^\[|\]$/g, '');
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
if (osProxyBypasses(host, endpoint.bypass))
|
|
85
|
+
return undefined;
|
|
86
|
+
const server = endpoint.server.trim();
|
|
87
|
+
if (!server)
|
|
88
|
+
return undefined;
|
|
89
|
+
return /^https?:\/\//i.test(server) ? server : `http://${server}`;
|
|
90
|
+
}
|
|
91
|
+
function inputUrl(input) {
|
|
92
|
+
if (typeof input === 'string')
|
|
93
|
+
return input;
|
|
94
|
+
if (input instanceof URL)
|
|
95
|
+
return input.toString();
|
|
96
|
+
return input.url;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The fetch implementation the geo download runs on.
|
|
100
|
+
*
|
|
101
|
+
* - `machine` — the way this box's other applications leave: through the OS
|
|
102
|
+
* system proxy when one is enabled (bypass list honoured), directly when
|
|
103
|
+
* none is. Needs no running core. The check runs per request, so the
|
|
104
|
+
* redirect to `objects.githubusercontent.com` is judged on its own host.
|
|
105
|
+
* - `node` — through the core's mixed port, i.e. the operator's selected
|
|
106
|
+
* node. The caller must refuse this leg while the core is down; by the time
|
|
107
|
+
* a request lands here the core is expected to be listening.
|
|
108
|
+
*/
|
|
109
|
+
export async function geoFetchForLeg(leg, opts = {}) {
|
|
110
|
+
if (leg === 'node') {
|
|
111
|
+
const port = opts.mixedPort;
|
|
112
|
+
if (!Number.isInteger(port) || port < 1 || port > 65535) {
|
|
113
|
+
throw new Error('mixed port unavailable for the node leg');
|
|
114
|
+
}
|
|
115
|
+
const proxy = `http://127.0.0.1:${port}`;
|
|
116
|
+
return (input, init) => fetchViaProxy(inputUrl(input), init ?? {}, proxy);
|
|
117
|
+
}
|
|
118
|
+
const endpoint = await (opts.osProxyReader ?? readOsProxyEndpoint)();
|
|
119
|
+
return (input, init) => {
|
|
120
|
+
const url = inputUrl(input);
|
|
121
|
+
const proxy = machineLegProxy(endpoint, url);
|
|
122
|
+
return proxy ? fetchViaProxy(url, init ?? {}, proxy) : fetch(input, init);
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* The digest MetaCubeX publishes for one asset, or undefined when the host
|
|
127
|
+
* would not give one. Best-effort by design: a refused `.sha256sum` costs the
|
|
128
|
+
* verification, never the download — the operator still gets the database, and
|
|
129
|
+
* the transfer is still resumable from the recorded ETag.
|
|
130
|
+
*/
|
|
131
|
+
async function resolveAssetDigest(fetchImpl, url, headers, signal) {
|
|
132
|
+
try {
|
|
133
|
+
const res = await fetchImpl(`${url}${SHA256SUM_SUFFIX}`, { headers, ...(signal ? { signal } : {}) });
|
|
134
|
+
if (!res.ok)
|
|
135
|
+
return undefined;
|
|
136
|
+
return parseAssetDigest((await res.text()).trim().split(/\s+/)[0]);
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
async function fetchAsset(asset, dir, fetchImpl, onProgress, signal) {
|
|
143
|
+
const dest = path.join(dir, asset.file);
|
|
144
|
+
const { partPath } = assetPartPaths(dest);
|
|
145
|
+
const headers = { 'User-Agent': USER_AGENT, Accept: 'text/plain' };
|
|
146
|
+
const digest = await resolveAssetDigest(fetchImpl, asset.url, headers, signal);
|
|
147
|
+
const downloaded = await downloadAssetToFile({
|
|
148
|
+
url: asset.url,
|
|
149
|
+
partPath,
|
|
150
|
+
fetchImpl,
|
|
151
|
+
maxBytes: MAX_GEO_BYTES,
|
|
152
|
+
...(digest ? { sha256: digest } : {}),
|
|
153
|
+
headers: { 'User-Agent': USER_AGENT },
|
|
154
|
+
...(signal ? { signal } : {}),
|
|
155
|
+
...(onProgress ? { onProgress: (bytes, total) => onProgress(asset.key, bytes, total) } : {}),
|
|
156
|
+
});
|
|
157
|
+
if (!downloaded.ok) {
|
|
158
|
+
if (downloaded.code === 'download-too-large') {
|
|
159
|
+
return { ok: false, code: 'geo-download-too-large', error: 'geo data download exceeded 64MB' };
|
|
160
|
+
}
|
|
161
|
+
if (downloaded.code === 'write-failed') {
|
|
162
|
+
const message = downloaded.error.includes('(') ? downloaded.error : `(${downloaded.error})`;
|
|
163
|
+
return { ok: false, code: 'geo-download-failed', error: `could not write ${asset.file} ${message}` };
|
|
164
|
+
}
|
|
165
|
+
if (downloaded.code === 'checksum-failed') {
|
|
166
|
+
// Distinct from a network failure: the host served a file that is not the
|
|
167
|
+
// published database, so retrying cannot help until upstream is fixed.
|
|
168
|
+
return { ok: false, code: 'checksum-failed', error: `${asset.file} did not match the published digest` };
|
|
169
|
+
}
|
|
170
|
+
// A cancelled or truncated transfer keeps its `.part`: the next sync picks up
|
|
171
|
+
// where this one stopped. Every other failure already destroyed the part.
|
|
172
|
+
return { ok: false, code: 'geo-download-failed', error: downloaded.error };
|
|
173
|
+
}
|
|
174
|
+
// The verified bytes already sit in the staging file, so the install is the
|
|
175
|
+
// rename alone: they are never copied back through memory, and the database
|
|
176
|
+
// mihomo parses is never a half-written one.
|
|
177
|
+
try {
|
|
178
|
+
if (fs.statSync(partPath).size === 0) {
|
|
179
|
+
cleanupAssetPart(partPath);
|
|
180
|
+
return { ok: false, code: 'geo-download-failed', error: `geo data download was empty (${asset.file})` };
|
|
181
|
+
}
|
|
182
|
+
renameWithRetry(partPath, dest);
|
|
183
|
+
}
|
|
184
|
+
catch (err) {
|
|
185
|
+
cleanupAssetPart(partPath);
|
|
186
|
+
const message = err instanceof Error ? err.message : 'write failed';
|
|
187
|
+
return { ok: false, code: 'geo-download-failed', error: `could not install ${asset.file} (${message})` };
|
|
188
|
+
}
|
|
189
|
+
// The part is gone with the rename; this clears its sidecar.
|
|
190
|
+
cleanupAssetPart(partPath);
|
|
191
|
+
return { ok: true };
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Install the geo databases into the core's work directory. Existing non-empty
|
|
195
|
+
* files are kept unless `refresh` asks for replacement (a retry after a partial
|
|
196
|
+
* failure only fetches the missing one); a file that fails to download or write
|
|
197
|
+
* never replaces a working copy. Each asset is one critical section (ADR-0022):
|
|
198
|
+
* a second click waits instead of writing the same part file underneath it.
|
|
199
|
+
*/
|
|
200
|
+
export async function downloadMihomoGeoAssets(dir, opts = {}) {
|
|
201
|
+
const fetchImpl = opts.fetchImpl ?? fetch;
|
|
202
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
203
|
+
for (const asset of MIHOMO_GEO_ASSETS) {
|
|
204
|
+
if (!opts.refresh && fileInfo(dir, asset).exists)
|
|
205
|
+
continue;
|
|
206
|
+
const outcome = await withAssetLock(path.join(dir, asset.file), () => fetchAsset(asset, dir, fetchImpl, opts.onProgress, opts.signal));
|
|
207
|
+
if (!outcome.ok) {
|
|
208
|
+
return { ok: false, present: geoAssetsPresent(dir), files: geoReport(dir).files, code: outcome.code, error: outcome.error };
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
const report = geoReport(dir);
|
|
212
|
+
return { ok: true, present: report.present, files: report.files };
|
|
213
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** `gateway` marks lines this process writes itself (spawn/exit markers), not core output. */
|
|
2
|
+
export type MihomoLogStream = 'stdout' | 'stderr' | 'gateway';
|
|
3
|
+
export interface MihomoCoreLogLine {
|
|
4
|
+
id: string;
|
|
5
|
+
ts: number;
|
|
6
|
+
stream: MihomoLogStream;
|
|
7
|
+
text: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function appendMihomoCoreLog(stream: MihomoLogStream, raw: string): void;
|
|
10
|
+
/** Oldest first; `limit` keeps the newest N. */
|
|
11
|
+
export declare function mihomoCoreLogs(limit?: number): MihomoCoreLogLine[];
|
|
12
|
+
export declare function clearMihomoCoreLogs(): void;
|
|
13
|
+
/** The slice of a spawned child this module consumes (structural, so tests and
|
|
14
|
+
* the sidecar's `MihomoChildLike` both fit without importing each other). */
|
|
15
|
+
export interface MihomoLogSource {
|
|
16
|
+
stdout?: {
|
|
17
|
+
on(event: string, listener: (chunk: unknown) => void): void;
|
|
18
|
+
} | null;
|
|
19
|
+
stderr?: {
|
|
20
|
+
on(event: string, listener: (chunk: unknown) => void): void;
|
|
21
|
+
} | null;
|
|
22
|
+
}
|
|
23
|
+
/** Split both pipes into lines as they arrive. Partial lines are held until
|
|
24
|
+
* their newline shows up (mihomo writes one record per line). `sink` receives
|
|
25
|
+
* the same cleaned text the ring stores — the sidecar uses it to tell a bind
|
|
26
|
+
* failure apart from a slow start while the process is still its own. */
|
|
27
|
+
export declare function attachMihomoCoreLog(source: MihomoLogSource, sink?: (line: string) => void): void;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-memory ring of the Clash core's own stdout/stderr (ADR-0022).
|
|
3
|
+
*
|
|
4
|
+
* The core is spawned with piped stdio and every line lands here, so the
|
|
5
|
+
* console's Logs section can answer "why did it refuse to start / die" — the
|
|
6
|
+
* evidence the controller cannot provide once the process is gone. The ring
|
|
7
|
+
* outlives a crashed core on purpose and is memory-only: nothing is written to
|
|
8
|
+
* disk, and neither the controller secret nor a subscription URL can appear
|
|
9
|
+
* (the core prints neither; the generated config holds them).
|
|
10
|
+
*/
|
|
11
|
+
import { EventRing, MIHOMO_LOG_RING_CAPACITY, nextRingEventId, } from '../utils/event-ring.js';
|
|
12
|
+
/** One captured line is a diagnostic sample, not a log archive. */
|
|
13
|
+
const LINE_MAX_CHARS = 2000;
|
|
14
|
+
/** A stream that never emits a newline must not grow the pending buffer forever. */
|
|
15
|
+
const PENDING_MAX_CHARS = 8192;
|
|
16
|
+
/** Colour codes are terminal decoration; a captured line must not carry them. */
|
|
17
|
+
const ANSI_RE = /\x1b\[[0-9;]*m/g;
|
|
18
|
+
const ring = new EventRing(undefined, MIHOMO_LOG_RING_CAPACITY);
|
|
19
|
+
export function appendMihomoCoreLog(stream, raw) {
|
|
20
|
+
const text = raw.replace(ANSI_RE, '').replace(/\r$/, '');
|
|
21
|
+
if (!text.trim())
|
|
22
|
+
return;
|
|
23
|
+
const ts = Date.now();
|
|
24
|
+
ring.append({
|
|
25
|
+
id: nextRingEventId('l-', ts),
|
|
26
|
+
ts,
|
|
27
|
+
stream,
|
|
28
|
+
text: text.length > LINE_MAX_CHARS ? `${text.slice(0, LINE_MAX_CHARS)}…` : text,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/** Oldest first; `limit` keeps the newest N. */
|
|
32
|
+
export function mihomoCoreLogs(limit) {
|
|
33
|
+
const rows = ring.rows();
|
|
34
|
+
if (limit == null || limit >= rows.length)
|
|
35
|
+
return rows;
|
|
36
|
+
return limit > 0 ? rows.slice(rows.length - limit) : [];
|
|
37
|
+
}
|
|
38
|
+
export function clearMihomoCoreLogs() {
|
|
39
|
+
ring.clear();
|
|
40
|
+
}
|
|
41
|
+
/** Split both pipes into lines as they arrive. Partial lines are held until
|
|
42
|
+
* their newline shows up (mihomo writes one record per line). `sink` receives
|
|
43
|
+
* the same cleaned text the ring stores — the sidecar uses it to tell a bind
|
|
44
|
+
* failure apart from a slow start while the process is still its own. */
|
|
45
|
+
export function attachMihomoCoreLog(source, sink) {
|
|
46
|
+
const streams = [
|
|
47
|
+
['stdout', source.stdout],
|
|
48
|
+
['stderr', source.stderr],
|
|
49
|
+
];
|
|
50
|
+
const emit = (stream, line) => {
|
|
51
|
+
appendMihomoCoreLog(stream, line);
|
|
52
|
+
sink?.(line.replace(ANSI_RE, '').replace(/\r$/, ''));
|
|
53
|
+
};
|
|
54
|
+
for (const [stream, pipe] of streams) {
|
|
55
|
+
if (!pipe)
|
|
56
|
+
continue;
|
|
57
|
+
let pending = '';
|
|
58
|
+
pipe.on('data', (chunk) => {
|
|
59
|
+
pending += typeof chunk === 'string' ? chunk : String(chunk);
|
|
60
|
+
const lines = pending.split(/\r?\n/);
|
|
61
|
+
pending = lines.pop() ?? '';
|
|
62
|
+
for (const line of lines)
|
|
63
|
+
emit(stream, line);
|
|
64
|
+
if (pending.length > PENDING_MAX_CHARS) {
|
|
65
|
+
emit(stream, pending);
|
|
66
|
+
pending = '';
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PAC (proxy auto-config) generator for the mihomo outbound core (ADR-0022).
|
|
3
|
+
*
|
|
4
|
+
* Why PAC: a browser or a client that only understands "point me at a proxy
|
|
5
|
+
* config URL" cannot be handed an HTTP/SOCKS port and a bypass list. A PAC
|
|
6
|
+
* script carries BOTH — the mixed port to use and the hosts that must stay
|
|
7
|
+
* direct — in one URL, and the client re-reads it on demand, so the port in the
|
|
8
|
+
* console stays the single source of truth.
|
|
9
|
+
*
|
|
10
|
+
* The bypass list is the PAC-side mirror of the router's own loopback rule
|
|
11
|
+
* (`isLoopbackHost` in ../forward-proxy/rules.ts): anything that cannot leave
|
|
12
|
+
* the machine, or that belongs to the local network, is DIRECT. Keeping those
|
|
13
|
+
* requests off the core also keeps them off the console's own control port.
|
|
14
|
+
*
|
|
15
|
+
* What is deliberately NOT mirrored: `proxy.includes` / `proxy.excludes` match
|
|
16
|
+
* provider/model names, not hosts, so they have no meaning in a PAC script.
|
|
17
|
+
*/
|
|
18
|
+
/** Served at the gateway root, outside /api (browsers fetch it unauthenticated). */
|
|
19
|
+
export declare const PAC_PATH = "/proxy.pac";
|
|
20
|
+
/**
|
|
21
|
+
* Absolute PAC URL for the client that reached the gateway.
|
|
22
|
+
*
|
|
23
|
+
* The request's own Host is the only origin that is guaranteed to reach this
|
|
24
|
+
* listener: a dev console is served by Vite on another port, and handing out
|
|
25
|
+
* `window.location.origin` would tie the OS/browser auto-config to a dev
|
|
26
|
+
* server that dies with the terminal. `changeOrigin` in the Vite proxy
|
|
27
|
+
* rewrites Host to the gateway, and a production console is served by the
|
|
28
|
+
* gateway itself, so both paths yield the gateway origin.
|
|
29
|
+
*/
|
|
30
|
+
export declare function pacUrlFor(requestHost: string | undefined, protocol?: string, gatewayPort?: number): string;
|
|
31
|
+
export interface PacScriptOptions {
|
|
32
|
+
/** The mihomo mixed port (HTTP + SOCKS5 on one listener). */
|
|
33
|
+
proxyPort: number;
|
|
34
|
+
/** Host the core listens on; the core only ever binds loopback. */
|
|
35
|
+
proxyHost?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare function buildPacScript({ proxyPort, proxyHost }: PacScriptOptions): string;
|