Dashboard › opencode › Distillation
5d2eb5bd-8872-4422-9c7d-fab04ddb5d5e["lore_tm_v1_O4f2OYhy1JgnuW75f2JPPM6yVFOfdZVik6nr-gXczKs","lore_tm_v1_OCjF8ucQkolGfeYLLJ-B6paEApbW5raCNm0Jg5YOpoA","lore_tm_v1_BhtPQKQbp_O52tUoXRHCvzoH19beYtX1KPlhSY-x5iI","lore_tm_v1_vrYn_j0dMqMeiaAd0KVnqx7MfbMUF8GmO1JsufsXl-8","lore_tm_v1_LOGm1kqAvw_c2F2-YBL_ACbeW1GpEEx42UKmdq_eFIM","lore_tm_v1_vHhC_OFJPe91Dnz1WIjLQvuRQvBDusdQUimFzFxriXs","lore_tm_v1_ww_KavmdcFTuZ80PWyVxCt_-ieUYA5Tl7FjeBuTegXk","lore_tm_v1_TiRT6nn56YQPv9e0on0DMdNk24jtLTJRuDRpPkN-AZE","lore_tm_v1_bb495j8Ozv5pHeexCJcMjnrTYHkGlqGFT_PyCbkTxPQ","lore_tm_v1__OWxuMhDE9g9eQ4oFJCqaW6DWr3kO7ppymLIHUg-e3w","lore_tm_v1_zRs4Wivr8h9PwmZUaUz0dJW4fINo3S64qCIwr_0oReo","lore_tm_v1_Q5cXpY_V9zMeh8fhaaCCsgrksSmGIljjtAEhixeK5Do","lore_tm_v1_0wcXFXA6PnJnV_Tcw7mIb9jnYc20qT0RIjwAR3LMPNY","lore_tm_v1_EgqDYlDcQDu-Cm-Ttn6FBK9G8mb6zxuuG9cNi7v9tik","lore_tm_v1_f_aN4ZrxYf1ZMXmdGntUf-Ryoz8NgRrR4nPe3YlQKfs","lore_tm_v1_a2o6U9pfOWZYt8_yMPa3AmfhsJdH68eNKD-KqGkqolg","lore_tm_v1_qvQwb6_-DuOjvmMmuFWQKjKvlOQ--nefa9kPOms3SMY","lore_tm_v1_hlQwF_nY_Z6F0YtMqaa61e0P-JtpQLM_gBOVeo0UcSM","lore_tm_v1_O--nTbi-_WD3b3kc25fOx_fdwIPpg_VudTWZWb3G1yI","lore_tm_v1_u7mEdYNbEMeDWS_6lCxj7JMiejfPWBpxPn0UgnoQHrE","lore_tm_v1_zWU9A42qtYwm5-R2yAsI7nIyejuKpd9SgEEHitkV3ZE","lore_tm_v1_1kGs4feqHGGpgc-uaaqPWdPvQB2x3NfYbAIiN1nAPh4","lore_tm_v1_SBULofwQm5ip-cWMGLPDq0Q9Ees9SGGRTEpo2sL9Nwc","lore_tm_v1_8lDdEhrtNTcrbL3aYDiPSSkfcc_FjwtNtt_VqpP8SYg","lore_tm_v1_DppDVqmDRXoxG-wMUGHNoRe34I89pVITMg-OAWRNRKA","lore_tm_v1_aiS_D-y-39YyN6aEjrP8FrPO6Je15MlUJJoQ5WBN77w","lore_tm_v1_JQQg3rhkHv-zM7gkIyfpWWruaKMm1Jl6ZKF4MbmfU8M"]
processBoundary?: boolean in /home/byk/Code/opencode-lore/packages/gateway/src/cli/start.ts is an internal CLI-owned process boundary and is never set by in-process plugins./home/byk/Code/opencode-lore/packages/gateway/src/cli/start.ts defines GatewayHandle with config: GatewayConfig, port: number, ownership flag owned: boolean, owner-only managementToken: string, shutdown: () => Promise<void> that is a no-op when owned is false, and optional one-shot CLI processShutdown?: ProcessShutdownController. GatewayIdentityProbe variants are authenticated with GatewayHealthIdentity { pid: number }, rejected, unavailable, and timeout./home/byk/Code/opencode-v2-pilot/packages/client/src/promise/generated/client.ts found 12 generated get methods: location.get, agent.get, session.get, provider.get, integration.get, form.get, permission.get, pty.get, experimental.persistentPty.get, shell.get, vcs.get, and config.get./home/byk/Code/opencode-v2-pilot/packages/client/src/promise/generated/client.ts: export uses GET /api/session/${encodeURIComponent(input.sessionID)}/export, query sanitize, success 200, declared statuses [400, 401, 404, 500]; active uses GET /api/session/active, success 200, statuses [400, 401]; get uses GET /api/session/${encodeURIComponent(input.sessionID)}, success 200, statuses [400, 401, 404]; remove uses DELETE on that session path, success 204, statuses [400, 401, 404], empty: true; fork uses POST /api/session/${encodeURIComponent(input.sessionID)}/fork, body { boundary: input["boundary"] }, success 200, statuses [400, 401, 404].session.prompt in /home/byk/Code/opencode-v2-pilot/packages/client/src/promise/generated/client.ts uses POST /api/session/${encodeURIComponent(input.sessionID)}/prompt, body fields in order id, text, files, agents, skills, metadata, delivery, resume, success 200, and declared statuses [400, 401, 404, 409]. The adjacent session.command uses POST /api/session/${encodeURIComponent(input.sessionID)}/command with body fields command, text, files, agents, skills, and delivery./home/byk/Code/opencode-v2-pilot/packages/protocol/src/groups/event.ts builds OpenCodeEvent as a union of EventManifest.ServerDefinitions, an rpcEvent, and a fallback server.connected event only if the supplied definitions do not already contain that type. rpcEvent requires id, finite created, optional record metadata, template-literal type rpc.${string}, location: Location.Ref, and record data. EventGroup exposes GET /api/event as HttpApiSchema.StreamSse({ data: EventSchema }); its contract says the stream is volatile, slow consumers overflow and fail, and events during disconnection are missed. isOpenCodeEvent(...) accepts server.connected, EventManifest.isServer(event), or types beginning with rpc../home/byk/Code/opencode-v2-pilot/packages/core/src/config/discovery.ts recognizes opencode.json and opencode.jsonc. ConfigDiscovery.Sources contains optional global, optional explicit, direct, project entries with { path, present }, claude, and agents. Discovery uses global roots <config>, ~/.claude, and ~/.agents; walks upward unless the current location resolves to the global config root or options.project === false; examines .claude, .agents, .opencode, then ...names.toReversed(); resolves parents and candidates to honor symlinked global roots; and prevents global sources from re-entering through the project walk.ConfigDiscovery.discover(...) returns global unless options.global === false, resolves options.file into explicit, puts non-directory candidates into reversed direct order, records reversed .opencode roots with present: fs.isDir(...), and deduplicates claude and agents roots with Set, including their global directories only when global config is enabled./home/byk/Code/opencode-v2-pilot/packages/core/src/config.ts loads configuration in this precedence/order: 1. well-known documents, 2. existing Claude directories as ClaudeDirectory, 3. existing Agents directories as AgentsDirectory, 4. global supplementary files plus Directory, 5. explicit file, 6. direct files, 7. present project supplementary files plus Directory, 8. OPENCODE_CONFIG_CONTENT. Its comment states global entries sit below explicit/direct files while project directories rank above them./home/byk/Code/opencode-v2-pilot/packages/core/src/config.ts: files are read safely, passed through ConfigVariable.substitute({ type: "path", path, text }), parsed, and represented as Document; a directory loads both ConfigDiscovery.names and a Directory entry. Well-known entries use the last credential for an integration when it is a key, map it to the manifest auth environment variable, substitute virtual JSON, and log warnings rather than failing when discovery or resolution fails. Reload infrastructure uses PubSub.unbounded<Watcher.Update>(), PubSub.sliding<void>(1), and readiness rescans to recover writes made before a watcher attached.5 service-v2-pilot.json; another output identified keys on lines 2:hostname, 3:port, and 4:password. No password value was exposed./home/byk/Code/opencode-v2-pilot/packages/core/src/plugin.ts manages plugin activation with active: Map<Plugin.ID, Slot>, a one-permit Semaphore, a Latch initially open, and tokenized readiness holds in pending: Set<object>. holdUnsafe() closes readiness, returns a release effect, and reopens readiness only when the last token is removed.Plugin.activate brands IDs with Plugin.ID.make(...), dies on duplicate IDs with Duplicate plugin ID: ${definition.id}, retains the unchanged prefix, tears down the changed suffix in reverse order, and publishes Plugin.Event.Updated./home/byk/Code/opencode-v2-pilot/packages/core/src/plugin.ts: reordering a failed activation with the same revision does not authorize retry; a newly failed load is stored as error; if a healthy prior activation exists, its plugin revision is reloaded as fallback while the requested definition remains represented; if fallback restoration also fails, the plugin is deactivated and "failed to restore plugin; deactivating" is logged.Activation with message Plugin disabled after ${failure.state}.transform failed. Check server logs for details. and a reference err_${crypto.randomUUID().slice(0, 8)}. A PendingFailure carries the plugin, activation scope, State.Failure, refresh effect, ref, and readiness-release effect. The worker updates inventory under the lock, batches refresh, publishes Plugin.Event.Updated, then schedules Scope.close(item.scope, Exit.void) using Effect.forkScoped({ startImmediately: true }) outside the lock/hold; cleanup/reporting failures are logged, and item.release is always ensured.closed = true, clears pending readiness tokens, opens the readiness latch, clears active slots, and performs State.shutdown(Scope.close(scope, exit)). The service exposes activate, close, awaitActivation: ready.await, hold, and list./home/byk/Code/opencode-lore/.opencode contains exactly 6 entries: .gitignore, bun.lock, node_modules/, package-lock.json, package.json, and plans/./home/byk/Code/opencode-lore/.opencode/package.json is 5 lines and declares one dependency: "@opencode-ai/plugin": "1.4.7"./home/byk/Code/opencode-v2-pilot/.opencode contains exactly 11 entries: .gitignore, agent/, command/, env.d.ts, glossary/, opencode.jsonc, plugins/, skills/, themes/, tool/, and tui.json. Its plugins/ directory contains exactly one entry, smoke-theme.json; a subsequent file search returned No files found./home/byk/Code/opencode-v2-pilot/.opencode/opencode.jsonc uses schema https://opencode.ai/config.json, has empty provider, permission, and mcp objects, references effect at github.com/Effect-TS/effect-smol for Effect v4/effect-smol implementation details and opencode-local at ~/.local/share/opencode for logs/data, and disables tools github-triage and github-pr-search.export default occurrences across plugin/module-related tests: 4 in packages/core/test/plugin/supervisor-reload.test.ts, 2 in packages/core/test/plugin/module.test.ts, 6 in packages/core/test/npm.test.ts, 1 in packages/core/test/plugin/fixtures/greeting.ts, and 1 in packages/core/test/session-activation.test.ts./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/module.test.ts has 2 live tests: 1. "watches creation of an external helper with missing parent directories" starts with a failed load of plugin/index.ts re-exporting missing ../shared/new/nested/helper.ts, creates the helper exporting { id: "appeared", async setup() {} }, joins a change stream with a 5 seconds timeout, reloads, and expects ID appeared; 2. "interrupts pending watcher setup when the loader scope closes during module evaluation" uses entered/release files and deferred gates, closes the loader scope, expects watcher setup to stop, then sleeps 50 ms so Bun can finish the uncancellable native import without an unhandled rejection./home/byk/Code/opencode-v2-pilot/packages/plugin/src/source.ts implements createPluginSources(watch): waits for all pending watch setup before reads; reuses a cached load when every tracked file/directory digest is unchanged; tracks files with Hash.sha256(readFileSync(...)) or sorted-directory JSON, using "missing" on read errors; imports prepareSource from #plugin-source; caches the load attempt before module evaluation so unchanged failing modules do not repeat import-time effects; suppresses rejected interrupted watcher promises; and runs registered disposers plus clears the cache on dispose(). localSource(spec, directory) accepts file://, ./, ../, or absolute paths and otherwise returns undefined./home/byk/Code/opencode-v2-pilot/packages/cli/AGENTS.md: use @opencode/client and location-scoped data from packages/tui/src/context/data.tsx rather than adding dependencies on legacy sync state; preserve established TUI behavior unless intentionally changing it./home/byk/Code/opencode-v2-pilot/packages/cli/vite.node.config.ts maps 6 plugin imports through Node registerHooks: @opencode/plugin → opencode:plugin-v2, @opencode/plugin/promise/plugin → opencode:plugin-promise-plugin, @opencode/plugin/promise/tool → opencode:plugin-promise-tool, @opencode/plugin/effect → opencode:plugin-v2-effect, @opencode/plugin/effect/plugin → opencode:plugin-v2-effect-plugin, and @opencode/plugin/effect/tool → opencode:plugin-v2-effect-tool. Promise/effect modules come from SDKs stored at Symbol.for("opencode.plugin.v2.promise") and Symbol.for("opencode.plugin.v2.effect"); the Promise tool shim is export {}, while the Effect tool shim exports sdk.Tool.Error.${tmpdir()}/opencode-node-${uid ?? "user"}. For SEA builds it creates/chmods the root to 0o700, rejects non-directories, symlinks, and paths owned by another UID, extracts assets through temporary files, and chmods the node-pty spawn helper and persistent PTY asset to 0o755 on non-Windows systems./home/byk/Code/opencode-v2-pilot/packages/cli/src/node/plugin-runtime.promise.ts imports and registers exactly 10 SDK namespaces under Symbol.for("opencode.plugin.v2.promise"): Agent, Command, Connection, Credential, Integration, Model, Plugin, Provider, Reference, and Skill./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/fixtures/greeting.ts defines plugin ID "greeting" with Plugin.define; its async setup transforms commands by adding "greet" with description ctx.options.description and an empty async execute./home/byk/Code/opencode-lore/packages/opencode/test contains exactly 7 test files: gateway-smoke.test.ts, index.test.ts, internal.test.ts, routing.e2e.test.ts, session-state.test.ts, subagent-detection.test.ts, and tui-silence.test.ts.