Dashboard › opencode › Distillation
5aeb711e-ffda-4a33-a319-a3c1d52999a8["lore_tm_v1_3_3O0r2NMQ43QEyYZiaONLc7kFy4BkUO6fCxfy_hIP0","lore_tm_v1_bpAeGjmhTtpnKS86MUAqq99KLsVPlTdOs3QnPvXiD_w","lore_tm_v1_qdLlzNc1VUCAbQ8sLrB37TIKTUWcUoiH_y5ESXZn-QA","lore_tm_v1_s2rxrdOmT0rC1ug5rGNQqPMzI9Otsv4WOMYQuHEm6KA","lore_tm_v1_tMYiJzP2abLn1UI_mr7EZ8qlwAULNuy0FKp9bIJn-Qg","lore_tm_v1_z6yqrFbhYRc_UfhnuaAKx0TgqUsxt77FAqyJS6El810","lore_tm_v1_amWU14Z5tr_ZilQrr58BsZam5Hzii_ZpmQoFJAc-xHw","lore_tm_v1_D6W0V4Q1a7z0sHjhkEH201w55FJCwcQnYhg12Mboaoc","lore_tm_v1_AhIaQg3mGPL296jRnILAE90YKcfcXyZkNR6zvw4g2AE","lore_tm_v1_k8v-sh1edsfp8CoTxfCIODpRa2TF8o50bRI6N7JeHx8","lore_tm_v1_dc9WAnarXuElq40C3EpgCF3jwTGBYRKpW2jgo49HPu4","lore_tm_v1_Ndgstf-akNXAcYi5xY5PN3CouS4RcalqUgzMx8qi4yQ","lore_tm_v1_Vxnw1zlJ-gMNd4YkYtkUut7rzorVtTpqQTG0JaR1bKM"]
Date: Sep 8, 2026
/home/byk/Code/opencode-v2-pilot/packages/cli/dist-v2-pilot-final/cli-node-linux-x64/, /home/byk/Code/opencode-v2-pilot/packages/cli/dist-v2-pilot-next/cli-node-linux-x64/, and /home/byk/Code/opencode-v2-pilot/packages/cli/dist-v2-pilot/cli-node-linux-x64/; each contains package.json and bin/opencode2-node./home/byk/Code/opencode-v2-pilot/packages/cli/dist-v2-pilot-final/cli-node-linux-x64/package.json declares package @opencode/cli-node-linux-x64, version 0.0.0-v2-pilot-202609080301, license MIT, repository git+https://github.com/anomalyco/opencode.git, OS linux, and CPU x64./home/byk/Code/opencode-v2-pilot/packages/cli/dist-v2-pilot-next/cli-node-linux-x64/package.json declares package @opencode/cli-node-linux-x64, version 0.0.0-v2-pilot-202609080105, license MIT, repository git+https://github.com/anomalyco/opencode.git, OS linux, and CPU x64./home/byk/Code/opencode-v2-pilot/packages/cli/dist-v2-pilot/cli-node-linux-x64/package.json declares the older package name @opencode-ai/cli-node-linux-x64 and version 0.0.0-v2-pilot-202608250932, with license MIT, repository git+https://github.com/anomalyco/opencode.git, OS linux, and CPU x64./home/byk/Code/opencode-v2-pilot/packages/cli/AGENTS.md requires CLI/TUI development to use @opencode/client and location-scoped data in packages/tui/src/context/data.tsx rather than adding dependencies on legacy sync state, and to preserve established TUI behavior unless intentionally changing it./home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/adapter.ts is 609 lines and adapts Promise plugins into Effect plugins via fromPromise(plugin: Plugin) so the existing Effect-only Core plugin runtime can run them unchanged./home/byk/Code/opencode-v2-pilot/packages/plugin/AGENTS.md states that the plugin package has Effect and Promise versions; every Effect domain must extend its corresponding Effect API client interface from @opencode/client/effect/api; existing Effect API client functions must not be redefined; plugin domains add only plugin-context-specific functions./home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/adapter.ts, makeStreams() converts Effect streams into abortable AsyncIterables, tracks iterator-closing functions in subscriptions, removes abort listeners during close(), closes an iterator when it finishes or errors, and registers an Effect finalizer that closes every remaining subscription when the plugin unloads.rpcFromEffect() in /home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/adapter.ts creates Promise RPC clients and registrations from portable definitions. Calls run with the captured Effect scope and optional AbortSignal; event subscribe returns an AsyncIterable; event on combines caller and local cancellation with AbortSignal.any, returns an abort function, and logs asynchronous handler-loop errors.ReturnedRpcError, carrying type, message, and optional data. The handler contextβs error() constructs this value; both thrown and returned ReturnedRpcError values are converted through hostRpcError() to context.error(type, message, data).compileEndpoint() in /home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/adapter.ts caches compiled endpoint codecs in compiledEndpoints: WeakMap<object, CompiledEndpoint>, supports at most 1 payload schema and 1 success schema, and throws Unsupported API schema cardinality: ${endpoint.identifier} otherwise. Inputs comprise params, typed query, headers, and payload; absent success uses HttpApiSchema.NoContent.compileEndpoint() unwraps a success object only when its typed form has no index signatures and exactly one property named data, using that propertyβs schema as output; otherwise it encodes the complete success schema. The compiled result contains decode, encode, and noContent.fromPromise() dynamically imports ClientApi from @opencode/protocol/client and OpenCodeEvent from @opencode/protocol/groups/event, captures the plugin Effect scope, and resolves endpoint groups for server.agent, server.command, server.experimental, server.generate, server.integration, server.mcp, server.model, server.plugin, server.permission, server.provider, server.reference, server.session, server.skill, server.vcs, server.websearch, and server.worktree.adaptApiMethod() decodes each endpoint input schema against input ?? {}, merges decoded structures with Object.assign({}, ...decoded), invokes the Effect host method, returns undefined for no-content endpoints, and otherwise encodes the result before running it as a Promise in the captured scope.register(), which converts an Effect HostRegistration into a Promise Registration with dispose(). This preserves boot-time batching so Promise-plugin transforms coalesce into one reload per domain.fromPromise() by wrapping definition.execute(input) with Effect.tryPromise({ try: () => definition.execute(input), catch: (cause) => cause }).host.event.subscribe() by encoding each event with Schema.encodeUnknownEffect(OpenCodeEvent) and exposing the resulting stream through the abortable streams() adapter.session.create, session.get, session.switchAgent, session.switchModel, session.prompt, session.generate, session.command, session.synthetic, session.interrupt, session.rename, session.move, session.wait, and session.context through their corresponding SessionEndpoints; session and shell hooks wrap callbacks with Effect.promise(() => Promise.resolve(callback(event))).fromPromise() acquires plugin.setup(context2) with Effect.acquireRelease; if setup returns cleanup, unload executes it through Effect.promise(() => Promise.resolve(cleanup())), otherwise release is Effect.void./home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/adapter.ts defines attempt<A>(evaluate) as Effect.tryPromise({ try: evaluate, catch: (cause) => cause }) and executePromiseTool(tool, input, context) as an Effect.promise wrapper around tool.execute, replacing progress with (update) => Effect.runPromise(context.progress(update))./home/byk/Code/opencode-v2-pilot/packages/plugin/src/effect/tool.ts defines ToolEditor operations in order: list(), get(id), namespace(namespace), add(tool), update(id, update), and remove(id); update ignores missing IDs./home/byk/Code/opencode-v2-pilot/packages/plugin/src/effect/tool.ts are execute.before, containing mutable tool and input plus readonly sessionID, agent, messageID, and call id; and execute.after, containing readonly call metadata/input plus either { status: "completed", result: Tool.Result } or { status: "error", error: Tool.Error }.ToolFailures: only execute.before may fail, with Tool.Error, which rejects the call before execution; execute.after has failure type never. ToolDomain exposes transform: Transform<ToolEditor>, reload: () => Effect.Effect<void>, and hook: Hooks<ToolHooks, ToolFailures>./home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/tool.ts defines Promise ToolContext as Omit<Tool.Context, "progress"> with progress(update: Tool.Metadata): Promise<void>, and Promise Info replaces Tool.Info.execute with an executor returning Promise<Tool.Result<Output>>.ToolEditor in /home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/tool.ts mirrors the Effect editor operations list(), get(id), namespace(namespace), add(tool), update(id, update), and remove(id); update ignores missing IDs. Promise ToolDomain exposes transform, reload: () => Promise<void>, and hook: Hooks<ToolHooks> without the Effect versionβs explicit ToolFailures generic.Permission.DeclinedError, defined in /home/byk/Code/opencode-v2-pilot/packages/core/src/permission.ts as Schema.TaggedError with tag Permission.DeclinedError; pending permission deferreds fail with DeclinedError | CorrectedError, and declined assertions are caught at line 242 and converted to defects with Effect.die(error)./home/byk/Code/opencode-v2-pilot/packages/core/src/session/model-request.ts defines ExecuteError = Tool.Error | Permission.DeclinedError | QuestionTool.CancelledError; /home/byk/Code/opencode-v2-pilot/packages/core/src/session/runner/step.ts uses fibers and settled exits whose typed failures are Permission.DeclinedError | QuestionTool.CancelledError.