Skip to main content

Crate tuff_adapter_opencode

Crate tuff_adapter_opencode 

Source

Structs§

OpenCode

Constants§

CONFIG_RELPATH
The OpenCode config file policy rules are compiled into. OpenCode loads .opencode/opencode.json after the project’s opencode.json and applies the last permission rule that matches, so rules here take precedence over the project’s own.
DISPLAY_NAME
HOOK_COMPATIBILITY
Every event is unsupported: this adapter takes no hooks, and tuff hooks spec lists only adapters that do.
ID
SUPPORTED_AGENTS
SUPPORTED_TYPES
Policies and MCP servers, both of which OpenCode reads from opencode.json. Skills reach OpenCode through the open-agents layout, and OpenCode hooks are plugins, which this adapter does not manage.

Functions§

permission_paths
A policy path pattern, read as .gitignore reads a pattern at the project root, as OpenCode path patterns.
permission_rules
The OpenCode rules one policy rule compiles to, as Tuff records them: a permission name, then a space and a pattern when the rule sits in that permission’s object. The effect is the action the rule is written with.
policy_matrix
How OpenCode enforces each kind of policy rule, from its permissions documentation and source, checked against OpenCode 1.18.15 on 2026-09-15.