Commit Graph

1547 Commits

Author SHA1 Message Date
Fusion
68f59169fa feat(FN-2334): align mailbox tab controls with shared button styles
- Apply shared btn btn-sm btn-secondary classes to mailbox tabs and agent subtabs in MailboxModal and MailboxView
- Update mailbox tab/subtab CSS to use bordered surface button defaults with active-state border, background, and focus-ring styling
- Add component tests asserting mailbox tab, subtab, and action controls keep shared button class contracts
- Add CSS regression checks to prevent reintroducing border:none/background:none square-edge tab styles
2026-04-24 11:58:34 -07:00
gsxdsm
d30b65b370 feat(FN-2332): merge fusion/fn-2332 2026-04-24 11:42:31 -07:00
Fusion
89b5b5d68c fix(FN-2462): enforce frozen-lockfile bootstrap across workflows
- Update CI, version, and test-release workflows to use pnpm install --frozen-lockfile consistently.
- Align contributor and settings documentation plus worktree init examples toward deterministic frozen-lockfile bootstrap.
- Clarify TaskExecutor worktree init guidance to distinguish dependency bootstrap failures from missing workspace dist export failures.
- Refresh workflow, executor, restart, and SettingsModal tests (including stable Node Sync tab selection) to assert the new bootstrap contract.
2026-04-24 11:41:10 -07:00
Fusion
e480b8d411 feat(FN-2465): stabilize agent log handling and add OpenClaw adapter
- Make agent log ordering deterministic in core store and dev-server retrieval paths
- Stabilize AgentLogViewer row identity and hook ordering behavior to prevent regressions
- Add targeted tests for store ordering, useAgentLogs hook behavior, and AgentLogViewer rendering
- Introduce executable OpenClaw runtime adapter modules, types, and updated plugin packaging/docs
2026-04-24 11:35:55 -07:00
Fusion
968e6e7e2d fix(FN-2331): normalize usage modal footer layout
- Update UsageIndicator footer markup to use consistent button grouping and alignment
- Adjust dashboard CSS for usage modal footer spacing and responsive behavior
- Add regression tests covering footer layout and action placement in UsageIndicator
2026-04-24 11:12:10 -07:00
Fusion
403e3a751a feat(FN-2477): add executable OpenClaw runtime adapter
- Replace deferred OpenClaw placeholder runtime with an executable adapter that creates sessions, prompts with fallback, describes models, and disposes safely
- Add a dedicated pi-module seam and local runtime contract types to decouple plugin compilation from engine internals while preserving runtime behavior
- Update OpenClaw plugin metadata, manifest/package descriptions, and README to reflect active execution support instead of deferred status
- Harden dashboard DevServerStore save flow against ENOENT temp-directory races and add regression coverage for project-directory removal during save
2026-04-24 11:06:20 -07:00
Fusion
d92dc37f92 docs(FN-2474): reconcile Hermes runtime README with current behavior
- Update README status and overview to reflect Hermes as an experimental placeholder runtime
- Document current runtime factory shape and explicit execute() not-implemented failure semantics
- Clarify runtime routing via runtimeConfig.runtimeHint and expected selection behavior
- Align source-of-truth manifest/runtime metadata and plugin test coverage sections
2026-04-24 10:52:15 -07:00
Fusion
213516199d feat(FN-2460): improve merge verification fix observability
- Stream in-merge fix-agent text and tool activity through AgentLogger hooks
- Log deterministic verification reruns with per-attempt context for fix loops
- Expand merger tests to cover fix-loop observability and rerun logging behavior
2026-04-24 10:25:37 -07:00
gsxdsm
c2bd7dd9ec test(dashboard): consolidate AI Setup disclosure expand/collapse tests
Merge three sequential expand/collapse tests into the existing
"multiple disclosures are independent" test, which already exercised
expansion for two triggers. Added a final click to cover the collapse
case so no behavior coverage is lost.

