Commit Graph

3043 Commits

Author SHA1 Message Date
Semih
825288a06e dashboard(cli): reset plugin state to installed before autoload
PluginStore.updatePluginState rejects same-state transitions, so the
autoload at startup error'd with "Invalid state transition from
started to started" for every plugin whose persisted state was
"started" from a previous container generation. The new process has
no in-memory instance yet, so the right thing is to flip the
persisted state back to "installed" before loadAllPlugins() walks
the registry; loadPlugin() then drives the state machine forward to
"started" cleanly.

This unblocks the plugin route mount for telemetry-watcher.
2026-05-10 12:57:55 +00:00
Semih
c8c7eb342f dashboard(cli): autoload enabled plugins before route mount
The plugin route mount in createApiRoutes runs once at server start,
iterating pluginLoader.getPluginRoutes() to bind handlers and to
register their paths as daemon-auth exempt. Without an autoload step
the loader is empty at mount time, so plugin routes are missing
until the next restart even after a successful enable through the
dashboard API — Express routes can't be added after listen().

Add a pluginLoader.loadAllPlugins() call before createServer to
mirror what runtime-providing plugins (paperclip etc.) already
assume: enabled plugins are live the moment fusion starts. Failure
of an individual plugin's load doesn't fail startup.
2026-05-10 12:51:56 +00:00
Semih
10dca2d3da plugin(telemetry-watcher): inline plugin SDK to break ESM TS chain
@fusion/plugin-sdk's package.json points its import entry at
src/index.ts (TS source), and that file imports core/src/plugin-types.js
via relative path. Node 22 ESM has no TS loader so the chain
unraveled at runtime: the plugin loader successfully resolved our
compiled dist/index.js, but the very first `import { definePlugin }
from "@fusion/plugin-sdk"` walked into TS source and fell over.

definePlugin is a pure typed identity function — it adds no runtime
behavior. Inline its source plus a structural copy of the plugin
context/route/manifest types we use, drop the @fusion/plugin-sdk
dependency entirely. The compiled output now imports nothing outside
node:crypto and Node builtins, so it can load anywhere fusion can
spawn ESM modules.

When fusion publishes a compiled SDK build, swap the inline types
back to import statements and restore the workspace dependency.
2026-05-10 12:45:58 +00:00
Semih
278d96df55 plugin(telemetry-watcher): emit dist/ via tsc, mirror paperclip layout
The runtime plugin packages (paperclip, hermes, openclaw) all build to
dist/ and have package.json exports import pointing at dist/index.js.
Fusion's plugin loader uses Node ESM dynamic import on the absolute
installation path, which fails on TypeScript source because there's
no TS loader at runtime. Drop noEmit, exclude tests from compilation,
emit dist + sourcemaps + d.ts so the loader can resolve dist/index.js
the same way it resolves paperclip's.

Plugin should be re-registered with path
/app/plugins/fusion-plugin-telemetry-watcher/dist/index.js after the
fusion redeploy lands the new dist artifact.
2026-05-10 09:19:26 +00:00
Semih
52ea986460 plugin(telemetry-watcher): collapse to single index.ts for ESM load
Fusion's plugin loader imports source files directly via Node 22 ESM
without a TS loader, so relative imports like "./internal/dedup.js"
fail at runtime: there's no compiled .js artifact and Node won't fall
back to .ts. Inline severity classifier, dedup cache, rate limiter,
and Grafana parser into the single entry file. Tests now import named
exports from "../index.js" directly. The Phase-2 split into separate
source files can come back once fusion adds a TS-aware plugin loader.

All 14 unit tests still pass. Behavior unchanged.
2026-05-10 09:13:21 +00:00
Semih
ddce7ff5a8 auth-middleware: exempt plugin-defined webhook routes from daemon token
External services (Grafana, Sentry, Slack) call plugin webhooks with
their own per-plugin shared secret — they cannot present the
dashboard's daemon token. Daemon auth was 401'ing those callbacks
before they reached the plugin handler, so even with the route
correctly mounted the secret check inside the plugin never fired.

Add a registry of dynamically-exempt paths populated at server
startup when plugin routes are mounted. Plugin management routes
(/api/plugins, /api/plugins/:id/enable, etc.) stay gated; only the
plugin-defined routes (/api/plugins/:pluginId/<route>) are exempted.
Each plugin handler is responsible for its own secret check (the
telemetry-watcher webhook compares Authorization Bearer against
settings.grafanaWebhookSecret in constant time at the handler).
2026-05-10 09:04:16 +00:00
Semih
2d43ac7bd2 dashboard: mount plugin-defined routes with project-scoped TaskStore
Phase-1 telemetry-watcher's grafana-webhook handler 401'd because the
dashboard never mounted plugin-supplied routes — getPluginRoutes()
exists on PluginLoader but no caller consumed it. The smoke test was
working around this by injecting incident tasks directly through
/api/tasks; we want the real path to work end-to-end.

