8399 Commits

Author SHA1 Message Date
kumarabhirup
039cbe6a43
feat: async I/O, tags field type, rich chat messages, deploy verification
- Convert sync filesystem and DuckDB operations to async across API routes,
  workspace lib, and active-runs to prevent event loop blocking during tree
  discovery, object lookups, and database queries
- Add "tags" field type for free-form string arrays with parse-tags utility,
  TagsBadges/TagsInput UI components, filter operators, and CRM skill docs
- Preserve rich text formatting (bold, italic, code, @mentions) in user chat
  messages by sending HTML alongside plain text through the transport layer
- Detect empty-stream errors, improve agent error emission, and add file
  mutation queues for concurrent write safety in active-runs
- Add pre-publish standalone node_modules verification in deploy script
  checking serverExternalPackages are present
- Extract syncManagedSkills and discoverWorkspaceDirs for multi-workspace
  skill syncing, add ensureSeedAssets for runtime app dir
- Bump version 2.1.1 → 2.1.4
2026-03-08 19:53:18 -07:00
kumarabhirup
ec73141a01
chore: bump version to 2.0.16 and enhance feedback API message handling
Update package versions for denchclaw and dench to 2.0.16. Refactor feedback API to convert chat lines into PostHog-compatible messages, preserving chronological order and including tool calls and results. Improve test cases to reflect changes in message handling.
2026-03-05 21:38:55 -08:00
kumarabhirup
83f6b69f82
feat(telemetry): use session key as trace ID and improve AI event inputs
Use the session key directly as the PostHog trace ID so feedback and generation events share the same trace. Extract non-assistant messages from conversations for $ai_input.
2026-03-05 19:09:13 -08:00
kumarabhirup
a0853ec83c
feat(telemetry): unified identity for PostHog plugin with key fallback
Plugin reads the same persisted install ID from telemetry.json and falls back to a build-time baked PostHog key when no config-level key is set.
2026-03-05 19:09:05 -08:00
kumarabhirup
1e21185d47
feat(telemetry): replace hostname hash with persisted install-scoped anonymous ID
A random UUID is generated on first run and stored in ~/.openclaw-dench/telemetry.json, replacing the SHA-256 hostname hash that could theoretically be reversed.
2026-03-05 19:09:00 -08:00
kumarabhirup
261f49de9b
feat(telemetry): add trace conversation state and improve tool extraction
Populates $ai_input_state/$ai_output_state on traces for full conversation view in PostHog, and handles toolCall content blocks.
2026-03-05 15:35:57 -08:00
kumarabhirup
6b794dac4e
feat(telemetry): add structure-preserving privacy redaction
Redacts text content and tool arguments while keeping roles, tool names, and message ordering visible in PostHog.
2026-03-05 15:35:51 -08:00
kumarabhirup
ddac5c777b
fix(cli): restart gateway after bundled plugin install
Ensures newly installed or updated plugins are loaded without manual restart.
2026-03-05 15:35:46 -08:00
kumarabhirup
113b1ffb17
docs: use npx prefix in telemetry CLI commands
Users run via npx, not a global install — fix all examples and output messages.
2026-03-05 15:35:42 -08:00
kumarabhirup
251ad368a7
feat: add noOpen option to web runtime commands and prompt for browser opening
Introduce a `noOpen` option across various web runtime commands to control automatic browser opening. Implement a prompt to ask users if they want to open the web UI, enhancing user experience and flexibility during command execution.
2026-03-05 14:04:15 -08:00
kumarabhirup
136d3049b7
feat: add configuration for plugin load paths in OpenClaw
Enhance the installBundledPlugins function to set the plugins.load.paths configuration for posthog-analytics using OpenClaw. This addition allows for dynamic loading of plugin paths, improving plugin management during the bootstrap process.
2026-03-05 13:57:38 -08:00
kumarabhirup
8755c509f8
feat: extract real token usage from messages and auto-restart gateway on web runtime updates
Add extractUsageFromMessages and normalizeOutputForPostHog to pull actual
token counts and cost from OpenClaw per-message usage metadata, and convert
Anthropic-style tool call blocks to OpenAI format for PostHog AI observability.

