@hybridaione/hybridclaw 0.1.20 → 0.1.22

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 (68) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +44 -8
  3. package/config.example.json +3 -0
  4. package/container/package-lock.json +2 -2
  5. package/container/package.json +1 -1
  6. package/container/src/browser-tools.ts +594 -9
  7. package/container/src/index.ts +93 -2
  8. package/container/src/tools.ts +23 -3
  9. package/container/src/types.ts +7 -0
  10. package/container/src/web-fetch.ts +98 -7
  11. package/dist/audit-events.d.ts.map +1 -1
  12. package/dist/audit-events.js +24 -1
  13. package/dist/audit-events.js.map +1 -1
  14. package/dist/container-runner.d.ts.map +1 -1
  15. package/dist/container-runner.js +50 -0
  16. package/dist/container-runner.js.map +1 -1
  17. package/dist/discord.d.ts +3 -3
  18. package/dist/discord.d.ts.map +1 -1
  19. package/dist/discord.js +4 -4
  20. package/dist/discord.js.map +1 -1
  21. package/dist/gateway-service.d.ts +7 -3
  22. package/dist/gateway-service.d.ts.map +1 -1
  23. package/dist/gateway-service.js +28 -3
  24. package/dist/gateway-service.js.map +1 -1
  25. package/dist/gateway-types.d.ts +5 -0
  26. package/dist/gateway-types.d.ts.map +1 -1
  27. package/dist/gateway-types.js.map +1 -1
  28. package/dist/gateway.js +41 -12
  29. package/dist/gateway.js.map +1 -1
  30. package/dist/heartbeat.d.ts.map +1 -1
  31. package/dist/heartbeat.js +4 -0
  32. package/dist/heartbeat.js.map +1 -1
  33. package/dist/prompt-hooks.d.ts.map +1 -1
  34. package/dist/prompt-hooks.js +17 -0
  35. package/dist/prompt-hooks.js.map +1 -1
  36. package/dist/runtime-config.d.ts +3 -0
  37. package/dist/runtime-config.d.ts.map +1 -1
  38. package/dist/runtime-config.js +17 -1
  39. package/dist/runtime-config.js.map +1 -1
  40. package/dist/scheduled-task-runner.d.ts +8 -1
  41. package/dist/scheduled-task-runner.d.ts.map +1 -1
  42. package/dist/scheduled-task-runner.js +4 -1
  43. package/dist/scheduled-task-runner.js.map +1 -1
  44. package/dist/skills-guard.d.ts +36 -0
  45. package/dist/skills-guard.d.ts.map +1 -0
  46. package/dist/skills-guard.js +607 -0
  47. package/dist/skills-guard.js.map +1 -0
  48. package/dist/skills.d.ts +13 -2
  49. package/dist/skills.d.ts.map +1 -1
  50. package/dist/skills.js +494 -59
  51. package/dist/skills.js.map +1 -1
  52. package/dist/types.d.ts +6 -0
  53. package/dist/types.d.ts.map +1 -1
  54. package/docs/index.html +3 -3
  55. package/package.json +1 -1
  56. package/src/container-runner.ts +51 -1
  57. package/src/discord.ts +8 -5
  58. package/src/gateway-service.ts +50 -8
  59. package/src/gateway-types.ts +5 -0
  60. package/src/gateway.ts +61 -12
  61. package/src/heartbeat.ts +4 -0
  62. package/src/prompt-hooks.ts +11 -0
  63. package/src/runtime-config.ts +18 -1
  64. package/src/scheduled-task-runner.ts +8 -2
  65. package/src/skills-guard.ts +736 -0
  66. package/src/skills.ts +570 -61
  67. package/src/types.ts +7 -0
  68. package/.hybridclaw/container-image-state.json +0 -5
package/CHANGELOG.md CHANGED
@@ -8,6 +8,44 @@
8
8
 
9
9
  ### Fixed
10
10
 
