136 Commits

Author SHA1 Message Date
kumarabhirup
477daad4ff
feat(gateway): migrate chat transport to WebSocket and enforce single ironclaw profile
This commit introduces a new plan to transition the chat transport from CLI processes to Gateway WebSocket, while maintaining the existing SSE API contract. It locks the web to a single `ironclaw` profile, disables workspace/profile switching, and updates relevant tests. Key changes include the implementation of a WebSocket-backed adapter, API lockdown with 403 responses for profile mutations, and UI adjustments to remove profile switching controls.
2026-03-03 15:39:27 -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
70ca59a66d
refactor(web): show IDENTITY.md in workspace, filter managed skills, hide bootstrap toggle
IDENTITY.md is now user-editable (no longer a system file). Managed skill filter updated from dench to crm/browser. Bootstrap seed toggle hidden from create-workspace dialog.
2026-03-03 15:38:41 -08:00
kumarabhirup
1398e556a1
feat(api): register default agent in config on workspace switch
Call setDefaultAgentInConfig when switching workspaces so the gateway picks up the active workspace agent.
2026-03-03 15:38:07 -08:00
kumarabhirup
38f3cb6efe
feat(web): use workspace-aware agent IDs for gateway sessions
Replace hardcoded agent:main: session keys with resolveActiveAgentId() so each workspace routes to its own gateway agent.
2026-03-03 15:38:00 -08:00
kumarabhirup
bf6a0abe48
refactor(api): deduplicate workspace init using shared workspace-seed
Remove ~200 lines of duplicated CRM seed objects, DuckDB seeding, and identity generation from the init route by importing from @repo/cli/workspace-seed.
2026-03-03 15:37:49 -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
aec4e9d89a
refactor(web): update workspace page and hooks
Use workspace model in page and use-workspace-watcher.
2026-03-03 13:47:18 -08:00
kumarabhirup
3c2138e4bd
feat(web): add workspace-switch component
New workspace-switch component and tests for workspace selection UI.
2026-03-03 13:47:02 -08:00
kumarabhirup
1adb7b926b
refactor(web): update workspace components for workspace model
ProfileSwitcher uses workspaces; create-workspace-dialog, empty-state, sidebar updated.
2026-03-03 13:46:54 -08:00
kumarabhirup
974ba61b48
refactor(api): update workspace tree and virtual-file routes
Use workspace lib for path resolution.
2026-03-03 13:46:49 -08:00
kumarabhirup
6084381346
refactor(api): update workspace delete for workspace model
Use workspace lib helpers instead of profile-based paths.
2026-03-03 13:46:44 -08:00
kumarabhirup
4f0f7af622
refactor(api): update workspace init for workspace model
Use discoverWorkspaces, setUIActiveWorkspace, resolveWorkspaceDir; remove inline spawn logic.
2026-03-03 13:46:39 -08:00
kumarabhirup
9b505e9ae6
refactor(api): update profiles API for workspace model
Use discoverWorkspaces and getActiveWorkspaceName; keep backward-compat response fields.
2026-03-03 13:46:34 -08:00
kumarabhirup
232d6640ba
feat(api): add workspace list and switch API routes
New /api/workspace/list and /api/workspace/switch for workspace discovery and switching.
2026-03-03 13:46:30 -08:00
kumarabhirup
693811ccb2
test(web): add profile-switcher, object-filter-bar, stream-parser, and subagent-panel message tests 2026-03-02 18:36:19 -08:00
kumarabhirup
a61aedd51d
refactor(web): update workspace page layout and profile integration 2026-03-02 18:35:48 -08:00
kumarabhirup
a7a89a990e
feat(web): add object-view-active-view module for workspace page 2026-03-02 18:35:41 -08:00
kumarabhirup
3ed8872f16
refactor(web): move profile management to workspace-sidebar 2026-03-02 18:35:34 -08:00
kumarabhirup
e7bdd45be1
feat(web): add IDENTITY.md to system file patterns in file-manager-tree 2026-03-02 18:35:27 -08:00
kumarabhirup
440e7063e2
refactor(web): simplify empty-state to remove inline workspace creation 2026-03-02 18:35:20 -08:00
kumarabhirup
f0135da82e
feat(web): add copyConfigAuth option to create-workspace-dialog 2026-03-02 18:35:13 -08:00
kumarabhirup
9542c60f66
feat(web): add workspace delete and profile discovery to profile-switcher 2026-03-02 18:35:03 -08:00
kumarabhirup
af0d34b5db
feat(web): add message queue UI with edit/send/remove to subagent-panel 2026-03-02 18:34:56 -08:00
kumarabhirup
e3fb54880a
feat(web): add subagent status labels to chat-message component 2026-03-02 18:34:49 -08:00
kumarabhirup
7309d649dd
test(web): add workspace file-ops, objects, and tree-browse tests 2026-03-02 18:34:41 -08:00
kumarabhirup
f23b7133cb
feat(web): improve suggest-files and tree route with better error handling 2026-03-02 18:34:34 -08:00
kumarabhirup
f3fffec97f
fix(web): guard system files in file write route and allow aborting waiting-for-subagents runs 2026-03-02 18:34:27 -08:00
kumarabhirup
67812f0de6
feat(web): add workspace delete API route 2026-03-02 18:34:19 -08:00
kumarabhirup
efbeacff54
test(web): update workspace init tests for new profile-based flow 2026-03-02 18:34:12 -08:00
kumarabhirup
3568779912
feat(web): overhaul workspace init with profile creation, onboarding, and port allocation 2026-03-02 18:34:06 -08:00
kumarabhirup
d8e2d455b8
test(web): update profiles API tests for gateway metadata and switch validation 2026-03-02 18:33:59 -08:00
kumarabhirup
d4a2e445ca
feat(web): harden profile switch with validation, existence check, and env override detection 2026-03-02 18:33:52 -08:00
kumarabhirup
6f6b841d92
feat(web): enrich profiles API with gateway metadata 2026-03-02 18:33:44 -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
kumarabhirup
20ace16d4c
fix(web): prevent subagent sessions from leaking into chat sidebar
- Skip updateIndex for session IDs containing :subagent: so they don't
  appear as top-level "New Chat" entries in the sidebar