Two changes:

1. PluginLoader gains createContextFor(pluginId, { taskStore? }).
   Lifecycle hooks still see the loader's bound store (the cwd
   project), but REST handlers receive a project-scoped store derived
   from the request's projectId so a Grafana webhook addressed to
   sase opens tasks in sase even though fusion's loader is bound
   to its own cwd. Settings still come from the loader's store at
   load time, which is the right thing — settings don't follow the
   request.

2. routes.ts iterates pluginLoader.getPluginRoutes() once at server
   startup and binds /api/plugins/:pluginId/:routePath to a handler
   that resolves project context per request, builds the context via
   createContextFor, and forwards to the plugin's route. ApiError +
   rethrowAsApiError preserve the dashboard's standard error envelope.

Plugins added after server start still need a restart for routes to
bind; reloadPlugin doesn't currently re-mount Express handlers. That
limitation matches the existing constraint and is out of scope here.
2026-05-10 08:56:48 +00:00
Semih
3947528fec plugin(telemetry-watcher): Phase 1 — Grafana webhook ingestor
New workspace package fusion-plugin-telemetry-watcher that turns a
Grafana Alerting webhook payload into a Fusion incident task in the
triage column. Hooks the dedup/severity/rate-limit primitives that
PostHog/Sentry/Slack sources will reuse in Phase 2.

Pipeline:
  POST /api/plugins/fusion-plugin-telemetry-watcher/grafana-webhook
    → bearer-secret check
    → parseGrafanaPayload (one signal per firing alert; resolved alerts
      are dropped — recovery is verified post-deploy by the QA agent)
    → classifySeverity P0/P1/P2/P3 with critical-path keyword
      escalation (payment/auth/billing/subscription)
    → DedupCache 4h fingerprint window — repeat fires log against the
      existing task instead of opening duplicates
    → IncidentRateLimiter 5/h, 20/d — overflow becomes a "telemetry
      storm" mega-task in a future phase
    → taskStore.createTask({ column: "triage", priority })
    → optional auto-assign to Triage Agent

14 unit tests cover severity buckets, critical-path escalation, dedup
windowing/eviction, hourly+daily rate caps, and the Grafana payload
parser (firing vs resolved, label-based domain inference).

Settings expose all thresholds + secret + dedup window + rate limits
through the dashboard plugin settings UI. README documents the deploy
+ register + Grafana contact-point wiring.
2026-05-09 16:55:38 +00:00
Semih
accd19b18d dashboard: route per-project heartbeat execution via engineManager
ProjectEngineManager runs one engine per registered project, but the
heartbeat handler in register-agent-runtime-routes.ts only used the
single global heartbeatMonitor passed via ServerOptions. That monitor
is bound to the cwd project's engine, so heartbeat triggers for any
secondary project silently no-op'd: the run id was returned but no
execution actually happened.

Add resolveHeartbeatMonitorFor(scopedStore) that walks
engineManager.getAllEngines() and returns the engine whose working
directory matches the request's scoped store, falling back to the
global monitor when its rootDir matches. Use the resolver at every
heartbeat call site (state-pause stop, /agents/:id/heartbeat,
/agents/:id/runs, /agents/:id/runs/stop).
2026-05-09 15:17:06 +00:00
Semih
32db77e4ef fix(dashboard): stack SetupWizardModal above ModelOnboardingModal 2026-05-09 11:28:38 +00:00
Semih
d600d731f8 Dockerfile: install ca-certificates for outbound TLS 2026-05-09 10:21:13 +00:00
Semih
ed2c23f8aa Dockerfile: symlink codex into /usr/local/bin
The host's /usr/bin/codex is a symlink to the codex.js entrypoint inside
the package directory; bind-mounting it directly resolves to the file
content but breaks codex's import.meta.url-based module resolution. Add
the symlink at build time so a /usr/lib/node_modules/@openai/codex bind
mount is enough to make codex usable in the container.
2026-05-09 10:14:29 +00:00
maestro
ec52ef8e29 Dockerfile: bind dashboard to 0.0.0.0 (default is 127.0.0.1, unreachable from Traefik) 2026-04-26 22:34:32 +00:00
maestro
14dbf9fcb0 Dockerfile: keep pnpm node_modules layout in /app, use /project as cwd only 2026-04-26 22:19:18 +00:00
maestro
c20955aee4 Dockerfile: single-stage build, copy full node_modules + healthcheck via curl 2026-04-26 22:15:46 +00:00
maestro
1f6ba03778 Dockerfile: copy packages/plugins wholesale + fix CLI filter for Coolify build 2026-04-26 22:11:32 +00:00
gsxdsm
544d8d77e3 fix(dashboard,core,engine): statically import @fusion/engine to fix createFnAgent undefined in published CLI
The dashboard modules used a variable-specifier dynamic import
(`const m = "@fusion/engine"; await import(m)`) to defeat bundler static
analysis. tsup honored that and left the dynamic import in dist/bin.js,
so the published `@runfusion/fusion` package failed at runtime with
"createFnAgent2 is not a function" — `@fusion/engine` isn't on npm and
the silent catch set the binding to undefined. Replaces the trick with
static imports across planning, chat, subtask-breakdown, mission-interview,
agent-generation, ai-refine, roadmap-suggestions, milestone-slice-interview,
and routes. Core can't statically import engine (cycle), so it now exposes
setCreateFnAgent and engine wires itself in at module load. Documents the
pattern in AGENTS.md.

