opencode/packages/core
Ryan Vogel e86ed5d0e0 fix(core): limit provider packages from remote sources to known names
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.
2026-10-26 14:42:48 -04:00
..
script ci: separate release builds from signing and publishing (#59046) 2026-10-26 14:21:29 -04:00
src fix(core): limit provider packages from remote sources to known names 2026-10-26 14:42:48 -04:00
test fix(core): limit provider packages from remote sources to known names 2026-10-26 14:42:48 -04:00
bunfig.toml refactor(core): simplify integration test fixtures (#33292) 2026-06-22 04:15:34 +00:00
drizzle.config.ts refactor(core): move database schema ownership (#29068) 2026-05-30 21:08:38 -04:00
package.json ci: separate release builds from signing and publishing (#59046) 2026-10-26 14:21:29 -04:00
README.md refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
schema.json refactor(core): drop unused session_pending table and pin the history compaction bound (#59020) 2026-10-25 14:27:59 -07:00
sst-env.d.ts refactor: rename shared package to core (#24309) 2026-04-25 10:59:17 -04:00
tsconfig.build.json feat(core): configure package publishing 2026-08-12 09:30:34 -04:00
tsconfig.json chore: upgrade typecheck to TypeScript 7.0.2 (#56300) 2026-10-17 13:26:46 -07:00
tsconfig.tests.json chore: upgrade typecheck to TypeScript 7.0.2 (#56300) 2026-10-17 13:26:46 -07:00

@opencode/core

Core runtime services for OpenCode.