3,819 → 3,786 LOC (-33). 159 tests still passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 10:06:31 -07:00
gsxdsm
703581e8ee test(dashboard): drop redundant field-presence tests in SettingsModal
Each of these tests asserts only that a labeled form field exists in
a section. The consolidated "all settings fields are present across
all sections" test (line 497) covers the same space, and the
accompanying payload-roundtrip tests implicitly require the field to
be present before toggling it.

Dropped 7 presence-only tests:
- Recycle worktrees, Show quick chat button, Auto-completion mode
- Include task ID, Auto-resolve conflicts, Add author attribution
- Smart conflict resolution, groupOverlappingFiles type=checkbox

4,317 → 4,206 LOC (-111). 197 tests still passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 10:04:26 -07:00
Fusion
3d089b04c7 test(dashboard): consolidate low-signal TaskDetailModal matrix tests
Collapse CSS-class presence checks and column-gate permutations into
table-driven variants. The rest of this file covers real user flows
(retry uniqueness FN-bug, paste/drag upload, plan approval, inline
editing, agent assignment, etc.) and was left intact.

- mobile responsive structure 6→1 (class-presence aggregate)
- Commits tab visibility 3→1 (it.each over done-task variants)
- Refinement button column gate 5→2 (it.each over columns)
- Workflow tab visibility 4→1 (it.each over data states)

5,676 → 5,433 LOC (-243). 190 tests still passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 10:03:57 -07:00
gsxdsm
75348be3e0 test(dashboard): trim low-signal TaskCard permutation tests
Collapse describe blocks that iterated primarily over class/state
permutations into table-driven variants:

