Commit Graph
157 Commits
Author SHA1 Message Date
David KayaandCopilot ab4e217d74 refactor: rename app to aryx
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 21:11:36 +01:00
David Kaya cb7f216bc3 fix: styling 2026-03-25 20:43:04 +01:00
David KayaandCopilot 8d3c4f474e revert: replace plain CSS class with @theme text-pill token
Remove .pill-trigger CSS class and restore the idiomatic Tailwind v4
@theme approach: --text-pill in @theme generates the text-pill utility.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 20:40:11 +01:00
David KayaandCopilot 4797c9b30c fix: use plain CSS class for pill font size instead of Tailwind token
The @theme --text-pill token and text-[8px] arbitrary value both
failed to apply at dev time due to @tailwindcss/vite not generating
the utility rule during HMR. Use a plain .pill-trigger CSS class
in styles.css instead, which is always available regardless of
Tailwind's JIT scanner behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 20:40:10 +01:00
David KayaandCopilot d6596efc11 fix: register pill font size as Tailwind v4 theme token
The arbitrary text-[8px] class was not being generated by the
Tailwind v4 Vite plugin at dev time. Register --text-pill in
@theme so text-pill becomes a first-class utility that is always
generated. Uses 0.5rem (8px) with line-height 1.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 20:33:28 +01:00
David KayaandCopilot 0ed22adb03 style: add leading-none to pill text to ensure 8px font takes effect
Add explicit leading-none alongside text-[8px] so both font-size
and line-height shrink, making the size reduction visually apparent.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 20:32:44 +01:00
David KayaandCopilot 689b853a8a style: set pill font to 8px and add breathing room around icons
Reduce font to text-[8px], restore icons to size-2.5 for legibility,
and bump padding to px-1.5 py-0.5 so icons aren't flush with the
pill border.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 20:28:43 +01:00
David KayaandCopilot 23c8a6bb9b style: further shrink inline pills to match surrounding text density
Reduce to text-[10px] (matching agent badges), px-1 py-px padding,
gap-0.5, size-2 icons, rounded (not rounded-md), and 100px model
name truncation. Pills now sit subtly alongside 13px chat text.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 20:25:50 +01:00
David KayaandCopilot fa037859da style: reduce inline pill button size above chat composer
Shrink padding (px-2 py-1 → px-1.5 py-0.5), font (12px → 11px),
gap (1.5 → 1), icon size (3 → 2.5), and model name max-width
(140px → 120px) on all four pill trigger buttons. Dropdown popovers
remain unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 20:20:36 +01:00
David KayaandCopilot 1b1ebdb676 fix: move handleCreateScratchpad above early return to fix hooks order
The useCallback for handleCreateScratchpad was placed after the early
return for the loading state, causing React to see a different number
of hooks between the initial render (workspace undefined) and subsequent
renders. Move it before the guard and add a null check inside instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 20:16:44 +01:00
David KayaandCopilot 3218de3856 docs: strengthen backend agent guidelines
Clarify backend C# cleanliness, decomposition, contract safety, testing, and validation expectations for future agent changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 20:13:31 +01:00
David KayaandCopilot 0bc90be68e docs: add frontend conventions and validation checklist to agent guidelines
Add section 5 (Frontend conventions) covering:
- Feature-based component directory structure and placement rules
- Custom hooks location and patterns
- Lib utility boundary (pure logic vs React-aware hooks vs components)
- State/rendering guidance (useCallback, useMemo, lifting state)
- Accessibility requirements for modals, dropdowns, menus, toggles
- Import conventions and path alias usage

Add section 7 (Validation checklist) with the exact commands to run
before every commit: typecheck, test, build, and optionally sidecar:test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 20:12:51 +01:00
David KayaandCopilot fcfc5c9641 refactor: decompose large frontend components into focused modules
Split six monolithic component files into smaller, single-responsibility
modules organized by feature domain:

- ChatPane (1054→~250 lines): extract InlinePills, ApprovalBanner,
  ThinkingDots into chat/ directory
- SettingsPanel (1027→~280 lines): extract McpServerEditor,
  LspProfileEditor, ToolingEditorShell into settings/ directory;
  mutation helpers into lib/settingsHelpers.ts
- PatternEditor: use shared ToggleSwitch from ui/
- App.tsx: extract useTheme and useSidecarCapabilities into hooks/
- Sidebar: extracted accessibility improvements inline

New shared primitives:
- hooks/useClickOutside: replaces 5 duplicated click-outside listeners
- components/ui/: ToggleSwitch, PopoverToggleRow, FormField, TextInput,
  TextareaInput, SelectInput, InfoCallout

