hoomanjs 1.40.1 → 1.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/README.md +50 -3
  2. package/dist/acp/acp-agent.d.ts +16 -3
  3. package/dist/acp/acp-agent.js +371 -177
  4. package/dist/acp/acp-agent.js.map +1 -1
  5. package/dist/acp/commands.d.ts +6 -3
  6. package/dist/acp/commands.js +6 -24
  7. package/dist/acp/commands.js.map +1 -1
  8. package/dist/acp/meta/vscode.d.ts +10 -0
  9. package/dist/acp/meta/vscode.js +16 -0
  10. package/dist/acp/meta/vscode.js.map +1 -0
  11. package/dist/acp/questions.d.ts +18 -0
  12. package/dist/acp/questions.js +80 -0
  13. package/dist/acp/questions.js.map +1 -0
  14. package/dist/acp/session-config.d.ts +3 -1
  15. package/dist/acp/session-config.js +20 -8
  16. package/dist/acp/session-config.js.map +1 -1
  17. package/dist/acp/sessions/replay.js +117 -1
  18. package/dist/acp/sessions/replay.js.map +1 -1
  19. package/dist/acp/sessions/store.d.ts +55 -16
  20. package/dist/acp/sessions/store.js +174 -71
  21. package/dist/acp/sessions/store.js.map +1 -1
  22. package/dist/acp/utils/tool-kind.js +1 -1
  23. package/dist/acp/utils/tool-kind.js.map +1 -1
  24. package/dist/acp/utils/tool-result-content.d.ts +1 -0
  25. package/dist/acp/utils/tool-result-content.js +28 -1
  26. package/dist/acp/utils/tool-result-content.js.map +1 -1
  27. package/dist/chat/app.d.ts +3 -1
  28. package/dist/chat/app.js +65 -24
  29. package/dist/chat/app.js.map +1 -1
  30. package/dist/chat/components/BottomChrome.d.ts +12 -3
  31. package/dist/chat/components/BottomChrome.js +2 -2
  32. package/dist/chat/components/BottomChrome.js.map +1 -1
  33. package/dist/chat/components/ChromePicker.d.ts +5 -1
  34. package/dist/chat/components/ChromePicker.js +6 -2
  35. package/dist/chat/components/ChromePicker.js.map +1 -1
  36. package/dist/chat/components/QuestionPrompt.d.ts +8 -0
  37. package/dist/chat/components/QuestionPrompt.js +41 -0
  38. package/dist/chat/components/QuestionPrompt.js.map +1 -0
  39. package/dist/chat/components/StatusBar.d.ts +8 -3
  40. package/dist/chat/components/StatusBar.js +55 -26
  41. package/dist/chat/components/StatusBar.js.map +1 -1
  42. package/dist/chat/index.d.ts +2 -1
  43. package/dist/chat/index.js +1 -3
  44. package/dist/chat/index.js.map +1 -1
  45. package/dist/chat/questions.d.ts +24 -0
  46. package/dist/chat/questions.js +71 -0
  47. package/dist/chat/questions.js.map +1 -0
  48. package/dist/cli.js +13 -10
  49. package/dist/cli.js.map +1 -1
  50. package/dist/core/agent/index.d.ts +3 -0
  51. package/dist/core/agent/index.js +11 -6
  52. package/dist/core/agent/index.js.map +1 -1
  53. package/dist/core/agent/session-title-plugin.d.ts +27 -0
  54. package/dist/core/agent/session-title-plugin.js +77 -0
  55. package/dist/core/agent/session-title-plugin.js.map +1 -0
  56. package/dist/core/config.d.ts +30 -1
  57. package/dist/core/config.js +2 -0
  58. package/dist/core/config.js.map +1 -1
  59. package/dist/core/index.d.ts +12 -0
  60. package/dist/core/index.js +7 -2
  61. package/dist/core/index.js.map +1 -1
  62. package/dist/core/models/azure.js +5 -1
  63. package/dist/core/models/azure.js.map +1 -1
  64. package/dist/core/models/groq.js +5 -1
  65. package/dist/core/models/groq.js.map +1 -1
  66. package/dist/core/models/moonshot.js +5 -1
  67. package/dist/core/models/moonshot.js.map +1 -1
  68. package/dist/core/models/openai.js +6 -1
  69. package/dist/core/models/openai.js.map +1 -1
  70. package/dist/core/models/openrouter.js +5 -1
  71. package/dist/core/models/openrouter.js.map +1 -1
  72. package/dist/core/models/types.d.ts +44 -0
  73. package/dist/core/models/types.js +15 -0
  74. package/dist/core/models/types.js.map +1 -1
  75. package/dist/core/models/usage.d.ts +10 -0
  76. package/dist/core/models/usage.js +45 -0
  77. package/dist/core/models/usage.js.map +1 -0
  78. package/dist/core/models/xai.js +5 -1
  79. package/dist/core/models/xai.js.map +1 -1
  80. package/dist/core/modes/definitions.js +2 -2
  81. package/dist/core/modes/definitions.js.map +1 -1
  82. package/dist/core/prompts/harness/behaviour.md +3 -15
  83. package/dist/core/prompts/harness/communication.md +3 -16
  84. package/dist/core/prompts/harness/execution.md +6 -13
  85. package/dist/core/prompts/harness/guardrails.md +6 -12
  86. package/dist/core/prompts/static/ask-user.md +7 -0
  87. package/dist/core/prompts/static/daemon.md +4 -18
  88. package/dist/core/prompts/static/environment.md +2 -7
  89. package/dist/core/prompts/static/fetch.md +4 -30
  90. package/dist/core/prompts/static/filesystem.md +1 -1
  91. package/dist/core/prompts/static/identity.md +4 -19
  92. package/dist/core/prompts/static/planning.md +1 -9
  93. package/dist/core/prompts/static/subagents.md +4 -29
  94. package/dist/core/prompts/static/thinking.md +4 -24
  95. package/dist/core/prompts/static/todo.md +6 -32
  96. package/dist/core/prompts/system.js +5 -4
  97. package/dist/core/prompts/system.js.map +1 -1
  98. package/dist/core/sessions/generate-title.d.ts +10 -0
  99. package/dist/core/sessions/generate-title.js +113 -0
  100. package/dist/core/sessions/generate-title.js.map +1 -0
  101. package/dist/core/sessions/lazy-session-manager.js +0 -2
  102. package/dist/core/sessions/lazy-session-manager.js.map +1 -1
  103. package/dist/core/sessions/list-cli-sessions.js +13 -1
  104. package/dist/core/sessions/list-cli-sessions.js.map +1 -1
  105. package/dist/core/skills/built-in/hooman-channels/SKILL.md +11 -148
  106. package/dist/core/skills/built-in/hooman-channels/channels.md +117 -0
  107. package/dist/core/skills/built-in/hooman-coding/SKILL.md +49 -44
  108. package/dist/core/skills/built-in/hooman-coding/debugging.md +26 -0
  109. package/dist/core/skills/built-in/hooman-coding/new-project.md +23 -0
  110. package/dist/core/skills/built-in/hooman-config/SKILL.md +19 -257
  111. package/dist/core/skills/built-in/hooman-config/providers.md +171 -0
  112. package/dist/core/skills/built-in/hooman-config/search.md +39 -0
  113. package/dist/core/skills/built-in/hooman-mcp/SKILL.md +22 -153
  114. package/dist/core/skills/built-in/hooman-skills/SKILL.md +11 -147
  115. package/dist/core/skills/built-in/hooman-skills/authoring.md +80 -0
  116. package/dist/core/state/session-title.d.ts +17 -0
  117. package/dist/core/state/session-title.js +15 -0
  118. package/dist/core/state/session-title.js.map +1 -0
  119. package/dist/core/state/tool-approvals.js +3 -2
  120. package/dist/core/state/tool-approvals.js.map +1 -1
  121. package/dist/core/tools/ask-user.d.ts +38 -0
  122. package/dist/core/tools/ask-user.js +62 -0
  123. package/dist/core/tools/ask-user.js.map +1 -0
  124. package/dist/core/tools/filesystem.d.ts +26 -1
  125. package/dist/core/tools/filesystem.js +44 -23
  126. package/dist/core/tools/filesystem.js.map +1 -1
  127. package/dist/core/tools/index.d.ts +1 -1
  128. package/dist/core/tools/index.js +1 -1
  129. package/dist/core/tools/index.js.map +1 -1
  130. package/dist/core/tools/shell.d.ts +41 -0
  131. package/dist/core/tools/shell.js +8 -1
  132. package/dist/core/tools/shell.js.map +1 -1
  133. package/dist/core/tools/sleep.js +1 -1
  134. package/dist/core/tools/sleep.js.map +1 -1
  135. package/dist/core/utils/billing.d.ts +49 -0
  136. package/dist/core/utils/billing.js +295 -0
  137. package/dist/core/utils/billing.js.map +1 -0
  138. package/dist/core/utils/edit-replace.d.ts +6 -0
  139. package/dist/core/utils/edit-replace.js +88 -6
  140. package/dist/core/utils/edit-replace.js.map +1 -1
  141. package/dist/core/utils/paths.d.ts +1 -0
  142. package/dist/core/utils/paths.js +1 -0
  143. package/dist/core/utils/paths.js.map +1 -1
  144. package/dist/core/{models → utils}/reasoning-effort.d.ts +9 -0
  145. package/dist/core/utils/reasoning-effort.js.map +1 -0
  146. package/dist/daemon/index.d.ts +1 -1
  147. package/dist/daemon/index.js +1 -11
  148. package/dist/daemon/index.js.map +1 -1
  149. package/dist/exec/questions.d.ts +9 -0
  150. package/dist/exec/questions.js +50 -0
  151. package/dist/exec/questions.js.map +1 -0
  152. package/dist/index.d.ts +5 -5
  153. package/dist/index.js +5 -5
  154. package/dist/index.js.map +1 -1
  155. package/package.json +2 -2
  156. package/dist/core/models/reasoning-effort.js.map +0 -1
  157. package/dist/core/prompts/static/bye.md +0 -15
  158. package/dist/core/prompts/static/sleep.md +0 -20
  159. package/dist/core/state/exit-request.d.ts +0 -14
  160. package/dist/core/state/exit-request.js +0 -16
  161. package/dist/core/state/exit-request.js.map +0 -1
  162. package/dist/core/tools/bye.d.ts +0 -4
  163. package/dist/core/tools/bye.js +0 -23
  164. package/dist/core/tools/bye.js.map +0 -1
  165. package/dist/core/tools/terminal-backend.d.ts +0 -41
  166. package/dist/core/tools/terminal-backend.js +0 -9
  167. package/dist/core/tools/terminal-backend.js.map +0 -1
  168. package/dist/core/tools/text-fs-backend.d.ts +0 -25
  169. package/dist/core/tools/text-fs-backend.js +0 -9
  170. package/dist/core/tools/text-fs-backend.js.map +0 -1
  171. /package/dist/core/{models → utils}/reasoning-effort.js +0 -0
