kward 0.76.0 → 0.78.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +8 -1
- data/CHANGELOG.md +62 -0
- data/Gemfile.lock +2 -2
- data/README.md +13 -4
- data/doc/agent-tools.md +0 -3
- data/doc/api.md +4 -0
- data/doc/code-search.md +9 -6
- data/doc/composer.md +219 -0
- data/doc/configuration.md +114 -27
- data/doc/editor.md +18 -2
- data/doc/files.md +1 -1
- data/doc/getting-started.md +4 -0
- data/doc/git.md +2 -2
- data/doc/lifecycle-hooks.md +2 -14
- data/doc/pan.md +167 -0
- data/doc/permissions.md +179 -0
- data/doc/plugins.md +58 -0
- data/doc/rpc.md +61 -22
- data/doc/security.md +184 -0
- data/doc/tabs.md +4 -3
- data/doc/usage.md +15 -32
- data/doc/web-search.md +4 -2
- data/lib/kward/ansi.rb +2 -2
- data/lib/kward/auth/anthropic_oauth.rb +2 -2
- data/lib/kward/auth/github_oauth.rb +3 -3
- data/lib/kward/auth/oauth_helpers.rb +4 -2
- data/lib/kward/auth/openai_oauth.rb +2 -1
- data/lib/kward/cancellation.rb +2 -2
- data/lib/kward/cli/commands.rb +1 -3
- data/lib/kward/cli/interactive_turn.rb +0 -17
- data/lib/kward/cli/plugins.rb +24 -7
- data/lib/kward/cli/prompt_interface.rb +1 -0
- data/lib/kward/cli/rendering.rb +7 -1
- data/lib/kward/cli/runtime_helpers.rb +11 -35
- data/lib/kward/cli/sessions.rb +14 -5
- data/lib/kward/cli/settings.rb +22 -0
- data/lib/kward/cli/slash_commands.rb +1 -561
- data/lib/kward/cli/tabs.rb +154 -36
- data/lib/kward/cli.rb +30 -26
- data/lib/kward/compactor.rb +3 -3
- data/lib/kward/config_files.rb +28 -0
- data/lib/kward/ekwsh.rb +0 -4
- data/lib/kward/hooks/catalog.rb +0 -5
- data/lib/kward/hooks/http_handler.rb +2 -1
- data/lib/kward/http.rb +18 -0
- data/lib/kward/image_attachments.rb +1 -1
- data/lib/kward/model/client.rb +33 -11
- data/lib/kward/model/payloads.rb +6 -1
- data/lib/kward/openrouter_model_cache.rb +2 -1
- data/lib/kward/pan/index.html.erb +459 -64
- data/lib/kward/pan/kward_logo.png +0 -0
- data/lib/kward/pan/server.rb +248 -23
- data/lib/kward/permissions/policy.rb +171 -0
- data/lib/kward/plugin_registry.rb +71 -1
- data/lib/kward/prompt_interface/approval_prompt.rb +62 -0
- data/lib/kward/prompt_interface/editor/auto_indent.rb +31 -23
- data/lib/kward/prompt_interface/editor/modes/vibe.rb +72 -3
- data/lib/kward/prompt_interface/layout.rb +0 -4
- data/lib/kward/prompt_interface/project_browser.rb +40 -1
- data/lib/kward/prompt_interface/question_prompt.rb +12 -3
- data/lib/kward/prompt_interface/runtime_state.rb +4 -0
- data/lib/kward/prompt_interface/selection_prompt.rb +0 -1
- data/lib/kward/prompt_interface/transcript_renderer.rb +0 -12
- data/lib/kward/prompt_interface.rb +20 -1
- data/lib/kward/prompts/commands.rb +1 -3
- data/lib/kward/prompts.rb +20 -0
- data/lib/kward/rpc/plugin_chat_manager.rb +299 -0
- data/lib/kward/rpc/server.rb +48 -41
- data/lib/kward/rpc/session_manager.rb +76 -25
- data/lib/kward/rpc/tool_event_normalizer.rb +2 -0
- data/lib/kward/rpc/tool_metadata.rb +23 -0
- data/lib/kward/rpc/transcript_normalizer.rb +18 -5
- data/lib/kward/session_store.rb +55 -16
- data/lib/kward/skills/registry.rb +21 -1
- data/lib/kward/starter_pack_installer.rb +3 -1
- data/lib/kward/tab_driver.rb +87 -0
- data/lib/kward/tab_store.rb +74 -12
- data/lib/kward/tools/base.rb +14 -0
- data/lib/kward/tools/code_search.rb +8 -2
- data/lib/kward/tools/fetch_content.rb +4 -2
- data/lib/kward/tools/fetch_raw.rb +3 -1
- data/lib/kward/tools/registry.rb +45 -17
- data/lib/kward/tools/search/code.rb +47 -13
- data/lib/kward/tools/search/web.rb +61 -18
- data/lib/kward/tools/search/web_fetch.rb +206 -38
- data/lib/kward/tools/tool_call.rb +0 -4
- data/lib/kward/tools/web_search.rb +3 -1
- data/lib/kward/transcript_export.rb +1 -1
- data/lib/kward/update_check.rb +2 -1
- data/lib/kward/version.rb +1 -1
- data/templates/default/kward_navigation.rb +7 -2
- data/templates/default/layout/html/layout.erb +2 -2
- data/templates/default/layout/html/setup.rb +1 -0
- metadata +11 -12
- data/lib/kward/workers/git_guard.rb +0 -93
- data/lib/kward/workers/job.rb +0 -99
- data/lib/kward/workers/live_view.rb +0 -49
- data/lib/kward/workers/manager.rb +0 -328
- data/lib/kward/workers/queue_runner.rb +0 -166
- data/lib/kward/workers/queue_store.rb +0 -112
- data/lib/kward/workers/store.rb +0 -72
- data/lib/kward/workers/tool_policy.rb +0 -23
- data/lib/kward/workers/worker.rb +0 -82
- data/lib/kward/workers/write_lock.rb +0 -38
- data/lib/kward/workers.rb +0 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e77436e5f94e314fcab35e347c16994eb8f92f990ad4c3ebdc6ab76a393cb1b4
|
|
4
|
+
data.tar.gz: 50b73b48c76c737d5b7d2534380547d94e357cac6dec4528a80cfe36ea8f6bdf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bc17d7227fa1910ee107b840ec138ee19c8ed905d137d7aeed3fc552e2ec6d3aca1fb3d8df4febce7c7e84380a7e4f4378c3177415b3ab7a59fb22d344b92d2c
|
|
7
|
+
data.tar.gz: 56521cdb264f5745f2023a010892b99ec91693f4444c17c0f1aa7b9375e9d0727ba7c9ce280d4e0af9141ae5466073393fbf9d112d53bf7ea12872aa68c7f617
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -13,6 +13,10 @@ permissions:
|
|
|
13
13
|
jobs:
|
|
14
14
|
test:
|
|
15
15
|
runs-on: ubuntu-latest
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
matrix:
|
|
19
|
+
ruby-version: ['3.2', 'ruby']
|
|
16
20
|
steps:
|
|
17
21
|
- name: Checkout
|
|
18
22
|
uses: actions/checkout@v4
|
|
@@ -20,11 +24,14 @@ jobs:
|
|
|
20
24
|
- name: Set up Ruby
|
|
21
25
|
uses: ruby/setup-ruby@v1
|
|
22
26
|
with:
|
|
23
|
-
ruby-version:
|
|
27
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
24
28
|
bundler-cache: true
|
|
25
29
|
|
|
26
30
|
- name: Check syntax
|
|
27
31
|
run: find lib test -name '*.rb' -print0 | xargs -0 ruby -c
|
|
28
32
|
|
|
33
|
+
- name: Check runtime warnings
|
|
34
|
+
run: ruby -w -Ilib -e 'require "kward"'
|
|
35
|
+
|
|
29
36
|
- name: Run tests
|
|
30
37
|
run: bundle exec rake test
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,68 @@ All notable changes to Kward will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.78.0] - 2026-07-15
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Added opt-in transcript-observer delivery for plugin-owned tabs, including RPC plugin chats, so local integrations such as text-to-speech can receive permitted streamed replies.
|
|
12
|
+
- Added opt-in RPC support for plugin-owned chats, including explicit subscriptions, transcript snapshots, attachment-capable turns, event replay, and cancellation. Plugins remain disabled from this surface unless their tab type explicitly opts in.
|
|
13
|
+
- Added plugin-owned tab types, opened with `/tab open <plugin-tab>`, with typed tab persistence and the normal interactive composer, transcript, streaming, and image-input behavior. Plugin tabs are CLI-only in this release and own their own storage rather than Kward sessions.
|
|
14
|
+
- Added an opt-in permission policy for model-requested tools, with allow/ask/deny rules, read-only and workspace-write modes, write scopes, and interactive approval overlays. Permissions remain disabled by default and are not an OS sandbox.
|
|
15
|
+
- Added a custom-response path to permission approval overlays: choosing `Type something` denies the requested tool call and returns the entered guidance to the agent.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- Plugin-chat transcript RPC supports optional bounded, cursor-based pages for plugin drivers that opt in, avoiding full-history payloads for long-lived chats.
|
|
20
|
+
- Code search now synchronizes mutable repository refs before every read and search, reports the resolved commit, and accepts GitHub blob URLs as file inputs.
|
|
21
|
+
- Web and code research tools now cooperate with turn cancellation between requests, provider attempts, redirects, and repository scan files.
|
|
22
|
+
- Kward-owned HTTP requests now identify themselves with `User-Agent: Kward/<version>`.
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- Fixed `fetch_content` site navigation by preferring semantic main content over nested article cards, preserving inline and standalone link destinations, listing bounded discovered navigation links, and extracting ordered lists and simple tables.
|
|
27
|
+
- Prevented duplicate session-backed tabs from restoring as mirrored conversations after restart.
|
|
28
|
+
- Fixed `fetch_content` on documentation pages with large scripts or metadata before the main content by separating bounded page downloads from extracted output limits; plain-text extraction now parses HTML instead of returning cleaned markup.
|
|
29
|
+
- Fixed raw fetches so their response limit is enforced while reading the network body.
|
|
30
|
+
- Fixed stale code-search reads and searches by treating cached repositories as reusable local storage rather than authoritative snapshots.
|
|
31
|
+
- Restored GPT-5.6 Luna requests through Codex with a scoped Responses Lite compatibility workaround; normal Codex requests retain Kward's own identity.
|
|
32
|
+
|
|
33
|
+
## [0.77.0] - 2026-07-11
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- Added `firstChangedLine` to successful RPC file-mutation results when Kward can derive it from the unified diff, allowing clients to navigate to the first changed line.
|
|
38
|
+
- Added an opt-in Nerd Font icon theme for the `/files` browser, configurable through Interface settings or `project_browser.icons`; text-only rows remain the default.
|
|
39
|
+
- Added Vim-style Vibe editor reindent commands: `==`, `={motion}` and text objects, plus visual `=`; reindentation uses the built-in language-aware auto-indent rules.
|
|
40
|
+
- Added a security and trust guide covering local permissions, external data flow, trusted extensions, stored data, and safe use with unfamiliar repositories.
|
|
41
|
+
- Added a dedicated Pan mode guide covering setup, browser and session workflows, prompt queueing, extensions, network security, and limitations.
|
|
42
|
+
- Added an interactive composer guide covering editing keys, command and file completion, history, reasoning and tab shortcuts, busy input, cancellation, images, and terminal compatibility.
|
|
43
|
+
- Added session browsing, creation, resume, rename, and deletion to Pan mode, with a responsive mobile-first interface using the documentation palette, Kward logo, and CLI-inspired startup screen.
|
|
44
|
+
- Added dependency-free Markdown rendering for Pan transcript entries, including fenced code blocks, lists, blockquotes, inline styles, and safe links.
|
|
45
|
+
|
|
46
|
+
### Fixed
|
|
47
|
+
|
|
48
|
+
- Restored busy-tab `/tab` commands, including tab naming, switching, opening, and moving, without replacing the running tab's agent.
|
|
49
|
+
- Fixed `/reload` so newly loaded plugin slash commands appear in the interactive completion overlay.
|
|
50
|
+
- Pan mode now uses the active persona label for assistant messages and interface copy instead of a fixed Kward label.
|
|
51
|
+
- Pan mode now prints the routed LAN address in its startup URL when available.
|
|
52
|
+
- Fixed RPC session close, delete, and shutdown operations to cancel active turns before releasing session state, with a bounded fallback for uncooperative workers.
|
|
53
|
+
- Fixed concurrent RPC turn event recording so replay sequence numbers remain unique and ordered.
|
|
54
|
+
- Kept intentional empty-session garbage collection from deleting live CLI or RPC session files.
|
|
55
|
+
- Removed scheduler timing from the throttled CLI streaming test and restored Ruby 4 image-attachment compatibility.
|
|
56
|
+
|
|
57
|
+
### Removed
|
|
58
|
+
|
|
59
|
+
- Removed the experimental worker pipeline, tab-backed worker queue, related CLI flag and commands, RPC capability, lifecycle hooks, and stored-runtime integration. Existing session files, worker metadata, and Git stashes are left untouched.
|
|
60
|
+
|
|
61
|
+
### Changed
|
|
62
|
+
|
|
63
|
+
- Improved documentation navigation, command and settings coverage, editor and diff-view workflows, configuration task guidance, and generated API comments for supported extension surfaces.
|
|
64
|
+
- CI now tests the minimum supported Ruby and the current stable Ruby.
|
|
65
|
+
- Removed unused private CLI, transcript-rendering, layout, and shell helpers, and clarified compaction guard naming.
|
|
66
|
+
- Removed production Ruby warnings and added a warning-free runtime require check to CI.
|
|
67
|
+
- Limited session listings now fully reconstruct only the requested newest sessions while still garbage-collecting abandoned empty files.
|
|
68
|
+
|
|
7
69
|
## [0.76.0] - 2026-07-10
|
|
8
70
|
|
|
9
71
|
### Added
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
kward (0.
|
|
4
|
+
kward (0.78.0)
|
|
5
5
|
base64
|
|
6
6
|
nokogiri
|
|
7
7
|
tiktoken_ruby
|
|
@@ -146,7 +146,7 @@ CHECKSUMS
|
|
|
146
146
|
html-proofer (5.2.1) sha256=fdd958a7cbf9c3255fb96fe7cfc4e611f64e2706e469488a3326309ad007d2fd
|
|
147
147
|
io-event (1.16.2) sha256=9f9cb0a96ea5c3850a672606c65f27bc96d7621399ef6196acbfe2be0cd1279c
|
|
148
148
|
json (2.19.9) sha256=9b9025b7cdddafa38d316eca0b2358488e42d417045c1b90d216a9fefe46b79a
|
|
149
|
-
kward (0.
|
|
149
|
+
kward (0.78.0)
|
|
150
150
|
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
|
|
151
151
|
metrics (0.15.0) sha256=61ded5bac95118e995b1bc9ed4a5f19bc9814928a312a85b200abbdac9039072
|
|
152
152
|
minitest (6.0.6) sha256=153ea36d1d987a62942382b61075745042a2b3123b1cd48f4c3675af9cc7d6f1
|
data/README.md
CHANGED
|
@@ -41,18 +41,19 @@ kward init
|
|
|
41
41
|
|
|
42
42
|
This downloads Kward's default prompts and base `PRINCIPLES.md` into your config directory. It is useful for a first setup, but safe to skip if you prefer to create your own instructions. Existing files are left untouched.
|
|
43
43
|
|
|
44
|
-
Then
|
|
44
|
+
Then sign in and start Kward:
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
|
+
kward login # sign in or save provider credentials
|
|
47
48
|
kward # start an interactive chat
|
|
48
49
|
kward help # show available commands and examples
|
|
49
|
-
/login # from inside Kward: sign in or save provider credentials
|
|
50
|
-
kward login # from your shell: sign in or save provider credentials
|
|
51
50
|
kward hooks doctor # inspect lifecycle hook setup
|
|
52
51
|
kward "Explain this project" # run one prompt and exit
|
|
53
52
|
kward --working-directory ~/code/project "Explain this project"
|
|
54
53
|
```
|
|
55
54
|
|
|
55
|
+
From inside Kward, `/login` opens the same provider picker.
|
|
56
|
+
|
|
56
57
|
See [Authentication](doc/authentication.md) for more details about sign-in options and provider credentials.
|
|
57
58
|
|
|
58
59
|
## What Kward can do
|
|
@@ -74,16 +75,24 @@ Start here:
|
|
|
74
75
|
- [Usage](doc/usage.md): interactive chat, slash commands, sessions, tools, images, and Pan mode.
|
|
75
76
|
- [Configuration](doc/configuration.md): config files, providers, models, web search, logging, and color output.
|
|
76
77
|
- [Authentication](doc/authentication.md): OpenAI OAuth, Anthropic OAuth, OpenRouter API keys, and Copilot/GitHub setup.
|
|
78
|
+
- [Security and trust](doc/security.md): local permissions, external data flow, trusted extensions, and safe work in unfamiliar repositories.
|
|
79
|
+
- [Permissions](doc/permissions.md): opt-in tool approval, write scopes, policy rules, and current limits.
|
|
77
80
|
- [Troubleshooting](doc/troubleshooting.md): environment-specific install and runtime issues.
|
|
78
81
|
|
|
79
82
|
Feature guides:
|
|
80
83
|
|
|
81
84
|
- [Sessions](doc/session-management.md): resume, clone, fork, rewind, compact, and navigate saved work.
|
|
82
|
-
- [
|
|
85
|
+
- [Interactive composer](doc/composer.md): use multiline input, completion, history, files, reasoning shortcuts, busy input, and images.
|
|
86
|
+
- [Tabs](doc/tabs.md): keep several conversations open and run work in another tab.
|
|
87
|
+
- [Project files](doc/files.md): browse, search, mention, open, and edit workspace files.
|
|
88
|
+
- [Integrated Editor](doc/editor.md): open files from the shell or composer, edit in-place, and choose editor keybindings.
|
|
83
89
|
- [Git](doc/git.md): review changes, use the diff viewer, stage files, and commit from the interactive TUI.
|
|
84
90
|
- [Shell](doc/shell.md): use `/shell`, the embedded Kward shell with aliases, completion, and per-tab state.
|
|
85
91
|
- [Memory](doc/memory.md): opt-in core, soft, and session memory.
|
|
86
92
|
- [Personas](doc/personas.md): configure Kward's tone and role by default, workspace, model, reasoning effort, time, and weekday.
|
|
93
|
+
- [Skills](doc/skills.md): add reusable instructions that load only for matching tasks.
|
|
94
|
+
- [MCP servers](doc/mcp.md): connect trusted local Model Context Protocol tool servers.
|
|
95
|
+
- [Pan mode](doc/pan.md): use the mobile-friendly browser interface on a trusted local network.
|
|
87
96
|
|
|
88
97
|
Advanced:
|
|
89
98
|
|
data/doc/agent-tools.md
CHANGED
|
@@ -8,7 +8,6 @@ Tools are part of Kward's safety and context-management boundary:
|
|
|
8
8
|
- Ruby tool objects validate and execute those calls,
|
|
9
9
|
- workspace tools stay inside the active workspace by default (see [Configuration](configuration.md) for the guardrail setting),
|
|
10
10
|
- file-changing tools require the file to be read first,
|
|
11
|
-
- mutation tools (`edit_file`, `write_file`, `run_shell_command`) are gated by a write lock when agent workers are active, so only one worker can change the workspace at a time,
|
|
12
11
|
- large outputs are bounded or compacted before they enter model context,
|
|
13
12
|
- full tool outputs are kept in the session record for later inspection.
|
|
14
13
|
|
|
@@ -45,8 +44,6 @@ This lets the assistant reason from focused evidence while preserving access to
|
|
|
45
44
|
- `read_skill` is advertised only when skills are available,
|
|
46
45
|
- `ask_user_question` is advertised only when the frontend can display structured questions.
|
|
47
46
|
|
|
48
|
-
When agent workers are active, the registry can scope each worker to a subset of tools via an allowed-tool-names filter, so workers only see the tools they need.
|
|
49
|
-
|
|
50
47
|
When `write_file` or `edit_file` changes an `AGENTS.md` file in the workspace root, Kward automatically rebuilds the system message so the model picks up the new instructions without a restart.
|
|
51
48
|
|
|
52
49
|
Unknown tool calls are recorded as tool results instead of crashing the session, so the model can recover and choose an advertised tool on the next turn.
|
data/doc/api.md
CHANGED
|
@@ -45,6 +45,8 @@ Generated entry points:
|
|
|
45
45
|
- [`Kward::Tools::Base`](Kward/Tools/Base.html)
|
|
46
46
|
- [`Kward::ToolRegistry`](Kward/ToolRegistry.html)
|
|
47
47
|
|
|
48
|
+
These pages document the schema and dispatch contract used by built-in tools. Kward does not yet provide a plugin DSL for registering arbitrary model-callable tools; contributors add them through the built-in registry and keep schemas, validation, docs, and tests aligned.
|
|
49
|
+
|
|
48
50
|
### RPC and frontend authors
|
|
49
51
|
|
|
50
52
|
The RPC protocol is the supported integration surface for UI clients. Prefer the protocol guide before reading implementation classes.
|
|
@@ -78,6 +80,8 @@ Generated entry points:
|
|
|
78
80
|
- [`Kward::Skills::Registry`](Kward/Skills/Registry.html)
|
|
79
81
|
- [`Kward::ConfigFiles`](Kward/ConfigFiles.html)
|
|
80
82
|
|
|
83
|
+
The generated comments focus on these supported extension boundaries rather than trying to make every internal orchestration helper public. When a generated method lacks guide coverage, treat it as internal unless the page explicitly marks it as a public API.
|
|
84
|
+
|
|
81
85
|
## Public API expectations
|
|
82
86
|
|
|
83
87
|
Kward is still evolving. The generated reference is useful for understanding the codebase, but it should not be read as a promise that every class, method, or constructor is public and stable.
|
data/doc/code-search.md
CHANGED
|
@@ -85,9 +85,9 @@ The tool uses an `action` parameter:
|
|
|
85
85
|
| --- | --- |
|
|
86
86
|
| `package_search` | find package metadata and likely source repositories. |
|
|
87
87
|
| `github_search` | search public GitHub repositories. |
|
|
88
|
-
| `repo_clone` |
|
|
89
|
-
| `repo_search` | search files in a
|
|
90
|
-
| `repo_read` | read a bounded line range from a
|
|
88
|
+
| `repo_clone` | prewarm the local Git repository store. |
|
|
89
|
+
| `repo_search` | synchronize and search files in a repository. |
|
|
90
|
+
| `repo_read` | synchronize and read a bounded line range from a file. |
|
|
91
91
|
| `list_cache` | show cached repositories. |
|
|
92
92
|
| `refresh_cache` | fetch updates for a cached repository. |
|
|
93
93
|
| `clear_cache` | remove a cached repository. |
|
|
@@ -99,13 +99,16 @@ The tool uses an `action` parameter:
|
|
|
99
99
|
| `package_search` | `ecosystem`, `package` | — |
|
|
100
100
|
| `github_search` | `query` | `ecosystem`, `max_results` |
|
|
101
101
|
| `repo_clone` | `repo` | — |
|
|
102
|
-
| `repo_search` | `repo`, `query` | `max_results`, `context_lines` |
|
|
103
|
-
| `repo_read` | `repo
|
|
102
|
+
| `repo_search` | `repo`, `query` | `ref`, `max_results`, `context_lines` |
|
|
103
|
+
| `repo_read` | `repo` | `path`, `ref`, `start_line`, `line_count` |
|
|
104
104
|
| `list_cache` | — | — |
|
|
105
105
|
| `refresh_cache` | `repo` | — |
|
|
106
106
|
| `clear_cache` | `repo` | — |
|
|
107
107
|
|
|
108
|
-
- `repo` is a GitHub URL or `owner/name`.
|
|
108
|
+
- `repo` is a GitHub URL or `owner/name`. A GitHub `blob` URL can supply the file path and ref for `repo_read`.
|
|
109
|
+
- `ref` selects a branch, tag, or commit. Mutable refs are fetched before every read or search; without `ref`, Kward synchronizes the remote default branch.
|
|
110
|
+
- Successful reads and searches report the exact commit revision used. The local Git store reduces repeated downloads but is never silently treated as current source.
|
|
111
|
+
- If synchronization fails, Kward returns an error instead of silently answering from stale files.
|
|
109
112
|
- `query` is a plain-text search string (not regex). Matching is case-sensitive substring.
|
|
110
113
|
- `start_line` is 1-indexed.
|
|
111
114
|
- `context_lines` controls how many lines before and after a match are included in search snippets.
|
data/doc/composer.md
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# Interactive composer
|
|
2
|
+
|
|
3
|
+
The composer is the input area at the bottom of Kward's interactive terminal UI. It is more than a single-line prompt: it supports multiline editing, command and file completion, persistent history, image attachments, reasoning selection, background tabs, queued follow-ups, and in-flight steering.
|
|
4
|
+
|
|
5
|
+
This guide is a practical keyboard reference for working quickly without leaving the conversation.
|
|
6
|
+
|
|
7
|
+
## Write and submit a prompt
|
|
8
|
+
|
|
9
|
+
Type a prompt and press Return to submit it:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
Find where authentication errors are handled and explain the flow.
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Use Shift+Return to insert a newline without submitting:
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
Review the current diff.
|
|
19
|
+
Focus on:
|
|
20
|
+
- correctness
|
|
21
|
+
- missing tests
|
|
22
|
+
- confusing naming
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Modified Enter support depends on what your terminal sends. If Shift+Return is swallowed or arrives as an ordinary Return, paste multiline text with bracketed paste, or compose it in another editor before pasting.
|
|
26
|
+
|
|
27
|
+
The composer supports familiar line-editing keys:
|
|
28
|
+
|
|
29
|
+
| Key | Action |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| `Left` / `Right` | Move by character |
|
|
32
|
+
| `Home` / `Ctrl+A` | Move to the start of the current line |
|
|
33
|
+
| `End` / `Ctrl+E` | Move to the end of the current line |
|
|
34
|
+
| `Ctrl+B` / `Ctrl+F` | Move left or right |
|
|
35
|
+
| `Alt+B` / `Alt+F` | Move by word |
|
|
36
|
+
| `Backspace` / `Delete` | Delete before or at the cursor |
|
|
37
|
+
| `Ctrl+W` | Delete the word before the cursor |
|
|
38
|
+
| `Alt+D` | Delete the word after the cursor |
|
|
39
|
+
| `Ctrl+U` / `Ctrl+K` | Kill from the cursor to the start or end of the line |
|
|
40
|
+
| `Ctrl+Y` | Yank the most recently killed composer text |
|
|
41
|
+
| `Ctrl+L` | Redraw the terminal UI |
|
|
42
|
+
| `Ctrl+D` | Delete at the cursor, or exit when the composer is empty |
|
|
43
|
+
|
|
44
|
+
These are composer bindings. The integrated editor, shell, Git view, file browser, and plugin interfaces have their own keymaps.
|
|
45
|
+
|
|
46
|
+
## Find slash commands
|
|
47
|
+
|
|
48
|
+
Type `/` at the beginning of the composer to open the slash-command picker:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
/ses
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Use Up/Down to select a match. Press Tab to complete it, then add arguments if needed:
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
/session name OAuth cleanup
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Press Esc to dismiss the picker without deleting your draft. Return submits the command.
|
|
61
|
+
|
|
62
|
+
The picker includes:
|
|
63
|
+
|
|
64
|
+
- Kward's built-in commands,
|
|
65
|
+
- configured prompt templates,
|
|
66
|
+
- configured skills as `/skill:<name>`,
|
|
67
|
+
- plugin slash commands,
|
|
68
|
+
- plugin interactive commands.
|
|
69
|
+
|
|
70
|
+
See [Usage](usage.md#Interactive_slash_commands) for the built-in command reference and [Extensibility](extensibility.md) for adding commands.
|
|
71
|
+
|
|
72
|
+
## Mention a file with `@`
|
|
73
|
+
|
|
74
|
+
Type `@` followed by part of a workspace path anywhere in a prompt:
|
|
75
|
+
|
|
76
|
+
```text
|
|
77
|
+
@agent
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Kward shows fuzzy project-file matches. Use Up/Down to select one and Tab to insert the path:
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
@lib/kward/agent.rb Explain how tool execution works here.
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
An `@path` is a textual pointer for the agent. It does not automatically place the whole file into model context; Kward can inspect the file with its tools when the task requires it. This keeps large files from being attached blindly.
|
|
87
|
+
|
|
88
|
+
Press Esc to dismiss file completion. You can also insert a mention from the `/files` browser with `@`. See [Project files](files.md).
|
|
89
|
+
|
|
90
|
+
## Open a file with `$`
|
|
91
|
+
|
|
92
|
+
Start the composer with `$` to open a workspace file in the integrated editor:
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
$lib/kward/agent.rb
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The `$` token must begin at the first character of the composer. Use Up/Down to choose a match, then press Return or Tab to open it. If you type a path that does not exist and press Return, Kward can ask whether to create it.
|
|
99
|
+
|
|
100
|
+
A successful `$path` open is saved in prompt history using the resolved workspace-relative path. It opens the editor instead of sending a model prompt.
|
|
101
|
+
|
|
102
|
+
See [Integrated Editor](editor.md) for editing modes, save and quit keys, scratchpads, and conflict handling.
|
|
103
|
+
|
|
104
|
+
## Reuse prompt history
|
|
105
|
+
|
|
106
|
+
Kward stores prompt history per workspace under `~/.kward/history/`.
|
|
107
|
+
|
|
108
|
+
- Press Up/Down when no completion picker is visible to move through earlier prompts.
|
|
109
|
+
- Press `Ctrl+R` to start fuzzy history search.
|
|
110
|
+
- Type a query, then use Up/Down to choose a match.
|
|
111
|
+
- Press Return to place the selected result back into the composer for editing or submission.
|
|
112
|
+
- Press Esc or `Ctrl+C` to cancel search and restore the draft you had before searching.
|
|
113
|
+
|
|
114
|
+
History survives restarts. It contains submitted prompt text and successful `$path` editor-open commands, so protect it like other local Kward data. See [Security and trust](security.md#Local_data_and_permissions).
|
|
115
|
+
|
|
116
|
+
## Change reasoning effort
|
|
117
|
+
|
|
118
|
+
When no slash or file picker is open, Tab cycles forward through reasoning efforts supported by the current model. Shift+Tab cycles backward. The selection wraps and is persisted for later turns.
|
|
119
|
+
|
|
120
|
+
The composer status line shows the current provider, model, and reasoning effort. Use `/reasoning` or `/model` when you prefer the explicit picker.
|
|
121
|
+
|
|
122
|
+
Tab is context-sensitive:
|
|
123
|
+
|
|
124
|
+
- in slash or `@path` completion, it accepts the selected match,
|
|
125
|
+
- in `$path` completion, it opens the selected file,
|
|
126
|
+
- otherwise, it changes reasoning effort,
|
|
127
|
+
- in other modal interfaces, it follows that interface's own controls.
|
|
128
|
+
|
|
129
|
+
## Work with tabs
|
|
130
|
+
|
|
131
|
+
`Ctrl+Tab` and `Ctrl+Shift+Tab` switch conversations when your terminal reports those keys. Additional shortcuts depend on `composer.tab_keybindings`:
|
|
132
|
+
|
|
133
|
+
- `ctrl`: `Ctrl+T` creates a tab, `Ctrl+W` closes one, and reported `Ctrl+1` through `Ctrl+9` select numbered tabs.
|
|
134
|
+
- `alt`: `Alt+T` creates a tab, `Alt+Left`/`Alt+Right` move between tabs, and `Alt+1` through `Alt+9` select numbered tabs.
|
|
135
|
+
- `auto`: prefers the Ctrl family on macOS and the Alt family elsewhere.
|
|
136
|
+
|
|
137
|
+
Use `/settings` → Interface → Tab keybindings to change the family. If your terminal intercepts a shortcut, `/tab` commands always provide the same operations.
|
|
138
|
+
|
|
139
|
+
See [Tabs](tabs.md) for background work, status colors, persistence, naming, and moving tabs.
|
|
140
|
+
|
|
141
|
+
## Type while Kward is busy
|
|
142
|
+
|
|
143
|
+
The composer stays available during a model turn or many long local actions.
|
|
144
|
+
|
|
145
|
+
For a normal model turn:
|
|
146
|
+
|
|
147
|
+
- If the current provider supports native in-flight steering, a non-empty prompt is sent as guidance to the running turn. Kward marks it as steered until the model applies it.
|
|
148
|
+
- If steering is unavailable or fails, the prompt is queued and starts after the active turn.
|
|
149
|
+
- Kward displays queued and steered counts in the busy composer.
|
|
150
|
+
|
|
151
|
+
Use steering for short corrections that should affect work already in progress:
|
|
152
|
+
|
|
153
|
+
```text
|
|
154
|
+
Do not change the public API. Keep the fix internal.
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Use a separate tab when you want an independent task rather than a correction to the current one.
|
|
158
|
+
|
|
159
|
+
Most slash commands typed into a busy composer are intentionally ignored because delayed local state changes would be surprising. `/exit`, `/quit`, and `/new` are queued as control actions. `/tab` commands run immediately while work runs, so you can name, switch, open, or move tabs; closing the running tab remains unavailable.
|
|
160
|
+
|
|
161
|
+
During local operations that do not support steering, submitted text is queued for later processing.
|
|
162
|
+
|
|
163
|
+
## Cancel running work
|
|
164
|
+
|
|
165
|
+
Press `Ctrl+C` while the busy composer is active to request cancellation of the current operation. Kward stops rendering further work and cooperatively cancels model and tool activity where possible.
|
|
166
|
+
|
|
167
|
+
Cancellation is best effort. A network request, shell command, or side effect already in progress may finish before the underlying API can stop. Always inspect the workspace after cancelling a mutating task.
|
|
168
|
+
|
|
169
|
+
When Kward is idle, `Ctrl+C` does not exit the interactive session. Use `/exit`, `/quit`, or `Ctrl+D` on an empty composer.
|
|
170
|
+
|
|
171
|
+
The busy composer shows a cancellation hint by default. Hide only the hint—not cancellation itself—with `composer.busy_help: false` or the Interface settings menu.
|
|
172
|
+
|
|
173
|
+
## Attach images
|
|
174
|
+
|
|
175
|
+
Paste supported image references into the composer. Kward recognizes:
|
|
176
|
+
|
|
177
|
+
- image paths,
|
|
178
|
+
- Markdown image links,
|
|
179
|
+
- `file://` URLs,
|
|
180
|
+
- base64 image data URLs.
|
|
181
|
+
|
|
182
|
+
Supported formats are GIF, JPEG, PNG, and WebP, up to 20 MB per image. Pasted references become badges above the draft, and their source text is removed from the visible prompt. Duplicate pasted references are ignored. References typed normally are resolved when the prompt is submitted.
|
|
183
|
+
|
|
184
|
+
Example:
|
|
185
|
+
|
|
186
|
+
```text
|
|
187
|
+
./tmp/broken-layout.png Find the likely CSS problem shown in this screenshot.
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
If the cursor is at the start of an otherwise empty draft, Backspace removes the most recently added pending attachment. Submitting the draft clears its pending attachments.
|
|
191
|
+
|
|
192
|
+
The active model must support image input. iTerm2 and Kitty-compatible terminals can render submitted images inline; other terminals still show attachment badges and send the image to the model without an inline preview.
|
|
193
|
+
|
|
194
|
+
## Understand composer status
|
|
195
|
+
|
|
196
|
+
The composer area can include:
|
|
197
|
+
|
|
198
|
+
- the current Git branch or short commit, colored yellow when dirty,
|
|
199
|
+
- additions and deletions recorded in the current session,
|
|
200
|
+
- approximate context-window usage,
|
|
201
|
+
- provider, model, and reasoning effort,
|
|
202
|
+
- a tab bar plus queued or steered input counts,
|
|
203
|
+
- an optional plugin footer.
|
|
204
|
+
|
|
205
|
+
Context usage is an estimate, not provider billing. Use `/status` for more session and compaction detail.
|
|
206
|
+
|
|
207
|
+
## Recover from terminal issues
|
|
208
|
+
|
|
209
|
+
Terminal support for Shift+Return, Ctrl+Tab, modified number keys, OSC clipboard access, and inline images varies.
|
|
210
|
+
|
|
211
|
+
If rendering becomes corrupted after resize or after an external program writes terminal controls:
|
|
212
|
+
|
|
213
|
+
```text
|
|
214
|
+
/redraw
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
You can also press `Ctrl+L`. If a shortcut never reaches Kward, prefer its slash-command equivalent or change `composer.tab_keybindings` in `/settings`.
|
|
218
|
+
|
|
219
|
+
For full-screen interactive programs such as Vim or `less`, use `/pty <command>` or `pty <command>` inside `/shell` so the program temporarily owns the terminal instead of fighting the composer.
|