Accessibility improvements:
- NewSessionModal: role=dialog, aria-modal, Escape-to-close
- Pill dropdowns: aria-expanded, aria-haspopup, role=listbox/option
- Sidebar context menu: role=menu/menuitem, Escape-to-close
- SessionItem: Space key activation alongside Enter
- ToolbarButton: aria-pressed for toggle state
- ApprovalBanner: role=alert
- QueuedApprovalsList: aria-expanded on toggle
- ThinkingDots: aria-label

No behavioral changes. All 137 tests pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 20:12:36 +01:00
David KayaandCopilot 1bd0fcba3e refactor: improve sidecar backend structure
Refactor sidecar command dispatch, approval handling, transcript projection, stream merging, and tooling helpers while preserving behavior and expanding backend regression coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 20:11:59 +01:00
David KayaandCopilot 4f202274db feat: replace PrismJS with highlight.js for code syntax highlighting
PrismJS's CJS global state is fundamentally incompatible with Vite's ESM
dev mode, causing missing language support (~40% of dropdown languages)
and fragile loading hacks (optimizeDeps, global assignment).

Replace the entire Prism integration with highlight.js/lib/common which
is ESM-native, has no global state, and covers all 22 dropdown languages
out of the box (~37 common languages included).

Implementation:
- Custom CodeHighlightPlugin using hljs.highlight() for tokenization
- HTML parser extracts flat tokens from hljs output (handles nested spans)
- Token type mapping from hljs scopes to Lexical codeHighlight theme keys
- Selection preservation via absolute character offset save/restore
- Re-entrancy guard prevents infinite transform loops
- Removed @lexical/code-prism import and Vite optimizeDeps workaround

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 20:08:14 +01:00
David KayaandCopilot 2338d7c44b fix: resolve Prism CJS loading crash in Vite dev mode
Remove the prismSetup module that imported prismjs directly — it
caused Vite to pre-bundle prismjs into a separate chunk from
@lexical/code-prism, breaking the CJS require chain.  Language
components tried to call Prism.languages.extend() before the base
grammars were available, crashing the app.

Instead, add optimizeDeps.include for prismjs and @lexical/code-prism
so Vite pre-bundles them together, preserving the correct CJS
evaluation order within a single chunk.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 20:03:57 +01:00
David KayaandCopilot 5dc86426b1 fix: move Prism global setup to entry-point module
The previous approach imported prismjs component files directly in
MarkdownComposer.tsx.  In Vite dev mode, each component is served
as a separate ESM module whose IIFE references a bare 'Prism' global
that doesn't exist yet, crashing the app.

Fix: create a dedicated prismSetup module that imports prismjs and
assigns globalThis.Prism, then import it from the renderer entry
point (main.tsx) before any component that loads @lexical/code-prism.
ESM evaluation order guarantees the global is set before the
tokenizer captures its reference.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 20:03:02 +01:00
David KayaandCopilot 860876172e feat: enable Prism syntax highlighting in code blocks
- Register CodeHighlightNode in the editor node set
- Add CodeHighlightPlugin that calls registerCodeHighlighting
- Map 20+ Prism token types to mc-tok-* CSS classes with dark theme colors
- Explicitly import prismjs + language components and set globalThis.Prism
  before @lexical/code-prism loads, fixing a Vite dev-mode race where
  the CJS shim could initialize the tokenizer before the global was set
- Added @types/prismjs for type checking

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 19:52:54 +01:00
David KayaandCopilot 8240468d1e feat: enable Prism-based syntax highlighting in code blocks
- Register CodeHighlightNode in the editor node set
- Add CodeHighlightPlugin that calls registerCodeHighlighting
- Map codeHighlight theme keys to mc-tok-* CSS classes
- Add dark-theme token colors for 20+ Prism token types

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 19:52:41 +01:00
David KayaandCopilot 38d7e339a2 fix: replace imperative DOM overlay with React-based positioning
The imperative approach inserted overlay elements directly into
Lexical-managed CodeNode DOM elements.  Lexical's MutationObserver
detected the foreign DOM nodes, reconciled them away, which triggered
update listeners that re-inserted them — causing an infinite loop
that froze the app.

The new approach renders overlay elements via React, positioned
absolutely in a pointer-events:none container that sits over the
content editable.  Overlay positions are computed from each code
element's bounding rect and updated via requestAnimationFrame on
editor updates and scroll events.  This avoids all Lexical DOM
mutation and eliminates the freeze.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 19:49:16 +01:00
David KayaandCopilot 9ef7150183 feat: move language selector onto code block, fix code block insertion
Language selector:
- Replaced toolbar dropdown with an imperative overlay rendered
  directly inside each code block's DOM element
- Overlay uses contentEditable='false' + position:absolute at the
  top-right of the code block, styled as a compact native select
- Plugin re-inserts overlays after each Lexical reconciliation to
  survive DOM diffing

