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
Commit 28c8809
Browse filesBrowse the repository at this point in the historyBrowse files
|`src/config.ts`| Load and merge `.opencode-dev-framework.yml` and `.dev-framework.yml`, resolve profile defaults, validate with Zod. |
56
-
|`src/config-to-opencode.ts`| Helper that translates framework config into OpenCode-native-style `permission` / `formatter` fragments. The plugin does **not** inject these automatically (it enforces guardrails in `tool.execute.before` and does not rewrite `opencode.json`); the fragments are available for users who want to copy them manually. |
57
57
|`src/detect.ts`| Detect the project's language and tooling from root files for `df init`. |
58
58
|`src/protect.ts`| Implement `tool.execute.before` guardrails for protected paths and dangerous commands. |
59
59
|`src/lint.ts`| Implement per-edit checks on `file.edited`, with optional `pre-commit` fallback. |
60
60
|`src/gate.ts`| Implement the completion gate and changed-file tracking. |
61
61
|`src/rules.ts`| Load and inject constitution / project rules via `experimental.chat.system.transform`. |
|`src/registry.ts`| Module-level hook state registry (avoids closure-capture issues in OpenCode's Effect runtime). |
63
+
|`src/registry.ts`| Module-level hook state registry (avoids closure-capture issues in OpenCode's Effect runtime). Captures base directory and host permission snapshots. |
64
+
|`src/format-status.ts`| Shared status renderer for `dev_framework_status` tool and `/df-status` slash command. |
64
65
|`src/installer.ts`| Template copy and detected-config generation used by `bin/df` and the `dev_framework_init` tool. |
65
-
|`src/logger.ts`| Structured logging wrapper around `client.app.log()`. |
66
+
|`src/logger.ts`| Structured logging wrapper around `client.app.log()` with optional file fallback. |
66
67
|`src/types.ts`| Shared TypeScript types and interfaces. |
67
68
68
69
## Host abstraction
@@ -101,15 +102,19 @@ opencode session starts
101
102
102
103
## Tool guardrails
103
104
104
-
Use native `permission` config as the primary defense and the plugin hook for clearer messaging:
105
+
The plugin applies guardrails directly in `tool.execute.before`:
105
106
106
-
1.`config-to-opencode.ts` emits suggested `permission.edit` rules from `protect`
107
-
globs. Users can copy these into their `opencode.json` if desired.
108
-
2.`tool.execute.before` acts as a belt-and-suspenders check and throws a clearer
109
-
error message when the plugin denies a call.
107
+
1.`protect.ts` matches file-edit and shell tools against the configured `protect`
108
+
globs and the dangerous-command list.
109
+
2. The `config` hook captures the host's permission snapshot from OpenCode's
110
+
effective config and stores it in hook state. When the host already denies a
111
+
tool/target, the plugin skips its own block to avoid redundant or conflicting
112
+
denials.
113
+
3. The hook throws a clear `[opencode-dev-framework] ...` error when the plugin
114
+
denies a call.
110
115
111
116
The plugin does not modify `opencode.json` on disk and does not contribute
112
-
permissions at runtime. It applies guardrails directly in the hook.
117
+
permissions at runtime.
113
118
114
119
## Completion gate
115
120
@@ -138,6 +143,7 @@ in-memory state, so no LLM prompt interpretation is required.
138
143
-`/df-profile` — switch the active profile.
139
144
-`/df-status` — show the current profile, guardrails, gate, and tracked changed
140
145
files.
146
+
-`/df-help` — list the available slash commands.
141
147
142
148
The project template directory no longer contains command files; only agents,
143
149
skills, and the local rules directory are copied by `df init`.
@@ -152,7 +158,7 @@ skills, and the local rules directory are copied by `df init`.
0 commit comments