@kolisachint/hoocode-agent 0.2.0 → 0.2.1

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.
Files changed (122) hide show
  1. package/dist/cli/args.d.ts.map +1 -1
  2. package/dist/cli/args.js +1 -1
  3. package/dist/cli/args.js.map +1 -1
  4. package/dist/config.d.ts +6 -0
  5. package/dist/config.d.ts.map +1 -1
  6. package/dist/config.js +8 -0
  7. package/dist/config.js.map +1 -1
  8. package/dist/core/agent-session.d.ts.map +1 -1
  9. package/dist/core/agent-session.js +1 -1
  10. package/dist/core/agent-session.js.map +1 -1
  11. package/dist/core/auth-storage.d.ts +1 -1
  12. package/dist/core/auth-storage.d.ts.map +1 -1
  13. package/dist/core/auth-storage.js +1 -1
  14. package/dist/core/auth-storage.js.map +1 -1
  15. package/dist/core/bash-executor.d.ts.map +1 -1
  16. package/dist/core/bash-executor.js +1 -1
  17. package/dist/core/bash-executor.js.map +1 -1
  18. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  19. package/dist/core/compaction/branch-summarization.js +1 -1
  20. package/dist/core/compaction/branch-summarization.js.map +1 -1
  21. package/dist/core/compaction/compaction.d.ts.map +1 -1
  22. package/dist/core/compaction/compaction.js +1 -1
  23. package/dist/core/compaction/compaction.js.map +1 -1
  24. package/dist/core/extensions/runner.d.ts.map +1 -1
  25. package/dist/core/extensions/runner.js +1 -1
  26. package/dist/core/extensions/runner.js.map +1 -1
  27. package/dist/core/package-manager.d.ts.map +1 -1
  28. package/dist/core/package-manager.js +4 -4
  29. package/dist/core/package-manager.js.map +1 -1
  30. package/dist/core/sdk.d.ts +1 -1
  31. package/dist/core/sdk.d.ts.map +1 -1
  32. package/dist/core/sdk.js.map +1 -1
  33. package/dist/core/session-manager.d.ts +2 -2
  34. package/dist/core/session-manager.d.ts.map +1 -1
  35. package/dist/core/session-manager.js.map +1 -1
  36. package/dist/core/system-prompt.d.ts.map +1 -1
  37. package/dist/core/system-prompt.js +5 -5
  38. package/dist/core/system-prompt.js.map +1 -1
  39. package/dist/core/tools/bash.d.ts +2 -2
  40. package/dist/core/tools/bash.d.ts.map +1 -1
  41. package/dist/core/tools/bash.js +3 -3
  42. package/dist/core/tools/bash.js.map +1 -1
  43. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  44. package/dist/core/tools/output-accumulator.js +1 -1
  45. package/dist/core/tools/output-accumulator.js.map +1 -1
  46. package/dist/extensions/core/hoo-core.d.ts.map +1 -1
  47. package/dist/extensions/core/hoo-core.js +50 -4
  48. package/dist/extensions/core/hoo-core.js.map +1 -1
  49. package/dist/init.d.ts.map +1 -1
  50. package/dist/init.js +4 -3
  51. package/dist/init.js.map +1 -1
  52. package/dist/migrations.d.ts.map +1 -1
  53. package/dist/migrations.js +1 -1
  54. package/dist/migrations.js.map +1 -1
  55. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  56. package/dist/modes/interactive/components/config-selector.js +1 -1
  57. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  58. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  59. package/dist/modes/interactive/components/extension-editor.js +1 -1
  60. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  61. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  62. package/dist/modes/interactive/interactive-mode.js +1 -1
  63. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  64. package/dist/modes/print-mode.d.ts +2 -2
  65. package/dist/modes/print-mode.d.ts.map +1 -1
  66. package/dist/modes/print-mode.js +2 -2
  67. package/dist/modes/print-mode.js.map +1 -1
  68. package/dist/package-manager-cli.d.ts.map +1 -1
  69. package/dist/package-manager-cli.js +12 -9
  70. package/dist/package-manager-cli.js.map +1 -1
  71. package/dist/utils/clipboard-image.d.ts.map +1 -1
  72. package/dist/utils/clipboard-image.js +1 -1
  73. package/dist/utils/clipboard-image.js.map +1 -1
  74. package/docs/compaction.md +9 -9
  75. package/docs/custom-provider.md +4 -4
  76. package/docs/development.md +6 -6
  77. package/docs/extensions.md +21 -21
  78. package/docs/index.md +9 -9
  79. package/docs/json.md +3 -3
  80. package/docs/keybindings.md +5 -5
  81. package/docs/models.md +6 -6
  82. package/docs/packages.md +37 -37
  83. package/docs/prompt-templates.md +4 -4
  84. package/docs/providers.md +12 -44
  85. package/docs/quickstart.md +28 -28
  86. package/docs/rpc.md +10 -10
  87. package/docs/sdk.md +13 -13
  88. package/docs/session-format.md +7 -7
  89. package/docs/sessions.md +11 -11
  90. package/docs/settings.md +14 -14
  91. package/docs/shell-aliases.md +2 -2
  92. package/docs/skills.md +10 -10
  93. package/docs/terminal-setup.md +7 -7
  94. package/docs/termux.md +6 -6
  95. package/docs/themes.md +9 -9
  96. package/docs/tmux.md +3 -3
  97. package/docs/tui.md +3 -3
  98. package/docs/usage.md +47 -47
  99. package/docs/windows.md +2 -2
  100. package/examples/README.md +1 -1
  101. package/examples/extensions/README.md +5 -5
  102. package/examples/extensions/claude-rules.ts +1 -1
  103. package/examples/extensions/commands.ts +1 -1
  104. package/examples/extensions/custom-header.ts +1 -1
  105. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  106. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  107. package/examples/extensions/doom-overlay/README.md +3 -3
  108. package/examples/extensions/pirate.ts +1 -1
  109. package/examples/extensions/preset.ts +4 -4
  110. package/examples/extensions/prompt-customizer.ts +1 -1
  111. package/examples/extensions/sandbox/index.ts +3 -3
  112. package/examples/extensions/sandbox/package.json +1 -1
  113. package/examples/extensions/subagent/README.md +13 -13
  114. package/examples/extensions/subagent/agents.ts +1 -1
  115. package/examples/extensions/subagent/index.ts +1 -1
  116. package/examples/extensions/tools.ts +1 -1
  117. package/examples/extensions/with-deps/package.json +1 -1
  118. package/examples/sdk/04-skills.ts +1 -1
  119. package/examples/sdk/06-extensions.ts +1 -1
  120. package/examples/sdk/08-prompt-templates.ts +1 -1
  121. package/examples/sdk/README.md +2 -2
  122. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  # Compaction & Branch Summarization
