Dashboard › opencode › Distillation
a9107fa7-85c9-4053-98a4-74158dbf5f95["lore_tm_v1_yAlfdQRR9xp9XrpJ9dS8UVx-vGFyA_udcMECPVLquzM","lore_tm_v1_A_CIOr7utxUkzy_GN3UulYjv9AtNf0_oimSy_A_Zm6Y","lore_tm_v1_v1fl4Y3_fIJ7ZZc817lluUGUlbNrvEQnmLlqF7Rc8yo","lore_tm_v1_0r2Mf0vEuYKMbGCPNx1O9SerrYXyN7GtinF8cUWF5Hc","lore_tm_v1_LyLzF_km6gGze5CPHhwJMY_JBzb0humGiCXYOf40fu8","lore_tm_v1_m4B6XwjcsHTlOvbcHuXHaBINWyUnmQxvd8nTXKFt0iE","lore_tm_v1_frAgYB7v96o0gxCf4wLRJvfe3amXpHtIZvcPBXFr19w","lore_tm_v1_tHfxgbq9wPJw-PQcCfW7r8pUzf-F3BiH-Rhvcls0pBA","lore_tm_v1_Hi1Bl-LsK0p7tmmKEwADLO4nn_ZUUiOZSXEEhlyTHJ8","lore_tm_v1_4_q_nL2AMEI-NlzxWJVL6utwckhtsNTczBGIeHTs6TQ","lore_tm_v1_-MWshEzMTG28P0KnhsDGxFh0UNX9m-34fq8bCAOD81k","lore_tm_v1_VTt_reuqbofWP2x3yQAvLnwRwuqiJTQ86XUzPjgmzEc"]
Date: September 9, 2026
/home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/adapter.ts implements fromPromise(plugin: Plugin), adapting a Promise plugin into an Effect plugin via define({ id: plugin.id, effect }); plugin.setup(context2) is acquired with Effect.acquireRelease, and its optional cleanup runs when the plugin scope is released. Hook registrations run in the captured plugin Scope.Scope, preserving boot-time batching and disposing registrations on unload./home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/adapter.ts uses makeStreams() and Stream.toAsyncIterableWith(stream, context). Each async iterator has a tracked close() callback, supports an optional AbortSignal, removes abort listeners when closed, closes on completion/error, and is finalized collectively when the plugin unloads./home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/adapter.ts is implemented by rpcFromEffect(): generated client methods execute Effect RPC methods using the captured context and optional abort signal; events.subscribe exposes an AsyncIterable; events.on creates an AbortController and returns an unsubscribe function; register() adapts Promise handlers and returns { dispose, events.emit }. ReturnedRpcError carries type, message, and optional data; hostRpcError() maps it through the hostβs context.error(...).compileEndpoint() in /home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/adapter.ts caches compiled endpoint adapters in WeakMap<object, CompiledEndpoint>, rejects more than one payload or success schema with Unsupported API schema cardinality: ${endpoint.identifier}, decodes params/query/headers/payload with Effect Schema, handles HttpApiSchema.NoContent, and unwraps a success schema consisting solely of a data property before encoding the Promise-facing result.fromPromise() dynamically imports ClientApi from @opencode/protocol/client and OpenCodeEvent from @opencode/protocol/groups/event, then builds endpoint adapters 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./home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/adapter.ts exposes adapters for app, location, options, agent, aisdk, catalog, command, event, experimental.terminal.read, generate.text, integration, mcp, permission, plugin.list, reference, rpc, skill, storage, tool, vcs, websearch, worktree, session, and shell. API methods use adaptApiMethod(); transform/hook registrations return Promise-side disposable registrations; reload and storage operations run Effects in the captured context.execute with Effect.tryPromise; events encode through OpenCodeEvent; integration authorization adapts both auto and code-callback modes plus optional credential refresh; tool list/get/add/update translate execute and progress handling; VCS, web-search, and worktree definitions pass cancellation signals through attempt(); session exposes create, get, switchAgent, switchModel, prompt, generate, command, synthetic, interrupt, rename, move, wait, and context.TypedFailure by permission.assert; executePromiseTool() converts a TypedFailure into Tool.Error, choosing its message from a string feedback property, then an Error.message, then String(error.error), while other Promise-tool errors become Effect defects via Effect.die(error).plugins/followup.ts and plugins/pty.ts. Loreβs current entrypoint is rejected before setup because V2 requires one default definition with id and either setup or effect, whereas Lore exports a legacy plugin function.in_progress, high); 2. Trace Lore plugin entrypoint, dependencies, hooks, APIs, and startup assumptions (in_progress, high); 3. Trace V2 plugin discovery, loader, and Promise plugin contracts (pending, high); 4. Compare both sides and classify every concrete incompatibility (pending, high); 5. Define the smallest viable port and complete validation sequence (pending, medium); 6. Prepare a concise evidence-based compatibility report (pending, high)./home/byk/.local/share/opencode-v2-pilot/config/opencode/opencode.json contains only $schema: "https://opencode.ai/config.json"; no plugins are explicitly configured in that document./home/byk/.local/share/opencode-v2-pilot/config/opencode/package.json is private ESM and depends on effect through file:/home/byk/Code/opencode-v2-pilot/node_modules/.bun/effect@4.0.0-rc.112/node_modules/effect; its sole dev dependency is @types/bun: 1.2.21./home/byk/.local/share/opencode-v2-pilot/config/opencode/plugins/followup.ts default-exports Plugin.define({ id: "followup", async setup(ctx) }). It registers 3 tools in order: 1. schedule_followup parses delays, requires at least 1000ms, schedules ctx.session.prompt({ text: "[scheduled follow-up] ...", delivery: "steer" }), and uses 8-character base-36 IDs; 2. list_followups reports pending items and approximate remaining seconds; 3. cancel_followup cancels one ID or "all".followup plugin tracks timers per session in pending, caches whether sessions are subagents in subagentCache, and refuses all 3 tools in subagents with Error: scheduled follow-ups are disabled in subagents. A subagent must finish its task and return a result synchronously. It subscribes to session.deleted events to clear session state; cleanup aborts the event subscription and clears every pending timer.parseDelay() in /home/byk/.local/share/opencode-v2-pilot/config/opencode/plugins/followup.ts accepts nonnegative decimal values with optional units ms, s, m, h, sec, secs, min, mins, hour, hours, second, seconds, minute, or minutes; a bare number means seconds. Multipliers are 1, 1000, 60_000, or 3_600_000, and the result is rounded with Math.round./home/byk/.local/share/opencode-v2-pilot/config/opencode/plugins/pty.ts exports createPtyPlugin(options: PtyPluginOptions = {}) and default-exports createPtyPlugin(); the plugin definition has id: "local-pty". Its 5 tools are pty_spawn, pty_write, pty_read, pty_list, and pty_kill.MAX_SESSIONS = 16, MAX_SESSIONS_PER_OWNER = 5, DEFAULT_READ_LIMIT = 500, MAX_READ_LIMIT = 2_000, MAX_READ_OFFSET = 10_000, MAX_LINE_LENGTH = 2_000, MAX_PATTERN_LENGTH = 500, MAX_WRITE_SIZE = 65_536, MAX_TIMEOUT_SECONDS = 3_600, CLOSE_TIMEOUT_MS = 27_000, NOTIFICATION_TIMEOUT_MS = 5_000, IO_TIMEOUT_MS = NOTIFICATION_TIMEOUT_MS, MAX_COMMAND_LENGTH = 4_096, MAX_ARGUMENTS = 128, MAX_ARGUMENT_LENGTH = 16_384, MAX_ARGUMENT_BYTES = 65_536, MAX_PATH_LENGTH = 4_096, MAX_TITLE_LENGTH = 500, MAX_DESCRIPTION_LENGTH = 2_000, MAX_REGEX_WORKERS = 4, MAX_BUFFER_SIZE = 1_000_000, TERMINATE_TIMEOUT_MS = 2_000, and SPAWN_TIMEOUT_MS = 5_000./usr/bin/script and /bin/sh, with fixed environment HOME=/home/byk, LANG=C.UTF-8, LOGNAME=byk, PATH=/usr/bin:/bin, SHELL=/bin/sh, TERM=xterm-256color, and USER=byk. Its session statuses are "running" | "killing" | "killed" | "exited", and it tracks sessions, deleted owners, reservations, pending spawns, owner-specific spawns, pending notifications, reserved capacity, closing state, and regex-worker count.1..4_096 characters, at most 128 arguments of at most 16_384 characters each, paths to 4_096, titles to 500, descriptions to 1..2_000, timeout seconds to integers in 1..3_600, write strings to 65_536, read offsets to 0..10_000, read limits to 1..2_000, and regex patterns to 500. Supported write escapes are \n, \r, \t, \xNN, \uNNNN, and \\.hostname, port, and password; no values were shown.