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
data/doc/plugins.md
CHANGED
|
@@ -21,16 +21,21 @@ Plugins run inside the Kward process with your user permissions. Install only pl
|
|
|
21
21
|
| Repository rules | `AGENTS.md` |
|
|
22
22
|
| Local Ruby code or integration | plugin |
|
|
23
23
|
|
|
24
|
-
See [Extensibility](extensibility.md) for the full overview of Kward's extension points and prompt assembly order.
|
|
24
|
+
See [Extensibility](extensibility.md) for the full overview of Kward's extension points and prompt assembly order. See [Transports](transports.md) for external messaging and event integrations.
|
|
25
25
|
|
|
26
26
|
## Where plugins live
|
|
27
27
|
|
|
28
|
-
Kward loads
|
|
28
|
+
Kward loads trusted Ruby plugin entrypoints from:
|
|
29
29
|
|
|
30
30
|
```text
|
|
31
31
|
~/.kward/plugins/*.rb
|
|
32
|
+
~/.kward/plugins/*/plugin.rb
|
|
32
33
|
```
|
|
33
34
|
|
|
35
|
+
For a larger plugin, use a directory with `plugin.rb` as its entry point. Kward
|
|
36
|
+
loads only that file automatically, so use `require_relative` there to load any
|
|
37
|
+
sibling files.
|
|
38
|
+
|
|
34
39
|
Plugins are not loaded from the current workspace or a custom `KWARD_CONFIG_PATH` directory. This prevents a project checkout from silently adding executable Ruby code to Kward.
|
|
35
40
|
|
|
36
41
|
## A first plugin
|
|
@@ -58,7 +63,7 @@ Start Kward and run:
|
|
|
58
63
|
/hello World
|
|
59
64
|
```
|
|
60
65
|
|
|
61
|
-
When developing plugins, use `/reload` inside Kward to reload all plugin files without restarting. This picks up changes to existing plugins and
|
|
66
|
+
When developing plugins or prompt templates, use `/reload` inside Kward to reload configured prompt files and all plugin files without restarting. This picks up prompt edits, changes to existing plugins, and new plugin registrations, then refreshes slash-command completion and rebuilds the system message.
|
|
62
67
|
|
|
63
68
|
## Add a slash command
|
|
64
69
|
|
|
@@ -111,7 +116,7 @@ Kward.plugin do |plugin|
|
|
|
111
116
|
end
|
|
112
117
|
```
|
|
113
118
|
|
|
114
|
-
Only one footer is active. If multiple plugins register footers, the later one replaces the earlier one and Kward prints a warning.
|
|
119
|
+
Only one footer is active. If multiple plugins register footers, the later one replaces the earlier one and Kward prints a warning. Kward evaluates the active footer at most once per second and reuses its last value between refreshes.
|
|
115
120
|
|
|
116
121
|
## Add an interactive command
|
|
117
122
|
|
|
@@ -132,6 +137,7 @@ Kward.plugin do |plugin|
|
|
|
132
137
|
x = (x + 1) % ui.width
|
|
133
138
|
key = ui.poll_key
|
|
134
139
|
return :exit if key == :ctrl_c || key == "q"
|
|
140
|
+
ui.render
|
|
135
141
|
end
|
|
136
142
|
end
|
|
137
143
|
end
|
|
@@ -162,6 +168,8 @@ Keys are returned as symbols (`:left`, `:right`, `:up`, `:down`, `:return`,
|
|
|
162
168
|
without a named mapping. Ctrl+C always exits the loop immediately.
|
|
163
169
|
|
|
164
170
|
The tick callback runs at the configured frame rate (1–120 fps, default 30).
|
|
171
|
+
Calls to `put` and `clear_frame` stage canvas changes; call `render` after the
|
|
172
|
+
frame is complete to publish it. Kward skips ticks that do not publish a frame.
|
|
165
173
|
Returning `:exit` from the tick callback ends the loop, same as calling
|
|
166
174
|
`ui.exit`.
|
|
167
175
|
|
|
@@ -219,6 +227,7 @@ The observer context exposes the plugin tab's `messages` through
|
|
|
219
227
|
- `messages` — renderable transcript messages;
|
|
220
228
|
- `submit(input, display_input:, cancellation:, steering:)` — a turn method
|
|
221
229
|
that returns the final response and yields stream events;
|
|
230
|
+
- optionally `submit(..., context:)` — trusted actor context for transport turns;
|
|
222
231
|
- `descriptor` — the durable tab descriptor;
|
|
223
232
|
- `supports_steering?` and `assistant_label`.
|
|
224
233
|
|
|
@@ -234,6 +243,32 @@ plugin.tab_type "example", id: "com.example.chat", rpc: true do |host, descripto
|
|
|
234
243
|
end
|
|
235
244
|
```
|
|
236
245
|
|
|
246
|
+
Set `transport: true` separately when an external transport may target the
|
|
247
|
+
plugin chat. Do not use `rpc: true` as an implicit external-access permission:
|
|
248
|
+
|
|
249
|
+
```ruby
|
|
250
|
+
plugin.tab_type "example", id: "com.example.chat", rpc: true, transport: true do |host, descriptor|
|
|
251
|
+
ExampleChat.new(client: host.client, descriptor: descriptor)
|
|
252
|
+
end
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Set `local: false` for a transport-only plugin chat. It remains available to
|
|
256
|
+
transports when `transport: true`, but `/tab open` and local tab restoration do
|
|
257
|
+
not expose it:
|
|
258
|
+
|
|
259
|
+
```ruby
|
|
260
|
+
plugin.tab_type "telegram", id: "com.example.telegram", local: false, transport: true do |host, descriptor|
|
|
261
|
+
ExampleChat.new(client: host.client, descriptor: descriptor)
|
|
262
|
+
end
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Transport-created plugin chats receive a descriptor containing a stable scoped
|
|
266
|
+
key, transport identity, external conversation, and actor metadata. Use the
|
|
267
|
+
scope to select separate transcript and memory roots. The driver may accept a
|
|
268
|
+
`context:` keyword on `submit` to receive the authenticated actor for each
|
|
269
|
+
turn; access decisions must still be enforced by the transport and plugin code,
|
|
270
|
+
not by model instructions.
|
|
271
|
+
|
|
237
272
|
RPC clients discover opted-in types through `initialize.capabilities.pluginChats`, open a chat with `pluginChats/open`, and must explicitly subscribe before receiving live `pluginChat/event` notifications. See [RPC](rpc.md) for the protocol. Plugin tabs remain CLI-only unless they opt in.
|
|
238
273
|
|
|
239
274
|
## Observe transcript events
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Prompt templates
|
|
2
|
+
|
|
3
|
+
Prompt templates turn a repeated request into a slash command. Keep one when you regularly ask Kward to plan before coding, investigate without changing files, or review a particular part of a project in the same way.
|
|
4
|
+
|
|
5
|
+
Templates are reusable **user prompts**, not always-on instructions. Kward expands the selected template when you run its slash command, then sends the expanded text as your request.
|
|
6
|
+
|
|
7
|
+
Use [skills](skills.md) for task guidance the model can load when relevant, `PRINCIPLES.md` for preferences that apply broadly, and `AGENTS.md` for repository rules.
|
|
8
|
+
|
|
9
|
+
## Create a template
|
|
10
|
+
|
|
11
|
+
By default, put one Markdown file per command in:
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
~/.kward/prompts/
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
For example, create `~/.kward/prompts/review.md`:
|
|
18
|
+
|
|
19
|
+
```markdown
|
|
20
|
+
---
|
|
21
|
+
description: Review a change for correctness.
|
|
22
|
+
argument-hint: <focus>
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
Review the current diff for correctness, tests, and maintainability.
|
|
26
|
+
Focus on: $ARGUMENTS
|
|
27
|
+
Do not edit files; report findings first.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Restart Kward, or use `/reload` in an already-running session. The filename becomes the command name:
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
/review authentication edge cases
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Kward expands `$ARGUMENTS` everywhere it appears in the body with the text after `/review`. In this example, the model receives `Focus on: authentication edge cases`. If the template does not contain `$ARGUMENTS`, supplied arguments are not added automatically.
|
|
37
|
+
|
|
38
|
+
The `description` and `argument-hint` frontmatter fields are optional, but useful: Kward shows them in slash-command completion. The rest of the file is the prompt body. Add as much Markdown structure and instruction text as the workflow needs.
|
|
39
|
+
|
|
40
|
+
## Naming and discovery
|
|
41
|
+
|
|
42
|
+
Kward reads `*.md` files directly inside the prompts directory, in filename order. It ignores subdirectories. A filename must produce a command containing only letters, numbers, `_`, and `-`, and must begin with a letter or number:
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
~/.kward/prompts/
|
|
46
|
+
├── review.md # /review
|
|
47
|
+
├── release-check.md # /release-check
|
|
48
|
+
└── api_v2.md # /api_v2
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
A template cannot replace a built-in slash command such as `/settings`, `/skill`, or `/reload`; Kward warns and skips it. It also warns and skips files with invalid Markdown frontmatter or command names.
|
|
52
|
+
|
|
53
|
+
`~/.kward/prompts` is the default. When `KWARD_CONFIG_PATH` points to another config file, templates live in the `prompts/` directory beside that file instead. See [Configuration](configuration.md#Config_directory).
|
|
54
|
+
|
|
55
|
+
## Starter templates from `kward init`
|
|
56
|
+
|
|
57
|
+
After installing Kward, run:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
kward init
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The starter pack downloads template files into `~/.kward/prompts/` without overwriting files that already exist. It currently installs these four commands:
|
|
64
|
+
|
|
65
|
+
| Command | Use it for | What it asks Kward to do |
|
|
66
|
+
| --- | --- | --- |
|
|
67
|
+
| `/plan <task-or-change>` | Agree on an approach before coding | Clarify important requirements, produce a concise plan, and wait for confirmation before implementation. |
|
|
68
|
+
| `/investigate <bug-or-behavior>` | Diagnose a bug or surprising result | Gather evidence, identify the root cause or strongest hypothesis, suggest the smallest safe fix, and make no edits. |
|
|
69
|
+
| `/research <question-or-topic>` | Answer a question that needs current or external evidence | Prefer primary sources, separate facts from recommendations, cite sources and caveats, and make no changes. |
|
|
70
|
+
| `/codebase-review [scope-or-focus]` | Assess a repository or area for practical cleanup | Report concrete maintainability, correctness, duplication, ownership, testing, and hot-path findings without refactoring. |
|
|
71
|
+
|
|
72
|
+
For example:
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
/plan Add rate limiting to the public API
|
|
76
|
+
/investigate The session picker occasionally shows the wrong title
|
|
77
|
+
/research Which OAuth scopes does this provider require?
|
|
78
|
+
/codebase-review lib/kward/model
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
The starter templates deliberately favor report- or plan-first workflows. They do not make Kward edit files until you follow up with an explicit implementation request. Edit the installed files to fit your own process, or add new files alongside them.
|
|
82
|
+
|
|
83
|
+
`kward init` also installs a base `PRINCIPLES.md` and starter skills. It needs network access to fetch the versioned [starter pack](https://github.com/kaiwood/kward-starter-pack) and leaves existing destination files untouched.
|
|
84
|
+
|
|
85
|
+
## Practical patterns
|
|
86
|
+
|
|
87
|
+
Keep templates specific enough to set a workflow, but short enough that the request remains easy to adapt. For example, a release-check prompt might take a version as an argument:
|
|
88
|
+
|
|
89
|
+
```markdown
|
|
90
|
+
---
|
|
91
|
+
description: Prepare release notes and verification for a version.
|
|
92
|
+
argument-hint: <version>
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
Prepare the release checklist for version $ARGUMENTS.
|
|
96
|
+
Inspect the changelog and version files. Do not publish or tag a release.
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Then run:
|
|
100
|
+
|
|
101
|
+
```text
|
|
102
|
+
/release-check 1.4.0
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Templates only expand text; they do not execute local code, grant permissions, or bypass Kward's tool and workspace safeguards.
|
data/doc/providers.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# Model providers
|
|
2
|
+
|
|
3
|
+
Kward can keep credentials for several model providers and switch between them without changing your conversation. Use this guide to compare authentication options, see where each provider's model list comes from, and find the names used in configuration.
|
|
4
|
+
|
|
5
|
+
For login steps and credential storage, see [Authentication](authentication.md). For every config key and environment override, see [Configuration](configuration.md#Provider_and_model_settings).
|
|
6
|
+
|
|
7
|
+
## Quick start
|
|
8
|
+
|
|
9
|
+
Inside interactive Kward:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
/login
|
|
13
|
+
/model
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`/login` connects a provider. `/model` chooses the active provider and model. The model picker can refresh the available models, accept a manual model ID, show models normally hidden by compatibility filters, or switch providers.
|
|
17
|
+
|
|
18
|
+
For example, direct OpenAI API access and ChatGPT/Codex OAuth can coexist:
|
|
19
|
+
|
|
20
|
+
1. Run `kward login` for ChatGPT/Codex.
|
|
21
|
+
2. Open `/login`, choose **API key**, then **OpenAI**.
|
|
22
|
+
3. Open `/model` and choose either **Codex** or **OpenAI**.
|
|
23
|
+
|
|
24
|
+
## Provider overview
|
|
25
|
+
|
|
26
|
+
Kward normally uses the same provider name for authentication and configuration. Direct OpenAI is the exception: authentication and private API-key storage use `openai`, while config uses `openai_api` so it cannot be confused with Codex. RPC clients also use the authentication ID.
|
|
27
|
+
|
|
28
|
+
| Provider shown in Kward | Catalog/auth ID | `provider` value | Authentication | Model source | Request API |
|
|
29
|
+
| --- | --- | --- | --- | --- | --- |
|
|
30
|
+
| Codex | — | `codex` | ChatGPT OAuth or `OPENAI_ACCESS_TOKEN` | Curated choices | ChatGPT Codex Responses, streaming |
|
|
31
|
+
| OpenAI | `openai` | `openai_api` | API key | Live cache with curated/manual fallback | OpenAI Responses, streaming |
|
|
32
|
+
| Anthropic | `anthropic` | `anthropic` | API key or Claude subscription OAuth | Curated/manual choices | Anthropic Messages, streaming |
|
|
33
|
+
| Azure OpenAI | `azure_openai` | `azure_openai` | API key plus Azure setup | Configured deployment | Deployment-specific Chat Completions, streaming |
|
|
34
|
+
| Google Gemini | `gemini` | `gemini` | API key | Live cache with curated/manual fallback | Native Gemini, streaming |
|
|
35
|
+
| Cerebras | `cerebras` | `cerebras` | API key | Live cache or manual ID | OpenAI-compatible Chat Completions |
|
|
36
|
+
| DeepSeek | `deepseek` | `deepseek` | API key | Live cache with curated/manual fallback | OpenAI-compatible Chat Completions |
|
|
37
|
+
| Fireworks AI | `fireworks` | `fireworks` | API key | Live cache or manual ID | OpenAI-compatible Chat Completions |
|
|
38
|
+
| Groq | `groq` | `groq` | API key | Live cache or manual ID | OpenAI-compatible Chat Completions |
|
|
39
|
+
| Mistral | `mistral` | `mistral` | API key | Live cache with curated/manual fallback | OpenAI-compatible Chat Completions |
|
|
40
|
+
| NVIDIA NIM | `nvidia` | `nvidia` | API key | Live cache or manual ID | OpenAI-compatible Chat Completions |
|
|
41
|
+
| OpenRouter | `openrouter` | `openrouter` | API key | Account-specific cache or manual ID | OpenAI-compatible Chat Completions |
|
|
42
|
+
| Together AI | `together` | `together` | API key | Live cache or manual ID | OpenAI-compatible Chat Completions |
|
|
43
|
+
| xAI | `xai` | `xai` | API key | Live cache with curated/manual fallback | OpenAI-compatible Chat Completions |
|
|
44
|
+
| GitHub Copilot | `copilot` | `copilot` | GitHub OAuth or `COPILOT_GITHUB_TOKEN` | Live choices with curated fallback | Copilot Responses or Chat Completions, streaming |
|
|
45
|
+
| Local | — | `local` | Usually none; optional local bearer key | Local server `/models` endpoint or manual ID | OpenAI-compatible Chat Completions, streaming |
|
|
46
|
+
|
|
47
|
+
“OpenAI-compatible” means Kward sends the provider's documented Chat Completions shape. It does not imply that every provider supports every OpenAI feature. Model availability, tools, images, reasoning, context limits, and billing remain provider- and model-specific.
|
|
48
|
+
|
|
49
|
+
## IDs, model keys, and environment variables
|
|
50
|
+
|
|
51
|
+
| Provider | Model config key | Model environment variable | Credential environment variable |
|
|
52
|
+
| --- | --- | --- | --- |
|
|
53
|
+
| Codex | `openai_model` | `OPENAI_MODEL` | `OPENAI_ACCESS_TOKEN` |
|
|
54
|
+
| OpenAI | `openai_api_model` | `OPENAI_API_MODEL` | `OPENAI_API_KEY` |
|
|
55
|
+
| Anthropic | `anthropic_model` | `ANTHROPIC_MODEL` | `ANTHROPIC_API_KEY` for direct API access |
|
|
56
|
+
| Azure OpenAI | `azure_openai_model` | `AZURE_OPENAI_MODEL` | `AZURE_OPENAI_API_KEY` |
|
|
57
|
+
| Google Gemini | `gemini_model` | `GEMINI_MODEL` | `GEMINI_API_KEY` |
|
|
58
|
+
| Cerebras | `cerebras_model` | `CEREBRAS_MODEL` | `CEREBRAS_API_KEY` |
|
|
59
|
+
| DeepSeek | `deepseek_model` | `DEEPSEEK_MODEL` | `DEEPSEEK_API_KEY` |
|
|
60
|
+
| Fireworks AI | `fireworks_model` | `FIREWORKS_MODEL` | `FIREWORKS_API_KEY` |
|
|
61
|
+
| Groq | `groq_model` | `GROQ_MODEL` | `GROQ_API_KEY` |
|
|
62
|
+
| Mistral | `mistral_model` | `MISTRAL_MODEL` | `MISTRAL_API_KEY` |
|
|
63
|
+
| NVIDIA NIM | `nvidia_model` | `NVIDIA_MODEL` | `NVIDIA_API_KEY` or `NGC_API_KEY` |
|
|
64
|
+
| OpenRouter | `openrouter_model` | `OPENROUTER_MODEL` | `OPENROUTER_API_KEY` |
|
|
65
|
+
| Together AI | `together_model` | `TOGETHER_MODEL` | `TOGETHER_API_KEY` |
|
|
66
|
+
| xAI | `xai_model` | `XAI_MODEL` | `XAI_API_KEY` |
|
|
67
|
+
| GitHub Copilot | `copilot_model` | `COPILOT_MODEL` | `COPILOT_GITHUB_TOKEN` |
|
|
68
|
+
| Local | `local_model` | `KWARD_LOCAL_MODEL` | `KWARD_LOCAL_API_KEY` when needed |
|
|
69
|
+
|
|
70
|
+
Saved API keys live in private `<config-dir>/api_keys.json`; they do not belong in the model configuration. Environment credentials take precedence over saved API keys. OAuth files and their location overrides are documented in [Authentication](authentication.md#Custom_locations).
|
|
71
|
+
|
|
72
|
+
## Choosing between similar providers
|
|
73
|
+
|
|
74
|
+
### Codex or direct OpenAI
|
|
75
|
+
|
|
76
|
+
Choose **Codex** when you want ChatGPT subscription authentication and the ChatGPT Codex backend. Choose **OpenAI** when you want an OpenAI Platform API key, public `api.openai.com` billing, and the Responses API. Their credentials and model settings are intentionally separate.
|
|
77
|
+
|
|
78
|
+
### Anthropic API or Claude subscription
|
|
79
|
+
|
|
80
|
+
Both appear as **Anthropic**. If an Anthropic API key is configured, Kward uses it before subscription OAuth. Remove or unset the API key when you specifically want the OAuth-backed subscription path.
|
|
81
|
+
|
|
82
|
+
### OpenRouter or a direct provider
|
|
83
|
+
|
|
84
|
+
OpenRouter is useful when you want one key and its cross-provider model catalog. A direct provider is useful when you want that provider's own billing, endpoint, or native runtime. Refresh OpenRouter with `/model` or:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
kward openrouter refresh
|
|
88
|
+
kward openrouter list
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Cloud or Local
|
|
92
|
+
|
|
93
|
+
Choose **Local** for Ollama, LM Studio, llama.cpp, or another trusted OpenAI-compatible server. You must set the real context window yourself when the server cannot report it safely. See [Local models](local-models.md).
|
|
94
|
+
|
|
95
|
+
## Azure OpenAI setup
|
|
96
|
+
|
|
97
|
+
Azure requires:
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"provider": "azure_openai",
|
|
102
|
+
"azure_openai_endpoint": "https://example.openai.azure.com",
|
|
103
|
+
"azure_openai_model": "production-gpt",
|
|
104
|
+
"azure_openai_api_version": "2025-04-01-preview"
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
The endpoint must use HTTPS and cannot contain URL credentials, a query, or a fragment. The model value is the Azure deployment name. Kward does not attempt deployment discovery using an inference key.
|
|
109
|
+
|
|
110
|
+
## Model discovery and filtering
|
|
111
|
+
|
|
112
|
+
Kward combines several sources so a temporary catalog failure does not lock you out:
|
|
113
|
+
|
|
114
|
+
1. refreshed live metadata, when the provider exposes model discovery;
|
|
115
|
+
2. the last private local cache;
|
|
116
|
+
3. conservative curated choices, where Kward has them;
|
|
117
|
+
4. the currently configured model;
|
|
118
|
+
5. a manual ID entered in `/model`.
|
|
119
|
+
|
|
120
|
+
When capability metadata is present, the default picker prioritizes entries that advertise generation or tool/function support and hides the others. Empty or incomplete metadata stays visible. Use **Show all models** for embedding, preview, private, or unusually described models.
|
|
121
|
+
|
|
122
|
+
Model discovery proves that an ID exists; it does not guarantee account access, tool support, image support, context size, pricing, or regional availability. Provider errors remain authoritative.
|
|
123
|
+
|
|
124
|
+
## OAuth availability
|
|
125
|
+
|
|
126
|
+
Kward supports browser OAuth for ChatGPT/Codex and Anthropic, plus interactive GitHub login for Copilot. RPC can initiate OpenAI and Anthropic OAuth; Copilot OAuth remains CLI-only.
|
|
127
|
+
|
|
128
|
+
OpenRouter documents an official [OAuth PKCE flow](https://openrouter.ai/docs/guides/overview/auth/oauth), but Kward has not implemented it. xAI's public [API quickstart](https://docs.x.ai/developers/quickstart) documents API keys rather than a stable third-party subscription OAuth flow. Kward reports both limitations explicitly instead of presenting a login that cannot be completed safely.
|
|
129
|
+
|
|
130
|
+
## RPC clients
|
|
131
|
+
|
|
132
|
+
RPC clients should discover providers rather than hard-code this table:
|
|
133
|
+
|
|
134
|
+
- `auth/providers` returns catalog providers and supported authentication methods;
|
|
135
|
+
- `auth/status` returns sanitized configured/source state;
|
|
136
|
+
- `models/list` returns known model entries;
|
|
137
|
+
- `models/refresh` refreshes a provider when supported;
|
|
138
|
+
- `models/set` selects the provider and model.
|
|
139
|
+
|
|
140
|
+
See the [RPC protocol](rpc.md#Config_and_auth_methods) for request shapes and unsupported OAuth capability reporting.
|
data/doc/releasing.md
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
# Releasing Kward
|
|
2
2
|
|
|
3
|
+
## Before you begin
|
|
4
|
+
|
|
3
5
|
Kward requires Ruby >= 3.4 (`spec.required_ruby_version` in `kward.gemspec`). If you develop with a newer Ruby, verify tests pass against the minimum supported version before releasing.
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
## Prepare the release
|
|
8
|
+
|
|
9
|
+
Before publishing:
|
|
6
10
|
|
|
7
11
|
1. Update `CHANGELOG.md` for the version. Move `[Unreleased]` entries under a new version heading.
|
|
8
12
|
2. Update `Kward::VERSION` in `lib/kward/version.rb`.
|
|
@@ -41,7 +45,9 @@ Release steps before publishing:
|
|
|
41
45
|
|
|
42
46
|
8. Install the built gem locally and smoke test the `kward` executable in a clean workspace.
|
|
43
47
|
|
|
44
|
-
|
|
48
|
+
## Tag and publish
|
|
49
|
+
|
|
50
|
+
Commit the version bump and create a Git tag:
|
|
45
51
|
|
|
46
52
|
```bash
|
|
47
53
|
git commit -am "Bump to VERSION"
|
|
@@ -57,6 +63,8 @@ gem push kward-VERSION.gem
|
|
|
57
63
|
|
|
58
64
|
RubyGems MFA is required for publishing. Prefer RubyGems trusted publishing for automated releases if CI publishing is added later, so long-lived API keys do not need to be stored in CI secrets.
|
|
59
65
|
|
|
66
|
+
## If you need to yank a release
|
|
67
|
+
|
|
60
68
|
If a published gem has a serious problem, you can yank it within 24 hours of pushing:
|
|
61
69
|
|
|
62
70
|
```bash
|
data/doc/rpc.md
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
|
-
# Kward RPC
|
|
1
|
+
# Kward RPC protocol
|
|
2
2
|
|
|
3
3
|
<div class="kward-no-toc"></div>
|
|
4
4
|
|
|
5
|
-
Kward RPC
|
|
5
|
+
Use Kward RPC to build a trusted local interface around Kward's sessions, models, tools, and streaming turns. This page is for people building UI clients or integrations; if you use Kward only from the terminal, you can skip it.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The protocol uses JSON-RPC and is currently version `1`. Compatible releases may add methods and fields, so clients should ignore fields they do not recognize. Removing a method or changing the meaning of an existing field requires a protocol version bump. Individual capability groups may still report that they are unsupported in `initialize.capabilities`.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## Build a client
|
|
10
|
+
|
|
11
|
+
A typical client launches the server, sends `initialize`, creates or resumes a session, starts a turn, and renders `turn/event` notifications. Use these sections for the next step:
|
|
12
|
+
|
|
13
|
+
| You need to... | Start here |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| Connect and negotiate capabilities | [Launch](#Launch), [Framing](#Framing), and [Initialization](#Initialization) |
|
|
16
|
+
| Open, resume, branch, or export a conversation | [Session methods](#Session_methods) |
|
|
17
|
+
| Send input and render a response | [Turn methods](#Turn_methods) and [Turn notifications](#Turn_notifications) |
|
|
18
|
+
| Handle tool approval or structured questions | [Tool approval bridge](#Tool_approval_bridge) and [UI question bridge](#UI_question_bridge) |
|
|
19
|
+
| Show model, runtime, auth, or configuration controls | [Runtime methods](#Runtime_methods), [Model methods](#Model_methods), and [Config and auth methods](#Config_and_auth_methods) |
|
|
20
|
+
| Discover tools, MCP servers, prompts, skills, or plugins | [Tool and prompt methods](#Tool_and_prompt_methods) |
|
|
21
|
+
|
|
22
|
+
Prompt history search is a CLI terminal feature only. RPC clients own their composer/input UX and Kward does not expose prompt-history read, append, or search methods over RPC.
|
|
10
23
|
|
|
11
24
|
## Launch
|
|
12
25
|
|
|
@@ -47,31 +60,31 @@ Result fields:
|
|
|
47
60
|
- `experimental`: `false`.
|
|
48
61
|
- `capabilities`: includes frontend-neutral capability groups.
|
|
49
62
|
|
|
50
|
-
|
|
63
|
+
Read `capabilities` at runtime instead of assuming every feature is available. Its groups describe:
|
|
51
64
|
|
|
52
65
|
- `transcript`: Kward transcript format support, including normalized messages, image/tool support, compaction summaries, and restored assistant reasoning as Pi-compatible `thinking` content blocks.
|
|
53
|
-
- `sessions`: explicit RPC session mode, JSONL persistence,
|
|
54
|
-
- `turns`:
|
|
55
|
-
- `pluginChats`: optional plugin-owned chats. The capability lists opted-in chat types and methods. Clients must explicitly subscribe before receiving `pluginChat/event` notifications; plugin chats are independent from workspace sessions.
|
|
56
|
-
- `events`: `turn/event`
|
|
66
|
+
- `sessions`: explicit RPC session mode, JSONL persistence, and methods for listing, auto-resume, live-session discovery, linear forking, compaction, and labeled tree navigation with branch summaries. Import is unsupported. Live session updates are also unsupported but reserve the `session/updated` notification name. Git worktree bindings are reported as interactive-TUI-only.
|
|
67
|
+
- `turns`: asynchronous turns, per-session concurrency, active and recent turn lists, busy-input steering when the provider supports it, queued follow-ups, best-effort cancellation, and recent in-memory event replay. Per-turn options cover model, reasoning, tool scope, and tool approval, with structured client context for editor integrations.
|
|
68
|
+
- `pluginChats`: optional plugin-owned chats. The capability lists opted-in chat types and methods. Clients must explicitly subscribe before receiving `pluginChat/event` notifications; plugin chats are independent from workspace sessions. A type may also report `transport: true` when a trusted external transport is allowed to target it; RPC opt-in and external transport opt-in remain separate.
|
|
69
|
+
- `events`: the `turn/event` contract, assistant and reasoning events, normalized tool metadata, tool updates and results, diff support, workspace guardrail status, focused-context and context-budget statistics tools, and explicitly unsupported shell changed-file and session-update flags.
|
|
57
70
|
- `attachments`: supported input attachment contract for `turns/start`, with accepted base64 image MIME types and a stable max byte value.
|
|
58
|
-
- `models`: model
|
|
59
|
-
- `runtime`:
|
|
71
|
+
- `models`: model listing, refresh, selection, and exposed metadata across providers. Scoped model selection is not supported.
|
|
72
|
+
- `runtime`: runtime state, message-count statistics, and OpenAI/Codex context usage. Kward does not yet compute cumulative token or cost statistics.
|
|
60
73
|
- `lifecycleHooks`: supported lifecycle hook events, decisions, command/plugin/workspace/HTTP/async hook availability, audit log path, hook approval routing through tool approval, and hook notifications (`hook/event`, `hook/message`).
|
|
61
74
|
- `runtimeSettings`: live `runtime/updateSetting` support for `defaultModel` and `defaultThinkingLevel`, plus `runtime/reload`.
|
|
62
|
-
- `auth`:
|
|
75
|
+
- `auth`: available providers and authentication methods, private API-key storage, sanitized status, and logout. OpenAI and Anthropic OAuth are supported; Copilot OAuth is CLI-only, OpenRouter PKCE is not implemented, and xAI has no supported stable third-party flow.
|
|
63
76
|
- `memory`: opt-in structured memory support, interactive prompt injection only, JSON/JSONL local storage, and dedicated `memory/*` methods.
|
|
64
77
|
- `commands`: supported `commands/list` capability for prompt, skill, and plugin command sources, plus plugin execution through `commands/run` or plugin slash turns.
|
|
65
78
|
- `skillCapture`: capture a reviewed personal `SKILL.md` from any saved session’s active branch through `skills/captureSessions`, `skills/captureDraft`, and `skills/saveCapturedDraft`.
|
|
66
|
-
- `mcp`: local stdio MCP server support through the shared `mcpServers` config. RPC exposes MCP tools to turns and advertises discovery with `methods: ["tools/list", "mcp/status"]`, `toolMetadata: true`, and `serverStatus: true`. MCP resources, prompts, sampling,
|
|
79
|
+
- `mcp`: local stdio MCP server support through the shared `mcpServers` config. RPC exposes MCP tools to turns and advertises discovery with `methods: ["tools/list", "mcp/status"]`, `toolMetadata: true`, and `serverStatus: true`. It does not support MCP resources, prompts, sampling, or Streamable HTTP.
|
|
67
80
|
- `startupResources`: supported startup resource listing for context, skills, prompts, and plugins.
|
|
68
81
|
- `extensionUi`: question bridge support via `ui/question` and `ui/answerQuestion`, plus plugin footer updates via `ui/footer`; other UI primitives are explicitly unsupported.
|
|
69
82
|
- `composer`: composer-only UI features. Interactive session diff totals are explicitly unsupported over RPC (`composer.sessionDiff.supported: false`) because RPC clients already receive per-tool diff results and no live composer status payload is exposed. Clipboard copy is also unsupported over RPC (`composer.copy.supported: false`) because UI clients own clipboard access.
|
|
70
|
-
- `security`: trusted-local behavior
|
|
83
|
+
- `security`: trusted-local behavior and optional per-turn tool approval. By default, RPC turns have no workspace mutation guard or tool approval, so shell commands and file changes can run. Clients can inspect file-tool guardrails through `capabilities.events.tools.workspaceGuardrails` and `runtime/state.workspaceGuardrailsEnabled`. `security.sandbox` reports the command sandbox mode, enforcement backend, and filesystem and network capabilities; session pinning and one-time elevation are unsupported. See [Command sandboxing](sandboxing.md) for the boundary and its limits.
|
|
71
84
|
- `export`: supported transcript export formats. Currently `markdown` and `html`; default is `markdown`.
|
|
72
85
|
- `starterPack`: explicitly unsupported (`supported: false`, reason `cliOnlyInstallCommand`). Use `kward init` from the shell.
|
|
73
86
|
- `shell`: explicitly unsupported (`supported: false`, reason `interactiveTuiOnly`) because `/shell` is the local embedded TUI shell.
|
|
74
|
-
- `logging`: local redacted telemetry
|
|
87
|
+
- `logging`: local redacted telemetry, its directory and enabled categories, `logging/stats` and `logging/tokenCsv`, bucketed `usageCsv` support, JSONL storage, and 10 MB rotation with manual retention. Logs contain redacted metadata only. Configuration uses the `logging` key and `KWARD_LOGGING` environment prefix.
|
|
75
88
|
|
|
76
89
|
### `shutdown`
|
|
77
90
|
|
|
@@ -120,7 +133,7 @@ Params:
|
|
|
120
133
|
- `name`: optional session name.
|
|
121
134
|
- `resumeLast`: optional boolean. Defaults to the configured `sessions.auto_resume` behavior when omitted by clients that use `sessions/create` for startup. `false` forces a fresh session.
|
|
122
135
|
|
|
123
|
-
Creates a persisted Kward session and returns
|
|
136
|
+
Creates a persisted Kward session and returns its metadata. The response includes `activePersonaLabel` so clients can render the correct avatar immediately. If `resumeLast` and `sessions.auto_resume` are both enabled and no `name` is provided, Kward resumes the last session remembered for the workspace. That response includes `resumed: true` and normalized `messages`, allowing clients to render the restored transcript immediately.
|
|
124
137
|
|
|
125
138
|
### `sessions/resume`
|
|
126
139
|
|
|
@@ -171,7 +184,7 @@ Returns:
|
|
|
171
184
|
```json
|
|
172
185
|
{
|
|
173
186
|
"summary": "Compaction summary",
|
|
174
|
-
"firstKeptEntryId": "
|
|
187
|
+
"firstKeptEntryId": "a13f8c42b7d94e10c5f8a3b6d2e9f401",
|
|
175
188
|
"tokensBefore": 1234,
|
|
176
189
|
"details": {
|
|
177
190
|
"read_files": [],
|
|
@@ -193,12 +206,12 @@ Returns forkable user-message entries for the active session:
|
|
|
193
206
|
```json
|
|
194
207
|
{
|
|
195
208
|
"messages": [
|
|
196
|
-
{ "entryId": "
|
|
209
|
+
{ "entryId": "a13f8c42b7d94e10c5f8a3b6d2e9f401", "text": "User message text" }
|
|
197
210
|
]
|
|
198
211
|
}
|
|
199
212
|
```
|
|
200
213
|
|
|
201
|
-
`entryId` values are stable
|
|
214
|
+
`entryId` values are opaque, stable persisted tree-entry IDs. Clients must use the IDs returned by Kward rather than constructing them. `text` is compact display text.
|
|
202
215
|
|
|
203
216
|
### `sessions/fork`
|
|
204
217
|
|
|
@@ -549,7 +562,7 @@ Refreshes config-backed runtime state and returns `{ "ok": true, "message": "Res
|
|
|
549
562
|
|
|
550
563
|
## Logging methods
|
|
551
564
|
|
|
552
|
-
|
|
565
|
+
Check the `logging` capability to see whether local redacted telemetry is available. It reports the log directory, enabled categories, supported methods, bucketed CSV support, JSONL storage, and 10 MB rotation with manual retention. Logs contain redacted metadata only. Configure logging with the `logging` key or `KWARD_LOGGING` environment prefix, and enable at least one category before calling these methods.
|
|
553
566
|
|
|
554
567
|
### `logging/stats`
|
|
555
568
|
|
|
@@ -559,7 +572,7 @@ Params:
|
|
|
559
572
|
|
|
560
573
|
Accepted units are minutes, hours, days, weeks, months, and years. Ranges use UTC calendar periods: `1 month` means the current calendar month so far, and `2 months` means the previous month plus the current month so far. Invalid ranges return an invalid-params error with usage text.
|
|
561
574
|
|
|
562
|
-
Returns
|
|
575
|
+
Returns statistics for enabled categories over the requested range. The response includes the log directory, record counts by category and event, `usageStats` token totals, performance durations, tool call summaries, and error counts by event, class, provider, and code. It does not include error messages.
|
|
563
576
|
|
|
564
577
|
### `logging/tokenCsv`
|
|
565
578
|
|
|
@@ -682,7 +695,15 @@ Returns `{ "memories": [] }`.
|
|
|
682
695
|
|
|
683
696
|
### `models/list`
|
|
684
697
|
|
|
685
|
-
Returns known model entries from
|
|
698
|
+
Returns known model entries from configured provider catalogs, including cached and curated fallbacks. Entries use `{ "provider", "id", "name", "reasoning", "reasoningEffort", "contextWindow", "current" }`.
|
|
699
|
+
|
|
700
|
+
### `models/refresh`
|
|
701
|
+
|
|
702
|
+
Params:
|
|
703
|
+
|
|
704
|
+
- `provider`: optional configured provider name. Defaults to the active provider.
|
|
705
|
+
|
|
706
|
+
Refreshes that provider's live model catalog when discovery is supported and returns the complete sanitized model list. Providers without live discovery retain configured or curated choices.
|
|
686
707
|
|
|
687
708
|
### `models/current`
|
|
688
709
|
|
|
@@ -693,7 +714,7 @@ Returns the current model entry with `provider`, `id`, `name`, `reasoning`, `rea
|
|
|
693
714
|
Params:
|
|
694
715
|
|
|
695
716
|
- `model`: model ID string.
|
|
696
|
-
- `provider`: optional provider
|
|
717
|
+
- `provider`: optional provider name or catalog ID; defaults to the active provider.
|
|
697
718
|
|
|
698
719
|
Updates the config-backed provider model and returns the current model payload.
|
|
699
720
|
|
|
@@ -793,30 +814,32 @@ Params:
|
|
|
793
814
|
|
|
794
815
|
- `values`: object of config keys and values.
|
|
795
816
|
|
|
796
|
-
Updates
|
|
817
|
+
Updates non-secret config and returns a redacted config object. Provider API-key fields are rejected; use `auth/loginWithApiKey` so keys go to private credential storage.
|
|
797
818
|
|
|
798
819
|
### `auth/status`
|
|
799
820
|
|
|
800
|
-
Returns
|
|
821
|
+
Returns sanitized status plus catalog provider entries. It reports configured/source booleans but never credential values.
|
|
801
822
|
|
|
802
823
|
### `auth/providers`
|
|
803
824
|
|
|
804
|
-
Returns
|
|
825
|
+
Returns every catalog provider with `runtimeId`, `configured`, `source`, `canLogout`, and `authMethods`. Each auth method reports `id` (`api_key` or `oauth`), `supported`, `configured`, optional `source`, callback support, and an explicit reason when unsupported. Clients should discover this response dynamically; [Model providers](providers.md) is the corresponding human-readable reference.
|
|
805
826
|
|
|
806
827
|
### `auth/loginWithApiKey`
|
|
807
828
|
|
|
808
829
|
Params:
|
|
809
830
|
|
|
810
|
-
- `providerId`:
|
|
811
|
-
- `apiKey`: API key secret
|
|
831
|
+
- `providerId`: any catalog provider that accepts API keys;
|
|
832
|
+
- `apiKey`: API key secret;
|
|
833
|
+
- `configuration`: required for Azure OpenAI, with `endpoint`, `deployment`, and `apiVersion`.
|
|
812
834
|
|
|
813
|
-
Stores the
|
|
835
|
+
Stores the key in private `<config-dir>/api_keys.json`, refreshes client config, and returns only provider/method/status metadata. Keys and raw sensitive provider responses are never returned.
|
|
814
836
|
|
|
815
837
|
### `auth/logoutProvider`
|
|
816
838
|
|
|
817
839
|
Params:
|
|
818
840
|
|
|
819
|
-
- `providerId`:
|
|
841
|
+
- `providerId`: catalog provider ID;
|
|
842
|
+
- `authMethod`: optional `api_key` or `oauth`; omitting it removes all stored methods Kward can remove for that provider.
|
|
820
843
|
|
|
821
844
|
Removes stored credentials only. Environment variables remain active and are still reported by `auth/providers`.
|
|
822
845
|
|
|
@@ -827,7 +850,7 @@ Params:
|
|
|
827
850
|
- `providerId`: currently `openai` or `anthropic`.
|
|
828
851
|
- `timeoutSeconds`: optional callback wait timeout.
|
|
829
852
|
|
|
830
|
-
Provider-scoped wrapper around the OpenAI or Anthropic OAuth flow. The result includes `providerId`, `loginId`, `authorizationUrl`, `redirectUri`, and `status`.
|
|
853
|
+
Provider-scoped wrapper around the OpenAI or Anthropic OAuth flow. The result includes `providerId`, `loginId`, `authorizationUrl`, `redirectUri`, and `status`. Copilot is reported as CLI-only. OpenRouter's official PKCE flow is not yet implemented by Kward, and xAI has no supported stable third-party OAuth flow; both return explicit sanitized unsupported errors.
|
|
831
854
|
|
|
832
855
|
### `auth/startOpenAILogin`
|
|
833
856
|
|
data/doc/sandboxing.md
CHANGED
|
@@ -63,6 +63,28 @@ Changes apply to newly created sessions and tabs. Existing turns keep the
|
|
|
63
63
|
workspace and command runner they started with, so start a new session or tab
|
|
64
64
|
after changing the mode.
|
|
65
65
|
|
|
66
|
+
## Worktree tabs
|
|
67
|
+
|
|
68
|
+
An active worktree-backed tab uses a strict `workspace_write` policy for its
|
|
69
|
+
model-requested command workers, regardless of the global `sandbox.mode` or
|
|
70
|
+
`tools.workspace_guardrails` settings. The writable root is exactly the linked
|
|
71
|
+
worktree and no configured additional writable roots are carried into the tab.
|
|
72
|
+
The configured child-network setting is preserved.
|
|
73
|
+
|
|
74
|
+
If the current platform cannot provide filesystem enforcement, Kward refuses to
|
|
75
|
+
activate the worktree instead of falling back to an unrestricted command
|
|
76
|
+
worker. The strict agent also disables configured MCP clients and lifecycle
|
|
77
|
+
hooks because they run in the Kward host process rather than inside the command
|
|
78
|
+
sandbox.
|
|
79
|
+
|
|
80
|
+
This does not contain the interactive `/shell`, `!command`, or `/pty` features;
|
|
81
|
+
those are user-directed host-process operations. Generic model-requested shell
|
|
82
|
+
commands still cannot write Git metadata. Active worktree tabs additionally
|
|
83
|
+
expose a narrow `git_commit` tool for explicit agent-requested commits; it runs
|
|
84
|
+
through the trusted host-side Git workflow rather than widening the shell
|
|
85
|
+
sandbox. The interactive `/git` flow remains available for manual review and
|
|
86
|
+
commit.
|
|
87
|
+
|
|
66
88
|
## Platform support
|
|
67
89
|
|
|
68
90
|
| Platform | Backend | Status |
|