Fixes Runfusion/Fusion#9.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 14:43:03 -07:00
Fusion
861fb50df1 feat(FN-2614): merge fusion/fn-2614 (auto-resolved)
- feat(FN-2614): complete Step 4 — configure vitest test isolation setup
- test(FN-2614): complete Step 3 — add isolation companion test
- feat(FN-2614): complete Step 2 — add test home isolation setup
2026-04-26 14:31:41 -07:00
Fusion
b342e6b5d9 feat(FN-2613): merge fusion/fn-2613 (auto-resolved)
- test(FN-2613): complete Step 3 — update mobile and standalone CSS assertions
- feat(FN-2613): complete Step 2 — move standalone token override to global styles
- feat(FN-2613): complete Step 1 — remove mobile root safe-area padding
2026-04-26 14:29:00 -07:00
Fusion
112ad671f8 feat(FN-2611): merge fusion/fn-2611 (auto-resolved)
- feat(FN-2611): complete Step 4 — add changeset and docs
- test(FN-2611): complete Step 2 — cover legacy alias cleanup payload
- feat(FN-2611): complete Step 1 — normalize legacy experimental aliases
2026-04-26 14:19:18 -07:00
Fusion
6a54450288 feat(FN-2578): merge fusion/fn-2578 (auto-resolved)
- fix(FN-2578): align TodoView placeholder addToast typing
- feat(FN-2578): complete Step 4 — route and preload TodoView
- feat(FN-2578): complete Step 3 — wire todos nav entries
- feat(FN-2578): complete Step 2 — add todos to view state types
- feat(FN-2578): complete Step 1 — add useTodoLists hook and tests
2026-04-26 14:16:35 -07:00
Fusion
e4d4a0165b feat(FN-2612): merge fusion/fn-2612 (auto-resolved)
- test(FN-2612): complete Step 4 — cover shortcut helpers and panel interactions
- feat(FN-2612): complete Step 3 — style shortcut panel controls
- feat(FN-2612): complete Step 2 — add terminal shortcut panel UI
- feat(FN-2612): complete Step 1 — add control sequence helpers
2026-04-26 14:09:34 -07:00
Fusion
03a48ae9bb feat(FN-2604): merge fusion/fn-2604 (auto-resolved)
- feat(FN-2604): complete Step 8 — add changeset and delivery docs
- test(FN-2604): complete Step 7 — align tests and regenerate extension skill docs
- test(FN-2604): complete Step 6 — update dashboard tests for planning statuses
- feat(FN-2604): complete Step 5 — update CLI planning terminology
- feat(FN-2604): complete Step 4 — update workflow route status strings
- feat(FN-2604): complete Step 3 — update settings planning terminology
- feat(FN-2604): complete Step 2 — rename replanning actions in column and spec editor
- feat(FN-2604): complete Step 1 — update dashboard component status strings
2026-04-26 14:06:48 -07:00
Fusion
651ae34307 feat(FN-2576): merge fusion/fn-2576 (auto-resolved)
- test(FN-2576): complete Step 4 — add todo route coverage
- feat(FN-2576): complete Step 3 — add todo client API functions
- feat(FN-2576): complete Step 2 — register todo router
- feat(FN-2576): complete Step 1 — add todo routes module
2026-04-26 13:55:25 -07:00
Fusion
2f5d84c1ba feat(FN-2600): merge fusion/fn-2600 (auto-resolved)
- feat(FN-2600): finalize return-to-live button styling
- test(FN-2600): cover return-to-live and top load-more placement
- feat(FN-2600): add live-follow state and return-to-live control
- fix(FN-2600): clean chronological log documentation and test wording
- test(FN-2600): align log viewer assertions to chronological rendering
- fix(FN-2600): correct chronological badge transition detection
- feat(FN-2600): complete Step 1 — reverse log rendering chronology
2026-04-26 13:49:26 -07:00
Fusion
79ce48c51e feat(FN-2608): merge fusion/fn-2608 (auto-resolved)
- feat(FN-2608): complete Step 6 — verify lint test build gates
- feat(FN-2608): complete Step 5 — resume auto-merge on in-review unpause
- feat(FN-2608): complete Step 4 — pause-aware self-healing recovery
- feat(FN-2608): complete Step 3 — interrupt active merges on pause
- feat(FN-2608): complete Step 2 — guard auto-merge for paused review tasks
- feat(FN-2608): complete Step 1 — pause status for in-review tasks
2026-04-26 13:39:27 -07:00
Fusion
16ec2047cb feat(FN-2610): merge fusion/fn-2610 (auto-resolved)
- fix(FN-2610): add changeset for health version fix
- test(FN-2610): verify health endpoint returns real package version
- fix(FN-2610): read version from package.json in health endpoint
2026-04-26 13:34:28 -07:00
Fusion
9e35c064f5 feat(FN-2564): merge fusion/fn-2564 (auto-resolved)
- feat(FN-2564): complete Step 5 — update routing docs
- feat(FN-2564): complete Step 1 — stabilize registrar wiring
2026-04-26 13:22:36 -07:00
Fusion
1111411e8b feat(FN-2609): merge fusion/fn-2609 (auto-resolved)
- test(FN-2609): complete Step 4 — cover terminal font-size controls
- feat(FN-2609): complete Step 3 — style terminal font-size controls
- feat(FN-2609): complete Step 2 — add terminal status bar font controls
- feat(FN-2609): complete Step 1 — persist terminal font size state
2026-04-26 13:19:04 -07:00
Fusion
429b9671b2 feat(FN-2606): merge fusion/fn-2606 (auto-resolved)
- fix(FN-2606): complete Step 4 — clean up mkdtemp test directories
- test(FN-2606): complete Step 3 — add isolation guard coverage
- feat(FN-2606): complete Step 2 — add engine/dashboard HOME test isolation setup
2026-04-26 13:00:56 -07:00
Fusion
545c8a69f4 feat(FN-2607): merge fusion/fn-2607 (auto-resolved)
- test(FN-2607): complete Step 3 — update usage indicator assertions
- feat(FN-2607): complete Step 2 — hide labels for hidden usage rows
- feat(FN-2607): complete Step 1 — remove connected provider badge
2026-04-26 12:53:43 -07:00
Fusion
bbc872cee9 feat(FN-2603): merge fusion/fn-2603 (auto-resolved)
- test(FN-2603): update downstream tests for planning label expectations
- test(FN-2603): complete Step 6 — update engine tests for planning terminology
- feat(FN-2603): complete Step 5 — rename self-healing planning APIs
- feat(FN-2603): complete Step 4 — rename needs-respecify status to needs-replan
- feat(FN-2603): complete Step 3 — rename specifying and re-specification text
- feat(FN-2603): complete Step 2 — rename triageLog usages to planLog
- feat(FN-2603): complete Step 1 — rename triage logger to plan logger
- feat(FN-2602): complete Step 7 — add release changeset
- test(FN-2602): complete Step 6 — align migration and schema tests
- test(FN-2602): complete Step 5 — update store status assertions
- feat(FN-2602): complete Step 4 — rename triage prompt labels
- feat(FN-2602): complete Step 3 — add status rename migration
- feat(FN-2602): complete Step 2 — rename respecify status literals
- feat(FN-2602): complete Step 1 — rename triage display labels
2026-04-26 12:45:05 -07:00
Fusion
df7c197ab6 feat(FN-2563): merge fusion/fn-2563 (auto-resolved)
- docs(FN-2563): document proxy registrar ordering and dependencies
- fix(FN-2563): remove stale proxy context type import
- fix(FN-2563): preserve proxy registrar ordering semantics
- feat(FN-2563): complete Step 3 — wire proxy registrar
- feat(FN-2563): complete Step 2 — add modular proxy registrar
2026-04-26 12:37:38 -07:00
Fusion
c85ffa9198 feat(FN-2605): merge fusion/fn-2605 (auto-resolved)
- test(FN-2605): complete Step 4 — align tests with planning labels
- docs(FN-2605): complete Step 3 — update demo and script terminology
- docs(FN-2605): complete Step 2 — update docs terminology
- docs(FN-2605): complete Step 1 — update README terminology
2026-04-26 12:34:02 -07:00
gsxdsm
fa60ada0fc docs(FN-2586): require release script for npm releases 2026-04-26 12:29:05 -07:00
Fusion
c1b012129f feat(FN-2597): merge fusion/fn-2597 (auto-resolved)
- feat(FN-2597): complete Step 4 — add docs update and changeset
- test(FN-2597): complete Step 2 — align dashboard tests with reviewer labels
- feat(FN-2597): complete Step 1 — rename validator UI labels to reviewer
2026-04-26 12:25:10 -07:00
gsxdsm
80514718ed chore(release): v0.4.1
Version bump via changesets.
2026-04-26 12:24:08 -07:00
gsxdsm
ec3e2cb280 fix(FN-2586): restore 0.4.x release line and agent log stability 2026-04-26 12:22:06 -07:00
Fusion
8097db235a feat(FN-2602): merge fusion/fn-2602 (auto-resolved)
- feat(FN-2602): complete Step 7 — add release changeset
- test(FN-2602): complete Step 6 — align migration and schema tests
- test(FN-2602): complete Step 5 — update store status assertions
- feat(FN-2602): complete Step 4 — rename triage prompt labels
- feat(FN-2602): complete Step 3 — add status rename migration
- feat(FN-2602): complete Step 2 — rename respecify status literals
- feat(FN-2602): complete Step 1 — rename triage display labels
2026-04-26 12:10:21 -07:00
Fusion
9d7f58542b feat(FN-2562): merge fusion/fn-2562 (auto-resolved)
- docs(FN-2562): document extracted terminal and session-diff registrars
- fix(FN-2562): complete Step 5 — restore lint green
- feat(FN-2562): complete Step 3 — extract session diff registrar
- feat(FN-2562): complete Step 2 — create terminal route registrar
- feat(FN-2562): complete Step 1 — extract diff-base helper module
2026-04-26 11:54:54 -07:00
gsxdsm
4d095d1949 chore: bump runfusion.ai to 0.4.0 2026-04-26 11:50:02 -07:00
gsxdsm
4c739c82d0 feat(FN-2599): merge fusion/fn-2599 2026-04-26 11:49:50 -07:00
gsxdsm
b5200ba81b feat(FN-2586): merge fusion/fn-2586 2026-04-26 11:49:43 -07:00
gsxdsm
bf335dc1f5 chore: bump @runfusion/fusion to 0.4.0 2026-04-26 11:47:09 -07:00
gsxdsm
303e0e1032 fix(terminal): tighten CSS selector in keyboard layout test
Update test regexps to match .modal.terminal-modal (two-class selector) and assert min-height: 100dvh on mobile. Also clean up a stale comment in TaskDetailModal.
2026-04-26 11:44:39 -07:00
gsxdsm
dd63ecec91 feat(auth): add copy-to-clipboard for device codes in login instructions
Extract device codes from OAuth login instructions and render them with a copy button so users don't need to manually select and copy.
2026-04-26 11:44:33 -07:00
gsxdsm
845fed1d50 fix(terminal): anchor header to top when mobile keyboard is open
When the soft keyboard opens on mobile, the overlay's align-items:center was vertically centering the shrunken modal, pushing the header/tabs out of view. Add a rule to switch to align-items:flex-start when --keyboard-overlap is detected.
2026-04-26 11:43:43 -07:00
Fusion
db58f29abc feat(FN-2601): merge fusion/fn-2601 (auto-resolved)
- test(FN-2601): complete Step 3 — cover updated default copy
- feat(FN-2601): complete Step 2 — polish intro styling
- feat(FN-2601): complete Step 1 — update models tab copy
2026-04-26 11:39:08 -07:00
Fusion
4cfb502c3d feat(FN-2598): merge fusion/fn-2598 (auto-resolved)
- test(FN-2598): complete Step 3 — update collapsed model header coverage
- fix(FN-2598): normalize expand button spacing token
- feat(FN-2598): complete Step 2 — style compact model header
- feat(FN-2598): complete Step 1 — compact model header structure
2026-04-26 11:36:26 -07:00
gsxdsm
43523b92bf fix(sync): merge auth providers across all candidate files
readStoredAuthProvidersFromDisk() previously returned only the first
successfully-parsed auth file, missing providers that existed only in
fallback locations (e.g. github-copilot in ~/.pi/agent/auth.json when
another provider was in ~/.fusion/agent/auth.json). Now iterates all
candidates and merges entries with first-found-wins priority.
2026-04-26 11:35:44 -07:00