Dashboard › opencode › Distillation
ee584c7b-babb-426f-9fe7-690b5e2e7a2f["lore_tm_v1_V02cfgwBiQ6zRH2bVCUzXnAcNQ-nRwPwINGIfn6LrNM","lore_tm_v1__DahdKKntYTB5cw8tuw3iAdpHGPpPxAwb9AqgbKs9XM","lore_tm_v1_0SZfOu1fDi9hPCYLjoY2bqeB_0k1P8hceayeTykzOhI","lore_tm_v1_oI91a1n9uZPGV7KCntcysYdmezcw5V-Ya3XqpwgLsY8","lore_tm_v1_6m98gLoG9jOjluNdafuKdaX9wAO3OimCS9qgwMKEQAw","lore_tm_v1_H9N4_DTigjakj7U7h-YF9xsUDghbERzVVKp4x5lskwA","lore_tm_v1_AAawQaVHJEIAJnmiY5jsiy1PlHvQJg1YNBydB98i8Gs","lore_tm_v1_ciMrhGQqg5YkvJ0urhyhSqeUDounjnc8I5FAjfN7VP8","lore_tm_v1_Hwz8ArKkx4Cl9TTY-cUtZ7Fkc1YJWJb53K_TY9IPAuM","lore_tm_v1_XxrYD51WL7ua0pdzt22WYv03YerCBwF1tKP78dXhaXc","lore_tm_v1_J2oAhcp41mgCCzXG7G8GBWSF-0eMofCjYQqsxTIG-a4","lore_tm_v1_xq6_9qW7ZmbBjNlQO-yC-yLJdHy9UDr3x1FXlcTe59g","lore_tm_v1_nHtPK8SN_xvlMSnT85IhPL0aNQR4vkHUKjS9LwbFv3E","lore_tm_v1_gKsTcTEr4X24YVPKYakztjFpn2o_lSgUFq6LbmtZD78","lore_tm_v1_ftifoDPoPNYRMKkJ3zj1T7_rzJlSTGmdmCjMaEaFCvc"]
mode: "subagent" with hidden: true so it never surfaces in the host project's agent/skill picker.packages/opencode/package.json for @loreai/opencode version 0.40.0: ESM package ("type": "module"), license FSL-1.1-Apache-2.0, description Three-tier memory architecture for OpenCode — distillation, not summarization, raw TypeScript entrypoint/export ./src/index.ts, typecheck: "tsc --noEmit", and build script echo '@loreai/opencode ships raw TS — no build step needed'.@loreai/opencode package dependencies: peer dependency @opencode-ai/plugin >=1.1.0; dependencies @loreai/core: workspace:* and @loreai/gateway: workspace:*; dev dependencies @opencode-ai/plugin ^1.1.39, @opencode-ai/sdk ^1.1.39, and @types/bun ^1.2.0.@loreai/opencode publishes src/, README.md, and LICENSE publicly from repository git+https://github.com/BYK/loreai.git, directory packages/opencode; keywords are opencode, plugin, memory, agent, distillation, and llm; author is BYK.packages/opencode/test/index.test.ts initializes LorePlugin with a mocked OpenCode client and a timestamped temporary directory, then removes the directory recursively with force: true during cleanup.packages/opencode/test/index.test.ts verifies the config hook preserves an existing agent definition "my-agent": { hidden: false, description: "Custom" } while also adding lore-distill.packages/opencode/test/index.test.ts: applyLoreProviderConfig(cfg, "http://127.0.0.1:3207") must set options.baseURL to http://127.0.0.1:3207/v1 for openai, anthropic, google, and mistral, while a following test checks preservation of existing per-provider options such as custom headers.agents: packages/schema/src/config.ts defines agents: Schema.Record(Schema.String, ConfigAgent.Info).pipe(optional) with description Named built-in agent overrides and custom agent definitions; it separately defines default_agent as the default primary agent when no session agent is selected.packages/schema/src/config/agent.ts defining ConfigAgent.Info fields: optional model, request, system, description, mode, hidden, color, steps, disabled, and permissions; mode permits "subagent", "primary", or "all"; Color must match /^#[0-9a-fA-F]{6}$/; and steps is a PositiveInt.packages/schema/src/agent.ts runtime Agent.Info requires id, name, request, mode, hidden, and permissions, with optional model, system, description, color, and steps.Agent.Info.default(id) creates an agent whose name is derived from id, request has empty settings, headers, and body, mode is "primary", hidden is false, and permissions are ordered as: 1. allow all actions/resources; 2. ask for external_directory on all resources; 3. ask to read *.env; 4. ask to read *.env.*; 5. allow reading *.env.example.packages/plugin/src/promise/session.ts defines SessionRequestKind = "primary" | "compaction" | "title" | "generate".packages/core/src/config/plugin/agent.ts defines the Effect plugin opencode.config.agent; legacy agent sources are {agent,agents}/**/*.md as non-primary and {mode,modes}/*.md as primary, with source directories agent, agents, mode, and modes.ConfigAgentPlugin.load only loads config entries of type document or directory; directory entries are discovered and decoded, while other entry types are ignored, and file read/decode failures are converted to undefined and filtered out.packages/core/src/config/plugin/agent.ts: a PubSub.sliding<void>(1) combines relevant config.changes() and config.updated events, subscriptions fork scoped with startImmediately: true, updates debounce for "100 millis", and reload replaces loaded.documents before calling ctx.agent.reload().Stream.merge and Stream.debounce otherwise open upstream after a fiber hop.default_agent via editor.default(Agent.ID.make(configuredDefault)), removes agents whose config has disabled: true, and updates or creates configured agents.packages/core/src/config/plugin/agent.ts: model maps to { id: item.model.model, providerID: item.model.providerID, optional variant }; request headers/body are merged with Object.assign; optional system, description, mode, hidden, color, and steps overwrite runtime fields; configured permissions are expanded relative to global.home and appended.packages/core/test/plugin.test.ts verifies asynchronous cleanup from a failed plugin does not block recovered registry readiness: plugin async-cleanup throws inside ctx.command.transform, its finalizer waits on plugins.awaitActivation before resolving cleaned, plugin healthy still registers command healthy, and the first plugin reports state failed.packages/core/test/plugin.test.ts: promise-plugin retains its setup-captured registration function; a late ctx.command.transform adds command late then throws late Promise failure; activation transitions the plugin to failed with an error containing command.transform; late is absent, and subsequent registration attempts by the disabled group remain ignored.promise-permission calls ctx.permission.assert() with session ID ses_plugin_permission, action shell, resource "'true'", and tool source { messageID: "msg_plugin_permission", id: "call_plugin_permission" }; after activation and assertion completion, the plugin state is active.promise-permission-tool: it registers tool permission with input { action: Schema.String }, options: { codemode: false }, asserts permission against resource "fixture", and returns { content: "allowed" } on success."allow" yields { content: [{ type: "text", text: "allowed" }] }; action "corrected" fails with a Tool.Error whose message equals correctedFeedback; action "defect" produces an Effect failure cause containing a die and no typed failure.