@jabworks/condux 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,13 +1,15 @@
1
1
  # @jabworks/condux
2
2
 
3
3
  OpenCode plugin for the [condux](https://github.com/jabworks/agentic-toolkit)
4
- workflow toolkit. Complements the condux skills (installed separately, see
5
- below) with the pieces OpenCode cannot pick up from a skill tree:
4
+ workflow toolkit. It provides two pieces that OpenCode cannot pick up from a
5
+ skill tree alone:
6
6
 
7
7
  - **Agents** — injects the four condux specialist agents (`coder`, `explorer`,
8
- `planner`, `researcher`) as subagents via the `config` hook. If your
9
- `opencode.json` already defines an agent with the same name, yours wins —
10
- injection is skip-if-present.
8
+ `planner`, `researcher`) as subagents via the `config` hook, carrying the tool
9
+ restrictions their canonical definitions declare: `explorer` and `researcher`
10
+ are read-only (no `edit`, `write`, or `bash`) and `planner` cannot run shell
11
+ commands. If your `opencode.json` already defines an agent with the same name,
12
+ yours wins — injection is skip-if-present.
11
13
  - **Plan-review listener (opt-in)** — with `CONDUX_PLAN_REVIEW=1`, when the
12
14
  primary `plan` agent finishes a turn, spawns the plan-review annotate server
13
15
  from your installed condux skills. Best-effort: OpenCode does not await event
@@ -16,6 +18,21 @@ below) with the pieces OpenCode cannot pick up from a skill tree:
16
18
 
17
19
  ## Install
18
20
 
21
+ ### 1. Install skills
22
+
23
+ Install the OpenCode-facing skill variants (trigger conditions folded into each
24
+ description):
25
+
26
+ ```sh
27
+ npx skills add https://github.com/jabworks/agentic-toolkit/tree/main/dist/opencode/skills -a opencode
28
+ ```
29
+
30
+ This copies skills into `~/.config/opencode/skills/`.
31
+
32
+ ### 2. Add the plugin
33
+
34
+ Add `@jabworks/condux` to your `opencode.json`:
35
+
19
36
  ```jsonc
20
37
  // opencode.json
21
38
  {
@@ -23,18 +40,20 @@ below) with the pieces OpenCode cannot pick up from a skill tree:
23
40
  }
24
41
  ```
25
42
 
26
- Install the condux skills alongside it (OpenCode-facing variants, with trigger
27
- conditions folded into each description):
28
-
29
- ```sh
30
- npx skills add https://github.com/jabworks/agentic-toolkit/tree/main/dist/opencode/skills -a opencode
31
- ```
43
+ Restart OpenCode after adding the plugin.
32
44
 
33
45
  ## Notes
34
46
 
35
47
  - Injected agents carry no model pin — they inherit your session default. To
36
48
  restore the toolkit's tiering (e.g. a cheap model for `explorer`), override in
37
49
  `opencode.json`: `"agent": { "explorer": { "model": "anthropic/<model-id>" } }`.
50
+ - Restrictions are expressed as OpenCode `permission` denials, not the deprecated
51
+ `tools` map — `tools` is folded into permissions while the config file is
52
+ parsed, which is over before a plugin's `config` hook runs, so a `tools` map
53
+ injected there has no effect. Only the `bash` and `edit` gates cross over
54
+ (`edit` covers edit/write/patch). Read-side tools keep OpenCode's defaults,
55
+ because the Claude allowlists omit `Grep`/`Glob` while the prompts still expect
56
+ to search — denying those would break the agents rather than constrain them.
38
57
  - The plan-review listener needs the `plan-review` skill installed in a
39
58
  discoverable skill tree (`.opencode/skills/`, `.agents/skills/`,
40
59
  `.claude/skills/`, or their global equivalents) — it runs
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: "Use this agent when you need to understand an unfamiliar codebase, trace types or symbols, identify module boundaries, discover conventions, map call graphs, or find where specific patterns are implemented — before planning or implementing any changes. Fire non-blocking when possible — delegate and continue while it traverses."
3
3
  mode: subagent
4
+ permission: {"bash":"deny","edit":"deny"}
4
5
  ---
5
6
 
