opencode/packages/schema/src
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
..
v1 refactor(schema): isolate v1 contracts (#33769) 2026-06-25 17:26:47 +00:00
agent.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
catalog.ts refactor(schema): extract public event definitions (#33579) 2026-06-24 16:43:17 -04:00
command.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
connection.ts refactor(schema): extract shared public schemas (#33571) 2026-06-23 22:31:06 -04:00
credential.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
durable-event-manifest.ts feat(api): add finite durable session history pages (#34097) 2026-06-26 14:49:47 -04:00
event-manifest.ts refactor(schema): extract public event definitions (#33579) 2026-06-24 16:43:17 -04:00
event.ts feat(api): add finite durable session history pages (#34097) 2026-06-26 14:49:47 -04:00
file-diff.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
filesystem-watcher.ts refactor(schema): extract public event definitions (#33579) 2026-06-24 16:43:17 -04:00
filesystem.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
ide-event.ts refactor(schema): extract public event definitions (#33579) 2026-06-24 16:43:17 -04:00
identifier.ts refactor(schema): extract shared public schemas (#33571) 2026-06-23 22:31:06 -04:00
index.ts fix(core): resolve prompt attachment mime types 2026-06-26 13:51:00 -04:00
installation-event.ts refactor(schema): extract public event definitions (#33579) 2026-06-24 16:43:17 -04:00
integration-id.ts refactor(protocol): extract server contracts (#33708) 2026-06-24 22:15:31 -04:00
integration.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
legacy-event.ts refactor(schema): isolate v1 contracts (#33769) 2026-06-25 17:26:47 +00:00
llm.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
location.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
lsp-event.ts refactor(schema): extract public event definitions (#33579) 2026-06-24 16:43:17 -04:00
mcp-event.ts refactor(schema): extract public event definitions (#33579) 2026-06-24 16:43:17 -04:00
model.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
models-dev.ts refactor(schema): extract public event definitions (#33579) 2026-06-24 16:43:17 -04:00
permission-saved.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
permission-v1.ts refactor(schema): isolate v1 contracts (#33769) 2026-06-25 17:26:47 +00:00
permission.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
plugin.ts refactor(schema): normalize module patterns (#33770) 2026-06-25 15:42:22 +00:00
project-copy.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
project-directories.ts refactor(schema): normalize module patterns (#33770) 2026-06-25 15:42:22 +00:00
project-id.ts refactor(schema): normalize module patterns (#33770) 2026-06-25 15:42:22 +00:00
project.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
prompt-input.ts fix(core): resolve prompt attachment mime types 2026-06-26 13:51:00 -04:00
prompt.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
provider.ts feat(llm): provider packages own model request construction 2026-07-03 14:01:17 -04:00
pty-ticket.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
pty.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
question-v1.ts refactor(schema): isolate v1 contracts (#33769) 2026-06-25 17:26:47 +00:00
question.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
reference.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
revert.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
schema.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
server-event.ts refactor(schema): extract public event definitions (#33579) 2026-06-24 16:43:17 -04:00
session-compaction-event.ts refactor(schema): extract public event definitions (#33579) 2026-06-24 16:43:17 -04:00
session-delivery.ts refactor(schema): extract shared public schemas (#33571) 2026-06-23 22:31:06 -04:00
session-event.ts feat(api): add finite durable session history pages (#34097) 2026-06-26 14:49:47 -04:00
session-id.ts refactor(schema): normalize module patterns (#33770) 2026-06-25 15:42:22 +00:00
session-input.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
session-message.ts feat(core): port v2 runtime fixes onto dev 2026-06-27 00:07:25 -04:00
session-status-event.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
session-todo.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
session-v1.ts refactor(schema): isolate v1 contracts (#33769) 2026-06-25 17:26:47 +00:00
session.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
skill.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
tui-event.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
vcs-event.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
workspace-event.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00
workspace-id.ts refactor(schema): normalize module patterns (#33770) 2026-06-25 15:42:22 +00:00
workspace.ts refactor(schema): extract public event definitions (#33579) 2026-06-24 16:43:17 -04:00
worktree-event.ts refactor(schema): tighten public contracts (#33771) 2026-06-25 17:10:23 +00:00