Commit graph

43 commits

Author SHA1 Message Date
gagan
372309eb18
feat: run code mode on an in-app ACP client with live approvals (#593)
* feat(code-mode): add ACP client engine (Layer 2 core)

Own the Agent Client Protocol client instead of shelling out to `acpx`, so code
mode can stream structured events (tool calls, diffs, plan) and surface live
permission requests. Headless acpx can't do live approvals (it only supports
--approve-all), which is why we drive the agent adapters ourselves.

- code-mode/acp/{agents,client,permission-broker,session-store,manager,types}.ts:
  headless engine driving the Claude/Codex ACP adapters; one warm session per chat
  with create-or-resume via session/load; approval policy (ask | auto-approve-reads
  | yolo) in the broker.
- claude-exec.ts: cross-platform claude resolver (Windows .cmd EINVAL fix + macOS/Linux
  GUI-PATH safety net) shared with the legacy acpx path in builtin-tools.ts.
- add @agentclientprotocol/sdk + claude/codex adapters to core.

* feat(code-mode): route code mode through code_agent_run tool + live approvals

Replace the acpx shell-out with a structured code_agent_run tool that drives the
ACP engine directly, streaming the agent's tool calls / diffs / plan into the chat
and surfacing permission requests inline.

- shared: code-mode.ts zod schemas; add code-run-event + code-run-permission-request
  RunEvent variants (stream to the renderer over the existing runs:events channel);
  codeRun:resolvePermission IPC channel.
- core: CodePermissionRegistry (promise-based mid-run approvals — the LLM tool-loop's
  pre-call gate can't model a mid-execution wait); register codeModeManager +
  codePermissionRegistry in awilix.
- core: code_agent_run builtin tool (streams via ctx.publish, asks via the registry,
  cancels on ctx.signal, returns the agent summary). CodeModeConfig.approvalPolicy
  (ask | auto-approve-reads | yolo; default ask). Exclude the tool from the headless
  background-task / live-note / inline-task agents so they can't block on an approval.
- main: codeRun:resolvePermission handler -> registry.resolve.
- rewrite the code-with-agents skill and the runtime "Code Mode (Active)" block to call
  code_agent_run instead of emitting npx acpx commands.

* feat(code-mode): render coding runs inline (live timeline + permission card)

Render a code_agent_run tool call as a live CodingRun block instead of generic
tool output: the agent's text, tool-call rows (kind icon + status + changed-file
names from diffs), a plan checklist, and resolved-permission lines — plus an
inline Allow / Always-allow / Deny card wired to codeRun:resolvePermission.

- chat-conversation.ts: ToolCall carries codeRunEvents + pendingCodePermission;
  code_agent_run is excluded from tool-grouping so it renders standalone.
- App.tsx: handle code-run-event / code-run-permission-request, clear the pending
  card on tool-result, handleCodePermissionResponse, render via CodingRunBlock.

* fix(code-mode): run the ACP adapter as Node under Electron + resolve it from main

Two runtime failures that only surfaced inside the packaged/bundled Electron app
(the headless harness used real node, so neither showed there):

- "ACP connection closed": the main process spawns the adapter via
  process.execPath, which inside Electron is the Electron binary, not node — so
  the child never ran as Node and its ACP stdio stream closed immediately. Set
  ELECTRON_RUN_AS_NODE=1 on the adapter env (a no-op under real node).
- "Cannot find module '@agentclientprotocol/claude-agent-acp'": the adapters were
  transitive (core) deps, unreachable from the esbuild-bundled main.cjs. Add them
  as direct deps of the main app so require.resolve finds them at runtime (and so
  they ship when packaged).

Also capture the adapter's stderr + exit code and enrich connection errors, so a
future failure reports the real cause instead of the opaque "ACP connection closed".

* chore(code-mode): remove dead acpx code paths and stale copy

Code mode now runs through the code_agent_run tool (owning the ACP client), so the
legacy acpx shell-out paths are dead. Remove them:

- core: envForCommand (acpx-only CLAUDE_CODE_EXECUTABLE injection) from
  executeCommand; getCodeModeCommandLabel (acpx run-status label).
- renderer: the acpx-detection "switch agent / auto-flip the code-mode chip" flow —
  App.tsx executeCommand detection, the permission-request onSwitchAgent button +
  badge, and the composer's code-mode-detected listener.
- copy: Settings -> Code Mode and the code-with-agents skill summary no longer
  mention acpx; tidy stale comments (claude-exec, command-executor).

