Skip to content

[Adapter] Support OpenCode CLI #20

Description

@teseo

Kind

implement

Goal

Integrate human.md with OpenCode through a plugin that translates session and tool hooks to the neutral contract.

Non-goals

  • Supporting undocumented OpenCode internals.
  • Forking policy behavior in TypeScript.
  • Claiming support for OpenCode Desktop without a separate test.

Invariants

  • Plugin loading is idempotent.
  • Pre-tool deny decisions are enforced before execution.
  • Plugin API version differences produce a clear compatibility diagnostic.
  • State is isolated per OpenCode session and cwd.

Behavioral contract / States

Register the supported plugin hooks, emit normalized events, apply allow/deny/advisory decisions, and preserve OpenCode's native error/reporting semantics.

Scope surface

OpenCode plugin entrypoint, configuration/install path, version gate, fixtures, and tests.

Acceptance

  • Verify plugin discovery in global and project plugin locations.
  • Verify allow, deny, advisory, session start, and session end scenarios.
  • Run: node --test tests/test_guard.mjs plus the adapter-specific OpenCode smoke test.
  • Test the supported API version and one unsupported version with a deterministic failure message.

Split triggers

  • V2 plugin API changes require separate compatibility branches.
  • OpenCode's CLI and desktop runtimes expose different hook guarantees.

Dependencies / Parent

Blocked by: #1, #2, #3
Parent Epic: #15

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions