Commit graph

684 commits

Author SHA1 Message Date
Ma
2216d820a6 Merge branches 'split/pr182-backend-final' and 'split/pr182-studio-ui-final' into split/pr182-integrated 2026-04-15 12:08:25 +08:00
Ma
4f5184d83e docs(repo): restore readmes lockfile and skill from #182 2026-04-15 11:27:45 +08:00
Ma
18795c1d33 test(studio): align server mocks with service management split 2026-04-15 11:18:54 +08:00
fanghanjun
1831eaa384 feat(studio): split studio ui from #182 2026-04-15 11:15:53 +08:00
Ma
8dd296c24b feat(core): split backend changes from #182 2026-04-15 11:15:53 +08:00
Ma
b6c631684f docs(skill): clarify license duality, bump to 2.3.2
ClawHub platform enforces MIT-0 on all skill descriptors and ignores
per-skill license overrides. Remove the unused 'license' field from
frontmatter (no-op) and add an explicit note in the Security & Trust
section: the ClawHub descriptor is MIT-0, but the underlying npm
packages (@actalk/inkos, @actalk/inkos-core, @actalk/inkos-studio) are
AGPL-3.0-only and running/redistributing InkOS is governed by AGPL.
2026-04-14 16:53:04 +08:00
Ma
e0be4a7432 chore(skill): bump to 2.3.1 after ClawHub republish 2026-04-14 16:46:01 +08:00
Ma
aa4f217870 feat(skill): fix license, declare env vars, harden credential examples
- Add license: AGPL-3.0-only to SKILL.md frontmatter (was showing as
  MIT-0 on ClawHub due to missing field)
- Declare OPENAI_API_KEY in openclaw.requires.env and primaryEnv so the
  runtime key requirement is visible in skill metadata
- Rewrite setup example to use --api-key-env OPENAI_API_KEY instead of
  --api-key sk-xxx, avoiding shell history exposure
- Add 'Security & Trust' section documenting no install hooks, local
  file I/O only, no telemetry, trusted-base-URL guidance, and npm
  provenance verification command

