Commit Graph

1439 Commits

Author SHA1 Message Date
Fusion
5e62881d44 feat(FN-2218): add Markdown/Raw toggle for task documents
- Add Markdown/Raw rendering toggle support to DocumentsView and TaskDocumentsTab for consistent document preview behavior
- Reuse workflow-style toggle UX and markdown CSS patterns to align with existing dashboard design conventions
- Add comprehensive tests for DocumentsView and TaskDocumentsTab toggle interactions and rendering states
- Update dashboard guide documentation to describe the new Markdown/Raw toggle behavior
2026-04-22 08:04:24 -07:00
Fusion
3afa378594 feat(FN-2232): check mailbox on every heartbeat run
- Fetch unread inbox messages whenever messageStore is available, not only wake-on-message triggers
- Include pending messages in execution prompts for task and no-task heartbeat runs across timer, assignment, and on-demand sources
- Extend heartbeat messaging tests to cover run-wide mailbox prefetch and read-marking behavior
- Document heartbeat mailbox checking semantics and messageResponseMode behavior in agents docs
- Replace Header mailbox badge class with existing header-badge style token
2026-04-22 07:53:37 -07:00
Fusion
cc7d7d9040 fix(FN-2227): stabilize NewAgentDialog async lifecycle tests
- Trigger model loading when the dialog opens instead of only on initial mount
- Guard NewAgentDialog effects with isOpen to avoid late async state updates after close/unmount
- Update AgentsView dialog tests to await settled UI state before asserting controls
- Harden NewAgentDialog tests with async act/waitFor patterns around render, reopen, and fetch side effects
2026-04-22 02:05:26 -07:00
gsxdsm
a5800392f1 feat(FN-2220): merge fusion/fn-2220 2026-04-22 01:31:40 -07:00
gsxdsm
7e3c68249e feat(dashboard): bearer-token auth with browser persistence + MIT license
Pre-release polish. Two related changes bundled because they both land the
project on public-release footing:

Dashboard auth
- fn dashboard now gates the HTTP API + terminal/badge WebSockets behind a
  bearer token by default. Token resolution order: --token flag,
  FUSION_DASHBOARD_TOKEN env, FUSION_DAEMON_TOKEN env (back-compat), or an
  auto-generated fn_<32 hex>. --no-auth disables. The startup banner prints
  a click-to-open URL with ?token=<token> embedded.
- Auth middleware now also accepts fn_token=<token> as a query-string
  fallback so EventSource and WebSocket clients (which can't set custom
  headers) still authenticate.
- setupTerminalWebSocket / setupBadgeWebSocket now refuse unauthenticated
  upgrades with a proper 401 + socket close.
- Frontend: new auth.ts module captures ?token= off the URL into
  localStorage (key fn.authToken), strips it from the visible URL via
  replaceState, and installs a window.fetch wrapper that injects
  Authorization: Bearer <token> on every same-origin /api/* request.
  EventSource/WebSocket URL builders (api.ts, sse-bus.ts, useTerminal,
  useBadgeWebSocket) route through appendTokenQuery().

MIT license
- LICENSE file at repo root.
- license: "MIT" on root package.json and every packages/*/package.json,
  plus description/bugs metadata on the CLI package.

Docs
- docs/cli-reference.md documents --token / --no-auth / FUSION_DASHBOARD_TOKEN
  and the click-to-open auth flow.
- docs/getting-started.md, docs/docker.md, README.md point at the new flow
  and the CLI reference section.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 20:12:00 -07:00