Code block insertion:
- toggleCodeBlock now inserts a trailing paragraph after the code
  block when it would otherwise be the last element, so the user
  can always type regular text below a code block

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 19:42:58 +01:00
David KayaandCopilot 039b9037ee feat: add code block language selector to composer
When the cursor is inside a code block, the formatting toolbar shows
a language dropdown (22 languages). Selecting a language updates the
CodeNode, which the markdown serializer writes as the fenced code
block language tag (e.g. \\\	ypescript).

A CodeBlockLabelPlugin syncs a data-code-language attribute on each
code block element so CSS ::before shows the friendly language name
as a small label at the top of the block.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 19:37:08 +01:00
David KayaandCopilot 1f9203e1da fix: send button clearance and code block display mode
- Increase editable min-height from 40px to 52px and padding from 8px
  to 10px so the send button (32px + 8px bottom offset) has 12px
  clearance from the toolbar border instead of 0px
- Add display: block to .mc-code-block — Lexical CodeNode renders as
  <code> which is inline by default, causing border/padding to split
  visually across lines instead of forming a proper block
- Revert empty code block to code.select() without synthetic TextNode

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 19:35:25 +01:00
David KayaandCopilot d84de12f45 fix: send button overlaps toolbar border and empty code block glitch
- Move send button into MarkdownComposer children slot so it positions
  relative to the editor content area, not the full container
- Always create a text node when inserting a code block to prevent
  Lexical from rendering a split/empty code block artifact

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 19:31:24 +01:00
David KayaandCopilot 77194d1f01 feat: replace textarea with Lexical WYSIWYG markdown composer
Replace the plain <textarea> in ChatPane with a full WYSIWYG
markdown composer built on Lexical 0.42.0.