Addresses OpenClaw scanner flags: metadata missing env vars, API keys
in command history, custom base-URL redirect risk.
2026-04-14 16:44:21 +08:00
Ma
318d58cc64 docs: swap badges to stars, downloads, and ClawHub Skill 2026-04-14 16:32:17 +08:00
Ma
70aab2f314 docs: sync TUI release banner to en/ja READMEs 2026-04-14 16:31:50 +08:00
Ma
51c326973b docs: drop "CLI" from README titles and tagline 2026-04-14 16:31:34 +08:00
Ma
d7cacdaea4 docs: announce TUI general availability 2026-04-14 15:57:12 +08:00
Ma
fccf819b45 docs: refresh WeChat group QR to v6 2026-04-14 15:57:03 +08:00
Ma
c6e304f451 Merge branch 'pr-180-latest' into master 2026-04-13 18:01:05 +08:00
fanghanjun
3935a52df4 merge: resolve conflict with origin/master in project-tools.ts
Keep our try-catch for empty-content errors while incorporating
upstream's chat function structure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 02:56:04 -07:00
Ma
f230394315 fix(studio): expose fixed control truth files 2026-04-13 17:55:28 +08:00
Ma
c86d62f463 Merge branch 'pr-180' into master 2026-04-13 17:51:49 +08:00
fanghanjun
effcecc82d fix(core): only swallow empty-content errors in chat, re-throw others
The bare catch block silently swallowed all exceptions including
network errors, auth failures, and timeouts. Now only catches
errors related to empty content (thinking model edge case) and
re-throws everything else so users see real error messages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 02:51:10 -07:00
Ma
64886c834c fix(tui): preserve chat failures in interaction mode 2026-04-13 17:48:39 +08:00
fanghanjun
f617ca270b fix(tui): reduce markdown width to account for prefix and padding
Tables were overflowing the visible area because the width calculation
didn't account for the 2-char prefix (◆) in addition to paddingX.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 02:42:59 -07:00
fanghanjun
e9acb515ca test(tui): adapt dashboard tests for removed UI elements
Update assertions for removed statusSecondaryLine, composer
status/helper lines, and layout changes (minWidth prefix).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 02:23:06 -07:00
fanghanjun
9f700b7e74 fix(tui): remove execSync theme detection, match main branch exactly
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 02:16:05 -07:00
fanghanjun
06c42e3eaf fix(tui): only use macOS system appearance for Terminal.app
Other terminals (Ghostty, kitty, etc.) have their own theme
independent of macOS appearance. Only fall back to AppleInterfaceStyle
for Terminal.app. All other terminals default to dark when COLORFGBG
is not set.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 02:15:03 -07:00
fanghanjun
8967967418 fix(tui): add macOS system appearance detection for Terminal.app
Terminal.app doesn't set $COLORFGBG. Fall back to macOS
AppleInterfaceStyle via execSync. All colors remain hex (no
16-color ANSI names that caused Terminal.app crashes).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 02:13:33 -07:00
fanghanjun
34182fb036 fix(tui): add light/dark theme via COLORFGBG without execSync
Detect terminal background via $COLORFGBG (env var only, no child
process). Use darker hex colors for light backgrounds so text is
readable. No 16-color ANSI names — all hex like the main branch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 02:11:19 -07:00
fanghanjun
1936580f75 fix(tui): revert theme to main-branch colors to fix Terminal.app crash
Remove all Terminal.app color/theme workarounds (16-color palette,
execSync theme detection, light/dark palettes). Use the same static
hex colors as the main branch. Only keep isAppleTerminal for the
markdown rendering fallback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 02:10:20 -07:00
fanghanjun
9714e9345a fix(tui): use Page Up/Down raw sequences for conversation scrolling
Shift+Arrow is not reliably detected by Ink's useInput. Use raw
escape sequences for Page Up (\x1b[5~) and Page Down (\x1b[6~)
which work across Terminal.app, iTerm2, and other terminals.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 02:00:18 -07:00
fanghanjun
1ee7b7b5f1 fix(tui): revert Terminal.app workarounds, use main-branch layout instead
The stdout write buffering, alternate screen, and maxFps throttle we
added were not fixing the Terminal.app crashes — the main branch
doesn't crash because it uses a simpler rendering path.

Root cause: the complex Box nesting (<Box minWidth={2}> + flexShrink)
and renderMarkdown processing generate more ANSI cursor-positioning
codes per frame, which triggers Terminal.app's CoreGraphics bug.

Fix: on Terminal.app, ConversationRow uses the same simple layout as
the main branch (<Box><Text>prefix</Text><Text>{content}</Text></Box>)
without renderMarkdown. Enhanced rendering (minWidth layout, markdown)
is only used on terminals that can handle it (iTerm2, etc.).

Also adds Shift+Up/Down scrolling for conversation history, and
reverts the Terminal.app light palette change.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:58:16 -07:00
fanghanjun
9c1388bbdd feat(tui): add conversation scroll with Shift+Up/Down
Add scrollOffset to the conversation area so users can scroll back
through message history. Shift+Up scrolls up 3 messages, Shift+Down
scrolls back down. Scroll resets to bottom on new message submit.

Also reverts the Terminal.app light palette color change (keep
original yellow/blue).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:53:49 -07:00
fanghanjun
e80a41def7 fix(tui): only use alternate screen buffer on Terminal.app
The alternate screen disables terminal scrollback. Only enable it
on Terminal.app where it's needed to prevent IME XPC crashes.
Other terminals (iTerm2, etc.) keep native scrolling.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:49:46 -07:00
fanghanjun
76523568de fix(tui): use readable colors for Terminal.app light mode
ANSI "blue" renders as bright purple on light backgrounds.
Use "black" for AI reply text and "gray" for accents on
Terminal.app light mode.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:48:36 -07:00
fanghanjun
186fd25a81 fix(tui): restore table rendering on Terminal.app
Use marked-terminal for layout (tables, lists, indentation) on all
terminals, then strip ANSI escape codes for Terminal.app instead of
bypassing marked-terminal entirely. Box-drawing characters (┌─┐│└┘)
are plain Unicode and survive the strip.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:47:24 -07:00
fanghanjun
491e620530 fix(core): reset pending_hooks.md during import replay to prevent future state leak
resetImportReplayTruthFiles intentionally skipped pending_hooks.md,
but the architect's foundation output includes hooks from the full
imported text (e.g. chapter 60 hooks). When replay starts from
chapter 1, these future hooks leak into the context.

Reset pending_hooks.md to an empty table using the existing
buildImportReplayHooksSeed helper. The replay will incrementally
rebuild hooks from each chapter's analysis.

Fixes the pre-existing CI failure: "does not leak imported future
state into early replay chapters".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:45:41 -07:00
fanghanjun
9e60c0588e fix(tui): use alternate screen buffer to isolate IME from rendering
Terminal.app crashes in IMKInputSession when the IME's NSRemoteView
XPC connection conflicts with Ink's screen redraws. Enter the
alternate screen buffer (DEC 1049) before rendering — this isolates
Ink to a separate terminal view so the IME interacts with the
primary screen without corruption. Same approach as Claude Code's
<AlternateScreen> component.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:39:01 -07:00
fanghanjun
a8954a63ba fix(tui): remove default maxTokens from normal depth profile
The normal depth profile hardcoded maxTokens: 240, which was always
passed to the chat LLM call via getChatRequestOptions. This defeated
the "only pass maxTokens when /depth is explicitly set" fix in
project-tools.ts — thinking models like kimi-k2.5 were still
truncated at 240 tokens on the default TUI path.

Make maxTokens optional in ChatDepthProfile. Only light/deep depths
set it; normal leaves it undefined so the model decides its own
output length.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:37:24 -07:00
fanghanjun
4e5e44d22d fix(tui): buffer stdout writes for Terminal.app to prevent CJK crash
Terminal.app crashes (SIGSEGV in CGFontStrikeGetValue) when it sees
partial CJK UTF-8 bytes across multiple write() calls — the font
glyph cache gets corrupted with text bytes in pointer fields.

Buffer all stdout.write() calls within a single event-loop tick and
flush them as one atomic write via process.nextTick. This mirrors
Claude Code's single-write buffering approach (writeDiffToTerminal)
and ensures Terminal.app always receives complete frames.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:35:23 -07:00
fanghanjun
43a6523381 fix(tui): disable all color output on Terminal.app
Terminal.app's CoreGraphics/ColorSync pipeline has a memory corruption
bug where UTF-8 text bytes (CJK, em dash 0xe28094) end up in color
space pointers, causing SIGSEGV. Even basic 16-color ANSI codes
trigger it. Set FORCE_COLOR=0 to make chalk emit zero escape codes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:27:56 -07:00
fanghanjun
f4f3d5d3fb fix(tui): use 16-color ANSI names for Terminal.app
Terminal.app's CoreGraphics crashes with 24-bit RGB escape sequences
(\x1b[38;2;r;g;b;m) combined with CJK text. Use basic ANSI color
names (cyan, yellow, white, etc.) which map to safe 16-color codes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:25:56 -07:00
fanghanjun
7769c3b34b fix(tui): disable ANSI markdown rendering on Terminal.app
Terminal.app's CoreGraphics pipeline crashes (SIGSEGV in
color_space_icc_md5_equal) when ANSI escape codes + CJK text
are rendered together — UTF-8 bytes get misinterpreted as
color space pointers.

On Terminal.app, renderMarkdown now uses a plain-text fallback
that strips markdown syntax without emitting any ANSI codes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:23:36 -07:00
fanghanjun
2b6ddf277e fix(tui): improve Terminal.app compatibility with CJK input
- Detect Terminal.app via $TERM_PROGRAM and lower Ink render FPS from
  30 to 15 to reduce ANSI redraw pressure during CJK IME composition
- Use Intl.Segmenter for grapheme-aware backspace handling (correctly
  deletes CJK characters, emoji with ZWJ, surrogate pairs)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:20:29 -07:00
fanghanjun
432283a256 fix(tui): add macOS system appearance fallback for theme detection
Terminal.app does not set $COLORFGBG. Fall back to macOS
AppleInterfaceStyle via `defaults read` to correctly detect
light/dark mode on Terminal.app.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:15:35 -07:00
fanghanjun
1027632f26 feat(tui): auto-detect terminal background and switch color scheme
Detect light/dark terminal via $COLORFGBG env var (same method as
Claude Code's initial seed). Provide distinct dark and light palettes
so all UI colors remain readable on both backgrounds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:12:13 -07:00
fanghanjun
5cf9e0b45d fix(tui): swap user and AI message colors
User messages: #a8c4d4 (light blue) → #c0a480 (warm sand)
AI messages: #c0a480 (warm sand) → #a8c4d4 (light blue)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:08:20 -07:00
fanghanjun
38c7cd56f9 fix(tui): disable table header styling instead of bold
Bold is invisible with RGB colors in Ink; use empty style so headers
inherit the parent WARM_REPLY color like body cells.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:06:49 -07:00
fanghanjun
fc60131542 fix(tui): change table header from red to bold
Override cli-table3 default red header style via tableOptions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:05:24 -07:00
fanghanjun
f873c0cfb8 fix(tui): remove composer status line
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 00:58:53 -07:00
fanghanjun
039124efca fix(tui): remove composer helper hint line
Remove the slash command helper text below the composer status bar.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 00:58:15 -07:00
fanghanjun
c0b0460e03 chore: update pnpm-lock.yaml for marked-terminal dependencies
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 00:57:19 -07:00
fanghanjun
e171ff6c12 fix(tui): use minWidth layout for stable prefix spacing
Replace columnGap/trailing-space approach with <Box minWidth={2}> for
prefix icons (◆ │ ·), matching Claude Code's layout pattern.
Also fix user message body color to ROLE_USER (light blue).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 00:57:12 -07:00
fanghanjun
b4a4ea47ac test(tui): add renderMarkdown unit tests
Cover bold conversion, bullet replacement, bold-inside-lists,
bold leak prevention, table rendering, and full-reset stripping.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 00:57:05 -07:00