@kolisachint/hoocode-agent 0.5.26 → 0.5.28
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 +51 -0
- 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/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/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/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.
|
package/docs/session-format.md
CHANGED
|
@@ -5,14 +5,14 @@ Sessions are stored as JSONL (JSON Lines) files. Each line is a JSON object with
|
|
|
5
5
|
## File Location
|
|
6
6
|
|
|
7
7
|
```
|
|
8
|
-
~/.hoocode/
|
|
8
|
+
~/.hoocode/sessions/--<path>--/<timestamp>_<uuid>.jsonl
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Where `<path>` is the working directory with `/` replaced by `-`.
|
|
12
12
|
|
|
13
13
|
## Deleting Sessions
|
|
14
14
|
|
|
15
|
-
Sessions can be removed by deleting their `.jsonl` files under `~/.hoocode/
|
|
15
|
+
Sessions can be removed by deleting their `.jsonl` files under `~/.hoocode/sessions/`.
|
|
16
16
|
|
|
17
17
|
HooCode also supports deleting sessions interactively from `/resume` (select a session and press `Ctrl+D`, then confirm). When available, hoocode uses the `trash` CLI to avoid permanent deletion.
|
|
18
18
|
|
|
@@ -28,7 +28,7 @@ Existing sessions are automatically migrated to the current version (v3) when lo
|
|
|
28
28
|
|
|
29
29
|
## Source Files
|
|
30
30
|
|
|
31
|
-
Source on GitHub ([
|
|
31
|
+
Source on GitHub ([hoocode](https://github.com/kolisachint/hoocode)):
|
|
32
32
|
- [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/kolisachint/hoocode/blob/main/packages/coding-agent/src/core/session-manager.ts) - Session entry types and SessionManager
|
|
33
33
|
- [`packages/coding-agent/src/core/messages.ts`](https://github.com/kolisachint/hoocode/blob/main/packages/coding-agent/src/core/messages.ts) - Extended message types (BashExecutionMessage, CustomMessage, etc.)
|
|
34
34
|
- [`packages/ai/src/types.ts`](https://github.com/kolisachint/hoocode/blob/main/packages/ai/src/types.ts) - Base message types (UserMessage, AssistantMessage, ToolResultMessage)
|
package/docs/sessions.md
CHANGED
|
@@ -4,7 +4,7 @@ HooCode saves conversations as sessions so you can continue work, branch from ea
|
|
|
4
4
|
|
|
5
5
|
## Session Storage
|
|
6
6
|
|
|
7
|
-
Sessions auto-save to `~/.hoocode/
|
|
7
|
+
Sessions auto-save to `~/.hoocode/sessions/`, organized by working directory. Each session is a JSONL file with a tree structure.
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
hoocode -c # Continue most recent session
|
package/docs/settings.md
CHANGED
|
@@ -4,7 +4,7 @@ HooCode uses JSON settings files with project settings overriding global setting
|
|
|
4
4
|
|
|
5
5
|
| Location | Scope |
|
|
6
6
|
|----------|-------|
|
|
7
|
-
| `~/.hoocode/
|
|
7
|
+
| `~/.hoocode/settings.json` | Global (all projects) |
|
|
8
8
|
| `.hoocode/settings.json` | Project (current directory) |
|
|
9
9
|
|
|
10
10
|
Edit directly or use `/settings` for common options.
|
|
@@ -244,7 +244,7 @@ window.
|
|
|
244
244
|
|
|
245
245
|
These settings define where to load extensions, skills, prompts, and themes from.
|
|
246
246
|
|
|
247
|
-
Paths in `~/.hoocode/
|
|
247
|
+
Paths in `~/.hoocode/settings.json` resolve relative to `~/.hoocode`. Paths in `.hoocode/settings.json` resolve relative to `.hoocode`. Absolute paths and `~` are supported.
|
|
248
248
|
|
|
249
249
|
| Setting | Type | Default | Description |
|
|
250
250
|
|---------|------|---------|-------------|
|
|
@@ -313,7 +313,7 @@ See [packages.md](packages.md) for package management details.
|
|
|
313
313
|
Project settings (`.hoocode/settings.json`) override global settings. Nested objects are merged:
|
|
314
314
|
|
|
315
315
|
```json
|
|
316
|
-
// ~/.hoocode/
|
|
316
|
+
// ~/.hoocode/settings.json (global)
|
|
317
317
|
{
|
|
318
318
|
"theme": "dark",
|
|
319
319
|
"compaction": { "enabled": true, "reserveTokens": 16384 }
|
package/docs/shell-aliases.md
CHANGED
package/docs/skills.md
CHANGED
|
@@ -24,7 +24,7 @@ HooCode implements the [Agent Skills standard](https://agentskills.io/specificat
|
|
|
24
24
|
HooCode loads skills from:
|
|
25
25
|
|
|
26
26
|
- Global:
|
|
27
|
-
- `~/.hoocode/
|
|
27
|
+
- `~/.hoocode/skills/`
|
|
28
28
|
- `~/.agents/skills/`
|
|
29
29
|
- Project:
|
|
30
30
|
- `.hoocode/skills/`
|
|
@@ -34,7 +34,7 @@ HooCode loads skills from:
|
|
|
34
34
|
- CLI: `--skill <path>` (repeatable, additive even with `--no-skills`)
|
|
35
35
|
|
|
36
36
|
Discovery rules:
|
|
37
|
-
- In `~/.hoocode/
|
|
37
|
+
- In `~/.hoocode/skills/` and `.hoocode/skills/`, direct root `.md` files are discovered as individual skills
|
|
38
38
|
- In all skill locations, directories containing `SKILL.md` are discovered recursively
|
|
39
39
|
- In `~/.agents/skills/` and project `.agents/skills/`, root `.md` files are ignored
|
|
40
40
|
|
package/docs/terminal-setup.md
CHANGED
|
@@ -24,7 +24,7 @@ That mapping sends a raw linefeed byte. Inside hoocode, that is indistinguishabl
|
|
|
24
24
|
|
|
25
25
|
If Claude Code 2.x or newer is the only reason you added that mapping, you can remove it, unless you want to use Claude Code in tmux, where it still requires that Ghostty mapping.
|
|
26
26
|
|
|
27
|
-
If you want `Shift+Enter` to keep working in tmux via that remap, add `ctrl+j` to your hoocode `newLine` keybinding in `~/.hoocode/
|
|
27
|
+
If you want `Shift+Enter` to keep working in tmux via that remap, add `ctrl+j` to your hoocode `newLine` keybinding in `~/.hoocode/keybindings.json`:
|
|
28
28
|
|
|
29
29
|
```json
|
|
30
30
|
{
|
package/docs/termux.md
CHANGED
|
@@ -20,7 +20,7 @@ pkg install nodejs termux-api git
|
|
|
20
20
|
npm install -g @kolisachint/hoocode-agent
|
|
21
21
|
|
|
22
22
|
# Create config directory
|
|
23
|
-
mkdir -p ~/.hoocode
|
|
23
|
+
mkdir -p ~/.hoocode
|
|
24
24
|
|
|
25
25
|
# Run hoocode
|
|
26
26
|
hoocode
|
|
@@ -34,7 +34,7 @@ Image clipboard is not supported on Termux (the `ctrl+v` image paste feature wil
|
|
|
34
34
|
|
|
35
35
|
## Example AGENTS.md for Termux
|
|
36
36
|
|
|
37
|
-
Create `~/.hoocode/
|
|
37
|
+
Create `~/.hoocode/AGENTS.md` to help the agent understand the Termux environment:
|
|
38
38
|
|
|
39
39
|
```markdown
|
|
40
40
|
# Agent Environment: Termux on Android
|
package/docs/themes.md
CHANGED
|
@@ -20,7 +20,7 @@ Themes are JSON files that define colors for the TUI.
|
|
|
20
20
|
HooCode loads themes from:
|
|
21
21
|
|
|
22
22
|
- Built-in: every `*.json` in the shipped theme directory (see [Built-in Themes](#built-in-themes))
|
|
23
|
-
- Global: `~/.hoocode/
|
|
23
|
+
- Global: `~/.hoocode/themes/*.json`
|
|
24
24
|
- Project: `.hoocode/themes/*.json`
|
|
25
25
|
- Packages: `themes/` directories or `pi.themes` entries in `package.json`
|
|
26
26
|
- Settings: `themes` array with files or directories
|
|
@@ -113,8 +113,8 @@ On first run, hoocode detects your terminal background and defaults to `dark` or
|
|
|
113
113
|
1. Create a theme file:
|
|
114
114
|
|
|
115
115
|
```bash
|
|
116
|
-
mkdir -p ~/.hoocode/
|
|
117
|
-
vim ~/.hoocode/
|
|
116
|
+
mkdir -p ~/.hoocode/themes
|
|
117
|
+
vim ~/.hoocode/themes/my-theme.json
|
|
118
118
|
```
|
|
119
119
|
|
|
120
120
|
2. Define the theme with all required colors (see [Color Tokens](#color-tokens)):
|