Integrate gateway daemon restart (stop → install → start) into both the
update and start web runtime commands so the gateway stays in sync with
runtime upgrades.
2026-03-05 13:46:51 -08:00
kumarabhirup
460bf6bf6e
fix: resolve PostHog trace linkage, cost display, and tool capture
Switch TraceContextManager from runId to sessionId-based indexing so
tool spans share the same trace_id as their parent generation. Extract
tool names from agent_end messages for the PostHog Tools tab. Guard
against sending $0 cost and null token counts.
2026-03-05 12:58:24 -08:00
kumarabhirup
fdd89b4e6f
feat: add PostHog AI observability, feedback UI, and telemetry privacy mode
Integrate PostHog LLM Analytics via a bundled OpenClaw plugin that captures
$ai_generation, $ai_span, and $ai_trace events with configurable privacy
mode (content redaction on by default). Add like/dislike feedback buttons
to the web chat UI backed by a /api/feedback route. Extend the CLI with
`telemetry privacy on|off` subcommands and fix command delegation so
telemetry subcommands aren't forwarded to OpenClaw. Harden the web runtime
installer to auto-flatten pnpm standalone deps and dereference dangling
symlinks, preventing "Cannot find module 'next'" crashes in dev. Move
plugin installation before onboard in bootstrap so the gateway starts
with plugins.allow already configured.
2026-03-05 12:28:08 -08:00
kumarabhirup
f41c0411eb
test: add port isolation tests for DenchClaw gateway fix
- New src/config/paths.test.ts: 11 tests covering resolveGatewayPort
  profile-aware precedence (env > config > profile > global default)
- Extend bootstrap-external.test.ts: 15 new tests for
  readExistingGatewayPort (config reading, fallback, edge cases) and
  isPersistedPortAcceptable (18789 rejection guard, end-to-end composition)
- Extend web-runtime-command.test.ts: 2 new tests verifying the fallback
  returns 19001 when manifest has no lastGatewayPort or is null
- Update test fixtures across all test files to expect port 19001

All 5 critical mutations verified: removing profile check, removing
18789 guard, reverting fallback, changing constant, breaking config
reader -- each caught by at least 2 tests.
2026-03-05 10:46:16 -08:00
kumarabhirup
4bcd47b848
fix: prevent DenchClaw gateway from hijacking OpenClaw's port 18789
The bootstrap port selection logic tried OpenClaw's default port (18789)
before the DenchClaw range (19001+). If OpenClaw was temporarily down
during bootstrap, DenchClaw would claim 18789 and persist it to config
and the LaunchAgent plist, killing OpenClaw on every subsequent restart.

- Remove the DEFAULT_GATEWAY_PORT (18789) branch from bootstrap; always
  start from DENCHCLAW_GATEWAY_PORT_START (19001)
- Read previously persisted config port and reuse it (unless it is 18789)
- Extract isPersistedPortAcceptable guard to reject corrupted 18789 state
- Add DENCHCLAW_DEFAULT_GATEWAY_PORT constant and make resolveGatewayPort
  profile-aware so the "dench" profile falls back to 19001
- Fix hardcoded 18789 fallback in web-runtime-command.ts
2026-03-05 10:46:03 -08:00
kumarabhirup
8847e44854
feat(cli): add flatten-standalone-deps for pnpm standalone builds
pnpm's standalone output uses symlinks that npm pack silently drops, breaking require('next') on user machines. This flattens the virtual store into a standard node_modules layout.
2026-03-04 19:06:50 -08:00
kumarabhirup
ec973f40d3
fix(cli): update bootstrap onboard test for accept-risk and skip-ui flags
Onboard command now passes --accept-risk and --skip-ui by default; align test expectations.
2026-03-04 19:06:44 -08:00
kumarabhirup
b4b644a726
fix(cli): dereference symlinks during web runtime installation
pnpm standalone output contains symlinks that break after npm pack; dereference ensures real files are copied.
2026-03-04 19:06:40 -08:00
kumarabhirup
78e04e20b8
fix(cli): improve bootstrap onboard UX and fix command references
Always pass --skip-ui and --accept-risk to openclaw onboard so the
wizard never prompts for TUI/Web UI selection — bootstrap manages the
web UI lifecycle itself. Add a post-onboard spinner to eliminate the
silent gap while config-set calls, gateway probing, and web runtime
startup run. Fix remediation messages to use `npx denchclaw`.
2026-03-04 18:33:17 -08:00
kumarabhirup
912e7711bb
fix tests, add telemetry, deploy v2.0.4
- Fix bootstrap-command test: mock ensureManagedWebRuntime to probe
  directly instead of requiring standalone build on disk
