@kolisachint/hoocode-agent 0.5.25 → 0.5.27
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/CHANGELOG.md +128 -0
- package/dist/core/canvas/lifecycle.d.ts +93 -0
- package/dist/core/canvas/lifecycle.d.ts.map +1 -0
- package/dist/core/canvas/lifecycle.js +165 -0
- package/dist/core/canvas/lifecycle.js.map +1 -0
- package/dist/core/canvas/registry.d.ts +89 -0
- package/dist/core/canvas/registry.d.ts.map +1 -1
- package/dist/core/canvas/registry.js +205 -10
- package/dist/core/canvas/registry.js.map +1 -1
- package/dist/core/canvas/scaffold.d.ts +123 -0
- package/dist/core/canvas/scaffold.d.ts.map +1 -0
- package/dist/core/canvas/scaffold.js +376 -0
- package/dist/core/canvas/scaffold.js.map +1 -0
- package/dist/core/canvas/session.d.ts +39 -1
- package/dist/core/canvas/session.d.ts.map +1 -1
- package/dist/core/canvas/session.js +83 -1
- package/dist/core/canvas/session.js.map +1 -1
- package/dist/core/capabilities/lexical.d.ts +4 -0
- package/dist/core/capabilities/lexical.d.ts.map +1 -1
- package/dist/core/capabilities/lexical.js +104 -4
- package/dist/core/capabilities/lexical.js.map +1 -1
- package/dist/core/capabilities/registry.d.ts +3 -1
- package/dist/core/capabilities/registry.d.ts.map +1 -1
- package/dist/core/capabilities/registry.js.map +1 -1
- package/dist/core/self-docs.d.ts +103 -0
- package/dist/core/self-docs.d.ts.map +1 -0
- package/dist/core/self-docs.js +351 -0
- package/dist/core/self-docs.js.map +1 -0
- package/dist/core/system-prompt.d.ts +12 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +11 -1
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/canvas.d.ts +23 -3
- package/dist/core/tools/canvas.d.ts.map +1 -1
- package/dist/core/tools/canvas.js +99 -4
- package/dist/core/tools/canvas.js.map +1 -1
- package/dist/extensions/core/canvas.d.ts +20 -2
- package/dist/extensions/core/canvas.d.ts.map +1 -1
- package/dist/extensions/core/canvas.js +279 -36
- package/dist/extensions/core/canvas.js.map +1 -1
- package/dist/extensions/core/hoo-core.d.ts +1 -0
- package/dist/extensions/core/hoo-core.d.ts.map +1 -1
- package/dist/extensions/core/hoo-core.js +3 -0
- package/dist/extensions/core/hoo-core.js.map +1 -1
- package/dist/extensions/core/mcp-loader.d.ts.map +1 -1
- package/dist/extensions/core/mcp-loader.js +8 -2
- package/dist/extensions/core/mcp-loader.js.map +1 -1
- package/dist/extensions/core/scaffold.d.ts +7 -1
- package/dist/extensions/core/scaffold.d.ts.map +1 -1
- package/dist/extensions/core/scaffold.js +7 -185
- package/dist/extensions/core/scaffold.js.map +1 -1
- package/dist/extensions/core/self-knowledge.d.ts +28 -0
- package/dist/extensions/core/self-knowledge.d.ts.map +1 -0
- package/dist/extensions/core/self-knowledge.js +199 -0
- package/dist/extensions/core/self-knowledge.js.map +1 -0
- package/docs/canvas.md +117 -0
- package/docs/compaction.md +4 -4
- package/docs/custom-provider.md +1 -1
- package/docs/development.md +1 -1
- package/docs/docs.json +27 -2
- package/docs/extensions.md +12 -12
- package/docs/index.md +8 -0
- package/docs/keybindings.md +2 -2
- package/docs/mcp.md +97 -0
- package/docs/models.md +1 -1
- package/docs/modes.md +87 -0
- package/docs/packages.md +4 -4
- package/docs/plugins.md +124 -0
- package/docs/prompt-templates.md +1 -1
- package/docs/providers.md +2 -2
- package/docs/quickstart.md +2 -2
- package/docs/rpc.md +5 -5
- package/docs/sdk.md +5 -5
- package/docs/session-format.md +3 -3
- package/docs/sessions.md +1 -1
- package/docs/settings.md +3 -3
- package/docs/shell-aliases.md +1 -1
- package/docs/skills.md +2 -2
- package/docs/terminal-setup.md +1 -1
- package/docs/termux.md +2 -2
- package/docs/themes.md +3 -3
- package/docs/usage.md +93 -4
- package/docs/windows.md +1 -1
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +4 -4
package/docs/docs.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"path": "quickstart.md"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
|
-
"title": "Using
|
|
15
|
+
"title": "Using HooCode",
|
|
16
16
|
"path": "usage.md"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
@@ -34,6 +34,31 @@
|
|
|
34
34
|
{
|
|
35
35
|
"title": "Compaction",
|
|
36
36
|
"path": "compaction.md"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"title": "Modes",
|
|
40
|
+
"path": "modes.md"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"title": "Extending hoocode",
|
|
46
|
+
"items": [
|
|
47
|
+
{
|
|
48
|
+
"title": "MCP",
|
|
49
|
+
"path": "mcp.md"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"title": "Plugins",
|
|
53
|
+
"path": "plugins.md"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"title": "Canvas",
|
|
57
|
+
"path": "canvas.md"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"title": "Subagent delegation",
|
|
61
|
+
"path": "routing.md"
|
|
37
62
|
}
|
|
38
63
|
]
|
|
39
64
|
},
|
|
@@ -57,7 +82,7 @@
|
|
|
57
82
|
"path": "themes.md"
|
|
58
83
|
},
|
|
59
84
|
{
|
|
60
|
-
"title": "
|
|
85
|
+
"title": "HooCode Packages",
|
|
61
86
|
"path": "packages.md"
|
|
62
87
|
},
|
|
63
88
|
{
|
package/docs/extensions.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Extensions are TypeScript modules that extend hoocode's behavior. They can subscribe to lifecycle events, register custom tools callable by the LLM, add commands, and more.
|
|
6
6
|
|
|
7
|
-
> **Placement for /reload:** Put extensions in `~/.hoocode/
|
|
7
|
+
> **Placement for /reload:** Put extensions in `~/.hoocode/extensions/` (global) or `.hoocode/extensions/` (project-local) for auto-discovery. Use `hoocode -e ./path.ts` only for quick tests. Extensions in auto-discovered locations can be hot-reloaded with `/reload`.
|
|
8
8
|
|
|
9
9
|
**Key capabilities:**
|
|
10
10
|
- **Custom tools** - Register tools the LLM can call via `pi.registerTool()`
|
|
@@ -54,7 +54,7 @@ See [examples/extensions/](../examples/extensions/) for working implementations.
|
|
|
54
54
|
|
|
55
55
|
## Quick Start
|
|
56
56
|
|
|
57
|
-
Create `~/.
|
|
57
|
+
Create `~/.hoocode/extensions/my-extension.ts`:
|
|
58
58
|
|
|
59
59
|
```typescript
|
|
60
60
|
import type { ExtensionAPI } from "@kolisachint/hoocode-agent";
|
|
@@ -113,10 +113,10 @@ Extensions are auto-discovered from:
|
|
|
113
113
|
|
|
114
114
|
| Location | Scope |
|
|
115
115
|
|----------|-------|
|
|
116
|
-
| `~/.
|
|
117
|
-
| `~/.
|
|
118
|
-
| `.
|
|
119
|
-
| `.
|
|
116
|
+
| `~/.hoocode/extensions/*.ts` | Global (all projects) |
|
|
117
|
+
| `~/.hoocode/extensions/*/index.ts` | Global (subdirectory) |
|
|
118
|
+
| `.hoocode/extensions/*.ts` | Project-local |
|
|
119
|
+
| `.hoocode/extensions/*/index.ts` | Project-local (subdirectory) |
|
|
120
120
|
|
|
121
121
|
Additional paths via `settings.json`:
|
|
122
122
|
|
|
@@ -221,14 +221,14 @@ This pattern makes the fetched models available during normal startup and to `ho
|
|
|
221
221
|
**Single file** - simplest, for small extensions:
|
|
222
222
|
|
|
223
223
|
```
|
|
224
|
-
~/.
|
|
224
|
+
~/.hoocode/extensions/
|
|
225
225
|
└── my-extension.ts
|
|
226
226
|
```
|
|
227
227
|
|
|
228
228
|
**Directory with index.ts** - for multi-file extensions:
|
|
229
229
|
|
|
230
230
|
```
|
|
231
|
-
~/.
|
|
231
|
+
~/.hoocode/extensions/
|
|
232
232
|
└── my-extension/
|
|
233
233
|
├── index.ts # Entry point (exports default function)
|
|
234
234
|
├── tools.ts # Helper module
|
|
@@ -238,7 +238,7 @@ This pattern makes the fetched models available during normal startup and to `ho
|
|
|
238
238
|
**Package with dependencies** - for extensions that need npm packages:
|
|
239
239
|
|
|
240
240
|
```
|
|
241
|
-
~/.
|
|
241
|
+
~/.hoocode/extensions/
|
|
242
242
|
└── my-extension/
|
|
243
243
|
├── package.json # Declares dependencies and entry points
|
|
244
244
|
├── package-lock.json
|
|
@@ -496,7 +496,7 @@ pi.on("before_agent_start", async (event, ctx) => {
|
|
|
496
496
|
});
|
|
497
497
|
```
|
|
498
498
|
|
|
499
|
-
The `systemPromptOptions` field gives extensions access to the same structured data
|
|
499
|
+
The `systemPromptOptions` field gives extensions access to the same structured data HooCode uses to build the system prompt. This lets you inspect what HooCode has loaded — custom prompts, guidelines, tool snippets, context files, skills — without re-discovering resources or re-parsing flags. Use it when your extension needs to make deep, informed changes to the system prompt while respecting user-provided configuration.
|
|
500
500
|
|
|
501
501
|
Inside `before_agent_start`, `event.systemPrompt` and `ctx.getSystemPrompt()` both reflect the chained system prompt as of the current handler. Later `before_agent_start` handlers can still modify it again.
|
|
502
502
|
|
|
@@ -602,7 +602,7 @@ pi.on("context", async (event, ctx) => {
|
|
|
602
602
|
|
|
603
603
|
Fired after the provider-specific payload is built, right before the request is sent. Handlers run in extension load order. Returning `undefined` keeps the payload unchanged. Returning any other value replaces the payload for later handlers and for the actual request.
|
|
604
604
|
|
|
605
|
-
This hook can rewrite provider-level system instructions or remove them entirely. Those payload-level changes are not reflected by `ctx.getSystemPrompt()`, which reports
|
|
605
|
+
This hook can rewrite provider-level system instructions or remove them entirely. Those payload-level changes are not reflected by `ctx.getSystemPrompt()`, which reports HooCode's system prompt string rather than the final serialized provider payload.
|
|
606
606
|
|
|
607
607
|
```typescript
|
|
608
608
|
pi.on("before_provider_request", (event, ctx) => {
|
|
@@ -957,7 +957,7 @@ ctx.compact({
|
|
|
957
957
|
|
|
958
958
|
### ctx.getSystemPrompt()
|
|
959
959
|
|
|
960
|
-
Returns
|
|
960
|
+
Returns HooCode's current system prompt string.
|
|
961
961
|
|
|
962
962
|
- During `before_agent_start`, this reflects chained system-prompt changes made so far for the current turn.
|
|
963
963
|
- It does not include later `context` message mutations.
|
package/docs/index.md
CHANGED
|
@@ -35,6 +35,14 @@ For the full first-run flow, see [Quickstart](quickstart.md).
|
|
|
35
35
|
- [Keybindings](keybindings.md) - default shortcuts and custom keybindings.
|
|
36
36
|
- [Sessions](sessions.md) - session management, branching, and tree navigation.
|
|
37
37
|
- [Compaction](compaction.md) - context compaction and branch summarization.
|
|
38
|
+
- [Modes](modes.md) - ask, plan, build, and debug, and the planning workflow.
|
|
39
|
+
|
|
40
|
+
## Extending hoocode
|
|
41
|
+
|
|
42
|
+
- [MCP](mcp.md) - connect Model Context Protocol servers and their tools.
|
|
43
|
+
- [Plugins](plugins.md) - install capabilities from marketplaces, and the trust model.
|
|
44
|
+
- [Canvas](canvas.md) - interactive surfaces the agent can drive.
|
|
45
|
+
- [Subagent delegation](routing.md) - hand focused work to a separate agent.
|
|
38
46
|
|
|
39
47
|
## Customization
|
|
40
48
|
|
package/docs/keybindings.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Keybindings
|
|
2
2
|
|
|
3
|
-
All keyboard shortcuts can be customized via `~/.hoocode/
|
|
3
|
+
All keyboard shortcuts can be customized via `~/.hoocode/keybindings.json`. Each action can be bound to one or more keys.
|
|
4
4
|
|
|
5
5
|
The config file uses the same namespaced keybinding ids that hoocode uses internally and that extension authors use in `keyHint()` and injected `keybindings` managers.
|
|
6
6
|
|
|
@@ -153,7 +153,7 @@ Used inside the scoped models selector (opened via `/scoped-models`).
|
|
|
153
153
|
|
|
154
154
|
## Custom Configuration
|
|
155
155
|
|
|
156
|
-
Create `~/.hoocode/
|
|
156
|
+
Create `~/.hoocode/keybindings.json`:
|
|
157
157
|
|
|
158
158
|
```json
|
|
159
159
|
{
|
package/docs/mcp.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# MCP servers
|
|
2
|
+
|
|
3
|
+
hoocode speaks the Model Context Protocol, so tools from an MCP server appear
|
|
4
|
+
alongside the built-in ones. Each server tool is registered as
|
|
5
|
+
`mcp_<server>_<tool>` — a `create_pr` tool on a server named `github` becomes
|
|
6
|
+
`mcp_github_create_pr`.
|
|
7
|
+
|
|
8
|
+
## Configuring servers
|
|
9
|
+
|
|
10
|
+
Config files are read in this order, **first wins by server name**:
|
|
11
|
+
|
|
12
|
+
1. `~/.agents/mcp.json` — user, standard format
|
|
13
|
+
2. `./.agents/mcp.json` — project, standard format
|
|
14
|
+
3. `~/.config/claude/mcp.json` — Claude Desktop, standard format
|
|
15
|
+
4. `~/.hoocode/mcp-servers/*.json` — user, one file per server
|
|
16
|
+
5. `./.hoocode/mcp-servers/*.json` — project, one file per server
|
|
17
|
+
|
|
18
|
+
Plugins can also declare servers in their manifest or a `.mcp.json` — see
|
|
19
|
+
[Plugins](plugins.md).
|
|
20
|
+
|
|
21
|
+
Standard format:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mcpServers": {
|
|
26
|
+
"my-server": {
|
|
27
|
+
"command": "npx",
|
|
28
|
+
"args": ["-y", "my-mcp-server"],
|
|
29
|
+
"env": { "API_KEY": "..." }
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Per-server format (`.hoocode/mcp-servers/<name>.json`) uses a top-level `name`
|
|
36
|
+
and `command` instead of the `mcpServers` wrapper.
|
|
37
|
+
|
|
38
|
+
## Transports
|
|
39
|
+
|
|
40
|
+
| Transport | Config | Notes |
|
|
41
|
+
|-----------|--------|-------|
|
|
42
|
+
| stdio | `"command"` (+ `args`, `env`) | Default when `command` is set |
|
|
43
|
+
| Streamable HTTP | `{ "type": "http", "url": "..." }` | Add `headers` for auth |
|
|
44
|
+
| SSE | `{ "type": "sse", "url": "..." }` | Legacy |
|
|
45
|
+
|
|
46
|
+
One of `command` or `url` is required. Remote transports support OAuth; hoocode
|
|
47
|
+
stores the tokens and runs the authorization callback for you when a server
|
|
48
|
+
requires it.
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"mcpServers": {
|
|
53
|
+
"remote": {
|
|
54
|
+
"type": "http",
|
|
55
|
+
"url": "https://example.com/mcp",
|
|
56
|
+
"headers": { "Authorization": "Bearer ..." }
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Deferred schemas
|
|
63
|
+
|
|
64
|
+
A dozen MCP servers can contribute hundreds of tools, and their JSON schemas are
|
|
65
|
+
the largest thing in a system prompt that is otherwise a few thousand tokens. So
|
|
66
|
+
by default hoocode connects every server but **withholds the schemas**,
|
|
67
|
+
registering one resolver tool instead:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
ResolveMcpTools names: ["mcp_github_create_pr"]
|
|
71
|
+
ResolveMcpTools query: "open a pull request"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Naming a tool resolves it; describing a capability finds it and resolves it, so
|
|
75
|
+
the model does not have to know the name in advance. Resolved tools become
|
|
76
|
+
callable in the same turn.
|
|
77
|
+
|
|
78
|
+
Retrieval is hybrid — BM25 over tool names and descriptions, fused with a dense
|
|
79
|
+
leg when the `embsearch` binary is present. The lexical leg always works and
|
|
80
|
+
never needs a download, so an exact name match is guaranteed; the dense leg only
|
|
81
|
+
adds. When only the lexical leg answered, the result says so.
|
|
82
|
+
|
|
83
|
+
Turn deferral off with the `deferMcpSchemas` setting (default `true`) to load
|
|
84
|
+
every schema eagerly. Subagent children never defer — they are spawned with a
|
|
85
|
+
narrow tool allowlist already.
|
|
86
|
+
|
|
87
|
+
## Checking status
|
|
88
|
+
|
|
89
|
+
Connection happens at session start. A server that fails to connect reports an
|
|
90
|
+
error notification and the session continues without it, rather than failing to
|
|
91
|
+
start.
|
|
92
|
+
|
|
93
|
+
## Related
|
|
94
|
+
|
|
95
|
+
- [Settings](settings.md) — `deferMcpSchemas` and tool policy
|
|
96
|
+
- [Plugins](plugins.md) — plugins that ship MCP servers, and the trust rule that governs them
|
|
97
|
+
- [Project-local resources](project-local-resources.md) — the full `.agents/` discovery table
|
package/docs/models.md
CHANGED
package/docs/modes.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Modes
|
|
2
|
+
|
|
3
|
+
A mode swaps the system prompt hoocode runs under, so the same session can be
|
|
4
|
+
steered between answering questions, designing a change, and making it. Modes
|
|
5
|
+
change *instructions*, not permissions: the tool policy in
|
|
6
|
+
[Settings](settings.md) is what actually blocks a write. A read-only mode tells
|
|
7
|
+
the model not to edit; it does not stop a tool call on its own.
|
|
8
|
+
|
|
9
|
+
The active mode is `build` unless configured otherwise.
|
|
10
|
+
|
|
11
|
+
## Switching
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
/mode ask # read-only Q&A
|
|
15
|
+
/mode plan # explore and design, no source edits
|
|
16
|
+
/mode build # careful implementation (default)
|
|
17
|
+
/mode debug # root-cause analysis, no file modifications
|
|
18
|
+
/plan # shorthand for /mode plan
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The active mode persists in `hoo-config.json` under `active_mode`. Switching
|
|
22
|
+
back to `build` clears the key rather than writing the default.
|
|
23
|
+
|
|
24
|
+
## The four built-in modes
|
|
25
|
+
|
|
26
|
+
| Mode | For | Tells the model to |
|
|
27
|
+
|------|-----|--------------------|
|
|
28
|
+
| `ask` | Questions about a codebase | Read, grep, trace, and explain, citing paths and line numbers; decline edits and suggest `/mode build` |
|
|
29
|
+
| `plan` | Designing a change before making it | Explore, ask clarifying questions, then write a plan with Goal / Files to modify / New files / Tests / Verification |
|
|
30
|
+
| `build` | Implementing | One tool per turn, read before editing, show diffs, confirm destructive operations, run tests after each unit of work |
|
|
31
|
+
| `debug` | Finding a root cause | Gather evidence, reproduce, trace the call path, state the root cause in one sentence, describe the fix without applying it |
|
|
32
|
+
|
|
33
|
+
## The planning workflow
|
|
34
|
+
|
|
35
|
+
Plan mode writes to `.hoocode/plans/<session-id>.md`. Each session gets its own
|
|
36
|
+
plan file, so two sessions in one project do not overwrite each other.
|
|
37
|
+
(`.hoocode/plan.md`, the older single-file location, is still read as a
|
|
38
|
+
fallback.)
|
|
39
|
+
|
|
40
|
+
Once a plan exists:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
/grill [me|plan] # stress-test it before committing to it
|
|
44
|
+
/approve # accept it and switch to build mode to execute
|
|
45
|
+
/goal [--max-turns N] [objective]
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`/approve` switches to `build`. `/goal` runs autonomously toward an objective —
|
|
49
|
+
if you do not type one, it takes the plan's **Goal** section, and the plan's
|
|
50
|
+
**Verification** section becomes the completion condition either way. Cap the
|
|
51
|
+
run with `--max-turns`.
|
|
52
|
+
|
|
53
|
+
`/grill` is worth the round trip when a plan carries real risk; it argues
|
|
54
|
+
against the plan rather than refining it.
|
|
55
|
+
|
|
56
|
+
## Custom modes
|
|
57
|
+
|
|
58
|
+
A mode is a directory containing `system.md`. hoocode resolves a mode name
|
|
59
|
+
against these locations, first match winning:
|
|
60
|
+
|
|
61
|
+
1. `./.hoocode/modes/<name>/system.md` (project)
|
|
62
|
+
2. `~/.hoocode/modes/<name>/system.md` (user)
|
|
63
|
+
3. Directories passed with `--mode-path`
|
|
64
|
+
4. The built-in prompt, for the four names above
|
|
65
|
+
|
|
66
|
+
So `./.hoocode/modes/build/system.md` overrides the shipped build prompt for one
|
|
67
|
+
project, and `./.hoocode/modes/review/system.md` adds a `review` mode that
|
|
68
|
+
`/mode review` will find.
|
|
69
|
+
|
|
70
|
+
In a plan-mode template, `{{PLAN_PATH}}` is substituted with the session's plan
|
|
71
|
+
file path, relative to the working directory.
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
.hoocode/
|
|
75
|
+
└── modes/
|
|
76
|
+
└── review/
|
|
77
|
+
└── system.md
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Start one with `hoocode --mode review`, or switch mid-session with
|
|
81
|
+
`/mode review`.
|
|
82
|
+
|
|
83
|
+
## Related
|
|
84
|
+
|
|
85
|
+
- [Settings](settings.md) — tool policy, which is what actually restricts writes
|
|
86
|
+
- [Prompt templates](prompt-templates.md) — reusable prompts, as opposed to a persistent stance
|
|
87
|
+
- [Subagent delegation](routing.md) — handing focused work to a separate agent
|
package/docs/packages.md
CHANGED
|
@@ -36,7 +36,7 @@ hoocode update npm:@foo/bar # update one package
|
|
|
36
36
|
hoocode update --extension npm:@foo/bar
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
By default, `install` and `remove` write to global settings (`~/.hoocode/
|
|
39
|
+
By default, `install` and `remove` write to global settings (`~/.hoocode/settings.json`). Use `-l` to write to project settings (`.hoocode/settings.json`) instead. Project settings can be shared with your team, and hoocode installs any missing packages automatically on startup.
|
|
40
40
|
|
|
41
41
|
To try a package without installing it, use `--extension` or `-e`. This installs to a temporary directory for the current run only:
|
|
42
42
|
|
|
@@ -84,7 +84,7 @@ ssh://git@github.com/user/repo@v1
|
|
|
84
84
|
- SSH URLs use your configured SSH keys automatically (respects `~/.ssh/config`).
|
|
85
85
|
- For non-interactive runs (for example CI), you can set `GIT_TERMINAL_PROMPT=0` to disable credential prompts and set `GIT_SSH_COMMAND` (for example `ssh -o BatchMode=yes -o ConnectTimeout=5`) to fail fast.
|
|
86
86
|
- Refs pin the package and skip package updates (`hoocode update`, `hoocode update --extensions`).
|
|
87
|
-
- Cloned to `~/.hoocode/
|
|
87
|
+
- Cloned to `~/.hoocode/git/<host>/<path>` (global) or `.hoocode/git/<host>/<path>` (project).
|
|
88
88
|
- Runs `npm install` after clone or pull if `package.json` exists.
|
|
89
89
|
|
|
90
90
|
**SSH examples:**
|
|
@@ -163,7 +163,7 @@ If no `pi` manifest is present, hoocode auto-discovers resources from these dire
|
|
|
163
163
|
|
|
164
164
|
Third party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, or themes also belong in `dependencies`. When hoocode installs a package from npm or git, it runs `npm install`, so those dependencies are installed automatically.
|
|
165
165
|
|
|
166
|
-
|
|
166
|
+
HooCode bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `@kolisachint/hoocode-ai`, `@kolisachint/hoocode-agent-core`, `@kolisachint/hoocode-agent`, `@kolisachint/hoocode-tui`, `typebox`.
|
|
167
167
|
|
|
168
168
|
Other hoocode packages must be bundled in your tarball. Add them to `dependencies` and `bundledDependencies`, then reference their resources through `node_modules/` paths. HooCode loads packages with separate module roots, so separate installs do not collide or share modules.
|
|
169
169
|
|
|
@@ -212,7 +212,7 @@ Filter what a package loads using the object form in settings:
|
|
|
212
212
|
|
|
213
213
|
## Enable and Disable Resources
|
|
214
214
|
|
|
215
|
-
Use `hoocode config` to enable or disable extensions, skills, prompt templates, and themes from installed packages and local directories. Works for both global (`~/.hoocode
|
|
215
|
+
Use `hoocode config` to enable or disable extensions, skills, prompt templates, and themes from installed packages and local directories. Works for both global (`~/.hoocode`) and project (`.hoocode/`) scopes.
|
|
216
216
|
|
|
217
217
|
## Scope and Deduplication
|
|
218
218
|
|
package/docs/plugins.md
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Plugins
|
|
2
|
+
|
|
3
|
+
A plugin is a directory that bundles capabilities — skills, slash commands,
|
|
4
|
+
subagents, hooks, MCP servers, themes, and canvas extensions — behind one
|
|
5
|
+
installable name. Plugins come from marketplaces, which are git repositories or
|
|
6
|
+
local directories that index them.
|
|
7
|
+
|
|
8
|
+
Plugins overlap with [hoocode packages](packages.md); the difference is where
|
|
9
|
+
they come from and who installs them. A package is an npm or git dependency you
|
|
10
|
+
list in settings. A plugin is installed by name from a marketplace, can be
|
|
11
|
+
installed by the model mid-task, and is portable across agent tools —
|
|
12
|
+
hoocode reads the Claude Code and GitHub Copilot plugin formats as well as its
|
|
13
|
+
own.
|
|
14
|
+
|
|
15
|
+
## Using plugins
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
/plugin marketplace add <git-url|path> # register a marketplace (a human act)
|
|
19
|
+
/plugin marketplace list # what is registered
|
|
20
|
+
/plugin marketplace refresh # re-fetch marketplace indices
|
|
21
|
+
/plugin list # what is installed
|
|
22
|
+
/plugin install <name> [--scope user|project]
|
|
23
|
+
/plugin remove <name>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`--scope user` (the default) installs under your agent dir, for every project.
|
|
27
|
+
`--scope project` installs into the current repository, where it travels with
|
|
28
|
+
the clone.
|
|
29
|
+
|
|
30
|
+
## Trust
|
|
31
|
+
|
|
32
|
+
Two different decisions, deliberately kept apart:
|
|
33
|
+
|
|
34
|
+
**Adding a marketplace is a human act.** It says you accept code from that
|
|
35
|
+
source. Nothing installs a marketplace for you.
|
|
36
|
+
|
|
37
|
+
**Installing from a marketplace you already added is the model's discretion** —
|
|
38
|
+
the package-manager model. hoocode announces what it installed and the install
|
|
39
|
+
is reversible with `/plugin remove`.
|
|
40
|
+
|
|
41
|
+
Separately, a plugin committed to a repository is code that runs for whoever
|
|
42
|
+
clones it next. Its skills and commands are only text the model reads, no worse
|
|
43
|
+
than reading the repository itself, but **its hooks and MCP servers are
|
|
44
|
+
processes that start when the session loads**. So hoocode keeps a per-machine
|
|
45
|
+
record of which working directories you have agreed to run repository-supplied
|
|
46
|
+
plugin code from:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
/plugin trust [list] # inspect, or grant trust for this workspace
|
|
50
|
+
/plugin untrust # revoke it
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The record lives in your agent dir, keyed by absolute path — outside the
|
|
54
|
+
repository, so repository content cannot forge it. Until a workspace is trusted,
|
|
55
|
+
a repo-supplied plugin loads with its hooks and MCP servers held back; hoocode
|
|
56
|
+
reports this as a warning at startup rather than failing the session.
|
|
57
|
+
|
|
58
|
+
Granting trust is always a human act. The autonomous install path never grants
|
|
59
|
+
it. As with VS Code's trusted folders, trust is a statement about a place you
|
|
60
|
+
work, not about a specific commit — code pulled into a trusted directory later
|
|
61
|
+
is trusted too.
|
|
62
|
+
|
|
63
|
+
## What a plugin can contain
|
|
64
|
+
|
|
65
|
+
A directory is recognized as a plugin if it has a `plugin.json` manifest or any
|
|
66
|
+
of these:
|
|
67
|
+
|
|
68
|
+
| Path | Provides |
|
|
69
|
+
|------|----------|
|
|
70
|
+
| `skills/` | Agent Skills ([Skills](skills.md)) |
|
|
71
|
+
| `commands/` | Slash commands |
|
|
72
|
+
| `agents/` | Subagent definitions ([Subagent delegation](routing.md)) |
|
|
73
|
+
| `hooks/`, `hooks/hooks.json` | Lifecycle hooks |
|
|
74
|
+
| `.mcp.json` | MCP servers ([MCP](mcp.md)) |
|
|
75
|
+
| `SKILL.md` | A single-skill plugin |
|
|
76
|
+
|
|
77
|
+
Read from the manifest but not sufficient on their own to mark a directory as a
|
|
78
|
+
plugin: `themes/` and `extensions/` (canvas extensions — see [Canvas](canvas.md)).
|
|
79
|
+
|
|
80
|
+
## Formats
|
|
81
|
+
|
|
82
|
+
hoocode reads three on-disk layouts, so a plugin written for another agent tool
|
|
83
|
+
generally works unchanged:
|
|
84
|
+
|
|
85
|
+
| Format | Marker | Notes |
|
|
86
|
+
|--------|--------|-------|
|
|
87
|
+
| hoocode (native) | `plugin.json` | The only format with `providers` |
|
|
88
|
+
| Claude Code | `.claude-plugin/` | Same component layout, no `providers` |
|
|
89
|
+
| GitHub Copilot | `.github/plugin/` | Also read from the plugin root, `.plugin/`, and `.claude-plugin/`; written to `.github/plugin/` |
|
|
90
|
+
|
|
91
|
+
## Authoring
|
|
92
|
+
|
|
93
|
+
Scaffold the pieces:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
/new-skill <name>
|
|
97
|
+
/new-agent <name>
|
|
98
|
+
/new-command <name>
|
|
99
|
+
/new-canvas <name>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Then package for distribution:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
/plugin publish <name> [--to <dir>]
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Model-facing tools
|
|
109
|
+
|
|
110
|
+
When plugin tooling is enabled (`--enable-plugintools`, or the
|
|
111
|
+
`enablePluginTools` setting), the model gets its own lifecycle tools rather than
|
|
112
|
+
going through the slash command: `SearchPlugins`, `ListPlugins`,
|
|
113
|
+
`SuggestPluginInstall`, `InstallPlugin`, `UninstallPlugin`, `UpdatePlugin`,
|
|
114
|
+
`ProposePlugin`, `RemovePluginCapability`, and `PackagePlugin`.
|
|
115
|
+
|
|
116
|
+
`SearchPlugins` matches on capability, not just name — a plugin described as
|
|
117
|
+
"compose and send mail" is findable by a search for "email" — so the model can
|
|
118
|
+
close a capability gap mid-task instead of hand-rolling a solution.
|
|
119
|
+
|
|
120
|
+
## Related
|
|
121
|
+
|
|
122
|
+
- [HooCode packages](packages.md) — npm/git-distributed bundles you list in settings
|
|
123
|
+
- [Skills](skills.md), [Extensions](extensions.md), [MCP](mcp.md), [Canvas](canvas.md)
|
|
124
|
+
- [Project-local resources](project-local-resources.md) — the `.agents/` conventions plugins build on
|
package/docs/prompt-templates.md
CHANGED
|
@@ -8,7 +8,7 @@ Prompt templates are Markdown snippets that expand into full prompts. Type `/nam
|
|
|
8
8
|
|
|
9
9
|
HooCode loads prompt templates from:
|
|
10
10
|
|
|
11
|
-
- Global: `~/.hoocode/
|
|
11
|
+
- Global: `~/.hoocode/prompts/*.md`
|
|
12
12
|
- Project: `.hoocode/prompts/*.md`
|
|
13
13
|
- Packages: `prompts/` directories or `pi.prompts` entries in `package.json`
|
|
14
14
|
- Settings: `prompts` array with files or directories
|
package/docs/providers.md
CHANGED
|
@@ -20,7 +20,7 @@ Use `/login` in interactive mode, then select a provider:
|
|
|
20
20
|
- Claude Pro/Max
|
|
21
21
|
- GitHub Copilot
|
|
22
22
|
|
|
23
|
-
Use `/logout` to clear credentials. Tokens are stored in `~/.hoocode/
|
|
23
|
+
Use `/logout` to clear credentials. Tokens are stored in `~/.hoocode/auth.json` and auto-refresh when expired.
|
|
24
24
|
|
|
25
25
|
### OpenAI Codex
|
|
26
26
|
|
|
@@ -49,7 +49,7 @@ hoocode
|
|
|
49
49
|
|
|
50
50
|
### Auth File
|
|
51
51
|
|
|
52
|
-
Store credentials in `~/.hoocode/
|
|
52
|
+
Store credentials in `~/.hoocode/auth.json`:
|
|
53
53
|
|
|
54
54
|
```json
|
|
55
55
|
{
|
package/docs/quickstart.md
CHANGED
|
@@ -40,7 +40,7 @@ export ANTHROPIC_API_KEY=sk-ant-...
|
|
|
40
40
|
hoocode
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
You can also run `/login` and select an API-key provider to store the key in `~/.hoocode/
|
|
43
|
+
You can also run `/login` and select an API-key provider to store the key in `~/.hoocode/auth.json`.
|
|
44
44
|
|
|
45
45
|
See [Providers](providers.md) for all supported providers, environment variables, and cloud-provider setup.
|
|
46
46
|
|
|
@@ -75,7 +75,7 @@ HooCode loads context files at startup. Add an `AGENTS.md` file to tell it how t
|
|
|
75
75
|
|
|
76
76
|
HooCode loads:
|
|
77
77
|
|
|
78
|
-
- `~/.hoocode/
|
|
78
|
+
- `~/.hoocode/AGENTS.md` for global instructions
|
|
79
79
|
- `AGENTS.md` or `CLAUDE.md` from parent directories and the current directory
|
|
80
80
|
|
|
81
81
|
Restart hoocode, or run `/reload`, after changing context files.
|
package/docs/rpc.md
CHANGED
|
@@ -714,9 +714,9 @@ Response:
|
|
|
714
714
|
"success": true,
|
|
715
715
|
"data": {
|
|
716
716
|
"commands": [
|
|
717
|
-
{"name": "session-name", "description": "Set or clear session name", "source": "extension", "path": "/home/user/.hoocode/
|
|
718
|
-
{"name": "fix-tests", "description": "Fix failing tests", "source": "prompt", "location": "project", "path": "/home/user/myproject/.hoocode/
|
|
719
|
-
{"name": "skill:brave-search", "description": "Web search via Brave API", "source": "skill", "location": "user", "path": "/home/user/.hoocode/
|
|
717
|
+
{"name": "session-name", "description": "Set or clear session name", "source": "extension", "path": "/home/user/.hoocode/extensions/session.ts"},
|
|
718
|
+
{"name": "fix-tests", "description": "Fix failing tests", "source": "prompt", "location": "project", "path": "/home/user/myproject/.hoocode/prompts/fix-tests.md"},
|
|
719
|
+
{"name": "skill:brave-search", "description": "Web search via Brave API", "source": "skill", "location": "user", "path": "/home/user/.hoocode/skills/brave-search/SKILL.md"}
|
|
720
720
|
]
|
|
721
721
|
}
|
|
722
722
|
}
|
|
@@ -730,8 +730,8 @@ Each command has:
|
|
|
730
730
|
- `"prompt"`: Loaded from a prompt template `.md` file
|
|
731
731
|
- `"skill"`: Loaded from a skill directory (name is prefixed with `skill:`)
|
|
732
732
|
- `location`: Where it was loaded from (optional, not present for extensions):
|
|
733
|
-
- `"user"`: User-level (`~/.hoocode
|
|
734
|
-
- `"project"`: Project-level (`./.hoocode
|
|
733
|
+
- `"user"`: User-level (`~/.hoocode/`)
|
|
734
|
+
- `"project"`: Project-level (`./.hoocode/`)
|
|
735
735
|
- `"path"`: Explicit path via CLI or settings
|
|
736
736
|
- `path`: Absolute file path to the command source (optional)
|
|
737
737
|
|
package/docs/sdk.md
CHANGED
|
@@ -338,7 +338,7 @@ const { session } = await createAgentSession({
|
|
|
338
338
|
cwd: process.cwd(), // default
|
|
339
339
|
|
|
340
340
|
// Global config directory
|
|
341
|
-
agentDir: "~/.hoocode
|
|
341
|
+
agentDir: "~/.hoocode", // default (expands ~)
|
|
342
342
|
});
|
|
343
343
|
```
|
|
344
344
|
|
|
@@ -354,7 +354,7 @@ const { session } = await createAgentSession({
|
|
|
354
354
|
`agentDir` is used by `DefaultResourceLoader` for:
|
|
355
355
|
- Global extensions (`extensions/`)
|
|
356
356
|
- Global skills:
|
|
357
|
-
- `skills/` under `agentDir` (for example `~/.hoocode/
|
|
357
|
+
- `skills/` under `agentDir` (for example `~/.hoocode/skills/`)
|
|
358
358
|
- `~/.agents/skills/`
|
|
359
359
|
- Global prompts (`prompts/`)
|
|
360
360
|
- Global context file (`AGENTS.md`)
|
|
@@ -418,7 +418,7 @@ API key resolution priority (handled by AuthStorage):
|
|
|
418
418
|
```typescript
|
|
419
419
|
import { AuthStorage, ModelRegistry } from "@kolisachint/hoocode-agent";
|
|
420
420
|
|
|
421
|
-
// Default: uses ~/.hoocode/
|
|
421
|
+
// Default: uses ~/.hoocode/auth.json and ~/.hoocode/models.json
|
|
422
422
|
const authStorage = AuthStorage.create();
|
|
423
423
|
const modelRegistry = ModelRegistry.create(authStorage);
|
|
424
424
|
|
|
@@ -560,7 +560,7 @@ Custom tools passed via `customTools` are combined with extension-registered too
|
|
|
560
560
|
|
|
561
561
|
### Extensions
|
|
562
562
|
|
|
563
|
-
Extensions are loaded by the `ResourceLoader`. `DefaultResourceLoader` discovers extensions from `~/.hoocode/
|
|
563
|
+
Extensions are loaded by the `ResourceLoader`. `DefaultResourceLoader` discovers extensions from `~/.hoocode/extensions/`, `.hoocode/extensions/`, and settings.json extension sources.
|
|
564
564
|
|
|
565
565
|
```typescript
|
|
566
566
|
import { createAgentSession, DefaultResourceLoader } from "@kolisachint/hoocode-agent";
|
|
@@ -818,7 +818,7 @@ const { session } = await createAgentSession({
|
|
|
818
818
|
**Project-specific settings:**
|
|
819
819
|
|
|
820
820
|
Settings load from two locations and merge:
|
|
821
|
-
1. Global: `~/.hoocode/
|
|
821
|
+
1. Global: `~/.hoocode/settings.json`
|
|
822
822
|
2. Project: `<cwd>/.hoocode/settings.json`
|
|
823
823
|
|
|
824
824
|
Project overrides global. Nested objects merge keys. Setters modify global settings by default.
|