Fusion
c9592050a6 feat(FN-2211): suppress redundant agent health labels
- Add stateDerived metadata to AgentHealthStatus to indicate when health text only mirrors agent.state
- Update getAgentHealthStatus to set stateDerived consistently across terminated, error, paused, running, heartbeat, idle, and disabled paths
- Update AgentDetailView, AgentListModal, and AgentsView to render icon-only health badges when labels are state-derived while preserving full labels via title tooltips
- Expand agentHealth tests with explicit stateDerived assertions and a table-driven semantics suite for representative states
2026-04-21 08:05:20 -07:00
Fusion
fd83cc6fd5 fix(FN-2210): classify legacy verification agents as ephemeral
- Extend isEphemeralAgent to treat metadata.internal agents as internal system agents
- Add legacy fallback detection for executor agents named verification-agent with no reportsTo
- Update AgentsView list and org tree filtering to honor the Show system agents toggle
- Add regression coverage in core and dashboard tests for default filtering and includeEphemeral visibility
2026-04-21 02:40:50 -07:00
Fusion
e1af5bbfe4 feat(FN-2202): reposition and restyle task card agent badge
- Move the assigned agent badge out of the card header into a dedicated metadata row below task details
- Add a new .card-agent-row container to control spacing and alignment for the badge block
- Update .card-agent-badge styling to use token-aligned pill radius and color-mix backgrounds while removing monospace/fixed-width conventions
- Expand TaskCard agent badge tests to verify new DOM placement and enforced badge style rules
2026-04-21 00:32:12 -07:00
Fusion
7bcc360400 feat(FN-2188): harden dev server view lifecycle and mobile nav
- Update the dashboard dev-server API client for compatibility with multiple backend response shapes
- Refine useDevServer polling and SSE lifecycle handling to improve status/action reliability
- Gate dev server navigation in header/mobile overflow and fix mobile preview header wrapping styles
- Expand DevServerView and useDevServer test coverage with isolated mocks and log/status assertions
- Document the devServerView experimental feature flag in settings reference
2026-04-20 23:07:28 -07:00
Fusion
3a9ab4171a feat(FN-2173): add auto-fallback flow for dev server preview
- Add preview embed diagnostics with richer error classification and fallback state handling
- Improve PreviewIframe and DevServerView retry UX for timeout and iframe failure states
- Adjust preview layout/styles to prevent clipping and header overflow while keeping fallback panels centered
- Expand dashboard tests to cover fallback transitions, retry flows, and responsive CSS behavior
2026-04-20 22:10:07 -07:00
Fusion
b0defea550 feat(FN-2172): add embedded dev server preview panel
- Add usePreviewEmbed hook to derive preview embed URLs and availability state
- Add PreviewIframe component with iframe load/error wiring and deduplicated error callbacks
- Integrate preview panel actions, fallback messaging, and embedded iframe rendering in DevServerView
- Expand test coverage for usePreviewEmbed, PreviewIframe, and DevServerView preview integration scenarios
2026-04-20 19:48:32 -07:00
Fusion
64f5c0862b fix(FN-2199): normalize heartbeat settings dirty state in agent config
- Display heartbeat interval and timeout in seconds while persisting runtimeConfig in milliseconds
- Convert derived and persisted heartbeat values before dirty-state comparison so unchanged settings keep Save Settings disabled
- Update heartbeat validation minimums, placeholders, and hints to align with seconds-based inputs
- Expand AgentDetailView tests for pre-filled values, unchanged-state save disabling, validation, and payload conversion
2026-04-20 18:44:40 -07:00
Fusion
dfcb0868a2 feat(FN-2201): make Run Now available for active agents
- Show Run Now controls in AgentsView for active and running agents without requiring taskId
- Rename Run Heartbeat copy to Run Now and update runs-tab accessibility labels in AgentDetailView
- Add AgentsView coverage for Run Now visibility and startAgentRun invocation when no task is assigned
- Update agent runs UI static-analysis tests and add a patch changeset for @gsxdsm/fusion
2026-04-20 17:16:22 -07:00
Fusion
c8203210c2 feat(FN-2170): add dev-server preview detection and log viewer flow
- Add dev-server port detection utilities and wire detected preview state into process/manager lifecycle
- Normalize dev-server status API responses with preview URL, detected port, and manual override compatibility
- Introduce useDevServerLogs and DevServerLogViewer, and integrate them into the DevServer dashboard view
- Expand dashboard test coverage for detection edges, process/routes behavior, log history handling, and CSS regressions
2026-04-20 15:37:32 -07:00
Fusion
6522369168 feat(FN-2182): add dashboard dev server management view
- Add DevServerView with command detection, start/stop/restart controls, live logs, and preview URL management
- Implement useDevServer with SSE log streaming, running-state polling, manual URL updates, and candidate detection support
- Extend dashboard API client mappings for dev-server candidate metadata, status fields, and preview URL helpers
- Integrate dev server navigation in header/mobile nav, normalize devserver view state persistence, and add feature-flag wiring
- Add/refresh DevServerView and useDevServer tests and replace legacy dev-server CSS with the new component styles
2026-04-20 15:09:56 -07:00
Fusion
db8258f8bd fix(FN-2198): sync agent heartbeat config UI with live runtime updates
- Refresh AgentDetailView on agent:updated SSE events while preserving local unsaved config edits
- Resync heartbeat and budget form state from latest runtime config when agent data changes
- Centralize heartbeat interval defaults/formatting in shared utilities and reuse them in AgentsView selectors
- Add dashboard tests for default heartbeat hints, unset runtime fallback behavior, and custom interval options
2026-04-20 14:36:18 -07:00
Fusion
238c5e27ec test(FN-2197): reconcile skipped-test inventory and stabilize planning resume coverage
- Add docs/skipped-test-inventory.md with the current intentional skip patterns and rationale across test suites
- Link the skipped-test inventory from docs/README.md for easier discovery
- Record reconciliation of older skip follow-up tasks that are now covered and no longer active backlog
- Stabilize PlanningModeModal conversation-history resume testing by overriding stream behavior in the targeted test case
2026-04-20 14:11:28 -07:00
Fusion
42476ec3da feat(FN-2166): persist dev server script configuration across sessions
- Extend dev server store with config defaults, normalization, and JSON persistence alongside runtime state.
- Add GET/PUT /api/dev-server/config endpoints with strict request validation for nullable fields and preview URLs.
- Add dashboard API helpers plus a useDevServerConfig hook to load and update selected script, source, command, and preview override.
- Update DevServerView and styles to support saved script selection, change/clear actions, and synchronized command/preview inputs.
- Expand dev server store/routes/component tests and document the config endpoint in architecture docs.
2026-04-20 12:59:58 -07:00
gsxdsm
ca6ed92dd1 fix(FN-000): clear stale queued state on task resume
Resume paths (unpause, drift recovery, engine restart) bypassed the
scheduler's todo->in-progress clear, leaving actively executing tasks
labeled status="queued" with a lingering blockedBy. Broadened
clearResumeFailureState to null both fields alongside the existing
failure cleanup, and added a defensive UI backstop so the "Queued"
badge no longer renders for tasks in the in-progress column.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 11:28:56 -07:00
Fusion
ee55075440 fix(FN-2194): align prompt manager spacing and responsive gutters
- Add horizontal padding to the prompt manager container for consistent desktop gutters
- Add top margin to separate the prompt manager from surrounding sections
- Add a mobile-specific prompt manager padding override at the 768px breakpoint
2026-04-20 11:21:32 -07:00
gsxdsm
c7266b7fbd fix(FN-000): restore iOS terminal input by full-covering helper textarea
On iOS Safari/PWA, tapping the terminal opened the keyboard but typed
keys produced no output. Focus landed on a 1×1 opacity-0.01 helper
textarea overlapped by the xterm canvas, and capture-phase gesture
handlers re-focused on every tap — a combination iOS silently drops
input events on.