- Add PostHog telemetry to CLI and web app with opt-out support
- Add dench alias package (npm rejects name; kept for future use)
- Bump version to 2.0.4 and publish to npm
2026-03-04 17:33:27 -08:00
kumarabhirup
286d0fdb48
delete em all 2026-03-04 16:34:45 -08:00
kumarabhirup
af45d4d17b
CLI: add managed web runtime with start/stop/update commands and major-version gating
Refactor bootstrap to use a managed web runtime lifecycle instead of
ad-hoc standalone server spawning. The managed runtime copies packaged
Next.js assets into ~/.openclaw-dench/web-runtime/, tracks deployment
state via manifest/process metadata, and cleanly separates Dench-owned
processes from foreign listeners on the target port.

- Fix false-negative web readiness when /api/profiles returns null
  activeProfile (first-run regression).
- Add `dench start` (start without updating assets), `dench stop`
  (terminate only Dench-managed web server), and `dench update`
  (refresh web runtime with major-version OpenClaw update gate).
- Major-version transitions (e.g. v2->v3) require mandatory OpenClaw
  update; non-interactive mode fails closed without --yes.
- All lifecycle commands show the ASCII banner/logo animation.
- Deploy smoke checks now verify update/stop/start --help paths.
2026-03-04 16:32:58 -08:00
kumarabhirup
4d6eec741d
npx denchclaw 2026-03-04 13:23:34 -08:00
kumarabhirup
1c93a3b525
fix(cli): enforce full tool profile in dench bootstrap 2026-03-04 13:18:39 -08:00
kumarabhirup
7fa49f58ce
feat(cli): add ensureSubagentDefaults function to set default subagent configurations
This commit introduces the ensureSubagentDefaults function, which sets various default configurations for subagents, including max concurrent agents, max spawn depth, and run timeout settings. The function is called during the bootstrap process to ensure these defaults are applied for the specified profile.
2026-03-03 16:34:03 -08:00
kumarabhirup
33589ca5ca
delete: remove debug log file and update Ironclaw identity in workspace seed
This commit deletes the debug.log file, which contained subagent session logs, and updates the Ironclaw identity in workspace-seed.ts to reflect the new author, changing from Kumar Abhirup to Dench.
2026-03-03 16:29:12 -08:00
kumarabhirup
72d5204e52
test: update tests for dench-to-crm rename and IDENTITY.md visibility
All test assertions updated to reference crm instead of dench, and IDENTITY.md is now expected to be visible in the workspace tree.
2026-03-03 15:38:46 -08:00
kumarabhirup
501276bdea
refactor(cli): remove dench-specific bootstrap code
syncBundledDenchSkill is now handled by the generalized seedWorkspaceFromAssets call.
2026-03-03 15:37:39 -08:00
kumarabhirup
a0d5281923
refactor(cli): generalize workspace-seed for multiple managed skills
Replace hardcoded dench references with a MANAGED_SKILLS array (crm, browser) and add template path substitution support.
2026-03-03 15:37:35 -08:00
kumarabhirup
8eb25cfcb7
chore: update tsconfig and vitest config
Exclude extensions and test from tsconfig; remove extensions from vitest include.
2026-03-03 13:48:10 -08:00
kumarabhirup
365e1650bc
fix(test): resolve lint errors in workspace and init route tests
Remove unused useEnvWorkspace; fix base-to-string in identity content assertion.
2026-03-03 13:48:05 -08:00
kumarabhirup
f6eee0b398
refactor(cli): update workspace-seed with dynamic identity and dench skill
Build identity template with workspace path; add seedDenchSkill for skills/dench.
2026-03-03 13:47:38 -08:00
kumarabhirup
c704ddd15f
refactor(cli): update program help and bootstrap options
Document --profile/--dev as compatibility flags for Ironclaw.
2026-03-03 13:47:34 -08:00
kumarabhirup
227739d729
refactor(cli): update bootstrap for workspace path
Use workspace dir instead of workspace-profile; ensure agents.defaults.workspace before onboard.
2026-03-03 13:47:23 -08:00
kumarabhirup
785dd449f4
refactor(cli): pin Ironclaw profile and simplify profile handling
Ironclaw always runs with profile ironclaw; --profile/--dev are compatibility flags.
2026-03-03 13:46:21 -08:00
kumarabhirup
c134c9b29a
chore(config): pin Ironclaw state dir to .openclaw-ironclaw
Ironclaw always uses a fixed state path; remove legacy dir fallback.
2026-03-03 13:46:13 -08:00
kumarabhirup
75b8410709
fix(cli): sync bootstrap gateway port for web runtime 2026-03-03 12:24:43 -08:00
kumarabhirup
37400badc2
fix(cli): harden bootstrap profile and recovery paths
Make bootstrap deterministic across profile flag order and stale local runtime state so onboarding and health checks converge on the intended profile, gateway service, and web port.
2026-03-02 22:10:46 -08:00
kumarabhirup
49b46fc657
docs(cli): add testing edge case matrix for CLI bootstrap 2026-03-02 18:32:10 -08:00
kumarabhirup
b7ddb23e34
chore(cli): add vitest config for CLI test suite 2026-03-02 18:32:03 -08:00
kumarabhirup
6d51543f39
test(cli): add argv, cli-name, cli-utils, ports, profile, profile-utils, and respawn-policy tests 2026-03-02 18:31:56 -08:00
kumarabhirup
55a94523a7
test(cli): add run-main entry point tests 2026-03-02 18:31:48 -08:00
kumarabhirup
5eb084db95
test(cli): add bootstrap-external unit and bootstrap-command tests 2026-03-02 18:31:40 -08:00
kumarabhirup
0f057c0346
feat(cli): overhaul bootstrap-external with gateway auto-fix, robust CLI detection, and agent-auth check 2026-03-02 18:31:15 -08:00
kumarabhirup
be246df30f
feat(cli): add workspace-seed module for profile bootstrapping 2026-03-02 18:31:08 -08:00
kumarabhirup
e5aa1ac311
test(cli): add windows-argv unit tests 2026-03-02 18:31:00 -08:00
kumarabhirup
91e3742be7
feat(cli): add testability options to normalizeWindowsArgv 2026-03-02 18:30:52 -08:00
kumarabhirup
52707f471d
refactor!: IronClaw v2.0 - external OpenClaw runtime
BREAKING CHANGE: Convert repository to IronClaw-only package with strict
external dependency on globally installed `openclaw` runtime.