- Filter subagent IDs in the sidebar component as a safety net
- Clean up existing leaked entries from index.json

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-22 01:11:26 -08:00
kumarabhirup
a046cf2349
refactor(web): unify subagent tracking with parent session system
Subagents now use the same ActiveRun infrastructure as parent sessions:
- startSubscribeRun() creates a subscribe-only ActiveRun when sessions_spawn
  tool results are detected, using the same event buffering, persistence,
  and SSE reconnection as parent runs
- Stream/stop/chat routes no longer branch on subagent vs parent; both
  use getActiveRun/subscribeToRun with the session key as map key
- hasRunningSubagentsForParent moved into active-runs.ts to check the
  unified activeRuns map (+ disk registry fallback)
- Deferred finalization on lifecycle/end with 5s safety timeout
- ev.data.text fallback for assistant events without delta field
- 24h cleanup grace for subscribe-only runs (vs 30s for parent)

Reverts the broken childSessionKey registration from 32cfcf14f.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-22 00:35:07 -08:00
kumarabhirup
6594de6186
Merge Ironclaw changes onto upstream Openclaw 2026.2.22
Replays all Ironclaw-specific changes (176 commits) onto the latest
upstream Openclaw release (2026.2.22). Conflicts auto-resolved in
favor of Ironclaw to guarantee zero change loss.

Merge base: cbc3de6c9 (2026-02-16)
Upstream: a37e12eab (upstream/main, 2026.2.22)
Ironclaw: 3009566c9 (origin/main, 2026.2.15-1.9)
Backup: ironclaw-backup-pre-sync

Conflict resolutions:
- 6 GitHub workflow files: deleted (Ironclaw intentionally stripped)
- src/sessions/session-key-utils.test.ts: kept (Ironclaw modified)
- Duplicate imports from merge: deduplicated
- Unused imports from upstream code Ironclaw overrode: removed
- Broken test indentation from merge: fixed

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-21 18:06:01 -08:00
kumarabhirup
7aadd02313
test: add comprehensive workspace test suite and deploy pre-flight checks
- Profile management: discoverProfiles, getEffectiveProfile precedence,
  setUIActiveProfile, resolveWebChatDir, workspace registry (32 tests)
