Dashboard › opencode › Distillation
3cc50d35-251e-484a-8091-59648aced952["lore_tm_v1_FEgES25LGhdZbLddEwhojKjTpEvKf9-gazhGcN7QkQI","lore_tm_v1_Br1MEoe1XK7SQlR7mEqXnRzrCIcJOqUKFBrnd5HcqcA","lore_tm_v1_RyQSVtYnPNSqZAKxE1hbuTo_QoWUrPGbOj3epg5MkdU","lore_tm_v1_0IqRSsHdcK9-pobNDFOZC_PNz3cN4Z5yyCNzd7Rio2g","lore_tm_v1_kTEhKx53QOEuMjM4QtDldkJABaSuNQVBFeq8chdCnS0","lore_tm_v1_vwwdUtPCt7HUFHKJJhCNySDc3E_Wh0hqifkf07L_yp4","lore_tm_v1_qxvmx4gJpFnY9gCyVRlWbHNiLm_R3ybA2TL2JJb5_mk","lore_tm_v1_i4Z8GXHin6zYK5_CSLPNYHcleTVPpJ1kapF3Q6At-jg","lore_tm_v1_0DXq86tax8gAWzwb7n7SBznerj02yF0c3YafXEOyngI","lore_tm_v1_AkIWJyGTa6CvCuYHgNDM2OcGrbOu3yTQIb3BPebFFlc","lore_tm_v1_gwwBjFpW6QUiRiSmDh2HCRsC7blpOnI2ZhB6JF3rwLY","lore_tm_v1_-EMc8C82SoQJZ8muKS0vrpddU5T-i5Odwne456d-UhA","lore_tm_v1_-juwXBq84trS7J8JIZG3W5CZ-GKxx9vwWA4Mwt4Y4pQ","lore_tm_v1_BrAFepWeU6B0JBghV4SajaqE3PaCW5PRyig08Tn2c_0","lore_tm_v1_fL5yonGygZ2XubI7v-SslVBIr-iRj4wo5ibImWFqs-E","lore_tm_v1_m_AsYCg29ChCIvVQ4-U48Iwf1dHurq6XUlIU84OPMAU","lore_tm_v1_pOvncro0x-nVzpJrv0HU6Nukt66oJAZq9jDR3HmQy_8"]
/home/byk/Code/opencode-v2-pilot/packages/sdk/test/promise.test.ts contains 3 Promise SDK tests: 1. "Promise host uses the embedded router" creates an embedded host with events: { persist: true } and config: { directory: config, project: false, content: "{}" }, creates/gets/lists a session, observes "session.created", verifies a missing Session.ID.create() produces { _tag: "SessionNotFoundError", sessionID: missingSessionID }, and calls opencode.close() twice; 2. "Promise event streams support cancellation" receives "server.connected", aborts an AbortController, and expects { name: "ClientError", reason: "Transport" }; 3. "closing cancels active Promise event streams" closes the host while events.next() is pending and expects the same transport ClientError.@opencode/plugin or @opencode/plugin-browser: /home/byk/Code/opencode-v2-pilot/packages/sdk/package.json, root /home/byk/Code/opencode-v2-pilot/package.json, /home/byk/Code/opencode-v2-pilot/packages/plugin-browser/package.json, /home/byk/Code/opencode-v2-pilot/packages/latex/package.json, /home/byk/Code/opencode-v2-pilot/packages/plugin/package.json, /home/byk/Code/opencode-v2-pilot/packages/merman/package.json, /home/byk/Code/opencode-v2-pilot/packages/desktop/package.json, /home/byk/Code/opencode-v2-pilot/packages/cli/package.json, /home/byk/Code/opencode-v2-pilot/packages/app/package.json, /home/byk/Code/opencode-v2-pilot/packages/core/package.json with both dependencies, /home/byk/Code/opencode-v2-pilot/packages/simulation/package.json, /home/byk/Code/opencode-v2-pilot/packages/server/package.json, and /home/byk/Code/opencode-v2-pilot/packages/tui/package.json; workspace dependencies use "workspace:*"./home/byk/Code/opencode-v2-pilot/packages/sdk/test/import-boundaries.test.ts test "bundles the Promise and Effect clients with the in-memory host" bundles @opencode/sdk and @opencode/sdk/effect, then verifies each bundle includes inputs from ../../client, ../../core, and ../../server.bundleInputs(specifier) in /home/byk/Code/opencode-v2-pilot/packages/sdk/test/import-boundaries.test.ts creates .import-boundary- temporary directories and runs process.execPath build <entrypoint> --target=bun --format=esm --packages=bundle --metafile=<metafile> --outdir=<out>, reads metadata.inputs, resolves the paths, and recursively removes the temporary directory with force: true./home/byk/Code/opencode-v2-pilot/packages/sdk/test/contract-identity.test.ts verifies the SDK directly re-exports canonical Schema contracts by identity: Agent, Config, Event, Model, WebSearch, Session, Worktree, and Workspace.../src/index are: AbsolutePath, Agent, ClientError, Command, Config, Credential, Event, FileSystem, Integration, Location, Model, OpenCode, Permission, PermissionSaved, Project, Prompt, PromptInput, Provider, Pty, Question, Reference, RelativePath, Session, SessionInbox, SessionMessage, Skill, Tool, WebSearch, Workspace, and Worktree.CoreAgent.ID === Agent.ID, CoreLocation.Ref === Location.Ref, CoreModel.Ref === Model.Ref, CoreSession.Info === Session.Info, CoreProject.Current === Project.Current, CoreWorktree.List === Worktree.List, CoreWorktree.Info === Worktree.Info, and CoreWorktree.DirectoryUnavailableError is defined.CoreSessionInbox.Item, .User, and .Synthetic reuse SessionInbox values; CoreSessionMessage.Info and .AssistantText reuse SessionMessage values; Api.groups["server.session"].identifier is "server.session"; Api.groups["server.project"].identifier is "server.project"; and ClientApi.groups has the same keys as Api.groups.Session.ID.create() starts with "ses_", String(Project.ID.global) is "global", String(Provider.ID.anthropic) is "anthropic", and Workspace.ID.create() starts with "wrk_"."client and Server contracts generate identically" compiles both Api and ClientApi with { groupNames, omitEndpoints: promiseOmitEndpoints } and expects emitPromise(client) to equal emitPromise(server)./home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/catalog.ts defines CatalogProviderRecord with readonly provider: DeepMutable<Provider.Info> and readonly models: ReadonlyMap<string, DeepMutable<Model.Info>>.CatalogEditor exposes provider operations list(), get(providerID), update(providerID, update), and remove(providerID); model operations get(providerID, modelID), update(providerID, modelID, update), remove(providerID, modelID), plus default.get() and default.set(providerID, modelID).CatalogDomain extends CatalogApi and adds readonly transform: Transform<CatalogEditor> and reload: () => Promise<void>./home/byk/Code/opencode-v2-pilot/packages/sdk/src/workerd.ts has optional plugins?: PromiseSdk.CreateOptions["plugins"]; /home/byk/Code/opencode-v2-pilot/packages/sdk/src/promise.ts defines instance, creation, registration, and adaptation paths; /home/byk/Code/opencode-v2-pilot/packages/sdk/src/internal/instances.ts stores InstancePlugins.List and passes configuration.plugins; /home/byk/Code/opencode-v2-pilot/packages/sdk/src/internal/host.ts retrieves SdkPlugins.Service./home/byk/Code/opencode-v2-pilot/packages/sdk/src/promise.ts defines InstanceConfiguration.plugins as ReadonlyArray<Plugin.Plugin> and InstanceOptions with key(session: typeof Session.Info.Encoded): string and configure(key: string): InstanceConfiguration | Promise<InstanceConfiguration>.InstanceOptions.key contract says it selects a sharing key within the Sessionβs current Location and must not initialize plugins; configure reconstructs configuration on a cache miss, including after a host restart.CreateOptions extends Omit<EmbeddedHost.CreateOptions, "workspaceProviders" | "instances"> and supports optional plugins?: ReadonlyArray<Plugin.Plugin> and instances?: InstanceOptions.Interface omits the original "plugin" member from OpenCodeClient, aliases sessions to OpenCodeClient["session"] and events to OpenCodeClient["event"], exposes plugin as both an async registration function and OpenCodeClient["plugin"], and exposes close() plus [Symbol.asyncDispose]().create() in /home/byk/Code/opencode-v2-pilot/packages/sdk/src/promise.ts encodes Session.Info before calling the instance key function; dynamically imports @opencode/core/plugin/promise; runs instances.configure(key) with Effect.tryPromise; converts every configured plugin using PluginPromise.fromPromise; creates a client at base URL "http://opencode.local" using host.fetch; registers initial plugins sequentially; aliases sessions and events; and uses host.close for both close and [Symbol.asyncDispose]./home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/promise.ts exports namespace PluginPromise and re-exports fromPromise from @opencode/plugin/promise/adapter.atWorktree() in /home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/host.ts rejects refs with a workspaceID using Worktree.UnsupportedLocationError, directly runs the current-location service when no ref is supplied or the ref is current, and only for a different location dynamically imports ../plugin.js, gets Plugin.Service and Worktree.Service, waits on plugins.awaitActivation, then runs against the target service under locations.get(ref).atWorktree() is intentionally deferred because Plugin construction depends on this host, while same-location setup must avoid self-waiting.PluginHost.make in /home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/host.ts constructs Plugin.Context from services including App, Agent, AISDK, Catalog, Command, Bus, Integration, KV, Mcp, Location, Reference, Rpc, Skill, Tool, Vcs, WebSearch, Generate, Permission, PluginHooks, Session, PersistentPty, LocationServiceMap, and Worktree.list, create, refresh, and remove through atWorktree(locationRef(input), ...); refresh is converted to void; reload uses worktrees.reload; and transform adds strategies after converting definition.id with Worktree.StrategyID.make and decoding returned worktree/list values.hook, create, get, switchAgent, switchModel, prompt, generate, command, rename, move, synthetic, interrupt, wait, and context; creation defaults location to the current directory/workspace, generation maps text to { text }, and interruption maps its boolean to { interrupted }.plugin:${pluginID.split("").map((value) => value.charCodeAt(0).toString(16).padStart(4, "0")).join("")}:; get, set, and remove prefix keys, while scan prefixes prefix/after and strips the namespace from returned entry keys and next./home/byk/Code/opencode-v2-pilot/packages/sdk/src/internal/plugins.ts was not found, and a subsequent file search returned no files./home/byk/Code/opencode-v2-pilot/packages/sdk/src/internal/host.ts, which imports SdkPlugins from @opencode/core/plugin/sdk and retrieves SdkPlugins.Service./home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/sdk.ts defines ephemeral bus event Updated as { type: "sdk.plugin.updated", schema: {} }.SdkPlugins.Interface provides register(plugin: Plugin): Effect.Effect<void> and all(): readonly Generation[]; its private store is Map<string, Generation> with revision counter starting at 0.plugin.id as { ...plugin, revision: String(++revision), source: { type: "sdk" } }, then publishes the unlocated Updated event so every booted Location reloads its plugin generation.SdkPlugins layer owns a private store; Location graphs reuse that layer through Effect memoization, so separate hosts remain isolated while all Locations in one host see the same registrations.SdkPlugins.node is created with makeGlobalNode({ service: Service, layer, deps: [Bus.node] }).fromPromise imports/usages in /home/byk/Code/opencode-v2-pilot/packages/core/test/plugin.test.ts, PluginPromise.fromPromise in /home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/worktree.test.ts, config reload behavior in /home/byk/Code/opencode-v2-pilot/packages/core/test/config/reload.test.ts, and unrelated missing/default tests in VCS, CLI ACP, and app persistence tests./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/fixtures/greeting.ts, /home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/fixtures/provider-factory.ts, /home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/fixtures/models-dev.json, and /home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/fixtures/models-dev-reasoning.json./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/fixtures/greeting.ts default-exports Plugin.define({ id: "greeting", ... }); its setup(ctx) calls ctx.command.transform() to add command "greet" with description: ctx.options.description and an async no-op execute.