Commit Graph

17 Commits

Author SHA1 Message Date
Fusion
ba3d868c2d feat(FN-2944): merge fusion/fn-2944
- test(FN-2944): cover already checked out worktree conflict recovery
- fix(FN-2944): recognize git already checked out worktree conflict
- fix(engine): auto-recover from squash-merge orphan rebase failures

Fusion-Task-Id: FN-2944
2026-04-29 07:10:52 -07:00
Fusion
dfd82b144d feat(FN-2618): merge fusion/fn-2618
- test(FN-2618): harden process-manager fs/tmpdir mocks
- fix(cli): mark react-devtools-core external in bun compile
- fix(pty): switch to @homebridge/node-pty-prebuilt-multiarch fork
2026-04-26 15:33:39 -07:00
gsxdsm
14e41b0ebe fix(core,cli): make standalone binary actually run
Bun's --compile binary previously crashed at startup because:
  1. node:sqlite isn't implemented in Bun 1.3.8 (require returns
     undefined; import throws "No such built-in module")
  2. ink imports react-devtools-core inside its reconciler; even though
     gated by isDev(), the bundled module path failed to resolve at
     runtime

Fixes:
  - Add packages/core/src/sqlite-adapter.ts: a thin DatabaseSync wrapper
    that picks bun:sqlite under Bun and node:sqlite under Node via
    createRequire (so the bundler doesn't statically pull in either).
    Drop-in for the three core files that import DatabaseSync.
  - Install react-devtools-core as a workspace devDependency so it
    resolves at bundle time. The dev-only code path is still gated by
    DEV=true, so it stays inert in production.
  - Revert the prior --external react-devtools-core flag (no longer
    needed and was causing a different runtime error).
  - Mark node-pty external in tsup so esbuild stops choking on the
    homebridge fork's conditional native require()s
    (build/Release/conpty.node etc.) when bundling for the npm package.
  - Update bundle-output test: the bundle now contains both
    bun:sqlite and node:sqlite specifiers (loaded via createRequire).

Verified end-to-end: dist/fn dashboard -p 0 starts cleanly (no PTY,
sqlite, or devtools errors). Core tests 3038/3038, CLI tests 826/826
(up from 822/826 baseline).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 15:25:06 -07:00
gsxdsm
19c75e0b39 fix(cli): mark react-devtools-core external in bun compile
ink@6 has a devtools.js module that imports react-devtools-core. It is
only loaded at runtime when DEV=true, but Bun's static bundler still
tries to resolve it at compile time and fails with "Could not resolve".
Marking it external lets the compile succeed; the dynamic import path
is never taken in production.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 15:03:12 -07:00
gsxdsm
4bae9d22a1 fix(pty): switch to @homebridge/node-pty-prebuilt-multiarch fork
Resolves "Failed to load PTY module" install errors on Linux/macOS by
aliasing node-pty to the homebridge fork, which ships prebuilds for
linux x64/arm64/arm/ia32 across many Node ABIs and uses prebuild-install
for darwin/windows binaries on install.

- Aliased dep so all "node-pty" import specifiers (and vi.mock calls)
  keep working unchanged.
- Removed darwin chmod postinstall hack (fork handles permissions).
- Updated cli/build.ts to dynamically resolve node-pty install root and
  pick prebuilds by ABI for Linux cross-compile; warn-and-skip for
  darwin/windows cross-compile (host-only there, as before).
- Added type shim because the fork's bundled typings declare module
  '@homebridge/node-pty-prebuilt-multiarch', not 'node-pty'.

Verified: pnpm install clean, dashboard typecheck clean, native module
loads and spawns shell via fork, host + linux-x64 cross-compile staging
both produce dist/runtime/<plat>/pty.node.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 15:00:10 -07:00
Fusion
5c8c250d14 fix(FN-2139): wire source export condition into CLI builds
- Add "source" export entries for @fusion/core, @fusion/dashboard, and @fusion/engine package exports
- Configure tsup/esbuild to include the "source" condition when resolving workspace dependencies
- Pass --conditions=source to bun compile so compiled CLI binaries resolve source-conditioned exports consistently
2026-04-19 10:13:34 -07:00
gsxdsm
4e38c5f7de feat(FN-1719): rebuild eslint baseline and add memory lessons
- Rebuild eslint config with context-aware flat config for better TypeScript/JSX handling
- Add memory lessons for lint/type/test baseline restoration
- Skip pre-existing flaky stream test (flushes a final complete event)
- Fix api.ts require import path
- Add ProjectEngineManager.startReconciliation mock to tests for main compatibility
2026-04-13 18:21:31 -07:00
gsxdsm
b94c7428d3 feat(FN-1318): rename CLI binary artifacts from kb to fn
- Update CLI build and runtime paths to emit and reference fn-named binaries across default and cross-target builds
- Adjust Bun binary bootstrap stubs and native patch temp/symlink prefixes to use fn naming consistently
- Update CI, release, and test-release workflows to validate and collect fn-prefixed artifacts
- Align CLI build and package config tests with fn binary expectations and add a patch changeset for @gsxdsm/fusion
2026-04-08 14:47:30 -07:00
gsxdsm
f68a5f0565 fix(FN-1243): add build-time dashboard stub fallback for CLI bundles
- Add resilient client asset staging in packages/cli/build.ts with automatic dist/client/index.html stub generation when dashboard assets are missing
- Update packages/cli/tsup.config.ts onSuccess hook to clear stale client output and emit the same minimal stub fallback in clean checkout builds
- Make bundle-output test build-aware by running pnpm build in beforeAll when bundle artifacts are absent, then assert client assets are present
- Preserve build output visibility by reporting whether real or stub client assets were staged
2026-04-08 09:44:42 -07:00
gsxdsm
2c48ce0852 feat: rename data directory, add global project settings, multi-project CLI commands, and provider badge in model selector
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 09:10:42 -07:00
gsxdsm
a75b743808 feat(KB-335): rename environment variables from KB_* to FUSION_*
- Rename all KB_* environment variables to FUSION_* prefix across CLI and dashboard
- Update CLI runtime files (native-patch.ts) and build configuration
- Update dashboard server, badge-pubsub, GitHub webhooks, and terminal service
- Update test files to use new FUSION_API_KEY and related env vars
- Update documentation in README, AGENTS.md, STANDALONE.md, and dashboard README
- Update changeset files with new environment variable names
2026-03-31 17:03:23 -07:00
gsxdsm
af1347861e fix(KB-140): fix standalone CLI native asset packaging for terminal support
- Stage node-pty native assets (pty.node, spawn-helper) alongside compiled binary

- Add runtime native-patch.ts to resolve native assets in Bun-compiled binaries

- Fix eager native module loading crash for non-terminal commands

- Enable terminal functionality in isolated standalone deployments

- Update release workflows and add STANDALONE.md documentation
2026-03-30 23:32:30 -07:00
gsxdsm
a53e4c1420 feat(KB-048): add collapsible list sections to dashboard
- Add section expansion state management with localStorage persistence
- Update section headers with chevron toggle controls
- Implement conditional task row rendering based on section state
- Add Expand All / Collapse All toolbar controls
- Add CSS styles for chevron rotation animation and section headers
- Add comprehensive tests for collapsible section behavior
2026-03-29 19:51:41 -07:00
Dustin Byrne
c802108a02 refactor(HAI-116): rename kb to hai across all packages, CLI, and docs
- Rename npm packages from @kb/* to @hai/* and update all workspace references
- Rename CLI binary from kb to hai and config directory from .kb to .hai
- Update dashboard UI branding, titles, and references from kb to hai
- Update all test files, CI workflows, and documentation to reflect new naming
- Run comprehensive grep verification to ensure no stale kb references remain
2026-03-26 22:44:11 -04:00
Dustin Byrne
eac1eda49a feat(HAI-090): remove package.json dependency from compiled binary
- Inline version/name resolution in bin.ts so the binary works without package.json
- Simplify build.ts by removing package.json bundling steps
- Remove unused dynamic package.json lookups in engine merger, triage, and executor
- Expand build-exe tests to verify binary runs independently of package.json
- Clean up obsolete engine unit tests tied to removed package.json logic
2026-03-26 01:18:18 -04:00
Dustin Byrne
6643f1f5e0 feat(HAI-076): add cross-compilation support for CLI executable builds
- Extend build.ts with cross-compilation targets for multiple platforms/architectures
- Add build:exe:all npm script to package.json for building all targets
- Add cross-compilation tests for build-exe-cross
- Add cross-compilation documentation section to README
- Clean up unused agent log, store, and route code across dashboard/core/engine packages
2026-03-26 00:37:57 -04:00
Dustin Byrne
fbecff7255 feat(HAI-071): add Bun single-binary compile support for CLI
- Create build script (packages/cli/build.ts) using Bun.build compile target
- Update asset resolution in dashboard server for bundled context
- Add npm scripts to wire up the build process
- Add build-exe tests to verify compiled binary output
- Fix pre-existing build errors in engine and core packages
- Document build and compile workflow in README
2026-03-26 00:32:57 -04:00