Dashboard › opencode › Distillation
28c190c6-6551-4722-86e1-d525446b6409["lore_tm_v1_tLlscdkZsGwBU9h_4BMRjYDAunwvRO_11iVCVgm9nnQ","lore_tm_v1_Z57wPJufrT-GYYrWHZnzvtp-3KUIVespXKZ4w4oJUjU","lore_tm_v1_TWkFz_kWOIspsIFaKeTgCQE5ziiCXrWG-OHO9SRiudE","lore_tm_v1_v_wt_UZeIlEiyOqN7pVCbyI9BFX8rcFOnaZSZyb5suM","lore_tm_v1_7IDX43fbxdBK98mQ5ycavi_Y97TvDp6rI_nfqUWl6SY","lore_tm_v1_DrEv4bQOvKe6RkiqtOlZeGIywK8XGn0wJFsFmrogxvw","lore_tm_v1_tWGmNYJ90Lyb5PMS1byV9QmxZxx5G7Vn4I9jjiJWED4","lore_tm_v1_E0hX8D5H-NU1jkQ07f0MhOg_ZohwmNcKd6C5kDd6KIo","lore_tm_v1_lw3mO4an8OTf9nKZuyIoZPLL3yrl_8xNgeeOKUm5FFE","lore_tm_v1__kSU6jqpouk0f1GdXGLizGWUz6lVGJINYyoCeXTHVdI","lore_tm_v1_VKqBtY4pl5RQn2gv_sccCaAq3CaJ2SQPpcNT3E0IGW4"]
Date: Sep 9, 2026
pnpm workspaces, and SQLite runs in WAL mode with FTS5 at ~/.local/share/lore/lore.db.packages/core/test/setup.ts and never the production database.pnpm install, pnpm test, pnpm run typecheck, pnpm run lint, pnpm run lint:fix, pnpm run format, pnpm run format:check, and pnpm run build.quality/REVIEW.md and covers regression-test discipline, adversarial-order state setup, fan-out registry coverage, recurring bug-class batteries, and the two-reviewer rule.CHANGELOG.md must never be edited manually because Craft handles both.gh workflow run release.yml -f version=auto for conventional-commit-derived semver or gh workflow run release.yml -f version=0.23.0 for an explicit version.scripts/bump-version.sh updates all package.json versions; 2. changelog is generated from conventional commits; 3. a release/X.Y.Z branch is created and pushed; 4. CI tests and builds npm tarballs, standalone binaries, and delta patches; 5. Craft opens a publish issue; 6. adding the accepted label triggers npm publishing through OIDC trusted publishing and a GitHub Release containing binaries and patches..craft.yml defines release targets for 4 npm workspaces, the legacy opencode-lore alias, and a GitHub Release with binaries.@loreai/opencode in /home/byk/Code/opencode-lore/packages/opencode/package.json is version 0.40.0, uses "type": "module", ships raw TypeScript from ./src/index.ts as both main and types, has no build step, and requires peer dependency @opencode-ai/plugin >=1.1.0./home/byk/Code/opencode-lore/packages/opencode/package.json dependencies are @loreai/core: workspace:* and @loreai/gateway: workspace:*; dev dependencies are @opencode-ai/plugin: ^1.1.39, @opencode-ai/sdk: ^1.1.39, and @types/bun: ^1.2.0./home/byk/Code/opencode-lore/packages/gateway/src/index.ts exports loadConfig, DEFAULT_PORTS, DEFAULT_PORT, GatewayConfig, startServer, handleRequest, resetPipelineState, readPortFile, readGatewayProcessFile, startGateway, probeGateway, probeGatewayProcess, probeGatewayProcessHost, probeUrlFor, GatewayHandle, StartOptions, runCli, and legacy _cli./home/byk/Code/opencode-lore/packages/gateway/src/index.ts, direct-execution detection checks process.argv[1] === __filename for CJS, where __filename is always defined; ESM under Bun or tsx instead compares against fileURLToPath(import.meta.url).import.meta.url to an injected import_meta_url shim through packages/gateway/script/import-meta-url.js; the import.meta.url branch is unreachable at CJS runtime because __filename is always defined there, but the shim avoids esbuildβs empty-import-meta warning.runCli is the Stricli-driven gateway entry for help, version, whoami, logs, stop, log, and diff; it falls back to legacy _cli() for commands not yet migrated, while _cli() remains exported for compatibility./home/byk/Code/opencode-lore/packages/opencode/test/index.test.ts enforces that the plugin entry exports only LorePlugin and default, with default being the exact same function reference as LorePlugin./home/byk/Code/opencode-lore/packages/opencode/test/session-state.test.ts covers per-project OpenCode plugin state for multiple worktrees or sub-agent project contexts in one process: each project retains its own project path and git remote, chat.headers uses the correct state per request, and concurrent registrations do not clobber sibling state.lore-config bug where module-level currentProjectPath was overwritten by sibling project initialization, causing requests to be attributed to the wrong project.chat.headers injects x-lore-session-id, x-lore-agent, and the project-specific x-lore-project; multiple sessions in one projectβincluding s1, s2, s3, sub-agent-1, and sub-agent-2βreceive the same project path.title still receive x-lore-project, allowing the gateway to route consistently rather than falling back to its current working directory.x-lore-git-remote; no git remote may leak from a sibling project./home/byk/Code/opencode/packages/plugin/src/v2/effect/context.ts defines PluginContext with readonly options, agent, aisdk, catalog, command, integration, plugin, reference, and skill; agent, catalog, command, integration, reference, and skill include Reload where declared./home/byk/Code/opencode/packages/core/src/plugin.ts, plugin lifecycle state uses active: Map<ID, Scope.Closeable>, loading: Set<ID>, waiters: Map<ID, Set<Deferred.Deferred<void>>>, failures: Map<ID, Exit.Exit<void, never>>, and per-ID KeyedMutex locking.Plugin load cycle detected for ${id}; replacing an active plugin closes its existing child scope, forks a new child scope, runs the plugin effect under that scope, publishes Event.Added, and releases registered waiters.Cannot remove plugin ${id} while it is loading; otherwise it deletes active and failure state and closes the current plugin scope if present./home/byk/Code/opencode-lore/packages/core/src/fetch-interceptor.ts intercepts at globalThis.fetch so provider SDKs construct requests with their correct authentication and URLs first; routing then preserves original headers and URL context while injecting dynamic Lore headers per request through getHeaders().messages, chat/completions, and responses under /v1/, /api/v1/, /api/, /openai/v1/, and /anthropic/v1/, plus Codex /codex/responses./home/byk/Code/opencode-lore/packages/core/src/fetch-interceptor.ts rewrites "/codex/responses" to "/v1/codex/responses" and maps body protocols to gateway paths as anthropic β /v1/messages, openai β /v1/chat/completions, and openai-responses β /v1/responses.LLM_ENDPOINT_SUFFIXES is ordered longest-first as ["/chat/completions", "/codex/responses", "/responses", "/messages"] so body-detected non-standard requests derive the correct upstream base prefix and X-Lore-Upstream-URL.LORE_REMOTE_URL and LORE_GATEWAY_AUTH_TOKEN; the plugin injects the access token as x-lore-gateway-token only for the matching LORE_REMOTE_URL.LORE_GATEWAY_AUTH_TOKEN is never used as provider authentication and is never placed in the URL./v1; the gateway appends API paths automatically.LORE_UPSTREAM_<PROVIDER>, uppercasing the provider name and replacing hyphens with underscores. Documented mappings are vllm β LORE_UPSTREAM_VLLM, llamacpp β LORE_UPSTREAM_LLAMACPP, ollama β LORE_UPSTREAM_OLLAMA, lmstudio β LORE_UPSTREAM_LMSTUDIO, tgi β LORE_UPSTREAM_TGI, and litellm β LORE_UPSTREAM_LITELLM.