Dashboard › opencode › Distillation
b3f6cbbe-2bca-4987-ba29-a7999745e1f9["lore_tm_v1_paH1_hsgRFi2m_oNoOvQVoAVnxC0yko9jm6KHUKqSjw","lore_tm_v1_yg3hqGoJ3fkautCwzkniiVDguebfaIqdSMWYerfPgqQ","lore_tm_v1_XLNjpstK1X5QBRLiMSYVy1H3b_crrglXIRN565UjGt4","lore_tm_v1_5TEYKNgpXnbdQSmrgQc1U4qCkW8E4sxgbOY4asAS_Gc","lore_tm_v1_BIPIrEg0Ms3TGuzBH7QQ56y_BR1uvdGRNh8vHpkdsR4","lore_tm_v1_YGD032yYE2huw1vjJ_uOK3MvhUbfOhzJna0lCyPg2hE","lore_tm_v1_6cYG5o7p1vjnYaV8C3Z-__kiEm9EXyLjLD69PzV8RDI"]
packages/gateway/src/cli/start.ts defines EMBED_DRAIN_DEADLINE_MS = Math.max(500, Math.floor(SHUTDOWN_DEADLINE_MS * 0.6)); the bounded in-flight document-embed drain must remain under the hard shutdown deadline so a slow/stuck embed can never reintroduce the Ctrl+C hang, with unfinished work re-indexed by runStartupBackfill on next boot.packages/gateway/src/cli/start.ts defines VECTOR_POOL_SHUTDOWN_DEADLINE_MS = Math.max(Math.min(DEFAULT_VECTOR_POOL_SHUTDOWN_DEADLINE_MS, SHUTDOWN_DEADLINE_MS - 500), 500); vector-pool shutdown must close every worker SQLite reader before the writer can TRUNCATE the WAL, while preserving at least 500ms for checkpoint/close even with aggressive LORE_SHUTDOWN_TIMEOUT_MS such as 1000ms.StartOptions.processBoundary?: boolean is an internal CLI-owned process-boundary flag and must never be set by in-process plugins.StartOptions in packages/gateway/src/cli/start.ts includes port, hosts, debug, quiet, remoteUrl, local, allowRemoteManagement, bg, and processBoundary; remoteUrl overrides LORE_REMOTE_URL, local corresponds to --local/-l, and bg corresponds to --bg/--daemon.GatewayHandle exposes config, port, owned, owner-only managementToken, async shutdown(), and optional internal processShutdown?: ProcessShutdownController; shutdown is a no-op when owned is false.GatewayIdentityProbe variants are { kind: "authenticated"; identity: GatewayHealthIdentity }, { kind: "rejected" }, { kind: "unavailable" }, and { kind: "timeout" }; GatewayShutdownRequestResult is "accepted" | "unsupported" | "failed".isLoopbackProbeUrl() accepts hostnames localhost, localhost., ::1, and IPv4 strings matching /^127(?:\.\d{1,3}){3}$/; malformed URLs return false./home/byk/Code/opencode-v2-pilot/packages/schema/src/location.ts defines Location.Ref with required directory: AbsolutePath and optional workspaceID: WorkspaceID; Location.Info adds project: { id: ProjectID; directory: AbsolutePath; canonical: AbsolutePath }; response<S extends Schema.Top>(data: S) returns Schema.Struct({ location: Info, data })./home/byk/Code/opencode-v2-pilot/packages/plugin/package.json identifies @opencode/plugin version 1.18.15, ESM, MIT licensed; scripts are test: "bun test --only-failures", typecheck: "tsgo --noEmit", and build: "tsc -p tsconfig.build.json".@opencode/plugin exports "." -> "./src/promise/index.ts", "./effect" -> "./src/effect/index.ts", "./host" -> "./src/host.ts", "./tui" -> "./src/tui/index.ts", and "./*" -> "./src/*.ts"; import alias #plugin-source selects ./src/source.bun.ts for Bun and ./src/source.node.ts for Node/default.@opencode/plugin dependencies include @ai-sdk/provider@3.0.8, workspace packages @opencode/ai, @opencode/client, @opencode/protocol, @opencode/schema, @opencode/util, plus @standard-schema/spec, effect, and zod; optional peers are @opencode/theme, @opentui/core>=0.5.10, @opentui/solid>=0.5.10, and solid-js>=1.9.0./home/byk/Code/opencode-lore/.oxfmtrc.json configures useTabs: false, tabWidth: 2, printWidth: 80, double quotes via singleQuote: false and jsxSingleQuote: false, quoteProps: "as-needed", trailingComma: "all", semi: true, arrowParens: "always", bracketSameLine: false, bracketSpacing: true, sortPackageJson: false, and sortImports: false..oxfmtrc.json ignores **/dist, **/dist-bin, **/dist-tarballs, **/dist-vendor, **/.sea-staging, **/.vendor-build, **/*.d.ts, **/eval/data, **/eval/fixtures, **/eval/results, and files matching **/*.md, **/*.mdx, **/*.markdown, **/*.css, **/*.scss, **/*.less, **/*.yml, **/*.yaml, **/*.toml, **/*.html, **/*.astro, **/*.vue, **/*.svelte, **/*.graphql, and **/*.gql.packages/opencode/test/index.test.ts initializes LorePlugin with a mock client, a timestamped __tmp_plugin_${Date.now()}__ directory, project { id: "test", path: tmpDir }, directory/worktree set to that directory, serverUrl: new URL("http://localhost:0"), and cleanup via rmSync(tmpDir, { recursive: true, force: true }).{ auto: false, prune: false }.lore-distill with description "Lore memory distillation worker", lore-curator with description "Lore knowledge curator worker", and lore-query-expand with description "Lore query expansion worker"; each must have mode: "subagent" and hidden: true.hidden only for subagent-mode agents, every internal worker must explicitly remain mode: "subagent" rather than "all" or "primary"."my-agent": { hidden: false, description: "Custom" }, while Loreβs internal agents are added.applyLoreProviderConfig() regression test pins options.baseURL to "http://127.0.0.1:3207/v1" for every provider in cfg.provider, explicitly including openai, anthropic, google, and mistral; this prevents Anthropic requests from being derived from OPENAI_BASE_URL as http://host/messages instead of /v1/messages, and handles OpenCode resolveSDK() bypassing OPENAI_BASE_URL/ANTHROPIC_BASE_URL.defaultHeaders: { "X-Custom": "value" }, while baseURL is pinned to "http://127.0.0.1:3207/v1".headerTimeout: false for routed openai and openai-codex providers, overriding an inherited OpenAI value such as 30_000, while preserving an explicit Anthropic headerTimeout: 10_000.applyLoreProviderConfig(cfg, "") is a no-op when gatewayBase is empty, such as under NODE_ENV=test or startup failure, so user configuration is not overwritten with a broken "/v1" value.cfg.provider is absent, Lore adds provider.openai.options exactly as { baseURL: "http://127.0.0.1:3207/v1", headerTimeout: false }.glitch: "not-an-object" are skipped without crashing or producing invalid config, while valid entries such as Anthropic are still routed.hooks.tool is {} and only config, tool, and chat.headers hooks should be registered; event, experimental.chat.system.transform, experimental.chat.messages.transform, and experimental.session.compacting must be undefined."undefined is not an object (evaluating 'A.event')" caused by OpenCodeβs legacy loader invoking every function export as a plugin and rejecting non-function exports; packages/opencode/src/index must export only LorePlugin and default, with default === LorePlugin.Object.keys(mod).sort() to equal ["LorePlugin", "default"]; reference deduplication over function exports must yield exactly one function, and that function must be mod.LorePlugin.packages/gateway/package.json identifies @loreai/gateway version 0.40.0, ESM, license FSL-1.1-Apache-2.0, requiring Node >=22.15; its description is "Lore as a transparent LLM proxy β context management for any AI coding client".@loreai/gateway package entry points are main: "./dist/index.cjs", types: "./dist/index.d.cts", conditional exports with Bun ./dist/index.bun.js and require/default ./dist/index.cjs, and binaries lore and lore-gateway both mapped to ./dist/bin.cjs.typecheck: "tsc --noEmit", build: "tsx script/build.ts", bundle: "tsx script/bundle.ts", build:binary: "tsx script/build.ts --binary", build:binary:sea: "tsx script/build-binary-sea.ts", and start: "tsx src/index.ts".@loreai/gateway published files are dist/bin.cjs, dist/embedding-worker.cjs, dist/embedding-worker.js, dist/index.bun.js, dist/index.cjs, dist/index.d.cts, dist/ort-wasm-simd-threaded.mjs, dist/ort-wasm-simd-threaded.wasm, dist/vector-worker.cjs, and dist/vector-worker.js.@streamparser/json@0.0.26, @stricli/auto-complete@1.2.8, @stricli/core@1.2.8, @supabase/supabase-js@^2.58.0, google-auth-library@^10.9.0, jsonc-parser@3.3.1, p-limit@7, qrcode-terminal@^0.12.0, semver@^7.7.3, and sqlite-vec@0.1.9; development dependencies include @loreai/core@workspace:*, @sentry/bun@^10.52.0, ai-tokenizer@^1.0.6, binpatch@^0.3.1, fossilize@^0.10.1, onnxruntime-node@1.27.0, tar@^7.5.21, and undici@^8.9.0.