@hybridaione/hybridclaw 0.1.12 → 0.1.17

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 (84) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/README.md +29 -2
  3. package/config.example.json +25 -3
  4. package/container/Dockerfile +4 -1
  5. package/container/package-lock.json +3102 -141
  6. package/container/package.json +4 -2
  7. package/container/src/browser-tools.ts +612 -0
  8. package/container/src/extensions.ts +130 -0
  9. package/container/src/hybridai-client.ts +13 -1
  10. package/container/src/index.ts +111 -8
  11. package/container/src/tools.ts +297 -13
  12. package/container/src/types.ts +38 -6
  13. package/dist/cli.js +5 -1
  14. package/dist/cli.js.map +1 -1
  15. package/dist/config.d.ts +13 -0
  16. package/dist/config.d.ts.map +1 -1
  17. package/dist/config.js +27 -1
  18. package/dist/config.js.map +1 -1
  19. package/dist/container-runner.d.ts.map +1 -1
  20. package/dist/container-runner.js +7 -2
  21. package/dist/container-runner.js.map +1 -1
  22. package/dist/container-setup.d.ts +1 -0
  23. package/dist/container-setup.d.ts.map +1 -1
  24. package/dist/container-setup.js +190 -17
  25. package/dist/container-setup.js.map +1 -1
  26. package/dist/db.d.ts +14 -0
  27. package/dist/db.d.ts.map +1 -1
  28. package/dist/db.js +47 -0
  29. package/dist/db.js.map +1 -1
  30. package/dist/delegation-manager.d.ts +11 -0
  31. package/dist/delegation-manager.d.ts.map +1 -0
  32. package/dist/delegation-manager.js +37 -0
  33. package/dist/delegation-manager.js.map +1 -0
  34. package/dist/gateway-service.d.ts +1 -1
  35. package/dist/gateway-service.d.ts.map +1 -1
  36. package/dist/gateway-service.js +492 -5
  37. package/dist/gateway-service.js.map +1 -1
  38. package/dist/gateway-types.d.ts +0 -1
  39. package/dist/gateway-types.d.ts.map +1 -1
  40. package/dist/gateway-types.js.map +1 -1
  41. package/dist/gateway.js +46 -2
  42. package/dist/gateway.js.map +1 -1
  43. package/dist/health.d.ts.map +1 -1
  44. package/dist/health.js +2 -2
  45. package/dist/health.js.map +1 -1
  46. package/dist/heartbeat.d.ts.map +1 -1
  47. package/dist/heartbeat.js +29 -1
  48. package/dist/heartbeat.js.map +1 -1
  49. package/dist/proactive-policy.d.ts +3 -0
  50. package/dist/proactive-policy.d.ts.map +1 -0
  51. package/dist/proactive-policy.js +40 -0
  52. package/dist/proactive-policy.js.map +1 -0
  53. package/dist/prompt-hooks.d.ts +2 -1
  54. package/dist/prompt-hooks.d.ts.map +1 -1
  55. package/dist/prompt-hooks.js +94 -0
  56. package/dist/prompt-hooks.js.map +1 -1
  57. package/dist/runtime-config.d.ts +23 -1
  58. package/dist/runtime-config.d.ts.map +1 -1
  59. package/dist/runtime-config.js +168 -5
  60. package/dist/runtime-config.js.map +1 -1
  61. package/dist/side-effects.d.ts +6 -2
  62. package/dist/side-effects.d.ts.map +1 -1
  63. package/dist/side-effects.js +40 -14
  64. package/dist/side-effects.js.map +1 -1
  65. package/dist/types.d.ts +15 -0
  66. package/dist/types.d.ts.map +1 -1
  67. package/docs/index.html +7 -2
  68. package/package.json +1 -1
  69. package/src/cli.ts +5 -1
  70. package/src/config.ts +36 -1
  71. package/src/container-runner.ts +10 -1
  72. package/src/container-setup.ts +218 -17
  73. package/src/db.ts +70 -0
  74. package/src/delegation-manager.ts +45 -0
  75. package/src/gateway-service.ts +629 -6
  76. package/src/gateway-types.ts +0 -1
  77. package/src/gateway.ts +60 -1
  78. package/src/health.ts +6 -3
  79. package/src/heartbeat.ts +39 -1
  80. package/src/proactive-policy.ts +44 -0
  81. package/src/prompt-hooks.ts +103 -2
  82. package/src/runtime-config.ts +198 -5
  83. package/src/side-effects.ts +54 -21
  84. package/src/types.ts +20 -1
