Repository navigation
feat: project-level API server + CLAUDE.md parser module (v0.4.0) - #15
Merged
Merged
Conversation
- Add projectApiServer.ts: HTTP server with 5 endpoints for Fusion Studio - GET /api/project/context?cwd=<path> - GET /api/sessions?cwd=<path> - GET /api/sessions/:id?cwd=<path> - GET /api/memory?cwd=<path> - POST /api/memory?cwd=<path> - Add claudemdPortable.ts: DI version of claudemd.ts without CLI deps - Add claudemd-parser module (src/lib/claudemd-parser/) for external use - Replace server.ts stub with real startServer() - Add --serve/--api CLI dispatch with --port= and --auth= options - Add package.json exports for @fusion-mlx/fusion-code/claudemd-parser - Add 17 new tests (10 API + 7 module) - Fixes #6 (P0), Fixes #7 (P1) Co-Authored-By: Claude <[email protected]>
This was referenced Jul 29, 2026
Closed
dahai80
added a commit
that referenced
this pull request
Aug 28, 2026
) (#185) Extract the composedOnScroll scroll-routing logic from REPL.tsx into a pure helper src/utils/composedOnScroll.ts (applyComposedOnScroll). No React hooks, no JSX, no await — only side effects are mutating lastUserScrollTsRef.current and dispatching to 4 callbacks/setters, byte-identical to the inlined useCallback body. REPL keeps a thin useCallback wrapper whose deps array [onRepin, onScrollAway, maybeLoadOlder, setAppState] is unchanged verbatim (feature() is a bun:bundle build-time DCE macro, not a runtime dep). Downstream reads the same const name. Tests (src/__tests__/utils/composedOnScroll.test.ts, 5 cases) cover the non-feature paths: timestamp write, sticky->onRepin, non-sticky-> onScrollAway(handle). KAIROS/BUDDY arms are DCE-off under bun test (no flag) and asserted not-invoked; production build:dev:full covers them. Gates: typecheck 0 / 865 tests / biome clean / build:dev pass. REPL 6468 -> 6455 (-13). Cumulative across 15 slices: -641. Co-authored-by: Claude Fable 5 <[email protected]>
dahai80
added a commit
that referenced
this pull request
Aug 28, 2026
#187) Extract setInputValue useCallback body (27 LOC, 3 deps) to pure-helper src/utils/inputValueState.ts applySetInputValue(). Same aggregate-input pattern as slices #15/#16: typed InputValueStateSetters (7 fields), REPL keeps useCallback thin wrapper, deps array [setIsPromptInputActive, repinScroll, trySuggestBgPRIntercept] unchanged verbatim. RECENT_SCROLL_REPIN_WINDOW_MS (REPL-local const 3000) passed as recentScrollRepinWindowMs field to keep helper pure-agnostic. Behavior: (1) trySuggestBgPRIntercept(prev,value) hit -> early return; (2) empty->non-empty + scroll-stale (>= window) -> repinScroll; (3) sync inputValueRef.current + setInputValueRaw + setIsPromptInputActive(trim>0). Tests: 8 cases (repin+write+activate, intercept early-return, non-empty guard, scroll within-window/boundary, empty deactivate, whitespace guard, ref-sync-before-setters). 881/881 pass, typecheck 0, biome clean, build:dev ok. REPL 6434 -> 6420 (-14). Cumulative 7096 -> 6420 (-676) across 16 slices. Zero REPL import churn. Byte-identical behavior (deps + ref reads unchanged). Co-authored-by: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Issue #6 (P0) and Issue #7 (P1).
Issue #6: Project-Level API (JSON-RPC/HTTP)
HTTP server for Fusion Studio integration using
Bun.serve():/api/project/context?cwd=<path>/api/sessions?cwd=<path>/api/sessions/:id?cwd=<path>/api/memory?cwd=<path>/api/memory?cwd=<path>Start with:
./fusion-code --serve [--port=4827] [--auth=<token>]src/server/server.tsstub with real implementationIssue #7: CLAUDE.md Parser Module
Standalone re-export barrel at
src/lib/claudemd-parser/:@fusion-mlx/fusion-code/claudemd-parserparseFrontmatter,MEMORY_TYPES,scanMemoryFiles,getMemoryFilesPortable,getProjectContextPortableKey Design Decisions
claudemdPortable.ts— DI version ofclaudemd.tsthat acceptscwdparameter instead of readingbootstrap/state. No hooks, no analytics, no feature flags. This is what the API server uses.projectApiServer.ts— UsesBun.serve()(zero deps, matches existingupstreamproxy/relay.tspattern). Route matching supports parameterized paths (:id).Files Changed
src/server/projectApiServer.tssrc/server/server.tsstartServer()src/entrypoints/cli.tsx--serve/--apidispatchsrc/utils/claudemdPortable.tssrc/lib/claudemd-parser/index.tspackage.jsontests/server/projectApiServer.test.tstests/lib/claudemd-parser.test.tsTest Results
312 pass, 2 flaky (pre-existing fusion-mlx-adapter test isolation — not related to this change)
Fixes #6, Fixes #7
🤖 Generated with Claude Code