- On touch-primary devices, expand .xterm-helper-textarea to cover the
  entire terminal surface (100% × 100%, opacity 0, z-index 2) via
  @media (hover: none) and (pointer: coarse). Taps land on the
  textarea directly, so iOS grants keyboard + input events natively.
- Desktop keeps the 1×1 rule so xterm's canvas-level drag-to-select
  and mouse tracking continue to work.
- Revert onPointerDownCapture/onTouchStartCapture/onClickCapture back
  to bubble-phase onPointerDown/onTouchStart; capture phase was
  confusing iOS's focus attribution and is no longer needed now that
  taps reach the textarea directly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 10:42:44 -07:00
Fusion
c19ac60d10 feat(FN-2192): rename markdown files route to markdown-list
- Rename the dashboard markdown files route to /files/markdown-list.
- Update fetchProjectMarkdownFiles to call the new markdown-list endpoint.
- Adjust useDocuments test mocks and assertions to match the renamed route.
2026-04-20 10:38:38 -07:00
Fusion
263d23dccf feat(FN-2189): include gh CLI auth in setup readiness
- Extend auth status API typing to include optional ghCli availability/authentication metadata.
- Update /api/auth/status to return ghCli readiness using isGhAvailable() and isGhAuthenticated().
- Treat setup GitHub readiness as satisfied when either GitHub OAuth or authenticated gh CLI is present.
- Add hook tests covering gh CLI authenticated, unauthenticated, combined OAuth, and missing-ghCli fallback cases.
2026-04-20 10:16:13 -07:00
Fusion
74f2b25c1d fix(FN-2176): honor planning summary overrides for task generation
- Add optional summary payload support to planning create-task and start-breakdown API client calls
- Pass edited summary data from PlanningModeModal when creating a task or starting breakdown
- Parse and validate summary overrides in planning routes and prioritize override data when present
- Add and update dashboard tests to verify override handling and modal call expectations
2026-04-20 09:32:04 -07:00
Fusion
a1f535008b fix(FN-2165): prevent mobile nav tab overflow
- Keep only one optional tab (Skills or Roadmaps) in the top-level mobile nav to preserve touch-target width
- Move overflowed optional destinations into the More sheet and mark More active when those views are selected
- Add MobileNavBar tests covering Skills/Roadmaps overflow behavior and More-sheet routing
- Add mobile nav CSS guards (min-width and label ellipsis) to avoid clipping on narrow screens
2026-04-20 08:53:25 -07:00
Fusion
c03868af48 fix(FN-2179): suppress ANSI regex lint warning in dev server logs 2026-04-20 08:30:24 -07:00
Fusion
7b7883434f test(FN-2179): complete Step 6 dev server hook and component tests 2026-04-20 08:30:24 -07:00
Fusion
9a3155416a feat(FN-2179): complete Step 3-5 dev server view UI and navigation 2026-04-20 08:30:24 -07:00
Fusion
d0bd6c2329 feat(FN-2179): complete Step 1-2 API and useDevServer hook 2026-04-20 08:30:24 -07:00
Fusion
7b8bbaaa0a feat(FN-2152): render collapsed tool call previews in chat
- Emit tool_start/tool_end SSE events from dashboard chat backend and parse them in streaming client helpers
- Track in-flight and completed tool calls in useChat/useQuickChat to preserve tool output summaries alongside assistant messages
- Render collapsed tool call preview blocks in ChatView and QuickChatFAB with dedicated tokenized styles for compact output summaries
- Expand frontend and backend test coverage for SSE tool events, hook state transitions, and collapsed preview rendering behavior
- Add a changeset for @gsxdsm/fusion documenting the new tool-call display behavior
2026-04-20 08:30:24 -07:00
Fusion
eaf99e6279 feat(FN-2195): unify chat model labeling for fn assistant sessions
- Show formatted model names in sidebar metadata for fn assistant sessions with a Fusion fallback
- Use the resolved model name as the thread header title and assistant avatar label for fn sessions
- Suppress duplicate model tags when the primary label already displays the model while keeping tags for non-fn sessions
- Expand ChatView tests to cover sidebar, header, and avatar model-label and fallback behavior
2026-04-20 08:30:24 -07:00
Fusion
0b9bf62a2a refactor(FN-2162): rename kb-agent identifiers to fn-agent
- Rename core loader, dashboard server chat/planning routes, and frontend agent IDs/storage keys from kb-agent to fn-agent naming
- Update dashboard hooks and components (agent list, chat view, quick chat) to use the new fn agent key prefixes consistently
- Refresh engine, dashboard, core, and CLI tests/mocks to remove remaining kb-agent route and temp prefix references
- Update storage/gap-analysis docs to reflect fn agent key names and add a @gsxdsm/fusion patch changeset for the rename
2026-04-19 20:48:14 -07:00
Fusion
0aa1360a18 feat(FN-2193): add fullscreen template preview for agent prompts
- Render full template prompt text in cards with a scrollable preview area instead of truncation
- Add expand controls for built-in and custom templates to open a single fullscreen dialog view with Escape/collapse handling
- Align template expand buttons to shared icon-button styling for consistent UI behavior
- Extend AgentPromptsManager tests to cover preview overflow styles and fullscreen interactions across built-in/custom templates
2026-04-19 20:48:14 -07:00
Fusion
a929b729b9 refactor(FN-2161): standardize on createFnAgent naming
- Rename engine export and call sites to use createFnAgent consistently across runtime flows
- Update core lazy engine loader and dashboard agent-generation/planning/chat paths to reference createFnAgent
- Refresh affected unit and integration tests, including renaming pi-create-kb-agent.test.ts to pi-create-fn-agent.test.ts
- Update AGENTS.md documentation references to match the new createFnAgent name
2026-04-19 20:48:14 -07:00
Fusion
5de8c8dca7 feat(FN-2181): add dashboard dev-server process manager and API routes
- Introduce DevServerStore and DevServerProcessManager with a simplified store API contract
- Add dev-server script detection and route legacy manager behavior through the new process manager
- Add a dedicated dev-server router with start/stop/status/log endpoints and SSE event streaming
- Wire dev-server routes into the main route table and hook manager shutdown into server teardown
- Expand tests and architecture docs for store, process, route, detection, and SSE coverage
2026-04-19 20:48:14 -07:00
Fusion
b41be769eb fix(FN-2190): add Skills View label to experimental feature names
- Add the `skillsView` entry to the known experimental feature display-name map in SettingsModal.
- Show "Skills View" as the user-facing label in the experimental features list instead of a raw feature key.
2026-04-19 20:48:14 -07:00
Fusion
10f10c5a45 feat(FN-2168): add persistent dev-server dashboard flow
- Add a durable dev-server store and manager with persisted state/log history, process reconciliation, and SSE event buffering
- Wire new backend lifecycle APIs for status/history/start/stop/restart/stream and initialize/shutdown manager handling in server startup
- Add dashboard Dev Server view, hook-based hydration/stream handling, nav integration, and supporting styles
- Expand coverage with backend persistence/route tests and frontend DevServerView/useDevServer tests
- Document the dev-server persistence architecture in docs/architecture.md
2026-04-19 20:48:14 -07:00
Fusion
66ad0769c4 fix(FN-2177): exclude terminal AI sessions from background list
- Limit background session inclusion to active statuses (generating and awaiting_input)
- Remove sessions from local state when SSE updates deliver complete or error terminal statuses
- Update useBackgroundSessions tests to assert terminal sessions are filtered out and removed on SSE updates
- Adjust session count expectations to reflect active-only tracking
2026-04-19 20:48:13 -07:00
Fusion
f588301d8e feat(FN-2154): show dismissible setup warning on project page
- Render SetupWarningBanner from App only in project view when setup readiness reports warnings
- Persist dismiss state per project via scoped storage and restore it when switching projects
- Add optional dismiss action to SetupWarningBanner with close button UI and responsive styles
- Remove inline banner from QuickEntryBox and add tests covering dismiss button behavior
2026-04-19 20:48:13 -07:00
gsxdsm
3f8161a90a refactor: low-regret cleanup across core, engine, dashboard
- core: extract ai-engine-loader.ts to share @fusion/engine dynamic-import
  boilerplate between ai-summarize and memory-compaction (incl. AgentMessage
  type); collapse getInbox/getOutbox, listInsights/countInsights,
  listRuns/countRuns, and three hasProjectDb* variants behind shared helpers.