package/CHANGELOG.md CHANGED
@@ -8,6 +8,80 @@
8
8
 
9
9
  ### Fixed
10
10
 
11
+ ## [0.1.17](https://github.com/HybridAIOne/hybridclaw/tree/v0.1.17)
12
+
13
+ ### Added
14
+
15
+ - **Push-based delegation tool**: Added `delegate` side-effect orchestration so subagent tasks auto-announce on completion without parent polling.
16
+ - **Delegation runtime manager**: Added queue-backed delegation execution with configurable concurrency, depth, and per-turn limits.
17
+ - **Proactive active-hours policy**: Added configurable active-hours gating and optional off-hours queueing for proactive outbound messages.
18
+ - **Container extension hooks**: Added runtime lifecycle hook points around model/tool execution with a built-in proactive security hook.
19
+ - **Multi-mode delegation interface**: Added `delegate` modes for `single`, `parallel`, and `chain` (with `{previous}` step interpolation), plus per-task and per-run model overrides.
20
+ - **Delegation result metadata**: Added structured delegated completion transcripts with per-task status, duration, attempts, model, and tool usage, alongside concise user-facing summaries.
21
+ - **Automatic stale container rebuild detection**: Added startup fingerprint checks for container sources so `gateway`/`tui` can rebuild the runtime image automatically when stale.
22
+
23
+ ### Changed
24
+
25
+ - **Prompt hook pipeline**: Added `proactivity` hook to explicitly guide autonomous memory capture, session recall, and delegation strategy.
26
+ - **Container resilience**: HybridAI requests now use bounded exponential retry for transient API/network failures.
27
+ - **Gateway status output**: `status` now reports live delegation queue activity.
28
+ - **LLM delegation guidance**: Parent system prompt now includes a full subagent delegation playbook (when to delegate, when not to, anti-patterns, context checklist, and decomposition heuristics).
29
+ - **Subagent prompt contract**: Delegated child sessions now receive explicit role/identity constraints and a required structured final output format (`Completed`, `Files Touched`, `Key Findings`, `Issues / Limits`).
30
+ - **Depth-aware delegation capability**: Non-leaf delegated sessions can orchestrate further delegation within max depth; leaf delegates are explicitly restricted.
31
+ - **Container startup policy**: Container readiness now defaults to `if-stale` rebuild behavior and supports env override via `HYBRIDCLAW_CONTAINER_REBUILD=if-stale|always|never`.
32
+
33
+ ### Fixed
34
+
35
+ - **Delegation turn-budget accounting**: Depth-rejected delegations no longer consume per-turn delegation budget, preventing false limit exhaustion.
36
+
37
+ ## [0.1.16](https://github.com/HybridAIOne/hybridclaw/tree/v0.1.16)
38
+
39
+ ### Added
40
+
41
+ - **Built-in browser toolset**: Added `browser_navigate`, `browser_snapshot`, `browser_click`, `browser_type`, `browser_press`, `browser_scroll`, `browser_back`, `browser_screenshot`, `browser_pdf`, and `browser_close` in the container runtime.
42
+ - **Browser runtime module**: Added a dedicated browser tooling layer with per-session socket isolation and normalized JSON responses for tool calls.
43
+
44
+ ### Changed
45
+
46
+ - **Preinstalled browser stack in container image**: Container build now includes `agent-browser`, `playwright`, and preinstalled Chromium/headless-shell binaries for immediate browser tool availability.
47
+ - **Browser runtime hardening**: Browser subprocesses now use workspace-backed runtime/cache paths and explicit Playwright browser path wiring to avoid permission/cache issues across UID modes.
48
+ - **Docs updates**: Updated README and website docs tool catalog to include browser automation capabilities and preinstall behavior.
49
+
50
+ ### Fixed
51
+
52
+ - **Browser tool startup failures**: Resolved `npm ENOENT/EACCES` and Playwright executable-missing errors observed during runtime tool execution in persistent containers.
53
+
54
+ ## [0.1.15](https://github.com/HybridAIOne/hybridclaw/tree/v0.1.15)
55
+
56
+ ### Added
57
+
58
+ ### Changed
59
+
60
+ ### Fixed
61
+
62
+ - **Program creation workflow enforcement**: Implementation requests now enforce file-first behavior (write/edit on disk before response), disallow shell-based file authoring shortcuts (`heredoc`, `echo` redirects, `sed`, `awk`), and require explicit run/offer-run behavior after file changes.
63
+
64
+ ## [0.1.14](https://github.com/HybridAIOne/hybridclaw/tree/v0.1.14)
65
+
66
+ ### Added
67
+
68
+ ### Changed
69
+
70
+ ### Fixed
71
+
72
+ - **Website build timeout regression**: Increased default container request timeout from `60s` to `300s` and upgraded `bash` tool execution timeouts (configurable per call) so longer build/test commands return actionable errors instead of premature timeout failures.
73
+
74
+ ## [0.1.13](https://github.com/HybridAIOne/hybridclaw/tree/v0.1.13)
75
+
76
+ ### Added
77
+
78
+ ### Changed
79
+
80
+ - **Release/version sync**: Bumped package and container versions to `0.1.13` after `0.1.12` npm publication.
81
+ - **Docs alignment**: Kept README/changelog aligned with the `config.json` runtime + `.env` secrets model.
82
+
83
+ ### Fixed
84
+
11
85
  ## [0.1.12](https://github.com/HybridAIOne/hybridclaw/tree/v0.1.12)
