You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
C2: Port the plugin runtime to the v2 Effect-first plugin API #25
The plugin registers under an opencode v2 host via the v2 Effect-based plugin definition with a stable id. Agents are injected through the v2 agent domain transform, replacing the v1 config hook. Permission registration (the external-directory allow) migrates to v2 permission semantics per the verified-facts record. Prompt path rewriting, at-most-once advisories, and the startup non-interference invariant (registration failures degrade to a warning and advisory, never abort startup) are all preserved. The v1 factory and its types are removed; dependencies move to the v2 packages adjudicated in C1, Effect-first.
Acceptance criteria
Plugin loads under a v2 host and registers all ten agents
Permission registration works under v2 semantics
Prompt path rewriting and advisories behave as before
All five acceptance criteria verified at 8670c4b on v2/issue-25-effect-ts:
v2 definition, ten agents — default export is { id: "opencode-architect", effect } via Plugin.define from @opencode/plugin/effect (opencode-v2-facts §1–2 contract); the activation test registers exactly 10 agents through ctx.agent.transform/editor.update with non-empty system and valid mode. Host-level load smoke lands with C4's harness per the spec's ticket split.
v2 permission semantics — external-directory allow is a ctx.permission.hook("evaluate") decision: upgrades ask→allow only for resources inside the bundled assets dir; explicit config denies are final under v2 (never reach the hook), preserving the old deny-wins behavior. Nine decision-table tests.
Prompt rewriting + advisories unchanged — resolveReferencePaths untouched (reference-resolution tests assert no unrewritten relative refs, resolvable absolute paths); stale-cache advisory fires exactly once with the cache-path text and <version> fallback; not-installed advisory keeps its separate once-guard and stays suppressed after install; failure skips it, matching v1 ordering.
No v1 plugin API in the runtime — zero @opencode-ai/* references in src/; no config hook; @opencode-ai/plugin and @opencode-ai/sdk removed from dependencies (@opencode/plugin@2.0.23, effect@4.0.0-rc.112 pinned; 2.0.24 was latest at execution — flagged, not adopted per spec; consumer-facing templates use @latest).
Typecheck + migrated suite — tsc --noEmit clean; migrated tests 23/23; full suite 143 pass with only the 5 failures that pre-exist on the base commit (Windows-only environment artifacts in tarball/cache tests; CI runs ubuntu).
Activity
diegohb commentedon Oct 6, 2026
All five acceptance criteria verified at 8670c4b on v2/issue-25-effect-ts:
{ id: "opencode-architect", effect }viaPlugin.definefrom@opencode/plugin/effect(opencode-v2-facts §1–2 contract); the activation test registers exactly 10 agents throughctx.agent.transform/editor.updatewith non-emptysystemand validmode. Host-level load smoke lands with C4's harness per the spec's ticket split.ctx.permission.hook("evaluate")decision: upgradesask→allowonly for resources inside the bundled assets dir; explicit config denies are final under v2 (never reach the hook), preserving the old deny-wins behavior. Nine decision-table tests.resolveReferencePathsuntouched (reference-resolution tests assert no unrewritten relative refs, resolvable absolute paths); stale-cache advisory fires exactly once with the cache-path text and<version>fallback; not-installed advisory keeps its separate once-guard and stays suppressed after install; failure skips it, matching v1 ordering.@opencode-ai/*references insrc/; noconfighook;@opencode-ai/pluginand@opencode-ai/sdkremoved from dependencies (@opencode/plugin@2.0.23,effect@4.0.0-rc.112pinned; 2.0.24 waslatestat execution — flagged, not adopted per spec; consumer-facing templates use@latest).tsc --noEmitclean; migrated tests 23/23; full suite 143 pass with only the 5 failures that pre-exist on the base commit (Windows-only environment artifacts in tarball/cache tests; CI runs ubuntu).Commits: aa6fd0d, 3191c06, ebf71c7, 8670c4b.