@hybridaione/hybridclaw 0.2.3 → 0.2.7
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/.github/workflows/ci.yml +70 -0
- package/.husky/pre-commit +1 -0
- package/CHANGELOG.md +95 -0
- package/CONTRIBUTING.md +33 -0
- package/README.md +57 -19
- package/SECURITY.md +17 -0
- package/biome.json +35 -0
- package/config.example.json +72 -7
- package/container/package-lock.json +2 -2
- package/container/package.json +1 -1
- package/container/src/approval-policy.ts +1405 -0
- package/container/src/browser-tools.ts +672 -136
- package/container/src/extensions.ts +36 -12
- package/container/src/hybridai-client.ts +65 -16
- package/container/src/index.ts +463 -110
- package/container/src/ipc.ts +5 -3
- package/container/src/token-usage.ts +107 -18
- package/container/src/tools.ts +600 -225
- package/container/src/types.ts +49 -2
- package/container/src/web-fetch.ts +89 -32
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +15 -4
- package/dist/agent.js.map +1 -1
- package/dist/audit-cli.d.ts.map +1 -1
- package/dist/audit-cli.js +4 -2
- package/dist/audit-cli.js.map +1 -1
- package/dist/audit-events.d.ts.map +1 -1
- package/dist/audit-events.js +53 -3
- package/dist/audit-events.js.map +1 -1
- package/dist/audit-trail.d.ts.map +1 -1
- package/dist/audit-trail.js +17 -8
- package/dist/audit-trail.js.map +1 -1
- package/dist/channels/discord/attachments.d.ts.map +1 -1
- package/dist/channels/discord/attachments.js +14 -7
- package/dist/channels/discord/attachments.js.map +1 -1
- package/dist/channels/discord/debounce.d.ts +9 -0
- package/dist/channels/discord/debounce.d.ts.map +1 -0
- package/dist/channels/discord/debounce.js +20 -0
- package/dist/channels/discord/debounce.js.map +1 -0
- package/dist/channels/discord/delivery.d.ts +4 -1
- package/dist/channels/discord/delivery.d.ts.map +1 -1
- package/dist/channels/discord/delivery.js +24 -4
- package/dist/channels/discord/delivery.js.map +1 -1
- package/dist/channels/discord/human-delay.d.ts +16 -0
- package/dist/channels/discord/human-delay.d.ts.map +1 -0
- package/dist/channels/discord/human-delay.js +29 -0
- package/dist/channels/discord/human-delay.js.map +1 -0
- package/dist/channels/discord/inbound.d.ts +31 -0
- package/dist/channels/discord/inbound.d.ts.map +1 -1
- package/dist/channels/discord/inbound.js +156 -6
- package/dist/channels/discord/inbound.js.map +1 -1
- package/dist/channels/discord/mentions.d.ts.map +1 -1
- package/dist/channels/discord/mentions.js +16 -4
- package/dist/channels/discord/mentions.js.map +1 -1
- package/dist/channels/discord/presence.d.ts +33 -0
- package/dist/channels/discord/presence.d.ts.map +1 -0
- package/dist/channels/discord/presence.js +111 -0
- package/dist/channels/discord/presence.js.map +1 -0
- package/dist/channels/discord/rate-limiter.d.ts +14 -0
- package/dist/channels/discord/rate-limiter.d.ts.map +1 -0
- package/dist/channels/discord/rate-limiter.js +49 -0
- package/dist/channels/discord/rate-limiter.js.map +1 -0
- package/dist/channels/discord/reactions.d.ts +38 -0
- package/dist/channels/discord/reactions.d.ts.map +1 -0
- package/dist/channels/discord/reactions.js +151 -0
- package/dist/channels/discord/reactions.js.map +1 -0
- package/dist/channels/discord/runtime.d.ts +7 -4
- package/dist/channels/discord/runtime.d.ts.map +1 -1
- package/dist/channels/discord/runtime.js +755 -150
- package/dist/channels/discord/runtime.js.map +1 -1
- package/dist/channels/discord/stream.d.ts +4 -1
- package/dist/channels/discord/stream.d.ts.map +1 -1
- package/dist/channels/discord/stream.js +19 -12
- package/dist/channels/discord/stream.js.map +1 -1
- package/dist/channels/discord/tool-actions.d.ts.map +1 -1
- package/dist/channels/discord/tool-actions.js +24 -12
- package/dist/channels/discord/tool-actions.js.map +1 -1
- package/dist/channels/discord/typing.d.ts +15 -0
- package/dist/channels/discord/typing.d.ts.map +1 -0
- package/dist/channels/discord/typing.js +106 -0
- package/dist/channels/discord/typing.js.map +1 -0
- package/dist/chunk.d.ts.map +1 -1
- package/dist/chunk.js +4 -2
- package/dist/chunk.js.map +1 -1
- package/dist/cli.js +77 -23
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +24 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +113 -18
- package/dist/config.js.map +1 -1
- package/dist/container-runner.d.ts.map +1 -1
- package/dist/container-runner.js +59 -26
- package/dist/container-runner.js.map +1 -1
- package/dist/container-setup.d.ts.map +1 -1
- package/dist/container-setup.js +10 -9
- package/dist/container-setup.js.map +1 -1
- package/dist/conversation.d.ts +2 -2
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +1 -1
- package/dist/conversation.js.map +1 -1
- package/dist/db.d.ts +118 -2
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +1568 -50
- package/dist/db.js.map +1 -1
- package/dist/delegation-manager.d.ts.map +1 -1
- package/dist/delegation-manager.js +3 -2
- package/dist/delegation-manager.js.map +1 -1
- package/dist/gateway-client.d.ts +2 -2
- package/dist/gateway-client.d.ts.map +1 -1
- package/dist/gateway-client.js +10 -4
- package/dist/gateway-client.js.map +1 -1
- package/dist/gateway-service.d.ts +3 -3
- package/dist/gateway-service.d.ts.map +1 -1
- package/dist/gateway-service.js +624 -87
- package/dist/gateway-service.js.map +1 -1
- package/dist/gateway-types.d.ts +24 -0
- package/dist/gateway-types.d.ts.map +1 -1
- package/dist/gateway-types.js.map +1 -1
- package/dist/gateway.js +303 -26
- package/dist/gateway.js.map +1 -1
- package/dist/health.d.ts.map +1 -1
- package/dist/health.js +20 -10
- package/dist/health.js.map +1 -1
- package/dist/heartbeat.d.ts +4 -0
- package/dist/heartbeat.d.ts.map +1 -1
- package/dist/heartbeat.js +62 -20
- package/dist/heartbeat.js.map +1 -1
- package/dist/hybridai-bots.d.ts.map +1 -1
- package/dist/hybridai-bots.js +4 -2
- package/dist/hybridai-bots.js.map +1 -1
- package/dist/hybridai-models.d.ts +8 -0
- package/dist/hybridai-models.d.ts.map +1 -0
- package/dist/hybridai-models.js +94 -0
- package/dist/hybridai-models.js.map +1 -0
- package/dist/instruction-approval-audit.d.ts.map +1 -1
- package/dist/instruction-approval-audit.js.map +1 -1
- package/dist/instruction-integrity.d.ts.map +1 -1
- package/dist/instruction-integrity.js +8 -2
- package/dist/instruction-integrity.js.map +1 -1
- package/dist/ipc.d.ts.map +1 -1
- package/dist/ipc.js +6 -1
- package/dist/ipc.js.map +1 -1
- package/dist/logger.js.map +1 -1
- package/dist/memory-consolidation.d.ts +17 -0
- package/dist/memory-consolidation.d.ts.map +1 -0
- package/dist/memory-consolidation.js +25 -0
- package/dist/memory-consolidation.js.map +1 -0
- package/dist/memory-service.d.ts +200 -0
- package/dist/memory-service.d.ts.map +1 -0
- package/dist/memory-service.js +294 -0
- package/dist/memory-service.js.map +1 -0
- package/dist/mount-security.d.ts.map +1 -1
- package/dist/mount-security.js +31 -7
- package/dist/mount-security.js.map +1 -1
- package/dist/observability-ingest.d.ts.map +1 -1
- package/dist/observability-ingest.js +32 -11
- package/dist/observability-ingest.js.map +1 -1
- package/dist/onboarding.d.ts.map +1 -1
- package/dist/onboarding.js +32 -9
- package/dist/onboarding.js.map +1 -1
- package/dist/proactive-policy.d.ts.map +1 -1
- package/dist/proactive-policy.js +2 -1
- package/dist/proactive-policy.js.map +1 -1
- package/dist/prompt-hooks.d.ts.map +1 -1
- package/dist/prompt-hooks.js +11 -7
- package/dist/prompt-hooks.js.map +1 -1
- package/dist/runtime-config.d.ts +104 -1
- package/dist/runtime-config.d.ts.map +1 -1
- package/dist/runtime-config.js +503 -24
- package/dist/runtime-config.js.map +1 -1
- package/dist/scheduled-task-runner.d.ts +1 -0
- package/dist/scheduled-task-runner.d.ts.map +1 -1
- package/dist/scheduled-task-runner.js +43 -10
- package/dist/scheduled-task-runner.js.map +1 -1
- package/dist/scheduler.d.ts +43 -4
- package/dist/scheduler.d.ts.map +1 -1
- package/dist/scheduler.js +530 -56
- package/dist/scheduler.js.map +1 -1
- package/dist/session-export.d.ts +26 -0
- package/dist/session-export.d.ts.map +1 -0
- package/dist/session-export.js +149 -0
- package/dist/session-export.js.map +1 -0
- package/dist/session-maintenance.d.ts.map +1 -1
- package/dist/session-maintenance.js +75 -13
- package/dist/session-maintenance.js.map +1 -1
- package/dist/session-transcripts.d.ts.map +1 -1
- package/dist/session-transcripts.js.map +1 -1
- package/dist/side-effects.d.ts.map +1 -1
- package/dist/side-effects.js +14 -2
- package/dist/side-effects.js.map +1 -1
- package/dist/skills-guard.d.ts.map +1 -1
- package/dist/skills-guard.js +893 -130
- package/dist/skills-guard.js.map +1 -1
- package/dist/skills.d.ts +5 -0
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +29 -15
- package/dist/skills.js.map +1 -1
- package/dist/token-efficiency.d.ts.map +1 -1
- package/dist/token-efficiency.js.map +1 -1
- package/dist/tui.js +92 -11
- package/dist/tui.js.map +1 -1
- package/dist/types.d.ts +150 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +24 -1
- package/dist/types.js.map +1 -1
- package/dist/update.d.ts.map +1 -1
- package/dist/update.js +42 -14
- package/dist/update.js.map +1 -1
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +49 -9
- package/dist/workspace.js.map +1 -1
- package/docs/chat.html +9 -3
- package/docs/index.html +72 -13
- package/package.json +8 -2
- package/src/agent.ts +31 -4
- package/src/audit-cli.ts +44 -16
- package/src/audit-events.ts +69 -5
- package/src/audit-trail.ts +41 -15
- package/src/channels/discord/attachments.ts +81 -27
- package/src/channels/discord/debounce.ts +25 -0
- package/src/channels/discord/delivery.ts +65 -14
- package/src/channels/discord/human-delay.ts +48 -0
- package/src/channels/discord/inbound.ts +190 -8
- package/src/channels/discord/mentions.ts +42 -18
- package/src/channels/discord/presence.ts +148 -0
- package/src/channels/discord/rate-limiter.ts +58 -0
- package/src/channels/discord/reactions.ts +211 -0
- package/src/channels/discord/runtime.ts +1161 -205
- package/src/channels/discord/stream.ts +85 -31
- package/src/channels/discord/tool-actions.ts +78 -37
- package/src/channels/discord/typing.ts +140 -0
- package/src/chunk.ts +12 -4
- package/src/cli.ts +174 -57
- package/src/config.ts +208 -36
- package/src/container-runner.ts +134 -42
- package/src/container-setup.ts +57 -22
- package/src/conversation.ts +9 -7
- package/src/db.ts +2217 -84
- package/src/delegation-manager.ts +6 -2
- package/src/gateway-client.ts +41 -17
- package/src/gateway-service.ts +996 -220
- package/src/gateway-types.ts +33 -0
- package/src/gateway.ts +487 -52
- package/src/health.ts +66 -26
- package/src/heartbeat.ts +99 -22
- package/src/hybridai-bots.ts +14 -5
- package/src/hybridai-models.ts +158 -0
- package/src/instruction-approval-audit.ts +4 -1
- package/src/instruction-integrity.ts +30 -9
- package/src/ipc.ts +23 -5
- package/src/logger.ts +4 -1
- package/src/memory-consolidation.ts +41 -0
- package/src/memory-service.ts +606 -0
- package/src/mount-security.ts +58 -13
- package/src/observability-ingest.ts +134 -35
- package/src/onboarding.ts +126 -35
- package/src/proactive-policy.ts +3 -1
- package/src/prompt-hooks.ts +42 -17
- package/src/runtime-config.ts +1112 -122
- package/src/scheduled-task-runner.ts +77 -11
- package/src/scheduler.ts +683 -60
- package/src/session-export.ts +196 -0
- package/src/session-maintenance.ts +125 -22
- package/src/session-transcripts.ts +12 -3
- package/src/side-effects.ts +28 -5
- package/src/skills-guard.ts +1067 -219
- package/src/skills.ts +163 -65
- package/src/token-efficiency.ts +31 -9
- package/src/tui.ts +166 -25
- package/src/types.ts +199 -2
- package/src/update.ts +79 -23
- package/src/workspace.ts +63 -11
- package/tests/approval-policy.test.ts +335 -0
- package/tests/discord.basic.test.ts +213 -4
- package/tests/discord.human-presence.test.ts +85 -0
- package/tests/gateway-service.media-routing.test.ts +8 -2
- package/tests/hybridai-client.test.ts +112 -0
- package/tests/hybridai-models.test.ts +46 -0
- package/tests/memory-service.test.ts +1114 -0
- package/tests/token-efficiency.basic.test.ts +8 -2
- package/tests/token-usage.cache.test.ts +128 -0
- package/vitest.e2e.config.ts +3 -1
- package/vitest.integration.config.ts +3 -1
- package/vitest.live.config.ts +3 -1
- package/vitest.unit.config.ts +9 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
unit-tests:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Setup Node.js
|
|
17
|
+
uses: actions/setup-node@v4
|
|
18
|
+
with:
|
|
19
|
+
node-version: 22
|
|
20
|
+
cache: npm
|
|
21
|
+
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: npm install
|
|
24
|
+
|
|
25
|
+
- name: Install container dependencies
|
|
26
|
+
run: npm run setup
|
|
27
|
+
|
|
28
|
+
- name: Biome check (changed files)
|
|
29
|
+
shell: bash
|
|
30
|
+
run: |
|
|
31
|
+
set -euo pipefail
|
|
32
|
+
|
|
33
|
+
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
|
34
|
+
BASE_SHA="${{ github.event.pull_request.base.sha }}"
|
|
35
|
+
else
|
|
36
|
+
BASE_SHA="${{ github.event.before }}"
|
|
37
|
+
fi
|
|
38
|
+
HEAD_SHA="${{ github.sha }}"
|
|
39
|
+
|
|
40
|
+
FILES=()
|
|
41
|
+
if [[ -z "${BASE_SHA}" || "${BASE_SHA}" == "0000000000000000000000000000000000000000" ]]; then
|
|
42
|
+
while IFS= read -r file; do
|
|
43
|
+
[[ -n "${file}" ]] && FILES+=("${file}")
|
|
44
|
+
done < <(git ls-files src | grep -E '^src/.*\.(ts|tsx|js|jsx)$' || true)
|
|
45
|
+
else
|
|
46
|
+
while IFS= read -r file; do
|
|
47
|
+
[[ -n "${file}" ]] && FILES+=("${file}")
|
|
48
|
+
done < <(
|
|
49
|
+
git diff --name-only --diff-filter=ACMRT "${BASE_SHA}" "${HEAD_SHA}" \
|
|
50
|
+
| grep -E '^src/.*\.(ts|tsx|js|jsx)$' || true
|
|
51
|
+
)
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
if [[ "${#FILES[@]}" -eq 0 ]]; then
|
|
55
|
+
echo "No changed source files for Biome check."
|
|
56
|
+
exit 0
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
echo "Running Biome on changed files:"
|
|
60
|
+
printf ' - %s\n' "${FILES[@]}"
|
|
61
|
+
npx biome check "${FILES[@]}"
|
|
62
|
+
|
|
63
|
+
- name: TypeScript lint (root)
|
|
64
|
+
run: npm run lint
|
|
65
|
+
|
|
66
|
+
- name: TypeScript lint (container)
|
|
67
|
+
run: npm --prefix container run lint
|
|
68
|
+
|
|
69
|
+
- name: Unit tests with coverage
|
|
70
|
+
run: npx vitest run --coverage --config vitest.unit.config.ts
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
npx biome check --write --staged
|
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,107 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
No unreleased changes.
|
|
6
|
+
|
|
7
|
+
## [0.2.7](https://github.com/HybridAIOne/hybridclaw/tree/v0.2.7)
|
|
8
|
+
|
|
5
9
|
### Added
|
|
6
10
|
|
|
11
|
+
- **Private approval slash command**: Added `/approve` with private (ephemeral) responses for `view`, `yes`, `session`, `agent`, and `no`, including optional `approval_id`.
|
|
12
|
+
- **Static model context-window catalog**: Added curated context-window mappings (Claude/Gemini/GPT-5 families) plus family-aware model-id fallback matching for session status metrics without runtime model-list fetches.
|
|
13
|
+
- **Discord command access + output controls**: Added runtime config support for `discord.commandMode`, `discord.commandAllowedUserIds`, `discord.textChunkLimit`, and `discord.maxLinesPerMessage`.
|
|
14
|
+
- **HybridAI completion budget control**: Added `hybridai.maxTokens` runtime setting and request wiring (`max_tokens`) for container model calls.
|
|
15
|
+
|
|
7
16
|
### Changed
|
|
8
17
|
|
|
18
|
+
- **Approval prompt visibility in Discord**: Channel responses now post a minimal “approval required” notice and move full approval details/decisions into private slash-command responses (`/approve`), matching the visibility pattern of `/status`.
|
|
19
|
+
- **Discord command handler context**: Command execution now receives invoking `userId` and `username` so approval actions can be scoped to the requesting user.
|
|
20
|
+
- **Discord slash command discoverability**: `/status` and `/approve` are now upserted globally for DM visibility while guild-only authorization checks remain enforced in servers.
|
|
21
|
+
- **Discord free-mode message relevance gating**: Free-mode replies now skip low-signal acknowledgements/URL-only chatter and avoid jumping in when other users are explicitly mentioned.
|
|
22
|
+
- **Status context usage reporting**: Session status now derives context usage from usage telemetry and static model context-window resolution instead of char-budget estimation only.
|
|
23
|
+
- **Approval parsing and trust scoping**: Approval response parsing now handles mention-prefixed/batched messages, and network trust scopes now normalize hosts to broader domain scopes.
|
|
24
|
+
- **Prompt dump diagnostics**: `data/last_prompt.jsonl` now includes media context plus allowed/blocked tool lists for richer debugging context.
|
|
25
|
+
|
|
9
26
|
### Fixed
|
|
10
27
|
|
|
28
|
+
- **Google Images/Lens upload compatibility**: `browser_upload` now supports CSS-selector targets and automatically falls back from wrapper refs to detected `input[type="file"]` selectors when upload fails with non-input elements.
|
|
29
|
+
- **Install-root container bootstrap**: CLI container readiness checks now resolve the package install root, preventing false build failures when invoked from non-package working directories.
|
|
30
|
+
- **DM slash command registration regression**: Restored reliable discovery/usage of HybridClaw slash commands in Discord DMs.
|
|
31
|
+
|
|
32
|
+
## [0.2.6](https://github.com/HybridAIOne/hybridclaw/tree/v0.2.6)
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
- **Memory consolidation runtime controls**: Added `memory.decayRate` and `memory.consolidationIntervalHours` config support, plus gateway-managed periodic consolidation scheduling.
|
|
37
|
+
- **Scheduler job runtime metadata**: Added optional `scheduler.jobs[].name` / `description`, persisted `nextRunAt`, and scheduler status surfaces for runtime visibility.
|
|
38
|
+
- **Scheduler status API typing**: Added gateway status typing for scheduler jobs (`id`, `name`, `description`, `enabled`, `lastRun`, `lastStatus`, `nextRunAt`, `disabled`, `consecutiveErrors`).
|
|
39
|
+
- **CLI version flag**: Added top-level `hybridclaw --version` / `-v`.
|
|
40
|
+
- **Memory substrate architecture**: Added full SQLite-backed memory layers for structured KV (`kv_store`), semantic memory (`semantic_memories` with optional embeddings), knowledge graph (`entities` + `relations`), canonical cross-channel sessions, and usage events.
|
|
41
|
+
- **Knowledge graph model + APIs**: Added typed entity/relation enums (with custom value support), relation traversal query APIs, and normalized serialization/parsing for graph properties.
|
|
42
|
+
- **Canonical cross-channel sessions**: Added `canonical_sessions` persistence keyed by `(agent_id, user_id)` with rolling window retention, compaction summaries, and current-session exclusion support at recall time.
|
|
43
|
+
- **Usage aggregation layer**: Added `usage_events` persistence plus aggregation queries (daily/monthly totals, by-agent, by-model, and daily breakdown) and gateway `usage` command surface.
|
|
44
|
+
- **JSONL session export tools**: Added manual `export session [sessionId]` command and automatic compaction exports to `.session-exports/` for debugging and human review.
|
|
45
|
+
- **Memory service abstraction**: Added `MemoryService` + pluggable backend interface for session/memory access, semantic recall, knowledge graph APIs, canonical recall, and compaction helpers.
|
|
46
|
+
- **Memory consolidation engine**: Added consolidation engine + report model for periodic semantic decay operations.
|
|
47
|
+
- **Discord command namespace expansion**: Added `usage` and `export` command parsing support.
|
|
48
|
+
- **Coverage expansion**: Added comprehensive memory/DB unit tests (`tests/memory-service.test.ts`) and Discord parsing coverage for `usage`.
|
|
49
|
+
|
|
50
|
+
### Changed
|
|
51
|
+
|
|
52
|
+
- **Session compaction controls**: Added token-budget compaction knobs (`sessionCompaction.tokenBudget`, `sessionCompaction.budgetRatio`) and exposed them in config normalization + example config.
|
|
53
|
+
- **Gateway runtime scheduling**: Gateway now starts/restarts memory consolidation when runtime config changes and stops it cleanly on shutdown.
|
|
54
|
+
- **Heartbeat memory path**: Heartbeat turns now use `MemoryService` for session retrieval, prompt-memory context, and turn persistence.
|
|
55
|
+
- **Scheduler observability depth**: Scheduler now tracks and persists `nextRunAt`, includes job labels in logs, and keeps runtime state synchronized for status consumers.
|
|
56
|
+
- **Approval UX wording**: Red-tier approval prompt now instructs users to deny with `no` (alias `4`) instead of `skip`.
|
|
57
|
+
- **Prompt wording clarity**: Session summary hook text now explicitly frames memory as compressed/recalled durable context.
|
|
58
|
+
- **Runtime hygiene sweep**: Applied project-wide lint/import-order/format cleanup across gateway/runtime modules (audit, Discord channels, container runtime, onboarding, observability, skills/security, and Vitest configs) without behavior changes.
|
|
59
|
+
- **Schema migrations**: Replaced ad-hoc bootstrapping with versioned `user_version` migrations (including forward-version guard) and migration records.
|
|
60
|
+
- **Memory context injection**: Gateway prompt assembly now includes canonical cross-channel recall (summary + recent messages) while excluding the current session to avoid duplicate context.
|
|
61
|
+
- **SQLite migration baseline**: Introduced schema version `4` with explicit `user_version` migrations for canonical and usage tables.
|
|
62
|
+
- **SQLite concurrency defaults**: Database initialization now enforces `PRAGMA journal_mode=WAL` and `PRAGMA busy_timeout=5000` for better concurrent read behavior.
|
|
63
|
+
- **Gateway memory integration**: Gateway flows now route session/history/memory operations through `MemoryService`, append canonical turns after successful responses, and record usage events from model telemetry.
|
|
64
|
+
- **Compaction instrumentation**: Session maintenance now exports compacted snapshots to JSONL and records richer compaction diagnostics.
|
|
65
|
+
- **Scheduled usage accounting**: Isolated scheduled task runs now record usage events for aggregation parity with interactive turns.
|
|
66
|
+
|
|
67
|
+
## [0.2.5](https://github.com/HybridAIOne/hybridclaw/tree/v0.2.5)
|
|
68
|
+
|
|
69
|
+
### Added
|
|
70
|
+
|
|
71
|
+
- **Trusted-coworker approval flow**: Added green/yellow/red approval runtime with contextual red prompts and support for `yes`, `yes for session`, `yes for agent`, and `skip` (including `1/2/3/4` shorthand replies).
|
|
72
|
+
- **TUI approval selector**: Added an interactive TUI approval menu for pending red actions to reduce reply friction while preserving explicit consent.
|
|
73
|
+
- **Agent-scoped approval trust persistence**: Added durable per-agent trust state in `.hybridclaw/approval-trust.json` for `yes for agent` decisions.
|
|
74
|
+
|
|
75
|
+
### Changed
|
|
76
|
+
|
|
77
|
+
- **Approval policy location**: Moved policy configuration from `.claude/policy.yaml` to `.hybridclaw/policy.yaml` and updated workspace bootstrap seeding/docs accordingly.
|
|
78
|
+
- **Yellow-tier timing**: Increased yellow implicit approval countdown from 2s to 5s and simplified yellow narration text.
|
|
79
|
+
- **CI quality gates**: Updated CI to install container dependencies and enforce changed-file Biome checks plus root/container TypeScript lint before running unit tests.
|
|
80
|
+
|
|
81
|
+
### Fixed
|
|
82
|
+
|
|
83
|
+
- **Pinned red trust behavior**: Pinned-red actions now correctly reject session/agent trust promotion and fall back to one-time approval only.
|
|
84
|
+
- **Approval audit classification**: Approval audit events now mark `approved_agent` decisions as approved and include richer approval reason metadata.
|
|
85
|
+
|
|
86
|
+
## [0.2.4](https://github.com/HybridAIOne/hybridclaw/tree/v0.2.4)
|
|
87
|
+
|
|
88
|
+
### Added
|
|
89
|
+
|
|
90
|
+
- **Dynamic Discord self-presence states**: Added health-aware presence management that maps runtime state to Discord status (`online`, `idle`, `dnd`) and applies maintenance `invisible` presence during shutdown.
|
|
91
|
+
- **Config-backed proactive scheduler jobs**: Added `scheduler.jobs[]` runtime jobs with `cron`/`every`/`at` schedules, `agent_turn`/`system_event` actions, and `channel`/`last-channel`/`webhook` delivery targets.
|
|
92
|
+
- **Scheduler metadata persistence for config jobs**: Added atomic persisted state at `data/scheduler-jobs-state.json` for per-job `lastRun`, `lastStatus`, `consecutiveErrors`, `disabled`, and one-shot completion tracking.
|
|
93
|
+
- **Discord humanization behaviors**: Added time-of-day/weekend pacing, conversation cooldown scaling after long back-and-forth, selective silence in active group channels, short-ack read-without-reply reactions, and reconnect startup staggering.
|
|
94
|
+
|
|
95
|
+
### Changed
|
|
96
|
+
|
|
97
|
+
- **Scheduler execution model**: Scheduler now co-schedules legacy DB tasks and config jobs in one timer loop with consistent due-time arming and persisted per-job error recovery behavior.
|
|
98
|
+
- **Discord inbound debounce behavior**: Debounce batching now skips immediate flush delays for commands/media and keeps per-channel debounce tuning for normal chat messages.
|
|
99
|
+
- **Documentation sync for Discord humanization/scheduler controls**: Updated README and site docs to cover health-driven presence, proactive job config, and human-like reply pacing behavior.
|
|
100
|
+
|
|
101
|
+
### Fixed
|
|
102
|
+
|
|
103
|
+
- **Uncanny Discord response timing**: Reduced robotic burst behavior by adding natural delay variation over long exchanges and reconnect bursts.
|
|
104
|
+
- **Over-eager group replies**: Free-mode channels now avoid unnecessary follow-up replies when another participant likely already answered.
|
|
105
|
+
|
|
11
106
|
## [0.2.3](https://github.com/HybridAIOne/hybridclaw/tree/v0.2.3)
|
|
12
107
|
|
|
13
108
|
### Added
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## Development setup
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
`npm install` runs the `prepare` script and installs Husky git hooks.
|
|
10
|
+
|
|
11
|
+
## Code quality checks
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# TypeScript checks
|
|
15
|
+
npm run typecheck
|
|
16
|
+
npm run lint
|
|
17
|
+
|
|
18
|
+
# Biome (lint + formatting + import sorting)
|
|
19
|
+
npm run check
|
|
20
|
+
|
|
21
|
+
# Apply Biome fixes to src
|
|
22
|
+
npm run format
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Git hooks
|
|
26
|
+
|
|
27
|
+
This repo uses Husky with a pre-commit hook:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx biome check --write --staged
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Before committing, stage your files (`git add ...`). The hook validates and auto-formats staged changes.
|
package/README.md
CHANGED
|
@@ -11,15 +11,17 @@ npm install -g @hybridaione/hybridclaw
|
|
|
11
11
|
hybridclaw onboarding
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Latest release: [v0.2.
|
|
14
|
+
Latest release: [v0.2.7](https://github.com/HybridAIOne/hybridclaw/releases/tag/v0.2.7)
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Release highlights (v0.2.7)
|
|
17
17
|
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
18
|
+
- Private approval flow via `/approve [view|yes|session|agent|no] [approval_id]` with ephemeral responses, and DM-ready global slash registration for `/status` + `/approve`.
|
|
19
|
+
- Discord command access controls now support `discord.commandMode` (`public|restricted`) plus `discord.commandAllowedUserIds` (with legacy `commandUserId` compatibility).
|
|
20
|
+
- Free-mode Discord replies now apply stronger relevance gating (for example short acknowledgements/URL-only chatter are skipped, and messages mentioning other users are de-prioritized).
|
|
21
|
+
- `browser_upload` now supports selector targets and automatic fallback from wrapper refs to detected `input[type="file"]` elements.
|
|
22
|
+
- HybridAI status/usage context metrics now use a curated static context-window catalog (Claude/Gemini/GPT-5) with family-aware fallback matching, and runtime supports `hybridai.maxTokens` for default completion budgeting.
|
|
23
|
+
- Model-usage telemetry now captures cache read/write token counters where providers expose them, and prompt-dump diagnostics include media plus allowed/blocked tool context.
|
|
24
|
+
- CLI container readiness checks now resolve the package install root to avoid non-root invocation failures.
|
|
23
25
|
|
|
24
26
|
## HybridAI Advantage
|
|
25
27
|
|
|
@@ -32,7 +34,7 @@ Latest release: [v0.2.3](https://github.com/HybridAIOne/hybridclaw/releases/tag/
|
|
|
32
34
|
|
|
33
35
|
## Architecture
|
|
34
36
|
|
|
35
|
-
- **Gateway service** (Node.js) — shared message/command handlers, SQLite persistence, scheduler, heartbeat, web/API, and optional Discord integration
|
|
37
|
+
- **Gateway service** (Node.js) — shared message/command handlers, SQLite persistence (KV + semantic + knowledge graph + canonical sessions + usage events), scheduler, heartbeat, web/API, and optional Discord integration
|
|
36
38
|
- **TUI client** — thin client over HTTP (`/api/chat`, `/api/command`)
|
|
37
39
|
- **Container** (Docker, ephemeral) — HybridAI API client, sandboxed tool executor, and preinstalled browser automation runtime
|
|
38
40
|
- Communication via file-based IPC (input.json / output.json)
|
|
@@ -40,7 +42,7 @@ Latest release: [v0.2.3](https://github.com/HybridAIOne/hybridclaw/releases/tag/
|
|
|
40
42
|
## Quick start
|
|
41
43
|
|
|
42
44
|
```bash
|
|
43
|
-
# Install dependencies
|
|
45
|
+
# Install dependencies
|
|
44
46
|
npm install
|
|
45
47
|
|
|
46
48
|
# Run onboarding (also auto-runs on first `gateway`/`tui` start if API key is missing)
|
|
@@ -84,14 +86,18 @@ HybridClaw best-in-class capabilities:
|
|
|
84
86
|
|
|
85
87
|
- explicit trust-model acceptance during onboarding (recorded in `config.json`)
|
|
86
88
|
- typed `config.json` runtime settings with defaults, validation, and hot reload
|
|
87
|
-
- formal prompt hook orchestration (`bootstrap`, `memory`, `safety`)
|
|
88
|
-
-
|
|
89
|
+
- formal prompt hook orchestration (`bootstrap`, `memory`, `safety`, `proactivity`)
|
|
90
|
+
- layered memory substrate: structured KV, semantic memory, typed knowledge graph entities/relations, canonical cross-channel sessions, and usage event persistence
|
|
91
|
+
- lightweight DB evolution and concurrency hardening via `PRAGMA user_version` migrations, `journal_mode=WAL`, and `busy_timeout=5000`
|
|
92
|
+
- Discord conversational UX: edit-in-place streaming responses, fence-safe chunking beyond Discord's 2000-char limit, phase-aware typing/reactions, adaptive debounce batching, per-user rate limits, health-driven self-presence, reply-chain-aware context, concise attachment-first screenshot replies, and humanized pacing (time-of-day slowdown, cooldown scaling, selective silence, read-without-reply, startup staggering)
|
|
89
93
|
- token-efficient context assembly: per-message history truncation, hard history budgets with head/tail preservation, and head/tail truncation for oversized bootstrap files
|
|
90
94
|
- runtime self-awareness in prompts: exact HybridClaw version/date, model, and runtime host metadata injected each turn for reliable "what version/model are you?" answers
|
|
91
95
|
- proactive runtime layer with active-hours gating, push delegation (`single`/`parallel`/`chain`), depth-aware tool policy, and retry controls
|
|
96
|
+
- trusted-coworker approval model for tool execution: Green (`just run`), Yellow (`narrate + 5s interrupt window`), Red (`explicit approval`) with `yes` (once), `yes for session`, `yes for agent`, and explicit deny (`no`, also `4`) plus pinned-red protections
|
|
92
97
|
- structured audit trail: append-only hash-chained wire logs (`data/audit/<session>/wire.jsonl`) with tamper-evident immutability, normalized SQLite audit tables, and verification/search CLI commands
|
|
93
98
|
- observability export: incremental `events:batch` forwarding with durable cursor tracking and bot-scoped ingest token lifecycle via `ingest-token:ensure`
|
|
94
99
|
- model token telemetry in audit/observability events (`model.usage`) with API usage + deterministic fallback estimates
|
|
100
|
+
- built-in usage aggregation (`usage summary|daily|monthly|model`) plus JSONL session exports (`export session [sessionId]`) for cost/debug visibility
|
|
95
101
|
- gateway lifecycle controls: managed + unmanaged restart/stop flows with graceful shutdown fallback paths
|
|
96
102
|
- instruction-integrity approval flow: core instruction docs (`AGENTS.md`, `SECURITY.md`, `TRUST_MODEL.md`) are hash-verified against a local approved baseline before TUI start
|
|
97
103
|
|
|
@@ -103,13 +109,36 @@ HybridClaw uses typed runtime config in `config.json` (auto-created on first run
|
|
|
103
109
|
- Runtime watches `config.json` and hot-reloads most settings (model defaults, heartbeat, prompt hooks, limits, etc.)
|
|
104
110
|
- `discord.guildMembersIntent` enables richer guild member context and better `@name` mention resolution in replies (requires enabling **Server Members Intent** in Discord Developer Portal)
|
|
105
111
|
- `discord.presenceIntent` enables Discord presence events (requires enabling **Presence Intent** in Discord Developer Portal)
|
|
106
|
-
- `discord.respondToAllMessages`
|
|
107
|
-
- `discord.
|
|
108
|
-
- `discord.
|
|
109
|
-
- `discord.
|
|
112
|
+
- `discord.respondToAllMessages` is a global fallback for open-policy guild channels without explicit mode config (`false` mention-gated, `true` free-response)
|
|
113
|
+
- `discord.commandMode` controls command access: `public` (any user can run slash/`!claw` commands) or `restricted` (only allowlisted users can run slash/`!claw` commands)
|
|
114
|
+
- `discord.commandAllowedUserIds` is the allowlist used when `discord.commandMode` is `restricted`
|
|
115
|
+
- `discord.commandUserId` is a legacy single-user allowlist alias; when set without `commandMode`, runtime treats command access as `restricted` for backward compatibility
|
|
116
|
+
- `discord.commandsOnly` optional hard mode: if `true`, the bot ignores non-`!claw` messages and only accepts prefixed commands (still subject to `discord.commandMode`)
|
|
117
|
+
- `discord.groupPolicy` controls guild channel scope: `open` (default, mention-first unless a channel is set to `free`), `allowlist`, or `disabled`
|
|
110
118
|
- `discord.freeResponseChannels` is a Hermes-style channel ID list that gets free-response behavior while other channels remain mention-gated
|
|
111
|
-
- `discord.
|
|
112
|
-
-
|
|
119
|
+
- `discord.textChunkLimit` controls Discord message chunk size (default `2000`)
|
|
120
|
+
- `discord.maxLinesPerMessage` controls max lines per Discord chunk (default `17`)
|
|
121
|
+
- `discord.humanDelay` controls natural delays between multi-part messages (`off|natural|custom`)
|
|
122
|
+
- `discord.typingMode` controls typing indicator lifecycle (`instant|thinking|streaming|never`)
|
|
123
|
+
- `discord.presence.*` enables dynamic self-presence health states (healthy/degraded/exhausted mapped to `online|idle|dnd`, plus maintenance `invisible` during shutdown)
|
|
124
|
+
- `discord.lifecycleReactions.*` enables phase emoji transitions (`queued|thinking|toolUse|streaming|done|error`)
|
|
125
|
+
- approval policy layer is configured via `.hybridclaw/policy.yaml` (`approval.pinned_red`, `workspace_fence`, pending/timeout controls, audit toggles)
|
|
126
|
+
- `discord.ackReaction`, `discord.ackReactionScope`, and `discord.removeAckAfterReply` control acknowledgment reaction behavior
|
|
127
|
+
- `discord.debounceMs` controls default inbound debounce; channel overrides can tune noisy channels
|
|
128
|
+
- `discord.rateLimitPerUser` and `discord.rateLimitExemptRoles` enforce per-user sliding-window limits
|
|
129
|
+
- `discord.suppressPatterns` blocks auto-reply triggers for suppression terms (case-insensitive)
|
|
130
|
+
- `discord.maxConcurrentPerChannel` limits concurrent in-flight runs per channel
|
|
131
|
+
- `discord.guilds.<guildId>.defaultMode` sets that guild's fallback mode in `open` policy (`mention` recommended)
|
|
132
|
+
- `discord.guilds.<guildId>.channels.<channelId>.*` supports per-channel mode and behavior overrides (`mode`, `typingMode`, `debounceMs`, `ackReaction*`, `humanDelay`, `rateLimitPerUser`, `suppressPatterns`, `maxConcurrentPerChannel`)
|
|
133
|
+
- `scheduler.jobs[]` defines config-backed proactive jobs with `schedule.kind` (`cron|every|at`), `action.kind` (`agent_turn|system_event`), and delivery targets (`channel|last-channel|webhook`)
|
|
134
|
+
- `scheduler.jobs[].name` / `scheduler.jobs[].description` add optional human-readable labels for status/log output; runtime status persists `nextRunAt`
|
|
135
|
+
- Config scheduler job metadata (last status, consecutive errors, one-shot completion) persists atomically in `data/scheduler-jobs-state.json`
|
|
136
|
+
- Config scheduler jobs auto-disable after repeated failures (5 consecutive errors) and one-shot jobs retry on a bounded interval until successful
|
|
137
|
+
- `memory.decayRate` and `memory.consolidationIntervalHours` control semantic-memory consolidation intensity/cadence
|
|
138
|
+
- `sessionCompaction.tokenBudget` and `sessionCompaction.budgetRatio` tune compaction token budgeting behavior
|
|
139
|
+
- Built-in Discord humanization behaviors include night/weekend pacing, post-exchange cooldown scaling (after 5+ exchanges, reset after 20 minutes idle), selective silence in active free-mode channels, short-ack read reactions, and reconnect staggered dequeue
|
|
140
|
+
- Per-guild/per-channel mode takes precedence over `discord.respondToAllMessages`
|
|
141
|
+
- Discord slash commands: `/status`, `/approve [view|yes|session|agent|no] [approval_id]`, `/channel-mode <off|mention|free>`, and `/channel-policy <open|allowlist|disabled>` (ephemeral replies)
|
|
113
142
|
- `skills.extraDirs` adds additional enterprise/shared skill roots (lowest precedence tier)
|
|
114
143
|
- `proactive.*` controls autonomous behavior (`activeHours`, `delegation`, `autoRetry`, `ralph`)
|
|
115
144
|
- `proactive.ralph.maxIterations` enables Ralph loop (`0` off, `-1` unlimited, `>0` extra autonomous iterations before forcing completion)
|
|
@@ -117,6 +146,7 @@ HybridClaw uses typed runtime config in `config.json` (auto-created on first run
|
|
|
117
146
|
- `observability.*` controls push ingest into HybridAI (`events:batch` endpoint, batching, identity metadata)
|
|
118
147
|
- Some settings require restart to fully apply (for example HTTP bind host/port)
|
|
119
148
|
- Default bot is configured via `hybridai.defaultChatbotId` in `config.json`
|
|
149
|
+
- `hybridai.maxTokens` sets the default completion budget per model call (default `4096`)
|
|
120
150
|
|
|
121
151
|
Secrets remain in `.env`:
|
|
122
152
|
|
|
@@ -313,7 +343,7 @@ The agent has access to these sandboxed tools inside the container:
|
|
|
313
343
|
- `session_search` — search/summarize historical sessions from transcript archives
|
|
314
344
|
- `delegate` — push-based background subagent tasks (`single`, `parallel`, `chain`) with auto-announced completion (no polling)
|
|
315
345
|
- `web_fetch` — plain HTTP fetch + extraction for static/read-only content (docs, articles, READMEs, JSON/text APIs, direct files)
|
|
316
|
-
- `browser_*` (optional) — full browser automation for JS-rendered or interactive pages (`navigate`, `snapshot`, `click`, `type`, `press`, `scroll`, `back`, `screenshot`, `pdf`, `close`)
|
|
346
|
+
- `browser_*` (optional) — full browser automation for JS-rendered or interactive pages (`navigate`, `snapshot`, `click`, `type`, `upload`, `press`, `scroll`, `back`, `screenshot`, `pdf`, `close`)
|
|
317
347
|
|
|
318
348
|
`delegate` mode examples:
|
|
319
349
|
|
|
@@ -343,6 +373,9 @@ HybridClaw also supports automatic session compaction with pre-compaction memory
|
|
|
343
373
|
|
|
344
374
|
- when a session gets long, old turns are summarized into `session_summary`
|
|
345
375
|
- before compaction, the agent gets a `memory`-only flush turn to persist durable notes
|
|
376
|
+
- each `(agent_id, user_id)` pair also maintains a canonical cross-channel session for continuity across channels
|
|
377
|
+
- canonical context injection includes compacted summary + recent cross-channel messages (excluding the current live session)
|
|
378
|
+
- compaction writes JSONL exports to `<workspace>/.session-exports/` for human-readable debugging
|
|
346
379
|
|
|
347
380
|
System prompt assembly is handled by a formal hook pipeline:
|
|
348
381
|
|
|
@@ -385,6 +418,7 @@ Test layout and scopes:
|
|
|
385
418
|
|
|
386
419
|
CLI runtime commands:
|
|
387
420
|
|
|
421
|
+
- `hybridclaw --version` / `-v` — Print installed HybridClaw version
|
|
388
422
|
- `hybridclaw gateway start [--foreground]` — Start gateway (backend by default; foreground with flag)
|
|
389
423
|
- `hybridclaw gateway restart [--foreground]` — Restart managed gateway backend process
|
|
390
424
|
- `hybridclaw gateway stop` — Stop managed gateway backend process
|
|
@@ -406,7 +440,11 @@ In Discord, use `!claw help` to see all commands. Key ones:
|
|
|
406
440
|
- `!claw audit verify [sessionId]` — Verify audit hash chain integrity
|
|
407
441
|
- `!claw audit search <query>` — Search structured audit history
|
|
408
442
|
- `!claw audit approvals [n] [--denied]` — Show policy approval decisions
|
|
409
|
-
- `!claw
|
|
443
|
+
- `!claw usage [summary|daily|monthly|model [daily|monthly] [agentId]]` — Show token/cost aggregates
|
|
444
|
+
- `!claw export session [sessionId]` — Export session snapshot as JSONL
|
|
445
|
+
- `!claw schedule add "<cron>" <prompt>` — Add cron scheduled task
|
|
446
|
+
- `!claw schedule add at "<ISO time>" <prompt>` — Add one-shot task
|
|
447
|
+
- `!claw schedule add every <ms> <prompt>` — Add interval task
|
|
410
448
|
|
|
411
449
|
## Project structure
|
|
412
450
|
|
package/SECURITY.md
CHANGED
|
@@ -40,6 +40,23 @@ Before tool execution, HybridClaw applies policy hooks that block known dangerou
|
|
|
40
40
|
|
|
41
41
|
Implementation: [container/src/extensions.ts](./container/src/extensions.ts)
|
|
42
42
|
|
|
43
|
+
### 2.1) Trusted-Coworker Approvals
|
|
44
|
+
|
|
45
|
+
Tool actions are risk-tiered at runtime:
|
|
46
|
+
|
|
47
|
+
- Green: execute silently (read/search/status checks)
|
|
48
|
+
- Yellow: execute with narrated intent and a short interrupt window
|
|
49
|
+
- Red: explicit user approval required (`yes` / `yes for session` / `yes for agent` / `skip`, or `1/2/3/4`)
|
|
50
|
+
|
|
51
|
+
The policy layer is repo-controlled through `.hybridclaw/policy.yaml`:
|
|
52
|
+
|
|
53
|
+
- `approval.pinned_red` (never auto-promoted high-risk actions)
|
|
54
|
+
- `approval.workspace_fence` (no writes outside workspace fence)
|
|
55
|
+
- `approval.max_pending_approvals` and `approval.approval_timeout_secs`
|
|
56
|
+
- `audit.log_all_red` and `audit.log_denials`
|
|
57
|
+
|
|
58
|
+
Implementation: [container/src/approval-policy.ts](./container/src/approval-policy.ts)
|
|
59
|
+
|
|
43
60
|
### 3) Container Isolation
|
|
44
61
|
|
|
45
62
|
Tool execution runs inside Docker with sandbox constraints:
|
package/biome.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.4.5/schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"clientKind": "git",
|
|
6
|
+
"useIgnoreFile": true
|
|
7
|
+
},
|
|
8
|
+
"files": {
|
|
9
|
+
"includes": ["**", "!!**/dist"]
|
|
10
|
+
},
|
|
11
|
+
"formatter": {
|
|
12
|
+
"enabled": true,
|
|
13
|
+
"indentStyle": "space",
|
|
14
|
+
"indentWidth": 2
|
|
15
|
+
},
|
|
16
|
+
"linter": {
|
|
17
|
+
"enabled": true,
|
|
18
|
+
"rules": {
|
|
19
|
+
"recommended": true
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"javascript": {
|
|
23
|
+
"formatter": {
|
|
24
|
+
"quoteStyle": "single"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"assist": {
|
|
28
|
+
"enabled": true,
|
|
29
|
+
"actions": {
|
|
30
|
+
"source": {
|
|
31
|
+
"organizeImports": "on"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
package/config.example.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version":
|
|
2
|
+
"version": 5,
|
|
3
3
|
"security": {
|
|
4
4
|
"trustModelAccepted": false,
|
|
5
5
|
"trustModelAcceptedAt": "",
|
|
@@ -15,21 +15,56 @@
|
|
|
15
15
|
"presenceIntent": false,
|
|
16
16
|
"respondToAllMessages": false,
|
|
17
17
|
"commandsOnly": false,
|
|
18
|
+
"commandMode": "public",
|
|
19
|
+
"commandAllowedUserIds": [],
|
|
18
20
|
"commandUserId": "",
|
|
19
21
|
"groupPolicy": "open",
|
|
20
22
|
"freeResponseChannels": [],
|
|
23
|
+
"textChunkLimit": 2000,
|
|
24
|
+
"maxLinesPerMessage": 17,
|
|
25
|
+
"humanDelay": {
|
|
26
|
+
"mode": "natural",
|
|
27
|
+
"minMs": 800,
|
|
28
|
+
"maxMs": 2500
|
|
29
|
+
},
|
|
30
|
+
"typingMode": "thinking",
|
|
31
|
+
"presence": {
|
|
32
|
+
"enabled": true,
|
|
33
|
+
"intervalMs": 30000,
|
|
34
|
+
"healthyText": "Watching the channels",
|
|
35
|
+
"degradedText": "Thinking slowly...",
|
|
36
|
+
"exhaustedText": "Taking a break",
|
|
37
|
+
"activityType": "watching"
|
|
38
|
+
},
|
|
39
|
+
"lifecycleReactions": {
|
|
40
|
+
"enabled": true,
|
|
41
|
+
"removeOnComplete": true,
|
|
42
|
+
"phases": {
|
|
43
|
+
"queued": "⏳",
|
|
44
|
+
"thinking": "🤔",
|
|
45
|
+
"toolUse": "⚙️",
|
|
46
|
+
"streaming": "✍️",
|
|
47
|
+
"done": "✅",
|
|
48
|
+
"error": "❌"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"ackReaction": "👀",
|
|
52
|
+
"ackReactionScope": "group-mentions",
|
|
53
|
+
"removeAckAfterReply": true,
|
|
54
|
+
"debounceMs": 2500,
|
|
55
|
+
"rateLimitPerUser": 0,
|
|
56
|
+
"rateLimitExemptRoles": [],
|
|
57
|
+
"suppressPatterns": ["/stop", "/pause", "brb", "afk"],
|
|
58
|
+
"maxConcurrentPerChannel": 2,
|
|
21
59
|
"guilds": {}
|
|
22
60
|
},
|
|
23
61
|
"hybridai": {
|
|
24
62
|
"baseUrl": "https://hybridai.one",
|
|
25
63
|
"defaultModel": "gpt-5-nano",
|
|
26
64
|
"defaultChatbotId": "",
|
|
65
|
+
"maxTokens": 4096,
|
|
27
66
|
"enableRag": true,
|
|
28
|
-
"models": [
|
|
29
|
-
"gpt-5-nano",
|
|
30
|
-
"gpt-5-mini",
|
|
31
|
-
"gpt-5"
|
|
32
|
-
]
|
|
67
|
+
"models": ["gpt-5-nano", "gpt-5-mini", "gpt-5"]
|
|
33
68
|
},
|
|
34
69
|
"container": {
|
|
35
70
|
"image": "hybridclaw-agent",
|
|
@@ -45,6 +80,10 @@
|
|
|
45
80
|
"intervalMs": 1800000,
|
|
46
81
|
"channel": ""
|
|
47
82
|
},
|
|
83
|
+
"memory": {
|
|
84
|
+
"decayRate": 0.1,
|
|
85
|
+
"consolidationIntervalHours": 24
|
|
86
|
+
},
|
|
48
87
|
"ops": {
|
|
49
88
|
"healthHost": "127.0.0.1",
|
|
50
89
|
"healthPort": 9090,
|
|
@@ -68,7 +107,9 @@
|
|
|
68
107
|
},
|
|
69
108
|
"sessionCompaction": {
|
|
70
109
|
"enabled": true,
|
|
71
|
-
"
|
|
110
|
+
"tokenBudget": 100000,
|
|
111
|
+
"budgetRatio": 0.7,
|
|
112
|
+
"threshold": 200,
|
|
72
113
|
"keepRecent": 40,
|
|
73
114
|
"summaryMaxChars": 8000,
|
|
74
115
|
"preCompactionMemoryFlush": {
|
|
@@ -106,5 +147,29 @@
|
|
|
106
147
|
"ralph": {
|
|
107
148
|
"maxIterations": 0
|
|
108
149
|
}
|
|
150
|
+
},
|
|
151
|
+
"scheduler": {
|
|
152
|
+
"jobs": [
|
|
153
|
+
{
|
|
154
|
+
"id": "morning-standup",
|
|
155
|
+
"name": "Daily Standup Report",
|
|
156
|
+
"description": "Runs standup summary every weekday at 9am.",
|
|
157
|
+
"schedule": {
|
|
158
|
+
"kind": "cron",
|
|
159
|
+
"expr": "0 9 * * 1-5",
|
|
160
|
+
"tz": "America/New_York"
|
|
161
|
+
},
|
|
162
|
+
"action": {
|
|
163
|
+
"kind": "agent_turn",
|
|
164
|
+
"message": "Post a brief morning standup update for the team."
|
|
165
|
+
},
|
|
166
|
+
"delivery": {
|
|
167
|
+
"kind": "channel",
|
|
168
|
+
"channel": "discord",
|
|
169
|
+
"to": "123456789012345678"
|
|
170
|
+
},
|
|
171
|
+
"enabled": false
|
|
172
|
+
}
|
|
173
|
+
]
|
|
109
174
|
}
|
|
110
175
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hybridclaw-agent",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "hybridclaw-agent",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.7",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@mozilla/readability": "^0.6.0",
|
|
12
12
|
"agent-browser": "^0.15.1",
|