11
+ ## [0.1.22](https://github.com/HybridAIOne/hybridclaw/tree/v0.1.22)
12
+
13
+ ### Added
14
+
15
+ - **Skills trust scanner**: Added `src/skills-guard.ts` with Hermes-derived regex threat detection (exfiltration, prompt injection, destructive ops, persistence, reverse shells, obfuscation, supply chain, credential exposure), structural checks (file count/size limits, binary blocking, symlink escape checks), and invisible-unicode detection.
16
+ - **Skill scan cache**: Added mtime-signature + content-hash scanner caching to skip re-scan on unchanged skills.
17
+ - **Extended SKILL frontmatter**: Added support for `always`, `requires.bins`, `requires.env`, and `metadata.hybridclaw.{tags,related_skills}` while preserving backward compatibility for existing fields.
18
+
19
+ ### Changed
20
+
21
+ - **Skill discovery tiers**: Expanded skill discovery precedence to `extra < bundled < codex < claude < agents-personal < agents-project < workspace`, including `config.skills.extraDirs[]` and `.agents/skills` interop paths.
22
+ - **Skill prompt embedding modes**: Implemented Always/Summary/Hidden behavior via frontmatter flags (`always`, `disable-model-invocation`) with `maxAlwaysChars=10000`, `maxSkillsPromptChars=30000`, and `maxSkillsInPrompt=150`.
23
+ - **Skill eligibility gating**: Skills with unmet `requires` are now silently excluded from both prompt availability and slash-command resolution.
24
+ - **Skill slash commands**: Added command-name sanitization (32-char max), reserved built-in command blocking, and deterministic collision deduplication (`-2`, `-3`, ...), while keeping `/skill name`, `/skill:name`, and `/<name>` invocation compatibility.
25
+ - **Web tool routing guidance**: Tool descriptions and runtime prompt guidance now include explicit `web_fetch` vs browser decision rules, concrete SPA/auth/app categories, and quantified cost asymmetry.
26
+ - **web_fetch escalation signaling**: `web_fetch` now emits structured escalation hints (`javascript_required`, `spa_shell_only`, `empty_extraction`, `boilerplate_only`, `bot_blocked`) and surfaces them in tool output for browser fallback routing.
27
+ - **Browser extraction steering**: `browser_navigate` responses now include text preview metadata and explicit next-step hints (`browser_snapshot` with `mode="full"`), and docs/prompts now clarify that `browser_pdf` is export-only (not text extraction).
28
+
29
+ ### Fixed
30
+
31
+ ## [0.1.21](https://github.com/HybridAIOne/hybridclaw/tree/v0.1.21)
32
+
33
+ ### Added
34
+
35
+ - **Browser tool expansion**: Added `browser_vision`, `browser_get_images`, `browser_console`, and `browser_network` to the container browser toolset and subagent allowlists.
36
+ - **Frame-aware browser interactions**: Added optional `frame` targeting to browser interaction tools and exposed iframe metadata in browser snapshots.
37
+ - **Discord artifact delivery path**: Added proactive/delegation artifact propagation so generated screenshot/PDF outputs can be attached to Discord messages.
38
+
39
+ ### Changed
40
+
41
+ - **Vision request payload policy**: Browser vision requests now always send a single-message payload with `enable_rag: false` and include required active request context (`baseUrl`, `apiKey`, `model`, `chatbot_id`).
42
+ - **Browser snapshot modes**: Added explicit snapshot `mode` support (`default`, `interactive`, `full`) for tighter interactive-only dumps.
43
+
44
+ ### Fixed
45
+
46
+ - **Delegation attachment gap**: Resolved delegated/scheduled tool-result path that previously posted text-only proactive responses while omitting generated artifacts.
47
+ - **Bot-detection signaling**: Browser navigation responses now emit structured warning hints when known anti-bot/verification titles are detected.
48
+
11
49
  ## [0.1.20](https://github.com/HybridAIOne/hybridclaw/tree/v0.1.20)
12
50
 
13
51
  ### Added
