2139 Commits

Author SHA1 Message Date
kumarabhirup
2c52012d1e
feat(chat): fix infinite loading and enable concurrent sessions
Chat panel froze because `thinking: "xhigh"` silently killed gateway runs, sessions used mutable global agent state, and OpenClaw's one-run-per-agent limit blocked concurrent chats.
2026-03-09 08:58:50 -07:00
kumarabhirup
825e47e6af
feat(gateway): add uninstall command to README for clarity 2026-03-08 21:48:02 -07:00
kumarabhirup
8deeccf646
feat(web): add workspace app tabs and embedded runtime
This makes Dench apps behave like first-class workspace views with persistent tabs and embedded app loading instead of exposing raw folders.
2026-03-08 21:47:41 -07:00
kumarabhirup
1af9d75396
fix(terminal): add try/catch around PTY spawn to prevent silent hangs
Without error handling, if node-pty require or pty.spawn throws (bad
permissions, missing cwd, stale server), the client gets no response and
the terminal hangs with a blinking cursor. Now sends an exit event back.
2026-03-08 21:45:17 -07:00
kumarabhirup
7975405da9
fix(terminal): defer PTY spawn until container has layout dimensions
fitAddon.fit() was called synchronously on mount before the browser laid
out the container, sending 0-dimension cols/rows to the PTY. The shell
would hang without displaying a prompt. Now defers WS connection by 50ms,
re-fits after the shell reports ready, and shows an error if WS fails.
2026-03-08 21:27:37 -07:00
kumarabhirup
bf419cbaeb
chore: bump version to 2.1.5 in package.json 2026-03-08 20:47:46 -07:00
kumarabhirup
e1fc698f2e
feat(web): add in-browser terminal panel (Cmd+J)
xterm.js frontend + node-pty WebSocket server spawning the user's real shell,
with drag-to-resize drawer, multi-terminal tabs, live theme sync, and URL state.
2026-03-08 20:45:10 -07:00
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
36e9cf9517
fix(agent-runner): ensure tool events stream on first chat message
sessions.patch for verboseLevel=full was called before the agent RPC
created the session, so it silently failed on new chats. Tool events
were never emitted and the frontend only showed brief text responses.

Now patches both before (for existing sessions) and after the agent RPC
(for newly created sessions). Also adds SSE keepalive to the POST /api/chat
stream to prevent connection drops during long tool executions, and removes
the unused legacy CLI spawn codepath.
2026-03-06 23:30:31 -08:00
kumarabhirup
eaef8df20b
fix(telemetry): prevent anonymousId from leaking via npm package
The root layout called getOrCreateAnonymousId() in a Server Component
without marking the route as dynamic. Next.js treated it as static,
pre-rendering the developer's UUID into the standalone build shipped
via npm — so every `npx denchclaw` user shared the same PostHog identity.

- Add `export const dynamic = "force-dynamic"` to root layout
- Replace `process.env.HOME || "~"` fallback with `homedir()` in web
  telemetry and posthog-analytics plugin (Node.js path.join doesn't
  expand "~", creating a relative path under cwd instead)
2026-03-06 23:30:31 -08:00
kumarabhirup
b8ba9d5ed4
Merge branch 'main' of https://github.com/denchHQ/ironclaw into kumareth/nested-object-views-fix 2026-03-06 21:29:28 -08:00
kumarabhirup
8f4fd62d63
fix(workspace): prevent URL sync from wiping params on hydration render
The URL sync effect and hydration effect run in the same React render
cycle. Since React state updates (setActivePath) are batched, the URL
sync effect still saw activePath=null and pushed "/", stripping all
query params. This caused an alternating refresh bug where odd refreshes
showed the homepage and even refreshes worked correctly.

Skip the URL sync effect for one render after hydration completes, giving
React state time to update before the effect writes the URL.
2026-03-06 21:29:03 -08:00
kumarabhirup
7cf895a3c7
fix(workspace): recursively search for nested object directories in findObjectDir
findObjectDir only searched the workspace root and one level deep, so objects
nested inside category folders (e.g. marketing/influencer/) were not discovered
by the views API. This caused saved views, active_view, and view_settings to
silently return empty for any object beyond depth 1.