- memoization 7→2 (drop bare React.memo re-render assertions that
  test React itself, not TaskCard's areTaskCardPropsEqual)
- agent-active 22→10 (it.each over the status/column/paused matrix)
- failed 6→3, stuck 5→2, queued-badge 8→4 (consolidate repeated
  single-assertion boolean checks)
- size badge 6→3 (S/M/L → one it.each; keep far-right done-column
  positioning test)
- steps auto-expand 9→5 (column × completed-steps matrix → it.each)

4,399 → 3,932 LOC (-467). 182 tests still passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 09:56:23 -07:00
Fusion
34a47b2c95 feat(FN-2466): prefer workflow lookup names in progress labels
- Thread workflow name lookup data from Board into Column, TaskCard, and WorktreeGroup components
- Update unified task progress resolution to prefer workflow lookup names over raw workflow IDs
- Keep fallback behavior for missing lookup entries so progress labels remain stable
- Expand Board, Column, and TaskCard tests to cover lookup-based workflow name rendering
2026-04-24 09:54:00 -07:00
Fusion
a4044e2b02 feat(FN-2456): persist task token usage on task records
- Add schema v44 migration to persist task-level token usage totals and first/last usage timestamps on tasks
- Extend core task types, store create/update flows, and exports to round-trip token usage data
- Add migration and TaskStore regression tests for token usage persistence, null clearing, and reinitialization behavior
- Update dashboard async handling and tests to prevent post-unmount state updates and reduce flaky assertion timing
2026-04-24 09:44:44 -07:00
gsxdsm
eed6380ae1 test(dashboard): stabilize MailboxView unread-badge assertion
The badge only appears after fetchAgentMailbox resolves, so asserting
immediately after the subtabs render raced against the async update.
Move the badge check inside waitFor so it polls until populated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 09:43:25 -07:00
Fusion
d6c8f1118b fix(FN-2444): polish node dashboard UX and discovery core handling
- Update node management UI components to use shared form/button classes, semantic color tokens, and accessible interactions
- Refine mesh topology rendering and related dashboard tests for improved readability and behavior coverage
- Adjust discovery routes to reuse injected centralCore instances without unnecessary init/close cycles
- Add/extend tests for shared CentralCore discovery flows and model settings scope save behavior
2026-04-24 09:38:16 -07:00
gsxdsm
83630a5193 feat(FN-2449): merge fusion/fn-2449 2026-04-24 08:55:02 -07:00
gsxdsm
0206862c05 feat(FN-2324): merge fusion/fn-2324 2026-04-24 08:55:02 -07:00
Fusion
0f1da6e6af feat(FN-2447): add dependency-aware task delete flow
- Extend TaskStore deleteTask with a safe default that blocks deleting tasks still referenced by live dependents
- Add an opt-in removeDependencyReferences path that rewrites dependent tasks atomically before deletion
- Update dashboard API/routes to surface TASK_HAS_DEPENDENTS as a 409 with structured details and a delete query flag
- Add TaskCard/TaskDetailModal confirmation-retry UX plus coverage in core, dashboard route/API, and component tests
- Document the new delete semantics and opt-in behavior in the dashboard API README
2026-04-24 08:55:02 -07:00
Fusion
82158cc570 feat(FN-2448): add Hermes runtime plugin to pnpm workspace
- Add plugins/fusion-plugin-hermes-runtime to pnpm-workspace package globs
- Register the Hermes runtime importer in pnpm-lock.yaml
- Capture workspace link to @fusion/plugin-sdk and dev toolchain dependencies for the new plugin
2026-04-24 08:55:02 -07:00
Fusion
b3cf118799 fix(FN-2400): harden dashboard TUI log viewport budgeting
- Rework logs viewport calculation to budget by rendered rows and keep content above footer hints
- Add zero-row safety handling for short terminals with a dedicated expansion hint instead of overlapping output
- Cap wrapped log rendering by remaining row budget so long messages cannot overflow into footer space
- Add regression tests for footer-safe list windowing and wrapped-line truncation, plus a patch changeset for @runfusion/fusion
2026-04-24 08:55:02 -07:00
Fusion
606de5d14c feat(FN-2394): add Fusion reinstall flow for Pi extensions
- Add dashboard route and server handling to reinstall the Fusion Pi extension
- Introduce a client API helper and wire a reinstall action into PiExtensionsManager
- Polish action spacing and document Fusion reinstall recovery in the CLI README
- Expand route, API, and component tests including reinstall refresh stability coverage
- Add a changeset for @runfusion/fusion patch release
2026-04-24 08:55:02 -07:00
Fusion
aa25b8c4a2 fix(FN-2419): preserve three-state bulk model selection
- Add optional noChangeValue/noChangeLabel support to CustomModelDropdown so No change can coexist with Use default
- Update ListView bulk model controls to pass through a dedicated __no_change__ sentinel and avoid conflating untouched with clear-to-default
- Keep batch update payloads explicit by sending null provider/model only for Use default while leaving untouched lanes undefined
- Add dashboard tests covering No change vs explicit model vs Use default behavior and update README bulk-edit documentation
2026-04-24 08:55:02 -07:00
Fusion
e6ee31108b feat(FN-2320): add settings-tab agent deletion controls
- Add a Danger Zone section in AgentDetailView settings with a Delete Agent action
- Reuse the existing delete confirmation/handler flow and gate deletion to idle or terminated agent states
- Add UI styling for danger sections and deletion guidance text in settings
- Expand AgentDetailView tests to cover enabled/disabled states plus confirm/cancel deletion paths
- Document settings-tab deletion behavior and constraints in docs/agents.md
2026-04-24 08:55:02 -07:00
Fusion
1076a3360c feat(FN-2441): singularize one-step progress labels
- Update TaskCard step toggle label to render "step" when the unified total is 1
- Update TaskDetailModal completion label to use singular/plural based on total step count
- Add regression tests in TaskCard and TaskDetailModal suites to verify singular labels and reject incorrect plural forms
- Tighten existing completion-count assertions to cover singular/plural text expectations
2026-04-24 08:55:02 -07:00
Fusion
86b427c126 feat(FN-2315): add hidden markdown toggle for project documents
- Extend dashboard file service and routes to support includeHidden when scanning markdown files
- Update API client, markdown hook, and Documents view UI to expose a hidden files toggle
- Add coverage for hidden-file filtering in file-service, hook, and DocumentsView tests
- Stabilize related SettingsModal and TaskForm tests and document toggle behavior in the dashboard README
2026-04-24 08:55:02 -07:00
Fusion
7529d7a7ed fix(FN-2404): scope onboarding first-task creation to active project
- Guard onboarding first-task creation when no project is selected
- Pass projectId to createTask so onboarding tasks are created in the active project
- Update AppModals wiring tests to verify projectId forwarding for selected and unselected states
- Expand onboarding modal and flow regression tests to assert project-scoped task creation calls
2026-04-24 08:54:25 -07:00
gsxdsm
159e40b42d feat(FN-2310): merge fusion/fn-2310 2026-04-24 08:54:25 -07:00
Fusion
8a0885ad48 fix(FN-2392): normalize skill-facing tool references to fn_*
- Update Fusion skill docs, prompts, and capability references to use public fn_* tool names consistently
- Align engine system prompts and tool schemas for messaging/task actions with fn_send_message, fn_read_messages, fn_task_* naming
- Refresh related tests across CLI, engine, dashboard, and core to match normalized tool naming and behavior
- Add a patch changeset for @runfusion/fusion describing the skill-tool namespace normalization
2026-04-24 08:54:25 -07:00
Fusion
28a2a0c371 feat(FN-2387): unify agents view loading through useAgents
- Move AgentsView to consume agents, loading state, and reload logic directly from useAgents
- Extend useAgents with filterState/showSystemAgents options and always pass includeEphemeral in fetch filters
- Remove duplicate initial fetch/SSE path in AgentsView and rely on hook-managed refresh behavior
- Add regression coverage for single initial load and system-agent visibility toggling behavior
- Update useAgents hook tests to assert the new includeEphemeral fetch contract
2026-04-24 08:54:25 -07:00
Fusion
064e1ddaf7 feat(FN-2386): replace reports-to ID input with manager selector
- Load available agents when the New Agent dialog opens and present them in a Reports To dropdown
- Keep manager assignment optional with a default "No manager" option and graceful fallback when manager fetch fails
- Show manager name plus ID in the step-3 summary while still submitting reportsTo as the selected manager ID
- Add focused NewAgentDialog tests for manager option loading, payload behavior, summary rendering, and failure handling
2026-04-24 08:54:25 -07:00
Fusion
de5dd6f7db feat(FN-2370): merge fusion/fn-2370 (auto-resolved)
- test(FN-2370): complete Step 3 — align qa-check template expectation
- test(FN-2370): complete Step 2 — add regression coverage for addComment diagnostics
- test(FN-2370): complete Step 2 — cover addComment warning regressions
- feat(FN-2370): complete Step 1 — log addComment best-effort failures
- feat(FN-2369): merge fusion/fn-2369
- feat(prompts): require lint alongside tests and typecheck in agent instructions
- perf(test): parallelize harder — unlock worker count, split build-output, bump workspace concurrency
- fix(core): recognize legacy kb-* backups and canonicalize .kb/backups settings
- refactor: eliminate remaining 15 any warnings and ratchet rule to error
- refactor: eliminate ~400 no-explicit-any warnings across the workspace
- feat(core): add getErrorMessage helper for narrowing unknown errors
- refactor: fix and tighten mechanical lint rules
- chore(eslint): fix pre-existing errors surfaced by wider .cjs match
- chore(eslint): promote @typescript-eslint/no-unused-vars from warn to error
- refactor(dashboard,desktop,engine): remove unused imports, props, and locals
- refactor(core): remove unused imports, helpers, and dead migration constant
- refactor(cli): remove unused imports and variables
- refactor: adapt resource loader and tool wiring to pi-coding-agent 0.70
- fix: adapt to AgentState.error → errorMessage rename
- refactor: migrate @sinclair/typebox imports to typebox 1.x
- refactor: migrate to ModelRegistry.create factory
- chore: bump pi-coding-agent + pi-ai to 0.70.0
- refactor: remove legacy kb compatibility
- feat: add "Anthropic — via Claude CLI" as a first-class provider
- test(FN-2358): harden clean-worktree CI verification tests
- fix(FN-2352): add structured terminal websocket diagnostics
- fix: use live merge-base for task diff scope
- feat: backfill Claude skills when useClaudeCli toggle flips on
- fix: prevent nested .fusion/.fusion dir from PluginStore path bug
2026-04-24 08:54:25 -07:00
Aron Prins
fddcd92db5 test(FN-0000): drop flaky settings modal assertions 2026-04-24 15:21:04 +02:00
Aron Prins
9474e157dd test(FN-0000): mock full agent detail API surface 2026-04-24 13:47:12 +02:00
Aron Prins
b8012c2881 test(FN-0000): update SSE bus URL expectations 2026-04-24 13:23:44 +02:00
Aron Prins
a95e6b0124 fix(FN-0000): stabilize automation cron scheduling and SSE coverage 2026-04-24 12:51:53 +02:00
Aron Prins
0c64766b2a fix(FN-0000): prevent stale dashboard service worker reload traps 2026-04-24 11:38:20 +02:00
Aron Prins
8d985c468c fix(dashboard): close SSE EventSources on page unload to prevent freeze
After ~3 refreshes, the dashboard would hang on "Initializing dashboard..."
with all /api/* fetches stalling. Root cause: Chrome keeps HTTP/1.1 sockets
in its keep-alive pool across page navigations even after EventSource is
garbage-collected. Once 6 (the per-origin limit) are held, every new fetch
queues indefinitely and the app can't finish booting.

Fix, layered:

1. sse-bus.ts — pagehide/beforeunload listeners close all active channels
   and send a sendBeacon to /api/events/disconnect so the server forces
   the socket closed (socket.destroy) rather than waiting for the browser
   to notice. Uses a sessionStorage clientId to correlate.

2. api.ts — createResilientEventSource (used by planning / mission / slice
   stream endpoints) registers every handle in a module-level set and
   closes them all on pagehide/beforeunload. sse-bus doesn't see these
   streams, so it needs its own teardown.

3. sse.ts — server-side connection bookkeeping. Tracks managed SSE
   connections by clientId, supports client-triggered disconnect via
   POST /api/events/disconnect, stale-timer cleanup, and supersedes
   older streams when a client reconnects.

4. server.ts — exposes /api/events/disconnect and /api/events/keepalive
   under a dedicated 300 req/min rate limit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 11:09:29 +02:00
gsxdsm
b478c252e2 feat(FN-2399): merge fusion/fn-2399 2026-04-24 00:43:15 -07:00
gsxdsm
422b324103 fix(FN-000): stabilize failing tests and trim slow waits 2026-04-23 23:11:58 -07:00
gsxdsm
b7233e833d feat(FN-2340): merge fusion/fn-2340 2026-04-23 23:02:38 -07:00
gsxdsm
256ba0ee61 refactor(claude-cli): always load extension, gate via /api/models filter
Previously the vendored @fusion/pi-claude-cli extension was conditionally
loaded based on GlobalSettings.useClaudeCli. That forced a Fusion restart
every time the user toggled the provider card — confusing UX.

Key insight: pi-claude-cli registers a NEW provider id ("pi-claude-cli")
rather than overriding "anthropic", so loading it unconditionally is
safe — direct Anthropic auth and CLI-routed models coexist peacefully.
The extension also gracefully no-ops when the `claude` binary is missing
(see packages/pi-claude-cli/index.ts:106 — the throw is caught locally).

Changes:
 - serve/daemon/dashboard: always append the resolved pi-claude-cli path
   to discoverAndLoadExtensions, no settings lookup.
 - resolveClaudeCliExtensionPaths() takes no args now; always returns the
   resolved path.
 - /api/models filter flipped: hide provider === "pi-claude-cli" when
   the toggle is OFF (previously: restricted to those models when ON).
 - POST /api/auth/claude-cli drops restartRequired semantics — toggling
   now has immediate effect on the picker.
 - Provider card UX updated to match: "Claude-CLI-routed models are
   now visible/hidden from the model picker" instead of "Restart Fusion
   to activate".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:02:37 -07:00
gsxdsm
836089fe5f fix(core): use query param instead of hash fragment for plugin cache-busting
Vite/Vitest's resolver treats `#` as part of the filesystem path in some
environments, causing ERR_MODULE_NOT_FOUND on plugin reload.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:02:37 -07:00
Fusion
1b00478032 feat(prompts): require lint alongside tests and typecheck in agent instructions
Every agent-facing quality gate that used to pair tests with typecheck now
also includes lint. Specifically:

- core/src/types.ts: QA Check skill prompt runs lint, tests, typecheck (was
  tests only) and gates task_done() on all three.
- core/src/agent-prompts.ts + engine/src/reviewer.ts: "Do NOT issue REVISE"
  exclusion list now covers lint as well, so out-of-scope fixes that
  restore lint remain allowed (matches the already-lint-aware completion
  gate text at the top of the same prompts).
- engine/src/executor.ts: task_done() pre-flight checklist adds an explicit
  "if the repo has a lint command, run it and fix failures" bullet, mirrors
  the typecheck bullet, and expands the CRITICAL line from "ALL test
  failures" to "ALL lint, test, and typecheck failures".
- core/src/store.ts: default Step 2 checklist (Testing & Verification) now
  includes Lint and Typecheck alongside "All tests pass".
- cli/src/commands/plugin-scaffold.ts: generated plugin README and the
  "Next steps" CLI output include \`pnpm lint\` between install and test.

Existing prompts that already paired lint with tests+typecheck (the
Completion section, hard quality gates, triage testing requirements) are
unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:02:37 -07:00
gsxdsm
88d8a8fa37 refactor: eliminate remaining 15 any warnings and ratchet rule to error
- TaskCard: four catch((err: any) => err.message) promise handlers in
  archive/unarchive/delete/move → catch((err) => getErrorMessage(err)).
- InlineCreateCard + QuickEntryBox: .catch((err: any)) model-load handlers
  → getErrorMessage(err) with existing @fusion/core import.
- TerminalModal: drop (navigator as any).maxTouchPoints — modern lib.dom
  types already expose the property.
- serve.ts: remove unused any annotation on OpenRouter model mapper; the
  array element type is already inferred from json.data.
- pi.js, runtime-resolution.ts, dashboard.ts, serve.ts, dev-server-port-
  detect.ts, devserver-manager.ts: drop now-stale eslint-disable comments
  that the cleanup made redundant.

Fix a prompt-builder regression surfaced by agent's `any` cleanup: toolCall
with a raw string `arguments` field must be preserved verbatim (JSON-quoted)
rather than coerced to `{}`; restores a previously-passing test.

Then promote @typescript-eslint/no-explicit-any from warn → error. Future
new anys must either come with a one-line disable + justification or use a
real type. Workspace is now lint-clean (0 problems).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:02:37 -07:00
gsxdsm
3fbb7c47cf refactor: eliminate ~400 no-explicit-any warnings across the workspace
Parallel subagent pass: four typescript-pro agents on non-overlapping scopes.

Patterns applied:
- catch (err: any) { ... err.message ... } → catch (err) { ... getErrorMessage(err) ... }
  using the new @fusion/core helper. Bare catch {} where the error was unused.
- SQLite row types: defined typed XxxRow interfaces per table and cast
  .all()/.get() results via `as unknown as XxxRow[]` (the double cast is
  required because better-sqlite3 returns Record<string, SQLOutputValue>).
- rowToX(row: any) converters: typed argument with the matching row interface.
- Dynamic settings key writes: (settings as Record<string, unknown>)[key].
- React event handlers and setState callbacks: inferred types or concrete
  React.{Mouse,Change,Form}Event<...> where needed.
- pi-claude-cli: local PiMessage / PiContext duck types to avoid re-typing
  pi-ai concrete shapes; typed Claude stream event message fields.

72 files changed, ~400 anys eliminated. Typecheck passes across the workspace.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:02:36 -07:00
gsxdsm
94e752d606 refactor: fix and tighten mechanical lint rules
- no-useless-escape: drop needless backslashes in character classes and
  URL/path regexes (gh-cli, store, task, modelFilter, useFileMention,
  RoutineEditor, ScheduleForm).
- no-case-declarations: wrap case bodies in ProjectOverview and
  SettingsModal with block scopes.
- prefer-const: convert a never-reassigned slug binding in agent-import;
  annotate legitimate forward-declared let bindings in dashboard.ts that
  callbacks close over before assignment.
- no-fallthrough: add missing break after settings-subcommand error.
- no-empty-interface/no-empty-object-type: convert ProjectManifest from
  empty interface extension to a type alias.
- no-unused-expressions: replace `x && x.method()` short-circuits in
  TerminalModal with optional chaining.

Then ratchet these rules from warn → error so regressions are blocked.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:02:36 -07:00
gsxdsm
200ebfcd39 refactor(dashboard,desktop,engine): remove unused imports, props, and locals
Clears the remaining no-unused-vars warnings across the dashboard app and
server, desktop main, and engine sources. Dead React state destructures are
collapsed to setter-only, unused props are underscore-prefixed to preserve
API shape, and unreferenced catch bindings are dropped. No behaviour change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:02:35 -07:00
gsxdsm
a269f4829f refactor: remove legacy kb compatibility
Drops the .kb/kb.db migration path, legacy backup filename handling, and
backward-compat test suites. Renames internal kbDir identifiers to
fusionDir and hasKbProject/isValidKbProject to their fusion equivalents.

- Remove needsCentralMigration, autoMigrateToCentral, and the
  "needs-migration" FirstRunState; checkAndMigrate and KB_SKIP_MIGRATION
  env var are gone
- Remove LEGACY_BACKUP_DIR and canonicalizeBackupDir; listBackups no
  longer matches kb-* filenames
- Delete backward-compat.test.ts and store-backward-compat.test.ts;
  update remaining tests to new 3-state first-run model

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:02:34 -07:00
gsxdsm
32da0aedac feat: add "Anthropic — via Claude CLI" as a first-class provider
Replaces the stray useClaudeCli settings checkbox + onboarding question
with a proper provider-card UX. The card lives next to OAuth + API-key
cards in onboarding and settings, with Enable/Disable + Test actions.

Backend:
 - Vendors rchern/pi-claude-cli@0.3.1 as packages/pi-claude-cli
   (MIT, attribution in UPSTREAM.md). Lets us bump peer-dep on
   pi-coding-agent in lockstep with Fusion (upstream pinned ^0.52.0
   vs ours ^0.62.0) and fix bugs without waiting on upstream.
 - Adds @fusion/pi-claude-cli as a workspace dep of @runfusion/fusion
   so users don't have to `npm install -g pi-claude-cli` manually.
 - serve/daemon/dashboard conditionally load the extension via
   discoverAndLoadExtensions() when GlobalSettings.useClaudeCli is on;
   no side-effects on user ~/.fusion/agent/settings.json.
 - New GET /api/providers/claude-cli/status: claude --version probe
   + toggle state + cached extension resolution.
 - New POST /api/auth/claude-cli: flips useClaudeCli, refuses if the
   claude binary is missing, fires the existing skill-backfill hook.
 - /api/auth/status now injects a synthetic {id:"claude-cli", type:"cli"}
   provider entry so onboarding + settings see a consistent list.

Frontend:
 - New ClaudeCliProviderCard component shared between ModelOnboardingModal
   and SettingsModal's Authentication section.
 - New AuthProvider.type = "cli" variant.
 - Removed the old "Route AI calls through the Claude CLI" checkbox from
   Global Models settings and the opt-in step from the onboarding wizard.
 - ProviderIcon gets a composite Anthropic-mark-plus-terminal glyph for
   the claude-cli provider id.

Tests:
 - 8 unit tests for extension resolution (@fusion/pi-claude-cli is
   workspace-linked so these run in-tree).
 - 2 unit tests for the binary probe.
 - Existing /auth/status tests filter out the new synthetic entry so
   they keep asserting structural OAuth/API-key behavior in isolation.
 - The vendored package's own 296 tests still pass unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:02:34 -07:00