New Windows-native capabilities:
- windowCapture.ts: PrintWindow API for per-window screenshot (works on
occluded/background windows)
- windowEnum.ts: EnumWindows for precise window enumeration with HWND
- uiAutomation.ts: IUIAutomation for UI tree reading, element clicking,
text input, and coordinate-based element identification
- ocr.ts: Windows.Media.Ocr for screen text recognition (en-US + zh-CN)
Updated win32.ts backend to use EnumWindows for listRunning() and added
captureWindowTarget() for window-specific screenshots.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
These two exported functions in src/utils/format.ts had no test
coverage. formatRelativeTimeAgo wraps formatRelativeTime and forces
numeric:'always' for past dates; formatLogMetadata assembles parts
(time, branch, size/count, tag, agentSetting, prNumber) into a
' · '-separated string.
Added 8 tests for formatRelativeTimeAgo covering past dates, future
dates, equal-to-now, and the no-'ago'-for-future invariant. Added
9 tests for formatLogMetadata covering all optional fields and the
separator format.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
- buddy.ts:105: remove unsafe (context as any).messages cast.
ToolUseContext already declares messages: Message[] at Tool.ts:250,
so context.messages is properly typed. Other commands (feedback,
copy, export) access it the same way without cast.
- companionReact.ts:154: wrap resp.json() in try/catch for defensive
JSON parsing. Malformed 200 responses now return null instead of
propagating to the outer catch.
Rate-limit timing (set before API call) kept as-is — matches official
ZUK pattern: prevents retry-storm on transient failures.
src/ path alias suggestions dismissed — project uses relative paths.
Auto-unmute on /buddy view kept — matches official behavior.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- buddy.ts: return type Promise<null> → Promise<React.ReactNode>
to match LocalJSXCommandCall interface (CompanionCard path returns
ReactElement, not null).
- CompanionCard.tsx: clamp stat value to 0..100 before .repeat()
to prevent negative count runtime error on out-of-range values.
Import path alias suggestions (src/ vs ../) dismissed — project
convention uses relative paths (verified against color.ts, help.ts).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Trim and normalize target before use
- Validate with validateBridgeId allowlist (same as bridgeApi.ts)
- URL-encode compatTarget to prevent path traversal/injection
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
getBridgeAccessToken() provides the OAuth Bearer token, matching
the auth pattern used by bridgeApi.ts and codeSessionApi.ts.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- webhookSanitizer: redact before truncate to avoid split secrets at boundary
- webhookSanitizer: return safe placeholder on error instead of raw content
- peerSessions: use discriminated union return type for type safety
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add BRIDGE_MODE to DEFAULT_FEATURES in dev.ts
- Implement peerSessions.ts: cross-session messaging via bridge API
- Implement webhookSanitizer.ts: redact secrets from webhook payloads
- Replace any stubs in controlTypes.ts with Zod schema-inferred types
- Fix tengu_bridge_system_init default to true for app "active" status
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>