kward 0.79.0 → 0.80.1
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 +6 -0
- data/CHANGELOG.md +65 -1
- data/Gemfile.lock +2 -2
- data/README.md +31 -38
- data/doc/agent-tools.md +9 -10
- data/doc/api.md +3 -3
- data/doc/authentication.md +79 -110
- data/doc/code-search.md +1 -1
- data/doc/composer.md +1 -1
- data/doc/configuration.md +69 -26
- data/doc/context-budgeting.md +6 -6
- data/doc/context-tools.md +2 -2
- data/doc/editor.md +7 -7
- data/doc/extensibility.md +7 -29
- data/doc/files.md +6 -6
- data/doc/getting-started.md +2 -2
- data/doc/git.md +8 -2
- data/doc/lifecycle-hooks.md +5 -4
- data/doc/local-models.md +2 -2
- data/doc/mcp.md +5 -5
- data/doc/permissions.md +13 -4
- data/doc/plugins.md +39 -4
- data/doc/prompt-templates.md +105 -0
- data/doc/providers.md +140 -0
- data/doc/releasing.md +10 -2
- data/doc/rpc.md +54 -31
- data/doc/sandboxing.md +22 -0
- data/doc/security.md +22 -7
- data/doc/session-management.md +2 -4
- data/doc/skills.md +2 -0
- data/doc/tabs.md +37 -0
- data/doc/telegram.md +138 -0
- data/doc/transports.md +209 -0
- data/doc/usage.md +11 -3
- data/doc/web-search.md +3 -3
- data/doc/workspace-tools.md +2 -2
- data/examples/plugins/stardate_footer.rb +10 -0
- data/examples/plugins/telegram/plugin.rb +39 -0
- data/examples/plugins/telegram/telegram_api.rb +136 -0
- data/examples/plugins/telegram/telegram_transport.rb +304 -0
- data/lib/kward/agent.rb +11 -6
- data/lib/kward/ansi.rb +1 -0
- data/lib/kward/auth/api_key_store.rb +99 -0
- data/lib/kward/cli/auth_commands.rb +72 -13
- data/lib/kward/cli/commands.rb +7 -0
- data/lib/kward/cli/git.rb +31 -8
- data/lib/kward/cli/memory_commands.rb +2 -2
- data/lib/kward/cli/plugins.rb +1 -0
- data/lib/kward/cli/prompt_interface.rb +44 -1
- data/lib/kward/cli/rendering.rb +6 -2
- data/lib/kward/cli/runtime_helpers.rb +5 -2
- data/lib/kward/cli/sessions.rb +1 -1
- data/lib/kward/cli/settings.rb +97 -33
- data/lib/kward/cli/slash_commands.rb +1 -1
- data/lib/kward/cli/tabs.rb +103 -37
- data/lib/kward/cli/transports.rb +67 -0
- data/lib/kward/cli/worktrees.rb +360 -0
- data/lib/kward/cli.rb +22 -0
- data/lib/kward/compactor.rb +7 -2
- data/lib/kward/config_files.rb +51 -12
- data/lib/kward/conversation.rb +13 -7
- data/lib/kward/git_worktree_manager.rb +291 -0
- data/lib/kward/hooks/audit_log.rb +5 -2
- data/lib/kward/model/azure_openai_config.rb +54 -0
- data/lib/kward/model/catalog.rb +113 -0
- data/lib/kward/model/client.rb +225 -20
- data/lib/kward/model/model_info.rb +49 -0
- data/lib/kward/model/payloads.rb +63 -4
- data/lib/kward/model/provider_catalog.rb +114 -0
- data/lib/kward/model/sources.rb +70 -0
- data/lib/kward/model/stream_parser.rb +83 -13
- data/lib/kward/permissions/policy.rb +18 -4
- data/lib/kward/plugin_chat_runtime.rb +374 -0
- data/lib/kward/plugin_registry.rb +99 -19
- data/lib/kward/private_file.rb +9 -3
- data/lib/kward/prompt_interface/approval_prompt.rb +2 -0
- data/lib/kward/prompt_interface/composer_renderer.rb +1 -5
- data/lib/kward/prompt_interface/editor/auto_indent.rb +46 -0
- data/lib/kward/prompt_interface/editor/buffer.rb +18 -4
- data/lib/kward/prompt_interface/editor/controller.rb +7 -7
- data/lib/kward/prompt_interface/editor/modes/vibe.rb +2 -2
- data/lib/kward/prompt_interface/editor/renderer.rb +8 -8
- data/lib/kward/prompt_interface/editor/state.rb +3 -9
- data/lib/kward/prompt_interface/editor/syntax_highlighter.rb +219 -19
- data/lib/kward/prompt_interface/file_overlay.rb +2 -2
- data/lib/kward/prompt_interface/git_prompt.rb +7 -3
- data/lib/kward/prompt_interface/interactive/controller.rb +4 -4
- data/lib/kward/prompt_interface/interactive/renderer.rb +4 -1
- data/lib/kward/prompt_interface/interactive/state.rb +2 -2
- data/lib/kward/prompt_interface/project_browser.rb +25 -6
- data/lib/kward/prompt_interface/runtime_state.rb +22 -6
- data/lib/kward/prompt_interface/screen.rb +3 -0
- data/lib/kward/prompt_interface/selection_prompt.rb +7 -1
- data/lib/kward/prompt_interface/transcript_buffer.rb +24 -2
- data/lib/kward/prompt_interface.rb +53 -12
- data/lib/kward/prompts/commands.rb +1 -1
- data/lib/kward/prompts/templates.rb +11 -6
- data/lib/kward/prompts.rb +6 -5
- data/lib/kward/rpc/auth_manager.rb +112 -152
- data/lib/kward/rpc/config_manager.rb +46 -6
- data/lib/kward/rpc/plugin_chat_manager.rb +55 -196
- data/lib/kward/rpc/prompt_bridge.rb +8 -4
- data/lib/kward/rpc/redactor.rb +1 -1
- data/lib/kward/rpc/server.rb +60 -10
- data/lib/kward/rpc/session_manager.rb +109 -30
- data/lib/kward/session_store.rb +84 -24
- data/lib/kward/skills/registry.rb +16 -11
- data/lib/kward/tab_driver.rb +6 -3
- data/lib/kward/telemetry/logger.rb +5 -2
- data/lib/kward/tools/git_commit.rb +39 -0
- data/lib/kward/tools/registry.rb +7 -2
- data/lib/kward/tools/tool_call.rb +1 -0
- data/lib/kward/transport/gateway.rb +253 -0
- data/lib/kward/transport/host.rb +343 -0
- data/lib/kward/transport/manager.rb +179 -0
- data/lib/kward/transport/plugin_chat_gateway.rb +186 -0
- data/lib/kward/transport/runtime.rb +41 -0
- data/lib/kward/transport/store.rb +101 -0
- data/lib/kward/transport.rb +204 -0
- data/lib/kward/version.rb +1 -1
- data/lib/kward/workspace_factory.rb +19 -2
- data/templates/default/fulldoc/html/js/kward.js +2 -0
- data/templates/default/kward_navigation.rb +7 -2
- data/templates/default/layout/html/setup.rb +4 -0
- metadata +26 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dceefb01256daa642d6fe1d06d2e332cac1154c93072524b4aa5e98779a26807
|
|
4
|
+
data.tar.gz: cc8b3c0f226c0b58ea5704a613f84a39d93c5da3ae4d4b9769c891aad2d704d0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4e433643946a04c43fc833edb1a7a550d4333a4184e5c68e5a54b8ab8f24317821587176fc85337a5682fee8caa87cc0f404cf2717490338fc3d9f4988c6e3c4
|
|
7
|
+
data.tar.gz: 3ea451ab6978d7e726270de4d0e6bc14e1c5a5b6792bb00de551cc137d0e1875579da03437eb2687d8e1d8d93e099ba87a1bfd42fdd18070ddf215fc7ad88ed7
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -30,6 +30,12 @@ jobs:
|
|
|
30
30
|
- name: Install sandbox test dependency
|
|
31
31
|
run: sudo apt-get update && sudo apt-get install --yes bubblewrap
|
|
32
32
|
|
|
33
|
+
- name: Enable Bubblewrap namespaces
|
|
34
|
+
run: |
|
|
35
|
+
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
|
|
36
|
+
sudo sysctl -w kernel.unprivileged_userns_clone=1
|
|
37
|
+
bwrap --ro-bind / / --unshare-net true
|
|
38
|
+
|
|
33
39
|
- name: Check syntax
|
|
34
40
|
run: find lib test -name '*.rb' -print0 | xargs -0 ruby -c
|
|
35
41
|
|
data/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,71 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to Kward will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [
|
|
5
|
+
## [0.80.1] - 2026-07-27
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Avoided repeated full-buffer syntax scans while rendering generic-language editor lines, keeping Python and other supported languages responsive during cursor movement.
|
|
10
|
+
- Routed interactive configuration, plugin, skill, compaction, memory, and logging warnings through synchronized `Runtime>` output so diagnostics cannot corrupt the terminal layout.
|
|
11
|
+
|
|
12
|
+
## [0.80.0] - 2026-07-27
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- Added HTML/Ruby syntax highlighting and common-block auto-indentation for `.erb` files in the integrated editor.
|
|
17
|
+
- Added catalog-based API-key login and model selection for OpenAI, Anthropic, Azure OpenAI, Gemini, Cerebras, DeepSeek, Fireworks AI, Groq, Mistral, NVIDIA NIM, OpenRouter, Together AI, and xAI, with private credential storage and live/cached/curated model catalogs.
|
|
18
|
+
- Added native streaming runtimes for the OpenAI Responses API, Google Gemini, and Azure OpenAI, including tool calls, usage metadata, retries, cancellation, and secret redaction.
|
|
19
|
+
- Added RPC parity for provider/auth-method discovery, sanitized credential status, API-key login/logout, model refresh, and provider/model selection.
|
|
20
|
+
- Added a dedicated model-provider guide with the canonical provider list, runtime IDs, authentication, model configuration, discovery behavior, and limitations.
|
|
21
|
+
- Added a prompt-template guide, including template creation, slash-command expansion, and the starter templates installed by `kward init`.
|
|
22
|
+
- Added a Stardate footer plugin example for the interactive CLI.
|
|
23
|
+
- Added a general transport plugin API with normalized messages and events, persistent transport state, policy checks, managed lifecycle, foreground CLI commands, and RPC capability/status reporting.
|
|
24
|
+
- Added a first-party Telegram long-polling transport example with fixed-workspace routing, numeric allowlists, idempotent updates, message chunking, and interactive approval/question buttons.
|
|
25
|
+
- Added packaged plugin entrypoints under `~/.kward/plugins/*/plugin.rb` for multi-file trusted plugins.
|
|
26
|
+
- Added generic transport execution profiles and an isolated Telegram chat transport with no tools, plugin commands, memory, attachments, or interactions.
|
|
27
|
+
- Added a shared scoped plugin-chat runtime and `Transport::Host#plugin_chats` for explicitly transport-capable plugin chats, including actor context, event replay, cancellation, and separate transport/RPC access.
|
|
28
|
+
- Added transport-only plugin chats with `local: false`, keeping externally targeted plugin chats out of local tab opening and restoration.
|
|
29
|
+
- Added Git worktree bindings for normal interactive session tabs. `/tab worktree` can move a tab into a strict linked-worktree workspace after research, preserve its transcript, warn about dirty origin changes, and keep the branch available when explicitly detached.
|
|
30
|
+
- Added the active worktree `git_commit` model tool, allowing explicitly requested agent commits through the trusted host-side Git workflow without widening the shell sandbox.
|
|
31
|
+
- Added `/tab worktree merge` for explicitly merging a clean worktree branch into the branch checked out in its original workspace, plus `/tab worktree merge abort` for conflicted merges.
|
|
32
|
+
- Added `j`/`k` keyboard navigation to the `/files` project browser.
|
|
33
|
+
- Added `h`/`l` keyboard navigation for collapsing and expanding `/files` directories.
|
|
34
|
+
- Added `j`/`k` keyboard navigation to the `/git` changed-file overlay.
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- Avoided copying bounded transcript buffers into idle tab snapshots while preserving intentional full-conversation scrollback replay when those tabs are revisited.
|
|
39
|
+
- Kept the TUI transcript buffer under its existing limit while trimming to a safe low watermark instead of copying the full buffer after every appended character.
|
|
40
|
+
- Reduced integrated-editor layout work by caching line starts and calculating the cursor line once per rendered frame.
|
|
41
|
+
- Limited interactive plugin footer evaluation to its authoritative one-second refresh interval and reused the cached value between refreshes.
|
|
42
|
+
- Made interactive plugin canvases publish only complete frames submitted with `ui.render`, skip unpublished ticks, and follow terminal width changes.
|
|
43
|
+
- Avoided rebuilding and flushing the TUI composer when tab labels and selection have not changed.
|
|
44
|
+
- Reduced interactive streaming overhead by writing each labeled TUI delta in one synchronized prompt transaction.
|
|
45
|
+
- Highlighted the current editor line number in white while keeping the rest of the line-number gutter green.
|
|
46
|
+
- Made `/model` provider-aware with refresh, manual model IDs, capability-filtered defaults, Show all, and provider switching while preserving Codex, Copilot, OpenRouter, and local models.
|
|
47
|
+
- Kept direct OpenAI API credentials (`openai_api`) separate from ChatGPT/Codex OAuth so both can be configured at once.
|
|
48
|
+
- Azure OpenAI setup now validates HTTPS endpoints, deployment names, and API versions, and treats the configured deployment as the selectable model.
|
|
49
|
+
- Updated current documentation to describe Copilot and the JSON-RPC backend as supported features rather than experimental ones.
|
|
50
|
+
- Clarified the distinct roles of workspace guardrails, tool permissions, and command sandboxing.
|
|
51
|
+
- Reorganized the README documentation index and clarified generated Ruby API support boundaries.
|
|
52
|
+
- Added task-oriented navigation to the RPC and configuration references.
|
|
53
|
+
- Standardized MCP support and limitation wording across the user and RPC guides.
|
|
54
|
+
- Reframed the README introduction around Kward as an Agentic Development Environment (ADE) with opt-in safety controls.
|
|
55
|
+
- Moved the local-model setup guide to the generated documentation Integrate navigation.
|
|
56
|
+
- Added the Telegram transport deployment guide to the generated documentation navigation.
|
|
57
|
+
- Replaced implicit `/tab worktree` detachment with explicit `/tab worktree detach`; running `/tab worktree` again now leaves an active worktree enabled.
|
|
58
|
+
- Added workspace overrides for foreground transports via `kward transport run NAME WORKSPACE` and the global `--working-directory` option.
|
|
59
|
+
- The `/files` project-browser now uses full terminal height if there are enough files to fill that space
|
|
60
|
+
|
|
61
|
+
### Fixed
|
|
62
|
+
|
|
63
|
+
- Prevented a stopped tab live-view thread from resuming against a newly active tab after a slow render.
|
|
64
|
+
- Kept `@`/`$` completion, `/files`, prompt history, and the integrated editor rooted in the active worktree tab instead of the original checkout.
|
|
65
|
+
- Fixed HTML and ERB editor highlighting so tag names, attributes, values, and tag fragments retain consistent colors across embedded Ruby expressions.
|
|
66
|
+
- Refreshed composer diff and context usage status immediately when switching session tabs.
|
|
67
|
+
- Prevented `/reload` from retaining stale prompt templates, so new and edited prompt files refresh slash-command completion and expansion.
|
|
68
|
+
- Prevented session-picker rename input from filtering the visible session list.
|
|
69
|
+
- Fixed session listing timestamps and ordering to ignore system-prompt and other metadata writes during session restoration.
|
|
6
70
|
|
|
7
71
|
## [0.79.0] - 2026-07-19
|
|
8
72
|
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
kward (0.
|
|
4
|
+
kward (0.80.1)
|
|
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.80.1)
|
|
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
|
@@ -1,29 +1,16 @@
|
|
|
1
1
|
# Kward
|
|
2
2
|
|
|
3
|
-
Kward is
|
|
3
|
+
Kward is a coding agent for your terminal. It can inspect and edit a project, run commands, research problems, and save your work in sessions you can resume later.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Use Kward from the terminal, its local browser interface, or a trusted JSON-RPC client. It works with ChatGPT/Codex and Claude subscriptions, hosted model APIs, GitHub Copilot, OpenRouter, and local servers such as Ollama, LM Studio, and llama.cpp.
|
|
6
6
|
|
|
7
|
-
## Why
|
|
7
|
+
## Why Kward?
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Software work rarely fits into one chat. A project can span days of research, implementation, debugging, review, and decisions worth keeping.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Kward treats that work as an ongoing workspace rather than a disposable conversation. You can resume earlier sessions, split work across tabs and Git worktrees, and keep project guidance close to the code. Optional permissions, command sandboxing, and workspace boundaries give you more control when a task needs it.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
- Investigating bugs
|
|
15
|
-
- Reviewing changes
|
|
16
|
-
- Refactoring code
|
|
17
|
-
- Automating repetitive development tasks
|
|
18
|
-
- Building custom agent workflows through plugins
|
|
19
|
-
|
|
20
|
-
Examples:
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
kward "Explain this project"
|
|
24
|
-
kward "Review this diff"
|
|
25
|
-
kward "Find performance problems in this codebase"
|
|
26
|
-
```
|
|
13
|
+
Start with a normal coding conversation. If your workflow grows, you can add memory, reusable prompts and skills, local plugins, lifecycle hooks, MCP servers, transports, or a custom RPC client.
|
|
27
14
|
|
|
28
15
|
## Install
|
|
29
16
|
|
|
@@ -52,57 +39,63 @@ kward "Explain this project" # run one prompt and exit
|
|
|
52
39
|
kward --working-directory ~/code/project "Explain this project"
|
|
53
40
|
```
|
|
54
41
|
|
|
55
|
-
From inside Kward, `/login`
|
|
42
|
+
From inside Kward, `/login` lets you choose API-key or subscription authentication across supported providers. `/model` then switches providers, refreshes model catalogs, or accepts a manual model/deployment ID. Direct OpenAI API credentials and ChatGPT/Codex OAuth can coexist.
|
|
56
43
|
|
|
57
|
-
See [Authentication](doc/authentication.md) for
|
|
44
|
+
See [Model providers](doc/providers.md) to choose a backend and [Authentication](doc/authentication.md) for credential storage and login flows.
|
|
58
45
|
|
|
59
|
-
##
|
|
46
|
+
## Common ways to use Kward
|
|
60
47
|
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
- Use optional memory, personas, prompt templates, and skills.
|
|
68
|
-
- Serve a JSON-RPC backend for trusted local UI clients.
|
|
48
|
+
- Explore an unfamiliar codebase and keep useful discoveries for later sessions.
|
|
49
|
+
- Investigate a bug, make a focused change, and run the related tests.
|
|
50
|
+
- Review a diff, inspect the surrounding code, and commit from the terminal UI.
|
|
51
|
+
- Work on several tasks at once with tabs, branches, and linked Git worktrees.
|
|
52
|
+
- Teach Kward your project conventions with `AGENTS.md`, skills, prompt templates, and optional memory.
|
|
53
|
+
- Add trusted local behavior through plugins, lifecycle hooks, MCP servers, transports, or JSON-RPC integrations.
|
|
69
54
|
|
|
70
55
|
## Documentation
|
|
71
56
|
|
|
72
|
-
|
|
57
|
+
New to Kward:
|
|
73
58
|
|
|
74
59
|
- [Getting started](doc/getting-started.md): first run, authentication choices, and basic commands.
|
|
75
60
|
- [Usage](doc/usage.md): interactive chat, slash commands, sessions, tools, images, and Pan mode.
|
|
76
61
|
- [Configuration](doc/configuration.md): config files, providers, models, web search, logging, and color output.
|
|
77
|
-
- [Authentication](doc/authentication.md):
|
|
62
|
+
- [Authentication](doc/authentication.md): multi-provider API keys, OpenAI/Anthropic subscription OAuth, Azure setup, and credential safety.
|
|
63
|
+
- [Model providers](doc/providers.md): compare providers and find their runtime IDs, model keys, environment variables, discovery behavior, and limitations.
|
|
64
|
+
|
|
65
|
+
Work safely:
|
|
66
|
+
|
|
78
67
|
- [Security and trust](doc/security.md): local permissions, external data flow, trusted extensions, and safe work in unfamiliar repositories.
|
|
79
68
|
- [Permissions](doc/permissions.md): opt-in tool approval, write scopes, policy rules, and current limits.
|
|
80
69
|
- [Command sandboxing](doc/sandboxing.md): opt-in OS-enforced boundaries for model-requested shell commands.
|
|
81
70
|
- [Troubleshooting](doc/troubleshooting.md): environment-specific install and runtime issues.
|
|
82
71
|
|
|
83
|
-
|
|
72
|
+
Everyday workflows:
|
|
84
73
|
|
|
85
74
|
- [Sessions](doc/session-management.md): resume, clone, fork, rewind, compact, and navigate saved work.
|
|
86
75
|
- [Interactive composer](doc/composer.md): use multiline input, completion, history, files, reasoning shortcuts, busy input, and images.
|
|
87
76
|
- [Tabs](doc/tabs.md): keep several conversations open and run work in another tab.
|
|
88
77
|
- [Project files](doc/files.md): browse, search, mention, open, and edit workspace files.
|
|
89
|
-
- [Integrated
|
|
78
|
+
- [Integrated editor](doc/editor.md): open files from the shell or composer, edit in-place, and choose editor keybindings.
|
|
90
79
|
- [Git](doc/git.md): review changes, use the diff viewer, stage files, and commit from the interactive TUI.
|
|
91
80
|
- [Shell](doc/shell.md): use `/shell`, the embedded Kward shell with aliases, completion, and per-tab state.
|
|
92
81
|
- [Memory](doc/memory.md): opt-in core, soft, and session memory.
|
|
93
82
|
- [Personas](doc/personas.md): configure Kward's tone and role by default, workspace, model, reasoning effort, time, and weekday.
|
|
94
83
|
- [Skills](doc/skills.md): add reusable instructions that load only for matching tasks.
|
|
84
|
+
- [Prompt templates](doc/prompt-templates.md): create reusable slash prompts and use the starter templates installed by `kward init`.
|
|
95
85
|
- [MCP servers](doc/mcp.md): connect trusted local Model Context Protocol tool servers.
|
|
96
86
|
- [Pan mode](doc/pan.md): use the mobile-friendly browser interface on a trusted local network.
|
|
97
87
|
- [Local models](doc/local-models.md): connect Ollama, LM Studio, or llama.cpp and use a minimal replacement prompt.
|
|
98
88
|
|
|
99
|
-
|
|
89
|
+
Extend and integrate:
|
|
100
90
|
|
|
101
|
-
- [Extensibility](doc/extensibility.md): `PRINCIPLES.md`, workspace `AGENTS.md`, skills, prompt templates, and extension
|
|
91
|
+
- [Extensibility](doc/extensibility.md): choose between `PRINCIPLES.md`, workspace `AGENTS.md`, skills, prompt templates, and other extension points.
|
|
102
92
|
- [Plugins](doc/plugins.md): trusted Ruby plugins for commands, footer UI, prompt context, transcript events, and RPC clients.
|
|
103
93
|
- [Lifecycle hooks](doc/lifecycle-hooks.md): deterministic runtime hooks for policy, approvals, automation, and command-hook integrations.
|
|
104
94
|
- [RPC protocol](doc/rpc.md): JSON-RPC backend mode for trusted local UI clients.
|
|
105
95
|
- [Releasing](doc/releasing.md): release checklist for RubyGems publishing.
|
|
96
|
+
|
|
97
|
+
Reference guides:
|
|
98
|
+
|
|
106
99
|
- [Agent tools](doc/agent-tools.md): overview of model-callable tools, token-saving behavior, and tool categories.
|
|
107
100
|
- [Workspace tools](doc/workspace-tools.md): local file, edit, and shell command tools.
|
|
108
101
|
- [Context budgeting](doc/context-budgeting.md): focused context gathering, budgeted reads, output compaction, and token-saving history.
|
|
@@ -110,9 +103,9 @@ Advanced:
|
|
|
110
103
|
- [Code search](doc/code-search.md): package lookup, GitHub repository cache, and external source reading for the code search agent tool.
|
|
111
104
|
- [Context tools](doc/context-tools.md): skills, compacted output retrieval, and structured clarification questions.
|
|
112
105
|
|
|
113
|
-
API
|
|
106
|
+
Generated Ruby API:
|
|
114
107
|
|
|
115
|
-
- [API reference](doc/api.md): generated Ruby API entry points, indexes, and
|
|
108
|
+
- [API reference](doc/api.md): generated Ruby API entry points, indexes, and supported API expectations.
|
|
116
109
|
|
|
117
110
|
## Development
|
|
118
111
|
|
data/doc/agent-tools.md
CHANGED
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
|
|
3
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
4
|
|
|
5
|
-
Tools
|
|
5
|
+
Tools also enforce important boundaries:
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
- full tool outputs are kept in the session record for later inspection.
|
|
7
|
+
- Kward validates every tool call before running it.
|
|
8
|
+
- Workspace tools stay inside the active workspace by default (see [Configuration](configuration.md) for the guardrail setting).
|
|
9
|
+
- File-changing tools require the file to be read first.
|
|
10
|
+
- Large outputs are bounded or compacted before they enter model context.
|
|
11
|
+
- Full tool outputs remain available in the session record for later inspection.
|
|
13
12
|
|
|
14
13
|
## Tool categories
|
|
15
14
|
|
|
@@ -22,7 +21,7 @@ Tools are part of Kward's safety and context-management boundary:
|
|
|
22
21
|
|
|
23
22
|
## How tools save tokens
|
|
24
23
|
|
|
25
|
-
Kward tries to
|
|
24
|
+
Kward tries to gather enough evidence without flooding the conversation. It usually starts with focused context tools, then moves from outlines and previews to exact ranges or full files only when needed:
|
|
26
25
|
|
|
27
26
|
- `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.
|
|
28
27
|
- `context_for_task` builds a task-shaped bundle from ranked files, outlines, and matching excerpts within a caller-supplied byte budget.
|
|
@@ -32,9 +31,9 @@ Kward tries to keep tool context useful without flooding the model. The built-in
|
|
|
32
31
|
- Repeated identical tool output is replaced with a short reference instead of being sent again.
|
|
33
32
|
- 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.
|
|
34
33
|
|
|
35
|
-
When
|
|
34
|
+
When output exceeds 12 KB, Kward keeps the most useful sections in context and stores the original output for later retrieval. The compacted result includes an artifact ID, so Kward can reopen an exact section without repeating the tool call. Error output under 8 KB stays intact so useful failure details are not lost.
|
|
36
35
|
|
|
37
|
-
|
|
36
|
+
See [Context budgeting](context-budgeting.md) for the full compaction strategy, limits, and token-saving workflow.
|
|
38
37
|
|
|
39
38
|
## How tools are exposed
|
|
40
39
|
|
data/doc/api.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# API reference
|
|
2
2
|
|
|
3
|
-
Kward's generated Ruby API documentation is
|
|
3
|
+
Kward's generated Ruby API documentation is for contributors, plugin authors, tool authors, and people building RPC or editor integrations.
|
|
4
4
|
|
|
5
|
-
If you use Kward from the terminal, start with the [user guides](file.README.html#Documentation)
|
|
5
|
+
If you use Kward from the terminal, start with the [user guides](file.README.html#Documentation). This reference also includes internal classes and methods that may change. Treat the behavior described in the guides, the Plugin DSL, and the methods in the [RPC protocol](rpc.md) as Kward's supported public interfaces.
|
|
6
6
|
|
|
7
7
|
## Start here
|
|
8
8
|
|
|
@@ -84,7 +84,7 @@ The generated comments focus on these supported extension boundaries rather than
|
|
|
84
84
|
|
|
85
85
|
## Public API expectations
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
The generated reference is useful for understanding the codebase, but it does not make every class, method, or constructor a supported public API.
|
|
88
88
|
|
|
89
89
|
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.
|
|
90
90
|
|
data/doc/authentication.md
CHANGED
|
@@ -1,181 +1,150 @@
|
|
|
1
1
|
# Authentication
|
|
2
2
|
|
|
3
|
-
Kward
|
|
3
|
+
Kward can keep credentials for several model providers at once. First connect an account or API key, then use `/model` to choose the provider and model for your work. See [Model providers](providers.md) to compare providers and find their configuration names and environment variables.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
kward login
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
Or inside interactive Kward:
|
|
5
|
+
The easiest setup is inside interactive Kward:
|
|
10
6
|
|
|
11
7
|
```text
|
|
12
8
|
/login
|
|
13
9
|
```
|
|
14
10
|
|
|
15
|
-
|
|
11
|
+
Choose **API key** or **Subscription / OAuth**, then choose a provider. After login, open:
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
| Provider | Use it when... |
|
|
22
|
-
| --- | --- |
|
|
23
|
-
| OpenAI/ChatGPT | You want the default Codex backend with a ChatGPT account. |
|
|
24
|
-
| Anthropic | You have Claude Pro/Max and want to use Claude through Kward. |
|
|
25
|
-
| OpenRouter | You want to use an OpenRouter API key and choose from its model catalog. |
|
|
26
|
-
| Copilot | You want to try experimental Copilot provider support. |
|
|
13
|
+
```text
|
|
14
|
+
/model
|
|
15
|
+
```
|
|
27
16
|
|
|
28
|
-
|
|
17
|
+
## Supported authentication
|
|
29
18
|
|
|
30
|
-
|
|
19
|
+
| Provider | API key | Subscription / OAuth |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| OpenAI | Yes, direct OpenAI API | Yes, ChatGPT/Codex |
|
|
22
|
+
| Anthropic | Yes, direct Anthropic API | Yes, Claude Pro/Max |
|
|
23
|
+
| Azure OpenAI | Yes; endpoint, deployment, and API version are also required | No |
|
|
24
|
+
| Google Gemini | Yes | No |
|
|
25
|
+
| Cerebras, DeepSeek, Fireworks AI, Groq, Mistral, NVIDIA NIM, Together AI | Yes | No |
|
|
26
|
+
| OpenRouter | Yes | Not yet in Kward |
|
|
27
|
+
| xAI | Yes | No supported third-party flow |
|
|
28
|
+
| GitHub Copilot | No API-key mode | Yes |
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
kward login # OpenAI/ChatGPT OAuth
|
|
34
|
-
kward login anthropic # Anthropic Claude Pro/Max OAuth
|
|
35
|
-
kward login openrouter # OpenRouter API key
|
|
36
|
-
kward login github # GitHub OAuth for experimental Copilot support
|
|
37
|
-
```
|
|
30
|
+
Direct OpenAI API credentials and ChatGPT/Codex OAuth are independent. You can keep both and switch between **OpenAI** and **Codex** in `/model`.
|
|
38
31
|
|
|
39
|
-
##
|
|
32
|
+
## API-key workflow
|
|
40
33
|
|
|
41
|
-
|
|
42
|
-
kward login
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
This opens a browser login and saves credentials to:
|
|
34
|
+
From `/login`, choose **API key** and the provider. Kward validates providers with live model discovery before saving the key, then stores it in:
|
|
46
35
|
|
|
47
36
|
```text
|
|
48
|
-
~/.kward/
|
|
37
|
+
~/.kward/api_keys.json
|
|
49
38
|
```
|
|
50
39
|
|
|
51
|
-
|
|
40
|
+
The file is private (`0600` when supported). It is separate from `config.json`, so normal config reads and RPC responses do not return keys.
|
|
52
41
|
|
|
53
|
-
|
|
42
|
+
For providers that do not also offer subscription login, the shell command is convenient:
|
|
54
43
|
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
44
|
+
```bash
|
|
45
|
+
kward login groq
|
|
46
|
+
kward login gemini
|
|
47
|
+
kward login openrouter
|
|
48
|
+
kward login azure_openai
|
|
59
49
|
```
|
|
60
50
|
|
|
61
|
-
|
|
51
|
+
Use the interactive `/login` method picker for direct OpenAI or Anthropic API keys because `kward login openai` and `kward login anthropic` retain their subscription-login behavior.
|
|
62
52
|
|
|
63
|
-
|
|
53
|
+
Environment variables override a stored key for that provider:
|
|
64
54
|
|
|
65
55
|
```bash
|
|
66
|
-
|
|
56
|
+
OPENAI_API_KEY=... kward
|
|
57
|
+
GEMINI_API_KEY=... kward
|
|
58
|
+
GROQ_API_KEY=... kward
|
|
67
59
|
```
|
|
68
60
|
|
|
69
|
-
|
|
61
|
+
Other supported variables are listed in [Configuration](configuration.md#Environment_overrides).
|
|
70
62
|
|
|
71
|
-
|
|
72
|
-
kward login anthropic
|
|
73
|
-
```
|
|
63
|
+
### Azure OpenAI
|
|
74
64
|
|
|
75
|
-
|
|
65
|
+
Azure setup asks for three non-secret values after the key:
|
|
76
66
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
67
|
+
- an HTTPS endpoint, such as `https://example.openai.azure.com`;
|
|
68
|
+
- a deployment name;
|
|
69
|
+
- an API version, such as `2025-04-01-preview`.
|
|
80
70
|
|
|
81
|
-
|
|
71
|
+
Kward rejects endpoint credentials, query strings, fragments, and unsafe deployment/version characters. The deployment is the model shown in `/model`; Kward does not claim to discover Azure deployments from an inference key.
|
|
82
72
|
|
|
83
|
-
##
|
|
73
|
+
## ChatGPT / Codex OAuth
|
|
84
74
|
|
|
85
75
|
```bash
|
|
86
|
-
kward login
|
|
76
|
+
kward login
|
|
87
77
|
```
|
|
88
78
|
|
|
89
|
-
|
|
79
|
+
Credentials are saved to `~/.kward/auth.json`. This uses the ChatGPT/Codex backend, not `OPENAI_API_KEY` or the public OpenAI API endpoint.
|
|
90
80
|
|
|
91
|
-
For
|
|
81
|
+
For one shell session, you can provide the Codex access token directly:
|
|
92
82
|
|
|
93
83
|
```bash
|
|
94
|
-
|
|
84
|
+
OPENAI_ACCESS_TOKEN=... kward
|
|
95
85
|
```
|
|
96
86
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
### Refresh the OpenRouter model cache
|
|
87
|
+
`OPENAI_ACCESS_TOKEN` continues to mean Codex OAuth. `OPENAI_API_KEY` means direct OpenAI API access; neither replaces the other.
|
|
100
88
|
|
|
101
|
-
|
|
89
|
+
## Anthropic Claude Pro/Max
|
|
102
90
|
|
|
103
91
|
```bash
|
|
104
|
-
kward
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
This fetches text-capable OpenRouter models for the configured key and writes them to:
|
|
108
|
-
|
|
109
|
-
```text
|
|
110
|
-
~/.kward/cache/openrouter_models.json
|
|
92
|
+
kward login anthropic
|
|
111
93
|
```
|
|
112
94
|
|
|
113
|
-
|
|
95
|
+
OAuth credentials are saved to `~/.kward/anthropic_auth.json`. Kward refreshes the access token when a refresh token is available. Choose **API key** in `/login` instead when you want direct Anthropic API billing.
|
|
114
96
|
|
|
115
|
-
|
|
97
|
+
## GitHub Copilot
|
|
116
98
|
|
|
117
99
|
```bash
|
|
118
|
-
kward
|
|
100
|
+
kward login github
|
|
119
101
|
```
|
|
120
102
|
|
|
121
|
-
|
|
103
|
+
Credentials are saved to `~/.kward/github_auth.json`. For one run, use `COPILOT_GITHUB_TOKEN`. General `GH_TOKEN` and `GITHUB_TOKEN` values are not treated as Copilot credentials.
|
|
122
104
|
|
|
123
|
-
|
|
124
|
-
- OpenRouter added new models,
|
|
125
|
-
- your model picker does not show the model you expect,
|
|
126
|
-
- you want Kward to use current context-window metadata from OpenRouter.
|
|
127
|
-
|
|
128
|
-
After refreshing, start Kward and choose the model with `/model`.
|
|
105
|
+
## OpenRouter
|
|
129
106
|
|
|
130
|
-
|
|
107
|
+
API-key login is supported, including model refresh:
|
|
131
108
|
|
|
132
109
|
```bash
|
|
133
|
-
kward login
|
|
110
|
+
kward login openrouter
|
|
111
|
+
kward openrouter refresh
|
|
112
|
+
kward openrouter list
|
|
134
113
|
```
|
|
135
114
|
|
|
136
|
-
|
|
115
|
+
The cache lives at `<config-dir>/cache/openrouter_models.json`. `/model` can also refresh the active provider directly.
|
|
137
116
|
|
|
138
|
-
|
|
139
|
-
~/.kward/github_auth.json
|
|
140
|
-
```
|
|
117
|
+
OpenRouter documents an official [OAuth PKCE flow](https://openrouter.ai/docs/guides/overview/auth/oauth), but Kward does not implement that flow yet. It remains unavailable in CLI and RPC capabilities rather than exposing an unverified partial login.
|
|
141
118
|
|
|
142
|
-
|
|
119
|
+
xAI's public inference documentation currently directs clients to API keys (see the [xAI quickstart](https://docs.x.ai/developers/quickstart)); Kward does not expose an xAI subscription OAuth flow.
|
|
143
120
|
|
|
144
|
-
|
|
145
|
-
COPILOT_GITHUB_TOKEN=... kward
|
|
146
|
-
```
|
|
121
|
+
## Model selection
|
|
147
122
|
|
|
148
|
-
|
|
123
|
+
The provider-aware `/model` picker offers:
|
|
149
124
|
|
|
150
|
-
|
|
125
|
+
- **Refresh model list**;
|
|
126
|
+
- **Enter model ID manually**;
|
|
127
|
+
- **Show all models**;
|
|
128
|
+
- **Change provider**.
|
|
151
129
|
|
|
152
|
-
|
|
130
|
+
By default, Kward hides entries when provider metadata proves they are not generation/tool models. It keeps entries whose metadata is incomplete. **Show all models** and manual IDs remain available for previews, private deployments, and incomplete catalogs.
|
|
153
131
|
|
|
154
|
-
|
|
132
|
+
## Status and logout
|
|
155
133
|
|
|
156
|
-
```
|
|
157
|
-
|
|
134
|
+
```bash
|
|
135
|
+
kward auth status
|
|
136
|
+
kward auth logout
|
|
158
137
|
```
|
|
159
138
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
For one-off shell runs, `KWARD_PROVIDER` and provider-specific model environment variables remain available. See [Configuration](configuration.md) for the full list.
|
|
163
|
-
|
|
164
|
-
## Custom auth file locations
|
|
165
|
-
|
|
166
|
-
Each auth file has an environment variable override, useful for isolated or multi-account setups. When unset, they default to the paths shown above under `~/.kward/`.
|
|
139
|
+
Status reports only whether credentials exist and where they came from; it never prints credential values. CLI logout removes all saved OAuth and API-key credentials. Environment variables remain active until you unset them.
|
|
167
140
|
|
|
168
|
-
|
|
169
|
-
- `KWARD_ANTHROPIC_AUTH_PATH` — Anthropic OAuth credentials (`anthropic_auth.json`)
|
|
170
|
-
- `KWARD_GITHUB_AUTH_PATH` — GitHub OAuth credentials (`github_auth.json`)
|
|
141
|
+
RPC clients can list catalog providers, inspect sanitized method availability, save/remove individual API keys, and remove a specific provider/auth method. See [RPC](rpc.md#Config_and_auth_methods).
|
|
171
142
|
|
|
172
|
-
|
|
143
|
+
## Custom locations
|
|
173
144
|
|
|
174
|
-
|
|
145
|
+
- `KWARD_CONFIG_PATH` moves `config.json`, `api_keys.json`, caches, and most other Kward state to that file's directory.
|
|
146
|
+
- `KWARD_AUTH_PATH` overrides ChatGPT/Codex OAuth storage.
|
|
147
|
+
- `KWARD_ANTHROPIC_AUTH_PATH` overrides Anthropic OAuth storage.
|
|
148
|
+
- `KWARD_GITHUB_AUTH_PATH` overrides GitHub Copilot OAuth storage.
|
|
175
149
|
|
|
176
|
-
|
|
177
|
-
- Do not commit `~/.kward/config.json` or auth files.
|
|
178
|
-
- Prefer environment variables for temporary credentials.
|
|
179
|
-
- `kward auth status` shows credential status without printing secrets.
|
|
180
|
-
- `kward auth logout` removes **all** saved credentials at once: every OAuth file (OpenAI, Anthropic, GitHub) and the stored OpenRouter API key. There is no per-provider logout; to remove a single provider, delete its auth file by hand.
|
|
181
|
-
- `kward doctor` reports which credentials are currently configured alongside other local checks.
|
|
150
|
+
Never commit credential files. For temporary credentials, prefer environment variables and unset them when finished.
|
data/doc/code-search.md
CHANGED
|
@@ -29,7 +29,7 @@ The `code_search` tool can:
|
|
|
29
29
|
4. search cached files,
|
|
30
30
|
5. read bounded line ranges from cached files.
|
|
31
31
|
|
|
32
|
-
Kward
|
|
32
|
+
Kward uses code search when the best answer depends on how another project actually implemented something.
|
|
33
33
|
|
|
34
34
|
## Supported ecosystems
|
|
35
35
|
|
data/doc/composer.md
CHANGED
|
@@ -99,7 +99,7 @@ The `$` token must begin at the first character of the composer. Use Up/Down to
|
|
|
99
99
|
|
|
100
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
101
|
|
|
102
|
-
See [Integrated
|
|
102
|
+
See [Integrated editor](editor.md) for editing modes, save and quit keys, scratchpads, and conflict handling.
|
|
103
103
|
|
|
104
104
|
## Reuse prompt history
|
|
105
105
|
|