package/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  <div align="center">
2
+ <img src=".github/logo.svg" alt="Hooman logo" width="128" />
2
3
  <h1>Hooman</h1>
3
4
  <p>
4
5
  Hooman is a hackable AI agent toolkit for local workflows. It is built with TypeScript, <a href="https://www.npmjs.com/package/@strands-agents/sdk">Strands Agents SDK</a>, and <a href="https://github.com/vadimdemedes/ink">Ink</a>.
@@ -40,6 +41,8 @@ It gives you a practical toolkit to build and run agent workflows:
40
41
  - Bundled prompt harness toggles (`behaviour`, `communication`, `execution`, `guardrails`); coding guidance ships as the built-in `hooman-coding` skill
41
42
  - Built-in read-only subagent tools (`subagent_research`, `subagent_review`, `subagent_test_investigator`)
42
43
  - Built-in `grep` tool backed by ripgrep (`rg`), with runtime bootstrap when `rg` is not available on PATH
44
+ - Built-in `ask_user` tool: the agent can ask you a multiple-choice question mid-task and wait for the answer — inline picker in `chat`, numbered prompt in `exec`, question card in ACP clients (Zed, the VS Code extension); environments without a human (daemon, non-TTY `exec`, subagents) report "no user available" so the agent proceeds on its own
45
+ - Context-window utilization and session-cost tracking backed by [models.dev](https://models.dev) (daily-cached catalog, optional per-model `billing` overrides) — shown in the chat status bar, the VS Code extension footer, and sent to ACP clients via `usage_update`
43
46
  - Toolkit-oriented architecture with configurable tools, prompts, and transports
44
47
  - Interactive terminal UI for chat and configuration
45
48
 
@@ -181,16 +184,20 @@ Start in ask mode:
181
184
  hooman chat --mode ask
182
185
  ```
183
186
 
187
+ The status bar under the composer shows the active model, effort, mode, and yolo state; a usage row with `context: N% (used/size)`, cumulative `tokens` (`in`/`cin`/`out`), and session `cost: $…` (each segment appears once it has data — context and cost require resolvable billing metadata, see the [`billing` block](#provider-notes)); and an mcp/tools/skills row with a live `elapsed` timer while a turn runs.
188
+
184
189
  ### Chat commands
185
190
 
186
191
  Inside an interactive `chat` session, type `/` to discover slash commands:
187
192
 
188
193
  - `/model` - pick or set the chat model for this session.
194
+ - `/effort` - pick or set the reasoning effort for the active model's provider (`off`, `minimal`, `low`, `medium`, `high`); Shift+Tab cycles it.
189
195
  - `/mode` - switch the session mode (`agent`, `ask`, `plan`); see [Session mode](#session-mode).
190
196
  - `/yolo` - toggle auto-approve of tool calls (`on` / `off`).
191
197
  - `/init` - generate or refresh `AGENTS.md` for the current project.
192
198
  - `/compact` - compact the conversation history now and persist the result.
193
199
  - `/new` - start a fresh chat session.
200
+ - `/sessions` - browse and resume saved sessions.
194
201
  - `/config` - launch the configuration workflow (see below).
195
202
 
196
203
  ### Session mode
@@ -290,10 +297,31 @@ hooman acp
290
297
 
291
298
  ACP notes:
292
299
 
293
- - ACP sessions are stored under the active project's session directory in `sessions/acp/` (see [Configuration Layout](#configuration-layout))
300
+ - ACP session metadata is indexed in the active project's `sessions/acp/sessions.jsonl`; conversation history lives in the regular per-session snapshots (see [Configuration Layout](#configuration-layout))
294
301
  - ACP loads MCP servers passed on `session/new` and `session/load`, in addition to Hooman's local `mcp.json`
295
302
  - ACP `session/new` and `session/load` support `_meta.userId`
296
303
  - session configuration includes `hooman.sessionMode` (`agent`, `plan`, or `ask`); see [Session mode](#session-mode)
304
+ - each turn ends with a `usage_update` carrying context-window utilization (`used`/`size`), cumulative session `cost`, and cumulative token totals under `_meta["hoomanjs/tokens"]` — `size` and `cost` come from the model's [`billing` metadata](#provider-notes) (models.dev-backed) and are omitted (`size: 0`, no `cost`) when unresolved; a model switch pushes a fresh `usage_update` so clients can rescale immediately
305
+
306
+ ## VS Code Extension
307
+
308
+ `src/vscode/` ships a self-contained VS Code extension (`hooman-vscode`) that bridges `hooman acp` into the editor with a **Hooman chat panel** — its own webview view in the activity bar with streaming markdown, collapsible thinking, tool-call cards, plan checklists, usage, session list/load, mode/model/effort pickers, slash-command autocomplete, and inline permission prompts. Works in **stable VS Code, Insiders, and compatible forks** — no proposed APIs and no special subscription required.
309
+
310
+ It's not published to the marketplace yet. Quick start:
311
+
312
+ ```bash
313
+ # from the repo root
314
+ npm install && npm run build && npm link
315
+
316
+ # from src/vscode
317
+ cd src/vscode
318
+ npm install && npm run compile
319
+ code . # open src/vscode as its own workspace, then press F5
320
+ ```
321
+
322
+ Or package and install a `.vsix` into any VS Code-compatible editor: `npm run package` in `src/vscode`, then `code --install-extension hooman-vscode-<version>.vsix`.
323
+
324
+ Full setup, settings, and architecture notes: [`src/vscode/README.md`](src/vscode/README.md).
297
325
 
298
326
  ## Configuration Layout
299
327
 
@@ -313,7 +341,8 @@ Important files and folders:
313
341
  - `cache/` - runtime caches used by tools and subsystems
314
342
  - `projects.json` - registry mapping each project root to a stable UUID
315
343
  - `projects/<uuid>/` - per-project storage, scoped to the project (git root, falling back to cwd) the session runs in:
316
- - `sessions/` - persisted session data (including ACP sessions under `sessions/acp/` and offloaded tool output under `sessions/offloaded-content/`)
344
+ - `sessions/` - persisted session data (per-session snapshots and the ACP session index at `sessions/acp/sessions.jsonl`)
345
+ - `offloaded-content/` - offloaded tool output (large tool results retrievable via `retrieve_offloaded_content`)
317
346
  - `memory/` - durable extracted memory store
318
347
  - `attachments/` - saved attachments (e.g. clipboard images)
319
348
  - `plans/` - plan-mode markdown documents
@@ -411,7 +440,7 @@ The on-disk shape uses a reusable **`providers`** array plus a non-empty **`llms
411
440
 
412
441
  Tool approvals are session-scoped and are not persisted in `config.json`.
413
442
 
414
- Hooman enables Strands `ContextOffloader` by default with file-backed storage under the project-scoped `~/.hooman/projects/<uuid>/sessions/offloaded-content`, so large tool results can be previewed in-context and retrieved later without bloating the active conversation window.
443
+ Hooman enables Strands `ContextOffloader` by default with file-backed storage under the project-scoped `~/.hooman/projects/<uuid>/offloaded-content`, so large tool results can be previewed in-context and retrieved later without bloating the active conversation window.
415
444
 
416
445
  Supported `providers[].provider` values registered in this release (see `src/core/models/index.ts`):
417
446
 
@@ -486,6 +515,24 @@ Normalized LLM option fields:
486
515
  - optional `temperature`
487
516
  - optional `maxTokens`
488
517
 
518
+ Each LLM entry may also carry an optional **`billing`** block used to display context-window utilization and cumulative session cost (in the chat TUI status bar and the VS Code extension footer, and sent to ACP clients via `usage_update`):
519
+
520
+ ```json
521
+ {
522
+ "name": "Haiku 4.5",
523
+ "provider": "LiteLLM Anthropic",
524
+ "billing": {
525
+ "name": "claude-haiku-4.5",
526
+ "context": 200000,
527
+ "costs": { "input/m": 1, "cache/m": 0.1, "output/m": 5 }
528
+ },
529
+ "options": { "model": "claude-haiku-4.5" },
530
+ "default": true
531
+ }
532
+ ```
533
+
534
+ `billing.name` is required when the block is present and is the identifier looked up in the [models.dev](https://models.dev) catalog (cached under `~/.hooman/cache/` and refreshed at most once daily); when `billing` is omitted, `options.model` is used as the lookup name. `context` (window size in tokens) and `costs` (USD per million tokens; `"cache/m"` prices cached-input reads) override whatever models.dev resolves. If neither the config nor models.dev yields the data, context usage and cost are simply not shown.
535
+
489
536
  Notes:
490
537
 
491
538
  - Google maps normalized `maxTokens` to the SDK's `maxOutputTokens` internally.
@@ -1,4 +1,4 @@
1
- import { type AgentApp, type AgentConnection, type AgentContext, type CancelNotification, type DeleteSessionRequest, type InitializeRequest, type InitializeResponse, type ListSessionsRequest, type ListSessionsResponse, type LoadSessionRequest, type LoadSessionResponse, type NewSessionRequest, type NewSessionResponse, type PromptRequest, type PromptResponse, type SetSessionConfigOptionRequest, type SetSessionConfigOptionResponse, type SetSessionModeRequest, type SetSessionModeResponse } from "@agentclientprotocol/sdk";
1
+ import { type AgentApp, type AgentConnection, type AgentContext, type CancelNotification, type CloseSessionRequest, type CloseSessionResponse, type DeleteSessionRequest, type InitializeRequest, type InitializeResponse, type ListSessionsRequest, type ListSessionsResponse, type LoadSessionRequest, type LoadSessionResponse, type NewSessionRequest, type NewSessionResponse, type PromptRequest, type PromptResponse, type ResumeSessionRequest, type ResumeSessionResponse, type SetSessionConfigOptionRequest, type SetSessionConfigOptionResponse, type SetSessionModeRequest, type SetSessionModeResponse } from "@agentclientprotocol/sdk";
2
2
  /** Name + version reported to the client in `agentInfo`. */
3
3
  type AgentIdentity = {
4
4
  name: string;
@@ -21,16 +21,29 @@ export declare class HoomanAcpAgent {
21
21
  deleteSession(params: DeleteSessionRequest): Promise<void>;
22
22
  newSession(params: NewSessionRequest): Promise<NewSessionResponse>;
23
23
  loadSession(params: LoadSessionRequest, client: AgentContext): Promise<LoadSessionResponse>;
24
+ /**
25
+ * Handle `session/resume`: reactivate a persisted session's in-memory state
26
+ * (including its conversation history, so the turn continues correctly)
27
+ * without replaying that history to the client — the spec reserves the full
28
+ * transcript replay for `session/load`.
29
+ */
30
+ resumeSession(params: ResumeSessionRequest, client: AgentContext): Promise<ResumeSessionResponse>;
31
+ /**
32
+ * Handle `session/close`: cancel any in-flight turn and free the in-memory
33
+ * session state, without deleting the persisted session from disk (unlike
34
+ * `session/delete`).
35
+ */
36
+ closeSession(params: CloseSessionRequest): Promise<CloseSessionResponse>;
24
37
  /**
25
38
  * Handle `session/set_mode`: switch the active mode for a running session,
26
39
  * re-applying the tool surface and persisting the choice.
27
40
  */
28
- setSessionMode(params: SetSessionModeRequest): Promise<SetSessionModeResponse>;
41
+ setSessionMode(params: SetSessionModeRequest, client: AgentContext): Promise<SetSessionModeResponse>;
29
42
  /**
30
43
  * Handle `session/set_config_option`: apply a model or mode selection and
31
44
  * return the complete, up-to-date configuration state (as the spec requires).
32
45
  */
33
- setSessionConfigOption(params: SetSessionConfigOptionRequest): Promise<SetSessionConfigOptionResponse>;
46
+ setSessionConfigOption(params: SetSessionConfigOptionRequest, client: AgentContext): Promise<SetSessionConfigOptionResponse>;
34
47
  /** Cancel an in-flight prompt turn. Silent no-op for unknown sessions. */
35
48
  cancel(params: CancelNotification): Promise<void>;
36
49
  /** Run one prompt turn: stream model output, tool calls, and a stop reason. */