thehood 0.1.0-preview.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/CODE_OF_CONDUCT.md +21 -0
- package/CONTRIBUTING.md +58 -0
- package/LICENSE +21 -0
- package/PRIVACY.md +49 -0
- package/README.md +264 -0
- package/SECURITY.md +31 -0
- package/dist/bridges/chatgptWebBridge.d.ts +2 -0
- package/dist/bridges/chatgptWebBridge.js +981 -0
- package/dist/bridges/chatgptWebBridge.js.map +1 -0
- package/dist/cli/args.d.ts +9 -0
- package/dist/cli/args.js +82 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/format.d.ts +56 -0
- package/dist/cli/format.js +752 -0
- package/dist/cli/format.js.map +1 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.js +996 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/mcpConfig.d.ts +36 -0
- package/dist/cli/mcpConfig.js +98 -0
- package/dist/cli/mcpConfig.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/protocol.d.ts +44 -0
- package/dist/mcp/protocol.js +33 -0
- package/dist/mcp/protocol.js.map +1 -0
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +106 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +10 -0
- package/dist/mcp/tools.js +2200 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp/validation.d.ts +8 -0
- package/dist/mcp/validation.js +67 -0
- package/dist/mcp/validation.js.map +1 -0
- package/dist/providers/chatgptWeb.d.ts +2 -0
- package/dist/providers/chatgptWeb.js +26 -0
- package/dist/providers/chatgptWeb.js.map +1 -0
- package/dist/providers/claudeCode.d.ts +4 -0
- package/dist/providers/claudeCode.js +32 -0
- package/dist/providers/claudeCode.js.map +1 -0
- package/dist/providers/codexCli.d.ts +6 -0
- package/dist/providers/codexCli.js +25 -0
- package/dist/providers/codexCli.js.map +1 -0
- package/dist/providers/codexCliModels.d.ts +23 -0
- package/dist/providers/codexCliModels.js +147 -0
- package/dist/providers/codexCliModels.js.map +1 -0
- package/dist/providers/localCommand.d.ts +26 -0
- package/dist/providers/localCommand.js +614 -0
- package/dist/providers/localCommand.js.map +1 -0
- package/dist/providers/markdownPayload.d.ts +7 -0
- package/dist/providers/markdownPayload.js +29 -0
- package/dist/providers/markdownPayload.js.map +1 -0
- package/dist/providers/responseSchema.d.ts +3 -0
- package/dist/providers/responseSchema.js +187 -0
- package/dist/providers/responseSchema.js.map +1 -0
- package/dist/providers/router.d.ts +3 -0
- package/dist/providers/router.js +21 -0
- package/dist/providers/router.js.map +1 -0
- package/dist/providers/stub.d.ts +2 -0
- package/dist/providers/stub.js +177 -0
- package/dist/providers/stub.js.map +1 -0
- package/dist/providers/types.d.ts +37 -0
- package/dist/providers/types.js +2 -0
- package/dist/providers/types.js.map +1 -0
- package/dist/runtime/agentBoard.d.ts +79 -0
- package/dist/runtime/agentBoard.js +166 -0
- package/dist/runtime/agentBoard.js.map +1 -0
- package/dist/runtime/agentBoardArtifact.d.ts +9 -0
- package/dist/runtime/agentBoardArtifact.js +171 -0
- package/dist/runtime/agentBoardArtifact.js.map +1 -0
- package/dist/runtime/agentRunner.d.ts +17 -0
- package/dist/runtime/agentRunner.js +92 -0
- package/dist/runtime/agentRunner.js.map +1 -0
- package/dist/runtime/approvalInbox.d.ts +54 -0
- package/dist/runtime/approvalInbox.js +143 -0
- package/dist/runtime/approvalInbox.js.map +1 -0
- package/dist/runtime/approvalPolicy.d.ts +11 -0
- package/dist/runtime/approvalPolicy.js +58 -0
- package/dist/runtime/approvalPolicy.js.map +1 -0
- package/dist/runtime/artifacts.d.ts +23 -0
- package/dist/runtime/artifacts.js +48 -0
- package/dist/runtime/artifacts.js.map +1 -0
- package/dist/runtime/browserManager.d.ts +37 -0
- package/dist/runtime/browserManager.js +356 -0
- package/dist/runtime/browserManager.js.map +1 -0
- package/dist/runtime/canonicalMemory.d.ts +23 -0
- package/dist/runtime/canonicalMemory.js +134 -0
- package/dist/runtime/canonicalMemory.js.map +1 -0
- package/dist/runtime/chatGptPageReadiness.d.ts +16 -0
- package/dist/runtime/chatGptPageReadiness.js +74 -0
- package/dist/runtime/chatGptPageReadiness.js.map +1 -0
- package/dist/runtime/commandRunner.d.ts +18 -0
- package/dist/runtime/commandRunner.js +115 -0
- package/dist/runtime/commandRunner.js.map +1 -0
- package/dist/runtime/commandSafety.d.ts +7 -0
- package/dist/runtime/commandSafety.js +61 -0
- package/dist/runtime/commandSafety.js.map +1 -0
- package/dist/runtime/config.d.ts +10 -0
- package/dist/runtime/config.js +107 -0
- package/dist/runtime/config.js.map +1 -0
- package/dist/runtime/crewLanes.d.ts +2 -0
- package/dist/runtime/crewLanes.js +123 -0
- package/dist/runtime/crewLanes.js.map +1 -0
- package/dist/runtime/criticPolicy.d.ts +17 -0
- package/dist/runtime/criticPolicy.js +50 -0
- package/dist/runtime/criticPolicy.js.map +1 -0
- package/dist/runtime/defaults.d.ts +5 -0
- package/dist/runtime/defaults.js +100 -0
- package/dist/runtime/defaults.js.map +1 -0
- package/dist/runtime/directives.d.ts +3 -0
- package/dist/runtime/directives.js +218 -0
- package/dist/runtime/directives.js.map +1 -0
- package/dist/runtime/doctor.d.ts +36 -0
- package/dist/runtime/doctor.js +185 -0
- package/dist/runtime/doctor.js.map +1 -0
- package/dist/runtime/errors.d.ts +20 -0
- package/dist/runtime/errors.js +41 -0
- package/dist/runtime/errors.js.map +1 -0
- package/dist/runtime/externalTransfer.d.ts +20 -0
- package/dist/runtime/externalTransfer.js +156 -0
- package/dist/runtime/externalTransfer.js.map +1 -0
- package/dist/runtime/fanout.d.ts +64 -0
- package/dist/runtime/fanout.js +263 -0
- package/dist/runtime/fanout.js.map +1 -0
- package/dist/runtime/gitEvidence.d.ts +10 -0
- package/dist/runtime/gitEvidence.js +80 -0
- package/dist/runtime/gitEvidence.js.map +1 -0
- package/dist/runtime/handoffs.d.ts +32 -0
- package/dist/runtime/handoffs.js +100 -0
- package/dist/runtime/handoffs.js.map +1 -0
- package/dist/runtime/ids.d.ts +2 -0
- package/dist/runtime/ids.js +4 -0
- package/dist/runtime/ids.js.map +1 -0
- package/dist/runtime/localStateIgnore.d.ts +9 -0
- package/dist/runtime/localStateIgnore.js +98 -0
- package/dist/runtime/localStateIgnore.js.map +1 -0
- package/dist/runtime/loop.d.ts +14 -0
- package/dist/runtime/loop.js +1863 -0
- package/dist/runtime/loop.js.map +1 -0
- package/dist/runtime/loopRecommendation.d.ts +109 -0
- package/dist/runtime/loopRecommendation.js +566 -0
- package/dist/runtime/loopRecommendation.js.map +1 -0
- package/dist/runtime/loopResponsibilities.d.ts +2 -0
- package/dist/runtime/loopResponsibilities.js +395 -0
- package/dist/runtime/loopResponsibilities.js.map +1 -0
- package/dist/runtime/loopRunner.d.ts +28 -0
- package/dist/runtime/loopRunner.js +81 -0
- package/dist/runtime/loopRunner.js.map +1 -0
- package/dist/runtime/operatorNextActions.d.ts +2 -0
- package/dist/runtime/operatorNextActions.js +344 -0
- package/dist/runtime/operatorNextActions.js.map +1 -0
- package/dist/runtime/paths.d.ts +9 -0
- package/dist/runtime/paths.js +14 -0
- package/dist/runtime/paths.js.map +1 -0
- package/dist/runtime/permissions.d.ts +9 -0
- package/dist/runtime/permissions.js +73 -0
- package/dist/runtime/permissions.js.map +1 -0
- package/dist/runtime/progressPacket.d.ts +12 -0
- package/dist/runtime/progressPacket.js +512 -0
- package/dist/runtime/progressPacket.js.map +1 -0
- package/dist/runtime/protectedPaths.d.ts +6 -0
- package/dist/runtime/protectedPaths.js +48 -0
- package/dist/runtime/protectedPaths.js.map +1 -0
- package/dist/runtime/providers.d.ts +13 -0
- package/dist/runtime/providers.js +60 -0
- package/dist/runtime/providers.js.map +1 -0
- package/dist/runtime/reconciliation.d.ts +17 -0
- package/dist/runtime/reconciliation.js +283 -0
- package/dist/runtime/reconciliation.js.map +1 -0
- package/dist/runtime/redaction.d.ts +1 -0
- package/dist/runtime/redaction.js +5 -0
- package/dist/runtime/redaction.js.map +1 -0
- package/dist/runtime/remoteRepoContext.d.ts +77 -0
- package/dist/runtime/remoteRepoContext.js +316 -0
- package/dist/runtime/remoteRepoContext.js.map +1 -0
- package/dist/runtime/repoContext.d.ts +50 -0
- package/dist/runtime/repoContext.js +399 -0
- package/dist/runtime/repoContext.js.map +1 -0
- package/dist/runtime/repoGateway.d.ts +64 -0
- package/dist/runtime/repoGateway.js +308 -0
- package/dist/runtime/repoGateway.js.map +1 -0
- package/dist/runtime/responseContracts.d.ts +3 -0
- package/dist/runtime/responseContracts.js +86 -0
- package/dist/runtime/responseContracts.js.map +1 -0
- package/dist/runtime/reviewLanes.d.ts +2 -0
- package/dist/runtime/reviewLanes.js +343 -0
- package/dist/runtime/reviewLanes.js.map +1 -0
- package/dist/runtime/reviewRouting.d.ts +51 -0
- package/dist/runtime/reviewRouting.js +152 -0
- package/dist/runtime/reviewRouting.js.map +1 -0
- package/dist/runtime/revisionPacket.d.ts +38 -0
- package/dist/runtime/revisionPacket.js +144 -0
- package/dist/runtime/revisionPacket.js.map +1 -0
- package/dist/runtime/revisionTrail.d.ts +2 -0
- package/dist/runtime/revisionTrail.js +162 -0
- package/dist/runtime/revisionTrail.js.map +1 -0
- package/dist/runtime/role-assignment.d.ts +4 -0
- package/dist/runtime/role-assignment.js +21 -0
- package/dist/runtime/role-assignment.js.map +1 -0
- package/dist/runtime/roleRoster.d.ts +28 -0
- package/dist/runtime/roleRoster.js +96 -0
- package/dist/runtime/roleRoster.js.map +1 -0
- package/dist/runtime/runInsights.d.ts +121 -0
- package/dist/runtime/runInsights.js +305 -0
- package/dist/runtime/runInsights.js.map +1 -0
- package/dist/runtime/runMonitor.d.ts +33 -0
- package/dist/runtime/runMonitor.js +143 -0
- package/dist/runtime/runMonitor.js.map +1 -0
- package/dist/runtime/runtime.d.ts +15 -0
- package/dist/runtime/runtime.js +199 -0
- package/dist/runtime/runtime.js.map +1 -0
- package/dist/runtime/runtimeInfo.d.ts +9 -0
- package/dist/runtime/runtimeInfo.js +76 -0
- package/dist/runtime/runtimeInfo.js.map +1 -0
- package/dist/runtime/store.d.ts +4 -0
- package/dist/runtime/store.js +48 -0
- package/dist/runtime/store.js.map +1 -0
- package/dist/runtime/summons.d.ts +25 -0
- package/dist/runtime/summons.js +403 -0
- package/dist/runtime/summons.js.map +1 -0
- package/dist/runtime/teamPresets.d.ts +14 -0
- package/dist/runtime/teamPresets.js +153 -0
- package/dist/runtime/teamPresets.js.map +1 -0
- package/dist/runtime/types.d.ts +505 -0
- package/dist/runtime/types.js +28 -0
- package/dist/runtime/types.js.map +1 -0
- package/dist/runtime/validationCommands.d.ts +18 -0
- package/dist/runtime/validationCommands.js +106 -0
- package/dist/runtime/validationCommands.js.map +1 -0
- package/dist/tui/dashboard.d.ts +41 -0
- package/dist/tui/dashboard.js +1115 -0
- package/dist/tui/dashboard.js.map +1 -0
- package/docs/ARCHITECTURE.md +277 -0
- package/docs/CLI_SPEC.md +396 -0
- package/docs/CODEX_SETUP.md +288 -0
- package/docs/COMPLETION_CONTRACT.md +52 -0
- package/docs/CONTRIBUTOR_GUIDE.md +70 -0
- package/docs/DEMO.md +62 -0
- package/docs/GLOSSARY.md +46 -0
- package/docs/GOAL_LOOP_SCHEDULE.md +50 -0
- package/docs/KNOWN_LIMITATIONS.md +29 -0
- package/docs/LICENSING.md +21 -0
- package/docs/LOOP_RECIPES.md +290 -0
- package/docs/LOOP_SELECTION_UX.md +118 -0
- package/docs/MCP_SPEC.md +689 -0
- package/docs/MEMORY_AND_RECONCILIATION.md +222 -0
- package/docs/NPM_PUBLISHING.md +51 -0
- package/docs/OPEN_DECISIONS.md +81 -0
- package/docs/PROMPT_SCHEMAS.md +411 -0
- package/docs/PROVIDER_ADAPTERS.md +323 -0
- package/docs/PROVIDER_MATRIX.md +21 -0
- package/docs/PUBLIC_REPO_READINESS.md +49 -0
- package/docs/RESEARCH_NOTES.md +92 -0
- package/docs/ROADMAP.md +94 -0
- package/docs/ROLE_CONTRACTS.md +252 -0
- package/docs/RUNTIME_LOOP.md +240 -0
- package/docs/SECURITY_AND_PRIVACY.md +161 -0
- package/docs/TESTING_AND_VERIFICATION.md +180 -0
- package/docs/TRUST_MODEL.md +65 -0
- package/docs/decisions/0001-runtime-first-cli-and-mcp.md +23 -0
- package/docs/decisions/0002-provider-neutral-role-mapping.md +43 -0
- package/docs/decisions/0003-separate-implementation-and-verification.md +27 -0
- package/docs/product/README.md +14 -0
- package/docs/product/model-selection.md +88 -0
- package/docs/product/positioning.md +37 -0
- package/docs/product/pro-usage-modes.md +70 -0
- package/docs/product/roadmap.md +57 -0
- package/docs/product/role-policy.md +89 -0
- package/docs/product/runtime-invariants.md +44 -0
- package/docs/release/v0.1.0-preview.0.md +48 -0
- package/examples/stub-demo/README.md +25 -0
- package/package.json +55 -0
package/docs/MCP_SPEC.md
ADDED
|
@@ -0,0 +1,689 @@
|
|
|
1
|
+
# MCP Spec
|
|
2
|
+
|
|
3
|
+
The MCP server exposes TheHood to Codex, ChatGPT Developer Mode, and other MCP clients.
|
|
4
|
+
|
|
5
|
+
Codex should use MCP as the doorway into the runtime. MCP tools should not implement orchestration logic themselves.
|
|
6
|
+
|
|
7
|
+
## Server
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
thehood mcp
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The current implementation uses the MCP stdio transport: newline-delimited JSON-RPC messages over stdin/stdout. It implements initialization, `tools/list`, `tools/call`, and `ping`.
|
|
14
|
+
|
|
15
|
+
## ChatGPT Developer Mode Connector
|
|
16
|
+
|
|
17
|
+
For ChatGPT Web/Pro as an MCP host, use ChatGPT Developer Mode with an MCP connector. For private local repos, prefer OpenAI Secure MCP Tunnel pointing at the local TheHood stdio command:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
tunnel-client init \
|
|
21
|
+
--sample sample_mcp_stdio_local \
|
|
22
|
+
--profile thehood-local \
|
|
23
|
+
--tunnel-id <tunnel-id> \
|
|
24
|
+
--mcp-command "thehood mcp"
|
|
25
|
+
|
|
26
|
+
tunnel-client doctor --profile thehood-local --explain
|
|
27
|
+
tunnel-client run --profile thehood-local
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Then create a ChatGPT connector using the tunnel connection and enable it in a new conversation. In that mode, ChatGPT can call TheHood's exact repo and run tools instead of receiving a prebuilt summary.
|
|
31
|
+
|
|
32
|
+
Validate connector mode from a fresh ChatGPT conversation by asking ChatGPT to use the TheHood connector to call:
|
|
33
|
+
|
|
34
|
+
1. `thehood_doctor` for the target `repo_path`.
|
|
35
|
+
2. `thehood_repo_tree` or `thehood_repo_read_file` for a harmless path.
|
|
36
|
+
3. `thehood_pro_access` when ChatGPT should understand the available Pro bridge and MCP connector handoff paths.
|
|
37
|
+
|
|
38
|
+
Successful connector validation proves only that ChatGPT can reach TheHood MCP and receive bounded tool results. It does not run a live TheHood orchestration, approve provider calls, or replace runtime verification.
|
|
39
|
+
|
|
40
|
+
The CLI can print the same tunnel setup shape:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
thehood mcp tunnel --tunnel-id <tunnel-id> --profile thehood-local
|
|
44
|
+
node dist/cli/main.js mcp tunnel --tunnel-id <tunnel-id> --profile thehood-local
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Use the local-build command while developing TheHood so the tunnel points at the current checkout's `dist/cli/main.js`.
|
|
48
|
+
|
|
49
|
+
This connector path is separate from the `chatgpt-web` agent bridge. Connector mode does not use the TheHood-managed Chrome profile, CDP, or `THEHOOD_CHATGPT_WEB_*` environment variables. The bridge path is for Codex or TheHood asking the runtime to invoke ChatGPT Web; connector mode is for ChatGPT acting as the MCP host and asking TheHood for repo/run evidence through tools.
|
|
50
|
+
|
|
51
|
+
References:
|
|
52
|
+
|
|
53
|
+
- [MCP Transports](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports)
|
|
54
|
+
- [MCP Lifecycle](https://modelcontextprotocol.io/specification/2025-06-18/basic/lifecycle)
|
|
55
|
+
- [MCP Tools](https://modelcontextprotocol.io/specification/2025-06-18/server/tools)
|
|
56
|
+
|
|
57
|
+
Conceptual Codex config:
|
|
58
|
+
|
|
59
|
+
```toml
|
|
60
|
+
[mcp_servers.thehood]
|
|
61
|
+
command = "thehood"
|
|
62
|
+
args = ["mcp"]
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Run `thehood mcp config` or `node dist/cli/main.js mcp config` to print installed-package and local-build snippets.
|
|
66
|
+
|
|
67
|
+
Run `thehood mcp config --chatgpt-web` after launching a debug Chrome profile and selecting the intended ChatGPT model to print snippets with the ChatGPT Web bridge environment variables included.
|
|
68
|
+
|
|
69
|
+
## Tools
|
|
70
|
+
|
|
71
|
+
Implemented tools:
|
|
72
|
+
|
|
73
|
+
- `thehood_doctor`
|
|
74
|
+
- `thehood_roles`
|
|
75
|
+
- `thehood_model_access`
|
|
76
|
+
- `thehood_pro_access`
|
|
77
|
+
- `thehood_recommend_loop`
|
|
78
|
+
- `thehood_agent_board`
|
|
79
|
+
- `thehood_assign_roles`
|
|
80
|
+
- `thehood_plan`
|
|
81
|
+
- `thehood_orchestrate`
|
|
82
|
+
- `thehood_consult`
|
|
83
|
+
- `thehood_summon`
|
|
84
|
+
- `thehood_fanout`
|
|
85
|
+
- `thehood_continue`
|
|
86
|
+
- `thehood_reconcile`
|
|
87
|
+
- `thehood_status`
|
|
88
|
+
- `thehood_runs`
|
|
89
|
+
- `thehood_read_artifact`
|
|
90
|
+
- `thehood_capture_evidence`
|
|
91
|
+
- `thehood_repo_tree`
|
|
92
|
+
- `thehood_repo_search`
|
|
93
|
+
- `thehood_repo_read_file`
|
|
94
|
+
- `thehood_git_status`
|
|
95
|
+
- `thehood_git_diff`
|
|
96
|
+
- `thehood_abort`
|
|
97
|
+
|
|
98
|
+
### `thehood_doctor`
|
|
99
|
+
|
|
100
|
+
Inspect provider and role readiness without invoking model calls.
|
|
101
|
+
The output includes `runtime.capabilities` so Codex can detect stale MCP server processes after local development builds. Provider entries include model policy, such as `listed`, `discovered`, or `passthrough`, so Codex can tell whether a model name came from a fixed list, a live catalog, or a user-configured provider passthrough.
|
|
102
|
+
|
|
103
|
+
Input:
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"repo_path": "string"
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### `thehood_roles`
|
|
112
|
+
|
|
113
|
+
Inspect configured role assignments, health, and the full agent roster. The roster is derived from the same runtime role contracts and includes lane labels, provider:model owners, default-vs-repo assignment source, readiness, purpose, and read/edit/shell/network authority. It is display and configuration metadata only; it does not grant permissions or schedule work.
|
|
114
|
+
|
|
115
|
+
Input:
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"repo_path": "string"
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### `thehood_model_access`
|
|
124
|
+
|
|
125
|
+
Inspect a general external model-access path without calling providers or sending repo context. Use this before Claude/Codex/GPT/Pro consults, fan-outs, or orchestrations that may disclose repo context, progress packets, memory, or runtime artifacts outside the local TheHood runtime.
|
|
126
|
+
|
|
127
|
+
Input:
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"repo_path": "string",
|
|
132
|
+
"agents": ["claude-code:opus", "codex-cli:gpt-5.5"],
|
|
133
|
+
"purpose": "optional local-only purpose",
|
|
134
|
+
"context_kind": "repo_context | progress_packet | no_repo_context | connector_handoff",
|
|
135
|
+
"constraints": ["optional local-only constraints"]
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Output includes current TheHood approval policy, provider/model readiness, repo visibility, a data-boundary summary, an explicit note that Codex or tenant external-disclosure policy is outside TheHood runtime control, a compact approval packet, and fallback paths such as no-repo-context prompting, connector mode when supported, or runtime-only evidence inspection. When Codex needs the user to approve the packet, render `approval_packet.copyable_text_block` as a fenced `text` block so the user gets a native copy button instead of inline approval prose.
|
|
140
|
+
|
|
141
|
+
Repo visibility drives the default UX:
|
|
142
|
+
|
|
143
|
+
- Dirty or unpushed repos require a user choice: commit and push a checkpoint first, approve bounded local context or diff transfer, use no-repo-context strategy, or cancel.
|
|
144
|
+
- Clean pushed GitHub repos default to remote refs only when the provider route is verified. For `chatgpt-web`, TheHood should prefer ChatGPT's GitHub connector at the exact commit only when the active ChatGPT Web bridge GitHub connector surface is confirmed; otherwise the preflight should present connector setup, explicit local context approval, no-repo-context, or cancel paths.
|
|
145
|
+
|
|
146
|
+
If Codex rejects a direct model-backed call as an external disclosure, do not ask the user to type a fresh long approval phrase. Present the model-access approval packet, show the exact approval text in a fenced `text` block if the user accepts, or switch to no-repo-context or connector mode.
|
|
147
|
+
|
|
148
|
+
### `thehood_pro_access`
|
|
149
|
+
|
|
150
|
+
Inspect the ChatGPT Pro access path without calling Pro or sending repo context externally. This is the safe fallback when Codex host policy rejects a direct `chatgpt-web` consult before TheHood can apply runtime autopilot.
|
|
151
|
+
|
|
152
|
+
Input:
|
|
153
|
+
|
|
154
|
+
```json
|
|
155
|
+
{
|
|
156
|
+
"repo_path": "string",
|
|
157
|
+
"goal": "optional local-only handoff goal",
|
|
158
|
+
"constraints": ["optional local-only handoff constraints"]
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Output includes current TheHood approval policy, ChatGPT Web bridge readiness, an explicit note that Codex or tenant external-disclosure policy is outside TheHood runtime control, and recommended paths for ChatGPT MCP connector mode, direct Codex agent-bridge mode, or an abstract no-repo-context Pro prompt.
|
|
163
|
+
|
|
164
|
+
If Codex rejects a direct Pro consult as an external disclosure, do not ask the user to approve the same blocked action again. Call `thehood_pro_access`, then use connector mode or a no-repo-context prompt.
|
|
165
|
+
|
|
166
|
+
### `thehood_recommend_loop`
|
|
167
|
+
|
|
168
|
+
Recommend a loop recipe and draft a completion contract without invoking providers, starting a run, editing files, creating schedules, or sending context externally.
|
|
169
|
+
|
|
170
|
+
Input:
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"repo_path": "string",
|
|
175
|
+
"goal": "string",
|
|
176
|
+
"constraints": ["optional local-only constraints"],
|
|
177
|
+
"acceptance_criteria": ["optional edited contract criteria"],
|
|
178
|
+
"validation_commands": ["optional edited validation commands"],
|
|
179
|
+
"allowed_paths": ["optional edited allowed paths"],
|
|
180
|
+
"forbidden_changes": ["optional edited forbidden changes"],
|
|
181
|
+
"max_iterations": 5
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Output includes the recommended recipe, confidence, reason, recommended stack, alternatives, a completion contract draft, app card actions, renderer-facing `card`, and `runAction` for the existing runtime path. It also includes `artifact.surface`, `artifact.manifest`, and `artifact.snapshot`, a bounded dashboard payload that Codex can render as a loop-plan fallback when it does not consume `card` directly.
|
|
186
|
+
|
|
187
|
+
Codex should call this before asking the user to choose a recipe name. Render `card` first when present, and use `artifact` as the generic dashboard/table fallback. If the user edits the contract, call this tool again with the edited fields. If the user accepts the recommendation, call the `runAction.tool` with `runAction.arguments`. Runtime approvals, provider calls, evidence capture, verifier review, and stop conditions still happen inside the normal TheHood run.
|
|
188
|
+
|
|
189
|
+
### `thehood_agent_board`
|
|
190
|
+
|
|
191
|
+
Return a visual-ready agent board for Codex app card-style visibility. The board is derived from role config, provider health, crew lanes, review lanes, loop responsibilities, handoffs, artifacts, and operator next actions. It is display guidance only: it does not grant tools, schedule agents, satisfy gates, or approve work.
|
|
192
|
+
|
|
193
|
+
Input:
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"repo_path": "string",
|
|
198
|
+
"run_id": "optional string",
|
|
199
|
+
"include_artifact": "optional boolean"
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
When `run_id` is omitted, the board is repo-scoped and shows configured agents, readiness, owners, and authority. When `run_id` is present, cards also include current lane state, blocking state, sidecar status, and bounded artifact/event/handoff refs for that run. When `include_artifact` is true, the output also includes `artifact.surface`, `artifact.manifest`, and `artifact.snapshot`, a bounded dashboard payload that a Codex app artifact renderer can display as native card and table UI.
|
|
204
|
+
|
|
205
|
+
This MCP tool does not create Codex-native subagent threads. Use the optional TheHood Codex plugin only when the user wants TheHood guidance and MCP wiring loaded into Codex; native Codex subagent threads still require Codex-owned subagent workflows.
|
|
206
|
+
|
|
207
|
+
### `thehood_assign_roles`
|
|
208
|
+
|
|
209
|
+
Persist provider:model assignments for one or more roles.
|
|
210
|
+
|
|
211
|
+
Input:
|
|
212
|
+
|
|
213
|
+
```json
|
|
214
|
+
{
|
|
215
|
+
"repo_path": "string",
|
|
216
|
+
"role_mapping": {
|
|
217
|
+
"orchestrator": "provider:model",
|
|
218
|
+
"planner": "provider:model",
|
|
219
|
+
"researcher": "provider:model",
|
|
220
|
+
"implementer": "provider:model",
|
|
221
|
+
"qa": "provider:model",
|
|
222
|
+
"verifier": "provider:model",
|
|
223
|
+
"critic": "provider:model"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Examples:
|
|
229
|
+
|
|
230
|
+
```json
|
|
231
|
+
{
|
|
232
|
+
"repo_path": "/path/to/repo",
|
|
233
|
+
"role_mapping": {
|
|
234
|
+
"implementer": "claude-code:sonnet",
|
|
235
|
+
"qa": "codex-cli:spark",
|
|
236
|
+
"verifier": "claude-code:sonnet",
|
|
237
|
+
"critic": "claude-code:fable"
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
```json
|
|
243
|
+
{
|
|
244
|
+
"repo_path": "/path/to/repo",
|
|
245
|
+
"role_mapping": {
|
|
246
|
+
"orchestrator": "chatgpt-web:chatgpt-pro",
|
|
247
|
+
"implementer": "codex-cli:default",
|
|
248
|
+
"verifier": "claude-code:sonnet",
|
|
249
|
+
"critic": "claude-code:sonnet"
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### `thehood_plan`
|
|
255
|
+
|
|
256
|
+
Create a read-only plan.
|
|
257
|
+
|
|
258
|
+
Input:
|
|
259
|
+
|
|
260
|
+
```json
|
|
261
|
+
{
|
|
262
|
+
"goal": "string",
|
|
263
|
+
"repo_path": "string",
|
|
264
|
+
"orchestrator": "optional provider:model",
|
|
265
|
+
"constraints": ["string"],
|
|
266
|
+
"auto_loop": "optional boolean",
|
|
267
|
+
"max_cycles": "optional positive integer for auto_loop",
|
|
268
|
+
"max_steps_per_cycle": "optional positive integer for auto_loop"
|
|
269
|
+
}
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
When `auto_loop` is true, the created plan run is immediately advanced through the headless loop runner until terminal state, required manual approval, no progress, or the cycle cap.
|
|
273
|
+
|
|
274
|
+
Output:
|
|
275
|
+
|
|
276
|
+
```json
|
|
277
|
+
{
|
|
278
|
+
"run_id": "string",
|
|
279
|
+
"status": "awaiting_approval | completed | failed",
|
|
280
|
+
"plan": "string",
|
|
281
|
+
"next_actions": [
|
|
282
|
+
{
|
|
283
|
+
"action": "string",
|
|
284
|
+
"label": "string",
|
|
285
|
+
"description": "string",
|
|
286
|
+
"owner": {
|
|
287
|
+
"kind": "runtime | role",
|
|
288
|
+
"label": "string",
|
|
289
|
+
"role": "optional runtime role"
|
|
290
|
+
},
|
|
291
|
+
"blocking": "boolean",
|
|
292
|
+
"required": "boolean",
|
|
293
|
+
"tool": "optional MCP tool name",
|
|
294
|
+
"arguments": "optional tool arguments",
|
|
295
|
+
"artifactRefs": ["string"],
|
|
296
|
+
"eventRefs": ["string"]
|
|
297
|
+
}
|
|
298
|
+
]
|
|
299
|
+
}
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### `thehood_orchestrate`
|
|
303
|
+
|
|
304
|
+
Start or continue a full run.
|
|
305
|
+
|
|
306
|
+
Input:
|
|
307
|
+
|
|
308
|
+
```json
|
|
309
|
+
{
|
|
310
|
+
"goal": "string",
|
|
311
|
+
"repo_path": "string",
|
|
312
|
+
"mode": "plan | research | implement | review",
|
|
313
|
+
"role_mapping": {
|
|
314
|
+
"orchestrator": "provider:model",
|
|
315
|
+
"planner": "provider:model",
|
|
316
|
+
"researcher": "provider:model",
|
|
317
|
+
"implementer": "provider:model",
|
|
318
|
+
"qa": "provider:model",
|
|
319
|
+
"verifier": "provider:model",
|
|
320
|
+
"critic": "provider:model"
|
|
321
|
+
},
|
|
322
|
+
"constraints": ["string"],
|
|
323
|
+
"auto_loop": "optional boolean",
|
|
324
|
+
"max_cycles": "optional positive integer for auto_loop",
|
|
325
|
+
"max_steps_per_cycle": "optional positive integer for auto_loop"
|
|
326
|
+
}
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
When `auto_loop` is true, the created run is immediately advanced through the headless loop runner. Manual gates are still not approved by this flag; runtime autopilot policy may auto-approve bounded gates when configured.
|
|
330
|
+
|
|
331
|
+
### `thehood_consult`
|
|
332
|
+
|
|
333
|
+
Run one read-only guest role immediately. This is the fast path for Codex chat to bring in Codex Spark, Pro, Claude, or another agent for planning, research, QA, second judgment, or critique.
|
|
334
|
+
|
|
335
|
+
Input:
|
|
336
|
+
|
|
337
|
+
```json
|
|
338
|
+
{
|
|
339
|
+
"goal": "string",
|
|
340
|
+
"repo_path": "string",
|
|
341
|
+
"role": "orchestrator | planner | researcher | qa | critic",
|
|
342
|
+
"agent": "provider:model",
|
|
343
|
+
"constraints": ["string"]
|
|
344
|
+
}
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
Example:
|
|
348
|
+
|
|
349
|
+
```json
|
|
350
|
+
{
|
|
351
|
+
"goal": "Critique the current approach before implementation.",
|
|
352
|
+
"repo_path": "/path/to/repo",
|
|
353
|
+
"role": "critic",
|
|
354
|
+
"agent": "codex-cli:spark"
|
|
355
|
+
}
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
ChatGPT Pro example:
|
|
359
|
+
|
|
360
|
+
```json
|
|
361
|
+
{
|
|
362
|
+
"goal": "Plan the implementation and delegate safely.",
|
|
363
|
+
"repo_path": "/path/to/repo",
|
|
364
|
+
"role": "orchestrator",
|
|
365
|
+
"agent": "chatgpt-web:chatgpt-pro"
|
|
366
|
+
}
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
QA tester example:
|
|
370
|
+
|
|
371
|
+
```json
|
|
372
|
+
{
|
|
373
|
+
"goal": "Inspect the current implementation evidence and recommend missed validation cases.",
|
|
374
|
+
"repo_path": "/path/to/repo",
|
|
375
|
+
"role": "qa",
|
|
376
|
+
"agent": "codex-cli:spark"
|
|
377
|
+
}
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
Claude second-judge example:
|
|
381
|
+
|
|
382
|
+
```json
|
|
383
|
+
{
|
|
384
|
+
"goal": "Challenge the current implementation plan and call out risks before we build.",
|
|
385
|
+
"repo_path": "/path/to/repo",
|
|
386
|
+
"role": "critic",
|
|
387
|
+
"agent": "claude-code:sonnet"
|
|
388
|
+
}
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
`chatgpt-web` requires `THEHOOD_CHATGPT_WEB_COMMAND`; without it the run returns `blocked`.
|
|
392
|
+
|
|
393
|
+
Output includes the created run id, current or final state, consulted role, consulted agent, stop reason, provider response count, normalized provider response summaries, and artifacts. Provider response summaries keep markdown payloads bounded; read the response artifact for the complete markdown plan, report, review, or critique. Read-only model-backed guest agents may return `awaiting_approval` before the first provider call; continue only after the user approves invoking that provider.
|
|
394
|
+
|
|
395
|
+
Output:
|
|
396
|
+
|
|
397
|
+
```json
|
|
398
|
+
{
|
|
399
|
+
"run_id": "string",
|
|
400
|
+
"status": "created | planning | awaiting_approval | implementing | verifying | completed | failed",
|
|
401
|
+
"summary": "string",
|
|
402
|
+
"approval_required": true,
|
|
403
|
+
"approval_reason": "string",
|
|
404
|
+
"artifacts": [
|
|
405
|
+
{
|
|
406
|
+
"kind": "plan | diff | log | report | metadata | status | agent | directive | context | remote_context | progress | reconciliation | critic_trigger | revision_packet | fanout | transfer_manifest",
|
|
407
|
+
"ref": "string"
|
|
408
|
+
}
|
|
409
|
+
]
|
|
410
|
+
}
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
### `thehood_summon`
|
|
414
|
+
|
|
415
|
+
Summon a read-only role onto an existing run. This is the same-run path for planner, reviewer, QA, research, and critic work when the response should be attached to the active run instead of a separate consult run.
|
|
416
|
+
|
|
417
|
+
Input:
|
|
418
|
+
|
|
419
|
+
```json
|
|
420
|
+
{
|
|
421
|
+
"run_id": "string",
|
|
422
|
+
"repo_path": "string",
|
|
423
|
+
"role": "orchestrator | planner | researcher | qa | verifier | critic",
|
|
424
|
+
"brief": "string",
|
|
425
|
+
"agent": "optional provider:model",
|
|
426
|
+
"kind": "optional review | qa | critique | research | plan",
|
|
427
|
+
"persona": "optional short role brief",
|
|
428
|
+
"constraints": ["string"],
|
|
429
|
+
"evidence_refs": ["artifact ref"]
|
|
430
|
+
}
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
The runtime records `agent_summoned`, a typed handoff, and provider directive/response artifacts when the provider runs. A one-call `agent` override does not rewrite the run's role mapping. Model-backed providers still pass through the provider-invocation approval gate; autopilot may auto-approve that bounded gate according to policy. A `qa` summon records model-assisted tester evidence, but runtime-captured validation artifacts remain the proof for runtime QA/validation gates.
|
|
434
|
+
|
|
435
|
+
Output includes the run summary, summoned role, summoned agent, summon kind, stop reason, directive and response artifact refs when present, provider response count, and normalized provider response summaries. Long provider-authored plans, reports, reviews, and critique should be returned as markdown in the role payload and are bounded in tool responses.
|
|
436
|
+
|
|
437
|
+
### `thehood_fanout`
|
|
438
|
+
|
|
439
|
+
Run a bounded group of read-only same-run summons on an existing run. This is the MCP path for asking several advisory agents to inspect the same state, such as QA tester plus critic, without giving those agents edit authority or acceptance authority.
|
|
440
|
+
|
|
441
|
+
Input:
|
|
442
|
+
|
|
443
|
+
```json
|
|
444
|
+
{
|
|
445
|
+
"run_id": "string",
|
|
446
|
+
"repo_path": "string",
|
|
447
|
+
"max_items": "optional number, hard-capped at 8",
|
|
448
|
+
"items": [
|
|
449
|
+
{
|
|
450
|
+
"role": "orchestrator | planner | researcher | qa | verifier | critic",
|
|
451
|
+
"brief": "string",
|
|
452
|
+
"agent": "optional provider:model",
|
|
453
|
+
"kind": "optional summon kind",
|
|
454
|
+
"persona": "optional string",
|
|
455
|
+
"constraints": ["string"],
|
|
456
|
+
"evidence_refs": ["artifact ref"]
|
|
457
|
+
}
|
|
458
|
+
]
|
|
459
|
+
}
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
Output includes the run summary, `fanout_status`, bounds, the compact `fanout` artifact ref, and one item summary per attempted summon with role, summon kind, status, stop reason, agent, directive artifact, response artifact, and provider status when present. Execution is currently sequential. Repo config `defaults.fanoutMaxItems` can lower the item cap, while the runtime hard cap remains 8. If a provider invocation or transfer gate blocks one item, the runtime stops before later items and records the group artifact. If a read-only advisory item returns malformed output or another contained provider failure without opening a gate, the runtime records that item as blocked or failed and continues to later requested items. Fan-out evidence is sidecar-only; it may appear in QA tester or critic lanes, but it cannot satisfy required verifier, runtime QA, approval, or completion gates.
|
|
463
|
+
|
|
464
|
+
### `thehood_continue`
|
|
465
|
+
|
|
466
|
+
Continue a paused or ready run through the runtime.
|
|
467
|
+
|
|
468
|
+
Current behavior:
|
|
469
|
+
|
|
470
|
+
- uses `approval: "none"` when no manual approval gate is active
|
|
471
|
+
- optionally records an explicit approval decision for an active manual gate
|
|
472
|
+
- advances the runtime loop until completion or the next gate
|
|
473
|
+
- may auto-approve bounded gates under runtime autopilot policy, including provider invocation and non-secret external transfers, while recording `approval_auto_approved` evidence
|
|
474
|
+
- returns the final state, stop reason, provider response count, normalized provider responses, and structured `next_actions`
|
|
475
|
+
- `next_actions` are derived by the runtime, include bounded owner/blocking/required metadata, and are display guidance for MCP clients rather than policy grants
|
|
476
|
+
- approval gates include `thehood_read_artifact` next actions when a specific patch, integration report, or transfer manifest should be inspected first
|
|
477
|
+
- external provider transfer gates include `thehood_transfer_preview` next actions when a transfer manifest is available
|
|
478
|
+
- completed runs include an `inspect_final_report` next action when a final report artifact is available
|
|
479
|
+
- completed runs include a `thehood_reconcile` next action when they can be reconciled from a progress packet
|
|
480
|
+
|
|
481
|
+
Input:
|
|
482
|
+
|
|
483
|
+
```json
|
|
484
|
+
{
|
|
485
|
+
"run_id": "string",
|
|
486
|
+
"approval": "approve | reject | revise | none",
|
|
487
|
+
"message": "string"
|
|
488
|
+
}
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
### `thehood_loop`
|
|
492
|
+
|
|
493
|
+
Run an existing TheHood run through the headless autopilot runner.
|
|
494
|
+
|
|
495
|
+
Current behavior:
|
|
496
|
+
|
|
497
|
+
- repeatedly calls the runtime advance path
|
|
498
|
+
- stops on terminal state, required manual approval, no progress, or max cycle cap
|
|
499
|
+
- does not approve manual gates
|
|
500
|
+
- still lets runtime autopilot policy auto-approve bounded gates when configured
|
|
501
|
+
- returns the final run state, stop kind, stop reason, cycle log, provider response count, normalized provider responses, and structured `next_actions`
|
|
502
|
+
|
|
503
|
+
Input:
|
|
504
|
+
|
|
505
|
+
```json
|
|
506
|
+
{
|
|
507
|
+
"run_id": "string",
|
|
508
|
+
"repo_path": "string",
|
|
509
|
+
"max_cycles": "optional positive integer, default 8",
|
|
510
|
+
"max_steps_per_cycle": "optional positive integer, default 10"
|
|
511
|
+
}
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
### `thehood_reconcile`
|
|
515
|
+
|
|
516
|
+
Reconcile a completed run from its latest progress packet.
|
|
517
|
+
|
|
518
|
+
Current behavior:
|
|
519
|
+
|
|
520
|
+
- finds or creates a `progress` artifact for a completed run
|
|
521
|
+
- writes a `transfer_manifest` artifact and pauses for approval before sending progress packets to browser or API providers
|
|
522
|
+
- invokes the configured `planner`, or `orchestrator` when no planner is assigned
|
|
523
|
+
- stores the schema-bound provider response as a `reconciliation` artifact whose role payload may include markdown narrative
|
|
524
|
+
|
|
525
|
+
Input:
|
|
526
|
+
|
|
527
|
+
```json
|
|
528
|
+
{
|
|
529
|
+
"run_id": "string",
|
|
530
|
+
"repo_path": "string",
|
|
531
|
+
"role": "optional planner | orchestrator",
|
|
532
|
+
"approval": "approve | reject | revise | none",
|
|
533
|
+
"message": "optional approval message"
|
|
534
|
+
}
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
### `thehood_transfer_preview`
|
|
538
|
+
|
|
539
|
+
Read the latest external transfer manifest for a run without sending anything to a provider.
|
|
540
|
+
|
|
541
|
+
Use this before approving browser or API-provider transfer gates.
|
|
542
|
+
|
|
543
|
+
Input:
|
|
544
|
+
|
|
545
|
+
```json
|
|
546
|
+
{
|
|
547
|
+
"run_id": "string",
|
|
548
|
+
"repo_path": "string"
|
|
549
|
+
}
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
### `thehood_status`
|
|
553
|
+
|
|
554
|
+
Inspect a run.
|
|
555
|
+
|
|
556
|
+
Output is compact by default. It includes run state, role mapping, artifact/event/tool counts, latest artifact refs, recent events, compact `next_actions`, compact `agent_board`, and bounded `insights`. The compact response is designed for MCP hosts such as Codex so repeated status checks do not fill the conversation context with full run evidence. Full evidence remains in `.thehood` run records and artifacts.
|
|
557
|
+
|
|
558
|
+
Set `detail` to `full` only when the caller intentionally needs the legacy verbose payload. Prefer reading a specific artifact with `thehood_read_artifact` when inspecting plans, verifier reports, provider logs, progress packets, or fan-out evidence.
|
|
559
|
+
|
|
560
|
+
Compact insights expose the latest attached provider response artifact, parsed primary output such as `decision`, final report artifact, latest progress packet, reconciliation, repo context, remote repo context, local provider execution, review routing, critic trigger, revision packet, fan-out, and transfer manifest refs when present, plus refs-only `canonicalMemory`, bounded revision trails, crew lane trails, review lanes, loop responsibility schedules, and operator next actions. Revision trails, crew lanes, loop responsibilities, and agent board cards are derived by the runtime from canonical run evidence and are display guidance only; they do not grant tools or satisfy verifier/runtime QA gates.
|
|
561
|
+
|
|
562
|
+
Input:
|
|
563
|
+
|
|
564
|
+
```json
|
|
565
|
+
{
|
|
566
|
+
"run_id": "string",
|
|
567
|
+
"repo_path": "string",
|
|
568
|
+
"detail": "summary | full"
|
|
569
|
+
}
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
### `thehood_runs`
|
|
573
|
+
|
|
574
|
+
List recent runs for a repository.
|
|
575
|
+
|
|
576
|
+
Input:
|
|
577
|
+
|
|
578
|
+
```json
|
|
579
|
+
{
|
|
580
|
+
"repo_path": "string",
|
|
581
|
+
"limit": 20,
|
|
582
|
+
"detail": "summary | full"
|
|
583
|
+
}
|
|
584
|
+
```
|
|
585
|
+
|
|
586
|
+
### `thehood_read_artifact`
|
|
587
|
+
|
|
588
|
+
Read a bounded artifact attached to a run. The runtime only allows refs already recorded on that run and only inside that run's artifact directory.
|
|
589
|
+
|
|
590
|
+
Input:
|
|
591
|
+
|
|
592
|
+
```json
|
|
593
|
+
{
|
|
594
|
+
"run_id": "string",
|
|
595
|
+
"repo_path": "string",
|
|
596
|
+
"ref": "string",
|
|
597
|
+
"max_bytes": 20000
|
|
598
|
+
}
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
### Repo Gateway Tools
|
|
602
|
+
|
|
603
|
+
The repo gateway tools are read-only and bounded. They skip `.git`, `.thehood`, dependency/build output, and secret-looking paths.
|
|
604
|
+
|
|
605
|
+
`thehood_repo_tree`:
|
|
606
|
+
|
|
607
|
+
```json
|
|
608
|
+
{
|
|
609
|
+
"repo_path": "string",
|
|
610
|
+
"path": "optional relative directory",
|
|
611
|
+
"max_depth": 4,
|
|
612
|
+
"max_entries": 200
|
|
613
|
+
}
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
`thehood_repo_search`:
|
|
617
|
+
|
|
618
|
+
```json
|
|
619
|
+
{
|
|
620
|
+
"repo_path": "string",
|
|
621
|
+
"query": "string",
|
|
622
|
+
"globs": ["src/**/*.ts"],
|
|
623
|
+
"max_results": 50,
|
|
624
|
+
"case_sensitive": true
|
|
625
|
+
}
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
`thehood_repo_read_file`:
|
|
629
|
+
|
|
630
|
+
```json
|
|
631
|
+
{
|
|
632
|
+
"repo_path": "string",
|
|
633
|
+
"path": "relative file path",
|
|
634
|
+
"offset": 0,
|
|
635
|
+
"max_bytes": 20000
|
|
636
|
+
}
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
`thehood_git_status`:
|
|
640
|
+
|
|
641
|
+
```json
|
|
642
|
+
{
|
|
643
|
+
"repo_path": "string"
|
|
644
|
+
}
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
`thehood_git_diff`:
|
|
648
|
+
|
|
649
|
+
```json
|
|
650
|
+
{
|
|
651
|
+
"repo_path": "string",
|
|
652
|
+
"path": "optional relative file path",
|
|
653
|
+
"max_bytes": 20000
|
|
654
|
+
}
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
### `thehood_abort`
|
|
658
|
+
|
|
659
|
+
Abort a run.
|
|
660
|
+
|
|
661
|
+
Input:
|
|
662
|
+
|
|
663
|
+
```json
|
|
664
|
+
{
|
|
665
|
+
"run_id": "string",
|
|
666
|
+
"reason": "string"
|
|
667
|
+
}
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
## Tool Design Rules
|
|
671
|
+
|
|
672
|
+
- Tools return run references and compact summaries.
|
|
673
|
+
- Large logs, diffs, and repo context packs are artifacts, not giant inline payloads.
|
|
674
|
+
- Runtime tool responses are compact by default; use `detail: "full"` sparingly and prefer artifact reads for exact evidence.
|
|
675
|
+
- Tool outputs include approval state.
|
|
676
|
+
- MCP tools do not bypass CLI/runtime policies.
|
|
677
|
+
- MCP tools never expose secrets.
|
|
678
|
+
|
|
679
|
+
## Codex Chat Flow
|
|
680
|
+
|
|
681
|
+
Recommended flow inside a Codex chat:
|
|
682
|
+
|
|
683
|
+
1. Call `thehood_doctor` to check available provider adapters and local CLI commands.
|
|
684
|
+
2. Call `thehood_model_access` before Claude/Codex/GPT/Pro consults, fan-outs, or orchestrations that may disclose repo context, progress packets, memory, or runtime artifacts. If the repo is dirty or unpushed, present the user choices from the preflight. If the repo is clean and pushed, use the remote GitHub refs default only when the preflight reports the provider route as confirmed; for `chatgpt-web`, unconfirmed bridge GitHub connector access still requires user choice. If host policy rejects a direct call, present the compact approval packet with `approval_packet.copyable_text_block` as a fenced `text` block, or switch to no-repo-context or connector mode.
|
|
685
|
+
3. Call `thehood_pro_access` before a direct `chatgpt-web` consult when the user asks for Pro from Codex and ChatGPT Web bridge readiness or ChatGPT MCP connector handoff details matter.
|
|
686
|
+
4. Call `thehood_assign_roles` when the user wants persistent role ownership, such as Pro as orchestrator, Claude as critic/verifier, Claude as implementer, or Spark plus Sonnet role separation.
|
|
687
|
+
5. Call `thehood_consult`, `thehood_summon`, or `thehood_fanout` to bring in read-only agents such as a critic, QA tester, or Claude second judge; use `thehood_continue` with `approval: "none"` when no manual approval gate is active so runtime autopilot can auto-approve bounded provider gates when policy allows.
|
|
688
|
+
6. Call `thehood_orchestrate` for implementation runs that require approval and verifier separation.
|
|
689
|
+
7. Call `thehood_continue` with `approval: "approve"`, `approval: "reject"`, or `approval: "revise"` only for an active manual approval gate after the user authorizes that gate.
|