kward 0.70.0 → 0.72.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/pages.yml +1 -1
- data/CHANGELOG.md +89 -3
- data/Gemfile +2 -0
- data/Gemfile.lock +90 -2
- data/README.md +34 -6
- data/Rakefile +96 -0
- data/doc/agent-tools.md +52 -0
- data/doc/api.md +92 -0
- data/doc/authentication.md +58 -23
- data/doc/code-search.md +42 -2
- data/doc/configuration.md +102 -13
- data/doc/context-budgeting.md +136 -0
- data/doc/context-tools.md +83 -0
- data/doc/editor.md +394 -0
- data/doc/extensibility.md +16 -7
- data/doc/files.md +100 -0
- data/doc/getting-started.md +25 -18
- data/doc/git.md +122 -0
- data/doc/memory.md +24 -4
- data/doc/personas.md +34 -5
- data/doc/plugins.md +74 -3
- data/doc/releasing.md +45 -8
- data/doc/rpc.md +77 -15
- data/doc/session-management.md +254 -0
- data/doc/shell.md +286 -0
- data/doc/tabs.md +122 -0
- data/doc/troubleshooting.md +77 -1
- data/doc/usage.md +60 -15
- data/doc/web-search.md +12 -4
- data/doc/workspace-tools.md +144 -0
- data/examples/plugins/space_invaders.rb +377 -0
- data/lib/kward/agent.rb +1 -1
- data/lib/kward/cli/commands.rb +41 -2
- data/lib/kward/cli/git.rb +150 -0
- data/lib/kward/cli/interactive_turn.rb +73 -9
- data/lib/kward/cli/openrouter_commands.rb +55 -0
- data/lib/kward/cli/plugins.rb +54 -4
- data/lib/kward/cli/prompt_interface.rb +111 -6
- data/lib/kward/cli/rendering.rb +11 -6
- data/lib/kward/cli/runtime_helpers.rb +133 -3
- data/lib/kward/cli/sessions.rb +262 -13
- data/lib/kward/cli/settings.rb +216 -37
- data/lib/kward/cli/slash_commands.rb +439 -8
- data/lib/kward/cli/tabs.rb +695 -0
- data/lib/kward/cli.rb +171 -26
- data/lib/kward/compactor.rb +4 -1
- data/lib/kward/config_files.rb +125 -5
- data/lib/kward/context_budget_meter.rb +44 -0
- data/lib/kward/conversation.rb +59 -22
- data/lib/kward/editor_mode.rb +25 -0
- data/lib/kward/ekwsh.rb +362 -0
- data/lib/kward/model/client.rb +37 -50
- data/lib/kward/model/context_usage.rb +13 -6
- data/lib/kward/model/model_info.rb +92 -16
- data/lib/kward/model/payloads.rb +2 -0
- data/lib/kward/openrouter_model_cache.rb +120 -0
- data/lib/kward/plugin_registry.rb +108 -1
- data/lib/kward/project_files.rb +52 -0
- data/lib/kward/prompt_history.rb +82 -0
- data/lib/kward/prompt_interface/banner.rb +16 -51
- data/lib/kward/prompt_interface/composer_controller.rb +124 -83
- data/lib/kward/prompt_interface/composer_renderer.rb +116 -14
- data/lib/kward/prompt_interface/composer_state.rb +96 -27
- data/lib/kward/prompt_interface/editor/auto_close_pairs.rb +123 -0
- data/lib/kward/prompt_interface/editor/auto_indent.rb +509 -0
- data/lib/kward/prompt_interface/editor/buffer.rb +109 -0
- data/lib/kward/prompt_interface/editor/controller.rb +1018 -0
- data/lib/kward/prompt_interface/editor/endwise.rb +321 -0
- data/lib/kward/prompt_interface/editor/file_marker.rb +40 -0
- data/lib/kward/prompt_interface/editor/indent_navigation.rb +61 -0
- data/lib/kward/prompt_interface/editor/kill_ring.rb +78 -0
- data/lib/kward/prompt_interface/editor/modes/emacs.rb +259 -0
- data/lib/kward/prompt_interface/editor/modes/modern.rb +353 -0
- data/lib/kward/prompt_interface/editor/modes/vibe.rb +1962 -0
- data/lib/kward/prompt_interface/editor/renderer.rb +243 -0
- data/lib/kward/prompt_interface/editor/search.rb +76 -0
- data/lib/kward/prompt_interface/editor/selections.rb +120 -0
- data/lib/kward/prompt_interface/editor/state.rb +1249 -0
- data/lib/kward/prompt_interface/editor/status_text.rb +23 -0
- data/lib/kward/prompt_interface/editor/syntax_highlighter.rb +420 -0
- data/lib/kward/prompt_interface/editor/undo_history.rb +46 -0
- data/lib/kward/prompt_interface/editor/vibe_state.rb +44 -0
- data/lib/kward/prompt_interface/file_overlay.rb +211 -0
- data/lib/kward/prompt_interface/git_prompt.rb +299 -0
- data/lib/kward/prompt_interface/interactive/controller.rb +186 -0
- data/lib/kward/prompt_interface/interactive/renderer.rb +71 -0
- data/lib/kward/prompt_interface/interactive/state.rb +62 -0
- data/lib/kward/prompt_interface/key_handler.rb +416 -43
- data/lib/kward/prompt_interface/layout.rb +2 -2
- data/lib/kward/prompt_interface/overlay_renderer.rb +21 -2
- data/lib/kward/prompt_interface/project_browser.rb +524 -0
- data/lib/kward/prompt_interface/prompt_renderer.rb +32 -13
- data/lib/kward/prompt_interface/question_prompt.rb +122 -82
- data/lib/kward/prompt_interface/runtime_state.rb +49 -1
- data/lib/kward/prompt_interface/screen.rb +17 -0
- data/lib/kward/prompt_interface/selection_prompt.rb +511 -58
- data/lib/kward/prompt_interface/stream_state.rb +7 -0
- data/lib/kward/prompt_interface/transcript_buffer.rb +13 -16
- data/lib/kward/prompt_interface/transcript_renderer.rb +3 -3
- data/lib/kward/prompt_interface.rb +307 -35
- data/lib/kward/prompts/commands.rb +7 -1
- data/lib/kward/prompts.rb +4 -2
- data/lib/kward/rpc/server.rb +45 -11
- data/lib/kward/rpc/session_manager.rb +52 -53
- data/lib/kward/rpc/session_tree_rows.rb +9 -115
- data/lib/kward/rpc/tool_event_normalizer.rb +1 -1
- data/lib/kward/session_store.rb +67 -4
- data/lib/kward/session_tree_nodes.rb +136 -0
- data/lib/kward/session_tree_renderer.rb +9 -131
- data/lib/kward/tab_store.rb +47 -0
- data/lib/kward/telemetry/logger.rb +5 -3
- data/lib/kward/text_boundary.rb +25 -0
- data/lib/kward/tool_output_compactor.rb +127 -0
- data/lib/kward/tools/base.rb +8 -2
- data/lib/kward/tools/context_budget_stats.rb +54 -0
- data/lib/kward/tools/context_for_task.rb +202 -0
- data/lib/kward/tools/read_file.rb +8 -4
- data/lib/kward/tools/registry.rb +92 -15
- data/lib/kward/tools/retrieve_tool_output.rb +71 -0
- data/lib/kward/tools/search/web.rb +2 -2
- data/lib/kward/tools/summarize_file_structure.rb +29 -0
- data/lib/kward/tools/tool_call.rb +12 -0
- data/lib/kward/version.rb +1 -1
- data/lib/kward/workers/git_guard.rb +68 -0
- data/lib/kward/workers/live_view.rb +49 -0
- data/lib/kward/workers/manager.rb +288 -0
- data/lib/kward/workers/store.rb +72 -0
- data/lib/kward/workers/tool_policy.rb +23 -0
- data/lib/kward/workers/worker.rb +82 -0
- data/lib/kward/workers/write_lock.rb +38 -0
- data/lib/kward/workers.rb +7 -0
- data/lib/kward/workspace.rb +154 -12
- data/templates/default/fulldoc/html/css/kward.css +362 -42
- data/templates/default/fulldoc/html/full_list.erb +107 -0
- data/templates/default/fulldoc/html/js/kward.js +161 -2
- data/templates/default/fulldoc/html/setup.rb +8 -0
- data/templates/default/kward_navigation.rb +102 -0
- data/templates/default/layout/html/layout.erb +43 -10
- data/templates/default/layout/html/setup.rb +39 -38
- metadata +65 -3
- data/lib/kward/resources/avatar_kward_logo.rb +0 -50
- data/lib/kward/resources/pixel_logo.rb +0 -232
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 32f9966cff49fb90d0c11f20277e77186fe439ede174a3d151a2a3dfdcddc726
|
|
4
|
+
data.tar.gz: ebcdfd83477ce0e90857019a67f8bfdf57f2f2e9cb4e7accdd89b790d6002b5c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9c625a36cf64cb7348f1ff14a07bd27e6b311bcd2d5b219669885d105118977143f17d1321d0acfefddc81469c0a11311868b8e8905d2d5a68339065dddf0513
|
|
7
|
+
data.tar.gz: 7de5e8b2887d654d57bd2032fa86b4fad7b3c0859d74d323e4d9f44cd682b7f7b616a11858e5e20bb4f2cc5a829d3746f94576fb114a35504581a45a66adbb16
|
data/.github/workflows/pages.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -2,17 +2,103 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to Kward will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [
|
|
5
|
+
## [0.72.0] - 2026-06-28
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added a built-in editor that can be opened from the TUI with `$` or directly from the CLI with `kward edit <filename>`, with modern, Emacs-style, and Vibe editing modes.
|
|
10
|
+
- Added richer editor workflows including syntax highlighting, undo/redo, auto-indent, soft wrap, mouse support, multi-cursor editing, relative line numbers, and an expanded Vim-like Vibe mode with visual selections, text objects, registers, marks, macros, substitution, and Ruby navigation.
|
|
11
|
+
- Added `/shell`, an embedded Kward shell (`ekwsh`) for running workspace commands without leaving the TUI, including command/path completion, safe color output, optional global `ekwsh.yml` configuration, and rbenv shim autodetection.
|
|
12
|
+
- Added `/files`, a searchable project file browser that can open files in the editor and remembers cursor and folder expansion state per workspace.
|
|
13
|
+
- Added persistent TUI tabs for session-backed conversations, plus tab commands, shortcuts, status colors, and restoration across restarts.
|
|
14
|
+
- Added `/git` workflows for reviewing changes, viewing diffs, staging or unstaging files, and writing commit messages from inside the TUI.
|
|
15
|
+
- Added TUI composer improvements including `@` file mentions, persistent workspace prompt history with Ctrl+R search, and Tab/Shift+Tab reasoning-effort cycling.
|
|
16
|
+
- Added CLI execution modes via `--mode auto|chat|oneshot|filter` and `--filter` for transforming piped input.
|
|
17
|
+
- Added context-budgeting tools and workflows, including `read_file` modes, richer source outlines, `context_for_task`, `context_budget_stats`, and restored compacted tool-output inspection.
|
|
18
|
+
- Added interactive plugin commands backed by a Kward-driven canvas render loop.
|
|
19
|
+
- Added experimental agent-worker support behind the existing experimental workflow.
|
|
20
|
+
- Added new and expanded guides for editor usage, tabs, project files, Git workflows, agent tools, context budgeting, workspace tools, web search, code search, plugins, RPC, authentication, memory, sessions, troubleshooting, and releasing.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Changed the built-in editor to use the modern editing mode by default, with smarter indentation and improved keyboard handling across terminal encodings.
|
|
25
|
+
- Improved TUI interaction polish across pickers, tabs, editor rendering, Git workflows, composer refresh behavior, mouse handling, and modal input isolation.
|
|
26
|
+
- Improved embedded shell environment handling so Kward-managed environment values are preserved while workspace shell conveniences still work.
|
|
27
|
+
- Improved RPC and session internals around steering events, session cleanup, worker metadata, session-tree traversal, and config updates.
|
|
28
|
+
- Improved tool-output context budgeting so agents start with focused context, preserve inspectable originals, and report active-conversation savings more accurately.
|
|
29
|
+
- Expanded documentation and generated-doc navigation to better reflect current workflows and configuration options.
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
|
|
33
|
+
- Fixed embedded-shell completion, environment preservation, and rbenv handling issues.
|
|
34
|
+
- Fixed editor and TUI input edge cases involving shifted keys, CSI-u encodings, Command/Ctrl shortcuts, selection preservation, mouse scrolling, tab switching, modal questions, and commit-message editing.
|
|
35
|
+
- Fixed many built-in editor behaviors around selection rendering, cursor movement, soft wrap, indentation, deletion/change operations, undo/search behavior, macro recording, registers, text objects, visual mode, and viewport positioning.
|
|
36
|
+
- Fixed Git overlay staging and commit-message behavior.
|
|
37
|
+
- Fixed session, tab, and worker state issues including tab restoration, session cleanup, worker handoff, foreground write locks, and plugin/test isolation.
|
|
38
|
+
- Fixed RPC steering, tool-output restoration, context-budget statistics, and session-manager lifecycle behavior.
|
|
39
|
+
- Fixed documentation rendering, navigation, tables, quote styling, and generated guide layout issues.
|
|
40
|
+
- Fixed persona time-of-day handling to use the current local time.
|
|
41
|
+
|
|
42
|
+
### Removed
|
|
43
|
+
|
|
44
|
+
- Removed the placeholder message from `/status` output.
|
|
45
|
+
- Removed unused RPC session helpers and temporarily hid worker labels behind the experimental worker flow.
|
|
46
|
+
|
|
47
|
+
## [0.71.0] - 2026-06-21
|
|
48
|
+
|
|
49
|
+
### Fixed
|
|
50
|
+
|
|
51
|
+
- Fixed generated YARD guide links so doc-to-doc Markdown links point at the generated `file.*.html` pages.
|
|
52
|
+
- Fixed web-tool results with BINARY/ASCII-8BIT response bodies so RPC tool events and TUI rendering receive UTF-8-safe content.
|
|
53
|
+
|
|
54
|
+
### Changed
|
|
55
|
+
|
|
56
|
+
- Changed transcript rendering so assistant, reasoning, and tool output starts on the same line as its label.
|
|
57
|
+
- Changed the interactive startup screen to an info block.”
|
|
58
|
+
- Changed shell command output capture to allow larger raw output for Kward's own compactor, preserving stdout/stderr structure and test failure summaries before model-context trimming.
|
|
59
|
+
- Tightened the built-in system prompt wording to reduce repeated instruction tokens.
|
|
60
|
+
- Changed generated runtime system prompts to use a stable timestamp anchor so time-based persona modifiers do not churn provider cache prefixes each turn.
|
|
61
|
+
- Changed tool schema properties to be emitted in deterministic key order for more stable provider request payloads.
|
|
62
|
+
- Changed large source-file reads to return an outline plus a short preview before requiring offset/limit continuation.
|
|
63
|
+
- Changed large search and fetched-content tool results to preserve file, line, URL, and heading anchors during model-context compaction.
|
|
64
|
+
- Changed large tool results to be compacted before they enter model context while preserving full originals in session tool-execution records, reusing existing artifact ids for repeated outputs, avoiding storage for verbatim outputs, preserving short errors exactly, reverting automatically when compaction would not reduce context, and teaching conversation compaction to preserve tool artifact ids.
|
|
65
|
+
- Changed model context-window resolution to prefer cached OpenRouter metadata, infer matching provider models from that metadata when possible, and use conservative fallbacks for unknown selected models.
|
|
66
|
+
- Updated the authentication guide to describe model picker selection and OpenRouter model cache refresh/list commands.
|
|
67
|
+
|
|
68
|
+
### Removed
|
|
69
|
+
|
|
70
|
+
- Removed the `banner.enabled` config setting and `/settings` toggle for hiding the interactive startup screen.
|
|
71
|
+
- Removed the generated table of contents and source-checkout launch snippet from the RPC protocol guide.
|
|
72
|
+
|
|
73
|
+
### Added
|
|
74
|
+
|
|
75
|
+
- Added a Sessions guide covering saved sessions, cloning, forking, rewinding, tree navigation, compaction, and exports.
|
|
76
|
+
- Added Agent Tools documentation pages covering workspace tools, context tools, and token-saving tool-output behavior.
|
|
77
|
+
- Added an API reference overview page and API docs navigation dropdown for generated Ruby indexes and key namespaces.
|
|
78
|
+
- Added Turbolinks-style navigation to the generated documentation site for same-origin HTML links.
|
|
79
|
+
- Added a `docs:check` Rake task and HTMLProofer development dependency for checking generated documentation links, images, and scripts.
|
|
80
|
+
- Added a `docs:serve` Rake task and WEBrick development dependency for previewing the built YARD documentation site locally with automatic rebuilds.
|
|
81
|
+
- Added optional `compaction` telemetry logging for tool-output context savings.
|
|
82
|
+
- Added a `summarize_file_structure` tool for compact source-file outlines before reading full files.
|
|
83
|
+
- Added a `retrieve_tool_output` tool for inspecting original outputs that were compacted out of model context.
|
|
84
|
+
- Added `kward openrouter refresh` and `kward openrouter list` for caching key-scoped text-capable OpenRouter models in the Kward cache directory.
|
|
85
|
+
- Added `/fork` for creating a new session from an earlier prompt and pre-filling that prompt for editing.
|
|
86
|
+
- Added `f` in the `/sessions` picker to open the fork prompt selector for the selected session.
|
|
87
|
+
- Added `/rename <name>` for renaming the current interactive session.
|
|
88
|
+
- Added `r` in the `/sessions` picker to rename the selected session without closing the picker.
|
|
89
|
+
- Added `c` in the `/sessions` picker to clone the selected session and open the new clone, with a cloning spinner while it runs.
|
|
90
|
+
- Added `d d` in the `/sessions` picker to delete the selected session after an inline confirmation.
|
|
91
|
+
|
|
92
|
+
## [0.70.0] - 2026-06-19
|
|
8
93
|
|
|
9
94
|
### Added
|
|
10
95
|
|
|
11
|
-
- Added `z-ai/glm-5.2` to the static OpenRouter model choices.
|
|
12
96
|
- Added `/rewind` for revisiting earlier user prompts and continuing from there as a branch, while `/tree` remains the advanced full session tree navigator.
|
|
13
97
|
|
|
14
98
|
### Changed
|
|
15
99
|
|
|
100
|
+
- Changed TUI selection search to start only after pressing `/`, hiding the composer cursor until search mode is active and supporting shell-style editing keys while searching.
|
|
101
|
+
- Changed the `/sessions` picker to show right-aligned relative timestamps like `/rewind`.
|
|
16
102
|
- Changed TUI list navigation to keep long `/sessions` and `/tree` pickers centered while scrolling, and removed wrap-around at list edges.
|
|
17
103
|
- Changed the saved session picker slash command to `/sessions`, with `/resume` kept as an alias.
|
|
18
104
|
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
kward (0.
|
|
4
|
+
kward (0.72.0)
|
|
5
5
|
base64
|
|
6
6
|
nokogiri
|
|
7
7
|
tiktoken_ruby
|
|
@@ -13,10 +13,50 @@ PATH
|
|
|
13
13
|
GEM
|
|
14
14
|
remote: https://rubygems.org/
|
|
15
15
|
specs:
|
|
16
|
+
Ascii85 (2.0.1)
|
|
17
|
+
addressable (2.9.0)
|
|
18
|
+
public_suffix (>= 2.0.2, < 8.0)
|
|
19
|
+
afm (1.0.0)
|
|
20
|
+
async (2.39.0)
|
|
21
|
+
console (~> 1.29)
|
|
22
|
+
fiber-annotation
|
|
23
|
+
io-event (~> 1.11)
|
|
24
|
+
metrics (~> 0.12)
|
|
25
|
+
traces (~> 0.18)
|
|
16
26
|
base64 (0.3.0)
|
|
27
|
+
benchmark (0.5.0)
|
|
28
|
+
bigdecimal (3.3.1)
|
|
29
|
+
console (1.36.0)
|
|
30
|
+
fiber-annotation
|
|
31
|
+
fiber-local (~> 1.1)
|
|
32
|
+
json
|
|
17
33
|
date (3.5.1)
|
|
18
34
|
drb (2.2.3)
|
|
19
35
|
erb (6.0.4)
|
|
36
|
+
ethon (0.18.0)
|
|
37
|
+
ffi (>= 1.15.0)
|
|
38
|
+
logger
|
|
39
|
+
ffi (1.17.4-arm64-darwin)
|
|
40
|
+
ffi (1.17.4-x86_64-linux-gnu)
|
|
41
|
+
fiber-annotation (0.2.0)
|
|
42
|
+
fiber-local (1.1.0)
|
|
43
|
+
fiber-storage
|
|
44
|
+
fiber-storage (1.0.1)
|
|
45
|
+
hashery (2.1.2)
|
|
46
|
+
html-proofer (5.2.1)
|
|
47
|
+
addressable (~> 2.3)
|
|
48
|
+
async (~> 2.1)
|
|
49
|
+
benchmark (~> 0.5)
|
|
50
|
+
nokogiri (~> 1.13)
|
|
51
|
+
pdf-reader (~> 2.11)
|
|
52
|
+
rainbow (~> 3.0)
|
|
53
|
+
typhoeus (~> 1.3)
|
|
54
|
+
yell (~> 2.0)
|
|
55
|
+
zeitwerk (~> 2.5)
|
|
56
|
+
io-event (1.16.2)
|
|
57
|
+
json (2.19.9)
|
|
58
|
+
logger (1.7.0)
|
|
59
|
+
metrics (0.15.0)
|
|
20
60
|
minitest (6.0.6)
|
|
21
61
|
drb (~> 2.0)
|
|
22
62
|
prism (~> 1.5)
|
|
@@ -26,20 +66,32 @@ GEM
|
|
|
26
66
|
racc (~> 1.4)
|
|
27
67
|
pastel (0.8.0)
|
|
28
68
|
tty-color (~> 0.5)
|
|
69
|
+
pdf-reader (2.15.1)
|
|
70
|
+
Ascii85 (>= 1.0, < 3.0, != 2.0.0)
|
|
71
|
+
afm (>= 0.2.1, < 2)
|
|
72
|
+
hashery (~> 2.0)
|
|
73
|
+
ruby-rc4
|
|
74
|
+
ttfunk
|
|
29
75
|
prism (1.9.0)
|
|
30
76
|
psych (5.4.0)
|
|
31
77
|
date
|
|
32
78
|
stringio
|
|
79
|
+
public_suffix (7.0.5)
|
|
33
80
|
racc (1.8.1)
|
|
81
|
+
rainbow (3.1.1)
|
|
34
82
|
rake (13.3.1)
|
|
35
83
|
rdoc (7.2.0)
|
|
36
84
|
erb
|
|
37
85
|
psych (>= 4.0.0)
|
|
38
86
|
tsort
|
|
87
|
+
ruby-rc4 (0.1.5)
|
|
39
88
|
stringio (3.2.0)
|
|
40
89
|
tiktoken_ruby (0.0.16-arm64-darwin)
|
|
41
90
|
tiktoken_ruby (0.0.16-x86_64-linux)
|
|
91
|
+
traces (0.18.2)
|
|
42
92
|
tsort (0.2.0)
|
|
93
|
+
ttfunk (1.8.0)
|
|
94
|
+
bigdecimal (~> 3.1)
|
|
43
95
|
tty-color (0.6.0)
|
|
44
96
|
tty-cursor (0.7.1)
|
|
45
97
|
tty-prompt (0.23.1)
|
|
@@ -50,8 +102,13 @@ GEM
|
|
|
50
102
|
tty-screen (~> 0.8)
|
|
51
103
|
wisper (~> 2.0)
|
|
52
104
|
tty-screen (0.8.2)
|
|
105
|
+
typhoeus (1.6.0)
|
|
106
|
+
ethon (>= 0.18.0)
|
|
107
|
+
webrick (1.9.2)
|
|
53
108
|
wisper (2.0.1)
|
|
54
109
|
yard (0.9.44)
|
|
110
|
+
yell (2.2.2)
|
|
111
|
+
zeitwerk (2.8.2)
|
|
55
112
|
|
|
56
113
|
PLATFORMS
|
|
57
114
|
arm64-darwin
|
|
@@ -59,38 +116,69 @@ PLATFORMS
|
|
|
59
116
|
x86_64-linux
|
|
60
117
|
|
|
61
118
|
DEPENDENCIES
|
|
119
|
+
html-proofer
|
|
62
120
|
kward!
|
|
63
121
|
minitest
|
|
64
122
|
rake
|
|
65
123
|
rdoc
|
|
124
|
+
webrick
|
|
66
125
|
yard
|
|
67
126
|
|
|
68
127
|
CHECKSUMS
|
|
128
|
+
Ascii85 (2.0.1) sha256=15cb5d941808543cbb9e7e6aea3c8ec3877f154c3461e8b3673e97f7ecedbe5a
|
|
129
|
+
addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af
|
|
130
|
+
afm (1.0.0) sha256=5bd4d6f6241e7014ef090985ec6f4c3e9745f6de0828ddd58bc1efdd138f4545
|
|
131
|
+
async (2.39.0) sha256=df18730073f2bbb45788077dfa20cb365ecc1b9453969f44de6796b5191a00aa
|
|
69
132
|
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
|
|
133
|
+
benchmark (0.5.0) sha256=465df122341aedcb81a2a24b4d3bd19b6c67c1530713fd533f3ff034e419236c
|
|
134
|
+
bigdecimal (3.3.1) sha256=eaa01e228be54c4f9f53bf3cc34fe3d5e845c31963e7fcc5bedb05a4e7d52218
|
|
135
|
+
console (1.36.0) sha256=45599ea906cf80a73d8941f03abf873fe66a6a954e0bac5bc1c01e2cdc406f07
|
|
70
136
|
date (3.5.1) sha256=750d06384d7b9c15d562c76291407d89e368dda4d4fff957eb94962d325a0dc0
|
|
71
137
|
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
|
|
72
138
|
erb (6.0.4) sha256=38e3803694be357fe2bfe312487c74beaf9fb4e5beb3e22498952fe1645b95d9
|
|
73
|
-
|
|
139
|
+
ethon (0.18.0) sha256=b598afc9f30448cb068b850714b7d6948e941476095d04f90a4ac65b8d6efcb2
|
|
140
|
+
ffi (1.17.4-arm64-darwin) sha256=19071aaf1419251b0a46852abf960e77330a3b334d13a4ab51d58b31a937001b
|
|
141
|
+
ffi (1.17.4-x86_64-linux-gnu) sha256=9d3db14c2eae074b382fa9c083fe95aec6e0a1451da249eab096c34002bc752d
|
|
142
|
+
fiber-annotation (0.2.0) sha256=7abfadf1d119f508867d4103bf231c0354d019cc39a5738945dec2edadaf6c03
|
|
143
|
+
fiber-local (1.1.0) sha256=c885f94f210fb9b05737de65d511136ea602e00c5105953748aa0f8793489f06
|
|
144
|
+
fiber-storage (1.0.1) sha256=f48e5b6d8b0be96dac486332b55cee82240057065dc761c1ea692b2e719240e1
|
|
145
|
+
hashery (2.1.2) sha256=d239cc2310401903f6b79d458c2bbef5bf74c46f3f974ae9c1061fb74a404862
|
|
146
|
+
html-proofer (5.2.1) sha256=fdd958a7cbf9c3255fb96fe7cfc4e611f64e2706e469488a3326309ad007d2fd
|
|
147
|
+
io-event (1.16.2) sha256=9f9cb0a96ea5c3850a672606c65f27bc96d7621399ef6196acbfe2be0cd1279c
|
|
148
|
+
json (2.19.9) sha256=9b9025b7cdddafa38d316eca0b2358488e42d417045c1b90d216a9fefe46b79a
|
|
149
|
+
kward (0.72.0)
|
|
150
|
+
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
|
|
151
|
+
metrics (0.15.0) sha256=61ded5bac95118e995b1bc9ed4a5f19bc9814928a312a85b200abbdac9039072
|
|
74
152
|
minitest (6.0.6) sha256=153ea36d1d987a62942382b61075745042a2b3123b1cd48f4c3675af9cc7d6f1
|
|
75
153
|
nokogiri (1.19.3-arm64-darwin) sha256=71b9bd424b1b7abc18b05052a1a3cfd3627abdca62be280854cc411791357e42
|
|
76
154
|
nokogiri (1.19.3-x86_64-linux-gnu) sha256=2f5078620fe12e83669b5b17311b32532a8153d02eee7ad06948b926d6080976
|
|
77
155
|
pastel (0.8.0) sha256=481da9fb7d2f6e6b1a08faf11fa10363172dc40fd47848f096ae21209f805a75
|
|
156
|
+
pdf-reader (2.15.1) sha256=18c6a986a84a3117fa49f4279fc2de51f5d2399b71833df5d2bccd595c7068ce
|
|
78
157
|
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
|
|
79
158
|
psych (5.4.0) sha256=14f72d69a611af663d7d70e4a7b67d9eb1f3ae9f8d916b478961d5a0075ba5b7
|
|
159
|
+
public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623
|
|
80
160
|
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
|
|
161
|
+
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
|
|
81
162
|
rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c
|
|
82
163
|
rdoc (7.2.0) sha256=8650f76cd4009c3b54955eb5d7e3a075c60a57276766ebf36f9085e8c9f23192
|
|
164
|
+
ruby-rc4 (0.1.5) sha256=00cc40a39d20b53f5459e7ea006a92cf584e9bc275e2a6f7aa1515510e896c03
|
|
83
165
|
stringio (3.2.0) sha256=c37cb2e58b4ffbd33fe5cd948c05934af997b36e0b6ca6fdf43afa234cf222e1
|
|
84
166
|
tiktoken_ruby (0.0.16-arm64-darwin) sha256=3da6fe850bf920d08c7eb736673f50bc9d08e8f2e17d34904ad3185a73fc9da7
|
|
85
167
|
tiktoken_ruby (0.0.16-x86_64-linux) sha256=4d970b8e68a86972ec81799306116480b33a558c06bb4fe0092852280a4b76b2
|
|
168
|
+
traces (0.18.2) sha256=80f1649cb4daace1d7174b81f3b3b7427af0b93047759ba349960cb8f315e214
|
|
86
169
|
tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
|
|
170
|
+
ttfunk (1.8.0) sha256=a7cbc7e489cc46e979dde04d34b5b9e4f5c8f1ee5fc6b1a7be39b829919d20ca
|
|
87
171
|
tty-color (0.6.0) sha256=6f9c37ca3a4e2367fb2e6d09722762647d6f455c111f05b59f35730eeb24332a
|
|
88
172
|
tty-cursor (0.7.1) sha256=79534185e6a777888d88628b14b6a1fdf5154a603f285f80b1753e1908e0bf48
|
|
89
173
|
tty-prompt (0.23.1) sha256=fcdbce905238993f27eecfdf67597a636bc839d92192f6a0eef22b8166449ec8
|
|
90
174
|
tty-reader (0.9.0) sha256=c62972c985c0b1566f0e56743b6a7882f979d3dc32ff491ed490a076f899c2b1
|
|
91
175
|
tty-screen (0.8.2) sha256=c090652115beae764336c28802d633f204fb84da93c6a968aa5d8e319e819b50
|
|
176
|
+
typhoeus (1.6.0) sha256=bacc41c23e379547e29801dc235cd1699b70b955a1ba3d32b2b877aa844c331d
|
|
177
|
+
webrick (1.9.2) sha256=beb4a15fc474defed24a3bda4ffd88a490d517c9e4e6118c3edce59e45864131
|
|
92
178
|
wisper (2.0.1) sha256=ce17bc5c3a166f241a2e6613848b025c8146fce2defba505920c1d1f3f88fae6
|
|
93
179
|
yard (0.9.44) sha256=eb087e9b631ccd887b049f303d489963945452d5e2a7eb49a5a74a7cf6887f28
|
|
180
|
+
yell (2.2.2) sha256=1d166f3cc3b6dc49a59778ea7156ed6d8de794c15106d48ffd6cbb061b9b26bc
|
|
181
|
+
zeitwerk (2.8.2) sha256=7212a61311083c604184b1ea2574b9aa05cd14f855a0841c06985cabe9181d12
|
|
94
182
|
|
|
95
183
|
BUNDLED WITH
|
|
96
184
|
4.0.6
|
data/README.md
CHANGED
|
@@ -77,17 +77,29 @@ Start here:
|
|
|
77
77
|
|
|
78
78
|
Feature guides:
|
|
79
79
|
|
|
80
|
+
- [Sessions](doc/session-management.md): resume, clone, fork, rewind, compact, and navigate saved work.
|
|
81
|
+
- [Integrated Editor](doc/editor.md): open files from the composer, edit in-place, and choose editor keybindings.
|
|
82
|
+
- [Git](doc/git.md): review changes, use the diff viewer, stage files, and commit from the interactive TUI.
|
|
83
|
+
- [Shell](doc/shell.md): use `/shell`, the embedded Kward shell with aliases, completion, and per-tab state.
|
|
80
84
|
- [Memory](doc/memory.md): opt-in core, soft, and session memory.
|
|
81
85
|
- [Personas](doc/personas.md): configure Kward's tone and role by default, workspace, model, reasoning effort, time, and weekday.
|
|
82
|
-
- [Extensibility](doc/extensibility.md): `PRINCIPLES.md`, workspace `AGENTS.md`, skills, prompt templates, and extension choices.
|
|
83
|
-
- [Plugins](doc/plugins.md): trusted Ruby plugins for commands, footer UI, prompt context, transcript events, and RPC clients.
|
|
84
|
-
- [Web search](doc/web-search.md): live search providers and network behavior.
|
|
85
|
-
- [Code search](doc/code-search.md): package lookup, GitHub repository cache, and external source reading.
|
|
86
86
|
|
|
87
|
-
Advanced
|
|
87
|
+
Advanced:
|
|
88
88
|
|
|
89
|
+
- [Extensibility](doc/extensibility.md): `PRINCIPLES.md`, workspace `AGENTS.md`, skills, prompt templates, and extension choices.
|
|
90
|
+
- [Plugins](doc/plugins.md): trusted Ruby plugins for commands, footer UI, prompt context, transcript events, and RPC clients.
|
|
89
91
|
- [RPC protocol](doc/rpc.md): experimental JSON-RPC backend mode for UI clients.
|
|
90
92
|
- [Releasing](doc/releasing.md): release checklist for RubyGems publishing.
|
|
93
|
+
- [Agent tools](doc/agent-tools.md): overview of model-callable tools, token-saving behavior, and tool categories.
|
|
94
|
+
- [Workspace tools](doc/workspace-tools.md): local file, edit, and shell command tools.
|
|
95
|
+
- [Context budgeting](doc/context-budgeting.md): focused context gathering, budgeted reads, output compaction, and token-saving history.
|
|
96
|
+
- [Web search](doc/web-search.md): live search providers and network behavior for the web search agent tool.
|
|
97
|
+
- [Code search](doc/code-search.md): package lookup, GitHub repository cache, and external source reading for the code search agent tool.
|
|
98
|
+
- [Context tools](doc/context-tools.md): skills, compacted output retrieval, and structured clarification questions.
|
|
99
|
+
|
|
100
|
+
API reference:
|
|
101
|
+
|
|
102
|
+
- [API reference](doc/api.md): generated Ruby API entry points, indexes, and public API expectations.
|
|
91
103
|
|
|
92
104
|
## Development
|
|
93
105
|
|
|
@@ -97,7 +109,15 @@ Run tests:
|
|
|
97
109
|
bundle exec rake test
|
|
98
110
|
```
|
|
99
111
|
|
|
100
|
-
|
|
112
|
+
Preview the built YARD documentation site locally with automatic rebuilds:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
bundle exec rake docs:serve
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The preview builds `_yardoc/`, serves it with WEBrick using `Cache-Control: no-store`, and rebuilds in a fresh process when documentation sources, library code, or templates change. Generated HTML, images, CSS, and JavaScript match the published site. Open <http://localhost:8808/> and refresh your browser after rebuilds. Use `PORT=4000 bundle exec rake docs:serve` to choose another port.
|
|
119
|
+
|
|
120
|
+
Build the static YARD documentation site for publishing:
|
|
101
121
|
|
|
102
122
|
```bash
|
|
103
123
|
bundle exec rake docs:build
|
|
@@ -105,6 +125,14 @@ bundle exec rake docs:build
|
|
|
105
125
|
|
|
106
126
|
The generated site is written to `_yardoc/`. Pushes to `main` deploy that directory to GitHub Pages.
|
|
107
127
|
|
|
128
|
+
Check generated documentation links, images, and scripts:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
bundle exec rake docs:check
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
External link checks are disabled by default for stable local runs. Enable them with `DOCS_CHECK_EXTERNAL=1 bundle exec rake docs:check`.
|
|
135
|
+
|
|
108
136
|
Generate the RDoc API documentation:
|
|
109
137
|
|
|
110
138
|
```bash
|
data/Rakefile
CHANGED
|
@@ -1,8 +1,49 @@
|
|
|
1
1
|
require "fileutils"
|
|
2
|
+
require "html-proofer"
|
|
2
3
|
require "rdoc/task"
|
|
4
|
+
require "webrick"
|
|
3
5
|
require "yard"
|
|
4
6
|
require "yard/rake/yardoc_task"
|
|
5
7
|
|
|
8
|
+
DOCS_WATCH_GLOBS = [
|
|
9
|
+
".yardopts",
|
|
10
|
+
"CHANGELOG.md",
|
|
11
|
+
"LICENSE",
|
|
12
|
+
"README.md",
|
|
13
|
+
"doc/**/*.md",
|
|
14
|
+
"lib/**/*.rb",
|
|
15
|
+
"templates/**/*"
|
|
16
|
+
].freeze
|
|
17
|
+
|
|
18
|
+
def docs_watch_snapshot
|
|
19
|
+
DOCS_WATCH_GLOBS.flat_map { |pattern| Dir.glob(pattern) }
|
|
20
|
+
.select { |path| File.file?(path) }
|
|
21
|
+
.uniq
|
|
22
|
+
.to_h { |path| [path, File.mtime(path)] }
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def rebuild_docs
|
|
26
|
+
system({ "DOCS_SERVE_REBUILD" => "1" }, "bundle", "exec", "rake", "docs:build") || abort("Documentation rebuild failed")
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def rewrite_yard_markdown_links
|
|
30
|
+
guide_names = Dir.glob("doc/*.md").map { |path| File.basename(path, ".md") }
|
|
31
|
+
|
|
32
|
+
Dir.glob("_yardoc/**/*.html").each do |path|
|
|
33
|
+
html = File.read(path)
|
|
34
|
+
rewritten = html.gsub(/href=(["'])(?:(?:\.\.\/)?doc\/)?([a-z0-9-]+)\.md(#[^"']*)?\1/) do |match|
|
|
35
|
+
quote = Regexp.last_match(1)
|
|
36
|
+
guide_name = Regexp.last_match(2)
|
|
37
|
+
anchor = Regexp.last_match(3).to_s
|
|
38
|
+
next match unless guide_names.include?(guide_name)
|
|
39
|
+
|
|
40
|
+
"href=#{quote}file.#{guide_name}.html#{anchor}#{quote}"
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
File.write(path, rewritten) unless rewritten == html
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
6
47
|
task default: :test
|
|
7
48
|
|
|
8
49
|
task :test do
|
|
@@ -26,8 +67,63 @@ YARD::Rake::YardocTask.new do |yard|
|
|
|
26
67
|
end
|
|
27
68
|
|
|
28
69
|
namespace :docs do
|
|
70
|
+
desc "Serve the built YARD documentation site locally and rebuild on changes"
|
|
71
|
+
task serve: :build do
|
|
72
|
+
port = Integer(ENV.fetch("PORT", "8808"))
|
|
73
|
+
server = WEBrick::HTTPServer.new(
|
|
74
|
+
BindAddress: "127.0.0.1",
|
|
75
|
+
DocumentRoot: File.expand_path("_yardoc", __dir__),
|
|
76
|
+
Port: port
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
server.mount_proc "/" do |request, response|
|
|
80
|
+
WEBrick::HTTPServlet::FileHandler.new(server, File.expand_path("_yardoc", __dir__)).service(request, response)
|
|
81
|
+
response["Cache-Control"] = "no-store"
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
watcher = Thread.new do
|
|
85
|
+
snapshot = docs_watch_snapshot
|
|
86
|
+
|
|
87
|
+
loop do
|
|
88
|
+
sleep 1
|
|
89
|
+
current_snapshot = docs_watch_snapshot
|
|
90
|
+
next if current_snapshot == snapshot
|
|
91
|
+
|
|
92
|
+
snapshot = current_snapshot
|
|
93
|
+
puts "Documentation changed; rebuilding _yardoc/. Refresh your browser when it finishes."
|
|
94
|
+
rebuild_docs
|
|
95
|
+
puts "Documentation rebuilt."
|
|
96
|
+
rescue StandardError => error
|
|
97
|
+
warn "Documentation rebuild failed: #{error.class}: #{error.message}"
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
trap("INT") { server.shutdown }
|
|
102
|
+
trap("TERM") { server.shutdown }
|
|
103
|
+
|
|
104
|
+
puts "Serving documentation at http://localhost:#{port}/"
|
|
105
|
+
puts "Watching documentation sources for changes. Refresh your browser after rebuilds."
|
|
106
|
+
server.start
|
|
107
|
+
ensure
|
|
108
|
+
watcher&.kill
|
|
109
|
+
end
|
|
110
|
+
|
|
29
111
|
desc "Build the YARD documentation site"
|
|
30
112
|
task build: :yard do
|
|
113
|
+
rewrite_yard_markdown_links
|
|
31
114
|
FileUtils.touch("_yardoc/.nojekyll")
|
|
32
115
|
end
|
|
116
|
+
|
|
117
|
+
desc "Check generated documentation links and images"
|
|
118
|
+
task check: :build do
|
|
119
|
+
options = {
|
|
120
|
+
checks: ["Images", "Links", "Scripts"],
|
|
121
|
+
allow_missing_href: true,
|
|
122
|
+
disable_external: ENV["DOCS_CHECK_EXTERNAL"] != "1",
|
|
123
|
+
enforce_https: false,
|
|
124
|
+
ignore_urls: [/^$/]
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
HTMLProofer.check_directory("_yardoc", options).run
|
|
128
|
+
end
|
|
33
129
|
end
|
data/doc/agent-tools.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Agent tools
|
|
2
|
+
|
|
3
|
+
Agent tools are the model-callable operations Kward uses to inspect projects, change files, run commands, search outside sources, and ask for clarification. Most users do not call these tools directly. You ask for an outcome in natural language, and Kward decides which tools are needed.
|
|
4
|
+
|
|
5
|
+
Tools are part of Kward's safety and context-management boundary:
|
|
6
|
+
|
|
7
|
+
- schemas describe what the model is allowed to call,
|
|
8
|
+
- Ruby tool objects validate and execute those calls,
|
|
9
|
+
- workspace tools stay inside the active workspace by default (see [Configuration](configuration.md) for the guardrail setting),
|
|
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
|
+
- large outputs are bounded or compacted before they enter model context,
|
|
13
|
+
- full tool outputs are kept in the session record for later inspection.
|
|
14
|
+
|
|
15
|
+
## Tool categories
|
|
16
|
+
|
|
17
|
+
| Category | Tools | Guide |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| Workspace tools | `list_directory`, `read_file`, `context_for_task`, `context_budget_stats`, `summarize_file_structure`, `write_file`, `edit_file`, `run_shell_command` | [Workspace tools](workspace-tools.md) |
|
|
20
|
+
| Web tools | `web_search`, `fetch_content`, `fetch_raw` | [Web search](web-search.md) |
|
|
21
|
+
| Code search | `code_search` | [Code search](code-search.md) |
|
|
22
|
+
| Context and interaction tools | `read_skill`, `retrieve_tool_output`, `ask_user_question` | [Context tools](context-tools.md) |
|
|
23
|
+
|
|
24
|
+
## How tools save tokens
|
|
25
|
+
|
|
26
|
+
Kward tries to keep tool context useful without flooding the model. The built-in prompt tells Kward to start with focused context tools and escalate from outlines/previews to exact ranges before full-file reads:
|
|
27
|
+
|
|
28
|
+
- `read_file` reads bounded line ranges, supports continuation with `offset` and `limit`, and accepts explicit `preview`, `outline`, `range`, and `full` modes with optional per-call byte budgets.
|
|
29
|
+
- `context_for_task` builds a task-shaped bundle from ranked files, outlines, and matching excerpts within a caller-supplied byte budget.
|
|
30
|
+
- `context_budget_stats` reports approximate active-conversation bytes and estimated tokens saved by compaction and duplicate output replacement.
|
|
31
|
+
- `summarize_file_structure` returns a compact outline for large source files before reading all code.
|
|
32
|
+
- Search, fetch, and shell outputs are capped or compacted before model ingestion.
|
|
33
|
+
- Repeated identical tool output is replaced with a short reference instead of being sent again.
|
|
34
|
+
- Compacted outputs are stored as artifacts that can be reopened with `retrieve_tool_output`, including after resuming a saved session that contains the original tool execution record.
|
|
35
|
+
|
|
36
|
+
When a tool output exceeds 12 KB, Kward compacts it before sending it to the model. The compactor preserves the first 40 and last 40 lines, keeps lines matching error, test, or search-result patterns with 2 lines of surrounding context, and replaces omitted sections with `[... omitted lines ...]` markers. Shell command output is section-aware: STDOUT and STDERR sections are compacted separately. Compacted outputs include a header with the original and compacted byte counts and the artifact ID for retrieval. Error outputs under 8 KB are left intact so failure details stay visible.
|
|
37
|
+
|
|
38
|
+
This lets the assistant reason from focused evidence while preserving access to original outputs when needed. For a fuller overview of Kward's context budgeting and token-saving work, see [Context budgeting](context-budgeting.md).
|
|
39
|
+
|
|
40
|
+
## How tools are exposed
|
|
41
|
+
|
|
42
|
+
`Kward::ToolRegistry` builds the available tool objects and the schemas advertised to the model. Some tools are always available in normal CLI/RPC sessions, while others depend on configuration or frontend capability:
|
|
43
|
+
|
|
44
|
+
- web tools can be hidden with web search configuration,
|
|
45
|
+
- `read_skill` is advertised only when skills are available,
|
|
46
|
+
- `ask_user_question` is advertised only when the frontend can display structured questions.
|
|
47
|
+
|
|
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
|
+
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
|
+
|
|
52
|
+
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
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# API reference
|
|
2
|
+
|
|
3
|
+
Kward's generated Ruby API documentation is mainly for contributors, plugin authors, tool authors, and people building RPC or editor integrations.
|
|
4
|
+
|
|
5
|
+
If you use Kward from the terminal, start with the [user guides](file.README.html#Documentation) instead. The API reference exposes many internal classes because it is generated from the source tree; not every documented class is a stable extension API.
|
|
6
|
+
|
|
7
|
+
## Start here
|
|
8
|
+
|
|
9
|
+
- [Classes and modules](class_list.html): searchable index of generated Ruby constants.
|
|
10
|
+
- [Methods](method_list.html): searchable index of generated Ruby methods.
|
|
11
|
+
- [Files](file_list.html): generated file index.
|
|
12
|
+
- [Top-level Kward namespace](Kward.html): root namespace for the generated reference.
|
|
13
|
+
|
|
14
|
+
## Start by role
|
|
15
|
+
|
|
16
|
+
### Plugin authors
|
|
17
|
+
|
|
18
|
+
Use plugins when you need trusted local Ruby code for slash commands, prompt context, footer UI, transcript events, or RPC-visible commands.
|
|
19
|
+
|
|
20
|
+
Read first:
|
|
21
|
+
|
|
22
|
+
- [Plugins](plugins.md)
|
|
23
|
+
- [Extensibility](extensibility.md)
|
|
24
|
+
|
|
25
|
+
Generated entry points:
|
|
26
|
+
|
|
27
|
+
- [`Kward.plugin`](Kward.html#plugin-class_method)
|
|
28
|
+
- [`Kward::PluginRegistry`](Kward/PluginRegistry.html)
|
|
29
|
+
- [`Kward::PluginRegistry::DSL`](Kward/PluginRegistry/DSL.html)
|
|
30
|
+
- [`Kward::PluginRegistry::Context`](Kward/PluginRegistry/Context.html)
|
|
31
|
+
|
|
32
|
+
### Tool authors and contributors
|
|
33
|
+
|
|
34
|
+
Built-in tools are Ruby classes registered with Kward's tool registry. They expose schemas to the model and execute bounded local operations.
|
|
35
|
+
|
|
36
|
+
Read first:
|
|
37
|
+
|
|
38
|
+
- [Usage](usage.md#Workspace_tools)
|
|
39
|
+
- [Web search](web-search.md)
|
|
40
|
+
- [Code search](code-search.md)
|
|
41
|
+
|
|
42
|
+
Generated entry points:
|
|
43
|
+
|
|
44
|
+
- [`Kward::Tools`](Kward/Tools.html)
|
|
45
|
+
- [`Kward::Tools::Base`](Kward/Tools/Base.html)
|
|
46
|
+
- [`Kward::ToolRegistry`](Kward/ToolRegistry.html)
|
|
47
|
+
|
|
48
|
+
### RPC and frontend authors
|
|
49
|
+
|
|
50
|
+
The RPC protocol is the supported integration surface for UI clients. Prefer the protocol guide before reading implementation classes.
|
|
51
|
+
|
|
52
|
+
Read first:
|
|
53
|
+
|
|
54
|
+
- [RPC protocol](rpc.md)
|
|
55
|
+
|
|
56
|
+
Generated entry points:
|
|
57
|
+
|
|
58
|
+
- [`Kward::RPC`](Kward/RPC.html)
|
|
59
|
+
- [`Kward::RPC::Server`](Kward/RPC/Server.html)
|
|
60
|
+
- [`Kward::RPC::SessionManager`](Kward/RPC/SessionManager.html)
|
|
61
|
+
- [`Kward::RPC::ToolEventNormalizer`](Kward/RPC/ToolEventNormalizer.html)
|
|
62
|
+
|
|
63
|
+
### Prompt, skill, and configuration contributors
|
|
64
|
+
|
|
65
|
+
Prompt templates, skills, personas, and project instructions are user-facing extension points. Prefer the guides for supported behavior, then use the API reference to inspect implementation details.
|
|
66
|
+
|
|
67
|
+
Read first:
|
|
68
|
+
|
|
69
|
+
- [Extensibility](extensibility.md)
|
|
70
|
+
- [Personas](personas.md)
|
|
71
|
+
- [Configuration](configuration.md)
|
|
72
|
+
|
|
73
|
+
Generated entry points:
|
|
74
|
+
|
|
75
|
+
- [`Kward::Prompts`](Kward/Prompts.html)
|
|
76
|
+
- [`Kward::Prompts::Templates`](Kward/Prompts/Templates.html)
|
|
77
|
+
- [`Kward::Skills`](Kward/Skills.html)
|
|
78
|
+
- [`Kward::Skills::Registry`](Kward/Skills/Registry.html)
|
|
79
|
+
- [`Kward::ConfigFiles`](Kward/ConfigFiles.html)
|
|
80
|
+
|
|
81
|
+
## Public API expectations
|
|
82
|
+
|
|
83
|
+
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.
|
|
84
|
+
|
|
85
|
+
Prefer the documented guides for supported extension behavior. Use generated class and method pages when you need implementation detail, are contributing to Kward itself, or are coordinating a frontend integration with the current codebase.
|
|
86
|
+
|
|
87
|
+
As a rule of thumb:
|
|
88
|
+
|
|
89
|
+
- Guide-documented behavior is the supported user-facing surface.
|
|
90
|
+
- Plugin DSL methods are intended extension points.
|
|
91
|
+
- RPC JSON-RPC methods documented in [RPC protocol](rpc.md) are the integration contract for frontend clients.
|
|
92
|
+
- Generated classes without guide coverage may be internal implementation details.
|