package/README.md CHANGED
@@ -87,6 +87,7 @@ HybridClaw uses typed runtime config in `config.json` (auto-created on first run
87
87
 
88
88
  - Start from `config.example.json` (reference)
89
89
  - Runtime watches `config.json` and hot-reloads most settings (model defaults, heartbeat, prompt hooks, limits, etc.)
90
+ - `skills.extraDirs` adds additional enterprise/shared skill roots (lowest precedence tier)
90
91
  - `proactive.*` controls autonomous behavior (`activeHours`, `delegation`, `autoRetry`)
91
92
  - `observability.*` controls push ingest into HybridAI (`events:batch` endpoint, batching, identity metadata)
92
93
  - Some settings require restart to fully apply (for example HTTP bind host/port)
@@ -178,13 +179,25 @@ HybridClaw supports `SKILL.md`-based skills (`<skill-name>/SKILL.md`).
178
179
 
179
180
  You can place skills in:
180
181
 
181
- - `./skills/<skill-name>/SKILL.md` (project-level)
182
- - `<agent workspace>/skills/<skill-name>/SKILL.md` (agent-specific)
183
- - `$CODEX_HOME/skills/<skill-name>/SKILL.md`, `~/.codex/skills/<skill-name>/SKILL.md`, or `~/.claude/skills/<skill-name>/SKILL.md` (managed/shared)
182
+ - any directory listed in `config.skills.extraDirs[]` (enterprise/shared)
183
+ - bundled package skills (`<hybridclaw install>/skills/<skill-name>/SKILL.md`)
184
+ - `$CODEX_HOME/skills/<skill-name>/SKILL.md` or `~/.codex/skills/<skill-name>/SKILL.md`
185
+ - `~/.claude/skills/<skill-name>/SKILL.md`
186
+ - `~/.agents/skills/<skill-name>/SKILL.md`
187
+ - `./.agents/skills/<skill-name>/SKILL.md` (project)
188
+ - `./skills/<skill-name>/SKILL.md` (workspace)
184
189
 
185
190
  Load precedence is:
186
191
 
187
- - managed/shared < project < agent workspace
192
+ - `extra < bundled < codex < claude < agents-personal < agents-project < workspace`
193
+ - skills are merged by `name`; higher-precedence sources override lower-precedence ones
194
+
195
+ Security scanning is trust-aware:
196
+
197
+ - `bundled` sources are treated as `builtin` and not scanned
198
+ - `workspace` sources (`./skills/`, `./.agents/skills/`) are scanned; `caution` is allowed, `dangerous` is blocked
199
+ - `personal` sources (`~/.codex/skills/`, `~/.claude/skills/`, `~/.agents/skills/`) are scanned and blocked on `caution`/`dangerous`
200
+ - scanner includes Hermes-derived regex checks, structural limits (50 files, 1MB total, 256KB/file, binary/symlink checks), invisible-unicode detection, and mtime+content-hash cache reuse
188
201
 
189
202
  ### Required format
190
203
 
@@ -196,6 +209,14 @@ name: repo-orientation
196
209
  description: Quickly map an unfamiliar repository and identify where a requested feature should be implemented.
197
210
  user-invocable: true
198
211
  disable-model-invocation: false
212
+ always: false
213
+ requires:
214
+ bins: [docker, git]
215
+ env: [GITHUB_TOKEN]
216
+ metadata:
217
+ hybridclaw:
218
+ tags: [devops, docker]
219
+ related_skills: [kubernetes]
199
220
  ---
200
221
 
201
222
  # Repo Orientation
@@ -208,16 +229,25 @@ Supported frontmatter keys:
208
229
  - `description` (required)
209
230
  - `user-invocable` (optional, default `true`)
210
231
  - `disable-model-invocation` (optional, default `false`)
232
+ - `always` (optional, default `false`; embeds full skill body in the system prompt up to `maxAlwaysChars=10000`, then demotes to summary)
233
+ - `requires.bins` / `requires.env` (optional; skill is excluded unless requirements are met)
234
+ - `metadata.hybridclaw.tags` / `metadata.hybridclaw.related_skills` (optional metadata namespace)
211
235
 
212
236
  ### Using skills
213
237
 
214
- Skills are listed to the model as metadata (`name`, `description`, `location`), and the model reads `SKILL.md` on demand with the `read` tool.
238
+ Skills are listed to the model as metadata (`name`, `description`, `location`), and the model reads `SKILL.md` on demand with the `read` tool. Skills with `always: true` are embedded directly in the system prompt.
239
+
240
+ Prompt embedding modes:
241
+
242
+ - `Always`: `always: true` embeds full body in `<skill_always ...>` (budgeted by `maxAlwaysChars=10000`)
243
+ - `Summary`: default mode, emits only XML metadata under `<available_skills>`
244
+ - `Hidden`: `disable-model-invocation: true` excludes the skill from model prompt metadata (still invocable by slash command when `user-invocable: true`)
215
245
 
216
246
  Explicit invocation is supported via:
217
247
 
218
248
  - `/skill <name> [input]`
219
249
  - `/skill:<name> [input]`
220
- - `/<name> [input]` (when `user-invocable: true`)
250
+ - `/<name> [input]` (when `user-invocable: true`; command names are sanitized to lowercase `a-z0-9-`, max 32 chars, with `-2`/`-3` dedup and built-in command-name blocking)
221
251
 
222
252
  Example skill in this repo:
223
253
 
@@ -233,8 +263,8 @@ The agent has access to these sandboxed tools inside the container:
233
263
  - `memory` — durable memory files (`MEMORY.md`, `USER.md`, `memory/YYYY-MM-DD.md`)
234
264
  - `session_search` — search/summarize historical sessions from transcript archives
235
265
  - `delegate` — push-based background subagent tasks (`single`, `parallel`, `chain`) with auto-announced completion (no polling)
236
- - `web_fetch` — fetch a URL and extract readable content (HTML markdown/text)
237
- - `browser_*` (optional) — interactive browser automation (`navigate`, `snapshot`, `click`, `type`, `press`, `scroll`, `back`, `screenshot`, `pdf`, `close`)
266
+ - `web_fetch` — plain HTTP fetch + extraction for static/read-only content (docs, articles, READMEs, JSON/text APIs, direct files)
267
+ - `browser_*` (optional) — full browser automation for JS-rendered or interactive pages (`navigate`, `snapshot`, `click`, `type`, `press`, `scroll`, `back`, `screenshot`, `pdf`, `close`)
238
268
 
239
269
  `delegate` mode examples:
240
270
 
@@ -244,6 +274,12 @@ The agent has access to these sandboxed tools inside the container:
244
274
 
245
275
  Browser tooling notes:
246
276
 
277
+ - Routing default: prefer `web_fetch` first for read-only retrieval.
278
+ - Use browser tools for SPAs/web apps/auth flows/interaction tasks, or when `web_fetch` returns escalation hints (`javascript_required`, `spa_shell_only`, `empty_extraction`, `boilerplate_only`, `bot_blocked`).
279
+ - Cost profile: browser calls are typically ~10-100x slower/more expensive than `web_fetch`.
280
+ - Browser read flow: after `browser_navigate`, use `browser_snapshot` with `mode="full"` to extract content, then `browser_scroll` + `browser_snapshot` for additional lazy-loaded sections.
281
+ - `browser_pdf` is for export artifacts, not text extraction.
282
+
247
283
  - The shipped container image preinstalls `agent-browser` and Chromium (Playwright).
248
284
  - You can override the binary via `AGENT_BROWSER_BIN` if needed.
249
285
  - User-directed authenticated browser-flow testing is supported (including filling/submitting login forms on the requested site).
@@ -6,6 +6,9 @@
6
6
  "trustModelVersion": "",
7
7
  "trustModelAcceptedBy": ""
8
8
  },
9
+ "skills": {
10
+ "extraDirs": []
11
+ },
9
12
  "discord": {
10
13
  "prefix": "!claw"
11
14
  },
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "hybridclaw-agent",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "hybridclaw-agent",
9
- "version": "0.1.20",
9
+ "version": "0.1.22",
10
10
  "dependencies": {
11
11
  "@mozilla/readability": "^0.6.0",
12
12
  "agent-browser": "^0.15.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hybridclaw-agent",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "tsc",