Dashboard › opencode › Distillation
2a88bc69-2e31-48d0-9e2c-b2b43a7fd8d1["lore_tm_v1_y4oZ7HDVg8kw-ZrRNak4NYwp2Jc-hg0KyAnvRENxVNA","lore_tm_v1_bGLx1vufVHdH-gPVp-qLkjgc2s4TGJ5WWPgeTQGgK38","lore_tm_v1__7_F58CnSHsD1w7aDp23fIuZtEt0efx3RpzJ_BxJuK0","lore_tm_v1_ogCPTO6cUCAPymQtF5rMF3GebqTm4HbLsQ9mtXU8Phk","lore_tm_v1_6vK97o6UYp0zEI50WACtykhtG1atWfrO_kieFtwLmz8","lore_tm_v1_s4_zUAZjWXbhPlPR4HFypw9vQlkgNbw9llYeAOrovlM","lore_tm_v1_LxkPDFOrXwuEMaIZ30Jg3PCoPNeNVPaLbhjNQlXt2qk","lore_tm_v1_OjjgGVyqL3G3-AEt64cDZQgrv7Q6bnDRsRqw2ZTY_tc","lore_tm_v1_Q61a7xoq18zs_oTgMSmMrxihdfR8LICp6AZFwWQoaNQ","lore_tm_v1_UW89wk95cJiSS7StnwmO-ojtZ_fLWbPYbZN3pvP5iyQ","lore_tm_v1_NH0htBsZZzYm6QEHoR58MnPWRSvPTeitiBSR4NRWkOs","lore_tm_v1_zVH5y_PxfzKgIZIbeZkmWSG0b0Y_YkQ3FBCgN9aklLs","lore_tm_v1_Rgahs9CcJO9PFFvoeayhxWmZG3rmc9ygZWrZpAFj8Mw"]
/home/byk/Code/opencode-v2-pilot/packages/schema/src/config.ts defines native agents as Schema.Record(Schema.String, ConfigAgent.Info).pipe(optional) with description “Named built-in agent overrides and custom agent definitions”; default_agent is an optional string described as the default primary agent when no session agent is selected./home/byk/Code/opencode-v2-pilot/packages/schema/src/config/agent.ts defines ConfigAgent.Info fields: optional model, request, system, description, mode, hidden, color, steps, disabled, and permissions; mode accepts exactly "subagent", "primary", or "all", and Color must match /^#[0-9a-fA-F]{6}$/./home/byk/Code/opencode-v2-pilot/packages/core/test/config/normalization.test.ts establishes agent migration precedence as legacy agent, then legacy mode, then native agents; collisions produce conflict diagnostics at ["agents", "reviewer"], and migrated mode entries receive mode: "primary".100 generated Config.Info cases and verifies arbitrary JSON-round-tripped native configuration decodes identically after normalization, excluding empty compatibility containers.small_model: "anthropic/claude-haiku-4-5" migrates to agents.title.model = { providerID: "anthropic", model: "claude-haiku-4-5" }; when combined with legacy agent.title.prompt, it also produces system: "Custom title prompt".small_model values are omitted without exposing the supplied value: encoded.agents remains undefined, diagnostics contain only ["unsupported", ["small_model"]], and serialized diagnostics must not include the input./home/byk/Code/opencode-v2-pilot/packages/schema/src/agent.ts defines runtime Agent.Info with required id, name, request, mode, hidden, and permissions, plus optional model, system, description, color, and steps; Agent.Info.default(id) sets mode: "primary", hidden: false, empty request settings/headers/body, and five ordered permission rules: 1. allow all actions/resources; 2. ask for external_directory on *; 3. ask for reading *.env; 4. ask for reading *.env.*; 5. allow reading *.env.example./home/byk/Code/opencode-v2-pilot/packages/core/src/config/plugin/agent.ts discovers legacy agent Markdown using patterns {agent,agents}/**/*.md with primary: false and {mode,modes}/*.md with primary: true; recognized source directories are exactly agent, agents, mode, and modes.variant plus ConfigAgent.Info.fields; legacy files use ConfigAgentV1.Info followed by ConfigMigrateV1.migrateAgent, while native files use ConfigAgent.Info, with trimmed Markdown body mapped to prompt or system respectively./, stripped of a leading agent/, agents/, mode/, or modes/, and stripped of .md; files under mode/modes force mode: "primary".model, request headers/body, system, description, mode, hidden, color, steps, and expanded permissions; config changes and config.updated events share a PubSub.sliding<void>(1) feed with a "100 millis" debounce before reload.external_directory, read, and edit; ~, $HOME, ~/..., $HOME/..., and $HOME\... are expanded, while shell/bash resources are deliberately not rewritten because safe expansion would require shell-aware parsing./home/byk/Code/opencode-v2-pilot/packages/plugin/script/publish.ts builds before publishing, checks npm view ${name}@${version} version, rewrites package exports from ./src/*.ts to ./dist/*.js plus .d.ts, rewrites import conditions to .js, runs bun pm pack, publishes via npm publish *.tgz --tag ${Script.channel} --access public, and restores the original package.json in finally./home/byk/Code/opencode-v2-pilot/packages/plugin/src/host.ts resolves plugin entrypoints in order: server from ["server", ""], TUI from ["tui"], and RPC from ["rpc"]; missing candidates suppress ENOENT, ENOTDIR, MODULE_NOT_FOUND, ERR_MODULE_NOT_FOUND, ERR_PACKAGE_PATH_NOT_EXPORTED, and ERR_UNSUPPORTED_DIR_IMPORT./home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/module.ts as directories; standalone server-source files are admitted only by legacy auto-discovery./home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/module.ts nevertheless retains local-file handling: an absolute target whose stat() result is a file becomes { server: pathToFileURL(operation.target).href }; otherwise it uses Host.resolve(...).stat(), and emits changes through PubSub.unbounded<void>().npm.resolve() when options.install === false and npm.add() otherwise; unresolved non-installing packages return { pending: true }, while any source lacking a server entrypoint raises PluginModule.LoadError with Plugin entrypoint not found: ${operation.target}.{ id, effect } or { id, setup }; invalid modules raise PluginModule.LoadError stating “Plugin must export a default definition with an id and an effect or setup function.” Promise-style setup plugins are adapted through PluginPromise.fromPromise.@opencode/schema, preserve dependency direction @opencode/schema <- @opencode/protocol <- @opencode/server, keep current contracts unversioned and retained legacy contracts explicitly V1 under src/v1/, and avoid retaining V2 in permanent current namespaces, brands, or identifiers.undefined, absence of accidental current-contract Schema.Any, stable unique public identifiers, exact facade/schema identity, and current Protocol manifests excluding V1-only events.