12
86
 
13
87
  ### Added
package/README.md CHANGED
@@ -24,7 +24,7 @@ hybridclaw onboarding
24
24
 
25
25
  - **Gateway service** (Node.js) — shared message/command handlers, SQLite persistence, scheduler, heartbeat, web/API, and optional Discord integration
26
26
  - **TUI client** — thin client over HTTP (`/api/chat`, `/api/command`)
27
- - **Container** (Docker, ephemeral) — HybridAI API client, sandboxed tool executor
27
+ - **Container** (Docker, ephemeral) — HybridAI API client, sandboxed tool executor, and preinstalled browser automation runtime
28
28
  - Communication via file-based IPC (input.json / output.json)
29
29
 
30
30
  ## Quick start
@@ -62,7 +62,10 @@ Runtime model:
62
62
  - `hybridclaw gateway` is the core process and should run first.
63
63
  - If `DISCORD_TOKEN` is set, Discord runs inside gateway automatically.
64
64
  - `hybridclaw tui` is a thin client that connects to the gateway.
65
- - `hybridclaw gateway` and `hybridclaw tui` validate the container image at startup and build it automatically if missing.
65
+ - `hybridclaw gateway` and `hybridclaw tui` validate the container image at startup.
66
+ - If the image is missing, it is built automatically.
67
+ - Default rebuild policy is `if-stale`: when tracked container sources changed since last build, the image is rebuilt automatically.
68
+ - Policy override (optional): env `HYBRIDCLAW_CONTAINER_REBUILD=if-stale|always|never`.
66
69
 
67
70
  Maintainers can publish the package to npm using:
68
71
 
@@ -70,11 +73,18 @@ Maintainers can publish the package to npm using:
70
73
  npm publish --access public