### Changes

- Remove entire OpenClaw core source from repository (src/agents/*, src/acp/*,
  src/commands/*, and related modules)
- Implement CLI delegation: non-bootstrap commands now delegate to global
  `openclaw` binary via external contract
- Remove local OpenClaw path resolution from web app; always spawn global
  `openclaw` binary instead of local scripts
- Rename package.json scripts: `pnpm openclaw` → `pnpm ironclaw`,
  `openclaw:rpc` → `ironclaw:rpc`
- Update bootstrap flow to verify and install global OpenClaw when missing
- Migrate web workspace/profile logic to align with OpenClaw state paths
- Add migration contract tests for stream-json, session subscribe, and profile
  resolution behaviors
- Update build/release pipeline for IronClaw-only artifacts
- Update documentation for new peer + global installation model

### Architecture

IronClaw is now strictly a frontend/UI/bootstrap layer:
- `npx ironclaw` bootstraps OpenClaw (if missing), runs guided onboarding
- IronClaw UI serves on localhost:3100
- OpenClaw Gateway runs on standard port 18789
- Communication via stable CLI contracts and Gateway WebSocket protocol only

### Migration

Users must have `openclaw` installed globally:
  npm install -g openclaw

Existing IronClaw profiles and sessions remain compatible through gateway
protocol stability.

Refs: bootstrap_dev_testing, ironclaw_frontend_split, strict-external-openclaw
2026-03-01 16:11:40 -08:00
kumarabhirup
9ca4263147
👌 IMPROVE: discord fix 2026-02-24 17:20:34 -05:00