Replace the single-level scan with a depth-limited recursive search (max 4
levels), skipping known heavy directories (node_modules, .git, .next, etc.).

The sidebar tree builder (buildTree in tree/route.ts) already walks recursively,
so this brings findObjectDir in line with the rest of the workspace discovery.
2026-03-06 00:41:26 -08:00
kumarabhirup
4578dfa945
feat(cron): project schedule occurrences on calendar view
Parse cron/every/at schedules and project all occurrences within the
visible date range so the calendar shows upcoming runs, not just the
next one. Display scheduled times on event chips.
2026-03-05 22:54:37 -08:00
kumarabhirup
d829b73265
refactor(workspace): centralize URL sync and add back/forward navigation
Remove scattered router.replace("/") calls in favor of the URL sync effect.
Add popstate listener to restore app state on browser back/forward.
Preserve object-view params across shell-level URL updates.
Fix ObjectView overwriting URL params on initial mount.
2026-03-05 22:54:31 -08:00
kumarabhirup
5b87256cac
fix(workspace): preserve query params during sidebar and database navigation
Use URLSearchParams to merge new params instead of replacing the full URL.
2026-03-05 22:54:24 -08:00
kumarabhirup
7dd38c185c
refactor(workspace): rename replaceUrlToWorkspace to replaceUrlToRoot
URL sync is now handled by the centralized effect, not callers.
2026-03-05 22:54:18 -08: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
38b062a71e
chore: fix test mocks, suppress cron pageview tracking, and minor docs
Add workspace mock to agent-runner tests, skip PostHog pageviews on cron paths to reduce noise, document web-chat storage path in CRM skill, and include cursor plans and build info.
2026-03-05 21:20:35 -08:00
kumarabhirup
f279524e32
feat(chat): add hero state with prompt suggestions for new conversations
Show an animated hero screen with rotating prompt suggestion cards when the chat is empty, using framer-motion for layout transitions. Add setText method to ChatEditor for programmatic content insertion.
2026-03-05 21:20:25 -08:00
kumarabhirup
c21bbb6cea
feat(cron): overhaul dashboard with calendar/timeline/insights views and action bar
Add tabbed views (overview, calendar, timeline, insights) to the cron dashboard, run status filters and action buttons (run now, disable, delete) to job detail, reuse ChatMessage for session transcripts, and wire URL state through workspace content.
2026-03-05 21:20:18 -08:00
kumarabhirup
7cb654ea6a
fix(api): improve cron run transcript parsing for toolCall and toolResult formats
Handle the current toolCall message format alongside legacy tool_use, and merge toolResult messages back into the preceding assistant message.
2026-03-05 21:20:10 -08:00
kumarabhirup
cc1194b5eb
feat(api): add agent session fallback to web-sessions endpoint
When no web chat session file exists, search agent session directories (cron runs, CLI) and parse transcripts into UIMessage-compatible format.
2026-03-05 21:20:04 -08:00
kumarabhirup
6044372614
feat(cron): add URL-backed view state for cron dashboard and job detail
Persist cronView, cronCalMode, cronDate, cronRunFilter, and cronRun in URL params so cron UI state survives navigation and refresh.
2026-03-05 21:19:58 -08:00
kumarabhirup
ca3f559b8f
fix(web): honor initial session ID and forward subagent session keys
Reconnect to the correct chat session when initialSessionId is provided instead of always picking the latest, and pass through the subagent sessionKey for clickable subagent cards.
2026-03-05 19:09:39 -08:00
kumarabhirup
3533aa3358
feat(web): persist file tree expansion and add column visibility callbacks
Save expanded file tree paths to localStorage so they survive page reloads, and surface an onColumnVisibilityChanged callback from DataTable/ObjectTable.
2026-03-05 19:09:34 -08:00
kumarabhirup
1c21b039fc
refactor(web): consolidate workspace onto root route with URL state machine
Move the workspace shell from /workspace to / and introduce a typed URL state codec (parseUrlState/serializeUrlState) for deep-linkable workspace params. Legacy /workspace URLs are still recognized for backward compatibility.
2026-03-05 19:09:29 -08:00
kumarabhirup
f9d454f5c7
feat(web): forward client identity to server and improve feedback traces
Bootstrap posthog-js with the persisted install ID from the server, forward distinctId to API routes, and restructure feedback traces to use chronological conversation order.
2026-03-05 19:09:19 -08:00
kumarabhirup
c4ee320994
feat(feedback): forward client PostHog distinct ID to server-side AI traces
Ensures server-side trace events are attributed to the same user as client-side analytics.
2026-03-05 16:09:12 -08:00
kumarabhirup
00c04f89d3
refactor(telemetry): remove server-side anonymous ID in favor of PostHog native tracking
Let PostHog generate its own distinct ID client-side instead of deriving one from hostname/username.
2026-03-05 16:09:06 -08:00
kumarabhirup
7908aa3337
chore(web): add Bookerly font files
Add Bookerly Regular, Bold, Italic, and BoldItalic TTF variants.
2026-03-05 15:36:07 -08:00
kumarabhirup
ab8906a421
feat(web): wrap app in PostHog React provider with survey-based feedback
Enables useThumbSurvey for feedback buttons and sends un-redacted conversation traces on user feedback.
2026-03-05 15:36:02 -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
a771ab7259
fix: unify PostHog distinctId across client and server
Client-side posthog-js was using a random anonymous ID (reset every
page load) while server-side posthog-node used a deterministic
SHA256(hostname:username) hash. Bootstrap the client with the server's
anonymous ID so both sides share the same per-machine-per-user identity.
2026-03-05 10:47:36 -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
ec326fb34d
chore: add env examples for development setup
Documents required environment variables so new contributors can onboard without guessing.
2026-03-04 19:06:35 -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
ee6f3c6df3
chore: update package versions and add posthog dependencies
- Bump version of denchclaw to 2.0.2 in package.json.
- Add posthog-node and posthog-js dependencies with specified versions.
- Update chokidar dependency in web package.json.
- Modify deploy script to publish an alias package (dench) alongside denchclaw.
2026-03-04 17:09:22 -08:00
kumarabhirup
286d0fdb48
delete em all 2026-03-04 16:34:45 -08:00
kumarabhirup
4d6eec741d
npx denchclaw 2026-03-04 13:23:34 -08:00
kumarabhirup
2c5e5a8ac1
chore(web): refresh tsbuildinfo 2026-03-04 11:15:17 -08:00
kumarabhirup
bd859a52ef
test(web): add rich document editor interaction coverage 2026-03-04 11:15:04 -08:00
kumarabhirup
f98fb75e81
test(web): cover workspace binary write API 2026-03-04 11:14:56 -08:00
kumarabhirup
aaad832cc6
feat(web): add rich DOCX/TXT workspace editor 2026-03-04 11:14:48 -08:00
kumarabhirup
da440735d4
feat(web): add workspace binary write API endpoint 2026-03-04 11:14:14 -08:00
kumarabhirup
601d5231fb
feat(web): extract workspace editor toolbar primitives 2026-03-04 11:14:08 -08:00
kumarabhirup
c2fc170ac7
test(web): add exhaustive spreadsheet utility coverage 2026-03-04 11:09:18 -08:00
kumarabhirup
9890cd9d71
test(web): add raw-file binary write route coverage 2026-03-04 11:09:10 -08:00
kumarabhirup
3f3ed89f49
feat(web): add editable spreadsheet workspace component 2026-03-04 11:09:02 -08:00
kumarabhirup
19dffeabd4
feat(web): add binary workspace file write endpoint 2026-03-04 11:08:35 -08:00