71
74
  ```
72
75
 
76
+ If npm 2FA is enabled on your account, use:
77
+
78
+ ```bash
79
+ npm publish --access public --otp=<6-digit-code>
80
+ ```
81
+
73
82
  Best-in-class harness upgrades now in runtime:
74
83
 
75
84
  - explicit trust-model acceptance during onboarding (recorded in `config.json`)
76
85
  - typed `config.json` runtime settings with defaults, validation, and hot reload
77
86
  - formal prompt hook orchestration (`bootstrap`, `memory`, `safety`)
87
+ - proactive runtime layer with active-hours gating, push delegation (`single`/`parallel`/`chain`), depth-aware tool policy, and retry controls
78
88
 
79
89
  ## Configuration
80
90
 
@@ -82,6 +92,7 @@ HybridClaw now uses typed runtime config in `config.json` (auto-created on first
82
92
 
83
93
  - Start from `config.example.json` (reference)
84
94
  - Runtime watches `config.json` and hot-reloads most settings (model defaults, heartbeat, prompt hooks, limits, etc.)
95
+ - `proactive.*` controls autonomous behavior (`activeHours`, `delegation`, `autoRetry`)
85
96
  - Some settings still require restart to fully apply (for example HTTP bind host/port)
86
97
  - Default bot is configured via `hybridai.defaultChatbotId` in `config.json` (legacy `HYBRIDAI_CHATBOT_ID` values are auto-migrated on startup)
87
98
 
@@ -175,7 +186,22 @@ The agent has access to these sandboxed tools inside the container:
175
186
  - `bash` — shell command execution
176
187
  - `memory` — durable memory files (`MEMORY.md`, `USER.md`, `memory/YYYY-MM-DD.md`)
177
188
  - `session_search` — search/summarize historical sessions from transcript archives
189
+ - `delegate` — push-based background subagent tasks (`single`, `parallel`, `chain`) with auto-announced completion (no polling)
178
190
  - `web_fetch` — fetch a URL and extract readable content (HTML → markdown/text)
191
+ - `browser_*` (optional) — interactive browser automation (`navigate`, `snapshot`, `click`, `type`, `press`, `scroll`, `back`, `screenshot`, `pdf`, `close`)
192
+
193
+ `delegate` mode examples:
194
+
195
+ - single: `{ "prompt": "Audit auth middleware and list risks", "label": "auth-audit" }`
196
+ - parallel: `{ "mode": "parallel", "label": "module-audit", "tasks": [{ "prompt": "Scan api/" }, { "prompt": "Scan ui/" }] }`
197
+ - chain: `{ "mode": "chain", "label": "implement-flow", "chain": [{ "prompt": "Scout the payment module" }, { "prompt": "Plan changes from: {previous}" }, { "prompt": "Implement based on: {previous}" }] }`
198
+
199
+ Browser tooling notes:
200
+
201
+ - The shipped container image preinstalls `agent-browser` and Chromium (Playwright).
202
+ - You can override the binary via `AGENT_BROWSER_BIN` if needed.
203
+ - Navigation to private/loopback hosts is blocked by default (set `BROWSER_ALLOW_PRIVATE_NETWORK=true` to override).
204
+ - Screenshot/PDF outputs are constrained to `/workspace/.browser-artifacts`.
179
205
 
180
206
  HybridClaw also supports automatic session compaction with pre-compaction memory flush:
181
207
 
@@ -187,6 +213,7 @@ System prompt assembly is handled by a formal hook pipeline:
187
213
  - `bootstrap` hook (workspace bootstrap + skills metadata)
188
214
  - `memory` hook (session summary)
189
215
  - `safety` hook (runtime guardrails / trust-model constraints)
216
+ - `proactivity` hook (memory capture, session recall, delegation behavior)
190
217
 
191
218
  Hook toggles live in `config.json` under `promptHooks`.
192
219
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": 2,
3
3
  "security": {
4
4
  "trustModelAccepted": false,
5
5
  "trustModelAcceptedAt": "",
@@ -24,7 +24,7 @@
24
24
  "image": "hybridclaw-agent",
25
25
  "memory": "512m",
26
26
  "cpus": "1",
27
- "timeoutMs": 60000,
27
+ "timeoutMs": 300000,
28
28
  "additionalMounts": "",
29
29
  "maxOutputBytes": 10485760,
30
30
  "maxConcurrent": 5
@@ -57,6 +57,28 @@
57
57
  "promptHooks": {
58
58
  "bootstrapEnabled": true,
59
59
  "memoryEnabled": true,
60
- "safetyEnabled": true
60
+ "safetyEnabled": true,
61
+ "proactivityEnabled": true
62
+ },
63
+ "proactive": {
64
+ "activeHours": {
65
+ "enabled": false,
66
+ "timezone": "",
67
+ "startHour": 8,
68
+ "endHour": 22,
69
+ "queueOutsideHours": true
70
+ },
71
+ "delegation": {
72
+ "enabled": true,
73
+ "maxConcurrent": 3,
74
+ "maxDepth": 2,
75
+ "maxPerTurn": 3
76
+ },
77
+ "autoRetry": {
78
+ "enabled": true,
79
+ "maxAttempts": 3,
80
+ "baseDelayMs": 2000,
81
+ "maxDelayMs": 8000
82
+ }
61
83
  }
62
84
  }
@@ -10,11 +10,14 @@ WORKDIR /app
10
10
 
11
11
  COPY package.json tsconfig.json ./
12
12
  RUN npm install
13
+ ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
14
+ RUN npx playwright install --with-deps chromium
15
+ RUN npx playwright install --with-deps --only-shell chromium
13
16
 
14
17
  COPY src/ src/
15
18
  RUN npx tsc
16
19
 
17
- RUN chown -R node:node /app
20
+ RUN chown -R node:node /app /ms-playwright
18
21
 
19
22
  USER node
20
23