Commit graph

684 commits

Author SHA1 Message Date
fanghanjun
b04dca7ce6 fix(tui): fix markdown rendering bold leak, bullets, and color reset
- Keep **markers as plain text through reflowText to prevent ANSI code splitting
- Strip \x1b[0m full-reset codes that override Ink's <Text color> context
- Replace * bullets with · in post-processing
- Convert **text** to ANSI bold after reflow is complete

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 00:56:59 -07:00
fanghanjun
6d26af66b1 fix(tui): adjust theme colors for better contrast
- WARM_ACCENT: #c88a56 → #d4a070 (warmer highlight for ◆ and accents)
- WARM_REPLY: #f0e6d8 → #c0a480 (warm sand tone for AI response body)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 00:56:53 -07:00
fanghanjun
88715edfaf feat(tui): add markdown rendering for assistant messages
Use marked + marked-terminal to render markdown in assistant replies,
supporting bold, italic, inline code, tables, and lists in the terminal.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 00:24:18 -07:00
fanghanjun
64da761e62 fix: revert isSimpleGreeting bypass and adapt nl-router test for hasFailed
Revert the isSimpleGreeting LLM bypass in runtime.ts chat handler to
preserve existing behavior where tools.chat is always called. Adapt the
nl-router test to pass hasFailed: true when testing explain_failure
routing, matching the new guard condition.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 00:18:03 -07:00
fanghanjun
514a375513 fix(tui): fix chat truncation, book dir detection, and UI polish
- Remove hardcoded maxTokens cap (240/700) from chat and developBookDraft
  tools so thinking models like kimi-k2.5 are not truncated mid-response
- Add resolveProjectRoot() to launchTui so running `inkos` from inside a
  book directory auto-resolves to the correct project root
- Pass projectRoot through loadConfig in createInteractionTools instead of
  falling back to process.cwd()
- Skip LLM call for simple greetings (你好/hi/hello) that already have
  built-in fallback responses, preventing empty-response errors
- Add try-catch around chat tool LLM call to gracefully degrade when
  thinking models return empty content
- Guard "为什么/why" routing to explain_failure behind hasFailed context
  flag so normal questions containing "为什么" route to chat instead
- Use columnGap={1} for conversation row spacing in Ink v7
- Remove statusSecondaryLine and mode label from status bar

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 00:13:51 -07:00
Junxian Ma
8d28e364a3
Merge pull request #143 from 185259536/fix/rewrite-rollback-target
fix rewrite targeting after chapter rollback
2026-04-13 12:26:00 +08:00
Junxian Ma
07043c3e75
Merge pull request #133 from pzysvip99999/fix/settler-json-sanitizer
fix: sanitize JSON before parsing in settler-delta-parser
2026-04-13 12:25:49 +08:00
Junxian Ma
969fa7e723
Merge pull request #124 from Nerdless-ship-it/fix/state-validator-trailing-content-and-import-reset
fix: preserve pending_hooks on import + tighten StateValidator JSON extraction
2026-04-13 12:25:38 +08:00
Junxian Ma
7169701632
Merge pull request #167 from Tahshsa/fix/windows-tests-and-publish-manifests
Fix Windows test failures and restore workspace: protocol in manifests
2026-04-13 12:25:26 +08:00
Ma
2ec8b66e78 chore: remove docs/plans from tracking and gitignore
These are local design/planning documents that shouldn't be in the
repository. Untrack the 8 files merged from dev and add docs/plans/
to .gitignore.
2026-04-13 11:43:57 +08:00
Ma
f5ee8f71d9 docs(skill): add v1.2 interaction capabilities to SKILL.md
- Add Workflow 12: book-wide entity rename via interact
- Add Workflow 13: single-chapter text patching via /replace
- Add Workflow 14: TUI dashboard launch (inkos with no args)
- Add Studio assistant panel note (shares interaction kernel)
- Add inkos interact and inkos (TUI) to command reference table
- Bump skill version to 2.3.0
2026-04-13 11:40:47 +08:00
Ma
a7129b540d fix(cli): fix CI test failures blocking v1.2.0 release
- Guard browser.unref() call in studio command — mock spawn objects
  in test environment don't have unref, causing TypeError
- Fix cli-integration test isolation: clean up harbor book and session
  file after interact tests so book list/status tests find empty state
- Change interact --book test to use /books intent instead of
  explain status which requires LLM connectivity
2026-04-13 11:01:15 +08:00
Ma
4fcabc256e chore(release): bump to v1.2.0, update docs and changelog
- Update v1 sections to v1.2 in README.md, README.en.md, README.ja.md
  covering: shared interaction runtime, Ink TUI dashboard, Studio
  assistant panel, conversational book creation, entity rename,
  inkos interact endpoint, thinking model temperature clamp
- Add v1.2.0 changelog with full feature list, improvements, and fixes
- Bump all package versions from 1.1.1 to 1.2.0
2026-04-13 10:35:05 +08:00
Ma
0495b001bc fix(studio): use responseText instead of last session message for agent replies
The agent endpoint was returning `session.messages.at(-1)?.content` as
the response, but the last session message is the user's input — the
actual assistant reply is in `result.responseText`. This caused the
ChatBar to echo the user's own message back as the "assistant response".
2026-04-13 10:28:43 +08:00
Ma
367891c365 fix(studio): fix ChatBar dropping assistant responses on every interaction
The agent endpoint returns the response text in `data.response` and
the full session history in `data.session.messages`. The ChatBar was
replacing its entire message list with session history on every call,
but session messages don't include the latest assistant response —
so the reply was silently dropped every time.

Fix: always append `data.response` as an assistant message instead
of replacing with session history. Session restore only happens on
first panel open when ChatBar is empty.
2026-04-13 10:24:12 +08:00
Ma
645c9f60c4 fix(studio): lift book card z-index when dropdown menu is open
The fadeIn animation's transform creates a stacking context on each
book card, trapping the dropdown's z-50 inside. When the BookMenu
opens, the parent card now gets z-50 to sit above sibling cards,
allowing the full dropdown (including delete) to render unclipped.
2026-04-13 10:17:37 +08:00
Ma
9b40bb5589 fix(studio): fix dropdown menu z-index stacking by removing transform from paper-sheet
The paper-sheet hover effect used `transform: translateY(-4px)` which
creates a new stacking context, trapping the BookMenu dropdown's z-50
inside the card. Subsequent cards in DOM order rendered above it.

Remove transform and transform-style from paper-sheet, keep the
shadow-based hover effect. Dropdown menus now render above all cards.
2026-04-13 10:13:16 +08:00
Ma
6d613f8b6b fix(studio): remove overflow-hidden from book cards so dropdown menus render
The BookMenu dropdown (three-dot menu) was clipped by the parent
card's overflow-hidden. The progress bar already has its own
overflow-hidden, so the card-level clip was unnecessary.
2026-04-13 10:05:53 +08:00
Ma
8f12ee2ff1 feat: merge interaction control layer, TUI dashboard, and studio enhancements
54 commits from dev branch introducing:
- Shared interaction runtime (NL router, session management, edit controller)
- Ink-based TUI dashboard with themed animations and i18n
- Studio ChatBar shared session integration and book draft conversation flow
- CLI interact command for OpenClaw/agent interop
- Studio server endpoints for interaction session and agent routing

Core 585/585, Studio 70/70 tests pass.
2026-04-13 09:59:28 +08:00
Ma
8b71517d8f fix(studio): fix ChatBar stale closure, deduplicate command handlers
- Fix SSE effect stale `loading` closure: use loadingRef to read
  current loading state inside the SSE effect instead of capturing
  a stale value from the dependency array
- Deduplicate handleSubmit/handleQuickCommand: extract shared
  executeCommand() function, eliminating ~80 lines of copy-pasted
  logic that would inevitably diverge
- Fix curly quote encoding issue causing esbuild parse failures
2026-04-13 09:48:09 +08:00
Ma
5410b95452 refactor(interaction): split draft and book selection handlers 2026-04-13 09:36:29 +08:00
Ma
fbbf1086ac fix(interaction): harden agent errors and file handling 2026-04-13 09:36:29 +08:00
Ma
1edd52a3e0 fix(tui): polish dashboard interactions, theme and animations
- Add semantic status colors and role colors to theme palette
- Improve conversation rows with distinct icons per role
- Upgrade ExecutionBadge with per-status icons
- Add visual separators between dashboard sections
- Improve composer with separated status/helper text
- Enhance startup animation with project info reveal
- Move hardcoded i18n strings into TuiCopy stageLabels
- Fix non-null assertions in effects.ts
2026-04-13 09:27:18 +08:00
Ma
a0cf181e32 fix(studio): align revise endpoint with pipeline modes 2026-04-13 03:27:54 +08:00
Ma
21facd6350 chore(workspace): relink local packages for dev integration 2026-04-13 03:27:53 +08:00
Ma
54deba194f test(studio): align server fixture with chapter checks 2026-04-13 03:25:15 +08:00
Ma
ed1d792ba0 fix(studio): polish interaction flows across major pages 2026-04-13 03:20:56 +08:00
Ma
b8ac5b2cee fix(tui): stop caret redraws while idle 2026-04-13 03:19:06 +08:00
Ma
703ac5768a feat(studio): build creation flow on shared drafts 2026-04-13 03:19:06 +08:00
Ma
378acafb7a feat(interaction): carry foundation drafts into book creation 2026-04-13 03:19:06 +08:00
Ma
2437df01c0 feat(interaction): add shared book-draft ideation flow 2026-04-13 03:19:06 +08:00
Ma
3d75ac2eab fix(tui): stabilize slash commands and idle caret 2026-04-13 03:19:06 +08:00
Ma
c7bbb2bb15 fix(tui): add a blinking composer caret 2026-04-13 03:19:06 +08:00
Ma
a78b958e12 feat(tui): rebuild the interface around an Ink dashboard 2026-04-13 03:19:06 +08:00
Ma
70ef3dbd9e feat(interaction): add shared create and export flows 2026-04-13 03:18:37 +08:00
Ma
e944280392 fix(tui): drop input box borders, use simple › prompt with spacing 2026-04-13 03:17:36 +08:00
Ma
4c72b5c063 fix(tui): add bottom padding so input doesn't sit flush at terminal edge 2026-04-13 03:17:36 +08:00
Ma
c8cdddae85 refactor(tui): natural scroll flow, no cursor gymnastics
- Remove cursor lift/settle — content flows top-to-bottom naturally
- Spinner + response appear above next input (like Claude Code)
- Input box: top border + hint drawn before prompt, bottom border
  printed after submit, then response, then new input box
- Simplify InputChrome to drawInputTop/drawInputBottom
2026-04-13 03:17:36 +08:00
Ma
55d375682a feat(tui): back chat replies with the active LLM 2026-04-13 03:17:36 +08:00
Ma
098ea4a2c2 fix(tui): route casual chat away from status fallback 2026-04-13 03:17:36 +08:00
Ma
f753d00140 feat(tui): model display, slash Tab-complete, /config command
- Show configured model + provider in startup header
- Yellow warning if no model configured, directs to /config
- Tab completion for all slash commands (/write, /books, etc.)
- /config command launches interactive LLM setup wizard inline
- detectModelInfo reads provider/model/baseUrl from env files
2026-04-13 03:17:36 +08:00
Ma
8018ac74ed feat(tui): float input chrome above terminal edge 2026-04-13 03:17:36 +08:00
Ma
ecc4d2f47a fix(tui): restore prompt reset to unblock readline, suppress warnings via emitWarning 2026-04-13 03:17:36 +08:00
Ma
db92106663 fix(tui): keep user input text gray, reset color after enter 2026-04-13 03:17:36 +08:00
Ma
70f95f11ba fix(tui): full-width gray input area with more spacing 2026-04-13 03:17:36 +08:00
Ma
7a1752b2fb fix(tui): suppress SQLite warning, simplify input to gray line
- Filter ExperimentalWarning from stderr during TUI session
- Replace bordered input box with single gray separator line
- Gray ❯ prompt with proper spacing above and below
- Input line spans full terminal width
2026-04-13 03:17:36 +08:00
Ma
1e1324131a feat(tui): bordered input box with label separator
- Input prompt wrapped in ╭─ inkos ───╮ / ╰────╯ box
- Prompt shows │ ❯ inside the box frame
- Box closes after each input, reopens for next prompt
- Clean separation between output and input areas
2026-04-13 03:17:36 +08:00
Ma
6ae937b20a feat(tui): ASCII art logo, input separator, styled LLM wizard
- ASCII block logo with gradient animation (bright→mid→dim cyan)
- Input separator line between responses
- Styled LLM setup wizard: numbered steps, masked API key, confirmations
- Consistent ◇/◈/◌ iconography throughout
2026-04-13 03:17:35 +08:00
Ma
e79cbf2b75 feat(tui): themed animations and operation-aware effects
- Animated startup: typewriter logo reveal + fade-in project info
- ThemedSpinner: different animations per operation type
  - writing: pen/dots pattern (✎·····)
  - auditing: scan bar (▰▰▱▱▱)
  - revising: braille wave (⠋⠙⠹...)
  - planning/composing: pulse (◜◠◝◞◡◟)
  - thinking: wave dots (···  ·· ·)
- Intent-aware labels: "writing chapter", "revising chapter", etc.
- Elapsed time display after 3 seconds
- Styled help with categorized sections
- Styled status with color-coded mode/status badges
- Result cards with intent badges (WRITE, REVISE, FOCUS, etc.)
- Graceful goodbye animation on /quit and Ctrl+C
2026-04-13 03:17:35 +08:00
Ma
ec72e18bf4 feat(tui): Claude Code-style persistent REPL with auto-init
- Auto-detect inkos.json on launch, auto-init if missing
- Interactive LLM config wizard when no API key found
- Persistent REPL loop with colored output and box-drawn header
- Spinner animation during async operations
- /help, /status, /quit, /clear built-in commands
- Natural language and slash commands delegated to interaction layer
- Zero new dependencies (pure ANSI escape codes)
2026-04-13 03:17:35 +08:00