Composer features:
- Rich text editing with inline formatting (bold, italic, code)
- Block-level elements: headings, bullet/numbered lists, code blocks,
  blockquotes, links via markdown shortcuts (e.g. ## , - , \\\)
- Formatting toolbar with active-state indicators
- Markdown paste auto-import when the editor is empty
- Enter to send, Shift+Enter for newline (matches prior behavior)
- Disabled state syncs with session busy/config states
- Serializes to markdown on submit via the backend helpers

Files:
- New: MarkdownComposer.tsx (Lexical editor, toolbar, internal plugins)
- Modified: ChatPane.tsx (swap textarea for MarkdownComposer, simplify state)
- Modified: styles.css (add markdown composer theme classes)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 19:21:13 +01:00
David KayaandCopilot d07bf30e81 feat: add markdown composer backend foundation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 19:19:58 +01:00
David Kaya a8c6ba94f5 feat: collapse timeline automatically 2026-03-25 00:25:00 +01:00
David KayaandCopilot f2c5b2cf1a fix: preserve handoff final authorship
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 00:15:30 +01:00
David KayaandCopilot a6b3b0ff83 docs: note local upstream clone paths
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 00:13:25 +01:00
David KayaandCopilot 6460fe7173 fix: preserve agent authorship across projections
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 00:10:56 +01:00
David KayaandCopilot 9bfd7837aa fix: preserve handoff agent identity
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 00:02:46 +01:00
David KayaandCopilot 7c848113c0 fix: correct handoff output attribution
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 23:55:30 +01:00
David Kaya 2fc03454c4 fix: block tools for handoff triage\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> 2026-03-24 23:51:38 +01:00
David KayaandCopilot 2c972a063a fix: tighten handoff routing behavior
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 23:47:31 +01:00
David KayaandCopilot f67fab0816 fix: edge selection highlighting and group-chat connection rules
- Add CSS styling for selected edges (indigo highlight with glow)
- Enable orchestrator↔agent connections in group-chat mode
- Downgrade disconnected-agent validation from error to warning
- Rename addHandoffEdge to addEdge (generic for all modes)
- Add tests for group-chat connection rules

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 23:41:00 +01:00
David KayaandCopilot f0d7d44589 feat: enable edge deletion in group-chat mode
Extend edge deletion to group-chat orchestrator↔agent edges in addition
to handoff agent↔agent edges. Structural edges (user-input/output,
distributor/collector) remain non-deletable across all modes.

Sequential, concurrent, and single modes keep fully structural topologies
with no user-deletable edges.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 23:34:38 +01:00
David KayaandCopilot 24bbf1ded3 fix: agent node deletion, inspector layout, and header overlap
- Enable Delete-key removal of agent nodes on the canvas; system nodes
  remain non-deletable. Removals route through the authoritative
  removeAgent path which prevents deleting the last agent.
- Stack Model and Reasoning selects vertically in the inspector panel
  so they fit within the 320px-wide column without truncation.
- Add right padding (pr-36 / 144px) to the editor header so the Save
  and Delete buttons clear the Windows title-bar overlay controls.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 23:32:22 +01:00
David KayaandCopilot c81ea6f83b feat: improve graph readability with colored edges, bezier curves, and auto-layout
- Color-code edges by semantic role: structural edges (system↔node) in
  muted zinc, agent-to-agent edges in indigo for clear visual separation
- Switch from smoothstep to bezier curves for smoother, more natural
  edge routing that reduces right-angle overlaps
- Stagger agent nodes at alternating X offsets in concurrent, handoff,
  and group-chat layouts so parallel fan-out/fan-in edges take distinct
  bezier paths instead of stacking
- Increase spacing in all layouts to give edges more room
- Add dagre-powered auto-layout button (top-right of canvas) that
  computes optimal left-to-right hierarchical node positions
- Add 2 new tests for auto-layout across all orchestration modes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 23:27:43 +01:00
David Kaya 9b689e1411 Revert "fix: show single handle per node, rely on arrow for direction"
This reverts commit b5b4f1b1c6.
2026-03-24 23:21:15 +01:00
David KayaandCopilot b5b4f1b1c6 fix: show single handle per node, rely on arrow for direction
Hide the target (left) handle on SystemNode and AgentNode so each node
displays only one visible circle. The directional arrow marker on edges
communicates flow direction, halving the visual handle count.

- user-input:  source handle on right (visible)
- user-output: target handle on left  (visible)
- all others:  source handle on right (visible), target on left (hidden)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 23:18:55 +01:00
David KayaandCopilot eb2c8450e3 feat: directional edges and provider icons on agent nodes
- Add ArrowClosed markers to all graph edges for clear directional flow
- Replace generic Bot icon with AI provider logos (OpenAI, Anthropic,
  Google) on agent nodes, inferred from the agent's model id
- Show model display name as subtitle on agent nodes (e.g. 'GPT-5.4',
  'Claude Opus 4.5')
- Thread availableModels catalog from PatternEditor through canvas to
  resolve friendly model names; falls back to raw model id
- Add 3 new tests for arrow markers, provider icons, and model labels

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 23:16:04 +01:00
David KayaandCopilot c6c8e79e9f fix: address graph editor UX feedback
- Hide input handle on User Input nodes and output handle on User Output
  nodes (separate userInputNode/userOutputNode node types)
- Enable edge deletion in handoff mode only (Delete key or React Flow UI);
  only agent-to-agent edges are deletable, structural edges are protected
- Block all edge mutations (add/delete) in concurrent and group chat modes
- Add agent as disconnected node without auto-rebuilding the graph
- Add sequential reorder controls (↑↓) in the inspector panel with
  position/order swap and automatic edge rebuilding
- Replace circular group chat layout with vertical column to prevent
  bidirectional edge crossings
- Tighten handoff layout spacing so edges between triage and specialists
  don't overlap nodes
- Use smoothstep edge type for cleaner edge routing across all modes
- Add 6 new tests covering reorder, disconnected add, edge deletion rules,
  and node type assertions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 23:09:21 +01:00
David KayaandCopilot 7d078faada feat: replace form-based pattern editor with interactive graph canvas
Replace the flat agent list and static flow diagrams in PatternEditor with
an interactive React Flow canvas backed by the authoritative PatternGraph
model. Users can now see and manipulate orchestration topology visually.

Changes:
- Add @xyflow/react (React Flow) as a canvas library
- Create patternGraph view-model layer for graph-to-canvas projection
- Create GraphNodes with custom system/agent node components
- Create PatternGraphCanvas with drag, connect, and selection support
- Create PatternGraphInspector for selected node/agent details
- Rewrite PatternEditor with split layout: canvas + inspector sidebar
- Add dark theme CSS overrides for React Flow
- Add 11 tests covering view-model projection, connection rules, and
  graph mutation helpers
- Update ARCHITECTURE.md to reflect the new renderer graph boundary

The canvas projects PatternGraph into React Flow nodes/edges. Handoff mode
supports drawing new agent-to-agent edges interactively. Node positions
persist to the graph on drag completion. Agent editing moves from inline
forms to the inspector panel on node selection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 22:54:02 +01:00
David KayaandCopilot 2e2caf78f9 feat: add graph-backed orchestration topology
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 22:44:17 +01:00
David KayaandCopilot 5ab0b22d15 fix: align orchestration behavior with agent framework docs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 22:09:52 +01:00
David KayaandCopilot cf6a25a9da refactor: simplify handoff payload parsing
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 21:37:36 +01:00
David KayaandCopilot 8b2e7cd2c0 refactor: simplify workflow request interpretation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 21:29:35 +01:00
David Kaya 38ebe5bdfa docs: revert agent things 2026-03-24 21:23:48 +01:00
David KayaandCopilot 76846843ab docs: refine agent quality guidance
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 21:17:40 +01:00
David KayaandCopilot f1a96773c8 refactor: decompose CopilotWorkflowRunner
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 21:10:06 +01:00