mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
A provider's `package` from the Console config (new and legacy formats) and from the models.dev catalog was used as written. Picking such a model made OpenCode npm-install and import that package, so whoever controlled the Console response or the catalog could run any code (npm, git, file or URL spec) on every connected machine, contradicting the rule that a remote config can never run commands. Add Provider.remotePackage: a remote source may only name builtin @opencode/ai/* packages, official @ai-sdk/* packages, or the third-party AI SDK providers the catalog already routes through, by bare name (no version, git, file, URL or path spec). ConfigIntegration.make and the legacy Console transform drop any other provider or model package, so the provider falls back to the package it would use without one. models-dev route() skips a model whose package is not allowed. Local config files still name any package. Removed: a Console or catalog entry can no longer name an arbitrary npm package; such models now use the provider's default package (Console) or are left out (catalog). Verified: bun typecheck (core), bun run check (root), models, provider-opencode, config/provider, config/config, models-dev, provider, aisdk-native and gitlab test files pass; new cases fail with the predicate disabled and the local case fails when the predicate is applied to local config. |
||
|---|---|---|
| .. | ||
| script | ||
| src | ||
| test | ||
| bunfig.toml | ||
| drizzle.config.ts | ||
| package.json | ||
| README.md | ||
| schema.json | ||
| sst-env.d.ts | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
| tsconfig.tests.json | ||
@opencode/core
Core runtime services for OpenCode.