No behavior change for code mode; the general executeCommand tool is unaffected.

* feat(code-mode): approval-policy selector in Settings

Surface the approval policy (Ask every time / Auto-approve reads / YOLO) in
Settings -> Code Mode, instead of being config-file only. The broker already
reads CodeModeConfig.approvalPolicy; this plumbs it through the
codeMode:getConfig / setConfig IPC + main handlers and adds the picker UI
(with a one-line explanation of each level). Defaults to "ask".

* fix(code-mode): harden ACP engine — turn-scoped connections, chip-authoritative agent, reliable stop

Three robustness fixes that co-modify manager.runPrompt and the code_agent_run
tool, so they land together:

- Lifecycle: scope each ACP adapter connection to the agent turn. Dispose it a
  short grace (60s) after the turn ends instead of holding it for the app's life;
  the next turn resumes via session/load (both agents support it). Wire
  disposeAll() on app quit (was dead code). Fixes the unbounded per-chat leak of
  booted agent processes.

- Agent selection: make the composer chip the source of truth. Thread codeMode
  into ToolContext; code_agent_run uses it instead of the model's guessed `agent`
  arg, which anchored on the thread's earlier agent and ignored a chip change.
  Prompts updated to match; the run is labelled by the agent that actually ran.

- Stop/abort: guarantee a stopped turn unwinds. On abort the manager sends ACP
  session/cancel, then force-kills the adapter after a 2s grace and resolves the
  turn as cancelled — a wedged adapter can no longer hang the run and lock the
  chat. code_agent_run returns a clean cancelled result.

* fix(code-mode): hide Codex's native console window on Windows

Codex's engine ships as a native console-subsystem binary (codex.exe). Launched
from our console-less Electron process tree, Windows allocated a fresh *visible*
console window for it; closing that window wedged the run in a pending state.
(Claude Code is a Node CLI, so it never triggers this.)

The window is created by @openai/codex's launcher (bin/codex.js), which spawns
codex.exe with no windowsHide. Patch it via pnpm to pass windowsHide: true
(CREATE_NO_WINDOW) so the console stays hidden — no window, nothing to close.

* refactor(code-mode): move ACP session files out of WorkDir/config

