Dashboard › opencode › Distillation
a9fb7b2f-3607-4dcc-a035-00654428be30["lore_tm_v1_PZVdH9xZNNXag5CKw188K9ZXYRNgPQU8CHAMx_3nTAE","lore_tm_v1_19wx1KlVtBXIda9AoW9SoXXfyHh-wnKi8MsOldo-7kA","lore_tm_v1_tCfcj5nyINIOSGoQHfM2G7EZYs-hPniqjs9hzZ4xW0E","lore_tm_v1_SgEmHckRkG1dq0lGx4OFXfs2ycMuNtzs2dcsU9UMM8Y","lore_tm_v1_mBvlTBMIqFzjN8O1n_NyCJjLYJRUSALVZMtgmDGnE4Q","lore_tm_v1_aUpuR5nbO4Ufyo0dvmQmK5S82c10-3YaBhHm1c3j1Wk","lore_tm_v1_t7iG-dLDgifKVoWlygK4CydJiz-tHgfCdIVvkj32Kdc","lore_tm_v1_dIq1cHil_ACcd0IkfvQw8YQJKUJR5J_LmOKJNiLwFmQ","lore_tm_v1_MBzTbqeyF9KrLQLKfZ9rml_uMyPGS7fAknEOuU21-F4","lore_tm_v1_8hgeH3hznJtNInhQBz9YoVB1lr3h5O0EYMO64bivg1k","lore_tm_v1_I_i4hR1DxwtBFzDKAnV3DI9SowVS5SaaWdS4p9KTj4s","lore_tm_v1_rmulY450hAeYwCGlZSLdBR4MM8p3pks310h6v18Y1PU","lore_tm_v1_aLpoVe5FL5NmHqzgQHEsgqS9Ny1JMqWSHHaclZIRFY4","lore_tm_v1_CxdA2kRSVGi8Y2_Fjut5ya_Jj_2kKNsFGuqIQvjuMsI","lore_tm_v1_5oU0BVj8glt-3LMNyDKjaynBB3atjDQOaKMu0z7qhyk","lore_tm_v1_YRd7zfLFcX-g8VY2gEzcDJR2OhCEopvWdkRIxyxJG7A","lore_tm_v1_xel63CNfdbJIep5o1_xPxxfKtLHQcu8ED2rhilWGZvE","lore_tm_v1_1Y6ByGezGxrY2arQtiN4qizJ8_R6X6QvkdMuXmn486g","lore_tm_v1_FsImuw6FIxEP_Mway1b2CkJy-oxUCz9lQoQv6JGFkVs","lore_tm_v1_kgfRyAPMB1sUDkFw3k5bH7FSgAHgolPlpCKyc-0hBTY","lore_tm_v1_apNYGszQGSWNGRjSEfqeG7CMRJn3NYhu2OuXMdUO5EA","lore_tm_v1_pb881NJrz8DYqzZX7m92MRHqJOGDOoUWnA7waFtxNp8"]
/home/byk/Code/opencode-lore-v2/node_modules/@opencode; the workspace-scoped modules instead reside under /home/byk/Code/opencode-lore-v2/packages/opencode/node_modules, containing .bin/, @loreai/, @opencode-ai/, @opencode/, and @types/./home/byk/Code/opencode-lore-v2/packages/opencode/node_modules/@opencode/plugin/package.json: package @opencode/plugin version 0.0.0-beta-19378 exports the Promise API from ./dist/promise/index.js, Effect API from ./dist/effect/index.js, host and TUI entry points, and wildcard ./dist/*.js exports; scripts are bun test --only-failures, tsgo --noEmit, and tsc -p tsconfig.build.json.@opencode/plugin@0.0.0-beta-19378 dependencies include @ai-sdk/provider@3.0.8, @opencode/ai, @opencode/client, @opencode/protocol, @opencode/schema, and @opencode/util at 0.0.0-beta-19378, @standard-schema/spec@1.1.0, effect@4.0.0-rc.112, and zod@4.1.8; optional peers are @opencode/theme@0.0.0-beta-19378, @opentui/core>=0.5.10, @opentui/solid>=0.5.10, and solid-js>=1.9.0./home/byk/Code/opencode-lore-v2/packages/opencode/node_modules/@opencode/plugin/dist/promise contains 23 .d.ts/.js module pairs: adapter, agent, aisdk, catalog, command, event, index, integration, mcp, permission, plugin, reference, registration, rpc, session, shell, skill, storage, tool, types, vcs, websearch, and worktree./home/byk/Code/opencode-lore-v2/packages/opencode/node_modules/@opencode/plugin/dist/promise/index.d.ts exports PluginOptions, storage types, Plugin, and schema namespaces Agent, Command, Connection, Credential, Integration, Location, Mcp, Model, PersistentPty, Provider, Reference, Rpc, Skill, Vcs, WebSearch, and Worktree.Context in dist/promise/plugin.d.ts exposes app, location, options, agent, aisdk, catalog, command, event, experimental.terminal.read, integration, mcp, generate, permission, plugin.list, reference, rpc, session, shell, skill, storage, tool, vcs, websearch, and worktree; a plugin has exact fields id and setup(context), with Cleanup = () => Promise<void> | void, and is declared through define(plugin: Plugin).dist/promise/session.d.ts are prompt, context, "model.request", "http.request", "http.response", and retry; request kinds are exactly "primary" | "compaction" | "title" | "generate". SessionContext provides mutable system, messages, tools, generation, and providerOptions; model/HTTP request hooks expose mutable baseURL, headers, request, or response as applicable.SessionDomain combines SessionApi methods create, get, switchAgent, switchModel, prompt, generate, command, synthetic, interrupt, rename, move, wait, and context with hook: ModelHooks<SessionHooks>.AgentDomain.transform: Transform<AgentEditor> and reload(): Promise<void>; AgentEditor supports list(), get(id), default(id), update(id, update), and remove(id). ModelHooks may be scoped with ModelHookOptions.providerID; unscoped hooks apply to every provider, and registrations expose asynchronous dispose()./home/byk/Code/opencode-lore-v2/node_modules/.pnpm/@opencode+plugin@0.0.0-beta-19378_@opentelemetry+api-logs@0.214.0_@opentelemetry+resour_adca8235564d91579da6ab6087184da7/node_modules/@opencode/schema/dist/location.d.ts defines Location.Ref with directory and optional workspaceID, while Location.Info additionally contains project.id, project.directory, and project.canonical./home/byk/Code/opencode found 17 agent.transform uses across packages/core/test/session-runner.test.ts, packages/core/test/agent.test.ts, plugin fixtures/tests, packages/core/src/config/plugin/agent.ts, and packages/core/src/plugin/agent.ts./home/byk/Code/opencode found 28 model.request uses; request configuration merges provider and model headers/body in packages/core/src/catalog.ts, is consumed in packages/core/src/aisdk.ts and packages/core/src/session/runner/model.ts, and is modified by packages/core/src/config/plugin/provider.ts, packages/core/src/plugin/provider/opencode.ts, and packages/core/src/plugin/provider/gitlab.ts./home/byk/Code/opencode/packages/plugin/src/v2, including Promise and Effect implementations of agent, aisdk, catalog, command, context, integration, plugin, reference, registration, and skill; Effect-only modules also include event, filesystem, location, npm, and path.system — it embeds” system messages inside the messages array; top-level system together with messages is therefore treated as an Anthropic-specific body marker./home/byk/Code/opencode-lore-v2/packages/core/src/fetch-interceptor.ts, a 587-line fetch-level transparent LLM proxy router that preserves provider authentication and original URL context while redirecting eligible remote LLM calls through the Lore gateway.LLM_API_PATH_PATTERNS recognizes /v1/{messages,chat/completions,responses}, /api/v1/{messages,chat/completions,responses}, /api/{messages,chat/completions,responses}, /(openai|anthropic)/v1/{messages,chat/completions,responses}, and /codex/responses; NON_STANDARD_PATH_REWRITES maps "/codex/responses" to "/v1/codex/responses".detectProtocolFromBody() supports protocols "anthropic", "openai", and "openai-responses" and requires a parsed object with model: Responses is detected first from array input, max_output_tokens, or previous_response_id; Anthropic from top-level system plus array messages; OpenAI Chat falls back to array messages. Ambiguous fields such as store and instructions are intentionally excluded.extractBodyString() performs non-consuming synchronous extraction only for string, ArrayBuffer, and typed-array bodies; ReadableStream bodies and bodies available only through a Request are not read and fall through to bypass/warn handling.upstreamPath; standard /v1/ URLs retain the suffix after the last /v1/, while body-detected non-standard endpoints route via PROTOCOL_GATEWAY_PATHS: Anthropic to /v1/messages, OpenAI Chat to /v1/chat/completions, and OpenAI Responses to /v1/responses.LLM_ENDPOINT_SUFFIXES, ordered longest-first, are "/chat/completions", "/codex/responses", "/responses", and "/messages"; interceptUrlForProtocol() strips a recognized suffix to derive upstreamBase, otherwise falling back to the upstream origin.shouldIntercept() permits only recognized LLM API paths on remote hosts and rejects URLs beginning with gatewayBase plus local hosts localhost, 127.0.0.1, 0.0.0.0, ::1, and [::1]; malformed URLs also return false.rewriteRequest() and rewriteRequestForProtocol() do not read request bodies. Gateway-bound requests preserve all original headers, set x-lore-upstream-url to the upstream base and x-lore-upstream-path to the client’s original absolute pathname, inject dynamic headers only when absent, and invoke optional onRequestHeaders; failures from dynamic-header or observation callbacks are logged without aborting routing.installFetchInterceptor() uses process-global Symbol.for("lore.fetchInterceptor.originalFetch") to prevent stacked interceptor installations across multiple bundled copies of @loreai/core; the guard prevents the gateway→interceptor→gateway infinite-loop shape associated with issue #1027, and cleanup restores the original globalThis.fetch and resets the shared slot to null./messages, /completions, or /responses; unmatched but LLM-like remote paths are warned once per ${upstream.host}${upstream.pathname} and bypass Lore. It preserves extra properties on the original fetch via Object.assign(interceptor, originalFetch).x-lore-upstream-path is intended to support providers that omit /v1, specifically GitHub Copilot’s /chat/completions from issue #1052, as well as providers with non-standard prefixes./home/byk/Code/opencode-lore-v2/packages/core/test/fetch-interceptor-request.test.ts, /home/byk/Code/opencode-lore-v2/packages/core/test/fetch-interceptor-paths.test.ts, /home/byk/Code/opencode-lore-v2/packages/core/test/fetch-interceptor-install.test.ts, /home/byk/Code/opencode-lore-v2/packages/core/test/fetch-interceptor-global.test.ts, and /home/byk/Code/opencode-lore-v2/packages/core/test/fetch-interceptor-body.test.ts.