abel533
fb13919dbc
feat: implement 12 SkillLoader audit fixes + wire AgentLoader
...
Audit fixes implemented:
1. SkillTool command filtering via SkillFilters.getSkillToolCommands()
2. getSlashCommandToolSkills() with distinct slash command filters
3. SkillChangeDetector: WatchService-based hot reload with 300ms debounce
4. Skill hooks support: hooks field in Skill record + HooksSchema validation
5. SkillTool UI rendering: renderInlineResult/ForkedResult/Rejected/Error
6. McpSkillBuilders registry: register/unregister/getAllMcpSkills pattern
7. Permission checks in SkillTool via PermissionRuleEngine integration
8. Analytics telemetry: logSkillInvocation + tengu_skill_tool_invocation
9. SkillFilters exports: findCommand/hasCommand/getCommand/groupBySource
10. isOfficialMarketplaceName: marketplace skill provenance check
11. Experimental skill search: isExperimentalSkillSearchEnabled() flag
12. Model alias resolution: ModelResolver with haiku/sonnet/opus aliases
Additional:
- AgentLoader wired as Spring Bean in AppConfig
- PermissionRuleEngine injected into ToolContext for SkillTool
- SkillChangeDetector started on app boot for skill hot reload
- Skill record: 27 -> 28 fields (added hooks Map<String,Object>)
- 34 new tests (138 total, all passing)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4 weeks ago
abel533
1ca1543662
feat: implement 13 minor SkillLoader/Skill differences
...
Skill record expanded from 19 to 27 fields:
1. hasUserSpecifiedDescription — track if description from frontmatter vs auto-extracted
2. loadedFrom — aligned with TS values (commands_DEPRECATED/skills/plugin/managed/bundled/mcp)
3. skillRoot — base directory for CLAUDE_PLUGIN_ROOT env var support
4. disableModelInvocation — separate from disallowedTools, prevents model SkillTool invocation
5. hideFromSlashCommandTool — hide-from-slash-command-tool frontmatter field
6. isSensitive — is-sensitive frontmatter, args redacted from history
7. contentLength — content.length() for token estimation
8. progressMessage — default 'running' for UI progress display
New computed methods:
9. isHidden() — derived from !userInvocable || hideFromSlashCommandTool
10. isMcp() — check source/loadedFrom for MCP origin
11. estimateFrontmatterTokens() — rough token count for context budget
Validation & parsing improvements:
12. Effort validation — only accept low/medium/high/max/positive integer (parseEffortValue)
13. model 'inherit' — treated as null (use parent model, matching TS)
Additional fixes:
- when_to_use key support (TS uses underscore variant)
- buildSkillsSummary filters hidden/model-disabled skills
- SkillTool blocks model invocation when disableModelInvocation=true
- SkillTool uses skillRoot for base directory
- Brace expansion in paths (splitPathInFrontmatter + expandBraces)
- Backward-compatible 19-arg and 6-arg constructors preserved
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4 weeks ago
abel533
b7a7d35025
feat: implement 4 major SkillLoader gaps (cache/settings/shell/args)
...
1. Memoization/Caching
- loadAll() now memoized (volatile loaded flag + double-check lock)
- clearCache() invalidates and notifies listeners
- Dynamic skills map for runtime-discovered skills
- Conditional skills pending map with activation tracking
- onSkillsChanged() listener registration (matches TS onDynamicSkillsLoaded)
2. Setting Source Enforcement
- isSettingSourceEnabled() checks env CLAUDE_CODE_DISABLE_{SOURCE}
- isEnvTruthy() for boolean env vars (1/true/yes)
- CLAUDE_CODE_DISABLE_POLICY_SKILLS skips managed skills
- getManagedSkillsPath() for policy-managed skill directory
- Conditional loading per source (user/project/policy)
3. Shell Command Execution (PromptShellExecution)
- Parse \\\! command \\\ code blocks and !\command\ inline syntax
- Execute via bash or powershell per skill frontmatter shell field
- Output replaces command placeholder in skill content
- 30s timeout, proper error handling
- MCP skills excluded from shell execution (security)
4. Argument Substitution (ArgumentSubstitution)
- \ — full raw arguments string
- \[n] — indexed access
- \ — shorthand for indexed (bash-style)
- Named arguments (\, \) mapped from frontmatter
- Shell-quote aware parsing (handles quoted multi-word args)
- Auto-append 'ARGUMENTS: ...' if no placeholder found
- Progressive argument hints for UI
Also:
- Paths frontmatter: brace expansion (src/*.{ts,tsx} → [src/*.ts, src/*.tsx])
- splitPathInFrontmatter with comma-respecting-braces parsing
- activateConditionalSkillsForPaths() with proper activation model
- 17 new unit tests (104 total, 0 failures)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4 weeks ago
abel533
c66d58426f
feat: align SkillLoader with original claude-code (7 critical fixes)
...
1. YAML parsing: SnakeYAML instead of naive string splitting
- Handles arrays, nested objects, glob patterns, special chars
- quoteProblematicValues() fallback on parse failure
- extractDescriptionFromMarkdown() fallback for missing description
2. Frontmatter fields: 3 → 19 fields
- Added: display-name, allowed-tools, disallowed-tools, model, effort,
user-invocable, context, agent, shell, paths, argument-hint, arguments, version
- Skill record expanded with convenience methods (isConditional, isForked, userFacingName)
3. Gitignore filtering: git check-ignore integration
- Skills/commands from gitignored directories are skipped
- Prevents loading malicious skills from node_modules etc.
4. Symlink resolution & deduplication
- toRealPath() resolves symlinks to canonical paths
- Set<Path> tracking prevents duplicate loading
- Handles broken symlinks gracefully
5. AgentLoader: new .claude/agents/ directory support
- Supports AGENT.md directory format and single .md files
- Agent-specific frontmatter: tools, disallowed-tools, max-turns, memory,
isolation, background, model, effort
- User-level (~/.claude/agents/) and project-level loading
6. Conditional skills (paths)
- Parse paths frontmatter field (glob patterns)
- getConditionalSkillsForPaths() with glob matching
- getUnconditionalSkills() for always-active skills
7. Enhanced SkillTool execution
- Inline vs fork execution modes
- Argument substitution: \, \, \
- Named argument support from skill definition
- Tool restrictions in prompt (allowed-tools, disallowed-tools)
- Model and effort hints in prompt
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4 weeks ago
abel533
af9934d8c6
fix: SkillLoader support directory-based skills (SKILL.md)
...
Aligned with original claude-code behavior:
/skills/ directory (loadFromSkillsDirectory):
- Only directory format: skill-name/SKILL.md
- Single .md files are NOT loaded (matches TS behavior)
- Directory name = skill name
/commands/ directory (loadFromCommandsDirectory):
- Directory format: cmd-name/SKILL.md (priority)
- Single file format: cmd-name.md
- Recursive subdirs with namespace: sub/cmd.md → 'sub:cmd'
Previously only loaded flat .md files, missing directory skills entirely.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4 weeks ago
abel533
6fcd0caa9e
feat: add ConsoleMain test entry for dumb console
...
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4 weeks ago
abel533
d9ca1c7dd2
chore: add Apache License 2.0
...
- Added LICENSE file (Apache 2.0)
- Added <licenses> section to pom.xml
- Updated README license section
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4 weeks ago
abel533
f330803af4
chore: bump version to 0.2.0-SNAPSHOT
...
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4 weeks ago
abel533
b60a212ad0
release: v0.1.0
...
First official release of Claude Code Java.
- 34 tools, 54 commands, 184 source files, ~26.7K lines
- Jink 0.5.0 full-screen TUI
- Dual API providers (OpenAI + Anthropic)
- Multi-level permission system
- Three-layer context compression
- MCP protocol, plugin system, hook system
- 87 unit tests passing
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4 weeks ago
abel533
4be570a4f2
chore: upgrade Jink to 0.5.0 and enable mouse tracking, add Jink 0.5.0 TUI framework section to README
...
- Added Jink to tech stack table
- New section: what Jink is, why it was chosen, Ink vs Jink comparison table
- Documents Jink's role in the project (4 TUI files)
- Maven Central dependency + manual build fallback instructions
- Updated architecture diagram with tui/ package
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4 weeks ago
abel533
9f4023bdf0
refactor: apply BaseSlashCommand to all 54 command implementations
...
- implements SlashCommand -> extends BaseSlashCommand (all 54 files)
- Replace CommandUtils.parseArgs/args null checks -> args(args)
- Replace agentLoop null checks -> requireAgentLoop(context)/noSession()
- Replace context.agentLoop().getToolContext() -> toolCtx(context)
- Replace CommandUtils.success/error/header/subtitle/warning/info -> instance methods
- Remove unused CommandUtils/AnsiStyle imports where applicable
- 87 tests passing, zero compilation errors
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
12a443c9a9
refactor: extract AgentToolExecutor from AgentLoop
...
- Extracted tool execution + permission logic into AgentToolExecutor (212 lines)
- AgentLoop reduced from 597 to 469 lines (-21%)
- Clear separation: AgentLoop owns the chat loop, AgentToolExecutor owns tool dispatch
- 87 tests still passing
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
80f43480c1
refactor: extract utility classes and split AppConfig
...
- CommandUtils: shared formatting (header, separator, formatBytes, formatDuration, progressBar, truncate)
- ToolValidator: input validation (requireString, getString, getInt, getBoolean, validatePathInWorkDir)
- ProcessExecutor: consolidated ProcessBuilder with timeout, cleanup, shell execution
- AbstractReadOnlyTool: base class for read-only tools
- Split AppConfig -> ToolConfiguration + CommandConfiguration + AppConfig (core)
- Applied CommandUtils to 16 command files, removed duplicated private methods
- Applied ToolValidator + ProcessExecutor to NotificationTool
Net: -403 lines removed, 87 tests still passing
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
5929f50b3a
fix: BundledSkills Path.of crash on Windows
...
bundled://verify URI scheme contains ':' which is illegal in Windows paths.
Changed to null for bundled skills since they have no filesystem path.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
bd375e6b15
fix+test: code quality improvements + 87 unit tests
...
Fixes:
- Resource leaks: process cleanup in BashTool, GrepTool, NotificationService
- Input validation: null/blank checks in BashTool, FileEditTool, GrepTool
- Path traversal: FileEditTool blocks ../ escape from workDir
- Thread safety: AgentLoop messageHistory now synchronizedList
- Error handling: log instead of silently swallow exceptions
- Bounds validation: RateLimiter constructor validates all params
Tests (87 total):
- TokenEstimationServiceTest: 14 tests (estimation, cost, formatting)
- RateLimiterTest: 12 tests (limits, cooldown, reset, concurrent)
- InternalLoggerTest: 12 tests (levels, structured, file output, export)
- NotificationServiceTest: 6 tests (config, disabled mode)
- FileEditToolTest: 8 tests (validation, traversal, core edit)
- BashToolTest: 9 tests (validation, dangerous commands, metadata)
- GrepToolTest: 5 tests (validation, metadata)
- Phase4CommandsTest: 21 tests (all Phase 4B+4D command metadata)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
dd47566cb8
feat: Phase 4C infrastructure services + 4D debug commands
...
4C Services:
- RateLimiter: sliding window rate limiting, concurrent semaphore, cooldowns
- TokenEstimationService: approximate token counting, cost estimation
- NotificationService: cross-platform desktop notifications
- InternalLogger: structured session logging with export
4D Debug Commands:
- /debug: toggle debug mode, view internal logs
- /heapdump: JVM heap dump and memory pool info (Java advantage)
- /trace: request/response tracing
- /ctx-viz: context window token distribution visualization
- /reset-limits: reset rate limits and cooldowns
- /sandbox: sandbox mode toggle (strict/permissive/none)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
d09809e924
feat: 12 UX commands - brief, vim, theme, usage, tips, env, perf, etc (Phase 4B)
...
New commands:
- /brief: toggle concise output mode
- /vim: toggle vi-mode editing
- /theme: switch color theme (dark/light/auto)
- /usage: detailed token/cost breakdown with visual bar
- /tips: usage tips (random or /tips all)
- /output-style: output format (markdown/plain/json)
- /env: environment variables, config paths, system info
- /performance (/perf): memory, threads, GC, session metrics
- /privacy: telemetry/logging/memory opt-out settings
- /feedback: save feedback to ~/.claude-code-java/feedback/
- /release-notes (/changelog): version history
- /keybindings (/keys): keyboard shortcuts reference
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
d65d63038f
feat: LSPTool, BriefTool, NotificationTool (Phase 4A)
...
- LSPTool: goto_definition, find_references, hover, diagnostics, document_symbols
Wraps LSPServerManager.sendRequest() with JsonNode response formatting
- BriefTool: enable/disable/toggle/status for brief output mode via ToolContext
- NotificationTool: cross-platform notifications (Windows toast, macOS osascript,
Linux notify-send) with terminal bell fallback
- Registered all 3 in AppConfig (total: 31 tools)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
12557f23f0
feat: Plugin marketplace - manifest, installer, auto-update, marketplace (Phase 3E)
...
- PluginManifest: manifest.json record with validation, DeclaredTool/Command/Hook, MarketplaceEntry
- PluginInstaller: HTTP download, JAR install/uninstall, version management, update checking
- MarketplaceManager: remote catalog fetch with 24h cache, search/filter/popular queries
- PluginAutoUpdate: scheduled update checks, parallel check, auto-install option, notification callback
- Enhanced /plugin command: install/remove/update/search subcommands (was: load/unload/reload/info)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
76191f5035
feat: Basic telemetry - feature flags, metrics, feature gates (Phase 3D)
...
- FeatureFlagService: local JSON config with env override, hot reload, typed accessors
- MetricsCollector: session metrics (tools, commands, tokens, errors), daily JSON persistence
- FeatureGate: connects flags to tool/feature enable checks with status reporting
- Default flags for all major features (server, worktree, LSP, coordinator, etc.)
- Metrics flushed to ~/.claude-code/metrics/{date}.json
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
293dd5657c
feat: LSP integration - client, server manager, diagnostic registry (Phase 3C)
...
- LSPClient: JSON-RPC over stdio with Content-Length framing
- LSPServerInstance: single server lifecycle with lazy startup and crash recovery
- LSPServerManager: multi-server routing by file extension, file sync (didOpen/didChange/didSave/didClose)
- LSPDiagnosticRegistry: batch+cross-turn dedup, per-file/total limits, severity sorting
- LSPServerConfig: server config record with extension-to-language mapping
- Features: exponential backoff for content-modified errors, LRU cache for delivered diagnostics,
handler registration before connection ready, formatForContext() for agent injection
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
dcba6c86ae
feat: Git Worktree isolation tools (Phase 3B)
...
- WorktreeManager: full lifecycle with slug validation, symlinks, stale GC
- EnterWorktreeTool: create/resume worktree with auto-slug generation
- ExitWorktreeTool: keep or remove with uncommitted change safety
- Slug validation: max 64 chars, [a-zA-Z0-9._-] only, path traversal prevention
- Symlink support for large directories (node_modules, dist, etc.)
- Stale agent worktree cleanup with ephemeral pattern matching
- Fast resume via direct .git pointer file read (no subprocess)
- Registered both tools in AppConfig (total: 28 tools)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
b98675f643
feat: Server Mode with WebSocket direct connect (Phase 3A)
...
- DirectConnectServer: lifecycle management, auth token, port config
- DirectConnectWebSocketHandler: WebSocket handler with session management
- ServerSession: per-connection AgentLoop with permission forwarding
- ServerMessage: 7-type JSON protocol (user/assistant/result/control/interrupt/keep_alive/error)
- ServerModeAutoConfiguration: conditional Spring config with @EnableWebSocket
- WebSocketServerConfig: endpoint registration and container settings
- ClaudeCodeApplication: --server flag detection, web-application-type override
- ClaudeCodeRunner: skip TUI in server mode, block on shutdown signal
- pom.xml: added spring-boot-starter-websocket dependency
Server mode: --server [--server-port=12321] [--server-token=xxx]
Env vars: CLAUDE_CODE_SERVER_MODE, CLAUDE_CODE_SERVER_PORT, CLAUDE_CODE_SERVER_TOKEN
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
a926b31e34
feat: /doctor, /session, /agent, /rename commands (Phase 2F)
...
- /doctor: environment diagnostics (Java, Git, API keys, disk, memory)
- /session: session info, save/load/export functionality
- /agent: list/detail/stop sub-agents and workers
- /rename: session naming with clear/reset support
- Registered all 4 commands in AppConfig
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
5a6798540a
feat: MCP enhancements - HTTP+SSE transport, resource tools, env vars (Phase 2E)
...
- HttpSseTransport: HTTP POST + SSE streaming for modern MCP servers
- ListMcpResourcesTool: browse MCP server resources by server/URI
- ReadMcpResourceTool: read MCP resource content with auto-routing
- McpManager: environment variable expansion (\) in config
- McpManager: HTTP server support via 'url' field in mcp.json
- Registered both resource tools in AppConfig (total: 26 tools)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
758d0d2980
feat: Coordinator Mode with SendMessageTool (Phase 2D)
...
- CoordinatorMode: env-var activation, system prompt, tool filtering
- SendMessageTool: direct message, broadcast, message queuing
- Coordinator allowed tools: Agent, SendMessage, TaskStop, TaskGet, TaskList, TaskOutput
- Worker allowed tools: Read, Write, Edit, Bash, Grep, Glob, etc.
- AppConfig: coordinator mode detection, specialized system prompt
- Registered SendMessageTool in ToolRegistry
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
6e49c4fdc7
feat: SessionMemory service with post-sampling hook integration
...
- SessionMemoryService: threshold-based memory extraction (50K init, 20K update)
- Async extraction via virtual threads with forked agent
- Post-sampling hook in AgentLoop after each model response
- System prompt injection of existing session memory
- /memory session sub-command to view session memory
- AppConfig wiring: bean registration, agent factory, AgentLoop hook
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
6088678c4f
feat: Skills execution system (Phase 2B)
...
- SkillTool: execute skills by name via forked sub-agent
- BundledSkills: 4 built-in skills (verify, debug, review, commit)
- SkillLoader: bundled skills auto-loaded + budget-aware prompt listing
- /skills command: detail view with /skills <name>
- Budget management: 8K char budget, 250 char per-entry cap
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
cb76b267f1
feat: Plan Mode implementation (Phase 2A)
...
- EnterPlanModeTool: switch to read-only mode with plan file path management
- ExitPlanModeTool: restore permissions and validate plan content
- PermissionRuleEngine: plan file edit exception in PLAN mode
- SystemPromptBuilder: 5-phase plan workflow instructions injection
- /plan command: toggle plan mode from command line
- Plan file stored at ~/.claude/projects/[path]/PLAN.md
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
bd98dea6b3
feat: console rendering enhancements (Phase 1B.4)
...
- MarkdownRenderer: table parsing and box-drawing character rendering
- ToolStatusRenderer: permission dialog beautification, progress bar, duration tracking
- SpinnerAnimation: multiple animation styles, elapsed time display, stopAndGetElapsed()
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
95b45940fd
feat: command layer enhancements (Phase 1B.3)
...
- /help: keyword search + command detail view
- /compact: --stats for token statistics, --aggressive for deeper compaction
- /commit: --push to push after commit, --pr to create PR via gh CLI
- /files: directory tree with depth control, file pattern search
- /permissions: view current permission mode and rules
- /tasks: list background tasks with status, age, result preview
Total commands: 28 → 31
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
05e6e019b2
feat: BashTool sandbox, ConfigTool persistence, ToolSearchTool
...
- BashTool: command blacklist (fork bombs, rm -rf /, etc) + risky
command warning log. Blocked commands return clear error message.
- ConfigTool: JSON file persistence (~/.claude-code/config.json),
new 'list' action, loads from file on first access.
- ToolSearchTool: search ToolRegistry by name/description keywords,
returns matching tools with descriptions (total: 23 tools).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
f5da3499a4
feat: FileReadTool image support + FileEditTool unified diff output
...
- FileReadTool: detect image files (png/jpg/gif/webp/svg/bmp/ico),
read as Base64 with MIME type, 20MB size limit
- FileEditTool: generate unified diff after edits with 3-line context,
showing removed (-) and added (+) lines in standard diff format
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
d9b8c795b6
feat: add TaskStopTool, TaskOutputTool, and SleepTool
...
- TaskStopTool: cancel running tasks via TaskManager.cancelTask()
- TaskOutputTool: retrieve task results with status-aware formatting
- SleepTool: Thread.sleep() with 5-minute max and interrupt support
- Registered all 3 tools in AppConfig (total: 22 tools)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
08ebc72416
feat: enhance GrepTool with output_mode, case_insensitive, multiline, context lines
...
Add 7 new parameters to match TS GrepTool capabilities:
- output_mode: content/files_with_matches/count (3 modes like TS)
- case_insensitive: -i flag support
- multiline: cross-line pattern matching (ripgrep only)
- context_before/context_after: -B/-A context lines
- type: file type filter (e.g., 'java', 'py') for ripgrep
- head_limit: configurable result limit (was hardcoded 100)
All parameters correctly wired to rg, grep, and findstr backends.
Description updated with output mode documentation and escaping notes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
c5440a2b4c
feat: enhance system prompt and tool descriptions to match TS version
...
Phase 1A implementation:
SystemPromptBuilder.java (142 lines -> ~290 lines):
- Add CyberRisk security boundary instruction
- Add System section (permission modes, prompt injection defense)
- Add Doing Tasks section (coding style, security, collaboration)
- Add Actions section (operation risk management, dangerous ops protection)
- Add Tone & Style section (emoji control, concise output, code references)
- Add Output Efficiency section (direct communication)
- Add Language preference support
- Restructure into modular section builder methods matching TS architecture
Tool description enhancements (8 tools):
- BashTool: add security boundaries, git best practices, no-substitute rule
- FileWriteTool: add must-Read-first rule, prefer-Edit guidance
- GrepTool: add never-use-Bash-grep rule, search guidance
- AgentTool: add when-to-use/not-use guidance, sub-prompt enhanced
- FileEditTool: add indentation preservation, prefer-edit-existing rule
- TodoWriteTool: add proactive usage guidance, state machine rules
- TaskUpdateTool: add status workflow documentation
- ConfigTool: add available settings list
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
3b47c5e818
feat: cursor movement in input field
...
- Left/Right arrow keys move cursor within text
- Home/End jump to line start/end
- Insert text at cursor position (not just at end)
- Backspace/Delete work at cursor position
- Paste inserts at cursor position
- History browsing sets cursor to end
- Visual cursor: inverse style on character under cursor
- Hide terminal hardware cursor in normal input (use rendered cursor)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
8946ca93f2
feat: dynamic terminal title matching official Claude Code behavior
...
- Title updates on every user message (not just the first)
- Shows current tool name during execution: '⠂ Bash · user topic'
- Animation pauses during permission prompts (matches isWaitingForApproval)
- Clears tool name when tool completes
- Priority: sessionTitle (from user input) > 'Claude Code' (fallback)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
d63a10c221
fix: hide cursor during selection mode and agent execution
...
- Permission selection: cursor hidden (❯ marker indicates selection)
- AskUser selection: cursor hidden (same reason)
- Agent running: cursor hidden (no text input needed)
- AskUser input mode: cursor still visible at text position
- Normal idle: cursor visible at input position
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
f05732a60c
fix: terminal title uses jink writeRaw instead of raw PrintStream
...
Terminal title now writes OSC 0 through Ink.Instance.writeRaw()
which goes directly to the JLine terminal. This eliminates garbled
characters caused by writing through intercepted System.out/err or
to streams that bypass the terminal's ANSI processing.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
ecb88b25a0
fix: restore header border, defer title init, fix title encoding
...
- Restore bordered headerBox as single scrollable item in messagesArea
- Defer terminal title init to first render() (after jink ready)
- Title uses ConsolePatcher.getOriginalOut() to bypass interception
- Ctrl+C fix in jink: INT signal handler now respects exitOnCtrlC flag
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
db3de65c3c
fix: header scrolls with messages, auto-scroll pauses on scroll-up
...
- Header/logo moved from fixed layout to messagesArea first items
(matches official LogoHeader behavior: scrolls with messages, not pinned)
- addMessageInternal preserves scrollOffset when user has scrolled up
(matches official sticky-scroll: only auto-scrolls when at bottom)
- Terminal title uses ConsolePatcher.getOriginalOut() to bypass interception
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
4523e7e4d3
fix: markdown ####, Ctrl+C exit bug, terminal title
...
- MarkdownToText: support heading levels 1-6 (was 1-3, causing #### raw display)
- Ctrl+C: agent cancel no longer starts exit window (matching official double-press flow)
- Terminal title: dynamic OSC 0 title with animated spinner during work, static idle prefix
- Matches official useTerminalTitle hook + AnimatedTerminalTitle component
- Session title inferred from first user message (simplified vs AI generation)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
43e62fb8fc
feat: 增强系统提示词 — 对齐官方工具使用指南
...
添加 'Using your tools' 段落(匹配官方 Claude Code):
- 专用工具优先于 Bash(FileRead/FileEdit/Glob/Grep)
- WebSearch/WebFetch 主动使用指令:遇到实时信息需求时
必须使用 WebSearch,不要说无法获取实时信息
- 并行工具调用指导
- TodoWrite 任务管理指导
解决 AI 不主动使用 WebSearch 工具的问题
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
54c3cb41a9
feat: 工具执行流式输出预览
...
- ToolEvent 新增 PROGRESS 阶段,工具可在执行中报告进度
- ToolContext 添加 progressCallback,工具可通过 reportProgress() 报告输出行
- BashTool 在读取每行输出时实时报告进度
- AgentLoop 在工具执行前设置进度回调,执行后清除
- ToolCallMsg 支持 outputLines 字段,保留最后 5 行流式预览
- 运行中的工具在消息区显示实时输出(灰色,截断至 120 字符)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
012d5dfae6
feat: 添加 Ctrl+R 反向历史搜索
...
- Ctrl+R 进入搜索模式,输入关键词实时过滤历史记录
- 输入区显示 bash 风格搜索提示: (reverse-i-search)\query': result
- 再按 Ctrl+R 搜索更旧的匹配项
- Enter 选定结果放入输入框,Esc 退出搜索
- 快捷键栏显示搜索模式操作提示
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
6c5580ccd7
feat: 添加斜杠命令 Tab 自动补全
...
- 输入 / 开头时,前缀匹配所有已注册命令
- Tab 键补全唯一匹配,多个匹配时循环选择
- 输入区显示 ghost text(灰色补全后缀提示)
- 快捷键栏显示匹配命令列表(最多5个)
- 当前 Tab 选中项高亮显示
- Backspace/Esc/Submit 时同步更新建议列表
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
f995a34d66
feat: 对齐官方快捷键和动画行为
...
Phase A (快速修复):
- Ctrl+C 双击窗口从 2000ms 改为 800ms(匹配官方)
- 添加 Ctrl+L 强制重绘
- 添加 Ctrl+Home/End 跳到顶部/底部
Phase B (动画改进):
- Thinking 显示持续时间: 'Thinking...' → 'Thinking (5s)...'
(2秒后开始显示时间,匹配官方行为)
- Processing 显示输出 token 计数
- 底部自动滚动已正确实现(新消息 scrollOffset=0)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
99a4ccf059
feat: 块光标 + 动画移至消息区 + 权限交互选择
...
块光标:
- 输入区使用 █ 块光标(匹配原版 Claude Code 风格)
- Agent 运行中输入区只显示 ❯ █
动画效果:
- 思考/处理动画从输入区移至消息区底部
- 使用旋转帧 ◐◓◑◒ + Thinking.../Processing... 文字
- Agent 运行中快捷键栏显示 'esc to interrupt'
权限确认:
- 从 Y/A/N/D 文本输入改为交互选择模式
- 3个选项:Yes / Yes, and don't ask again / No
- 支持 ↑↓ 选择、Enter 确认、Esc 取消、1-3 快捷选择
- Tool use 消息显示蓝色分隔线 + 工具详情
- 新增 requestTextInput() 用于无选项的简单文本输入
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
5ad2628b1a
feat: Ctrl+C 双击退出(匹配原版 Claude Code 行为)
...
- 第一次 Ctrl+C: Agent 运行中则取消任务,空闲时清空输入
- 第二次 Ctrl+C (2秒内): 退出应用
- 快捷键栏显示 'Press Ctrl-C again to exit' 黄色提示
- 2秒超时后自动清除提示(虚拟线程定时)
- 移除未使用的 cmdCount 字段
- 保留 Esc 中断和 Ctrl+D 退出作为备选
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago