Dashboard › opencode › Distillation
867100ba-ad2e-457d-8c0a-92fe73713ea3["lore_tm_v1_1pDq_TwvtTVQ2kAFoF6b5xQ_lY4adN6ZrZ9yh1X3zPo","lore_tm_v1_QUIBP48LqH-PYgktT5MS0H26IocP6vYdRijDbAVdbcM","lore_tm_v1_y6ja5oVf3mKhwBSNGYmKbcbyLWb2vomEIFRMFVbX5RQ","lore_tm_v1_E2bokedrxS8iw_GPOMH2sxGVqmmez6AbQoGHt-pX2TE"]
/home/byk/Code/opencode-v2-pilot/packages/core/test/plugin.test.ts:32-100 tests plugin activation diffing: appending c starts only c; inserting x after a stops c, then b, and starts x, b, c; changing b revision from "1" to "2" stops c and b, then starts b:2 and c:1; removing trailing c stops only c; changing only source metadata to { type: "package", target: "fixture", outdated: true } does not reload revision "1" (loads remains 1)./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin.test.ts:102-148 tests that local fixture plugin/fixtures/greeting.ts receives options { description: "Configured greeting" }, and that activating an empty plugin list removes command greet and runs the plugin finalizer./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin.test.ts:150-223 tests failure isolation and transactional transforms: a "broken" setup defect containing "Setup failed" does not block the healthy greet command; a later plugin whose integration.transform and command.transform replay fails is cleaned up, receives failed state with an err_ ref and "command.transform failed", leaves the prior "shared" command description "original", does not publish integration "broken", and does not block command "healthy"./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin.test.ts:225-299 tests failed-generation behavior: identical definitions do not retry failed revision "1" or restart healthy suffix plugins; revision "2" retries the broken plugin once and restarts only the suffix after it; replay failure is attributed to "broken-plugin" while later "reader" remains active and registers its command./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin.test.ts:301-399 tests runtime/setup replay failure handling: runtime reload failure removes command "runtime", reports sanitized failed inventory with an err_ ref, preserves discovery entry { source: { type: "local", path: "/missing" }, state: { status: "failed", error: "Import failed" }, features: { server: true } }, does not retry unchanged revision "1", and recovers on revision "2"; failed replacement revision "2" is not rolled back to revision "1" and leaves command "replacement" undefined./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin.test.ts:401-463 tests that asynchronous cleanup can await plugins.awaitActivation without blocking recovered registry readiness, and that fromPromise retains registration groups for later callbacks while ignoring subsequent transform attempts after the group is disabled by "late Promise failure"./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin.test.ts:465-489 tests canonical Promise-plugin permission assertion by calling ctx.permission.assert with sessionID="ses_plugin_permission", action="shell", resources=["'true'"], and tool source { messageID: "msg_plugin_permission", id: "call_plugin_permission" }; successful assertion leaves plugin "promise-permission" active./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin.test.ts:492-548 uses promisePermissionIt and a Promise-defined tool "permission" to verify permission outcome preservation through tool execution: "allow" returns text "allowed"; "corrected" becomes Tool.Error with exact feedback "Use a read-only command instead"; "defect" and "declined" remain defects (Cause.hasDies=true, Cause.hasFails=false)./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin.test.ts:550-587 tests that reactivating plugin "greeting" from revision "1" to "2" replaces command "greet" implementation, producing output in order ["before", "after"]./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin.test.ts:589-651 tests OAuth refresh during plugin activation: stored credential access "expired-access" and refresh "fixture-refresh" expires after advancing TestClock by "2 minutes"; integration method "oauth" refreshes it to access "fresh-access"", refresh "rotated-refresh", and expiration currentTimeMillis + 3_600_000; the refreshed value is returned by context and integration resolution and persisted through Credential.Service./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/fixture.ts:53-112 defines pluginTestLayer(assert: Permission.Interface["assert"] = () => Effect.void), whose replacement Permission.Service delegates assert, returns { id, effect: "ask" } from ask, returns undefined from get, empty arrays from forSession/list, and no-ops reply; PluginTestLayer is pluginTestLayer()./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/fixture.ts:66-109 builds plugin tests with AppNodeBuilder.build and nodes including Credential.node, Plugin.node, Permission.node, PluginHooks.node, LocationServiceMap.node, PersistentPty.node, and Watcher.node; replacements include tempLocationLayer, stub npmLayer, Config.testLayer(), emptyMcpLayer, stub generateLayer, and the custom permissionLayer./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/host.ts:15-180 defines host(overrides) as a complete test Plugin.Context with default location /workspace, empty options, and “unused …” defects for unoverridden operations; its permission stub exposes hook, assert, list, get, and reply./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/host.ts:182-307 defines agentHost() and catalogHost() adapters that convert string IDs to branded Agent.ID, Provider.ID, Model.ID, Model.Family, and Model.VariantID, expose mutable transform editors, and clone mutable model/provider/agent structures through agentInfo(), providerInfo(), and modelInfo()./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/host.ts:309-428 defines integrationHost() with connection resolution, transform editor adapters, and method handling for OAuth, env, command, and other methods; OAuth authorization and optional refresh results are normalized with Credential.OAuth.make and branded Integration.MethodID./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/host.ts:430-465 defines webSearchHost() using fixed location /tmp/websearch-test; providers() and query() return { location, data }, provider IDs are branded with WebSearch.ID.make, and default selection preserves false and "random" while branding named selections./home/byk/Code/opencode-v2-pilot/packages/plugin/src/effect/permission.ts:8-36 defines PermissionEvaluation with mutable effect and optional mutable message, PermissionHooks with evaluate, and PermissionAssertInput containing sessionID, action, resources, optional save, metadata, source, and agent; PermissionDomain is currently Pick<PermissionApi<unknown>, "list" | "get" | "reply"> & { assert(...): Effect.Effect<void, unknown>; hook: Hooks<PermissionHooks> }./home/byk/Code/opencode-v2-pilot/packages/plugin/AGENTS.md states that the plugin package has Effect and Promise versions; every Effect domain must extend its corresponding Effect API client interface from @opencode/client/effect/api, must not redefine functions already present on that interface, and may add only functions meaningful in plugin context.