6
7
  You are a read-only codebase navigator and static-analysis specialist. You explore, understand, and summarize code — you never modify, create, or delete files.
package/agents/planner.md CHANGED
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: "Use this agent when planning a feature, architecture decision, or file structure before any implementation begins. Invoke whenever a task requires breaking down work into steps, evaluating architectural trade-offs, proposing folder/file structures, or producing ADR-style decision records — especially before delegating to the coder agent."
3
3
  mode: subagent
4
+ permission: {"bash":"deny"}
4
5
  ---
5
6
 
6
7
  You are a senior engineering planner — a principal-level architect. You produce task breakdowns, ADR-style decision records, and file/folder proposals. You never write code; every output feeds a downstream `coder` delegation and must be precise enough to execute without ambiguity.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: "Use this agent when any external library or framework API needs to be looked up before implementation. Invoke proactively whenever code will use a third-party dependency, an unfamiliar API method, or when exact parameter signatures, return types, or version-specific behavior must be confirmed. Fire non-blocking — delegate and continue working while it runs."
3
3
  mode: subagent
4
+ permission: {"bash":"deny","edit":"deny"}
4
5
  ---
5
6
 
6
7
  You are a library and framework research specialist. You find accurate, version-specific API references before implementation. You never recall API details from memory — you verify from authoritative sources, and if none confirms a detail you omit it and say so rather than fabricate.
package/index.js CHANGED
@@ -3,7 +3,8 @@
3
3
  // Injects the four condux specialist agents (coder, explorer, planner,
4
4
  // researcher) into the loaded config via the `config` hook, reading their
5
5
  // definitions from the bundled agents/*.md (generated from the canonical
6
- // Claude-dialect sources by scripts/build-opencode.mjs in the toolkit repo).
6
+ // Claude-dialect sources by scripts/build-opencode.mjs in the toolkit repo),
7
+ // including the tool restrictions those sources declare.
7
8
  // User-defined agents with the same name always win — injection is skip-if-present.
8
9
  //
9
10
  // Optional plan-review listener (CONDUX_PLAN_REVIEW=1): when the primary
@@ -22,13 +23,15 @@ const PKG_DIR = path.dirname(fileURLToPath(import.meta.url));
22
23
  const AGENTS_DIR = path.join(PKG_DIR, 'agents');
23
24
 
24
25
  // Bundled agent files use exactly the frontmatter the toolkit generator emits:
25
- // a JSON-quoted `description`, a plain `mode`, body = system prompt.
26
+ // a JSON-quoted `description`, a plain `mode`, an optional `permission` deny map
27
+ // (JSON object), body = system prompt.
26
28
  function parseAgent(text, name) {
27
- const match = text.match(/^---\ndescription: (".*")\nmode: (\S+)\n---\n/);
29
+ const match = text.match(/^---\ndescription: (".*")\nmode: (\S+)\n(?:permission: (\{.*\})\n)?---\n/);
28
30
  if (!match) throw new Error(`condux-opencode: malformed bundled agent ${name}`);
29
31
  return {
30
32
  description: JSON.parse(match[1]),
31
33
  mode: match[2],
34
+ permission: match[3] ? JSON.parse(match[3]) : undefined,
32
35
  prompt: text.slice(match[0].length).trim(),
33
36
  };
34
37
  }
@@ -74,6 +77,13 @@ export const ConduxPlugin = async ({ worktree }) => {
74
77
  description: def.description,
75
78
  mode: def.mode,
76
79
  prompt: def.prompt,
80
+ // Only present for agents whose canonical definition restricts them
81
+ // (explorer/researcher are read-only, planner cannot run shell) —
82
+ // without it OpenCode's defaults grant bash/edit/write to all four.
83
+ // Must be `permission`, not the deprecated `tools`: `tools` is folded
84
+ // into permissions while the config file is parsed, which has already
85
+ // happened by the time this hook runs.
86
+ ...(def.permission ? { permission: def.permission } : {}),
77
87
  };
78
88
  }
79
89
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jabworks/condux",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "OpenCode plugin for the condux workflow toolkit — injects the condux specialist agents (coder, explorer, planner, researcher) and an opt-in plan-review listener.",
5
5
  "type": "module",
6
6
  "publishConfig": {