Per-run ACP session state is runtime state that accumulates one file per
chat run, not user/app config. Relocate it from WorkDir/config to a
dedicated WorkDir/code-mode/sessions/ so it can be listed, cleaned up, and
managed on its own without crowding config. Drop the now-redundant
codesession- filename prefix (the directory conveys it).
2026-06-05 14:45:08 +05:30
gagan
5368751f61
feat: render and edit docx files in-app (#589)
Add a DocxFileViewer (via @eigenpal/docx-editor-react) wired into the file-type viewer switch, reading/saving bytes through the existing base64 workspace IPC with debounced autosave.
2026-05-29 18:04:04 +05:30
Ramnique Singh
31e35e00b8 Refactor builtin file tools beyond workspace scope
Replace workspace-scoped builtin file tools with general-purpose file-* tools that accept relative, absolute, and ~/ paths. Relative paths still resolve against the configured workdir.

File operations within the workdir are auto-approved. File operations outside the workdir now emit file permission metadata and require user approval, with support for once, session, and persistent grants.

Add a shared filesystem layer for text-focused read/write/edit/list/search operations, including binary-file safeguards for text reads. parseFile and LLMParse continue to read file buffers for document/image parsing.

Update copilot prompts, background/live-note agents, knowledge workflows, and renderer labels/UI to use the new file-* tool surface and permission details.

Add package-local Vitest setup for @x/core with colocated filesystem unit tests covering path resolution, canonical permission paths, binary detection, read/write/edit behavior, glob, and grep.
2026-05-25 16:21:51 +05:30
Arjun
e3d2a0988b embed tweets 2026-05-09 12:06:54 +05:30
gagan
4b7911c8ea
fix: context-aware folder/note creation in knowledge panel (#538)
* fix: context-aware folder/note creation with folder highlight and inline rename

* fix: clear folder highlight when a note is opened
2026-05-08 02:42:55 +05:30
Arjun
d6651c4bf8 fix build issues 2026-05-06 22:22:27 +05:30
gagan
0e3d058c29
feat: Gmail-style email block with inbox container layout (#531)
* feat: restyle email block with Gmail-style layout and avatar

* style: apply Google Sans/Roboto font to email block

* feat: add Gmail inbox-style multi-email block with accordion rows

* style: fix sender name casing, weight, and email display in expanded view

* feat: emails inbox block with container layout, two-line rows, Gmail title style
2026-05-06 21:41:26 +05:30
Ramnique Singh
43c1ba719f add posthog analytics for llm usage and auth events
Captures per-LLM-call token usage tagged by feature (copilot chat,
track block, meeting note, knowledge sync), plus sign-in / sign-out
and identity. Renderer and main share one PostHog identity so events
from either process resolve to the same user.

See apps/x/ANALYTICS.md for the event catalog, person properties,
use-case taxonomy, and how to add new events.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 19:53:40 +05:30
Arjun
0bb256879c preserve formatting in chat input text 2026-04-23 21:29:51 +05:30
Ramnique Singh
8e0a3e2991 render tables in markdown 2026-04-20 10:43:27 +05:30
Ramnique Singh
e2c13f0f6f
Add tracks — auto-updating note blocks with scheduled and event-driven triggers
Track blocks are YAML-fenced sections embedded in markdown notes whose output
is rewritten by a background agent. Three trigger types: manual (Run button or
Copilot), scheduled (cron / window / once with a 2 min grace window), and
event-driven (Gmail/Calendar sync events routed via an LLM classifier with a
second-pass agent decision). Output lives between <!--track-target:ID-->
comment markers that render as editable content in the Tiptap editor so users
can read and extend AI-generated content inline.

Core:
- Schedule and event pipelines run as independent polling loops (15s / 5s),
  both calling the same triggerTrackUpdate orchestrator. Events are FIFO via
  monotonic IDs; a per-track Set guards against duplicate runs.
- Track-run agent builds three message variants (manual/timed/event) — the
  event variant includes a Pass 2 directive to skip updates on false positives
  flagged by the liberal Pass 1 router.
- IPC surface: track:run/get/update/replaceYaml/delete plus tracks:events
  forward of the pub-sub bus to the renderer.
- Gmail emits per-thread events; Calendar bundles a digest per sync.

Copilot:
- New `tracks` skill (auto-generated canonical schema from Zod via
  z.toJSONSchema) teaches block creation, editing, and proactive suggestion.
- `run-track-block` tool with optional `context` parameter for backfills
  (e.g. seeding a new email-tracking block from existing synced emails).

Renderer:
- Tiptap chip (display-only) opens a rich modal with tabs, toggle, schedule
  details, raw YAML editor, and confirm-to-delete. All mutations go through
  IPC so the backend stays the single writer.
- Target regions use two atom marker nodes (open/close) around real editable
  content — custom blocks render natively, users can add their own notes.
- "Edit with Copilot" seeds a chat session with the note attached.

Docs: apps/x/TRACKS.md covers product flows, technical pipeline, and a
catalog of every LLM prompt involved with file+line pointers.
2026-04-14 13:51:45 +05:30
Ramnique Singh
610616e5a0 add mermaid rendering 2026-04-10 18:00:30 +05:30
arkml
86cc2aaf73
Meeting notes2 (#454)
Improve meeting transcription: screen recording permissions, collapsible transcript block
2026-03-30 22:31:49 +05:30
arkml
30e1785fe2
Chrome extension (#453)
* added chrome extension
* prepare chrome extension for web store submission
* retention 7 days
* gate chrome service with a flag
2026-03-28 00:41:46 +05:30
arkml
91030a5fca
Blocks (#439)
Added blocks to notes and updated assistant skill with this.

Image blocks — images with alt text and captions
Embed blocks — inline YouTube videos, Figma designs, or link cards
Chart blocks — line, bar, and pie charts from inline data or JSON files
Table blocks — styled data tables with named columns
2026-03-18 23:33:12 +05:30
arkml
d0a48d7f51
Download notes (#423)
* download notes to md, pdf or docx
2026-03-14 21:29:53 +05:30
arkml
d7dc27a77e
History (#406)
* notes history
2026-02-27 20:22:54 +05:30
Ramnique Singh
9d4f25895e oauth: persist client state, simplify IPC, and refactor
connected-accounts UI

This refactor simplifies OAuth storage/IPC and updates the Electron UI
to use the new client-facing contract. OAuth state is now persisted per
provider with tokens, optional clientId, and an error string. A new oauth:getState
IPC returns only client-facing state (connected + error), and the UI renders
error/reconnect flow based on that.

  Core changes
  - Replace OAuth config with providers { tokens, clientId?, error? }
    and add zod-based migration from legacy token maps.
  - Persist Google clientId after successful OAuth and keep error state
    in repo.
  - Surface provider errors from refresh/credential failures in Google +
    Fireflies.
  - Add oauth:getState in IPC, returning client-facing config; remove
    old status wiring in the UI.

  UI changes
  - Switch renderer status checks to oauth:getState and derive connected/error
    from config.
  - Add alert dialog for account issues and update copy to “Connected
    accounts”.
  - Provide “View connected accounts” CTA that opens the Connectors popover.
  - Add shadcn alert-dialog component and Radix dependency.

  Notes
  - Adds @radix-ui/react-alert-dialog and shadcn wrapper.
  - pnpm-lock updated accordingly.
2026-02-17 09:54:34 +05:30
Ramnique Singh
d1a2446cb3 update ai packages 2026-02-14 12:16:43 +05:30
Arjun
4151c296bd feat: add parseFile builtin tool for PDF, Excel, CSV, Word extraction
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 16:11:13 +05:30
Ramnique Singh
35ca1b69c0 build .deb and .rpm 2026-02-06 23:34:13 +05:30
Ramnique Singh
6425dbcf28 fix electron-squirrel-startup 2026-02-06 07:28:55 +05:30
Ramnique Singh
269787a013 fix electron-squirrel-startup 2026-02-06 07:09:31 +05:30
Ramnique Singh
e1637d5965 add win32 + linux electron builds 2026-02-06 06:44:06 +05:30
Arjun
c447a42d07 feat: add background agents with scheduling support
- Add background task scheduling system with cron-based triggers
- Add background-task-detail component for viewing agent status
- Add agent schedule repo and state management
- Update sidebar to show background agents section
- Remove old workflow-authoring and workflow-run-ops skills
- Add IPC handlers for agent schedule operations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 16:43:09 +05:30
Arjun
3e2ed4cbc4 upgrade composio and dependencies 2026-02-03 12:28:24 +05:30
tusharmagar
aa2a830f23 feat: slack integration with composio
Allow users to ask copilot to use Slack on their behalf via Composio integration.
Adds composio client, OAuth flow, slack skill with tool catalog, and UI for
connecting Slack in onboarding and connectors popover.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 12:28:22 +05:30
Arjun
e6c6571b07 feat: extract presentation generator into executable code with builtin tool
Move the presentation implementation out of the skill string into real
TypeScript files (types.ts, presentation-generator.tsx) and add a
generatePresentation builtin tool so the agent calls it directly instead
of writing code. Rewrite the skill to guidance-only with content limits,
preference gathering, and JSON examples for each slide type.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:30:06 +05:30
tusharmagar
a2e929ed05 Add image upload support 2026-01-21 13:23:33 +05:30
tusharmagar
ead93c34fe Merge branch 'dev' of github.com:rowboatlabs/rowboat into dev 2026-01-21 09:25:04 +05:30
tusharmagar
500d2d6725 Add sonner for notifications and update UI components to utilize it; clean up unused props in chat sidebar 2026-01-21 09:24:56 +05:30
Ramnique Singh
7da1aa5454 add posthog 2026-01-21 09:14:32 +05:30
Ramnique Singh
0d9dac8344 add x64 target in electron build 2026-01-20 09:08:16 +05:30
Ramnique Singh
5765d50125 bump update-electron-app 2026-01-20 01:02:50 +05:30
Ramnique Singh
d92106741d add electron auto-update 2026-01-20 00:15:41 +05:30
Ramnique Singh
f72dee731a integrate electron forge 2026-01-17 10:28:44 +05:30
Arjun
274a351bc1 added glob tool 2026-01-16 15:51:29 +05:30
tusharmagar
9c1ddf66ed tiptap improvements + removing ask AI button 2026-01-16 12:05:34 +05:30
tusharmagar
23ae0d8be0 Tiptap integrated 2026-01-16 12:05:34 +05:30
tusharmagar
8834238768 added right click content menu to knowledge 2026-01-16 12:05:34 +05:30
Ramnique Singh
13f2b7c2a5 use openid-client lib 2026-01-16 12:05:34 +05:30
tusharmagar
47ab50bfe7 UI improvements 2026-01-16 12:05:33 +05:30
Ramnique Singh
505e3ea620 bootstrap new electron app 2026-01-16 12:05:33 +05:30