2
2
 
3
- LLMs have limited context windows. When conversations grow too long, pi uses compaction to summarize older content while preserving recent work. This page covers both auto-compaction and branch summarization.
3
+ LLMs have limited context windows. When conversations grow too long, hoocode uses compaction to summarize older content while preserving recent work. This page covers both auto-compaction and branch summarization.
4
4
 
5
5
  **Source files** ([pi-mono](https://github.com/kolisachint/hoocode)):
6
6
  - [`packages/coding-agent/src/core/compaction/compaction.ts`](https://github.com/kolisachint/hoocode/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) - Auto-compaction logic
@@ -13,7 +13,7 @@ For TypeScript definitions in your project, inspect `node_modules/@kolisachint/h
13
13
 
14
14
  ## Overview
15
15
 
16
- Pi has two summarization mechanisms:
16
+ HooCode has two summarization mechanisms:
17
17
 
18
18
  | Mechanism | Trigger | Purpose |
19
19
  |-----------|---------|---------|
@@ -32,13 +32,13 @@ Auto-compaction triggers when:
32
32
  contextTokens > contextWindow - reserveTokens
33
33
  ```
34
34
 
35
- By default, `reserveTokens` is 16384 tokens (configurable in `~/.pi/agent/settings.json` or `<project-dir>/.pi/settings.json`). This leaves room for the LLM's response.
35
+ By default, `reserveTokens` is 16384 tokens (configurable in `~/.hoocode/agent/settings.json` or `<project-dir>/.hoocode/settings.json`). This leaves room for the LLM's response.
36
36
 
37
37
  You can also trigger manually with `/compact [instructions]`, where optional instructions focus the summary.
38
38
 
39
39
  ### How It Works
40
40
 
41
- 1. **Find cut point**: Walk backwards from newest message, accumulating token estimates until `keepRecentTokens` (default 20k, configurable in `~/.pi/agent/settings.json` or `<project-dir>/.pi/settings.json`) is reached
41
+ 1. **Find cut point**: Walk backwards from newest message, accumulating token estimates until `keepRecentTokens` (default 20k, configurable in `~/.hoocode/agent/settings.json` or `<project-dir>/.hoocode/settings.json`) is reached
42
42
  2. **Extract messages**: Collect messages from the previous kept boundary (or session start) up to the cut point
43
43
  3. **Generate summary**: Call LLM to summarize with structured format, passing the previous summary as iterative context when present
44
44
  4. **Append entry**: Save `CompactionEntry` with summary and `firstKeptEntryId`
@@ -76,7 +76,7 @@ What the LLM sees:
76
76
  prompt from cmp messages from firstKeptEntryId
77
77
  ```
78
78
 
79
- On repeated compactions, the summarized span starts at the previous compaction's kept boundary (`firstKeptEntryId`), not at the compaction entry itself, falling back to the entry after the previous compaction if that kept entry cannot be found in the path. This preserves messages that survived the earlier compaction by including them in the next summarization pass as well. Pi also recalculates `tokensBefore` from the rebuilt session context before writing the new `CompactionEntry`, so the token count reflects the actual pre-compaction context being replaced.
79
+ On repeated compactions, the summarized span starts at the previous compaction's kept boundary (`firstKeptEntryId`), not at the compaction entry itself, falling back to the entry after the previous compaction if that kept entry cannot be found in the path. This preserves messages that survived the earlier compaction by including them in the next summarization pass as well. HooCode also recalculates `tokensBefore` from the rebuilt session context before writing the new `CompactionEntry`, so the token count reflects the actual pre-compaction context being replaced.
80
80
 
81
81
  ### Split Turns
82
82
 
@@ -102,7 +102,7 @@ Split turn (one huge turn exceeds budget):
102
102
  turnPrefixMessages = [usr, ass, tool, ass, tool, tool]
103
103
  ```
104
104
 
105
- For split turns, pi generates two summaries and merges them:
105
+ For split turns, hoocode generates two summaries and merges them:
106
106
  1. **History summary**: Previous context (if any)
107
107
  2. **Turn prefix summary**: The early part of the split turn
108
108
 
@@ -148,7 +148,7 @@ See [`prepareCompaction()`](https://github.com/kolisachint/hoocode/blob/main/pac
148
148
 
149
149
  ### When It Triggers
150
150
 
151
- When you use `/tree` to navigate to a different branch, pi offers to summarize the work you're leaving. This injects context from the left branch into the new branch.
151
+ When you use `/tree` to navigate to a different branch, hoocode offers to summarize the work you're leaving. This injects context from the left branch into the new branch.
152
152
 
153
153
  ### How It Works
154
154
 
@@ -177,7 +177,7 @@ After navigation with summary:
177
177
 
178
178
  ### Cumulative File Tracking
179
179
 
180
- Both compaction and branch summarization track files cumulatively. When generating a summary, pi extracts file operations from:
180
+ Both compaction and branch summarization track files cumulatively. When generating a summary, hoocode extracts file operations from:
181
181
  - Tool calls in the messages being summarized
182
182
  - Previous compaction or branch summary `details` (if any)
183
183
 
@@ -373,7 +373,7 @@ See `SessionBeforeTreeEvent` and `TreePreparation` in the types file.
373
373
 
374
374
  ## Settings
375
375
 
376
- Configure compaction in `~/.pi/agent/settings.json` or `<project-dir>/.pi/settings.json`:
376
+ Configure compaction in `~/.hoocode/agent/settings.json` or `<project-dir>/.hoocode/settings.json`:
377
377
 
378
378
  ```json
379
379
  {
@@ -59,7 +59,7 @@ export default function (pi: ExtensionAPI) {
59
59
  }
60
60
  ```
61
61
 
62
- The extension factory can also be `async`. For dynamic model discovery, fetch and register models in the factory instead of `session_start`. pi waits for the factory before startup continues, so the provider is available during interactive startup and to `pi --list-models`.
62
+ The extension factory can also be `async`. For dynamic model discovery, fetch and register models in the factory instead of `session_start`. hoocode waits for the factory before startup continues, so the provider is available during interactive startup and to `hoocode --list-models`.
63
63
 
64
64
  ## Override Existing Provider
65
65
 
@@ -208,7 +208,7 @@ models: [{
208
208
  id: "custom-model",
209
209
  // ...
210
210
  reasoning: true,
211
- thinkingLevelMap: { // map pi levels to provider values; null hides unsupported levels
211
+ thinkingLevelMap: { // map hoocode levels to provider values; null hides unsupported levels
212
212
  minimal: null,
213
213
  low: null,
214
214
  medium: null,
@@ -330,7 +330,7 @@ interface OAuthLoginCallbacks {
330
330
 
331
331
  ### OAuthCredentials
332
332
 
333
- Credentials are persisted in `~/.pi/agent/auth.json`:
333
+ Credentials are persisted in `~/.hoocode/agent/auth.json`:
334
334
 
335
335
  ```typescript
336
336
  interface OAuthCredentials {
@@ -602,7 +602,7 @@ interface ProviderModelConfig {
602
602
  /** Whether the model supports extended thinking. */
603
603
  reasoning: boolean;
604
604
 
605
- /** Maps pi thinking levels to provider/model-specific values; null marks a level unsupported. */
605
+ /** Maps hoocode thinking levels to provider/model-specific values; null marks a level unsupported. */
606
606
  thinkingLevelMap?: Partial<Record<"off" | "minimal" | "low" | "medium" | "high" | "xhigh", string | null>>;
607
607
 
608
608
  /** Supported input types. */
@@ -6,7 +6,7 @@ See [AGENTS.md](../../../AGENTS.md) for additional guidelines.
6
6
 
7
7
  ```bash
8
8
  git clone https://github.com/kolisachint/hoocode
9
- cd pi-mono
9
+ cd hoocode
10
10
  npm install
11
11
  npm run build
12
12
  ```
@@ -14,10 +14,10 @@ npm run build
14
14
  Run from source:
15
15
 
16
16
  ```bash
17
- /path/to/pi-mono/hoocode-test.sh
17
+ /path/to/hoocode/hoocode-test.sh
18
18
  ```
19
19
 
20
- The script can be run from any directory. Pi keeps the caller's current working directory.
20
+ The script can be run from any directory. HooCode keeps the caller's current working directory.
21
21
 
22
22
  ## Forking / Rebranding
23
23
 
@@ -26,8 +26,8 @@ Configure via `package.json`:
26
26
  ```json
27
27
  {
28
28
  "piConfig": {
29
- "name": "pi",
30
- "configDir": ".pi"
29
+ "name": "hoocode",
30
+ "configDir": ".hoocode"
31
31
  }
32
32
  }
33
33
  ```
@@ -48,7 +48,7 @@ Never use `__dirname` directly for package assets.
48
48
 
49
49
  ## Debug Command
50
50
 
51
- `/debug` (hidden) writes to `~/.pi/agent/pi-debug.log`:
51
+ `/debug` (hidden) writes to `~/.hoocode/agent/hoocode-debug.log`:
52
52
  - Rendered TUI lines with ANSI codes
53
53
  - Last messages sent to the LLM
54
54
 
@@ -1,10 +1,10 @@
1
- > pi can create extensions. Ask it to build one for your use case.
1
+ > hoocode can create extensions. Ask it to build one for your use case.
2
2
 
3
3
  # Extensions
4
4
 
5
- Extensions are TypeScript modules that extend pi's behavior. They can subscribe to lifecycle events, register custom tools callable by the LLM, add commands, and more.
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 `~/.pi/agent/extensions/` (global) or `.pi/extensions/` (project-local) for auto-discovery. Use `pi -e ./path.ts` only for quick tests. Extensions in auto-discovered locations can be hot-reloaded with `/reload`.
7
+ > **Placement for /reload:** Put extensions in `~/.hoocode/agent/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()`
@@ -102,7 +102,7 @@ export default function (pi: ExtensionAPI) {
102
102
  Test with `--extension` (or `-e`) flag:
103
103
 
104
104
  ```bash
105
- pi -e ./my-extension.ts
105
+ hoocode -e ./my-extension.ts
106
106
  ```
107
107
 
108
108
  ## Extension Locations
@@ -133,7 +133,7 @@ Additional paths via `settings.json`:
133
133
  }
134
134
  ```
135
135
 
136
- To share extensions via npm or git as pi packages, see [packages.md](packages.md).
136
+ To share extensions via npm or git as hoocode packages, see [packages.md](packages.md).
137
137
 
138
138
  ## Available Imports
139
139
 
@@ -146,7 +146,7 @@ To share extensions via npm or git as pi packages, see [packages.md](packages.md
146
146
 
147
147
  npm dependencies work too. Add a `package.json` next to your extension (or in a parent directory), run `npm install`, and imports from `node_modules/` are resolved automatically.
148
148
 
149
- For distributed pi packages installed with `pi install` (npm or git), runtime deps must be in `dependencies`. Package installation uses production installs (`npm install --omit=dev`) by default, so `devDependencies` are not available at runtime; when `npmCommand` is configured, git packages use plain `install` for compatibility with wrappers.
149
+ For distributed hoocode packages installed with `hoocode install` (npm or git), runtime deps must be in `dependencies`. Package installation uses production installs (`npm install --omit=dev`) by default, so `devDependencies` are not available at runtime; when `npmCommand` is configured, git packages use plain `install` for compatibility with wrappers.
150
150
 
151
151
  Node.js built-ins (`node:fs`, `node:path`, etc.) are also available.
152
152
 
@@ -214,7 +214,7 @@ export default async function (pi: ExtensionAPI) {
214
214
  }
215
215
  ```
216
216
 
217
- This pattern makes the fetched models available during normal startup and to `pi --list-models`.
217
+ This pattern makes the fetched models available during normal startup and to `hoocode --list-models`.
218
218
 
219
219
  ### Extension Styles
220
220
 
@@ -268,7 +268,7 @@ Run `npm install` in the extension directory, then imports from `node_modules/`
268
268
  ### Lifecycle Overview
269
269
 
270
270
  ```
271
- pi starts
271
+ hoocode starts
272
272
 
273
273
  ├─► session_start { reason: "startup" }
274
274
  └─► resources_discover { reason: "startup" }
@@ -385,7 +385,7 @@ pi.on("session_before_switch", async (event, ctx) => {
385
385
  });
386
386
  ```
387
387
 
388
- After a successful switch or new-session action, pi emits `session_shutdown` for the old extension instance, reloads and rebinds extensions for the new session, then emits `session_start` with `reason: "new" | "resume"` and `previousSessionFile`.
388
+ After a successful switch or new-session action, hoocode emits `session_shutdown` for the old extension instance, reloads and rebinds extensions for the new session, then emits `session_start` with `reason: "new" | "resume"` and `previousSessionFile`.
389
389
  Do cleanup work in `session_shutdown`, then reestablish any in-memory state in `session_start`.
390
390
 
391
391
  #### session_before_fork
@@ -402,7 +402,7 @@ pi.on("session_before_fork", async (event, ctx) => {
402
402
  });
403
403
  ```
404
404
 
405
- After a successful fork or clone, pi emits `session_shutdown` for the old extension instance, reloads and rebinds extensions for the new session, then emits `session_start` with `reason: "fork"` and `previousSessionFile`.
405
+ After a successful fork or clone, hoocode emits `session_shutdown` for the old extension instance, reloads and rebinds extensions for the new session, then emits `session_start` with `reason: "fork"` and `previousSessionFile`.
406
406
  Do cleanup work in `session_shutdown`, then reestablish any in-memory state in `session_start`.
407
407
 
408
408
  #### session_before_compact / session_compact
@@ -675,7 +675,7 @@ Use this to update extension UI when `pi.setThinkingLevel()`, model changes, or
675
675
 
676
676
  Fired after `tool_execution_start`, before the tool executes. **Can block.** Use `isToolCallEventType` to narrow and get typed inputs.
677
677
 
678
- Before `tool_call` runs, pi waits for previously emitted Agent events to finish draining through `AgentSession`. This means `ctx.sessionManager` is up to date through the current assistant tool-calling message.
678
+ Before `tool_call` runs, hoocode waits for previously emitted Agent events to finish draining through `AgentSession`. This means `ctx.sessionManager` is up to date through the current assistant tool-calling message.
679
679
 
680
680
  In the default parallel tool execution mode, sibling tool calls from the same assistant message are preflighted sequentially, then executed concurrently. `tool_call` is not guaranteed to see sibling tool results from that same assistant message in `ctx.sessionManager`.
681
681
 
@@ -786,7 +786,7 @@ pi.on("user_bash", (event, ctx) => {
786
786
  // Option 1: Provide custom operations (e.g., SSH)
787
787
  return { operations: remoteBashOps };
788
788
 
789
- // Option 2: Wrap pi's built-in local bash backend
789
+ // Option 2: Wrap hoocode's built-in local bash backend
790
790
  const local = createLocalBashOperations();
791
791
  return {
792
792
  operations: {
@@ -891,7 +891,7 @@ Use this for abort-aware nested work started by extension handlers, for example:
891
891
  - file or process helpers that accept `AbortSignal`
892
892
 
893
893
  `ctx.signal` is typically defined during active turn events such as `tool_call`, `tool_result`, `message_update`, and `turn_end`.
894
- It is usually `undefined` in idle or non-turn contexts such as session events, extension commands, and shortcuts fired while pi is idle.
894
+ It is usually `undefined` in idle or non-turn contexts such as session events, extension commands, and shortcuts fired while hoocode is idle.
895
895
 
896
896
  ```typescript
897
897
  pi.on("tool_result", async (event, ctx) => {
@@ -912,7 +912,7 @@ Control flow helpers.
912
912
 
913
913
  ### ctx.shutdown()
914
914
 
915
- Request a graceful shutdown of pi.
915
+ Request a graceful shutdown of hoocode.
916
916
 
917
917
  - **Interactive mode:** Deferred until the agent becomes idle (after processing all queued steering and follow-up messages).
918
918
  - **RPC mode:** Deferred until the next idle state (after completing the current command response, when waiting for the next command).
@@ -1373,7 +1373,7 @@ Labels persist in the session and survive restarts. Use them to mark important p
1373
1373
 
1374
1374
  Register a command.
1375
1375
 
1376
- If multiple extensions register the same command name, pi keeps them all and assigns numeric invocation suffixes in load order, for example `/review:1` and `/review:2`.
1376
+ If multiple extensions register the same command name, hoocode keeps them all and assigns numeric invocation suffixes in load order, for example `/review:1` and `/review:2`.
1377
1377
 
1378
1378
  ```typescript
1379
1379
  pi.registerCommand("stats", {
@@ -1544,7 +1544,7 @@ Register or override a model provider dynamically. Useful for proxies, custom en
1544
1544
 
1545
1545
  Calls made during the extension factory function are queued and applied once the runner initialises. Calls made after that — for example from a command handler following a user setup flow — take effect immediately without requiring a `/reload`.
1546
1546
 
1547
- If you need to discover models from a remote endpoint, prefer an async extension factory over deferring the fetch to `session_start`. pi waits for the factory before startup continues, so the registered models are available immediately, including to `pi --list-models`.
1547
+ If you need to discover models from a remote endpoint, prefer an async extension factory over deferring the fetch to `session_start`. hoocode waits for the factory before startup continues, so the registered models are available immediately, including to `hoocode --list-models`.
1548
1548
 
1549
1549
  ```typescript
1550
1550
  // Register a new provider with custom models
@@ -1774,7 +1774,7 @@ async execute(toolCallId, params) {
1774
1774
 
1775
1775
  **Important:** Use `StringEnum` from `@kolisachint/hoocode-ai` for string enums. `Type.Union`/`Type.Literal` doesn't work with Google's API.
1776
1776
 
1777
- **Argument preparation:** `prepareArguments(args)` is optional. If defined, it runs before schema validation and before `execute()`. Use it to mimic an older accepted input shape when pi resumes an older session whose stored tool call arguments no longer match the current schema. Return the object you want validated against `parameters`. Keep the public schema strict. Do not add deprecated compatibility fields to `parameters` just to keep old resumed sessions working.
1777
+ **Argument preparation:** `prepareArguments(args)` is optional. If defined, it runs before schema validation and before `execute()`. Use it to mimic an older accepted input shape when hoocode resumes an older session whose stored tool call arguments no longer match the current schema. Return the object you want validated against `parameters`. Keep the public schema strict. Do not add deprecated compatibility fields to `parameters` just to keep old resumed sessions working.
1778
1778
 
1779
1779
  Example: an older session may contain an `edit` tool call with top-level `oldText` and `newText`, while the current schema only accepts `edits: [{ oldText, newText }]`.
1780
1780
 
@@ -1827,13 +1827,13 @@ Extensions can override built-in tools (`read`, `bash`, `edit`, `write`, `grep`,
1827
1827
 
1828
1828
  ```bash
1829
1829
  # Extension's read tool replaces built-in read
1830
- pi -e ./tool-override.ts
1830
+ hoocode -e ./tool-override.ts
1831
1831
  ```
1832
1832
 
1833
1833
  Alternatively, use `--no-builtin-tools` to start without any built-in tools while keeping extension tools enabled:
1834
1834
  ```bash
1835
1835
  # No built-in tools, only extension tools
1836
- pi --no-builtin-tools -e ./my-extension.ts
1836
+ hoocode --no-builtin-tools -e ./my-extension.ts
1837
1837
  ```
1838
1838
 
1839
1839
  See [examples/extensions/tool-override.ts](../examples/extensions/tool-override.ts) for a complete example that overrides `read` with logging and access control.
@@ -1884,7 +1884,7 @@ pi.registerTool({
1884
1884
 
1885
1885
  **Operations interfaces:** `ReadOperations`, `WriteOperations`, `EditOperations`, `BashOperations`, `LsOperations`, `GrepOperations`, `FindOperations`
1886
1886
 
1887
- For `user_bash`, extensions can reuse pi's local shell backend via `createLocalBashOperations()` instead of reimplementing local process spawning, shell resolution, and process-tree termination.
1887
+ For `user_bash`, extensions can reuse hoocode's local shell backend via `createLocalBashOperations()` instead of reimplementing local process spawning, shell resolution, and process-tree termination.
1888
1888
 
1889
1889
  The bash tool also supports a spawn hook to adjust the command, cwd, or env before execution:
1890
1890
 
@@ -2223,7 +2223,7 @@ ctx.ui.setFooter((tui, theme) => ({
2223
2223
  ctx.ui.setFooter(undefined); // Restore built-in footer
2224
2224
 
2225
2225
  // Terminal title
2226
- ctx.ui.setTitle("pi - my-project");
2226
+ ctx.ui.setTitle("hoocode - my-project");
2227
2227
 
2228
2228
  // Editor text
2229
2229
  ctx.ui.setEditorText("Prefill text");
package/docs/index.md CHANGED
@@ -1,13 +1,13 @@
1
- # Pi Documentation
1
+ # HooCode Documentation
2
2
 
3
- Pi is a minimal terminal coding harness. It is designed to stay small at the core while being extended through TypeScript extensions, skills, prompt templates, themes, and pi packages.
3
+ HooCode is a minimal terminal coding harness. It is designed to stay small at the core while being extended through TypeScript extensions, skills, prompt templates, themes, and hoocode packages.
4
4
 
5
5
  ## Quick start
6
6
 
7
- On linux or mac you can install Pi with curl:
7
+ On linux or mac you can install HooCode with curl:
8
8
 
9
9
  ```bash
10
- curl -fsSL https://pi.dev/install.sh | sh
10
+ curl -fsSL https://hoocode.dev/install.sh | sh
11
11
  ```
12
12
 
13
13
  Or alternatively with npm:
@@ -19,17 +19,17 @@ npm install -g @kolisachint/hoocode-agent
19
19
  Then run it in a project directory:
20
20
 
21
21
  ```bash
22
- pi
22
+ hoocode
23
23
  ```
24
24
 
25
- Authenticate with `/login` for subscription providers, or set an API key such as `ANTHROPIC_API_KEY` before starting pi.
25
+ Authenticate with `/login` for subscription providers, or set an API key such as `ANTHROPIC_API_KEY` before starting hoocode.
26
26
 
27
27
  For the full first-run flow, see [Quickstart](quickstart.md).
28
28
 
29
29
  ## Start here
30
30
 
31
31
  - [Quickstart](quickstart.md) - install, authenticate, and run a first session.
32
- - [Using Pi](usage.md) - interactive mode, slash commands, context files, and CLI reference.
32
+ - [Using HooCode](usage.md) - interactive mode, slash commands, context files, and CLI reference.
33
33
  - [Providers](providers.md) - subscription and API-key setup for built-in providers.
34
34
  - [Settings](settings.md) - global and project settings.
35
35
  - [Keybindings](keybindings.md) - default shortcuts and custom keybindings.
@@ -42,13 +42,13 @@ For the full first-run flow, see [Quickstart](quickstart.md).
42
42
  - [Skills](skills.md) - Agent Skills for reusable on-demand capabilities.
43
43
  - [Prompt templates](prompt-templates.md) - reusable prompts that expand from slash commands.
44
44
  - [Themes](themes.md) - built-in and custom terminal themes.
45
- - [Pi packages](packages.md) - bundle and share extensions, skills, prompts, and themes.
45
+ - [HooCode packages](packages.md) - bundle and share extensions, skills, prompts, and themes.
46
46
  - [Custom models](models.md) - add model entries for supported provider APIs.
47
47
  - [Custom providers](custom-provider.md) - implement custom APIs and OAuth flows.
48
48
 
49
49
  ## Programmatic usage
50
50
 
51
- - [SDK](sdk.md) - embed pi in Node.js applications.
51
+ - [SDK](sdk.md) - embed hoocode in Node.js applications.
52
52
  - [RPC mode](rpc.md) - integrate over stdin/stdout JSONL.
53
53
  - [JSON event stream mode](json.md) - print mode with structured events.
54
54
  - [TUI components](tui.md) - build custom terminal UI for extensions.
package/docs/json.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # JSON Event Stream Mode
2
2
 
3
3
  ```bash
4
- pi --mode json "Your prompt"
4
+ hoocode --mode json "Your prompt"
5
5
  ```
6
6
 
7
- Outputs all session events as JSON lines to stdout. Useful for integrating pi into other tools or custom UIs.
7
+ Outputs all session events as JSON lines to stdout. Useful for integrating hoocode into other tools or custom UIs.
8
8
 
9
9
  ## Event Types
10
10
 
@@ -78,5 +78,5 @@ Followed by events as they occur:
78
78
  ## Example
79
79
 
80
80
  ```bash
81
- pi --mode json "List files" 2>/dev/null | jq -c 'select(.type == "message_end")'
81
+ hoocode --mode json "List files" 2>/dev/null | jq -c 'select(.type == "message_end")'
82
82
  ```
@@ -1,12 +1,12 @@
1
1
  # Keybindings
2
2
 
3
- All keyboard shortcuts can be customized via `~/.pi/agent/keybindings.json`. Each action can be bound to one or more keys.
3
+ All keyboard shortcuts can be customized via `~/.hoocode/agent/keybindings.json`. Each action can be bound to one or more keys.
4
4
 
5
- The config file uses the same namespaced keybinding ids that pi uses internally and that extension authors use in `keyHint()` and injected `keybindings` managers.
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
 
7
7
  Older configs using pre-namespaced ids such as `cursorUp` or `expandTools` are migrated automatically to the namespaced ids on startup.
8
8
 
9
- After editing `keybindings.json`, run `/reload` in pi to apply the changes without restarting the session.
9
+ After editing `keybindings.json`, run `/reload` in hoocode to apply the changes without restarting the session.
10
10
 
11
11
  ## Key Format
12
12
 
@@ -153,7 +153,7 @@ Used inside the scoped models selector (opened via `/scoped-models`).
153
153
 
154
154
  ## Custom Configuration
155
155
 
156
- Create `~/.pi/agent/keybindings.json`:
156
+ Create `~/.hoocode/agent/keybindings.json`:
157
157
 
158
158
  ```json
159
159
  {
@@ -165,7 +165,7 @@ Create `~/.pi/agent/keybindings.json`:
165
165
 
166
166
  Each action can have a single key or an array of keys. User config overrides defaults.
167
167
 
168
- On native Windows, `app.suspend` has no default binding because Windows terminals do not support Unix job control. If you bind it manually, pi shows a status message instead of suspending. In WSL, the normal Linux `ctrl+z`/`fg` behavior still applies.
168
+ On native Windows, `app.suspend` has no default binding because Windows terminals do not support Unix job control. If you bind it manually, hoocode shows a status message instead of suspending. In WSL, the normal Linux `ctrl+z`/`fg` behavior still applies.
169
169
 
170
170
  ### Emacs Example
171
171
 
package/docs/models.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Custom Models
2
2
 
3
- Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via `~/.pi/agent/models.json`.
3
+ Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via `~/.hoocode/agent/models.json`.
4
4
 
5
5
  ## Table of Contents
6
6
 
@@ -36,7 +36,7 @@ For local models (Ollama, LM Studio, vLLM), only `id` is required per model:
36
36
 
37
37
  The `apiKey` is required but Ollama ignores it, so any value works.
38
38
 
39
- Some OpenAI-compatible servers do not understand the `developer` role used for reasoning-capable models. For those providers, set `compat.supportsDeveloperRole` to `false` so pi sends the system prompt as a `system` message instead. If the server also does not support `reasoning_effort`, set `compat.supportsReasoningEffort` to `false` too.
39
+ Some OpenAI-compatible servers do not understand the `developer` role used for reasoning-capable models. For those providers, set `compat.supportsDeveloperRole` to `false` so hoocode sends the system prompt as a `system` message instead. If the server also does not support `reasoning_effort`, set `compat.supportsReasoningEffort` to `false` too.
40
40
 
41
41
  You can set `compat` at the provider level to apply to all models, or at the model level to override a specific model. This commonly applies to Ollama, vLLM, SGLang, and similar OpenAI-compatible servers.
42
42
 
@@ -159,7 +159,7 @@ The `apiKey` and `headers` fields support three formats:
159
159
  "apiKey": "sk-..."
160
160
  ```
161
161
 
162
- For `models.json`, shell commands are resolved at request time. pi intentionally does not apply built-in TTL, stale reuse, or recovery logic for arbitrary commands. Different commands need different caching and failure strategies, and pi cannot infer the right one.
162
+ For `models.json`, shell commands are resolved at request time. hoocode intentionally does not apply built-in TTL, stale reuse, or recovery logic for arbitrary commands. Different commands need different caching and failure strategies, and hoocode cannot infer the right one.
163
163
 
164
164
  If your command is slow, expensive, rate-limited, or should keep using a previous value on transient failures, wrap it in your own script or command that implements the caching or TTL behavior you want.
165
165
 
@@ -192,7 +192,7 @@ If your command is slow, expensive, rate-limited, or should keep using a previou
192
192
  | `name` | No | `id` | Human-readable model label. Used for matching (`--model` patterns) and shown in model details/status text. |
193
193
  | `api` | No | provider's `api` | Override provider's API for this model |
194
194
  | `reasoning` | No | `false` | Supports extended thinking |
195
- | `thinkingLevelMap` | No | omitted | Maps pi thinking levels to provider values and marks unsupported levels (see below) |
195
+ | `thinkingLevelMap` | No | omitted | Maps hoocode thinking levels to provider values and marks unsupported levels (see below) |
196
196
  | `input` | No | `["text"]` | Input types: `["text"]` or `["text", "image"]` |
197
197
  | `contextWindow` | No | `128000` | Context window size in tokens |
198
198
  | `maxTokens` | No | `16384` | Maximum output tokens |
@@ -205,7 +205,7 @@ Current behavior:
205
205
 
206
206
  ### Thinking Level Map
207
207
 
208
- Use `thinkingLevelMap` on a model to describe model-specific thinking controls. Keys are pi thinking levels: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`.
208
+ Use `thinkingLevelMap` on a model to describe model-specific thinking controls. Keys are hoocode thinking levels: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`.
209
209
 
210
210
  Values are tristate:
211
211
 
@@ -317,7 +317,7 @@ Behavior notes:
317
317
 
318
318
  For providers or proxies using `api: "anthropic-messages"`, use `compat.supportsEagerToolInputStreaming` to control Anthropic fine-grained tool streaming compatibility.
319
319
 
320
- By default pi sends per-tool `eager_input_streaming: true`. If a proxy or Anthropic-compatible backend rejects that field, set `supportsEagerToolInputStreaming` to `false`. Pi will omit `tools[].eager_input_streaming` and send the legacy `fine-grained-tool-streaming-2025-05-14` beta header for tool-enabled requests instead.
320
+ By default hoocode sends per-tool `eager_input_streaming: true`. If a proxy or Anthropic-compatible backend rejects that field, set `supportsEagerToolInputStreaming` to `false`. HooCode will omit `tools[].eager_input_streaming` and send the legacy `fine-grained-tool-streaming-2025-05-14` beta header for tool-enabled requests instead.
321
321
 
322
322
  ```json
323
323
  {