opencode/packages/core/src/plugin
Kit Langton 38398fd450 feat(llm): provider packages own model request construction
Provider packages in @opencode-ai/llm/providers/* now implement a uniform
ProviderPackage contract: model(modelID, settings) => Model. SessionRunnerModel
becomes provider-agnostic: it resolves a package specifier, folds catalog
settings, credentials, and transport overlays into one Settings object, and
delegates request construction to the package.

- llm: add ProviderPackage (Settings, Definition, define), flat model(id,
  config) constructors on the openai-responses, anthropic-messages, and
  openai-compatible-chat protocols, contract-shaped model exports on the
  openai, anthropic, and openai-compatible providers, and a new
  providers/openai/codex entry point that targets the ChatGPT codex backend
  and sets the chatgpt-account-id header from settings.accountID.
- schema: Provider.Native gains optional package.
- core: SessionRunnerModel loads packages through a static built-in map
  (dynamic import for foreign specifiers) and applies one settings fold;
  the ChatGPT conditional is deleted from the runner. The OpenAI plugin's
  catalog transform now assigns the codex package to eligible models when a
  ChatGPT connection is active, alongside the existing eligibility and cost
  rewrites.
- llm schema: hoist ToolResultValue union out of its Object.assign self
  reference; the previous shape only typechecked under lucky check ordering
  and broke under core's typecheck with the new import graph.

Closes #34765
2026-07-03 14:01:17 -04:00
..
command feat(core): add command registry (#30624) 2026-06-04 02:57:43 -04:00
provider feat(llm): provider packages own model request construction 2026-07-03 14:01:17 -04:00
skill fix(core): fix command docs in customize-opencode skill (#32718) 2026-06-19 18:22:27 -04:00
agent.ts feat(plugin): add namespaced hook API (#33416) 2026-06-22 19:06:57 -04:00
command.ts feat(plugin): add namespaced hook API (#33416) 2026-06-22 19:06:57 -04:00
host.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
internal.ts refactor(core): remove infrastructure layer exports (#34624) 2026-06-30 12:17:12 -04:00
layer-map.example.ts docs: add LayerMap example (#27388) 2026-05-13 17:46:47 -04:00
models-dev.ts fix(core): expose models.dev modes as models (#34521) 2026-06-29 17:51:06 -05:00
promise.ts chore: generate 2026-06-23 23:46:36 +00:00
provider.ts feat(plugin): add namespaced hook API (#33416) 2026-06-22 19:06:57 -04:00
skill.ts refactor(schema): extract shared public schemas (#33571) 2026-06-23 22:31:06 -04:00
variant.ts feat(core): generate model variants 2026-06-24 13:17:14 -04:00