omnicell-router 0.2.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -10
- package/README.zh-CN.md +57 -8
- package/RELEASING.md +6 -0
- package/RELEASING.zh-CN.md +5 -0
- package/backend/dist/auth/api-keys.d.ts +14 -2
- package/backend/dist/auth/api-keys.js +26 -14
- package/backend/dist/auth/model-access.d.ts +27 -10
- package/backend/dist/auth/model-access.js +34 -17
- package/backend/dist/capture/migrate/engine.d.ts +38 -0
- package/backend/dist/capture/migrate/engine.js +307 -0
- package/backend/dist/capture/migrate/index.d.ts +18 -0
- package/backend/dist/capture/migrate/index.js +18 -0
- package/backend/dist/capture/migrate/migrator.d.ts +113 -0
- package/backend/dist/capture/migrate/migrator.js +16 -0
- package/backend/dist/capture/migrate/registry.d.ts +16 -0
- package/backend/dist/capture/migrate/registry.js +19 -0
- package/backend/dist/capture/migrate/steps/v1-to-v2.d.ts +86 -0
- package/backend/dist/capture/migrate/steps/v1-to-v2.js +396 -0
- package/backend/dist/capture/recorder.d.ts +422 -272
- package/backend/dist/capture/recorder.js +873 -417
- package/backend/dist/capture/turn-boundary.d.ts +17 -0
- package/backend/dist/capture/turn-boundary.js +31 -0
- package/backend/dist/cli/clients/base.d.ts +158 -23
- package/backend/dist/cli/clients/base.js +150 -4
- package/backend/dist/cli/clients/claude.d.ts +3 -2
- package/backend/dist/cli/clients/claude.js +4 -3
- package/backend/dist/cli/clients/codex.d.ts +3 -2
- package/backend/dist/cli/clients/codex.js +4 -3
- package/backend/dist/cli/clients/core-adapters.d.ts +25 -0
- package/backend/dist/cli/clients/core-adapters.js +44 -0
- package/backend/dist/cli/clients/dsh.d.ts +5 -3
- package/backend/dist/cli/clients/dsh.js +29 -18
- package/backend/dist/cli/clients/grok.d.ts +53 -0
- package/backend/dist/cli/clients/grok.js +249 -0
- package/backend/dist/cli/clients/index.d.ts +28 -19
- package/backend/dist/cli/clients/index.js +156 -58
- package/backend/dist/cli/clients/kimi.d.ts +75 -0
- package/backend/dist/cli/clients/kimi.js +316 -0
- package/backend/dist/cli/clients/launcher.d.ts +48 -0
- package/backend/dist/cli/clients/launcher.js +41 -0
- package/backend/dist/cli/clients/omp.d.ts +43 -0
- package/backend/dist/cli/clients/omp.js +537 -0
- package/backend/dist/cli/clients/openclaw.d.ts +55 -0
- package/backend/dist/cli/clients/openclaw.js +525 -0
- package/backend/dist/cli/clients/opencode.d.ts +7 -20
- package/backend/dist/cli/clients/opencode.js +32 -159
- package/backend/dist/cli/clients/pi.d.ts +7 -21
- package/backend/dist/cli/clients/pi.js +87 -229
- package/backend/dist/cli/clients/plugin-adapters.d.ts +20 -0
- package/backend/dist/cli/clients/plugin-adapters.js +88 -0
- package/backend/dist/cli/clients/reserved.d.ts +51 -0
- package/backend/dist/cli/clients/reserved.js +53 -0
- package/backend/dist/cli/clients/workbuddy.d.ts +31 -0
- package/backend/dist/cli/clients/workbuddy.js +259 -0
- package/backend/dist/cli/daemon.d.ts +105 -27
- package/backend/dist/cli/daemon.js +509 -151
- package/backend/dist/cli/index.d.ts +6 -1
- package/backend/dist/cli/index.js +238 -22
- package/backend/dist/cli/paths.d.ts +86 -0
- package/backend/dist/cli/paths.js +269 -0
- package/backend/dist/cli/shim.d.ts +47 -1
- package/backend/dist/cli/shim.js +180 -13
- package/backend/dist/cli/types.d.ts +102 -16
- package/backend/dist/cli/types.js +5 -4
- package/backend/dist/compression/caveman-prompts.d.ts +1 -1
- package/backend/dist/compression/caveman.d.ts +2 -16
- package/backend/dist/compression/caveman.js +25 -37
- package/backend/dist/compression/headroom.d.ts +4 -3
- package/backend/dist/compression/headroom.js +2 -2
- package/backend/dist/compression/index.d.ts +5 -26
- package/backend/dist/compression/index.js +79 -17
- package/backend/dist/compression/tool-output.d.ts +2 -20
- package/backend/dist/compression/tool-output.js +40 -47
- package/backend/dist/config/comments-en.d.ts +17 -0
- package/backend/dist/config/comments-en.js +232 -0
- package/backend/dist/config/comments-zh.d.ts +10 -0
- package/backend/dist/config/comments-zh.js +217 -0
- package/backend/dist/config/defaults.d.ts +190 -2
- package/backend/dist/config/defaults.js +191 -2
- package/backend/dist/config/env-archive.js +77 -38
- package/backend/dist/config/env.d.ts +4 -0
- package/backend/dist/config/env.js +16 -0
- package/backend/dist/config/index.d.ts +48 -12
- package/backend/dist/config/index.js +794 -368
- package/backend/dist/config/layout.d.ts +29 -0
- package/backend/dist/config/layout.js +86 -0
- package/backend/dist/config/migrations/v0-to-v1.d.ts +105 -0
- package/backend/dist/config/migrations/v0-to-v1.js +78 -0
- package/backend/dist/config/migrations/v1-to-v2.d.ts +14 -0
- package/backend/dist/config/migrations/v1-to-v2.js +41 -0
- package/backend/dist/config/migrations/v2-to-v3.d.ts +34 -0
- package/backend/dist/config/migrations/v2-to-v3.js +66 -0
- package/backend/dist/config/migrations/v3-to-v4.d.ts +34 -0
- package/backend/dist/config/migrations/v3-to-v4.js +61 -0
- package/backend/dist/config/runtime.d.ts +13 -0
- package/backend/dist/config/runtime.js +26 -0
- package/backend/dist/config/schema.d.ts +28 -0
- package/backend/dist/config/schema.js +98 -0
- package/backend/dist/config/types.d.ts +501 -84
- package/backend/dist/forward-proxy/access-log.d.ts +173 -0
- package/backend/dist/forward-proxy/access-log.js +657 -0
- package/backend/dist/forward-proxy/ca-trust.d.ts +42 -0
- package/backend/dist/forward-proxy/ca-trust.js +242 -0
- package/backend/dist/forward-proxy/ca.d.ts +66 -2
- package/backend/dist/forward-proxy/ca.js +146 -11
- package/backend/dist/forward-proxy/caller-context.d.ts +18 -0
- package/backend/dist/forward-proxy/caller-context.js +20 -0
- package/backend/dist/forward-proxy/egress.d.ts +104 -0
- package/backend/dist/forward-proxy/egress.js +280 -0
- package/backend/dist/forward-proxy/h2-forward.d.ts +66 -0
- package/backend/dist/forward-proxy/h2-forward.js +526 -0
- package/backend/dist/forward-proxy/index.d.ts +13 -1
- package/backend/dist/forward-proxy/index.js +148 -7
- package/backend/dist/forward-proxy/interceptor.d.ts +16 -13
- package/backend/dist/forward-proxy/interceptor.js +35 -57
- package/backend/dist/forward-proxy/relay.d.ts +21 -1
- package/backend/dist/forward-proxy/relay.js +48 -1
- package/backend/dist/forward-proxy/rules.d.ts +148 -0
- package/backend/dist/forward-proxy/rules.js +280 -0
- package/backend/dist/forward-proxy/server.d.ts +102 -9
- package/backend/dist/forward-proxy/server.js +1310 -305
- package/backend/dist/forward-proxy/sni.d.ts +29 -7
- package/backend/dist/forward-proxy/sni.js +109 -47
- package/backend/dist/forward-proxy/system-proxy.d.ts +72 -0
- package/backend/dist/forward-proxy/system-proxy.js +303 -0
- package/backend/dist/forward-proxy/upstream-tls.d.ts +46 -0
- package/backend/dist/forward-proxy/upstream-tls.js +105 -0
- package/backend/dist/forward-proxy/ws-frames.d.ts +45 -0
- package/backend/dist/forward-proxy/ws-frames.js +153 -0
- package/backend/dist/harness/common/catalog-registry.d.ts +63 -0
- package/backend/dist/harness/common/catalog-registry.js +77 -0
- package/backend/dist/harness/common/github.d.ts +6 -0
- package/backend/dist/harness/common/github.js +13 -0
- package/backend/dist/harness/common/market.d.ts +590 -0
- package/backend/dist/harness/common/market.js +1079 -0
- package/backend/dist/harness/common/marketplace-rescan-scheduler.d.ts +24 -0
- package/backend/dist/harness/common/marketplace-rescan-scheduler.js +62 -0
- package/backend/dist/harness/{catalog-npm.d.ts → common/npm-catalog.d.ts} +5 -5
- package/backend/dist/harness/{catalog-npm.js → common/npm-catalog.js} +7 -7
- package/backend/dist/harness/common/npm-source.d.ts +29 -0
- package/backend/dist/harness/common/npm-source.js +121 -0
- package/backend/dist/harness/common/pypi-source.d.ts +28 -0
- package/backend/dist/harness/common/pypi-source.js +71 -0
- package/backend/dist/harness/common/source-views.d.ts +22 -0
- package/backend/dist/harness/common/source-views.js +25 -0
- package/backend/dist/harness/{stars.d.ts → common/stars.d.ts} +1 -1
- package/backend/dist/harness/{stars.js → common/stars.js} +2 -2
- package/backend/dist/harness/common/text.d.ts +11 -0
- package/backend/dist/harness/common/text.js +18 -0
- package/backend/dist/harness/config-file.d.ts +14 -1
- package/backend/dist/harness/config-file.js +38 -0
- package/backend/dist/harness/db-probe.d.ts +29 -0
- package/backend/dist/harness/db-probe.js +270 -0
- package/backend/dist/harness/detail.d.ts +10 -1
- package/backend/dist/harness/detail.js +144 -7
- package/backend/dist/harness/host/adapters/amp.d.ts +19 -0
- package/backend/dist/harness/host/adapters/amp.js +21 -0
- package/backend/dist/harness/host/adapters/antigravity.d.ts +18 -0
- package/backend/dist/harness/host/adapters/antigravity.js +21 -0
- package/backend/dist/harness/host/adapters/base.d.ts +225 -0
- package/backend/dist/harness/host/adapters/base.js +521 -0
- package/backend/dist/harness/host/adapters/claude.d.ts +54 -0
- package/backend/dist/harness/host/adapters/claude.js +145 -0
- package/backend/dist/harness/host/adapters/cline.d.ts +18 -0
- package/backend/dist/harness/host/adapters/cline.js +20 -0
- package/backend/dist/harness/host/adapters/codex.d.ts +54 -0
- package/backend/dist/harness/host/adapters/codex.js +133 -0
- package/backend/dist/harness/host/adapters/cursor.d.ts +18 -0
- package/backend/dist/harness/host/adapters/cursor.js +24 -0
- package/backend/dist/harness/host/adapters/declarative.d.ts +22 -0
- package/backend/dist/harness/host/adapters/declarative.js +38 -0
- package/backend/dist/harness/host/adapters/dsh.d.ts +76 -0
- package/backend/dist/harness/host/adapters/dsh.js +253 -0
- package/backend/dist/harness/host/adapters/factory.d.ts +36 -0
- package/backend/dist/harness/host/adapters/factory.js +34 -0
- package/backend/dist/harness/host/adapters/gemini-cli.d.ts +17 -0
- package/backend/dist/harness/host/adapters/gemini-cli.js +19 -0
- package/backend/dist/harness/host/adapters/grok.d.ts +66 -0
- package/backend/dist/harness/host/adapters/grok.js +136 -0
- package/backend/dist/harness/{adapters → host/adapters}/index.d.ts +18 -5
- package/backend/dist/harness/{adapters → host/adapters}/index.js +73 -5
- package/backend/dist/harness/host/adapters/kimi.d.ts +30 -0
- package/backend/dist/harness/host/adapters/kimi.js +59 -0
- package/backend/dist/harness/host/adapters/omp.d.ts +55 -0
- package/backend/dist/harness/host/adapters/omp.js +90 -0
- package/backend/dist/harness/host/adapters/openclaw.d.ts +54 -0
- package/backend/dist/harness/host/adapters/openclaw.js +141 -0
- package/backend/dist/harness/host/adapters/opencode.d.ts +24 -0
- package/backend/dist/harness/host/adapters/opencode.js +48 -0
- package/backend/dist/harness/host/adapters/pi.d.ts +27 -0
- package/backend/dist/harness/host/adapters/pi.js +58 -0
- package/backend/dist/harness/host/adapters/types.d.ts +395 -0
- package/backend/dist/harness/host/adapters/types.js +17 -0
- package/backend/dist/harness/host/adapters/universal.d.ts +14 -0
- package/backend/dist/harness/host/adapters/universal.js +18 -0
- package/backend/dist/harness/host/adapters/windsurf.d.ts +20 -0
- package/backend/dist/harness/host/adapters/windsurf.js +22 -0
- package/backend/dist/harness/host/adapters/zed.d.ts +12 -0
- package/backend/dist/harness/host/adapters/zed.js +14 -0
- package/backend/dist/harness/host/claude-mcp-runtime.d.ts +6 -0
- package/backend/dist/harness/host/claude-mcp-runtime.js +56 -0
- package/backend/dist/harness/{discover.d.ts → host/discover.d.ts} +54 -18
- package/backend/dist/harness/{discover.js → host/discover.js} +314 -53
- package/backend/dist/harness/{drift.d.ts → host/drift.d.ts} +1 -1
- package/backend/dist/harness/{drift.js → host/drift.js} +1 -1
- package/backend/dist/harness/host/grok-mcp-runtime.d.ts +6 -0
- package/backend/dist/harness/host/grok-mcp-runtime.js +56 -0
- package/backend/dist/harness/{hosts.d.ts → host/hosts.d.ts} +3 -3
- package/backend/dist/harness/{hosts.js → host/hosts.js} +7 -2
- package/backend/dist/harness/host/index.d.ts +10 -0
- package/backend/dist/harness/host/index.js +12 -0
- package/backend/dist/harness/host/install-log.d.ts +22 -0
- package/backend/dist/harness/host/install-log.js +106 -0
- package/backend/dist/harness/{install.d.ts → host/install.d.ts} +32 -13
- package/backend/dist/harness/{install.js → host/install.js} +133 -50
- package/backend/dist/harness/host/inventory.d.ts +30 -0
- package/backend/dist/harness/{inventory.js → host/inventory.js} +107 -16
- package/backend/dist/harness/host/kimi-mcp-runtime.d.ts +6 -0
- package/backend/dist/harness/host/kimi-mcp-runtime.js +84 -0
- package/backend/dist/harness/{ledger.d.ts → host/ledger.d.ts} +1 -1
- package/backend/dist/harness/{ledger.js → host/ledger.js} +3 -3
- package/backend/dist/harness/{maintenance.d.ts → host/maintenance.d.ts} +23 -6
- package/backend/dist/harness/{maintenance.js → host/maintenance.js} +355 -63
- package/backend/dist/harness/{manifest.d.ts → host/manifest.d.ts} +11 -2
- package/backend/dist/harness/{manifest.js → host/manifest.js} +76 -15
- package/backend/dist/harness/host/marketplace-sync.d.ts +64 -0
- package/backend/dist/harness/host/marketplace-sync.js +231 -0
- package/backend/dist/harness/host/mcp-cli.d.ts +44 -0
- package/backend/dist/harness/host/mcp-cli.js +545 -0
- package/backend/dist/harness/host/mcp-edit.d.ts +89 -0
- package/backend/dist/harness/host/mcp-edit.js +342 -0
- package/backend/dist/harness/host/mcp-entry.d.ts +100 -0
- package/backend/dist/harness/host/mcp-entry.js +435 -0
- package/backend/dist/harness/host/mcp-inspector.d.ts +125 -0
- package/backend/dist/harness/host/mcp-inspector.js +634 -0
- package/backend/dist/harness/host/mcp-registry.d.ts +66 -0
- package/backend/dist/harness/host/mcp-registry.js +331 -0
- package/backend/dist/harness/host/mcp-runtime.d.ts +19 -0
- package/backend/dist/harness/host/mcp-runtime.js +22 -0
- package/backend/dist/harness/host/opencode-mcp-runtime.d.ts +7 -0
- package/backend/dist/harness/host/opencode-mcp-runtime.js +73 -0
- package/backend/dist/harness/{probe.d.ts → host/probe.d.ts} +4 -4
- package/backend/dist/harness/{probe.js → host/probe.js} +8 -8
- package/backend/dist/harness/{registry.d.ts → host/registry.d.ts} +1 -1
- package/backend/dist/harness/host/registry.js +28 -0
- package/backend/dist/harness/host/request.d.ts +56 -0
- package/backend/dist/harness/host/request.js +1 -0
- package/backend/dist/harness/{sources → host/resolvers}/clawhub.d.ts +1 -1
- package/backend/dist/harness/{sources → host/resolvers}/clawhub.js +1 -1
- package/backend/dist/harness/host/resolvers/git-marketplace.d.ts +16 -0
- package/backend/dist/harness/host/resolvers/git-marketplace.js +53 -0
- package/backend/dist/harness/{sources → host/resolvers}/github.d.ts +1 -1
- package/backend/dist/harness/{sources → host/resolvers}/github.js +2 -2
- package/backend/dist/harness/host/resolvers/npm.d.ts +2 -0
- package/backend/dist/harness/{sources → host/resolvers}/npm.js +16 -10
- package/backend/dist/harness/host/resolvers/pypi.d.ts +2 -0
- package/backend/dist/harness/host/resolvers/pypi.js +100 -0
- package/backend/dist/harness/host/scopes.d.ts +11 -0
- package/backend/dist/harness/host/scopes.js +12 -0
- package/backend/dist/harness/host/timeouts.d.ts +8 -0
- package/backend/dist/harness/host/timeouts.js +8 -0
- package/backend/dist/harness/host/writers/kimi-web.d.ts +70 -0
- package/backend/dist/harness/host/writers/kimi-web.js +222 -0
- package/backend/dist/harness/host/writers/mcp.d.ts +119 -0
- package/backend/dist/harness/host/writers/mcp.js +359 -0
- package/backend/dist/harness/host/writers/plugin.d.ts +176 -0
- package/backend/dist/harness/host/writers/plugin.js +528 -0
- package/backend/dist/harness/{writers → host/writers}/skill.d.ts +3 -3
- package/backend/dist/harness/{writers → host/writers}/skill.js +6 -3
- package/backend/dist/harness/lang.d.ts +14 -0
- package/backend/dist/harness/lang.js +33 -0
- package/backend/dist/harness/net.d.ts +33 -0
- package/backend/dist/harness/net.js +63 -0
- package/backend/dist/harness/plugin/adapters/antigravity.d.ts +11 -0
- package/backend/dist/harness/plugin/adapters/antigravity.js +14 -0
- package/backend/dist/harness/plugin/adapters/base.d.ts +107 -0
- package/backend/dist/harness/plugin/adapters/base.js +454 -0
- package/backend/dist/harness/plugin/adapters/claude.d.ts +28 -0
- package/backend/dist/harness/plugin/adapters/claude.js +63 -0
- package/backend/dist/harness/plugin/adapters/codex.d.ts +13 -0
- package/backend/dist/harness/plugin/adapters/codex.js +16 -0
- package/backend/dist/harness/plugin/adapters/cursor.d.ts +13 -0
- package/backend/dist/harness/plugin/adapters/cursor.js +16 -0
- package/backend/dist/harness/plugin/adapters/dsh-plugin-net.d.ts +20 -0
- package/backend/dist/harness/plugin/adapters/dsh-plugin-net.js +371 -0
- package/backend/dist/harness/plugin/adapters/dsh.d.ts +22 -0
- package/backend/dist/harness/plugin/adapters/dsh.js +50 -0
- package/backend/dist/harness/plugin/adapters/factory.d.ts +11 -0
- package/backend/dist/harness/plugin/adapters/factory.js +19 -0
- package/backend/dist/harness/plugin/adapters/gemini.d.ts +12 -0
- package/backend/dist/harness/plugin/adapters/gemini.js +22 -0
- package/backend/dist/harness/plugin/adapters/grok.d.ts +15 -0
- package/backend/dist/harness/plugin/adapters/grok.js +23 -0
- package/backend/dist/harness/plugin/adapters/index.d.ts +41 -0
- package/backend/dist/harness/plugin/adapters/index.js +143 -0
- package/backend/dist/harness/plugin/adapters/kimi.d.ts +6 -0
- package/backend/dist/harness/plugin/adapters/kimi.js +35 -0
- package/backend/dist/harness/plugin/adapters/omp.d.ts +19 -0
- package/backend/dist/harness/plugin/adapters/omp.js +26 -0
- package/backend/dist/harness/plugin/adapters/openclaw.d.ts +20 -0
- package/backend/dist/harness/plugin/adapters/openclaw.js +36 -0
- package/backend/dist/harness/plugin/adapters/pi-dev.d.ts +124 -0
- package/backend/dist/harness/plugin/adapters/pi-dev.js +420 -0
- package/backend/dist/harness/plugin/adapters/pi-github.d.ts +18 -0
- package/backend/dist/harness/plugin/adapters/pi-github.js +27 -0
- package/backend/dist/harness/plugin/adapters/universal.d.ts +11 -0
- package/backend/dist/harness/plugin/adapters/universal.js +18 -0
- package/backend/dist/harness/plugin/builtin.d.ts +13 -0
- package/backend/dist/harness/plugin/builtin.js +34 -0
- package/backend/dist/harness/plugin/catalog.d.ts +30 -0
- package/backend/dist/harness/plugin/catalog.js +200 -0
- package/backend/dist/harness/plugin/index.d.ts +9 -0
- package/backend/dist/harness/plugin/index.js +9 -0
- package/backend/dist/harness/plugin/types.d.ts +164 -0
- package/backend/dist/harness/plugin/types.js +1 -0
- package/backend/dist/harness/{clawhub.d.ts → skill/clawhub.d.ts} +28 -5
- package/backend/dist/harness/{clawhub.js → skill/clawhub.js} +170 -5
- package/backend/dist/harness/skill/skills-sh.d.ts +47 -0
- package/backend/dist/harness/skill/skills-sh.js +270 -0
- package/backend/dist/harness/skill/sources.d.ts +41 -0
- package/backend/dist/harness/skill/sources.js +131 -0
- package/backend/dist/harness/spi.d.ts +11 -7
- package/backend/dist/harness/tcp-reach.d.ts +30 -0
- package/backend/dist/harness/tcp-reach.js +61 -0
- package/backend/dist/harness/translation.d.ts +31 -13
- package/backend/dist/harness/translation.js +212 -62
- package/backend/dist/harness/types.d.ts +61 -16
- package/backend/dist/index.js +170 -16
- package/backend/dist/ir/adapters/anthropic-messages-stream.d.ts +18 -0
- package/backend/dist/ir/adapters/anthropic-messages-stream.js +266 -0
- package/backend/dist/ir/adapters/anthropic-messages.d.ts +30 -0
- package/backend/dist/ir/adapters/anthropic-messages.js +870 -0
- package/backend/dist/ir/adapters/google-gemini-stream.d.ts +22 -0
- package/backend/dist/ir/adapters/google-gemini-stream.js +246 -0
- package/backend/dist/ir/adapters/google-gemini.d.ts +9 -0
- package/backend/dist/ir/adapters/google-gemini.js +450 -0
- package/backend/dist/ir/adapters/openai-chat-stream.d.ts +41 -0
- package/backend/dist/ir/adapters/openai-chat-stream.js +369 -0
- package/backend/dist/ir/adapters/openai-chat.d.ts +17 -0
- package/backend/dist/ir/adapters/openai-chat.js +670 -0
- package/backend/dist/ir/adapters/openai-responses-output.d.ts +50 -0
- package/backend/dist/ir/adapters/openai-responses-output.js +353 -0
- package/backend/dist/ir/adapters/openai-responses-stream.d.ts +12 -0
- package/backend/dist/ir/adapters/openai-responses-stream.js +193 -0
- package/backend/dist/ir/adapters/openai-responses.d.ts +14 -0
- package/backend/dist/ir/adapters/openai-responses.js +670 -0
- package/backend/dist/ir/capabilities.d.ts +41 -0
- package/backend/dist/ir/capabilities.js +147 -0
- package/backend/dist/ir/errors.d.ts +23 -0
- package/backend/dist/ir/errors.js +31 -0
- package/backend/dist/ir/index.d.ts +5 -0
- package/backend/dist/ir/index.js +5 -0
- package/backend/dist/ir/media.d.ts +2 -0
- package/backend/dist/ir/media.js +2 -0
- package/backend/dist/ir/stream.d.ts +17 -0
- package/backend/dist/ir/stream.js +250 -0
- package/backend/dist/ir/types.d.ts +523 -0
- package/backend/dist/ir/types.js +19 -0
- package/backend/dist/ir/validate.d.ts +18 -0
- package/backend/dist/ir/validate.js +272 -0
- package/backend/dist/metrics/request-cost.d.ts +3 -11
- package/backend/dist/metrics/request-cost.js +9 -27
- package/backend/dist/observability/failure-events.d.ts +20 -4
- package/backend/dist/observability/failure-events.js +9 -1
- package/backend/dist/observability/http-exchange.d.ts +75 -27
- package/backend/dist/observability/http-exchange.js +136 -39
- package/backend/dist/observability/request-identity.d.ts +40 -0
- package/backend/dist/observability/request-identity.js +102 -0
- package/backend/dist/observability/traffic-live-hidden.d.ts +24 -0
- package/backend/dist/observability/traffic-live-hidden.js +82 -0
- package/backend/dist/observability/upstream-body-redaction.d.ts +23 -0
- package/backend/dist/observability/upstream-body-redaction.js +72 -0
- package/backend/dist/observability/upstream-events.d.ts +16 -10
- package/backend/dist/observability/upstream-events.js +17 -11
- package/backend/dist/opencode/agents.d.ts +10 -2
- package/backend/dist/opencode/agents.js +22 -3
- package/backend/dist/opencode/catalog/auto-pull.d.ts +35 -1
- package/backend/dist/opencode/catalog/auto-pull.js +169 -33
- package/backend/dist/opencode/catalog/ocr-store.d.ts +6 -6
- package/backend/dist/opencode/catalog/ocr-store.js +2 -2
- package/backend/dist/opencode/catalog/overrides-store.d.ts +6 -5
- package/backend/dist/opencode/catalog/overrides-store.js +28 -3
- package/backend/dist/opencode/catalog/repository.d.ts +4 -0
- package/backend/dist/opencode/catalog/repository.js +19 -0
- package/backend/dist/opencode/catalog/sources/models-dev.d.ts +4 -0
- package/backend/dist/opencode/catalog/sources/models-dev.js +15 -4
- package/backend/dist/opencode/catalog/types.d.ts +10 -7
- package/backend/dist/opencode/connector.d.ts +2 -2
- package/backend/dist/opencode/connector.js +2 -2
- package/backend/dist/opencode/credentials/def-materialize.d.ts +0 -5
- package/backend/dist/opencode/credentials/def-materialize.js +149 -11
- package/backend/dist/opencode/credentials/ocr-store.d.ts +18 -0
- package/backend/dist/opencode/credentials/ocr-store.js +88 -7
- package/backend/dist/opencode/credentials/opencode-v2-store.d.ts +24 -13
- package/backend/dist/opencode/credentials/opencode-v2-store.js +70 -29
- package/backend/dist/opencode/credentials/paths.d.ts +8 -0
- package/backend/dist/opencode/credentials/paths.js +10 -0
- package/backend/dist/opencode/credentials/sync.d.ts +1 -1
- package/backend/dist/opencode/credentials/sync.js +4 -4
- package/backend/dist/opencode/credentials/types.d.ts +40 -4
- package/backend/dist/opencode/probe.d.ts +9 -5
- package/backend/dist/opencode/probe.js +68 -15
- package/backend/dist/opencode/provider-defs.js +59 -2
- package/backend/dist/opencode/provider-package.d.ts +31 -0
- package/backend/dist/opencode/provider-package.js +70 -0
- package/backend/dist/opencode/user-config.d.ts +11 -17
- package/backend/dist/opencode/user-config.js +42 -66
- package/backend/dist/pipeline/credential-selection.d.ts +13 -0
- package/backend/dist/pipeline/credential-selection.js +29 -1
- package/backend/dist/pipeline/directives.d.ts +14 -22
- package/backend/dist/pipeline/directives.js +122 -68
- package/backend/dist/pipeline/orchestrator.d.ts +42 -7
- package/backend/dist/pipeline/orchestrator.js +736 -235
- package/backend/dist/pipeline/prompt-optimizer.d.ts +6 -13
- package/backend/dist/pipeline/prompt-optimizer.js +9 -52
- package/backend/dist/pipeline/streaming-posture.d.ts +29 -0
- package/backend/dist/pipeline/streaming-posture.js +27 -0
- package/backend/dist/pipeline/tool-pairing.d.ts +10 -0
- package/backend/dist/pipeline/tool-pairing.js +90 -0
- package/backend/dist/plugins/builtin/model-gateway.d.ts +30 -0
- package/backend/dist/plugins/builtin/model-gateway.js +98 -0
- package/backend/dist/plugins/config.d.ts +41 -0
- package/backend/dist/plugins/config.js +113 -0
- package/backend/dist/plugins/gateways.d.ts +98 -0
- package/backend/dist/plugins/gateways.js +151 -0
- package/backend/dist/plugins/host.d.ts +203 -0
- package/backend/dist/plugins/host.js +1310 -0
- package/backend/dist/plugins/manifest.d.ts +43 -0
- package/backend/dist/plugins/manifest.js +462 -0
- package/backend/dist/plugins/pack.d.ts +32 -0
- package/backend/dist/plugins/pack.js +222 -0
- package/backend/dist/plugins/seed.d.ts +53 -0
- package/backend/dist/plugins/seed.js +136 -0
- package/backend/dist/plugins/types.d.ts +721 -0
- package/backend/dist/plugins/types.js +1 -0
- package/backend/dist/projects/store.d.ts +56 -0
- package/backend/dist/projects/store.js +194 -0
- package/backend/dist/projects/types.d.ts +12 -0
- package/backend/dist/projects/types.js +1 -0
- package/backend/dist/protocols/chat-compat.d.ts +2 -0
- package/backend/dist/protocols/chat-compat.js +137 -0
- package/backend/dist/protocols/systemone/convert.d.ts +5 -4
- package/backend/dist/protocols/systemone/convert.js +72 -26
- package/backend/dist/protocols/systemone/decide.js +128 -51
- package/backend/dist/protocols/systemone/native.d.ts +1 -1
- package/backend/dist/protocols/systemone/native.js +6 -6
- package/backend/dist/providers/anthropic.js +6 -6
- package/backend/dist/providers/base.d.ts +8 -47
- package/backend/dist/providers/boot-direct.d.ts +20 -2
- package/backend/dist/providers/boot-direct.js +72 -23
- package/backend/dist/providers/compat/tool-markup-leak.d.ts +41 -0
- package/backend/dist/providers/compat/tool-markup-leak.js +57 -0
- package/backend/dist/providers/compat/tool-markup-recovery.d.ts +27 -0
- package/backend/dist/providers/compat/tool-markup-recovery.js +831 -0
- package/backend/dist/providers/dispatch.d.ts +5 -8
- package/backend/dist/providers/dispatch.js +18 -12
- package/backend/dist/providers/executors/anthropic-messages.d.ts +12 -0
- package/backend/dist/providers/executors/anthropic-messages.js +56 -0
- package/backend/dist/providers/executors/dispatch.d.ts +14 -0
- package/backend/dist/providers/executors/dispatch.js +71 -0
- package/backend/dist/providers/executors/google-gemini.d.ts +12 -0
- package/backend/dist/providers/executors/google-gemini.js +53 -0
- package/backend/dist/providers/executors/http-json.d.ts +19 -0
- package/backend/dist/providers/executors/http-json.js +125 -0
- package/backend/dist/providers/executors/http-stream.d.ts +53 -0
- package/backend/dist/providers/executors/http-stream.js +472 -0
- package/backend/dist/providers/executors/openai-chat.d.ts +13 -0
- package/backend/dist/providers/executors/openai-chat.js +89 -0
- package/backend/dist/providers/executors/openai-responses.d.ts +12 -0
- package/backend/dist/providers/executors/openai-responses.js +71 -0
- package/backend/dist/providers/executors/plugin-adapter.d.ts +9 -0
- package/backend/dist/providers/executors/plugin-adapter.js +31 -0
- package/backend/dist/providers/google.js +6 -6
- package/backend/dist/providers/openai-compatible.js +13 -13
- package/backend/dist/providers/opencode-proxy.js +6 -6
- package/backend/dist/providers/plugin-wires.d.ts +34 -0
- package/backend/dist/providers/plugin-wires.js +82 -0
- package/backend/dist/providers/pool-refresh.d.ts +14 -0
- package/backend/dist/providers/pool-refresh.js +13 -0
- package/backend/dist/providers/protocol.d.ts +4 -0
- package/backend/dist/providers/protocol.js +61 -0
- package/backend/dist/providers/provider-takedown.d.ts +59 -0
- package/backend/dist/providers/provider-takedown.js +135 -0
- package/backend/dist/providers/registry.d.ts +37 -21
- package/backend/dist/providers/registry.js +204 -109
- package/backend/dist/providers/responses.d.ts +4 -2
- package/backend/dist/providers/responses.js +12 -9
- package/backend/dist/providers/vocabulary.d.ts +24 -6
- package/backend/dist/providers/vocabulary.js +75 -33
- package/backend/dist/providers/wire.d.ts +12 -17
- package/backend/dist/providers/wire.js +43 -91
- package/backend/dist/proxy/manual-node-spec.d.ts +92 -0
- package/backend/dist/proxy/manual-node-spec.js +408 -0
- package/backend/dist/proxy/mihomo-binary.d.ts +39 -0
- package/backend/dist/proxy/mihomo-binary.js +267 -0
- package/backend/dist/proxy/mihomo-client.d.ts +94 -0
- package/backend/dist/proxy/mihomo-client.js +294 -0
- package/backend/dist/proxy/mihomo-config.d.ts +40 -0
- package/backend/dist/proxy/mihomo-config.js +152 -0
- package/backend/dist/proxy/mihomo-pac.d.ts +26 -0
- package/backend/dist/proxy/mihomo-pac.js +60 -0
- package/backend/dist/proxy/mihomo-rules-import.d.ts +43 -0
- package/backend/dist/proxy/mihomo-rules-import.js +193 -0
- package/backend/dist/proxy/mihomo-sidecar.d.ts +65 -0
- package/backend/dist/proxy/mihomo-sidecar.js +515 -0
- package/backend/dist/quota/engine.d.ts +9 -2
- package/backend/dist/quota/engine.js +19 -1
- package/backend/dist/quota/prober.d.ts +8 -4
- package/backend/dist/quota/prober.js +9 -10
- package/backend/dist/ratelimit/rate-limiter.d.ts +119 -6
- package/backend/dist/ratelimit/rate-limiter.js +358 -20
- package/backend/dist/ratelimit/window-store.d.ts +34 -0
- package/backend/dist/ratelimit/window-store.js +70 -0
- package/backend/dist/resilience/breaker-state.js +8 -1
- package/backend/dist/resilience/circuit-breaker-manager.d.ts +229 -132
- package/backend/dist/resilience/circuit-breaker-manager.js +566 -297
- package/backend/dist/resilience/circuit-breaker.d.ts +11 -0
- package/backend/dist/resilience/circuit-breaker.js +39 -7
- package/backend/dist/resilience/error-classifier.d.ts +31 -3
- package/backend/dist/resilience/error-classifier.js +159 -31
- package/backend/dist/resilience/health-prober.d.ts +21 -4
- package/backend/dist/resilience/health-prober.js +100 -18
- package/backend/dist/resilience/types.d.ts +56 -9
- package/backend/dist/resilience/types.js +1 -1
- package/backend/dist/router/index.d.ts +6 -29
- package/backend/dist/router/index.js +15 -61
- package/backend/dist/router/layer2-decision.d.ts +2 -2
- package/backend/dist/router/layer2-decision.js +22 -19
- package/backend/dist/router/request-traits.d.ts +4 -11
- package/backend/dist/router/request-traits.js +5 -13
- package/backend/dist/routes/console.js +1948 -253
- package/backend/dist/routes/environments.d.ts +3 -2
- package/backend/dist/routes/environments.js +8 -4
- package/backend/dist/routes/harness.d.ts +3 -1
- package/backend/dist/routes/harness.js +1164 -355
- package/backend/dist/routes/mihomo.d.ts +5 -0
- package/backend/dist/routes/mihomo.js +882 -0
- package/backend/dist/routes/projects.d.ts +2 -0
- package/backend/dist/routes/projects.js +90 -0
- package/backend/dist/routes/responses.d.ts +20 -1
- package/backend/dist/routes/responses.js +65 -3
- package/backend/dist/routes/translation.d.ts +9 -0
- package/backend/dist/routes/translation.js +155 -0
- package/backend/dist/server.d.ts +0 -15
- package/backend/dist/server.js +388 -105
- package/backend/dist/session/resp-store.d.ts +18 -49
- package/backend/dist/session/resp-store.js +114 -122
- package/backend/dist/session/session-manager.d.ts +237 -81
- package/backend/dist/session/session-manager.js +445 -180
- package/backend/dist/session/session-row.d.ts +157 -0
- package/backend/dist/session/session-row.js +120 -0
- package/backend/dist/surfaces/anthropic.d.ts +1 -15
- package/backend/dist/surfaces/anthropic.js +63 -44
- package/backend/dist/surfaces/chat-pipeline.d.ts +8 -4
- package/backend/dist/surfaces/chat-pipeline.js +102 -35
- package/backend/dist/surfaces/chat.d.ts +1 -9
- package/backend/dist/surfaces/chat.js +52 -29
- package/backend/dist/surfaces/decision-pipeline.js +26 -18
- package/backend/dist/surfaces/gateway-chat.d.ts +53 -0
- package/backend/dist/surfaces/gateway-chat.js +204 -0
- package/backend/dist/surfaces/ocr-headers.d.ts +25 -4
- package/backend/dist/surfaces/ocr-headers.js +52 -6
- package/backend/dist/surfaces/responses.d.ts +9 -1
- package/backend/dist/surfaces/responses.js +141 -141
- package/backend/dist/surfaces/systemone-probe.js +1 -1
- package/backend/dist/surfaces/systemone.d.ts +1 -1
- package/backend/dist/surfaces/systemone.js +1 -1
- package/backend/dist/surfaces/table.d.ts +15 -0
- package/backend/dist/surfaces/table.js +15 -0
- package/backend/dist/surfaces/transport-backpressure.d.ts +46 -0
- package/backend/dist/surfaces/transport-backpressure.js +122 -0
- package/backend/dist/surfaces/transport-fastify.js +92 -21
- package/backend/dist/surfaces/transport-node-http.js +92 -18
- package/backend/dist/surfaces/types.d.ts +74 -12
- package/backend/dist/trace/persist.d.ts +5 -0
- package/backend/dist/trace/persist.js +185 -24
- package/backend/dist/trace/tracker.d.ts +153 -16
- package/backend/dist/trace/tracker.js +77 -27
- package/backend/dist/translation/index.d.ts +151 -0
- package/backend/dist/translation/index.js +735 -0
- package/backend/dist/types/openai.d.ts +82 -1
- package/backend/dist/types/router.d.ts +71 -6
- package/backend/dist/types/router.js +33 -1
- package/backend/dist/update/check.d.ts +43 -0
- package/backend/dist/update/check.js +126 -0
- package/backend/dist/utils/chat-sse.d.ts +2 -22
- package/backend/dist/utils/chat-sse.js +1 -69
- package/backend/dist/utils/chat-stream.d.ts +2 -1
- package/backend/dist/utils/client-envelope.d.ts +108 -0
- package/backend/dist/utils/client-envelope.js +305 -0
- package/backend/dist/utils/event-ring.d.ts +8 -1
- package/backend/dist/utils/event-ring.js +13 -5
- package/backend/dist/utils/harness-profiles.d.ts +51 -0
- package/backend/dist/utils/harness-profiles.js +70 -0
- package/backend/dist/utils/percentile.d.ts +16 -0
- package/backend/dist/utils/percentile.js +29 -0
- package/backend/dist/utils/popularity.d.ts +4 -0
- package/backend/dist/utils/popularity.js +33 -0
- package/backend/dist/utils/probe-interval.d.ts +12 -0
- package/backend/dist/utils/probe-interval.js +16 -0
- package/backend/dist/utils/proxy-node.d.ts +13 -0
- package/backend/dist/utils/proxy-node.js +471 -0
- package/backend/dist/utils/proxy.d.ts +12 -0
- package/backend/dist/utils/proxy.js +44 -4
- package/backend/dist/utils/run-command.d.ts +42 -0
- package/backend/dist/utils/run-command.js +93 -0
- package/backend/dist/utils/self-url.d.ts +13 -0
- package/backend/dist/utils/self-url.js +90 -2
- package/backend/dist/utils/semver.d.ts +22 -0
- package/backend/dist/utils/semver.js +75 -0
- package/backend/dist/utils/stream-relay.d.ts +35 -0
- package/backend/dist/utils/stream-relay.js +1 -0
- package/backend/dist/utils/upstream-url-guard.d.ts +15 -0
- package/backend/dist/utils/upstream-url-guard.js +107 -0
- package/backend/dist/validator/parser.d.ts +2 -5
- package/backend/dist/validator/parser.js +12 -16
- package/backend/dist/validator/schema-assertion.d.ts +3 -2
- package/backend/dist/validator/schema-assertion.js +53 -8
- package/bin/ocr.js +2 -2
- package/frontend/dist/assets/index-CLvxJjp_.js +1476 -0
- package/frontend/dist/assets/index-CQSLGFTV.css +1 -0
- package/frontend/dist/assets/qoder.color-tVX5GCcD.svg +5 -0
- package/frontend/dist/index.html +2 -2
- package/frontend/dist/provider-logos/302ai.svg +7 -0
- package/frontend/dist/provider-logos/NOTICE.txt +39 -0
- package/frontend/dist/provider-logos/abacus.svg +14 -0
- package/frontend/dist/provider-logos/abliteration-ai.svg +6 -0
- package/frontend/dist/provider-logos/above.svg +3 -0
- package/frontend/dist/provider-logos/agentrouter.svg +4 -0
- package/frontend/dist/provider-logos/agnes.svg +1 -0
- package/frontend/dist/provider-logos/ai-router.svg +5 -0
- package/frontend/dist/provider-logos/ai21.svg +3 -0
- package/frontend/dist/provider-logos/aiand.svg +4 -0
- package/frontend/dist/provider-logos/aihubmix.svg +3 -0
- package/frontend/dist/provider-logos/aimlapi.svg +3 -0
- package/frontend/dist/provider-logos/ainetcafe.svg +1 -0
- package/frontend/dist/provider-logos/aixy.svg +4 -0
- package/frontend/dist/provider-logos/aki-io.svg +8 -0
- package/frontend/dist/provider-logos/alibaba-cn.svg +3 -0
- package/frontend/dist/provider-logos/alibaba-coding-plan-cn.svg +3 -0
- package/frontend/dist/provider-logos/alibaba-coding-plan.svg +3 -0
- package/frontend/dist/provider-logos/alibaba-token-plan-cn.svg +1 -0
- package/frontend/dist/provider-logos/alibaba-token-plan.svg +1 -0
- package/frontend/dist/provider-logos/alibaba.svg +3 -0
- package/frontend/dist/provider-logos/amazon-bedrock.svg +3 -0
- package/frontend/dist/provider-logos/ambient.svg +3 -0
- package/frontend/dist/provider-logos/amd.svg +3 -0
- package/frontend/dist/provider-logos/anthropic.svg +3 -0
- package/frontend/dist/provider-logos/anyapi.svg +3 -0
- package/frontend/dist/provider-logos/arcee.svg +3 -0
- package/frontend/dist/provider-logos/atomic-chat.svg +1 -0
- package/frontend/dist/provider-logos/auriko.svg +6 -0
- package/frontend/dist/provider-logos/azure-cognitive-services.svg +3 -0
- package/frontend/dist/provider-logos/azure.svg +3 -0
- package/frontend/dist/provider-logos/bailing.svg +3 -0
- package/frontend/dist/provider-logos/baseten.svg +3 -0
- package/frontend/dist/provider-logos/bee.svg +1 -0
- package/frontend/dist/provider-logos/berget.svg +3 -0
- package/frontend/dist/provider-logos/blueclaw.svg +3 -0
- package/frontend/dist/provider-logos/bothub.svg +33 -0
- package/frontend/dist/provider-logos/boundless.svg +12 -0
- package/frontend/dist/provider-logos/cerebras.svg +4 -0
- package/frontend/dist/provider-logos/chutes.svg +24 -0
- package/frontend/dist/provider-logos/clarifai.svg +3 -0
- package/frontend/dist/provider-logos/claudinio.svg +19 -0
- package/frontend/dist/provider-logos/cline-pass.svg +24 -0
- package/frontend/dist/provider-logos/cloudferro-sherlock.svg +5 -0
- package/frontend/dist/provider-logos/cloudflare-ai-gateway.svg +4 -0
- package/frontend/dist/provider-logos/cloudflare-workers-ai.svg +4 -0
- package/frontend/dist/provider-logos/cohere.svg +5 -0
- package/frontend/dist/provider-logos/commandcode.svg +11 -0
- package/frontend/dist/provider-logos/coralbricks.svg +6 -0
- package/frontend/dist/provider-logos/cortecs.svg +24 -0
- package/frontend/dist/provider-logos/crossmodel.svg +5 -0
- package/frontend/dist/provider-logos/crusoe.svg +23 -0
- package/frontend/dist/provider-logos/daoxe.svg +3 -0
- package/frontend/dist/provider-logos/databricks.svg +3 -0
- package/frontend/dist/provider-logos/deepinfra.svg +4 -0
- package/frontend/dist/provider-logos/deepseek.svg +3 -0
- package/frontend/dist/provider-logos/digitalocean.svg +6 -0
- package/frontend/dist/provider-logos/dinference.svg +1 -0
- package/frontend/dist/provider-logos/drun.svg +8 -0
- package/frontend/dist/provider-logos/ebcloud.svg +8 -0
- package/frontend/dist/provider-logos/echo.svg +7 -0
- package/frontend/dist/provider-logos/edenai.svg +8 -0
- package/frontend/dist/provider-logos/empiriolabs.svg +1 -0
- package/frontend/dist/provider-logos/engy.svg +1 -0
- package/frontend/dist/provider-logos/evroc.svg +3 -0
- package/frontend/dist/provider-logos/fastrouter.svg +3 -0
- package/frontend/dist/provider-logos/fireworks-ai.svg +3 -0
- package/frontend/dist/provider-logos/freemodel.svg +3 -0
- package/frontend/dist/provider-logos/friendli.svg +3 -0
- package/frontend/dist/provider-logos/frogbot.svg +36 -0
- package/frontend/dist/provider-logos/github-copilot.svg +3 -0
- package/frontend/dist/provider-logos/gitlab.svg +3 -0
- package/frontend/dist/provider-logos/gmicloud.svg +24 -0
- package/frontend/dist/provider-logos/google-vertex-anthropic.svg +10 -0
- package/frontend/dist/provider-logos/google-vertex.svg +10 -0
- package/frontend/dist/provider-logos/google.svg +3 -0
- package/frontend/dist/provider-logos/greenpt.svg +6 -0
- package/frontend/dist/provider-logos/groq.svg +3 -0
- package/frontend/dist/provider-logos/helicone.svg +6 -0
- package/frontend/dist/provider-logos/hetzner.svg +3 -0
- package/frontend/dist/provider-logos/hopper.svg +4 -0
- package/frontend/dist/provider-logos/hpc-ai.svg +446 -0
- package/frontend/dist/provider-logos/huggingface.svg +3 -0
- package/frontend/dist/provider-logos/hyper.svg +20 -0
- package/frontend/dist/provider-logos/impossibl.svg +3 -0
- package/frontend/dist/provider-logos/inception.svg +14 -0
- package/frontend/dist/provider-logos/inceptron.svg +14 -0
- package/frontend/dist/provider-logos/inco.svg +3 -0
- package/frontend/dist/provider-logos/infer.svg +4 -0
- package/frontend/dist/provider-logos/inference.svg +3 -0
- package/frontend/dist/provider-logos/inferx.svg +5 -0
- package/frontend/dist/provider-logos/infomaniak.svg +3 -0
- package/frontend/dist/provider-logos/io-net.svg +5 -0
- package/frontend/dist/provider-logos/iteracompute.svg +7 -0
- package/frontend/dist/provider-logos/jalapeno.svg +8 -0
- package/frontend/dist/provider-logos/jiekou.svg +4 -0
- package/frontend/dist/provider-logos/kenari.svg +4 -0
- package/frontend/dist/provider-logos/kilo.svg +4 -0
- package/frontend/dist/provider-logos/kimi-code-plan-cn.svg +3 -0
- package/frontend/dist/provider-logos/kimi-code-plan-global.svg +3 -0
- package/frontend/dist/provider-logos/klokintegration.svg +11 -0
- package/frontend/dist/provider-logos/kosmik.svg +28 -0
- package/frontend/dist/provider-logos/kuae-cloud-coding-plan.svg +3 -0
- package/frontend/dist/provider-logos/lilac.svg +6 -0
- package/frontend/dist/provider-logos/liquid.svg +1 -0
- package/frontend/dist/provider-logos/llmgateway-providers.svg +6 -0
- package/frontend/dist/provider-logos/llmgateway.svg +6 -0
- package/frontend/dist/provider-logos/llmtech.svg +6 -0
- package/frontend/dist/provider-logos/llmtr.svg +12 -0
- package/frontend/dist/provider-logos/lmstudio.svg +3 -0
- package/frontend/dist/provider-logos/longcat.svg +6 -0
- package/frontend/dist/provider-logos/lowrouter.svg +8 -0
- package/frontend/dist/provider-logos/lucidquery.svg +3 -0
- package/frontend/dist/provider-logos/lynkr.svg +1 -0
- package/frontend/dist/provider-logos/meganova.svg +3 -0
- package/frontend/dist/provider-logos/melious.svg +3 -0
- package/frontend/dist/provider-logos/merge-gateway.svg +4 -0
- package/frontend/dist/provider-logos/meta.svg +3 -0
- package/frontend/dist/provider-logos/minimax-cn-coding-plan.svg +3 -0
- package/frontend/dist/provider-logos/minimax-cn.svg +3 -0
- package/frontend/dist/provider-logos/minimax-coding-plan.svg +3 -0
- package/frontend/dist/provider-logos/minimax.svg +3 -0
- package/frontend/dist/provider-logos/mistral.svg +3 -0
- package/frontend/dist/provider-logos/mixlayer.svg +9 -0
- package/frontend/dist/provider-logos/moark.svg +3 -0
- package/frontend/dist/provider-logos/modal.svg +3 -0
- package/frontend/dist/provider-logos/model-oracle-ai.svg +11 -0
- package/frontend/dist/provider-logos/modelis.svg +1 -0
- package/frontend/dist/provider-logos/modelscope.svg +5 -0
- package/frontend/dist/provider-logos/modular.svg +3 -0
- package/frontend/dist/provider-logos/moonshotai-cn.svg +3 -0
- package/frontend/dist/provider-logos/moonshotai.svg +3 -0
- package/frontend/dist/provider-logos/morph.svg +24 -0
- package/frontend/dist/provider-logos/munito-eu.svg +1 -0
- package/frontend/dist/provider-logos/munito.svg +1 -0
- package/frontend/dist/provider-logos/nan.svg +1 -0
- package/frontend/dist/provider-logos/nano-gpt.svg +3 -0
- package/frontend/dist/provider-logos/nearai.svg +1 -0
- package/frontend/dist/provider-logos/nebius.svg +4 -0
- package/frontend/dist/provider-logos/neon.svg +3 -0
- package/frontend/dist/provider-logos/neosmith.svg +6 -0
- package/frontend/dist/provider-logos/neuralwatt.svg +27 -0
- package/frontend/dist/provider-logos/nova.svg +3 -0
- package/frontend/dist/provider-logos/novita-ai.svg +10 -0
- package/frontend/dist/provider-logos/nvidia.svg +3 -0
- package/frontend/dist/provider-logos/oci.svg +3 -0
- package/frontend/dist/provider-logos/ofox.svg +5 -0
- package/frontend/dist/provider-logos/ollama-cloud.svg +7 -0
- package/frontend/dist/provider-logos/openai.svg +3 -0
- package/frontend/dist/provider-logos/opencode-go.svg +4 -0
- package/frontend/dist/provider-logos/opencode.svg +4 -0
- package/frontend/dist/provider-logos/openreason.svg +8 -0
- package/frontend/dist/provider-logos/openrouter.svg +5 -0
- package/frontend/dist/provider-logos/opper.svg +3 -0
- package/frontend/dist/provider-logos/orcarouter.svg +2 -0
- package/frontend/dist/provider-logos/ovhcloud.svg +3 -0
- package/frontend/dist/provider-logos/pareto.svg +5 -0
- package/frontend/dist/provider-logos/pendra.svg +10 -0
- package/frontend/dist/provider-logos/perplexity-agent.svg +3 -0
- package/frontend/dist/provider-logos/perplexity.svg +3 -0
- package/frontend/dist/provider-logos/pioneer.svg +3 -0
- package/frontend/dist/provider-logos/poe.svg +7 -0
- package/frontend/dist/provider-logos/poolside.svg +3 -0
- package/frontend/dist/provider-logos/prime.svg +7 -0
- package/frontend/dist/provider-logos/privatemode-ai.svg +5 -0
- package/frontend/dist/provider-logos/qihang-ai.svg +9 -0
- package/frontend/dist/provider-logos/qiniu-ai.svg +7 -0
- package/frontend/dist/provider-logos/qvac.svg +6 -0
- package/frontend/dist/provider-logos/reflection.svg +3 -0
- package/frontend/dist/provider-logos/regolo-ai.svg +46 -0
- package/frontend/dist/provider-logos/requesty.svg +24 -0
- package/frontend/dist/provider-logos/routing-run.svg +4 -0
- package/frontend/dist/provider-logos/runinfra.svg +10 -0
- package/frontend/dist/provider-logos/sakana.svg +24 -0
- package/frontend/dist/provider-logos/salad-cloud.svg +15 -0
- package/frontend/dist/provider-logos/sambanova.svg +26 -0
- package/frontend/dist/provider-logos/sap-ai-core.svg +24 -0
- package/frontend/dist/provider-logos/sarvam.svg +24 -0
- package/frontend/dist/provider-logos/scaleway.svg +5 -0
- package/frontend/dist/provider-logos/scnet-token-plan.svg +8 -0
- package/frontend/dist/provider-logos/scx-ai.svg +1 -0
- package/frontend/dist/provider-logos/sensenova.svg +18 -0
- package/frontend/dist/provider-logos/siliconflow-cn.svg +3 -0
- package/frontend/dist/provider-logos/siliconflow.svg +3 -0
- package/frontend/dist/provider-logos/snowflake-cortex.svg +3 -0
- package/frontend/dist/provider-logos/stackit.svg +4 -0
- package/frontend/dist/provider-logos/standardcompute.svg +5 -0
- package/frontend/dist/provider-logos/stepfun-ai-step-plan.svg +16 -0
- package/frontend/dist/provider-logos/stepfun-ai.svg +16 -0
- package/frontend/dist/provider-logos/stepfun-step-plan.svg +16 -0
- package/frontend/dist/provider-logos/stepfun.svg +16 -0
- package/frontend/dist/provider-logos/subconscious.svg +3 -0
- package/frontend/dist/provider-logos/submodel.svg +3 -0
- package/frontend/dist/provider-logos/synthetic.svg +24 -0
- package/frontend/dist/provider-logos/tempr.svg +4 -0
- package/frontend/dist/provider-logos/tencent-coding-plan.svg +5 -0
- package/frontend/dist/provider-logos/tencent-token-plan.svg +3 -0
- package/frontend/dist/provider-logos/tencent-tokenhub.svg +3 -0
- package/frontend/dist/provider-logos/tensorx.svg +6 -0
- package/frontend/dist/provider-logos/the-grid-ai.svg +14 -0
- package/frontend/dist/provider-logos/thinkingmachines.svg +3 -0
- package/frontend/dist/provider-logos/tinfoil.svg +3 -0
- package/frontend/dist/provider-logos/togetherai.svg +4 -0
- package/frontend/dist/provider-logos/tokengo.svg +3 -0
- package/frontend/dist/provider-logos/tokenrouter.svg +4 -0
- package/frontend/dist/provider-logos/trustedrouter.svg +4 -0
- package/frontend/dist/provider-logos/umans-ai-coding-plan.svg +29 -0
- package/frontend/dist/provider-logos/umans-ai.svg +29 -0
- package/frontend/dist/provider-logos/unorouter.svg +7 -0
- package/frontend/dist/provider-logos/upstage.svg +24 -0
- package/frontend/dist/provider-logos/vancine.svg +6 -0
- package/frontend/dist/provider-logos/venice.svg +4 -0
- package/frontend/dist/provider-logos/vercel.svg +3 -0
- package/frontend/dist/provider-logos/vispark.svg +3 -0
- package/frontend/dist/provider-logos/vivgrid.svg +4 -0
- package/frontend/dist/provider-logos/volcengine-coding-plan.svg +1 -0
- package/frontend/dist/provider-logos/volcengine.svg +1 -0
- package/frontend/dist/provider-logos/vultr.svg +6 -0
- package/frontend/dist/provider-logos/wafer.ai.svg +3 -0
- package/frontend/dist/provider-logos/wallaby.svg +4 -0
- package/frontend/dist/provider-logos/wally.svg +1 -0
- package/frontend/dist/provider-logos/wandb.svg +6 -0
- package/frontend/dist/provider-logos/watsonx.svg +5 -0
- package/frontend/dist/provider-logos/xai.svg +3 -0
- package/frontend/dist/provider-logos/xiaomi-token-plan-ams.svg +3 -0
- package/frontend/dist/provider-logos/xiaomi-token-plan-cn.svg +3 -0
- package/frontend/dist/provider-logos/xiaomi-token-plan-sgp.svg +3 -0
- package/frontend/dist/provider-logos/xiaomi.svg +3 -0
- package/frontend/dist/provider-logos/xpersona.svg +8 -0
- package/frontend/dist/provider-logos/zai-coding-plan.svg +3 -0
- package/frontend/dist/provider-logos/zai.svg +3 -0
- package/frontend/dist/provider-logos/zeldoc.svg +3 -0
- package/frontend/dist/provider-logos/zenifra.svg +4 -0
- package/frontend/dist/provider-logos/zenmux.svg +4 -0
- package/frontend/dist/provider-logos/zhipuai-coding-plan.svg +3 -0
- package/frontend/dist/provider-logos/zhipuai.svg +3 -0
- package/package.json +13 -5
- package/backend/dist/cli/clients/opencode-proxy.d.ts +0 -16
- package/backend/dist/cli/clients/opencode-proxy.js +0 -372
- package/backend/dist/forward-proxy/bypass.d.ts +0 -20
- package/backend/dist/forward-proxy/bypass.js +0 -28
- package/backend/dist/harness/adapters/amp.d.ts +0 -2
- package/backend/dist/harness/adapters/amp.js +0 -7
- package/backend/dist/harness/adapters/claude.d.ts +0 -2
- package/backend/dist/harness/adapters/claude.js +0 -7
- package/backend/dist/harness/adapters/cline.d.ts +0 -2
- package/backend/dist/harness/adapters/cline.js +0 -6
- package/backend/dist/harness/adapters/codex.d.ts +0 -2
- package/backend/dist/harness/adapters/codex.js +0 -6
- package/backend/dist/harness/adapters/cursor.d.ts +0 -5
- package/backend/dist/harness/adapters/cursor.js +0 -10
- package/backend/dist/harness/adapters/declarative.d.ts +0 -62
- package/backend/dist/harness/adapters/declarative.js +0 -202
- package/backend/dist/harness/adapters/dsh.d.ts +0 -5
- package/backend/dist/harness/adapters/dsh.js +0 -6
- package/backend/dist/harness/adapters/gemini-cli.d.ts +0 -2
- package/backend/dist/harness/adapters/gemini-cli.js +0 -7
- package/backend/dist/harness/adapters/github-copilot.d.ts +0 -5
- package/backend/dist/harness/adapters/github-copilot.js +0 -10
- package/backend/dist/harness/adapters/opencode.d.ts +0 -2
- package/backend/dist/harness/adapters/opencode.js +0 -55
- package/backend/dist/harness/adapters/pi.d.ts +0 -1
- package/backend/dist/harness/adapters/pi.js +0 -22
- package/backend/dist/harness/adapters/types.d.ts +0 -174
- package/backend/dist/harness/adapters/types.js +0 -12
- package/backend/dist/harness/adapters/universal.d.ts +0 -6
- package/backend/dist/harness/adapters/universal.js +0 -10
- package/backend/dist/harness/adapters/windsurf.d.ts +0 -2
- package/backend/dist/harness/adapters/windsurf.js +0 -10
- package/backend/dist/harness/adapters/zed.d.ts +0 -2
- package/backend/dist/harness/adapters/zed.js +0 -6
- package/backend/dist/harness/awesome-opencode.d.ts +0 -40
- package/backend/dist/harness/awesome-opencode.js +0 -75
- package/backend/dist/harness/browse.d.ts +0 -202
- package/backend/dist/harness/browse.js +0 -1214
- package/backend/dist/harness/inventory.d.ts +0 -10
- package/backend/dist/harness/opencode-cafe.d.ts +0 -40
- package/backend/dist/harness/opencode-cafe.js +0 -85
- package/backend/dist/harness/opencode-ecosystem.d.ts +0 -34
- package/backend/dist/harness/opencode-ecosystem.js +0 -246
- package/backend/dist/harness/pi-dev.d.ts +0 -81
- package/backend/dist/harness/pi-dev.js +0 -187
- package/backend/dist/harness/registry.js +0 -26
- package/backend/dist/harness/scopes.d.ts +0 -21
- package/backend/dist/harness/scopes.js +0 -22
- package/backend/dist/harness/skills-sh.d.ts +0 -109
- package/backend/dist/harness/skills-sh.js +0 -178
- package/backend/dist/harness/smithery.d.ts +0 -64
- package/backend/dist/harness/smithery.js +0 -146
- package/backend/dist/harness/sources/awesome-opencode.d.ts +0 -11
- package/backend/dist/harness/sources/awesome-opencode.js +0 -39
- package/backend/dist/harness/sources/mcp-official.d.ts +0 -2
- package/backend/dist/harness/sources/mcp-official.js +0 -110
- package/backend/dist/harness/sources/npm.d.ts +0 -2
- package/backend/dist/harness/sources/opencode-cafe.d.ts +0 -11
- package/backend/dist/harness/sources/opencode-cafe.js +0 -41
- package/backend/dist/harness/sources/smithery.d.ts +0 -2
- package/backend/dist/harness/sources/smithery.js +0 -81
- package/backend/dist/harness/writers/extension.d.ts +0 -116
- package/backend/dist/harness/writers/extension.js +0 -219
- package/backend/dist/harness/writers/mcp.d.ts +0 -72
- package/backend/dist/harness/writers/mcp.js +0 -195
- package/backend/dist/observability/trace-id.d.ts +0 -40
- package/backend/dist/observability/trace-id.js +0 -134
- package/frontend/dist/assets/index-1o7qI-KJ.css +0 -1
- package/frontend/dist/assets/index-DvXKvNxl.js +0 -962
- package/frontend/dist/assets/inter-cyrillic-800-normal-C7MGvYyJ.woff2 +0 -0
- package/frontend/dist/assets/inter-cyrillic-800-normal-CCHyn08d.woff +0 -0
- package/frontend/dist/assets/inter-cyrillic-ext-800-normal-BZOjs1Xv.woff2 +0 -0
- package/frontend/dist/assets/inter-cyrillic-ext-800-normal-Ca-gJeZY.woff +0 -0
- package/frontend/dist/assets/inter-greek-800-normal-BU00tryP.woff +0 -0
- package/frontend/dist/assets/inter-greek-800-normal-CLIouy3y.woff2 +0 -0
- package/frontend/dist/assets/inter-greek-ext-800-normal-B--PVpEC.woff2 +0 -0
- package/frontend/dist/assets/inter-greek-ext-800-normal-DUe57HfS.woff +0 -0
- package/frontend/dist/assets/inter-latin-800-normal-BYj_oED-.woff2 +0 -0
- package/frontend/dist/assets/inter-latin-800-normal-D1mf63XC.woff +0 -0
- package/frontend/dist/assets/inter-latin-ext-800-normal-BOMpwxm3.woff +0 -0
- package/frontend/dist/assets/inter-latin-ext-800-normal-DZJjya6U.woff2 +0 -0
- package/frontend/dist/assets/inter-vietnamese-800-normal-Cm7tD1pz.woff2 +0 -0
- package/frontend/dist/assets/inter-vietnamese-800-normal-DDlpr_Ee.woff +0 -0
- /package/backend/dist/harness/{adapters → host/adapters}/skills-paths.d.ts +0 -0
- /package/backend/dist/harness/{adapters → host/adapters}/skills-paths.js +0 -0
- /package/backend/dist/harness/{skill-md.d.ts → skill/skill-md.d.ts} +0 -0
- /package/backend/dist/harness/{skill-md.js → skill/skill-md.js} +0 -0
|
@@ -1,1214 +0,0 @@
|
|
|
1
|
-
import { OPENCODE_ECOSYSTEM } from './opencode-ecosystem.js';
|
|
2
|
-
import { fetchAwesomeRegistry } from './awesome-opencode.js';
|
|
3
|
-
import { fetchCafeExtensions } from './opencode-cafe.js';
|
|
4
|
-
import { fetchPiDevCatalog, PI_DEV_PAGE_SIZE } from './pi-dev.js';
|
|
5
|
-
import { fetchSmitheryServers } from './smithery.js';
|
|
6
|
-
import { fetchSkillsShPage, isSkillsShBoard, searchSkillsSh, SKILLS_SH_MIN_QUERY, SKILLS_SH_PAGE_SIZE, SKILLS_SH_SEARCH_LIMIT, } from './skills-sh.js';
|
|
7
|
-
import { CLAWHUB_SEARCH_LIMIT, CLAWHUB_WALK_MAX, fetchClawHubCatalogPage, fetchClawHubSearch } from './clawhub.js';
|
|
8
|
-
import { repoSlug } from './catalog-npm.js';
|
|
9
|
-
import { describeFetchFailure, fetchFailureReason, fetchWithRetry } from './net.js';
|
|
10
|
-
/**
|
|
11
|
-
* Marketplace browse (ADR-0015 §8, slice T4-lite).
|
|
12
|
-
*
|
|
13
|
-
* The console needs ONE standard shape from every source, so the adapter does the normalizing and
|
|
14
|
-
* the page never learns a vendor's JSON. Ten sources are live: GitHub (skills), the npm registry
|
|
15
|
-
* (extension and MCP packages), the official pi.dev package catalog (extension packages, read from the
|
|
16
|
-
* server-rendered catalog page), the skills.sh leaderboards (skills, read from the site's
|
|
17
|
-
* server-rendered boards — its API is closed to callers without a Vercel workload token), the
|
|
18
|
-
* ClawHub community registry (skills, read through its own public API and installed from the
|
|
19
|
-
* registry's own versioned store), the awesome-opencode community registry and the opencode.cafe
|
|
20
|
-
* community catalog (extension packages,
|
|
21
|
-
* read through their own APIs), the official MCP registry and Smithery (MCP servers — the registry
|
|
22
|
-
* indexes, Smithery hosts its own) and the curated OpenCode
|
|
23
|
-
* ecosystem snapshot (read from disk, no network). A source whose upstream cannot be read answers
|
|
24
|
-
* `unavailable` with the measured reason rather than rendering an empty market that looks broken.
|
|
25
|
-
*
|
|
26
|
-
* Anonymous GitHub search is rate limited (10 req/min), so results are cached briefly — typing in the
|
|
27
|
-
* search field must not spend the whole budget. npm search, the pi.dev catalog and the community
|
|
28
|
-
* catalogs are anonymous and share the cache. The curated catalog needs neither: it is in memory.
|
|
29
|
-
*/
|
|
30
|
-
const API = 'https://api.github.com';
|
|
31
|
-
const NPM_REGISTRY = 'https://registry.npmjs.org';
|
|
32
|
-
const CACHE_TTL_MS = 60_000;
|
|
33
|
-
/**
|
|
34
|
-
* Board pages of a leaderboard source live LONGER than a search answer.
|
|
35
|
-
*
|
|
36
|
-
* A ranking moves slowly (installs accumulate over days), while skills.sh throttles a burst with
|
|
37
|
-
* `429 + Retry-After: 60` after roughly 30 requests (measured 2026-10-25). Its all-time board is ~50
|
|
38
|
-
* upstream pages, so a deep scroll spends two throttle windows to reach the end — and a second visit
|
|
39
|
-
* would spend them again under the shared 60 s window. Ten minutes keeps that to one walk per window.
|
|
40
|
-
*
|
|
41
|
-
* This is NOT a licence to stop re-reading: the market's refresh button evicts the source's whole cache
|
|
42
|
-
* family before dispatch (`evictBrowseCache`), so an explicit "ask again" still reaches the site.
|
|
43
|
-
*/
|
|
44
|
-
const BOARD_TTL_MS = 10 * 60_000;
|
|
45
|
-
/**
|
|
46
|
-
* GitHub request headers — one place for the token, shared by every reader that talks to the API
|
|
47
|
-
* (browse and the on-demand star resolver). A second copy would drift the day one of them learns a
|
|
48
|
-
* new header.
|
|
49
|
-
*/
|
|
50
|
-
export function githubHeaders() {
|
|
51
|
-
const token = process.env.GITHUB_TOKEN?.trim();
|
|
52
|
-
return {
|
|
53
|
-
Accept: 'application/vnd.github+json',
|
|
54
|
-
'User-Agent': 'omnicellrouter-harness',
|
|
55
|
-
...(token ? { Authorization: `Bearer ${token}` } : {}),
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
/** Deterministic alphabetical order for full-catalog sources (id breaks name ties). */
|
|
59
|
-
function byName(rows) {
|
|
60
|
-
return [...rows].sort((a, b) => a.name.localeCompare(b.name) || a.id.localeCompare(b.id));
|
|
61
|
-
}
|
|
62
|
-
const cache = new Map();
|
|
63
|
-
/** Row pages, keyed `<source>|<query>|<size>|<index>`; the cursor for that page is kept separately. */
|
|
64
|
-
const mcpPages = new Map();
|
|
65
|
-
/** Cursor chains, one per (query, page size): `chain[i]` is the cursor that fetches page `i`. */
|
|
66
|
-
const mcpCursors = new Map();
|
|
67
|
-
/** ClawHub pages and cursor chains — the same shape as the MCP registry's (a cursor API has no
|
|
68
|
-
* offset, so page N is only reachable by walking N-1 recorded cursors). */
|
|
69
|
-
const clawhubPages = new Map();
|
|
70
|
-
const clawhubCursors = new Map();
|
|
71
|
-
/** Drop the whole browse cache (tests, and any caller that cannot name one source): the TTL is a
|
|
72
|
-
* rate-limit shield, not a correctness contract. */
|
|
73
|
-
export function resetBrowseCache() {
|
|
74
|
-
cache.clear();
|
|
75
|
-
mcpPages.clear();
|
|
76
|
-
mcpCursors.clear();
|
|
77
|
-
clawhubPages.clear();
|
|
78
|
-
clawhubCursors.clear();
|
|
79
|
-
}
|
|
80
|
-
/** The first segment of every cache key, per source: the adapter that owns that window. */
|
|
81
|
-
const CACHE_PREFIX = {
|
|
82
|
-
github: 'github|',
|
|
83
|
-
npm: 'npm|',
|
|
84
|
-
'pi-dev': 'pi-dev|',
|
|
85
|
-
'skills-sh': 'skills-sh|',
|
|
86
|
-
'awesome-opencode': 'awesome|',
|
|
87
|
-
'opencode-cafe': 'cafe|',
|
|
88
|
-
'mcp-official': 'mcp|',
|
|
89
|
-
smithery: 'smithery|',
|
|
90
|
-
clawhub: 'clawhub|',
|
|
91
|
-
// `static-opencode` reads a bundled snapshot — it never caches, so it has nothing to drop.
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* Drop ONE source's cached pages, so the next read asks upstream again.
|
|
95
|
-
*
|
|
96
|
-
* Only an explicit operator refresh reaches here (`browseSource(..., { refresh: true })`): the 60 s
|
|
97
|
-
* window exists to shield the anonymous quota, and a forced re-read is the one caller that means
|
|
98
|
-
* "that window is stale, ask now". It is narrowed to one source on purpose — refreshing GitHub must
|
|
99
|
-
* not discard the npm or pi.dev window another tab just warmed.
|
|
100
|
-
*/
|
|
101
|
-
export function evictBrowseCache(sourceId) {
|
|
102
|
-
const prefix = CACHE_PREFIX[sourceId];
|
|
103
|
-
if (!prefix)
|
|
104
|
-
return;
|
|
105
|
-
for (const key of [...cache.keys()])
|
|
106
|
-
if (key.startsWith(prefix))
|
|
107
|
-
cache.delete(key);
|
|
108
|
-
// The MCP adapter keeps its own two families (row pages and the cursor chain that reaches them),
|
|
109
|
-
// both under the same `<source>|` prefix so one refresh drops all three.
|
|
110
|
-
for (const key of [...mcpPages.keys()])
|
|
111
|
-
if (key.startsWith(prefix))
|
|
112
|
-
mcpPages.delete(key);
|
|
113
|
-
for (const key of [...mcpCursors.keys()])
|
|
114
|
-
if (key.startsWith(prefix))
|
|
115
|
-
mcpCursors.delete(key);
|
|
116
|
-
// ClawHub keeps the same two families (row pages and the cursor chain that reaches them).
|
|
117
|
-
for (const key of [...clawhubPages.keys()])
|
|
118
|
-
if (key.startsWith(prefix))
|
|
119
|
-
clawhubPages.delete(key);
|
|
120
|
-
for (const key of [...clawhubCursors.keys()])
|
|
121
|
-
if (key.startsWith(prefix))
|
|
122
|
-
clawhubCursors.delete(key);
|
|
123
|
-
}
|
|
124
|
-
/** Public repositories that carry skills. A single `topic:` qualifier — GitHub answers 422 to
|
|
125
|
-
* the unparenthesized OR-combination of qualifiers. */
|
|
126
|
-
const DEFAULT_QUERY = 'topic:claude-skills';
|
|
127
|
-
function toItem(repo) {
|
|
128
|
-
return {
|
|
129
|
-
id: `github:${repo.full_name}`,
|
|
130
|
-
sourceId: 'github',
|
|
131
|
-
key: `github:${repo.full_name}`,
|
|
132
|
-
installKind: 'skill',
|
|
133
|
-
name: repo.name,
|
|
134
|
-
repo: repo.full_name,
|
|
135
|
-
description: repo.description,
|
|
136
|
-
url: repo.html_url,
|
|
137
|
-
stars: repo.stargazers_count,
|
|
138
|
-
updatedAt: repo.pushed_at,
|
|
139
|
-
topics: repo.topics ?? [],
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
export async function browseGitHub(query, limit = 24, page = 1, sort = 'stars') {
|
|
143
|
-
const q = query.trim() || DEFAULT_QUERY;
|
|
144
|
-
const perPage = Math.min(Math.max(limit, 1), 50);
|
|
145
|
-
const at = Math.max(page, 1);
|
|
146
|
-
// GitHub's published orderings; `best-match` means "omit sort", which is the API default ranking.
|
|
147
|
-
const ORDER = {
|
|
148
|
-
stars: 'stars',
|
|
149
|
-
forks: 'forks',
|
|
150
|
-
updated: 'updated',
|
|
151
|
-
// GitHub's fourth documented value: ranks by open issues carrying the `help wanted` label.
|
|
152
|
-
'help-wanted-issues': 'help-wanted-issues',
|
|
153
|
-
'best-match': null,
|
|
154
|
-
};
|
|
155
|
-
const order = sort in ORDER ? sort : 'stars';
|
|
156
|
-
const upstream = ORDER[order];
|
|
157
|
-
const key = `github|${q}|${perPage}|${at}|${order}`;
|
|
158
|
-
const note = process.env.GITHUB_TOKEN?.trim() ? undefined : 'anonymous GitHub search: 10 requests/minute';
|
|
159
|
-
const noteCode = process.env.GITHUB_TOKEN?.trim() ? undefined : 'github-anonymous';
|
|
160
|
-
const hit = cache.get(key);
|
|
161
|
-
if (hit && Date.now() - hit.at < CACHE_TTL_MS) {
|
|
162
|
-
return { ok: true, items: hit.items, note, ...(noteCode ? { noteCode } : {}), hasMore: hit.hasMore ?? false, ...(hit.total !== undefined ? { total: hit.total } : {}) };
|
|
163
|
-
}
|
|
164
|
-
// `order=desc` on every sort: best-match has no direction, and the other three are only useful
|
|
165
|
-
// from the top. Omitting `sort` entirely is what requests GitHub's relevance ranking.
|
|
166
|
-
const sortParam = upstream ? `&sort=${upstream}&order=desc` : '';
|
|
167
|
-
const url = `${API}/search/repositories?q=${encodeURIComponent(q)}${sortParam}&per_page=${perPage}&page=${at}`;
|
|
168
|
-
let res;
|
|
169
|
-
try {
|
|
170
|
-
// Every failed answer is retried inside the shared policy (`net.ts`); a 403/429 that outlasts
|
|
171
|
-
// the retries is mapped below.
|
|
172
|
-
res = await fetchWithRetry(url, { headers: githubHeaders() });
|
|
173
|
-
}
|
|
174
|
-
catch (e) {
|
|
175
|
-
return { ok: false, code: 'upstream', reason: fetchFailureReason(e), message: describeFetchFailure('GitHub search', e) };
|
|
176
|
-
}
|
|
177
|
-
if (res.status === 403 || res.status === 429) {
|
|
178
|
-
return {
|
|
179
|
-
ok: false,
|
|
180
|
-
code: 'unavailable',
|
|
181
|
-
reason: 'rateLimited',
|
|
182
|
-
message: 'GitHub search rate limit reached — set GITHUB_TOKEN to raise it',
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
if (!res.ok) {
|
|
186
|
-
return {
|
|
187
|
-
ok: false,
|
|
188
|
-
code: 'upstream',
|
|
189
|
-
reason: 'http',
|
|
190
|
-
reasonParams: { status: String(res.status) },
|
|
191
|
-
message: `GitHub returned HTTP ${res.status}`,
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
let payload;
|
|
195
|
-
try {
|
|
196
|
-
payload = (await res.json());
|
|
197
|
-
}
|
|
198
|
-
catch {
|
|
199
|
-
return { ok: false, code: 'upstream', reason: 'badPayload', message: 'GitHub search answered non-JSON content' };
|
|
200
|
-
}
|
|
201
|
-
const items = (payload.items ?? []).map(toItem);
|
|
202
|
-
// GitHub reports a total, but its search API refuses to page past 1000 rows — so the total the
|
|
203
|
-
// console may act on is the REACHABLE one. Reporting 50 000 would render a pager whose last 2 000
|
|
204
|
-
// pages answer empty.
|
|
205
|
-
const total = payload.total_count === undefined ? undefined : Math.min(payload.total_count, 1000);
|
|
206
|
-
const hasMore = total !== undefined ? at * perPage < total : items.length === perPage;
|
|
207
|
-
cache.set(key, { at: Date.now(), items, hasMore, ...(total !== undefined ? { total } : {}) });
|
|
208
|
-
return { ok: true, items, note, ...(noteCode ? { noteCode } : {}), hasMore, ...(total !== undefined ? { total } : {}) };
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Empty-query default, PER HARNESS. npm search ranks by relevance over the WHOLE registry, so an
|
|
212
|
-
* empty `text` returns unrelated popular packages — a market tab that looks broken. The `keywords:`
|
|
213
|
-
* qualifier is an exact tag filter (measured 2026-10-25: the first 250 rows of each query below all
|
|
214
|
-
* carry the tag), and npm declares one convention per runtime, so a page pinned to one harness opens
|
|
215
|
-
* on THAT runtime's catalog — never on another's. Anything the operator types is passed verbatim.
|
|
216
|
-
*
|
|
217
|
-
* Ecosystem size, measured the same day: `pi-package` 12 736 · `dsh-plugin` 10 048 ·
|
|
218
|
-
* `opencode-plugin` 2 684 · `claude-code-plugin` 656 · `codex-plugin` 118 ·
|
|
219
|
-
* `gemini-cli-extension` 18.
|
|
220
|
-
*
|
|
221
|
-
* A host with NO tag convention is deliberately ABSENT from this map. `cursor-extension` (2),
|
|
222
|
-
* `windsurf-extension` (1), `zed-extension` (2), `cline-plugin` (4), `amp-plugin` (0) and
|
|
223
|
-
* `copilot-extension` (8) are one cross-tagging package plus noise, so a `keywords:` default there
|
|
224
|
-
* would render an empty market and present it as a catalog. Those hosts open on the plain phrase
|
|
225
|
-
* below — a relevance query across runtimes, which is honest about being a guess.
|
|
226
|
-
*/
|
|
227
|
-
const NPM_DEFAULT_QUERY = {
|
|
228
|
-
pi: 'keywords:pi-package',
|
|
229
|
-
opencode: 'keywords:opencode-plugin',
|
|
230
|
-
dsh: 'keywords:dsh-plugin',
|
|
231
|
-
claude: 'keywords:claude-code-plugin',
|
|
232
|
-
codex: 'keywords:codex-plugin',
|
|
233
|
-
'gemini-cli': 'keywords:gemini-cli-extension',
|
|
234
|
-
};
|
|
235
|
-
/** Fallback for a host with no npm tag convention — plugin-shaped packages, any runtime. */
|
|
236
|
-
const NPM_FALLBACK_QUERY = 'coding agent plugin';
|
|
237
|
-
/** The empty-query expression one harness opens on (exported so a test can pin the mapping). */
|
|
238
|
-
export function npmDefaultQuery(harness) {
|
|
239
|
-
return NPM_DEFAULT_QUERY[harness] ?? NPM_FALLBACK_QUERY;
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* The empty-query expression the MCP axis opens on: the author's own `mcp-server` tag. Measured
|
|
243
|
-
* 2026-10-25: `keywords:mcp-server` matches 10 501 packages, while `keywords:model-context-protocol`
|
|
244
|
-
* casts the wider 41 344-row net but tags SDKs and clients as often as servers — the narrower tag
|
|
245
|
-
* is the honest default. `keywords:` is the same exact tag filter the per-harness map above relies
|
|
246
|
-
* on, and anything the operator types is passed verbatim, same as the extension axis.
|
|
247
|
-
*/
|
|
248
|
-
const NPM_MCP_QUERY = 'keywords:mcp-server';
|
|
249
|
-
/** The empty-query expression one (kind, harness) pair opens on (exported so a test can pin it). */
|
|
250
|
-
export function npmDefaultQueryFor(kind, harness) {
|
|
251
|
-
return kind === 'mcp' ? NPM_MCP_QUERY : npmDefaultQuery(harness);
|
|
252
|
-
}
|
|
253
|
-
function toNpmItem(pkg, installKind = 'extension') {
|
|
254
|
-
if (!pkg.name)
|
|
255
|
-
return null;
|
|
256
|
-
// npm search states the repository the package publishes (`git+https://…`, `git://…` and
|
|
257
|
-
// `https://…` are the same project), so the slug is parsed off a normalized URL. A row with a repo
|
|
258
|
-
// can have its stars resolved on demand (`harness/stars.ts`); a row without one cannot — and `null`
|
|
259
|
-
// says so, because npm itself publishes no star count.
|
|
260
|
-
const declared = (pkg.links?.repository ?? '').trim().replace(/^git\+/, '').replace(/^git:\/\//, 'https://');
|
|
261
|
-
const slug = repoSlug(declared.replace(/\.git$/, ''));
|
|
262
|
-
return {
|
|
263
|
-
id: `npm:${pkg.name}`,
|
|
264
|
-
sourceId: 'npm',
|
|
265
|
-
key: `npm:${pkg.name}`,
|
|
266
|
-
installKind,
|
|
267
|
-
name: pkg.name,
|
|
268
|
-
...(slug ? { repo: `${slug.owner}/${slug.repo}` } : {}),
|
|
269
|
-
description: pkg.description ?? null,
|
|
270
|
-
url: pkg.links?.npm ?? `https://www.npmjs.com/package/${pkg.name}`,
|
|
271
|
-
// npm exposes no star count; `null` keeps "unknown" distinguishable from "zero".
|
|
272
|
-
stars: null,
|
|
273
|
-
updatedAt: pkg.date ?? '',
|
|
274
|
-
topics: pkg.keywords ?? [],
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Orders npm's registry API cannot produce itself.
|
|
279
|
-
*
|
|
280
|
-
* `/-/v1/search` has no `sort` parameter and its documented `quality`/`popularity`/`maintenance`
|
|
281
|
-
* weights are inert today (measured 2026-10-25: 50-row result sets identical under three extreme
|
|
282
|
-
* weightings across five queries). So for these keys the BACKEND fetches one maximum-size window in
|
|
283
|
-
* the registry's own relevance order and orders that window server-side — the page still renders the
|
|
284
|
-
* order it was given, and the note names the window so the claim stays honest.
|
|
285
|
-
*/
|
|
286
|
-
const NPM_WINDOW = 250;
|
|
287
|
-
const NPM_WINDOW_SORTS = new Set(['name', 'updated']);
|
|
288
|
-
export async function browseNpm(query, limit = 24, defaultQuery = NPM_FALLBACK_QUERY, page = 1, sort = 'relevance', installKind = 'extension') {
|
|
289
|
-
const typed = query.trim();
|
|
290
|
-
const text = typed || defaultQuery;
|
|
291
|
-
const size = Math.min(Math.max(limit, 1), 50);
|
|
292
|
-
const at = Math.max(page, 1);
|
|
293
|
-
const from = (at - 1) * size;
|
|
294
|
-
const windowed = NPM_WINDOW_SORTS.has(sort);
|
|
295
|
-
// A windowed answer fetches once from the top and slices the sorted result, so `from`/`size` alone
|
|
296
|
-
// cannot describe it: the upstream request is always the whole window.
|
|
297
|
-
const fetchSize = windowed ? NPM_WINDOW : size;
|
|
298
|
-
const fetchFrom = windowed ? 0 : from;
|
|
299
|
-
// The console words the note, so it gets an IDENTITY (`noteCode`) plus params, never a sentence.
|
|
300
|
-
// A `keywords:` default reads as a tag; a phrase default must not claim to be one.
|
|
301
|
-
const tag = text.startsWith('keywords:') ? text.slice('keywords:'.length) : null;
|
|
302
|
-
let noteFields = typed
|
|
303
|
-
? {}
|
|
304
|
-
: tag !== null
|
|
305
|
-
? { note: `no query: showing packages tagged ${tag}`, noteCode: 'npm-keyword', noteParams: { keyword: tag } }
|
|
306
|
-
: {
|
|
307
|
-
note: `no query: this host publishes no npm tag — showing packages matching '${text}'`,
|
|
308
|
-
noteCode: 'npm-default',
|
|
309
|
-
noteParams: { query: text },
|
|
310
|
-
};
|
|
311
|
-
// The kind travels in the key: one typed query asked from two axes (an extension chip and an MCP
|
|
312
|
-
// chip) searches the same text but must not share rows — the install kind stamped on them differs.
|
|
313
|
-
const cacheKey = `npm|${installKind}|${text}|${size}|${at}|${sort}`;
|
|
314
|
-
const hit = cache.get(cacheKey);
|
|
315
|
-
if (hit && Date.now() - hit.at < CACHE_TTL_MS) {
|
|
316
|
-
return {
|
|
317
|
-
ok: true,
|
|
318
|
-
items: hit.items,
|
|
319
|
-
hasMore: hit.hasMore ?? false,
|
|
320
|
-
...(hit.total !== undefined ? { total: hit.total } : {}),
|
|
321
|
-
...noteFields,
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
const url = `${NPM_REGISTRY}/-/v1/search?text=${encodeURIComponent(text)}&size=${fetchSize}&from=${fetchFrom}`;
|
|
325
|
-
let res;
|
|
326
|
-
try {
|
|
327
|
-
// Same shared retry as GitHub: any failed answer is asked again inside the budget. The LAST
|
|
328
|
-
// 429/5xx is returned as-is and mapped by the branches below, so the console still gets a reason.
|
|
329
|
-
res = await fetchWithRetry(url, { headers: { Accept: 'application/json', 'User-Agent': 'omnicellrouter-harness' } });
|
|
330
|
-
}
|
|
331
|
-
catch (e) {
|
|
332
|
-
return { ok: false, code: 'upstream', reason: fetchFailureReason(e), message: describeFetchFailure('npm search', e) };
|
|
333
|
-
}
|
|
334
|
-
if (res.status === 429 || res.status >= 500) {
|
|
335
|
-
return { ok: false, code: 'unavailable', reason: 'unavailable', message: `npm search returned HTTP ${res.status} — try again later` };
|
|
336
|
-
}
|
|
337
|
-
if (!res.ok) {
|
|
338
|
-
return {
|
|
339
|
-
ok: false,
|
|
340
|
-
code: 'upstream',
|
|
341
|
-
reason: 'http',
|
|
342
|
-
reasonParams: { status: String(res.status) },
|
|
343
|
-
message: `npm search returned HTTP ${res.status}`,
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
let payload;
|
|
347
|
-
try {
|
|
348
|
-
payload = (await res.json());
|
|
349
|
-
}
|
|
350
|
-
catch {
|
|
351
|
-
return { ok: false, code: 'upstream', reason: 'badPayload', message: 'npm search answered non-JSON content' };
|
|
352
|
-
}
|
|
353
|
-
const fetched = (payload.objects ?? [])
|
|
354
|
-
.map((entry) => (entry.package ? toNpmItem(entry.package, installKind) : null))
|
|
355
|
-
.filter((item) => item !== null);
|
|
356
|
-
let items = fetched;
|
|
357
|
-
let total = payload.total;
|
|
358
|
-
let hasMore = fetchFrom + fetched.length < (total ?? 0);
|
|
359
|
-
if (windowed) {
|
|
360
|
-
// Unknown dates sink; ties fall back to the name so the order is stable across requests.
|
|
361
|
-
const sorted = sort === 'updated'
|
|
362
|
-
? [...fetched].sort((a, b) => {
|
|
363
|
-
const av = a.updatedAt || '';
|
|
364
|
-
const bv = b.updatedAt || '';
|
|
365
|
-
if (!av && !bv)
|
|
366
|
-
return a.name.localeCompare(b.name);
|
|
367
|
-
if (!av)
|
|
368
|
-
return 1;
|
|
369
|
-
if (!bv)
|
|
370
|
-
return -1;
|
|
371
|
-
return bv.localeCompare(av) || a.name.localeCompare(b.name);
|
|
372
|
-
})
|
|
373
|
-
: [...fetched].sort((a, b) => a.name.localeCompare(b.name) || a.id.localeCompare(b.id));
|
|
374
|
-
items = sorted.slice(from, from + size);
|
|
375
|
-
// The window IS the answer space here: reporting the registry's millions would promise pages
|
|
376
|
-
// this order cannot produce.
|
|
377
|
-
total = sorted.length;
|
|
378
|
-
hasMore = from + size < sorted.length;
|
|
379
|
-
noteFields = {
|
|
380
|
-
note: `sorted server-side across the top ${sorted.length} matches`,
|
|
381
|
-
noteCode: 'window-sorted',
|
|
382
|
-
noteParams: { n: String(sorted.length) },
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
cache.set(cacheKey, { at: Date.now(), items, hasMore, ...(total !== undefined ? { total } : {}) });
|
|
386
|
-
return {
|
|
387
|
-
ok: true,
|
|
388
|
-
items,
|
|
389
|
-
hasMore,
|
|
390
|
-
...(total !== undefined ? { total } : {}),
|
|
391
|
-
...noteFields,
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
/** One registry entry → one market row. The package name is NOT invented here (see the adapter). */
|
|
395
|
-
function toAwesomeItem(entry) {
|
|
396
|
-
if (!entry.productId || !entry.displayName)
|
|
397
|
-
return null;
|
|
398
|
-
const slug = repoSlug(entry.repoUrl);
|
|
399
|
-
return {
|
|
400
|
-
id: `awesome-opencode:${entry.productId}`,
|
|
401
|
-
sourceId: 'awesome-opencode',
|
|
402
|
-
key: `awesome-opencode:${entry.productId}`,
|
|
403
|
-
installKind: 'extension',
|
|
404
|
-
name: entry.displayName,
|
|
405
|
-
...(slug ? { repo: `${slug.owner}/${slug.repo}` } : {}),
|
|
406
|
-
description: entry.description ?? entry.tagline ?? null,
|
|
407
|
-
url: entry.homepageUrl ?? entry.repoUrl ?? '',
|
|
408
|
-
// The registry carries no popularity or time signal; `null` / '' is the honest answer.
|
|
409
|
-
stars: null,
|
|
410
|
-
updatedAt: '',
|
|
411
|
-
topics: entry.tags ?? [],
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
/**
|
|
415
|
-
* Browse the community catalog. The WHOLE registry is cached (not just the answered slice), so one
|
|
416
|
-
* upstream read serves every keystroke — the same 60 s window the other sources share.
|
|
417
|
-
*
|
|
418
|
-
* A row's key stays `awesome-opencode:<productId>`: the entry names no package. The INSTALL adapter
|
|
419
|
-
* (`sources/awesome-opencode.ts`) resolves a package name on demand and verifies it, rather than the
|
|
420
|
-
* market inventing one here for 136 rows on every keystroke.
|
|
421
|
-
*/
|
|
422
|
-
export async function browseAwesomeOpencode(query, limit = 24, page = 1, sort = 'catalog') {
|
|
423
|
-
const q = query.trim().toLowerCase();
|
|
424
|
-
const size = Math.min(Math.max(limit, 1), 50);
|
|
425
|
-
const at = Math.max(page, 1);
|
|
426
|
-
const cacheKey = 'awesome|plugins';
|
|
427
|
-
const hit = cache.get(cacheKey);
|
|
428
|
-
let all;
|
|
429
|
-
if (hit && Date.now() - hit.at < CACHE_TTL_MS) {
|
|
430
|
-
all = hit.items;
|
|
431
|
-
}
|
|
432
|
-
else {
|
|
433
|
-
const fetched = await fetchAwesomeRegistry();
|
|
434
|
-
if (!fetched.ok)
|
|
435
|
-
return fetched;
|
|
436
|
-
all = fetched.entries
|
|
437
|
-
.filter((entry) => entry.type === 'plugins')
|
|
438
|
-
.map(toAwesomeItem)
|
|
439
|
-
.filter((item) => item !== null);
|
|
440
|
-
cache.set(cacheKey, { at: Date.now(), items: all });
|
|
441
|
-
}
|
|
442
|
-
const matched = q
|
|
443
|
-
? all.filter((item) => item.name.toLowerCase().includes(q) ||
|
|
444
|
-
(item.description ?? '').toLowerCase().includes(q) ||
|
|
445
|
-
item.topics.some((t) => t.toLowerCase().includes(q)))
|
|
446
|
-
: all;
|
|
447
|
-
// The registry has no server-side paging: the whole catalog is cached once and each page is a
|
|
448
|
-
// slice of the filtered list, so page N costs one keystroke, never another upstream read.
|
|
449
|
-
//
|
|
450
|
-
// Ordering therefore runs over the WHOLE matched catalog, not one page: the backend holds every row
|
|
451
|
-
// before slicing, so "name A-Z" is a true global order instead of a re-sort of the visible window.
|
|
452
|
-
const ordered = sort === 'name' ? byName(matched) : matched;
|
|
453
|
-
const offset = (at - 1) * size;
|
|
454
|
-
const items = ordered.slice(offset, offset + size);
|
|
455
|
-
return {
|
|
456
|
-
ok: true,
|
|
457
|
-
items,
|
|
458
|
-
hasMore: offset + items.length < ordered.length,
|
|
459
|
-
total: ordered.length,
|
|
460
|
-
note: q
|
|
461
|
-
? undefined
|
|
462
|
-
: 'community catalog — the package name is resolved and verified at install time',
|
|
463
|
-
...(q ? {} : { noteCode: 'awesome' }),
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
/**
|
|
467
|
-
* One curated row → one market row.
|
|
468
|
-
*
|
|
469
|
-
* `key` is the INSTALL handle, and for a curated row that handle belongs to another source: the
|
|
470
|
-
* package is published on npm, so `npm:<pkg>` is what the install endpoint needs and what the
|
|
471
|
-
* "already installed" join already matches. A row with no verified package name keeps a
|
|
472
|
-
* `static-opencode:` key, which no adapter serves — the console offers "search npm" instead of an
|
|
473
|
-
* install button that could only fail.
|
|
474
|
-
*
|
|
475
|
-
* `stars` stays `null` and `updatedAt` empty: the upstream table carries no popularity or time signal,
|
|
476
|
-
* and inventing one would make the market's sort order a lie.
|
|
477
|
-
*/
|
|
478
|
-
function toEcosystemItem(entry) {
|
|
479
|
-
return {
|
|
480
|
-
id: `static-opencode:${entry.name}`,
|
|
481
|
-
sourceId: 'static-opencode',
|
|
482
|
-
key: entry.npm ? `npm:${entry.npm}` : `static-opencode:${entry.name}`,
|
|
483
|
-
installKind: 'extension',
|
|
484
|
-
name: entry.name,
|
|
485
|
-
repo: entry.repo,
|
|
486
|
-
description: entry.description,
|
|
487
|
-
url: entry.url,
|
|
488
|
-
// The curated table carries no popularity signal; `null` says so, `0` would claim "unstarred".
|
|
489
|
-
stars: null,
|
|
490
|
-
updatedAt: '',
|
|
491
|
-
topics: entry.npm ? [entry.npm] : [],
|
|
492
|
-
};
|
|
493
|
-
}
|
|
494
|
-
/**
|
|
495
|
-
* Curated OpenCode ecosystem snapshot (ADR-0015 §D6) — disk-only, so it never answers `unavailable`.
|
|
496
|
-
*
|
|
497
|
-
* Filtering is a substring match over name and description: 31 rows do not justify a ranking model,
|
|
498
|
-
* and an operator typing `pty` or `notif` gets the row they mean either way.
|
|
499
|
-
*/
|
|
500
|
-
export function browseOpenCodeEcosystem(query, limit = 24, page = 1, sort = 'catalog') {
|
|
501
|
-
const q = query.trim().toLowerCase();
|
|
502
|
-
const size = Math.min(Math.max(limit, 1), 50);
|
|
503
|
-
const at = Math.max(page, 1);
|
|
504
|
-
const matched = OPENCODE_ECOSYSTEM.map(toEcosystemItem).filter((item) => !q || item.name.toLowerCase().includes(q) || (item.description ?? '').toLowerCase().includes(q));
|
|
505
|
-
// A 31-row snapshot is small enough that "paging" is just a slice — but the page still needs an
|
|
506
|
-
// honest end, so `hasMore` is the slice's arithmetic, not a guess. Ordering covers the whole
|
|
507
|
-
// snapshot before slicing, so it is a global order rather than a page-local one.
|
|
508
|
-
const ordered = sort === 'name' ? byName(matched) : matched;
|
|
509
|
-
const offset = (at - 1) * size;
|
|
510
|
-
const items = ordered.slice(offset, offset + size);
|
|
511
|
-
return {
|
|
512
|
-
ok: true,
|
|
513
|
-
items,
|
|
514
|
-
hasMore: offset + items.length < ordered.length,
|
|
515
|
-
total: ordered.length,
|
|
516
|
-
note: q ? undefined : 'curated catalog — rows with a published package install through npm',
|
|
517
|
-
...(q ? {} : { noteCode: 'curated' }),
|
|
518
|
-
};
|
|
519
|
-
}
|
|
520
|
-
/** One opencode.cafe row → one market row. */
|
|
521
|
-
function toCafeItem(entry) {
|
|
522
|
-
if (!entry.productId || !entry.displayName)
|
|
523
|
-
return null;
|
|
524
|
-
const slug = repoSlug(entry.repoUrl);
|
|
525
|
-
return {
|
|
526
|
-
id: `opencode-cafe:${entry.productId}`,
|
|
527
|
-
sourceId: 'opencode-cafe',
|
|
528
|
-
key: `opencode-cafe:${entry.productId}`,
|
|
529
|
-
installKind: 'extension',
|
|
530
|
-
name: entry.displayName,
|
|
531
|
-
...(slug ? { repo: `${slug.owner}/${slug.repo}` } : {}),
|
|
532
|
-
description: entry.description ?? null,
|
|
533
|
-
url: entry.homepageUrl ?? entry.repoUrl ?? '',
|
|
534
|
-
// The cafe catalog carries no star count (a row with a repo can be resolved on demand).
|
|
535
|
-
stars: null,
|
|
536
|
-
updatedAt: '',
|
|
537
|
-
topics: entry.tags ?? [],
|
|
538
|
-
};
|
|
539
|
-
}
|
|
540
|
-
/**
|
|
541
|
-
* Browse the opencode.cafe catalog. Only `type: 'plugin'` rows are extensions; the catalog's other
|
|
542
|
-
* types (mcp-server, slash-command, hook, theme, web-view, tool) are a different artifact kind and
|
|
543
|
-
* this market cannot install them. The market therefore answers FEWER rows than the site's entry
|
|
544
|
-
* count, and says so: a silent 40-of-54 reads as data loss.
|
|
545
|
-
*/
|
|
546
|
-
export async function browseOpencodeCafe(query, limit = 24, page = 1, sort = 'catalog') {
|
|
547
|
-
const q = query.trim().toLowerCase();
|
|
548
|
-
const size = Math.min(Math.max(limit, 1), 50);
|
|
549
|
-
const at = Math.max(page, 1);
|
|
550
|
-
const cacheKey = 'cafe|plugins';
|
|
551
|
-
const hit = cache.get(cacheKey);
|
|
552
|
-
let all;
|
|
553
|
-
/** Every row the catalog returned, plugins or not — the honest denominator for the note. */
|
|
554
|
-
let catalogSize;
|
|
555
|
-
if (hit && Date.now() - hit.at < CACHE_TTL_MS) {
|
|
556
|
-
all = hit.items;
|
|
557
|
-
catalogSize = hit.catalogSize ?? all.length;
|
|
558
|
-
}
|
|
559
|
-
else {
|
|
560
|
-
const fetched = await fetchCafeExtensions();
|
|
561
|
-
if (!fetched.ok)
|
|
562
|
-
return fetched;
|
|
563
|
-
const plugins = fetched.entries.filter((entry) => entry.type === 'plugin');
|
|
564
|
-
catalogSize = fetched.entries.length;
|
|
565
|
-
all = plugins
|
|
566
|
-
.map(toCafeItem)
|
|
567
|
-
.filter((item) => item !== null);
|
|
568
|
-
cache.set(cacheKey, { at: Date.now(), items: all, catalogSize });
|
|
569
|
-
}
|
|
570
|
-
const matched = q
|
|
571
|
-
? all.filter((item) => item.name.toLowerCase().includes(q) ||
|
|
572
|
-
(item.description ?? '').toLowerCase().includes(q) ||
|
|
573
|
-
item.topics.some((t) => t.toLowerCase().includes(q)))
|
|
574
|
-
: all;
|
|
575
|
-
// The catalog is read whole and paged here, so ordering covers every matched row — a global
|
|
576
|
-
// order, not a re-sort of the visible page.
|
|
577
|
-
const ordered = sort === 'name' ? byName(matched) : matched;
|
|
578
|
-
const offset = (at - 1) * size;
|
|
579
|
-
const items = ordered.slice(offset, offset + size);
|
|
580
|
-
return {
|
|
581
|
-
ok: true,
|
|
582
|
-
items,
|
|
583
|
-
hasMore: offset + items.length < ordered.length,
|
|
584
|
-
total: ordered.length,
|
|
585
|
-
note: q
|
|
586
|
-
? undefined
|
|
587
|
-
: `catalog lists ${catalogSize} entries — ${all.length} of them are plugins`,
|
|
588
|
-
...(q
|
|
589
|
-
? {}
|
|
590
|
-
: {
|
|
591
|
-
noteCode: 'cafe-filtered',
|
|
592
|
-
noteParams: { total: String(catalogSize), plugins: String(all.length) },
|
|
593
|
-
}),
|
|
594
|
-
};
|
|
595
|
-
}
|
|
596
|
-
/** One pi.dev catalog row → one market row.
|
|
597
|
-
*
|
|
598
|
-
* `key` belongs to the npm source: the catalog prints `pi install npm:<pkg>` for every row, so the
|
|
599
|
-
* package is the identity and the row installs through the npm adapter. That keeps ONE identity per
|
|
600
|
-
* package (and the console's installed-state join is `canonicalKey`-exact), while `sourceId`/`id`
|
|
601
|
-
* still record where the row was discovered. */
|
|
602
|
-
function toPiDevItem(entry) {
|
|
603
|
-
const slug = repoSlug(entry.repoUrl);
|
|
604
|
-
return {
|
|
605
|
-
id: `pi-dev:${entry.packageName}`,
|
|
606
|
-
sourceId: 'pi-dev',
|
|
607
|
-
key: `npm:${entry.packageName}`,
|
|
608
|
-
installKind: 'extension',
|
|
609
|
-
name: entry.packageName,
|
|
610
|
-
...(slug ? { repo: `${slug.owner}/${slug.repo}` } : {}),
|
|
611
|
-
description: entry.description,
|
|
612
|
-
url: entry.url,
|
|
613
|
-
// The catalog carries downloads, not stars: `null` keeps "the catalog never said" apart from
|
|
614
|
-
// "nobody starred it" — the console resolves a row's stars from its repo on demand.
|
|
615
|
-
stars: null,
|
|
616
|
-
updatedAt: entry.publishedAt,
|
|
617
|
-
topics: [],
|
|
618
|
-
};
|
|
619
|
-
}
|
|
620
|
-
/**
|
|
621
|
-
* One catalog page as market rows, cached by its own upstream page number.
|
|
622
|
-
*
|
|
623
|
-
* This market lists the catalog row for row: every entry — extension, untyped bundle, skill, theme,
|
|
624
|
-
* prompt — installs with the same printed command (`pi install npm:<pkg>`) into the same runtime
|
|
625
|
-
* package store, so nothing is filtered, and the catalog's own count is therefore the honest `total`.
|
|
626
|
-
* The type chips are the catalog's vocabulary, not this market's kinds.
|
|
627
|
-
*
|
|
628
|
-
* The console pages by rows of THIS market while the catalog pages by ITS 50 cards; because nothing
|
|
629
|
-
* is filtered the two relate arithmetically (row `i` is catalog row `i`), so a console window reads
|
|
630
|
-
* only the one or two catalog pages it straddles — no walking from the first page, no duplicates and
|
|
631
|
-
* no gaps at any depth. Each catalog page is fetched once per cache window, and its count marker is
|
|
632
|
-
* carried along so the console can print `1–24 / 5338` the way the source does.
|
|
633
|
-
*/
|
|
634
|
-
async function piDevCatalogPage(q, upstream, sort) {
|
|
635
|
-
const cacheKey = `pi-dev|${q}|${upstream}|${sort}`;
|
|
636
|
-
const hit = cache.get(cacheKey);
|
|
637
|
-
if (hit && Date.now() - hit.at < CACHE_TTL_MS) {
|
|
638
|
-
return { ok: true, items: hit.items, more: hit.hasMore ?? false, total: hit.total ?? null };
|
|
639
|
-
}
|
|
640
|
-
const read = await fetchPiDevCatalog(q, upstream, fetch, sort);
|
|
641
|
-
if (!read.ok)
|
|
642
|
-
return read;
|
|
643
|
-
const items = read.entries.map(toPiDevItem);
|
|
644
|
-
cache.set(cacheKey, {
|
|
645
|
-
at: Date.now(),
|
|
646
|
-
items,
|
|
647
|
-
hasMore: read.more,
|
|
648
|
-
...(read.total !== null ? { total: read.total } : {}),
|
|
649
|
-
});
|
|
650
|
-
return { ok: true, items, more: read.more, total: read.total };
|
|
651
|
-
}
|
|
652
|
-
/**
|
|
653
|
-
* Browse the official Pi package catalog (pi.dev/packages); empty query = its top-downloads page.
|
|
654
|
-
*
|
|
655
|
-
* `total` is the SOURCE's own count — the number the catalog prints in its grid header — because this
|
|
656
|
-
* market lists exactly the catalog's rows, so the range and the total describe the same list. `hasMore`
|
|
657
|
-
* still decides the "next" affordance: a source that stops short of its own count (a short last page)
|
|
658
|
-
* must not advertise a successor.
|
|
659
|
-
*
|
|
660
|
-
* Because nothing is filtered, a window maps onto the catalog arithmetically: console rows `offset …
|
|
661
|
-
* offset+size-1` straddle at most TWO catalog pages (size ≤ 50), so even page 200 costs two fetches and
|
|
662
|
-
* the deep walk below is bounded by construction rather than by a cap.
|
|
663
|
-
*/
|
|
664
|
-
export async function browsePiDev(query, limit = 24, page = 1, sort = 'downloads') {
|
|
665
|
-
const q = query.trim();
|
|
666
|
-
const size = Math.min(Math.max(limit, 1), 50);
|
|
667
|
-
const at = Math.max(page, 1);
|
|
668
|
-
const offset = (at - 1) * size;
|
|
669
|
-
const note = q ? undefined : 'official Pi package catalog — every row installs with `pi install npm:<pkg>`';
|
|
670
|
-
const noteCode = q ? undefined : 'pi-dev';
|
|
671
|
-
const firstPage = Math.floor(offset / PI_DEV_PAGE_SIZE) + 1;
|
|
672
|
-
const lastPage = Math.floor((offset + size - 1) / PI_DEV_PAGE_SIZE) + 1;
|
|
673
|
-
const base = (firstPage - 1) * PI_DEV_PAGE_SIZE;
|
|
674
|
-
const rows = [];
|
|
675
|
-
let total = null;
|
|
676
|
-
let more = false;
|
|
677
|
-
for (let upstream = firstPage; upstream <= lastPage; upstream += 1) {
|
|
678
|
-
const read = await piDevCatalogPage(q, upstream, sort);
|
|
679
|
-
if (!read.ok)
|
|
680
|
-
return read;
|
|
681
|
-
rows.push(...read.items);
|
|
682
|
-
// The FIRST page of the window states the query's count; a page past the catalog's end reports
|
|
683
|
-
// zero matches, and that must not overwrite the count the in-range page gave.
|
|
684
|
-
if (upstream === firstPage)
|
|
685
|
-
total = read.total;
|
|
686
|
-
// Only the last fetched page can speak for "is there anything after this window".
|
|
687
|
-
if (upstream === lastPage)
|
|
688
|
-
more = read.more;
|
|
689
|
-
}
|
|
690
|
-
const local = offset - base;
|
|
691
|
-
const items = rows.slice(local, local + size);
|
|
692
|
-
return {
|
|
693
|
-
ok: true,
|
|
694
|
-
items,
|
|
695
|
-
// The source's own count when it states one; otherwise the catalog page's successor flag.
|
|
696
|
-
hasMore: total !== null ? offset + items.length < total : more,
|
|
697
|
-
...(total !== null ? { total } : {}),
|
|
698
|
-
note,
|
|
699
|
-
...(noteCode ? { noteCode } : {}),
|
|
700
|
-
};
|
|
701
|
-
}
|
|
702
|
-
/**
|
|
703
|
-
* skills.sh (source `skills-sh`) — the browse half of `harness/skills-sh.ts`.
|
|
704
|
-
*
|
|
705
|
-
* TWO reads, and which one answers depends on the query:
|
|
706
|
-
* - an EMPTY query (or a 1-character one) is answered from the chosen BOARD — All time (`/`),
|
|
707
|
-
* Trending 24h (`/trending`), Hot (`/hot`), each a fixed 600-row window the site renders whole. The
|
|
708
|
-
* three boards are the source's three ORDERINGS, so they are declared as `sorts` rather than as
|
|
709
|
-
* three sources.
|
|
710
|
-
* - a query of 2+ characters goes to the site's own search endpoint (`/api/search`, anonymous), which
|
|
711
|
-
* covers the WHOLE catalog — 1.5M+ skills — instead of the board window. It caps at 200 matches per
|
|
712
|
-
* query and ignores paging, so `total` is that capped count; claiming the leaderboard's own total
|
|
713
|
-
* (or the catalog's) would be a number this market cannot reach.
|
|
714
|
-
* - Every row installs through the GITHUB writer (`github:owner/repo#skill-dir`), because that is what
|
|
715
|
-
* the site's own `npx skills add <owner/repo>` resolves to: one artifact, one identity, and the
|
|
716
|
-
* console's installed-state join stays exact.
|
|
717
|
-
*/
|
|
718
|
-
function toSkillsShItem(entry) {
|
|
719
|
-
return {
|
|
720
|
-
id: `skills-sh:${entry.source}#${entry.skillId}`,
|
|
721
|
-
sourceId: 'skills-sh',
|
|
722
|
-
key: `github:${entry.source}#${entry.skillId}`,
|
|
723
|
-
installKind: 'skill',
|
|
724
|
-
name: entry.name,
|
|
725
|
-
repo: entry.source,
|
|
726
|
-
// The board prints no description; the skill's own page does, but reading 600 detail pages to fill
|
|
727
|
-
// one column would be 600 requests for a field the drawer resolves on click.
|
|
728
|
-
description: null,
|
|
729
|
-
url: `https://www.skills.sh/${entry.source}/${entry.skillId}`,
|
|
730
|
-
stars: null,
|
|
731
|
-
// The board states no per-skill date. `''` = unknown (the console renders "—"), never "today".
|
|
732
|
-
updatedAt: '',
|
|
733
|
-
topics: [],
|
|
734
|
-
};
|
|
735
|
-
}
|
|
736
|
-
export async function browseSkillsSh(query, limit = 24, page = 1, sort = 'all-time') {
|
|
737
|
-
const board = isSkillsShBoard(sort) ? sort : 'all-time';
|
|
738
|
-
const typed = query.trim();
|
|
739
|
-
const size = Math.min(Math.max(limit, 1), 50);
|
|
740
|
-
const offset = (Math.max(page, 1) - 1) * size;
|
|
741
|
-
// A query of 2+ characters goes to the site's own search endpoint, which covers the WHOLE catalog —
|
|
742
|
-
// not one board. An empty query (and a 1-character term, which that endpoint refuses with
|
|
743
|
-
// `400 "Query must be at least 2 characters"`) is answered from the board.
|
|
744
|
-
const viaSearch = typed.length >= SKILLS_SH_MIN_QUERY;
|
|
745
|
-
if (viaSearch) {
|
|
746
|
-
const cacheKey = `skills-sh|q|${typed.toLowerCase()}`;
|
|
747
|
-
let rows;
|
|
748
|
-
const hit = cache.get(cacheKey);
|
|
749
|
-
if (hit && Date.now() - hit.at < CACHE_TTL_MS) {
|
|
750
|
-
rows = hit.items;
|
|
751
|
-
}
|
|
752
|
-
else {
|
|
753
|
-
const read = await searchSkillsSh(typed, fetch);
|
|
754
|
-
if (!read.ok)
|
|
755
|
-
return read;
|
|
756
|
-
rows = read.slots.filter((entry) => entry !== null).map(toSkillsShItem);
|
|
757
|
-
cache.set(cacheKey, { at: Date.now(), items: rows });
|
|
758
|
-
}
|
|
759
|
-
const items = rows.slice(offset, offset + size);
|
|
760
|
-
// A search answer caps at 200 rows and the endpoint ignores `offset`/`page`/`cursor`, so its count
|
|
761
|
-
// is a WINDOW: the pager needs it for page buttons, but the summary stays hidden (`totalScope`).
|
|
762
|
-
return {
|
|
763
|
-
ok: true,
|
|
764
|
-
items,
|
|
765
|
-
hasMore: offset + items.length < rows.length,
|
|
766
|
-
total: rows.length,
|
|
767
|
-
totalScope: 'window',
|
|
768
|
-
note: `full-catalog skills.sh search — at most ${SKILLS_SH_SEARCH_LIMIT} matches per query (the endpoint ignores paging)`,
|
|
769
|
-
noteCode: 'skills-sh-search',
|
|
770
|
-
noteParams: { n: String(SKILLS_SH_SEARCH_LIMIT) },
|
|
771
|
-
};
|
|
772
|
-
}
|
|
773
|
-
// The board is PAGED UPSTREAM — `/api/skills/<view>/<n>`, 0-based, 200 rows an answer, and the answer
|
|
774
|
-
// states its own `total` — so a console page is a slice of the upstream pages it straddles. This is
|
|
775
|
-
// how the site's own leaderboard reaches row 601: the console asks for the same pages, caches each one
|
|
776
|
-
// for the shared TTL, and never re-ranks (the site's order IS the ranking).
|
|
777
|
-
const firstPage = Math.floor(offset / SKILLS_SH_PAGE_SIZE);
|
|
778
|
-
const lastPage = Math.floor((offset + size - 1) / SKILLS_SH_PAGE_SIZE);
|
|
779
|
-
// Slots, not entries: the slice is taken by the SITE's row index (its ranking), then the rows with no
|
|
780
|
-
// installable identity are dropped. Dropping first would shift every later row, so page N would
|
|
781
|
-
// repeat or skip rows after the first `open.feishu.cn` entry.
|
|
782
|
-
const merged = [];
|
|
783
|
-
let rawRows = 0;
|
|
784
|
-
let total;
|
|
785
|
-
let upstreamHasMore = false;
|
|
786
|
-
for (let n = firstPage; n <= lastPage; n += 1) {
|
|
787
|
-
const cacheKey = `skills-sh|b|${board}|${n}`;
|
|
788
|
-
const hit = cache.get(cacheKey);
|
|
789
|
-
if (hit && Date.now() - hit.at < BOARD_TTL_MS) {
|
|
790
|
-
merged.push(...(hit.slots ?? []));
|
|
791
|
-
rawRows += hit.rows ?? (hit.slots ?? []).length;
|
|
792
|
-
total = hit.catalogSize ?? total;
|
|
793
|
-
upstreamHasMore = hit.hasMore ?? false;
|
|
794
|
-
}
|
|
795
|
-
else {
|
|
796
|
-
const read = await fetchSkillsShPage(board, n, fetch);
|
|
797
|
-
if (!read.ok)
|
|
798
|
-
return read;
|
|
799
|
-
merged.push(...read.slots);
|
|
800
|
-
rawRows += read.rows;
|
|
801
|
-
total = read.total ?? total;
|
|
802
|
-
upstreamHasMore = read.hasMore === true;
|
|
803
|
-
cache.set(cacheKey, {
|
|
804
|
-
at: Date.now(),
|
|
805
|
-
items: [],
|
|
806
|
-
slots: read.slots,
|
|
807
|
-
rows: read.rows,
|
|
808
|
-
hasMore: read.hasMore,
|
|
809
|
-
...(read.total !== undefined ? { catalogSize: read.total } : {}),
|
|
810
|
-
});
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
const start = offset - firstPage * SKILLS_SH_PAGE_SIZE;
|
|
814
|
-
const items = merged
|
|
815
|
-
.slice(start, start + size)
|
|
816
|
-
.filter((entry) => entry !== null)
|
|
817
|
-
.map(toSkillsShItem);
|
|
818
|
-
const served = offset + size;
|
|
819
|
-
const totalRows = total ?? 0;
|
|
820
|
-
return {
|
|
821
|
-
ok: true,
|
|
822
|
-
items,
|
|
823
|
-
// `hasMore` = more rows exist either upstream or in the stated total. A board whose tail is shorter
|
|
824
|
-
// than one answer reports `hasMore: false` on its last page, so the two agree by construction.
|
|
825
|
-
hasMore: upstreamHasMore || (totalRows > 0 && served < totalRows),
|
|
826
|
-
...(totalRows > 0 ? { total: totalRows } : {}),
|
|
827
|
-
note: totalRows > 0
|
|
828
|
-
? `skills.sh leaderboard — ${totalRows} ranked skills, read ${SKILLS_SH_PAGE_SIZE} rows at a time from the site's own paging endpoint`
|
|
829
|
-
: `skills.sh leaderboard — ${rawRows} rows on this page (the site states no total)`,
|
|
830
|
-
noteCode: 'skills-sh-board',
|
|
831
|
-
noteParams: totalRows > 0 ? { n: String(totalRows) } : { n: String(rawRows) },
|
|
832
|
-
};
|
|
833
|
-
}
|
|
834
|
-
/**
|
|
835
|
-
* Smithery (source `smithery`) — the browse half of `harness/smithery.ts`.
|
|
836
|
-
*
|
|
837
|
-
* The listing is `page`/`pageSize` paginated (no cursor), so a console page IS one registry page and
|
|
838
|
-
* nothing has to be walked. Two numbers must stay apart:
|
|
839
|
-
* - `totalCount` — what the registry CLAIMS (measured 2026-10-25: ~20 765 servers);
|
|
840
|
-
* - the reachable window — what its API will actually serve (500 rows however the page size is
|
|
841
|
-
* chosen: 20 × 25 pages, 2 × 250 pages, and page 26 answers empty).
|
|
842
|
-
* `total` therefore reports the REACHABLE count while `noteCode: 'smithery-window'` names both, so the
|
|
843
|
-
* pager never promises pages that answer nothing.
|
|
844
|
-
*
|
|
845
|
-
* `useCount` is a usage counter, not a star count, so it stays out of `stars` (one unit per field). The
|
|
846
|
-
* registry's own order IS that popularity ranking and it is the only order this source offers, which is
|
|
847
|
-
* why no `sorts` is declared.
|
|
848
|
-
*/
|
|
849
|
-
function toSmitheryItem(entry) {
|
|
850
|
-
const ref = entry.qualifiedName;
|
|
851
|
-
if (!ref)
|
|
852
|
-
return null;
|
|
853
|
-
return {
|
|
854
|
-
id: `smithery:${ref}`,
|
|
855
|
-
sourceId: 'smithery',
|
|
856
|
-
key: `smithery:${ref}`,
|
|
857
|
-
installKind: 'mcp',
|
|
858
|
-
name: entry.displayName?.trim() || ref,
|
|
859
|
-
description: entry.description?.trim() || null,
|
|
860
|
-
// The registry publishes the project's own homepage; its listing page is the honest fallback.
|
|
861
|
-
url: entry.homepage?.trim() || `https://smithery.ai/servers/${ref}`,
|
|
862
|
-
stars: null,
|
|
863
|
-
updatedAt: entry.createdAt ?? '',
|
|
864
|
-
topics: [],
|
|
865
|
-
};
|
|
866
|
-
}
|
|
867
|
-
/** The one sentence a Smithery answer carries — recomputed on a cache hit, so it never goes stale. */
|
|
868
|
-
function smitheryNote(total, reachable) {
|
|
869
|
-
return {
|
|
870
|
-
note: `registry lists ${total} servers — its API serves the top ${reachable}`,
|
|
871
|
-
noteCode: 'smithery-window',
|
|
872
|
-
noteParams: { total: String(total), reachable: String(reachable) },
|
|
873
|
-
};
|
|
874
|
-
}
|
|
875
|
-
export async function browseSmithery(query, limit = 24, page = 1) {
|
|
876
|
-
const q = query.trim();
|
|
877
|
-
const size = Math.min(Math.max(limit, 1), 50);
|
|
878
|
-
const at = Math.max(page, 1);
|
|
879
|
-
const cacheKey = `smithery|${q}|${size}|${at}`;
|
|
880
|
-
const hit = cache.get(cacheKey);
|
|
881
|
-
if (hit && Date.now() - hit.at < CACHE_TTL_MS) {
|
|
882
|
-
const total = hit.total ?? hit.items.length;
|
|
883
|
-
return { ok: true, items: hit.items, hasMore: hit.hasMore ?? false, total, ...smitheryNote(hit.catalogSize ?? total, total) };
|
|
884
|
-
}
|
|
885
|
-
const read = await fetchSmitheryServers({ ...(q ? { q } : {}), page: at, pageSize: size });
|
|
886
|
-
if (!read.ok)
|
|
887
|
-
return read;
|
|
888
|
-
const items = read.page.servers.map(toSmitheryItem).filter((item) => item !== null);
|
|
889
|
-
// The reachable count, not the claimed one: `min(claimed, pages × size)` is 500 for the unfiltered
|
|
890
|
-
// listing and the true match count for a query (measured: q=github → 140 of 140).
|
|
891
|
-
const reachable = Math.min(read.page.totalCount, read.page.totalPages * read.page.pageSize);
|
|
892
|
-
const hasMore = read.page.page < read.page.totalPages;
|
|
893
|
-
cache.set(cacheKey, { at: Date.now(), items, hasMore, total: reachable, catalogSize: read.page.totalCount });
|
|
894
|
-
return { ok: true, items, hasMore, total: reachable, ...smitheryNote(read.page.totalCount, reachable) };
|
|
895
|
-
}
|
|
896
|
-
/**
|
|
897
|
-
* ClawHub (source `clawhub`) — the browse half of `harness/clawhub.ts`.
|
|
898
|
-
*
|
|
899
|
-
* TWO reads, and which one answers depends on the query:
|
|
900
|
-
* - an EMPTY query is answered from the catalog endpoint (`/api/v1/skills`), cursor-paged, so a
|
|
901
|
-
* console page walks the recorded cursor chain the way the MCP registry market does — page N
|
|
902
|
-
* costs N reads once, then the chain remembers them, and a page past the walk limit is a typed
|
|
903
|
-
* refusal. The registry publishes no count for the listing, so the console shows the page number
|
|
904
|
-
* without inventing a total.
|
|
905
|
-
* - a typed query goes to `/api/v1/search`, which has NO paging parameter: one answer is the whole
|
|
906
|
-
* reach of the query (`totalScope: 'window'`, the skills.sh-search treatment), sliced locally.
|
|
907
|
-
* - Every row installs from ClawHub's own versioned store (`clawhub:<owner>/<slug>`): the registry
|
|
908
|
-
* pins by version, not by commit, so no repo is claimed and `stars` stays `null` — the registry's
|
|
909
|
-
* own star/download/install tally travels in `registryStats` instead, where the console can label
|
|
910
|
-
* it as ClawHub's (the smithery/skills.sh rule).
|
|
911
|
-
*/
|
|
912
|
-
function toClawHubItem(entry) {
|
|
913
|
-
return {
|
|
914
|
-
id: `clawhub:${entry.ownerHandle}/${entry.slug}`,
|
|
915
|
-
sourceId: 'clawhub',
|
|
916
|
-
key: `clawhub:${entry.ownerHandle}/${entry.slug}`,
|
|
917
|
-
installKind: 'skill',
|
|
918
|
-
name: entry.name,
|
|
919
|
-
description: entry.summary,
|
|
920
|
-
// The registry's usage terms ask third-party directories to link the canonical page, which is
|
|
921
|
-
// also where the operator can read the skill's own record before installing it.
|
|
922
|
-
url: `https://clawhub.ai/${entry.ownerHandle}/skills/${entry.slug}`,
|
|
923
|
-
stars: null,
|
|
924
|
-
...(entry.stats ? { registryStats: entry.stats } : {}),
|
|
925
|
-
updatedAt: entry.updatedAtMs !== null ? new Date(entry.updatedAtMs).toISOString() : '',
|
|
926
|
-
topics: entry.topics,
|
|
927
|
-
};
|
|
928
|
-
}
|
|
929
|
-
/** One catalog page as market rows, cached by its own upstream index so a page costs one read. */
|
|
930
|
-
async function clawhubCatalogPage(sort, size, index, cursor) {
|
|
931
|
-
const cacheKey = `clawhub|${sort}|${size}|${index}`;
|
|
932
|
-
const hit = clawhubPages.get(cacheKey);
|
|
933
|
-
if (hit && Date.now() - hit.at < CACHE_TTL_MS)
|
|
934
|
-
return { ok: true, items: hit.items, next: hit.next };
|
|
935
|
-
const read = await fetchClawHubCatalogPage(sort, size, cursor || null);
|
|
936
|
-
if (!read.ok)
|
|
937
|
-
return read;
|
|
938
|
-
const items = read.entries.map(toClawHubItem);
|
|
939
|
-
clawhubPages.set(cacheKey, { at: Date.now(), items, next: read.next });
|
|
940
|
-
return { ok: true, items, next: read.next };
|
|
941
|
-
}
|
|
942
|
-
export async function browseClawHub(query, limit = 24, page = 1, sort = 'downloads') {
|
|
943
|
-
const q = query.trim();
|
|
944
|
-
const size = Math.min(Math.max(limit, 1), 50);
|
|
945
|
-
const at = Math.max(page, 1);
|
|
946
|
-
if (q) {
|
|
947
|
-
const cacheKey = `clawhub|q|${q.toLowerCase()}`;
|
|
948
|
-
let rows;
|
|
949
|
-
const hit = cache.get(cacheKey);
|
|
950
|
-
if (hit && Date.now() - hit.at < CACHE_TTL_MS) {
|
|
951
|
-
rows = hit.items;
|
|
952
|
-
}
|
|
953
|
-
else {
|
|
954
|
-
const read = await fetchClawHubSearch(q);
|
|
955
|
-
if (!read.ok)
|
|
956
|
-
return read;
|
|
957
|
-
rows = read.entries.map(toClawHubItem);
|
|
958
|
-
cache.set(cacheKey, { at: Date.now(), items: rows });
|
|
959
|
-
}
|
|
960
|
-
const offset = (at - 1) * size;
|
|
961
|
-
const items = rows.slice(offset, offset + size);
|
|
962
|
-
// The search endpoint ignores every paging parameter, so its answer count is a WINDOW: the pager
|
|
963
|
-
// keeps the number for its page buttons but the summary stays hidden (`totalScope`).
|
|
964
|
-
return {
|
|
965
|
-
ok: true,
|
|
966
|
-
items,
|
|
967
|
-
hasMore: offset + items.length < rows.length,
|
|
968
|
-
total: rows.length,
|
|
969
|
-
totalScope: 'window',
|
|
970
|
-
note: `full-catalog ClawHub search — at most ${CLAWHUB_SEARCH_LIMIT} matches per query (the endpoint has no paging)`,
|
|
971
|
-
noteCode: 'clawhub-search',
|
|
972
|
-
noteParams: { n: String(CLAWHUB_SEARCH_LIMIT) },
|
|
973
|
-
};
|
|
974
|
-
}
|
|
975
|
-
// The catalog walk: extend the (sort, size) chain in place so later pages are one read each.
|
|
976
|
-
if (at > CLAWHUB_WALK_MAX) {
|
|
977
|
-
return {
|
|
978
|
-
ok: false,
|
|
979
|
-
code: 'unavailable',
|
|
980
|
-
reason: 'unavailable',
|
|
981
|
-
message: `page ${at} is past the ${CLAWHUB_WALK_MAX}-page cursor walk limit`,
|
|
982
|
-
};
|
|
983
|
-
}
|
|
984
|
-
const chainKey = `clawhub|cursors|${sort}|${size}`;
|
|
985
|
-
let chain = clawhubCursors.get(chainKey);
|
|
986
|
-
if (!chain || Date.now() - chain.at >= CACHE_TTL_MS) {
|
|
987
|
-
chain = { at: Date.now(), cursors: [''] };
|
|
988
|
-
clawhubCursors.set(chainKey, chain);
|
|
989
|
-
}
|
|
990
|
-
while (chain.cursors.length - 1 < at - 1) {
|
|
991
|
-
const prev = await clawhubCatalogPage(sort, size, chain.cursors.length - 1, chain.cursors[chain.cursors.length - 1]);
|
|
992
|
-
if (!prev.ok)
|
|
993
|
-
return prev;
|
|
994
|
-
if (prev.next === null)
|
|
995
|
-
break;
|
|
996
|
-
chain.cursors.push(prev.next);
|
|
997
|
-
}
|
|
998
|
-
const index = at - 1;
|
|
999
|
-
const beyond = index > chain.cursors.length - 1;
|
|
1000
|
-
const read = beyond ? null : await clawhubCatalogPage(sort, size, index, chain.cursors[index]);
|
|
1001
|
-
if (read && !read.ok)
|
|
1002
|
-
return read;
|
|
1003
|
-
return {
|
|
1004
|
-
ok: true,
|
|
1005
|
-
items: read?.items ?? [],
|
|
1006
|
-
hasMore: read !== null && read.next !== null,
|
|
1007
|
-
note: 'ClawHub community registry — rows install from the registry\u2019s own store, pinned to a version',
|
|
1008
|
-
noteCode: 'clawhub-catalog',
|
|
1009
|
-
};
|
|
1010
|
-
}
|
|
1011
|
-
/**
|
|
1012
|
-
* Official MCP registry (ADR-0015 §D6) — the browse half of `sources/mcp-official.ts`.
|
|
1013
|
-
*
|
|
1014
|
-
* Measured 2026-10-25, anonymous: `GET /v0/servers?limit=&search=&cursor=&version=latest` → 200
|
|
1015
|
-
* `{ servers: [...], metadata: { nextCursor, count } }`. Three properties of that endpoint shape this
|
|
1016
|
-
* adapter:
|
|
1017
|
-
* - `limit` is capped at 100 (101 → 422 `expected number <= 100`), so one console page (≤ 50 rows)
|
|
1018
|
-
* is one registry page.
|
|
1019
|
-
* - Paging is an opaque CURSOR, not an offset: page N is only reachable by walking N-1 recorded
|
|
1020
|
-
* cursors. The chain is cached beside the rows for the same 60 s window, so revisiting a page or
|
|
1021
|
-
* stepping back costs nothing.
|
|
1022
|
-
* - Without `version=latest` the registry lists one row per PUBLISHED VERSION (`ac.inference.sh/mcp`
|
|
1023
|
-
* answered three rows), which would make the market show the same server repeatedly with drifting
|
|
1024
|
-
* launch specs. `version=latest` narrows it server-side; the `isLatest` flag is still checked,
|
|
1025
|
-
* because a stale index must not reintroduce the duplicate.
|
|
1026
|
-
*
|
|
1027
|
-
* The registry publishes no star count and no ordering parameter, so `stars` is `null` for every row
|
|
1028
|
-
* (a row with a repository can have its stars resolved on demand) and the source declares no `sorts`.
|
|
1029
|
-
*/
|
|
1030
|
-
const MCP_REGISTRY = 'https://registry.modelcontextprotocol.io/v0/servers';
|
|
1031
|
-
/** Largest console page this adapter will forward (the registry accepts 100; the market asks ≤ 50). */
|
|
1032
|
-
const MCP_PAGE_MAX = 50;
|
|
1033
|
-
/**
|
|
1034
|
-
* Deepest console page the cursor walk will serve (40 × 50 rows). A cursor API has no offset, so page
|
|
1035
|
-
* N costs N reads; past this depth the answer is a typed refusal — never a silent clamp onto the last
|
|
1036
|
-
* page, which would render the same rows under a new page number.
|
|
1037
|
-
*/
|
|
1038
|
-
const MCP_WALK_MAX = 40;
|
|
1039
|
-
/** The record's own metadata block (`io.modelcontextprotocol.registry/official`). */
|
|
1040
|
-
function mcpMeta(entry) {
|
|
1041
|
-
return entry._meta?.['io.modelcontextprotocol.registry/official'];
|
|
1042
|
-
}
|
|
1043
|
-
/** One registry record → one market row. A row's `key` IS the install handle the source resolves. */
|
|
1044
|
-
function toMcpItem(entry) {
|
|
1045
|
-
const server = entry.server;
|
|
1046
|
-
if (!server?.name)
|
|
1047
|
-
return null;
|
|
1048
|
-
if (mcpMeta(entry)?.isLatest === false)
|
|
1049
|
-
return null;
|
|
1050
|
-
const slug = repoSlug(server.repository?.url ?? '');
|
|
1051
|
-
const remote = server.remotes?.find((r) => r.url)?.url;
|
|
1052
|
-
return {
|
|
1053
|
-
id: `mcp-official:${server.name}`,
|
|
1054
|
-
sourceId: 'mcp-official',
|
|
1055
|
-
key: `mcp-official:${server.name}`,
|
|
1056
|
-
installKind: 'mcp',
|
|
1057
|
-
// `title` is the publisher's display string (`inference.sh`); the reverse-DNS name is the
|
|
1058
|
-
// IDENTITY and stays in `key`, so two candidates for one name never share an install handle.
|
|
1059
|
-
name: server.title?.trim() || server.name,
|
|
1060
|
-
...(slug ? { repo: `${slug.owner}/${slug.repo}` } : {}),
|
|
1061
|
-
description: server.description?.trim() || null,
|
|
1062
|
-
url: server.websiteUrl ?? remote ?? (slug ? `https://github.com/${slug.owner}/${slug.repo}` : ''),
|
|
1063
|
-
// The registry publishes no popularity signal at all — `null` keeps "never stated" apart from
|
|
1064
|
-
// "nobody starred it", the same rule every non-GitHub source follows.
|
|
1065
|
-
stars: null,
|
|
1066
|
-
updatedAt: mcpMeta(entry)?.updatedAt ?? '',
|
|
1067
|
-
topics: [],
|
|
1068
|
-
};
|
|
1069
|
-
}
|
|
1070
|
-
/** The cursor chain for (query, page size), extended in place so later pages are one read each. */
|
|
1071
|
-
function mcpCursorChain(q, size) {
|
|
1072
|
-
const key = `mcp|cursors|${q}|${size}`;
|
|
1073
|
-
const hit = mcpCursors.get(key);
|
|
1074
|
-
if (hit && Date.now() - hit.at < CACHE_TTL_MS)
|
|
1075
|
-
return hit.cursors;
|
|
1076
|
-
const fresh = { at: Date.now(), cursors: [''] };
|
|
1077
|
-
mcpCursors.set(key, fresh);
|
|
1078
|
-
return fresh.cursors;
|
|
1079
|
-
}
|
|
1080
|
-
/** One registry page (0-based), cached by its own index so a page costs one upstream read. */
|
|
1081
|
-
async function mcpRegistryPage(q, size, index, cursor) {
|
|
1082
|
-
const cacheKey = `mcp|${q}|${size}|${index}`;
|
|
1083
|
-
const hit = mcpPages.get(cacheKey);
|
|
1084
|
-
if (hit && Date.now() - hit.at < CACHE_TTL_MS)
|
|
1085
|
-
return { ok: true, items: hit.items, next: hit.next };
|
|
1086
|
-
const params = new URLSearchParams({ limit: String(size), version: 'latest' });
|
|
1087
|
-
if (q)
|
|
1088
|
-
params.set('search', q);
|
|
1089
|
-
if (cursor)
|
|
1090
|
-
params.set('cursor', cursor);
|
|
1091
|
-
let res;
|
|
1092
|
-
try {
|
|
1093
|
-
// The market-read retry policy is shared by every source reader (`net.ts`): every failed
|
|
1094
|
-
// answer is asked again while attempts and budget last.
|
|
1095
|
-
res = await fetchWithRetry(`${MCP_REGISTRY}?${params.toString()}`, { headers: { Accept: 'application/json', 'User-Agent': 'omnicellrouter-harness' } }, undefined, {});
|
|
1096
|
-
}
|
|
1097
|
-
catch (e) {
|
|
1098
|
-
return { ok: false, code: 'upstream', reason: fetchFailureReason(e), message: describeFetchFailure('MCP registry', e) };
|
|
1099
|
-
}
|
|
1100
|
-
if (res.status === 429 || res.status >= 500) {
|
|
1101
|
-
return { ok: false, code: 'unavailable', reason: 'unavailable', message: `MCP registry returned HTTP ${res.status} — try again later` };
|
|
1102
|
-
}
|
|
1103
|
-
if (!res.ok) {
|
|
1104
|
-
return {
|
|
1105
|
-
ok: false,
|
|
1106
|
-
code: 'upstream',
|
|
1107
|
-
reason: 'http',
|
|
1108
|
-
reasonParams: { status: String(res.status) },
|
|
1109
|
-
message: `MCP registry returned HTTP ${res.status}`,
|
|
1110
|
-
};
|
|
1111
|
-
}
|
|
1112
|
-
let payload;
|
|
1113
|
-
try {
|
|
1114
|
-
payload = (await res.json());
|
|
1115
|
-
}
|
|
1116
|
-
catch {
|
|
1117
|
-
return { ok: false, code: 'upstream', reason: 'badPayload', message: 'MCP registry answered non-JSON content' };
|
|
1118
|
-
}
|
|
1119
|
-
const items = (payload.servers ?? []).map(toMcpItem).filter((item) => item !== null);
|
|
1120
|
-
// A page the registry answers with no successor is the end of the list, whatever the row count says.
|
|
1121
|
-
const next = payload.metadata?.nextCursor ?? null;
|
|
1122
|
-
mcpPages.set(cacheKey, { at: Date.now(), items, next });
|
|
1123
|
-
return { ok: true, items, next };
|
|
1124
|
-
}
|
|
1125
|
-
/**
|
|
1126
|
-
* Browse the official MCP registry. Empty query = the registry's own list order (it publishes no
|
|
1127
|
-
* ranking parameter and no total, so the console shows the page number without inventing a count).
|
|
1128
|
-
*
|
|
1129
|
-
* A page past the registry's end answers EMPTY with no successor: a short last page must not
|
|
1130
|
-
* advertise a next one, and the console's "empty" is the honest answer there.
|
|
1131
|
-
*/
|
|
1132
|
-
export async function browseMcpOfficial(query, limit = 24, page = 1) {
|
|
1133
|
-
const q = query.trim();
|
|
1134
|
-
const size = Math.min(Math.max(limit, 1), MCP_PAGE_MAX);
|
|
1135
|
-
const at = Math.max(page, 1);
|
|
1136
|
-
if (at > MCP_WALK_MAX) {
|
|
1137
|
-
return {
|
|
1138
|
-
ok: false,
|
|
1139
|
-
code: 'unavailable',
|
|
1140
|
-
reason: 'unavailable',
|
|
1141
|
-
message: `page ${at} is past the ${MCP_WALK_MAX}-page cursor walk limit`,
|
|
1142
|
-
};
|
|
1143
|
-
}
|
|
1144
|
-
const chain = mcpCursorChain(q, size);
|
|
1145
|
-
// Walk only as far as the requested page; the chain remembers every cursor it has already paid for.
|
|
1146
|
-
while (chain.length - 1 < at - 1) {
|
|
1147
|
-
const prev = await mcpRegistryPage(q, size, chain.length - 1, chain[chain.length - 1]);
|
|
1148
|
-
if (!prev.ok)
|
|
1149
|
-
return prev;
|
|
1150
|
-
if (prev.next === null)
|
|
1151
|
-
break;
|
|
1152
|
-
chain.push(prev.next);
|
|
1153
|
-
}
|
|
1154
|
-
const index = at - 1;
|
|
1155
|
-
const beyond = index > chain.length - 1;
|
|
1156
|
-
const read = beyond ? null : await mcpRegistryPage(q, size, index, chain[index]);
|
|
1157
|
-
if (read && !read.ok)
|
|
1158
|
-
return read;
|
|
1159
|
-
return {
|
|
1160
|
-
ok: true,
|
|
1161
|
-
items: read?.items ?? [],
|
|
1162
|
-
hasMore: read !== null && read.next !== null,
|
|
1163
|
-
note: q ? undefined : 'official MCP registry — a row is merged into a client’s own mcp config',
|
|
1164
|
-
...(q ? {} : { noteCode: 'mcp-registry' }),
|
|
1165
|
-
};
|
|
1166
|
-
}
|
|
1167
|
-
/** Route a browse request to the adapter that can serve it; unknown/unavailable sources stay honest.
|
|
1168
|
-
* `harness` only selects a source's own empty-query default (a pi page opens on pi packages) —
|
|
1169
|
-
* it never narrows what a source may return, and it is never a target claim. `page` is 1-based.
|
|
1170
|
-
* `sort` is validated against the source's declared `sorts`: an order the upstream cannot serve
|
|
1171
|
-
* falls back to the source's own first (default) order instead of being forwarded as a guess.
|
|
1172
|
-
* `refresh` is the operator's explicit "ask again": it drops THIS source's cached pages first, so a
|
|
1173
|
-
* still-warm 60 s window cannot answer a request that means to be new. */
|
|
1174
|
-
export async function browseSource(source, query, limit, opts = {}) {
|
|
1175
|
-
const page = Math.max(opts.page ?? 1, 1);
|
|
1176
|
-
// Only an order this source DECLARES may travel upstream; anything else is not the console's to ask.
|
|
1177
|
-
const sort = opts.sort && source.sorts?.includes(opts.sort) ? opts.sort : source.sorts?.[0];
|
|
1178
|
-
if (!source.enabled) {
|
|
1179
|
-
return {
|
|
1180
|
-
ok: false,
|
|
1181
|
-
code: 'unavailable',
|
|
1182
|
-
reason: 'unavailable',
|
|
1183
|
-
message: source.unavailableReason ?? `${source.label} is unavailable`,
|
|
1184
|
-
};
|
|
1185
|
-
}
|
|
1186
|
-
// A forced re-read drops this source's window BEFORE the adapter computes its cache key, so the
|
|
1187
|
-
// adapter's own read-through starts from an empty family and genuinely asks upstream.
|
|
1188
|
-
if (opts.refresh)
|
|
1189
|
-
evictBrowseCache(source.id);
|
|
1190
|
-
if (source.id === 'github')
|
|
1191
|
-
return browseGitHub(query, limit, page, sort);
|
|
1192
|
-
if (source.id === 'npm')
|
|
1193
|
-
return browseNpm(query, limit, npmDefaultQueryFor(opts.kind, opts.harness ?? ''), page, sort,
|
|
1194
|
-
// Rows the MCP axis installs as `mcp`; the skill axis keeps the extension payload path (a
|
|
1195
|
-
// package-shaped skill installs through the runtime's package store), so only mcp forks here.
|
|
1196
|
-
opts.kind === 'mcp' ? 'mcp' : 'extension');
|
|
1197
|
-
if (source.id === 'pi-dev')
|
|
1198
|
-
return browsePiDev(query, limit, page, sort);
|
|
1199
|
-
if (source.id === 'skills-sh')
|
|
1200
|
-
return browseSkillsSh(query, limit, page, sort);
|
|
1201
|
-
if (source.id === 'clawhub')
|
|
1202
|
-
return browseClawHub(query, limit, page, sort);
|
|
1203
|
-
if (source.id === 'awesome-opencode')
|
|
1204
|
-
return browseAwesomeOpencode(query, limit, page, sort);
|
|
1205
|
-
if (source.id === 'opencode-cafe')
|
|
1206
|
-
return browseOpencodeCafe(query, limit, page, sort);
|
|
1207
|
-
if (source.id === 'static-opencode')
|
|
1208
|
-
return browseOpenCodeEcosystem(query, limit, page, sort);
|
|
1209
|
-
if (source.id === 'mcp-official')
|
|
1210
|
-
return browseMcpOfficial(query, limit, page);
|
|
1211
|
-
if (source.id === 'smithery')
|
|
1212
|
-
return browseSmithery(query, limit, page);
|
|
1213
|
-
return { ok: false, code: 'unsupported_source', reason: 'unsupportedSource', message: `no browse adapter for '${source.id}' yet` };
|
|
1214
|
-
}
|