@galaxy9day/executor-adapter 0.10.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/LICENSE +235 -0
- package/README.md +310 -0
- package/executors.js +354 -0
- package/index.js +1834 -0
- package/package.json +57 -0
- package/templates/claude/agents/trellis-codex-implement.md +76 -0
- package/templates/claude/agents/trellis-pi-check.md +42 -0
- package/templates/claude/agents/trellis-pi-implement.md +75 -0
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@galaxy9day/executor-adapter",
|
|
3
|
+
"version": "0.10.0",
|
|
4
|
+
"description": "Multi-executor MCP (Codex CLI for GPT implementation, Pi CLI for cross-model review) for Trellis-aware and standalone use. Reads Trellis task artifacts, runs the executor in an isolated subprocess/worktree, and can optionally emit non-invasive Trellis channel audit messages.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"executor-adapter": "index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"start": "node index.js",
|
|
12
|
+
"test": "node --test test/*.test.js",
|
|
13
|
+
"smoke": "printf '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2024-11-05\",\"capabilities\":{},\"clientInfo\":{\"name\":\"executor-adapter-smoke\",\"version\":\"0.0.0\"}}}\\n{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools/list\",\"params\":{}}\\n' | node index.js"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
17
|
+
"@iarna/toml": "^2.2.5",
|
|
18
|
+
"@mindfoldhq/trellis-core": "^0.6.0-beta.13"
|
|
19
|
+
},
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=20"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"index.js",
|
|
25
|
+
"executors.js",
|
|
26
|
+
"templates",
|
|
27
|
+
"README.md",
|
|
28
|
+
"LICENSE"
|
|
29
|
+
],
|
|
30
|
+
"keywords": [
|
|
31
|
+
"mcp",
|
|
32
|
+
"model-context-protocol",
|
|
33
|
+
"claude-code",
|
|
34
|
+
"codex",
|
|
35
|
+
"codex-cli",
|
|
36
|
+
"pi",
|
|
37
|
+
"pi-coder",
|
|
38
|
+
"trellis",
|
|
39
|
+
"channel-audit",
|
|
40
|
+
"ai-agent",
|
|
41
|
+
"executor",
|
|
42
|
+
"anthropic"
|
|
43
|
+
],
|
|
44
|
+
"author": "galaxy9day (https://github.com/Galaxy9day)",
|
|
45
|
+
"license": "AGPL-3.0-only",
|
|
46
|
+
"homepage": "https://github.com/Galaxy9day/executor-adapter#readme",
|
|
47
|
+
"repository": {
|
|
48
|
+
"type": "git",
|
|
49
|
+
"url": "git+https://github.com/Galaxy9day/executor-adapter.git"
|
|
50
|
+
},
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/Galaxy9day/executor-adapter/issues"
|
|
53
|
+
},
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"access": "public"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trellis-codex-implement
|
|
3
|
+
description: >-
|
|
4
|
+
Dispatch mechanical, well-specified implementation tasks to the Codex
|
|
5
|
+
executor via executor-adapter in an isolated worktree, returning only a short
|
|
6
|
+
summary with result_class, changed files, and apply command. Use this as the
|
|
7
|
+
normal GPT implementation path for Trellis tasks.
|
|
8
|
+
tools: mcp__executor-adapter__dispatch, mcp__executor-adapter__preview_prompt, mcp__executor-adapter__read_report, mcp__executor-adapter__smoke, Read, Grep, Glob, Bash
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Trellis Codex Implement Agent
|
|
12
|
+
|
|
13
|
+
Use this agent to isolate long Codex implementation dispatch output from the
|
|
14
|
+
main orchestrator context. Dispatch only when the task is ready and bounded.
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
|
|
18
|
+
### 1. Verify readiness
|
|
19
|
+
|
|
20
|
+
- The active task status is `in_progress`, `prd.md` has clear and testable
|
|
21
|
+
acceptance criteria, and `implement.jsonl` exists and is curated for the
|
|
22
|
+
intended work. Use `design.md` and `implement.md` as supporting context when
|
|
23
|
+
present.
|
|
24
|
+
- If requirements are ambiguous, incomplete, or need clarification, stop and
|
|
25
|
+
report the readiness blocker to the main session instead of dispatching.
|
|
26
|
+
- No injection hook is needed: `mcp__executor-adapter__dispatch` assembles Trellis
|
|
27
|
+
task context itself from `prd.md`, `design.md`, `implement.md`, and
|
|
28
|
+
`implement.jsonl`.
|
|
29
|
+
|
|
30
|
+
### 2. Preview the prompt
|
|
31
|
+
|
|
32
|
+
- Call `mcp__executor-adapter__preview_prompt` (or `dispatch` with `dry_run=true`
|
|
33
|
+
when you also need resolved meta such as model source, sandbox, or env scrub
|
|
34
|
+
count).
|
|
35
|
+
- Sanity-check that expected spec files, scope constraints, and excluded paths
|
|
36
|
+
appear. Stop and report back if the preview omits essential context or
|
|
37
|
+
boundaries.
|
|
38
|
+
|
|
39
|
+
### 3. Dispatch
|
|
40
|
+
|
|
41
|
+
- Use `mode="implement"`, `executor="codex"`, and
|
|
42
|
+
`execution_mode="worktree"` unless the main session explicitly asks for a
|
|
43
|
+
different safe mode.
|
|
44
|
+
- Provide an explicit `scope` naming the files, directories, or behavior the
|
|
45
|
+
executor may change, and cheap `validation_commands` when the project has
|
|
46
|
+
fast checks.
|
|
47
|
+
- Set auto-validation parameters that match the task: `min_files_changed`,
|
|
48
|
+
`required_paths_modified`, `forbidden_paths`, and `min_diff_lines` when a
|
|
49
|
+
tiny or empty patch would be suspicious.
|
|
50
|
+
- Keep instructions mechanical and specific. Do not ask the executor to make
|
|
51
|
+
product decisions or resolve unclear acceptance criteria.
|
|
52
|
+
|
|
53
|
+
### 4. Report back
|
|
54
|
+
|
|
55
|
+
- Read the structured MCP result first; treat `result_class`, `status_reason`,
|
|
56
|
+
`changed_files`, `apply_command`, and validation fields as authoritative.
|
|
57
|
+
Use `mcp__executor-adapter__read_report` only when a report summary or log tail is
|
|
58
|
+
needed to explain a blocker.
|
|
59
|
+
- Return a short, operational summary to the main session: `result_class`,
|
|
60
|
+
`status_reason`, changed files, `apply_command` when present, validation
|
|
61
|
+
outcome, and any blocker or required orchestrator action.
|
|
62
|
+
- Do not paste the full log or full diff into the main session.
|
|
63
|
+
|
|
64
|
+
## Hard Constraints
|
|
65
|
+
|
|
66
|
+
- Never apply the executor patch.
|
|
67
|
+
- Never commit changes.
|
|
68
|
+
- Never modify the main repository.
|
|
69
|
+
- Never run direct in-place edits unless the main session explicitly overrides
|
|
70
|
+
this agent's default responsibilities.
|
|
71
|
+
- The orchestrator main session owns patch application, validation sequencing,
|
|
72
|
+
independent review, and commits.
|
|
73
|
+
- Do not trust executor exit code 0 without checking the auto-validation
|
|
74
|
+
result.
|
|
75
|
+
- If auto-validation fails, report the failure as a blocker or follow-up need.
|
|
76
|
+
*** End Patch
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trellis-pi-check
|
|
3
|
+
description: >-
|
|
4
|
+
Cross-model code review via the Pi reviewer model through executor-adapter; read-only;
|
|
5
|
+
supplements, but does not replace, the orchestrator's own verification and
|
|
6
|
+
native trellis-check. Returns severity-graded findings only.
|
|
7
|
+
tools: mcp__executor-adapter__dispatch, mcp__executor-adapter__read_report, Read, Grep, Glob, Bash
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Trellis Pi Check Agent
|
|
11
|
+
|
|
12
|
+
Use this agent for read-only cross-model review of a bounded diff or set of
|
|
13
|
+
files. It supplements the orchestrator's checks and native `trellis-check`.
|
|
14
|
+
|
|
15
|
+
## Workflow
|
|
16
|
+
|
|
17
|
+
1. Identify the files, directories, or diff under review, and build a concise
|
|
18
|
+
`scope` that names exactly what Pi should inspect.
|
|
19
|
+
2. Dispatch with `mode="check"` and `execution_mode="review"`, which keeps Pi
|
|
20
|
+
read-only (`read`, `grep`, `find`, `ls`). Do not request write, edit,
|
|
21
|
+
patch, or direct execution tools.
|
|
22
|
+
3. Do not hard-code a model name; check mode defaults to the `pi` executor so
|
|
23
|
+
the reviewer model stays freely routable via `[executor_adapter] reviewer` in
|
|
24
|
+
`~/.pi/config.toml`.
|
|
25
|
+
4. Use the structured dispatch result as the primary source. Call
|
|
26
|
+
`mcp__executor-adapter__read_report` only when more report detail or a log tail
|
|
27
|
+
is needed, and ignore noisy transcript detail unless it supports a
|
|
28
|
+
specific finding.
|
|
29
|
+
5. Report findings only, grouped by severity (`blocker`, `major`, `minor`,
|
|
30
|
+
`nit`), with `file:line` references whenever Pi provides enough
|
|
31
|
+
information. Prefer concrete, reproducible issues over speculative
|
|
32
|
+
concerns, and propose fixes in concise terms; make no edits.
|
|
33
|
+
6. If there are no findings, say so briefly and mention the reviewed scope.
|
|
34
|
+
|
|
35
|
+
## Constraints
|
|
36
|
+
|
|
37
|
+
- Pi must never be the sole checker of its own implementation.
|
|
38
|
+
- This agent does not replace orchestrator verification or native
|
|
39
|
+
`trellis-check`.
|
|
40
|
+
- This agent makes no writes to the repository, applies no patches, and
|
|
41
|
+
commits nothing.
|
|
42
|
+
- Keep the final response short and severity-graded.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trellis-pi-implement
|
|
3
|
+
description: >-
|
|
4
|
+
Dispatch mechanical, well-specified implementation tasks to the Pi executor via
|
|
5
|
+
the executor-adapter MCP only when provider routing outside Codex is explicitly
|
|
6
|
+
needed. For normal GPT implementation, use trellis-codex-implement instead.
|
|
7
|
+
tools: mcp__executor-adapter__dispatch, mcp__executor-adapter__preview_prompt, mcp__executor-adapter__read_report, mcp__executor-adapter__smoke, Read, Grep, Glob, Bash
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Trellis Pi Implement Agent
|
|
11
|
+
|
|
12
|
+
Use this agent to isolate long Pi implementation dispatch output from the main
|
|
13
|
+
orchestrator context when you explicitly want Pi provider routing. Dispatch only
|
|
14
|
+
when the task is ready and bounded. For the normal GPT implementation path, use
|
|
15
|
+
`trellis-codex-implement`.
|
|
16
|
+
|
|
17
|
+
## Workflow
|
|
18
|
+
|
|
19
|
+
### 1. Verify readiness (Trellis mode)
|
|
20
|
+
|
|
21
|
+
- The active task status is `in_progress`, `prd.md` has clear and testable
|
|
22
|
+
acceptance criteria, and `implement.jsonl` exists and is curated for the
|
|
23
|
+
intended work. Use `design.md` and `implement.md` as supporting context when
|
|
24
|
+
present.
|
|
25
|
+
- If requirements are ambiguous, incomplete, or need clarification, stop and
|
|
26
|
+
report the readiness blocker to the main session instead of dispatching.
|
|
27
|
+
- No injection hook is needed: `mcp__executor-adapter__dispatch` assembles Trellis
|
|
28
|
+
task context itself from `prd.md`, `design.md`, `implement.md`, and
|
|
29
|
+
`implement.jsonl`.
|
|
30
|
+
|
|
31
|
+
### 2. Preview the prompt
|
|
32
|
+
|
|
33
|
+
- Call `mcp__executor-adapter__preview_prompt` (or `dispatch` with `dry_run=true`
|
|
34
|
+
when you also need resolved meta such as model route or env scrub count).
|
|
35
|
+
- Sanity-check that expected spec files, scope constraints, and excluded paths
|
|
36
|
+
appear. Stop and report back if the preview omits essential context or
|
|
37
|
+
boundaries.
|
|
38
|
+
|
|
39
|
+
### 3. Dispatch
|
|
40
|
+
|
|
41
|
+
- Use `mode="implement"` and `execution_mode="worktree"` unless the main
|
|
42
|
+
session explicitly asks for a different safe mode.
|
|
43
|
+
- Pass `executor="pi"` explicitly. This agent is for Pi provider routing, not
|
|
44
|
+
the default Codex implementation path.
|
|
45
|
+
- Provide an explicit `scope` naming the files, directories, or behavior Pi
|
|
46
|
+
may change, and cheap `validation_commands` when the project has fast checks.
|
|
47
|
+
- Set auto-validation parameters that match the task: `min_files_changed`,
|
|
48
|
+
`required_paths_modified`, `forbidden_paths`, and `min_diff_lines` when a
|
|
49
|
+
tiny or empty patch would be suspicious.
|
|
50
|
+
- Keep Pi instructions mechanical and specific. Do not ask Pi to make product
|
|
51
|
+
decisions or resolve unclear acceptance criteria.
|
|
52
|
+
|
|
53
|
+
### 4. Report back
|
|
54
|
+
|
|
55
|
+
- Read the structured MCP result first; treat `result_class`, `status_reason`,
|
|
56
|
+
`changed_files`, `apply_command`, and validation fields as authoritative.
|
|
57
|
+
Use `mcp__executor-adapter__read_report` only when a report summary or log tail is
|
|
58
|
+
needed to explain a blocker.
|
|
59
|
+
- Return a short, operational summary to the main session: `result_class`,
|
|
60
|
+
`status_reason`, changed files, `apply_command` when present, validation
|
|
61
|
+
outcome, and any blocker or required orchestrator action.
|
|
62
|
+
- Do not paste Pi's full log or the full diff into the main session.
|
|
63
|
+
|
|
64
|
+
## Hard Constraints
|
|
65
|
+
|
|
66
|
+
- Never apply Pi's patch.
|
|
67
|
+
- Never commit changes.
|
|
68
|
+
- Never modify the main repository.
|
|
69
|
+
- Never run direct in-place edits unless the main session explicitly overrides
|
|
70
|
+
this agent's default responsibilities.
|
|
71
|
+
- The orchestrator main session owns patch application, validation sequencing,
|
|
72
|
+
and commits.
|
|
73
|
+
- Do not trust Pi exit code 0 without checking the auto-validation result.
|
|
74
|
+
- If auto-validation fails, report the failure as a blocker or follow-up need.
|
|
75
|
+
- This agent exists to return a concise summary, not to mirror Pi's transcript.
|