- Workspace init API: creation, bootstrap seeding, custom paths,
  validation, idempotency (13 tests)
- Profile switch API: GET/POST profiles, validation, default reset (10 tests)
- Chat isolation: profile-scoped chat dirs, session isolation (7 tests)
- LLM context awareness: bootstrap loading, subagent filtering,
  resolveBootstrapContextForRun content isolation (15 unit + 5 live)
- Subagent streaming: registerSubagent, event replay, persistence,
  ensureRegisteredFromDisk, fan-out (24 unit + 5 live)
- deploy.sh: add --skip-tests flag, pnpm test + web:build pre-flight,
  auto git commit/push of version bump after publish
- package.json: add test:workspace and test:workspace:live scripts

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-21 15:38:31 -08:00
kumarabhirup
6665bf4a71
refactor: simplify web session management by removing unused functions and adding DELETE and PATCH endpoints
- Removed unused functions related to session index management.
- Added DELETE endpoint to remove a web chat session and its associated file.
- Added PATCH endpoint to update session metadata, including renaming sessions.
- Streamlined file writing for new session creation.
2026-02-21 15:17:10 -08:00
kumarabhirup
d88ed44521
Merge remote-tracking branch 'origin/main' into kumareth/workspaces
Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	apps/web/app/components/chat-message.tsx
2026-02-21 15:00:45 -08:00
kumarabhirup
c8ae7acbf4
fix: restore remaining merge regressions (SKILL.md, MIME types, showHidden, symlink, activeProfileHint) 2026-02-21 14:39:55 -08:00
kumarabhirup
92fadd6700
fix: filter non-parent events in main NDJSON handler and fix workspace creation path
Bug 1: Subagent events from gateway broadcasts were processed as parent
events because the sessionKey filter was accidentally removed during the
subagent decoupling refactor. Re-add the filter in wireChildProcess.

Bug 2: Creating workspaces at custom paths failed because:
- mkdir API rejected absolute paths outside workspace root
- Directory picker started at workspace root, not home
- Error responses from mkdir were silently swallowed
Add absolute path support to mkdir, handle errors in picker UI,
start picker at home dir, and normalize init route paths.
2026-02-21 13:45:11 -08:00
kumarabhirup
109b88b93c
web: restore functional features dropped by design merge
Restore backend/logic features that were incorrectly auto-merged from the
design branch:

- Spreadsheet viewer (xlsx, csv, ods, etc.) and xlsx dependency
- HTML iframe viewer with source toggle
- Directory picker modal for workspace creation
- Workspace registry for custom-path workspaces
- Session auto-discovery for orphaned sessions
- Workspace init seeding (CRM objects, DuckDB, templates, bootstrap files)
- Symlink resolution and showHidden in tree/browse routes
- Upload to workspace assets/ instead of hidden ~/.ironclaw/uploads/
- Webpack dev watcher config (next.config.ts)
- router.push for back-button navigation history
2026-02-21 13:10:32 -08:00
kumarabhirup
db4c90b37d
Merge remote-tracking branch 'origin/markrachapoom/design' into kumareth/workspaces
Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	apps/web/app/api/chat/subagent-stream/route.ts
#	apps/web/app/api/workspace/watch/route.ts
#	apps/web/app/components/chat-panel.tsx
#	apps/web/app/components/subagent-panel.tsx
#	apps/web/lib/subagent-runs.ts
#	apps/web/tsconfig.tsbuildinfo
2026-02-21 12:40:07 -08:00
kumarabhirup
536ae59667
web: add interactive messaging UI to subagent panel
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-21 12:32:59 -08:00
kumarabhirup
7cdcf61639
web: support subagent sessions in chat and stop API routes 2026-02-21 12:32:37 -08:00
kumarabhirup
54d048bfb9
web: merge subagent-stream into unified stream route 2026-02-21 12:32:32 -08:00