- core: drop unused pluginLoaderLog export; tighten two `any` casts
  (db.walCheckpoint row, plugin-loader error.code).
- engine: extract resolveRoleFallback helper from buildSessionSkillContext/Sync;
  remove 22 stale `eslint-disable no-explicit-any` directives across
  project-engine, self-healing, triage, worktree-pool.
- dashboard: apply ESLint autofix (let→const, empty `interface extends`→type).

All three packages: typecheck clean, full test suites pass (14,414 tests),
builds clean. Net lint: -31 warnings. No public behavior changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 20:48:13 -07:00
Fusion
a93f0f2ef9 feat(FN-2160): add push-after-merge remote sync workflow
- Add project settings for pushAfterMerge and pushRemote with defaults and typed merge result fields for push status/errors
- Implement post-merge remote sync in the merger with pull --rebase, auto/AI conflict resolution, and one non-fast-forward retry before push
- Expose push-after-merge controls in Settings modal with conditional Push Remote input and coverage for desktop/mobile save flows
- Document the new settings in the settings reference and stabilize CLI cross-build help test timeout
2026-04-19 20:48:13 -07:00
Fusion
4c08b1c32a fix(FN-2158): constrain settings modal sidebar overflow
- Make .settings-layout fill available space and allow shrinking with flex: 1 and min-height: 0
- Enable vertical scrolling on .settings-sidebar in desktop layout to prevent content clipping
- Add a SettingsModal regression test that loads styles.css and asserts desktop overflow/scroll computed styles
2026-04-19 20:48:13 -07:00
Fusion
e106d87fcb fix(FN-2159): hide manual PR controls for auto-merge tasks
- Add an autoMerge prop to PrSection and show an auto-merge hint instead of manual PR actions
- Pass project autoMerge settings from TaskDetailModal into PrSection
- Preserve active automation messaging when PR creation is already in progress
- Expand PrSection tests to cover auto-merge enabled and disabled behavior
- Increase core RunMutationContext log entry bounds test timeout to reduce flakiness
2026-04-19 20:48:13 -07:00
Fusion
9ec7ce9fd7 fix(FN-2149): harden agent reflection error handling
- Update reflection trigger API typing to allow null responses from manual generation
- Handle null results in AgentReflectionsTab with a clear insufficient-history toast
- Normalize reflection trigger errors to show specific UX for deleted agents and insufficient history
- Return a clear 500 error when manual reflection generation yields no reflection payload
- Expand dashboard reflection route/UI tests to lock in null and not-found regression behavior
2026-04-19 20:48:13 -07:00
Fusion
2b3f971fd5 feat(FN-2150): add agent memory file management
- Add core helpers to list, read, and write .fusion/agent-memory/{agentId} files with strict path validation and exports
- Add dashboard API routes and client methods for agent memory file listing and single-file read/write operations
- Expand AgentDetailView memory tab with file selection, editing, save states, and inline validation feedback
- Add route/backend coverage for agent memory file endpoints and include a @gsxdsm/fusion minor changeset
2026-04-19 20:48:13 -07:00
Fusion
a794cc0237 fix(FN-2151): recover modal retries after stream disconnects
- Handle retry API "not in an error state" responses by refreshing the server session instead of failing immediately
- Restore the correct view state for generating, awaiting_input, complete, and error sessions during retry recovery
- Reconnect planning/interview/subtask streams only when needed while preserving in-flight output and history
- Add regression tests for connection-loss retry recovery across PlanningModeModal, MissionInterviewModal, and SubtaskBreakdownModal
2026-04-19 20:48:13 -07:00
Fusion
5eb15f9454 Style changes 2026-04-19 20:48:13 -07:00
gsxdsm
2eb10bc683 Style changes 2026-04-19 10:13:34 -07:00
Fusion
b1f6740b51 refactor(FN-2134): remove legacy memory path exports and bootstrap aliases
- Remove legacy memory path constants/helpers from core exports and backend contract surface
- Simplify memory bootstrap to initialize canonical layered memory files without seeding from .fusion/memory.md
- Update core memory tests to assert canonical .fusion/memory/MEMORY.md behavior and legacy-path rejection
- Refresh dashboard and docs naming/references to reflect canonical long-term memory path semantics
2026-04-19 10:13:34 -07:00
Fusion
5e31c409bd feat(FN-2133): standardize project memory path guidance to .fusion/memory/
- Update executor, reviewer, core prompt templates, and path-boundary messaging to reference the .fusion/memory/ directory instead of a single MEMORY.md file
- Broaden worktree boundary checks in pi path validation to allow .fusion/memory/ directory access from task worktrees
- Align memory backend metadata and dashboard backend labels to display file backend storage as .fusion/memory/
- Refresh core/engine tests to assert the new directory-based memory wording and boundary behavior
2026-04-19 10:13:34 -07:00