Dashboard › opencode › Distillation
bd0f7d28-a7da-484e-8e51-f62cd526a19a["lore_tm_v1_dBT7Gb9DAeHLfCWq2hW0-CskpX3RxKA5cLH5b4hPBEo","lore_tm_v1_5NKh35URMwRlf6MwD2lLrraLv-dF_UwZkBwbeiDOY9g","lore_tm_v1_vbelmv0_nPwaBWc4EYMmzM9EvmydWn-XKHK8FmnXTHc","lore_tm_v1_-XmsiwQzdeqynEi6BvTaKjPE0QB0o-P-gLk6iHssP-A","lore_tm_v1_gfjmqAGY7--3tgpPdhRVJVL1Zma6tk-X47TUcXdLD2M","lore_tm_v1_F4KVbObXygKpmA0km6zBYhWFQueOSViWWjJB8UXE5GE","lore_tm_v1_BdKpTeoXkVKDOSzial9ico6BqfI1Kqlxx-wFY-pdkFo"]
/home/byk/Code/opencode-v2-pilot/packages/schema/src/config/compaction.ts exports namespace ConfigCompaction; defines Keep extends Schema.Class<Keep>("Config.Compaction.Keep") with optional tokens: NonNegativeInt; and defines Info extends Schema.Class<Info>("Config.Compaction") with optional auto: Schema.Boolean, keep: Keep, and buffer: NonNegativeInt./home/byk/Code/opencode-v2-pilot/packages/schema/src/config/plugin.ts exports namespace ConfigPlugin; defines Entry extends Schema.Class<Entry>("Config.Plugin.Entry") with required package: Schema.String and optional options: Schema.Record(Schema.String, Schema.Unknown); defines Plugin as Schema.Union([Schema.String, Entry]), exports type Plugin = typeof Plugin.Type, and defines Plugins = Plugin.pipe(Schema.Array)./home/byk/Code/opencode-lore/packages/opencode/src/index.ts config hook disables built-in compaction with cfg.compaction = { auto: false, prune: false } because the gateway handles compaction./home/byk/Code/opencode-lore/packages/opencode/src/index.ts registers 3 hidden internal worker agents: "lore-distill" (description: "Lore memory distillation worker"), "lore-curator" (description: "Lore knowledge curator worker"), and "lore-query-expand" (description: "Lore query expansion worker"). Each uses mode: "subagent" and hidden: true; mode: "subagent" is required because OpenCode defaults agents to mode: "all" and only honors hidden: true for subagent-mode agents./home/byk/Code/opencode-lore/packages/opencode/src/index.ts calls applyLoreProviderConfig(cfg, gatewayBase) to pin the Anthropic providerβs baseURL to the gateway./home/byk/Code/opencode-lore/packages/opencode/src/index.ts maintains module-level fallback currentProject = { path: thisProjectPath, gitRemote: thisGitRemote }, updated on every plugin call so the most recently active project is used for fetches lacking a known session ID, such as direct SDK fetches that bypass chat.headers."chat.headers" hook in /home/byk/Code/opencode-lore/packages/opencode/src/index.ts applies gatewayAccessHeadersForRemote(gatewayBase), sets stable OpenCode database session ID header x-lore-session-id from input.sessionID, and sets x-lore-agent from input.agent./home/byk/Code/opencode-lore/packages/opencode/src/index.ts uses resolveParentSession(ctx.client, input.sessionID) to detect OpenCode Task sub-agents and, when found, forwards the parent as x-parent-session-id so the gateway can size LTM injection; resolution is cached and never blocks or throws on failure."chat.headers" hook injects request-specific x-lore-project from thisProjectPath and x-lore-git-remote from thisGitRemote, preventing concurrent sub-agents or sibling projects in one OpenCode process from clobbering each other; the fetch interceptor remains a fallback for requests bypassing the hook, such as embedding or image generation."chat.headers" hook obtains runtime provider ID via (input.provider as Record<string, unknown> | undefined)?.id because OpenCode plugin SDK types omit .id, then sets x-lore-provider so the gateway routes by provider/protocol/upstream rather than model-prefix guessing.vllm, ollama, and llamacpp, /home/byk/Code/opencode-lore/packages/opencode/src/index.ts derives environment variable LORE_UPSTREAM_<PROVIDER> using providerID.toUpperCase().replace(/-/g, "_"); when present and x-lore-upstream-url is not already set, its value is forwarded as x-lore-upstream-url./home/byk/Code/opencode-lore/packages/opencode/src/index.ts parses LORE_UPSTREAM_EXTRA_HEADERS line by line using /\r?\n/, ignores blank lines and lines without a colon after a nonempty name, splits each valid line at its first colon, trims name/value, and forwards it only when shouldForwardUpstreamExtraHeader(name) permits it, avoiding clobbering gateway-managed headers./home/byk/Code/opencode-v2-pilot/packages/plugin/package.json defines ESM package @opencode/plugin version 1.18.15, license MIT, with scripts test: bun test --only-failures, typecheck: tsgo --noEmit, and build: tsc -p tsconfig.build.json; published files are limited to dist.@opencode/plugin exports "." as ./src/promise/index.ts, "./effect" as ./src/effect/index.ts, "./host" as ./src/host.ts, "./tui" as ./src/tui/index.ts, and "./*" as ./src/*.ts.@opencode/plugin maps import #plugin-source to ./src/source.bun.ts under Bun and to ./src/source.node.ts under both Node and the default condition.@opencode/plugin dependencies are @ai-sdk/provider: 3.0.8; workspace packages @opencode/ai, @opencode/client, @opencode/protocol, @opencode/schema, and @opencode/util at workspace:*; plus catalog versions of @standard-schema/spec, effect, and zod.@opencode/plugin optional peer dependencies are @opencode/theme: workspace:*, @opentui/core: >=0.5.10, @opentui/solid: >=0.5.10, and solid-js: >=1.9.0.@opencode/plugin devDependencies are @opencode/theme: workspace:* and catalog versions of @opentui/core, @opentui/solid, @tsconfig/bun, @tsconfig/node22, @types/bun, @types/node, solid-js, typescript, and @typescript/native-preview.packages/plugin/test/host.test.ts tests for Host.resolve: conventional entrypoints without package.json, local conventional entrypoints with package.json but no exports, honoring exports while preferring an explicit server entrypoint over the root, and the unresolved result { server: undefined, tui: undefined, rpc: undefined }.packages/sdk/test/import-boundaries.test.ts, packages/desktop/test/browser-native.test.ts, packages/schema/test/v1-isolation.test.ts, packages/cli/test/server-connection.test.ts, packages/cli/test/import-boundaries.test.ts, packages/client/test/import-boundaries.test.ts, packages/tui/test/plugin-source.test.ts, packages/core/test/sqlite-bundle.test.ts, packages/ai/test/provider-package.test.ts, and packages/core/test/provider.test.ts; named tests include isolated V1 schema identity, intentional package entrypoints, Moonshot API routes, MiniMax API routes, Azure API entrypoints, Vertex entrypoints, and bundled native provider entrypoints.