kward 0.82.0 → 0.84.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/CHANGELOG.md +96 -15
- data/CONTRIBUTING.md +74 -0
- data/Gemfile.lock +8 -2
- data/README.md +21 -1
- data/Rakefile +46 -2
- data/SECURITY.md +31 -0
- data/doc/agent-tools.md +1 -0
- data/doc/api.md +4 -0
- data/doc/composer.md +2 -2
- data/doc/configuration.md +82 -20
- data/doc/editor.md +47 -22
- data/doc/files.md +12 -7
- data/doc/getting-started.md +3 -0
- data/doc/pan.md +19 -15
- data/doc/permissions.md +1 -0
- data/doc/platform-support.md +48 -0
- data/doc/releasing.md +12 -4
- data/doc/rpc.md +2 -2
- data/doc/sandboxing.md +5 -1
- data/doc/security.md +4 -3
- data/doc/shell.md +101 -60
- data/doc/tabs.md +3 -0
- data/doc/troubleshooting.md +12 -2
- data/doc/usage.md +7 -6
- data/kward.gemspec +5 -4
- data/lib/kward/agent.rb +7 -3
- data/lib/kward/ansi.rb +110 -10
- data/lib/kward/auth/anthropic_oauth.rb +7 -7
- data/lib/kward/cli/auth_commands.rb +34 -13
- data/lib/kward/cli/commands.rb +83 -62
- data/lib/kward/cli/doctor.rb +39 -17
- data/lib/kward/cli/hook_commands.rb +22 -12
- data/lib/kward/cli/interactive_turn.rb +144 -21
- data/lib/kward/cli/project_skills_commands.rb +8 -4
- data/lib/kward/cli/prompt_interface.rb +27 -0
- data/lib/kward/cli/rendering.rb +15 -9
- data/lib/kward/cli/runtime_helpers.rb +260 -55
- data/lib/kward/cli/slash_commands.rb +21 -12
- data/lib/kward/cli/tabs.rb +91 -13
- data/lib/kward/cli/tool_summaries.rb +14 -0
- data/lib/kward/cli.rb +55 -7
- data/lib/kward/cli_transcript_formatter.rb +11 -4
- data/lib/kward/compaction/token_estimator.rb +12 -6
- data/lib/kward/config_files.rb +94 -63
- data/lib/kward/detached_run.rb +44 -0
- data/lib/kward/editor_prompt.rb +46 -0
- data/lib/kward/editor_prompt_session.rb +28 -0
- data/lib/kward/interactive_pty_runner.rb +102 -28
- data/lib/kward/{ekwsh.rb → kwsh.rb} +103 -24
- data/lib/kward/kwshrc.rb +233 -0
- data/lib/kward/markdown_code_block.rb +136 -0
- data/lib/kward/model/client.rb +35 -39
- data/lib/kward/model/model_info.rb +3 -2
- data/lib/kward/model/payloads.rb +0 -2
- data/lib/kward/model/provider_catalog.rb +5 -0
- data/lib/kward/model/stream_parser.rb +20 -4
- data/lib/kward/pan/index.html.erb +3 -3
- data/lib/kward/pan/server.rb +23 -3
- data/lib/kward/persistent_shell_session.rb +843 -0
- data/lib/kward/project_files.rb +19 -6
- data/lib/kward/prompt_interface/composer_renderer.rb +45 -41
- data/lib/kward/prompt_interface/composer_state.rb +33 -24
- data/lib/kward/prompt_interface/editor/auto_indent.rb +27 -22
- data/lib/kward/prompt_interface/editor/controller.rb +99 -33
- data/lib/kward/prompt_interface/editor/endwise.rb +13 -4
- data/lib/kward/prompt_interface/editor/modes/modern.rb +4 -0
- data/lib/kward/prompt_interface/editor/modes/vibe.rb +298 -47
- data/lib/kward/prompt_interface/editor/renderer.rb +109 -6
- data/lib/kward/prompt_interface/editor/runner.rb +362 -0
- data/lib/kward/prompt_interface/editor/runner_state.rb +78 -0
- data/lib/kward/prompt_interface/editor/state.rb +21 -10
- data/lib/kward/prompt_interface/editor/syntax_highlighter.rb +68 -6
- data/lib/kward/prompt_interface/editor/vibe_state.rb +3 -3
- data/lib/kward/prompt_interface/editor/word_completion.rb +124 -0
- data/lib/kward/prompt_interface/file_overlay.rb +92 -22
- data/lib/kward/prompt_interface/key_handler.rb +75 -0
- data/lib/kward/prompt_interface/overlay_renderer.rb +7 -5
- data/lib/kward/prompt_interface/project_browser.rb +443 -17
- data/lib/kward/prompt_interface/runtime_state.rb +55 -2
- data/lib/kward/prompt_interface/screen.rb +2 -2
- data/lib/kward/prompt_interface/selection_prompt.rb +3 -1
- data/lib/kward/prompt_interface/slash_overlay.rb +19 -4
- data/lib/kward/prompt_interface/transcript_renderer.rb +12 -7
- data/lib/kward/prompt_interface.rb +169 -18
- data/lib/kward/prompts/commands.rb +2 -1
- data/lib/kward/prompts.rb +1 -1
- data/lib/kward/pty_output_sink.rb +47 -0
- data/lib/kward/rpc/auth_manager.rb +1 -1
- data/lib/kward/rpc/server.rb +2 -1
- data/lib/kward/rpc/transcript_normalizer.rb +7 -3
- data/lib/kward/scratchpad_languages.rb +74 -0
- data/lib/kward/scratchpad_runner.rb +155 -29
- data/lib/kward/shell_prompt.rb +52 -0
- data/lib/kward/shell_prompt_session.rb +58 -0
- data/lib/kward/terminal_keys.rb +13 -0
- data/lib/kward/terminal_text.rb +121 -0
- data/lib/kward/text_matcher.rb +18 -0
- data/lib/kward/tools/open_editor.rb +41 -0
- data/lib/kward/tools/prepare_shell_command.rb +28 -0
- data/lib/kward/tools/registry.rb +75 -8
- data/lib/kward/tools/replace_editor_buffer.rb +30 -0
- data/lib/kward/tools/run_shell_command.rb +24 -6
- data/lib/kward/tools/tool_call.rb +2 -1
- data/lib/kward/version.rb +1 -1
- data/templates/default/fulldoc/html/css/kward.css +0 -125
- data/templates/default/fulldoc/html/images/kward_workflow.svg +52 -0
- data/templates/default/fulldoc/html/setup.rb +1 -1
- data/templates/default/kward_navigation.rb +1 -0
- data/templates/default/layout/html/footer.erb +10 -0
- data/templates/default/layout/html/headers.erb +23 -0
- data/templates/default/layout/html/layout.erb +6 -18
- data/templates/default/layout/html/setup.rb +41 -2
- metadata +44 -8
- data/templates/default/fulldoc/html/images/kward_screen_1.png +0 -0
data/doc/configuration.md
CHANGED
|
@@ -128,7 +128,7 @@ By default, Kward stores user data under `~/.kward`. Common files and directorie
|
|
|
128
128
|
~/.kward/anthropic_auth.json
|
|
129
129
|
~/.kward/github_auth.json
|
|
130
130
|
~/.kward/PRINCIPLES.md
|
|
131
|
-
~/.kward/
|
|
131
|
+
~/.kward/kwshrc
|
|
132
132
|
~/.kward/prompts/
|
|
133
133
|
~/.kward/skills/
|
|
134
134
|
~/.kward/plugins/
|
|
@@ -169,24 +169,51 @@ Project-local hooks can also live in `.kward/hooks.json`, but Kward loads them o
|
|
|
169
169
|
|
|
170
170
|
## Embedded shell config
|
|
171
171
|
|
|
172
|
-
The embedded Kward shell (`/shell`, internally `
|
|
172
|
+
The embedded Kward shell (`/shell`, internally `kwsh`) reads the shell-style rc files `~/.kward/kwshrc` and `~/.kwshrc`, in that order. When `KWARD_CONFIG_PATH` is set, the first path is beside that config file instead. Later rc entries override earlier aliases and exported variables.
|
|
173
173
|
|
|
174
|
-
Example:
|
|
174
|
+
Example rc file:
|
|
175
|
+
|
|
176
|
+
```sh
|
|
177
|
+
alias ll='ls -la'
|
|
178
|
+
alias gs="git status --short"
|
|
179
|
+
export BUNDLE_WITHOUT=production
|
|
180
|
+
export PATH="$HOME/bin:$PATH"
|
|
181
|
+
source ~/.kward/kwsh-aliases
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Only declarative `alias`, `export`, and `source` (or `.`) directives are handled. `source` parses the referenced file without executing it, resolving relative paths from the containing rc file. Other shell scripting is ignored for now.
|
|
185
|
+
|
|
186
|
+
### Shell-agent model
|
|
175
187
|
|
|
176
|
-
|
|
177
|
-
env:
|
|
178
|
-
FORCE_COLOR: "1"
|
|
179
|
-
CLICOLOR_FORCE: "1"
|
|
188
|
+
The transient shell assistant normally follows the active conversation's model and reasoning effort. Override those defaults in the main JSON configuration:
|
|
180
189
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
190
|
+
```json
|
|
191
|
+
{
|
|
192
|
+
"shell": {
|
|
193
|
+
"agent": {
|
|
194
|
+
"provider": "openrouter",
|
|
195
|
+
"model": "openai/gpt-5.6-sol",
|
|
196
|
+
"reasoning_effort": "none"
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
185
200
|
```
|
|
186
201
|
|
|
187
|
-
`
|
|
202
|
+
The optional `provider` selects a different backend for the transient shell assistant. Use the lowercase configuration IDs listed in [Model providers](providers.md). When it is omitted, the shell assistant follows the active conversation's provider, model, and reasoning effort. If a provider is explicitly configured without a model or reasoning effort, Kward uses that provider's defaults rather than inheriting values from the active conversation.
|
|
188
203
|
|
|
189
|
-
|
|
204
|
+
Environment variables take precedence over the JSON settings:
|
|
205
|
+
|
|
206
|
+
```sh
|
|
207
|
+
export KWSH_PROVIDER="openrouter"
|
|
208
|
+
export KWSH_MODE="openai/gpt-5.6-sol"
|
|
209
|
+
export KWSH_REASONING="none"
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
`KWSH_PROVIDER` selects the shell-agent provider, `KWSH_MODE` selects its model, and `KWSH_REASONING` selects its reasoning effort. Empty values are ignored.
|
|
213
|
+
|
|
214
|
+
`export` values are applied when shell mode starts, after Kward's conservative color defaults, and are also available to leading-`!` commands. Keys must be valid environment-variable names; invalid keys are ignored. Values support shell quoting and simple `$VAR`/`${VAR}` expansion. `/shell` keeps one persistent local interactive shell process per tab.
|
|
215
|
+
|
|
216
|
+
`alias` entries expand the first word of a command once. For example, `alias ll='ls -la'` makes `ll lib` run `ls -la lib`. Configured aliases are available both inside `/shell` and after the normal composer's `!` prefix, including command-name Tab completion. Built-in shell commands such as `cd`, `pwd`, `export`, `unset`, `alias`, `capture`, `clear`, `pty`, and `exit` take precedence over aliases inside `/shell`. External commands receive an interactive PTY by default. Prefix a submitted line with `?` inside `/shell` to ask the transient shell assistant about the current command output or state. An alias value can begin with `capture` when its `/shell` output should use the configured timeout, output limit, and transcript sanitization. Leading-`!` alias invocations are always interactive, so Kward removes a leading `capture` or legacy `pty` mode marker from the expanded alias before execution. Run `alias` inside `kwsh` to list configured aliases. Aliases created at runtime with that built-in belong only to the current `/shell` session and are not available to `!command` input.
|
|
190
217
|
|
|
191
218
|
## Provider and model settings
|
|
192
219
|
|
|
@@ -236,7 +263,7 @@ Model settings:
|
|
|
236
263
|
|
|
237
264
|
`model` is a legacy generic fallback. Provider-specific values take precedence. Catalog providers use `<runtime-id>_model`; for example, direct OpenAI uses `openai_api_model`, Gemini uses `gemini_model`, and Groq uses `groq_model`. Codex keeps `openai_model`. `reasoning_effort` and `thinking_level` are generic reasoning settings. `thinking_level` is an alias for `reasoning_effort` honored by all providers. For each provider, Kward resolves reasoning in this order: the provider-specific key (for example `openai_reasoning_effort`), then the generic `reasoning_effort`, then `thinking_level`, then the default `medium`. `openai_reasoning_effort`, `anthropic_reasoning_effort`, `openrouter_reasoning_effort`, and `copilot_reasoning_effort` are provider-specific forms.
|
|
238
265
|
|
|
239
|
-
|
|
266
|
+
OpenAI-hosted models do not expose their raw reasoning tokens. Kward displays the reasoning summaries and visible Codex commentary they provide. Set `codex_show_raw_reasoning` to `true` only for a backend that emits raw Codex `reasoning_text`; it defaults to `false` because raw reasoning can include internal or unstable model output.
|
|
240
267
|
|
|
241
268
|
`stream_idle_timeout_seconds` limits how long a streamed Codex, Anthropic, or Local response may go without receiving data. It defaults to `120`; set a positive value to override it. When the provider is silent longer than this limit, Kward closes the request and applies its normal transient-network retry behavior.
|
|
242
269
|
|
|
@@ -248,7 +275,7 @@ Defaults:
|
|
|
248
275
|
- Copilot: `gpt-5-mini`
|
|
249
276
|
- Reasoning effort: `medium`
|
|
250
277
|
|
|
251
|
-
The Anthropic model choices include `claude-fable-5`,
|
|
278
|
+
The Anthropic model choices include `claude-fable-5`, `claude-opus-5`, and `claude-sonnet-5`. Fable and Opus availability depends on the logged-in account and organization. Selecting a model without access returns an Anthropic provider error. Kward keeps Sonnet 5 as its default because it supports both Pro and Max subscriptions; select Opus 5 explicitly when it is available on the account.
|
|
252
279
|
|
|
253
280
|
The interactive `/model` picker reads cached OpenRouter models when available. Run `kward openrouter refresh` to fetch text-capable models available to the configured OpenRouter API key and cache them under `~/.kward/cache/openrouter_models.json`. Run `kward openrouter list` to inspect the cached model ids.
|
|
254
281
|
|
|
@@ -393,6 +420,22 @@ The built-in TUI file editor supports three keybinding modes. Modern is the defa
|
|
|
393
420
|
|
|
394
421
|
`mode` can be `modern`, `emacs`, or `vibe`. The old `default` value is still accepted as an alias for `modern`. You can change this from `/settings` → Interface → Editor mode; newly opened editor buffers pick up the setting immediately.
|
|
395
422
|
|
|
423
|
+
Vibe `:prompt` uses a dedicated transient editor agent. Configure its model and reasoning effort under `editor.agent` when it should differ from the active tab:
|
|
424
|
+
|
|
425
|
+
```json
|
|
426
|
+
{
|
|
427
|
+
"editor": {
|
|
428
|
+
"agent": {
|
|
429
|
+
"provider": "anthropic",
|
|
430
|
+
"model": "claude-sonnet-5",
|
|
431
|
+
"reasoning_effort": "medium"
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
The optional `provider` selects a different backend for the transient editor assistant. Use the lowercase configuration IDs listed in [Model providers](providers.md). When it is omitted, the editor assistant follows the active tab's provider, model, and reasoning effort. `KWARD_EDITOR_PROVIDER` can override the JSON provider for one-off runs. If a provider is explicitly configured without a model or reasoning effort, Kward uses that provider's defaults rather than inheriting values from the active tab. Editor-agent prompts and tool activity are kept out of the normal transcript and session history; the editor remains visible with a spinner while the transient turn runs.
|
|
438
|
+
|
|
396
439
|
The integrated Git and session diff viewers support unified and side-by-side layouts:
|
|
397
440
|
|
|
398
441
|
```json
|
|
@@ -405,6 +448,27 @@ The integrated Git and session diff viewers support unified and side-by-side lay
|
|
|
405
448
|
|
|
406
449
|
`diff_view` can be `auto`, `unified`, or `side_by_side`. In `auto` mode, Kward uses side-by-side output when the terminal is at least 120 columns wide and unified output in narrower terminals. Change it with `/settings` → Interface → Diff view.
|
|
407
450
|
|
|
451
|
+
### Editor runners
|
|
452
|
+
|
|
453
|
+
The editor can run the current in-memory buffer for supported scratchpad languages and normal files. It never saves a normal file automatically before running. Configure runner binaries under `editor.runners`; omitted entries use the built-in defaults.
|
|
454
|
+
|
|
455
|
+
```json
|
|
456
|
+
{
|
|
457
|
+
"editor": {
|
|
458
|
+
"runners": {
|
|
459
|
+
"node": { "binary": "node" },
|
|
460
|
+
"python": { "binary": ".venv/bin/python" },
|
|
461
|
+
"shell": { "binary": "/bin/bash" },
|
|
462
|
+
"go": { "binary": "/usr/local/go/bin/go" }
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
`binary` may be an executable name resolved through `PATH`, an absolute path, or a relative path resolved from the active workspace. JavaScript and TypeScript use the `node` runner. TypeScript `.ts` buffers require a Node version with built-in TypeScript support; Node strips erasable types but does not type-check the buffer or read `tsconfig.json`. Node's built-in support does not run `.tsx` buffers. Runner processes execute directly without a shell.
|
|
469
|
+
|
|
470
|
+
The initial runnable languages are Ruby, JavaScript, TypeScript, Python, Shell, Lua, Julia, Elixir, Crystal, Go, and Swift. Other highlighted languages remain editor-only until they have a suitable execution model.
|
|
471
|
+
|
|
408
472
|
The editor includes syntax highlighting, automatic indentation, and matching-pair insertion for common languages. Unknown file types and color-disabled terminals use plain text. See [Integrated editor](editor.md#What_the_editor_supports) for the supported languages and detailed editing behavior.
|
|
409
473
|
|
|
410
474
|
Auto-indent and matching-pair insertion are enabled by default. To disable either feature:
|
|
@@ -517,22 +581,20 @@ Manual `/compact [instructions]` works even when auto-compaction is disabled.
|
|
|
517
581
|
|
|
518
582
|
## Pan mode
|
|
519
583
|
|
|
520
|
-
`kward pan` starts a
|
|
584
|
+
`kward pan` starts a local web UI and requires HTTP Basic Auth. Configure credentials before starting it:
|
|
521
585
|
|
|
522
586
|
```json
|
|
523
587
|
{
|
|
524
588
|
"pan_mode": {
|
|
525
|
-
"host": "0.0.0.0",
|
|
526
|
-
"port": 8765,
|
|
527
589
|
"username": "kward",
|
|
528
590
|
"password": "choose-a-private-password"
|
|
529
591
|
}
|
|
530
592
|
}
|
|
531
593
|
```
|
|
532
594
|
|
|
533
|
-
`host` defaults to `
|
|
595
|
+
`host` defaults to `127.0.0.1` and `port` defaults to `8765`. Set `host` to `0.0.0.0` only when you intentionally want access from another device on a trusted LAN. Kward prints a warning for every non-loopback binding because Pan uses plain HTTP without TLS.
|
|
534
596
|
|
|
535
|
-
|
|
597
|
+
Kward fails to start Pan unless `username` and either `password` or the `KWARD_PAN_PASSWORD` environment variable are configured. Config-file credentials are stored in plaintext; use a unique password and do not share the file. Pan exposes the agent's file, shell, web, and configured extension tools to anyone who can connect and authenticate. See [Pan mode](pan.md) for the full browser workflow, session behavior, security guidance, and limitations.
|
|
536
598
|
|
|
537
599
|
## Web search
|
|
538
600
|
|
data/doc/editor.md
CHANGED
|
@@ -23,7 +23,7 @@ cd ~/code/my-project
|
|
|
23
23
|
kward edit lib/kward/agent.rb
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
Kward uses the current directory as the workspace, opens the file in the integrated editor, and exits when you close the editor. Use `--working-directory` when the file belongs to another workspace:
|
|
26
|
+
Kward uses the current directory as the workspace, opens the file in the integrated editor, and exits when you close the editor. During an interactive chat session, you can also ask Kward to open a workspace file for you; it uses the `open_editor` tool when that capability is available. Opening the editor does not change or save the file unless you choose to do so. Use `--working-directory` when the file belongs to another workspace:
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
29
|
kward --working-directory ~/code/my-project edit lib/kward/agent.rb
|
|
@@ -43,18 +43,23 @@ For a nested project tree, run:
|
|
|
43
43
|
/files
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
In the tree browser, use `↑`/`↓` to move, `←`/`→` to collapse or expand directories, `Enter` to toggle a directory or open a file, `Tab` or `/` to search, `@` to insert the selected file as an `@path` mention, and `Esc` to close. When you open a file from `/files`, quitting the editor returns to the browser at the same position.
|
|
46
|
+
In the tree browser, use `↑`/`↓` to move, `←`/`→` to collapse or expand directories, `Enter` to toggle a directory or open a file, `Tab` or `/` to search, `i` to show or hide Git-ignored files, `f` to create a file, `d` to create a directory, `r` to rename the selected entry, `Backspace` to delete after confirmation, `@` to insert the selected file as an `@path` mention, and `Esc` to close. Create and rename names are entered in the prompt and must be single entry names. When you open a file from `/files`, quitting the editor returns to the browser at the same position.
|
|
47
47
|
|
|
48
48
|
For an unsaved buffer, open a scratchpad:
|
|
49
49
|
|
|
50
50
|
```text
|
|
51
51
|
/scratchpad
|
|
52
52
|
/scratchpad markdown
|
|
53
|
-
/scratchpad
|
|
53
|
+
/scratchpad js
|
|
54
|
+
/scratchpad python
|
|
55
|
+
/scratchpad help
|
|
54
56
|
```
|
|
55
57
|
|
|
56
|
-
Scratchpads
|
|
57
|
-
|
|
58
|
+
Scratchpads accept canonical language names and familiar file-extension shortcuts. For example, `js` selects JavaScript, `py` selects Python, `rb` selects Ruby, `yml` selects YAML, `cs` selects C#, and `cpp` selects C++. Use `/scratchpad help` to print the complete list of names and aliases.
|
|
59
|
+
|
|
60
|
+
All 26 built-in syntax-highlighted languages are available: Ruby, ERB, Crystal, Elixir, Julia, JavaScript, TypeScript, JSON, Markdown, YAML, Shell, Makefile, HTML, CSS, SCSS, Python, Go, Rust, Java, C#, C, C++, Swift, Kotlin, Lua, and SQL. Markdown buffers also apply the tagged language highlighter, auto-indentation, and endwise behavior inside fenced code blocks, such as a fence tagged `ruby` or `js`; unknown tags remain readable as plain text. Scratchpads use a matching virtual filename such as `scratchpad.js` or `scratchpad.py`; in Vibe mode, save one to a real file with `:w filename`.
|
|
61
|
+
|
|
62
|
+
Supported editable buffers can run with `:run` in Vibe mode or `Ctrl+R` in Modern mode. This works for both scratchpads and normal editor files. Kward runs the current in-memory buffer, including unsaved changes, without saving the file automatically. It opens a read-only output pane in the lower half of the editor with the captured output, exit status, and duration. Drag with the mouse to make a virtual selection inside the output, then press `Ctrl+C` or `Cmd+C` to copy it (`y` in Vibe mode). Only the selected output text is copied; pane borders are excluded. `Cmd+C` requires the terminal to forward the Command key to Kward. Press `Esc` to return to editing, use the arrow or page keys to scroll, and press `Ctrl+C` without a selection to cancel a running buffer. Runnable languages are Ruby, JavaScript, TypeScript, Python, Shell, Lua, Julia, Elixir, Crystal, Go, and Swift; other languages currently provide editing and highlighting only.
|
|
58
63
|
|
|
59
64
|
```ruby
|
|
60
65
|
puts "foo"
|
|
@@ -63,14 +68,14 @@ __END__
|
|
|
63
68
|
foo
|
|
64
69
|
```
|
|
65
70
|
|
|
66
|
-
The next run receives the current `__END__` section as Ruby `DATA
|
|
71
|
+
The next run receives the current `__END__` section as Ruby `DATA`; the output window is refreshed without changing the source buffer.
|
|
67
72
|
|
|
68
73
|
You can also type a relative path yourself and press `Enter`. If the file does not exist, Kward asks whether to create it.
|
|
69
74
|
|
|
70
75
|
A few things to know:
|
|
71
76
|
|
|
72
77
|
- `$` only opens the editor when it is the first character in the composer.
|
|
73
|
-
- `/scratchpad` opens a plain-text scratchpad; pass
|
|
78
|
+
- `/scratchpad` opens a plain-text scratchpad; pass a language name or shortcut to select syntax highlighting. `/scratchpad help` lists the available choices.
|
|
74
79
|
- Once a file or scratchpad opens, the composer becomes the editor.
|
|
75
80
|
- Save or quit to return to normal chat.
|
|
76
81
|
- If the file changed on disk while you were editing, Kward asks before overwriting it.
|
|
@@ -85,21 +90,26 @@ $doc/editor.md
|
|
|
85
90
|
1. Type `$doc/editor.md` in the composer.
|
|
86
91
|
2. Pick the file from the matching results, or press `Enter` if the path is already complete.
|
|
87
92
|
3. Edit the file.
|
|
88
|
-
4.
|
|
89
|
-
5.
|
|
90
|
-
6.
|
|
93
|
+
4. In Vibe normal mode, use `:prompt <instruction>` to ask the agent to update the current in-memory buffer. In Modern mode, press `Ctrl+.` and type the instruction in the editor prompt line. For example, `write a HelloWorld class`.
|
|
94
|
+
5. The editor stays visible while the agent works; its status line shows a spinner. Review the generated buffer and save with `Ctrl+S` in Modern mode, `C-x C-s` in Emacs mode, or `:w` in Vibe mode. For an unsaved scratchpad in Vibe mode, use `:w filename`.
|
|
95
|
+
6. Quit with `Ctrl+Q`, `C-x C-c`, or `:q`.
|
|
96
|
+
7. Continue chatting with Kward.
|
|
91
97
|
|
|
92
98
|
## What the editor supports
|
|
93
99
|
|
|
94
100
|
The editor is intentionally compact, but it covers the basics you need for quick changes:
|
|
95
101
|
|
|
96
102
|
- Syntax highlighting for common languages, including Ruby, ERB templates, Crystal, Elixir, Julia, JavaScript, TypeScript, JSON, Markdown, YAML, Shell, Makefile, HTML, CSS, SCSS, Python, Go, Rust, Java, C#, C, C++, Swift, Kotlin, Lua, and SQL. ERB highlights template HTML outside ERB tags and Ruby inside `<% ... %>` tags. Unknown file types render as plain text.
|
|
97
|
-
-
|
|
103
|
+
- Current-buffer word completion. After a partial word, Tab completes from words elsewhere in the active buffer; repeated Tab presses cycle nearby matches. Completion is case-sensitive and recognizes letters, numbers, and underscores. No project files or external sources are searched.
|
|
104
|
+
- Auto-indent, enabled by default. New lines inherit indentation. When word completion does not apply, Tab jumps to the expected indentation or the next indentation stop. Shift+Tab moves indentation back, obvious closing tokens are re-indented, and Backspace in leading whitespace removes one indentation unit when possible. ERB recognizes common inline Ruby control tags and HTML opening tags when calculating the next indentation. For Ruby, Crystal, Elixir, Julia, Lua, Makefiles, and shell scripts, Enter after a block opener inserts the matching closing keyword; Ctrl+Enter also works from the middle of the line in terminals that report modified Enter keys.
|
|
98
105
|
- Undo and redo, with up to 100 history entries per buffer.
|
|
99
106
|
- Incremental search forward and backward.
|
|
100
107
|
- Selection, copy, cut, and paste. Copy and cut also write to the terminal clipboard through OSC 52 when the terminal supports it.
|
|
101
108
|
- A line-number gutter and a status line that shows the current mode and prompts.
|
|
102
109
|
- Soft-wrap, enabled by default so long lines wrap within the editor width instead of scrolling sideways. Disable it with `editor.soft_wrap: false`.
|
|
110
|
+
- Vibe `:prompt <instruction>` and Modern `Ctrl+.` prompt lines send the complete current buffer and document metadata to a dedicated, transient editor agent. The agent can replace the in-memory buffer through an explicit editor tool; it does not save files automatically.
|
|
111
|
+
- Editor prompts and their tool activity are not added to the normal chat transcript or session history.
|
|
112
|
+
- The editor remains visible and locked for editing while the agent runs. Its status line displays progress and a spinner; `Ctrl+C` cancels the request.
|
|
103
113
|
|
|
104
114
|
## Choosing an editor mode
|
|
105
115
|
|
|
@@ -122,12 +132,16 @@ You can also configure it in `config.json`:
|
|
|
122
132
|
```json
|
|
123
133
|
{
|
|
124
134
|
"editor": {
|
|
125
|
-
"mode": "modern"
|
|
135
|
+
"mode": "modern",
|
|
136
|
+
"agent": {
|
|
137
|
+
"model": "gpt-5.5",
|
|
138
|
+
"reasoning_effort": "medium"
|
|
139
|
+
}
|
|
126
140
|
}
|
|
127
141
|
}
|
|
128
142
|
```
|
|
129
143
|
|
|
130
|
-
`mode` can be `modern`, `emacs`, or `vibe`. The old `default` value is still accepted as an alias for `modern`.
|
|
144
|
+
`mode` can be `modern`, `emacs`, or `vibe`. The optional `editor.agent.model` and `editor.agent.reasoning_effort` settings configure the dedicated Vibe editor agent. They use the active tab's provider. When either value is omitted, it falls back to the active tab's setting and then the client default. Editor-agent turns use a dedicated system prompt and are not persisted in the active tab transcript. The old `default` value is still accepted as an alias for `modern`.
|
|
131
145
|
|
|
132
146
|
To disable auto-indent or auto-close pairs:
|
|
133
147
|
|
|
@@ -156,6 +170,7 @@ Modern mode is the default and is the easiest place to start. It uses common ter
|
|
|
156
170
|
| --------------------- | ------------------------------------------------- |
|
|
157
171
|
| `Ctrl+S` | Save |
|
|
158
172
|
| `Ctrl+Q` | Quit; press again to discard unsaved changes |
|
|
173
|
+
| `Ctrl+.` | Open the editor-agent prompt line |
|
|
159
174
|
| `/` | Search forward |
|
|
160
175
|
| `?` | Search backward |
|
|
161
176
|
| `Ctrl+C` | Copy selection, or cancel search |
|
|
@@ -192,7 +207,7 @@ Modern mode is the default and is the easiest place to start. It uses common ter
|
|
|
192
207
|
| `Home` / `End` | Move to start / end of line |
|
|
193
208
|
| `PageUp` / `PageDown` | Scroll |
|
|
194
209
|
| `Enter` | Insert newline, or confirm search |
|
|
195
|
-
| `Tab` |
|
|
210
|
+
| `Tab` | Complete a buffer word, or smart-indent when no match exists |
|
|
196
211
|
| `Shift+Tab` | Move indentation back by one stop |
|
|
197
212
|
| `Backspace` | Delete before cursor |
|
|
198
213
|
| `Delete` | Delete character at cursor |
|
|
@@ -233,7 +248,7 @@ Emacs mode is for users who prefer classic Emacs-style non-modal editing. Save a
|
|
|
233
248
|
| `Home` / `End` | Move to start / end of line |
|
|
234
249
|
| `PageUp` / `PageDown` | Scroll |
|
|
235
250
|
| `Enter` | Insert newline, or confirm search |
|
|
236
|
-
| `Tab` |
|
|
251
|
+
| `Tab` | Complete a buffer word, or smart-indent when no match exists |
|
|
237
252
|
| `Shift+Tab` | Move indentation back by one stop |
|
|
238
253
|
| `Backspace` | Delete before cursor |
|
|
239
254
|
| `Delete` / `C-d` | Delete character at cursor |
|
|
@@ -242,7 +257,7 @@ Emacs mode is for users who prefer classic Emacs-style non-modal editing. Save a
|
|
|
242
257
|
|
|
243
258
|
Vibe mode is a modal editor built for Kward, inspired by classic Vi and Vim. If you already know Vim, you will feel at home here. Files open in normal mode, where keys run commands. Press `i`, `a`, `o`, or another insert command to type text, then press `Esc` to return to normal mode.
|
|
244
259
|
|
|
245
|
-
It supports a compact but practical modal-editing set: counts, operators with motions, visual selections, visual block edits, marks, registers, macros, search, repeat (`.`), Ruby-aware navigation, and `:` commands. It is not a full Vim clone — there are no splits or ex-mode scripting — but it covers everyday keyboard editing inside the conversation.
|
|
260
|
+
It supports a compact but practical modal-editing set: counts, operators with motions, visual selections, multi-cursor and visual block edits, marks, registers, macros, search, repeat (`.`), Ruby-aware navigation, and `:` commands. It is not a full Vim clone — there are no splits or ex-mode scripting — but it covers everyday keyboard editing inside the conversation.
|
|
246
261
|
|
|
247
262
|
The status line always shows the current mode (`NORMAL`, `INSERT`, `VISUAL`, `REPLACE`, or `:`) so you never lose track of where you are.
|
|
248
263
|
|
|
@@ -278,7 +293,7 @@ Use normal mode for movement, operators, marks, registers, macros, search, and c
|
|
|
278
293
|
| `Ctrl+K` | Move up by indentation level |
|
|
279
294
|
| `Ctrl+F` | Page down |
|
|
280
295
|
| `Ctrl+B` | Page up |
|
|
281
|
-
| `Ctrl+D` |
|
|
296
|
+
| `Ctrl+D` | Select the next occurrence and enter insert mode |
|
|
282
297
|
| `Ctrl+U` | Half page up |
|
|
283
298
|
| `Ctrl+E` | Scroll down one line |
|
|
284
299
|
| `Ctrl+Y` | Scroll up one line |
|
|
@@ -344,17 +359,20 @@ Use normal mode for movement, operators, marks, registers, macros, search, and c
|
|
|
344
359
|
|
|
345
360
|
### Visual mode
|
|
346
361
|
|
|
347
|
-
Visual mode uses the same motion language as normal mode where practical. Start characterwise visual mode with `v`, linewise mode with `V`, or visual block mode with `Ctrl+V`.
|
|
362
|
+
Visual mode uses the same motion language as normal mode where practical. Arrow keys and plain `h`/`j`/`k`/`l` extend the selection. Start characterwise visual mode with `v`, linewise mode with `V`, or visual block mode with `Ctrl+V`.
|
|
348
363
|
|
|
349
364
|
| Key | Action |
|
|
350
365
|
| ----------------------- | ----------------------------------------------- |
|
|
351
366
|
| `o` | Switch active end of visual selection |
|
|
367
|
+
| `Ctrl+h` / `Ctrl+l` | Outdent / indent selected lines |
|
|
368
|
+
| `Ctrl+j` / `Ctrl+k` | Move selected lines down / up |
|
|
352
369
|
| `G` / `gg` / `N`motion | Extend visual selection with counts/motions |
|
|
353
370
|
| `%`, `f`/`F`/`t`/`T` | Extend visual selection with advanced motions |
|
|
354
371
|
| `iw` / `a(` / `ip` | Select visual text objects |
|
|
355
372
|
| `>` / `<` | Indent / outdent selected lines |
|
|
356
373
|
| `=` | Reindent selected lines |
|
|
357
|
-
| `I` / `A` | Insert /
|
|
374
|
+
| `I` / `A` | Insert cursors at the start / end of each selected line |
|
|
375
|
+
| `Ctrl+D` | Add the next occurrence of a characterwise selection |
|
|
358
376
|
| `J` | Join selected lines |
|
|
359
377
|
| `~` / `u` / `U` | Swapcase / lowercase / uppercase selection |
|
|
360
378
|
| `/` / `?` / `n` / `N` | Extend visual selection with search |
|
|
@@ -370,7 +388,7 @@ Vibe insert mode also supports readline-style shortcuts for efficient editing wi
|
|
|
370
388
|
| ---------------- | ---------------------------------------- |
|
|
371
389
|
| type text | Insert characters |
|
|
372
390
|
| `Enter` | Insert newline |
|
|
373
|
-
| `Tab` |
|
|
391
|
+
| `Tab` | Complete a buffer word, or smart-indent when no match exists |
|
|
374
392
|
| `Shift+Tab` | Move indentation back by one stop |
|
|
375
393
|
| `Backspace` | Delete before cursor |
|
|
376
394
|
| `Delete` | Delete character at cursor |
|
|
@@ -378,7 +396,7 @@ Vibe insert mode also supports readline-style shortcuts for efficient editing wi
|
|
|
378
396
|
| `Ctrl+E` | Move to end of line |
|
|
379
397
|
| `Ctrl+B` | Move left |
|
|
380
398
|
| `Ctrl+F` | Move right |
|
|
381
|
-
| `Ctrl+D` |
|
|
399
|
+
| `Ctrl+D` | Select the next occurrence |
|
|
382
400
|
| `Ctrl+K` | Kill to end of line |
|
|
383
401
|
| `Ctrl+U` | Kill to start of line |
|
|
384
402
|
| `Ctrl+W` | Delete word before cursor |
|
|
@@ -406,7 +424,7 @@ Typing an opening bracket (`(`, `[`, `{`) or quote (`"`, `'`, `` ` ``) in visual
|
|
|
406
424
|
|
|
407
425
|
### Command mode
|
|
408
426
|
|
|
409
|
-
Enter command mode with `:` from normal mode. Type a command and press `Enter`. Press `Esc` or `Ctrl+C` to cancel.
|
|
427
|
+
Enter command mode with `:` from normal mode. Type a command and press `Enter`. Press `Esc` or `Ctrl+C` to cancel. From visual mode, `:` starts the command with the selected line range (`'<,'>`), as in Vim.
|
|
410
428
|
|
|
411
429
|
| Command | Action |
|
|
412
430
|
| ------- | ------------------------------------------ |
|
|
@@ -416,6 +434,13 @@ Enter command mode with `:` from normal mode. Type a command and press `Enter`.
|
|
|
416
434
|
| `:wq` | Save and quit |
|
|
417
435
|
| `:x` | Save if changed, then quit |
|
|
418
436
|
| `:N` | Go to line `N` |
|
|
437
|
+
| `:run` | Run the complete current supported editor buffer; inside a Markdown fence, run that block into its `<output>` field |
|
|
438
|
+
| `:run all` | Run every runnable Markdown fenced block sequentially into its `<output>` field |
|
|
439
|
+
| `:prompt instruction` | Ask the editor agent to update the buffer |
|
|
440
|
+
| `:s/a/b/g` | Substitute `a` with `b` |
|
|
441
|
+
| `:'<,'>s/a/b/g` | Substitute only across the visual selection |
|
|
442
|
+
|
|
443
|
+
Visual line ranges apply to `:s` and `:run`. For `:run`, select the body or complete fence of one Markdown code block with a runnable language, or place the cursor inside that block without making a selection; Kward runs that block and inserts or replaces a formatted `<output>` field without opening the output pane. `:run all` executes every runnable fenced block in document order, skips unlabeled or unsupported fences, continues after failures, and writes each runner error into that block's output field. An existing output field is searched for after the block until the next code fence, so inline fields are reformatted too. Without a matching output field, one is inserted directly below the block with one blank line. Other commands retain their normal save, navigation, file, and quit behavior.
|
|
419
444
|
|
|
420
445
|
### Vibe design notes
|
|
421
446
|
|
data/doc/files.md
CHANGED
|
@@ -12,7 +12,7 @@ From an interactive Kward session, run:
|
|
|
12
12
|
/files
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Kward opens the project file browser. Use the arrow keys or `j`/`k` to move through the tree, then press `Enter` on a file to open it in the integrated editor. Supported images (PNG, JPEG, GIF, and WebP) open as read-only inline previews when the terminal supports Kitty or iTerm2 image sequences.
|
|
15
|
+
Kward opens the project file browser. Use the arrow keys or `j`/`k` to move through the tree, then press `Enter` on a file to open it in the integrated editor. Supported images (PNG, JPEG, GIF, and WebP) open as read-only inline previews when the terminal supports Kitty or iTerm2 image sequences. Use `f` for a new file, `d` for a new directory, or `r` to rename the selected file or directory; type the single entry name in the prompt and press `Enter`.
|
|
16
16
|
|
|
17
17
|
When you quit the editor or close an image preview, Kward returns to the file browser at the same position so you can keep browsing nearby files.
|
|
18
18
|
|
|
@@ -24,7 +24,7 @@ Inside a Git repository, `/files` uses Git's project view:
|
|
|
24
24
|
git ls-files --cached --others --exclude-standard
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
That means tracked files and normal untracked files appear, while ignored files stay out of the list.
|
|
27
|
+
That means tracked files and normal untracked files appear by default, while ignored files stay out of the list. Press `i` in the tree view to show or hide Git-ignored files; Kward remembers this choice for the workspace.
|
|
28
28
|
|
|
29
29
|
Outside Git, Kward scans the workspace directory and skips common noisy directories such as `.git`, `.yardoc`, `_yardoc`, `node_modules`, `rdoc`, `tmp`, and `vendor/bundle`.
|
|
30
30
|
|
|
@@ -39,7 +39,12 @@ Outside Git, Kward scans the workspace directory and skips common noisy director
|
|
|
39
39
|
| `Tab` | Start or stop search |
|
|
40
40
|
| `/` | Start search |
|
|
41
41
|
| `Backspace` | Delete the last search character |
|
|
42
|
-
| `
|
|
42
|
+
| `i` | Show or hide Git-ignored files |
|
|
43
|
+
| `f` | Create a file beneath the selected directory, or beside the selected file |
|
|
44
|
+
| `d` | Create a directory beneath the selected directory, or beside the selected file |
|
|
45
|
+
| `r` | Rename the selected file or directory; the prompt starts with its current name |
|
|
46
|
+
| `Backspace` | Start deletion confirmation for the selected file or directory |
|
|
47
|
+
| `Esc` | Leave search or name entry; cancel deletion; press again to close the browser |
|
|
43
48
|
| `Q` | Close an image preview |
|
|
44
49
|
| `+` / `-` | Zoom an image preview in / out |
|
|
45
50
|
| `@` | Insert the selected file as an `@path` mention |
|
|
@@ -90,9 +95,9 @@ See [Integrated editor](editor.md) for editor modes, save/quit keys, search, sel
|
|
|
90
95
|
|
|
91
96
|
## Remembered state
|
|
92
97
|
|
|
93
|
-
Kward remembers the expanded folders
|
|
98
|
+
Kward remembers the expanded folders, selected path, and Git-ignored file visibility for each workspace. The next time you open `/files` in the same project, it restores the browser close to where you left it.
|
|
94
99
|
|
|
95
|
-
Search itself is temporary. Closing search returns to the normal tree, and closing the browser leaves your chat session intact.
|
|
100
|
+
Search itself is temporary. Closing search returns to the normal tree, and closing the browser leaves your chat session intact. Create and rename operations reject existing names rather than replacing them; name entry accepts only one file or directory name, not a path. Backspace requires confirmation before deleting. Non-empty directories display an additional warning and require a second confirmation before recursive deletion.
|
|
96
101
|
|
|
97
102
|
## Image previews
|
|
98
103
|
|
|
@@ -102,5 +107,5 @@ Image previews are read-only and replace the file-list overlay while leaving the
|
|
|
102
107
|
|
|
103
108
|
- `/files` is only available in the interactive prompt.
|
|
104
109
|
- It opens files inside the current workspace.
|
|
105
|
-
- It is a focused project browser, not a full file manager: it does not
|
|
106
|
-
- Ignored Git files are
|
|
110
|
+
- It is a focused project browser, not a full file manager: it does not move or copy files.
|
|
111
|
+
- Ignored Git files are hidden by default when Git can provide the file list; press `i` in the tree view to show them.
|
data/doc/getting-started.md
CHANGED
|
@@ -7,6 +7,7 @@ This page gets you from install to a first useful chat.
|
|
|
7
7
|
## Requirements
|
|
8
8
|
|
|
9
9
|
- Ruby 3.4 or newer.
|
|
10
|
+
- macOS or Linux. WSL is best effort; native Windows is not currently supported. See [Platform support](platform-support.md).
|
|
10
11
|
- Credentials for one model provider. The easiest setup is `kward login` or `/login` inside Kward.
|
|
11
12
|
- Bundler only if you run Kward from a source checkout.
|
|
12
13
|
|
|
@@ -96,6 +97,8 @@ Find where user authentication is implemented and summarize the flow.
|
|
|
96
97
|
|
|
97
98
|
Kward can read files, suggest edits, apply changes, and run commands from the workspace. Existing files must be read in the current conversation before Kward can edit them.
|
|
98
99
|
|
|
100
|
+
The composer footer highlights the two main discovery shortcuts: type `/` to browse commands and `@` to find and mention project files. If no model provider is connected, the startup screen points directly to `/login` and `/model` before you submit a prompt.
|
|
101
|
+
|
|
99
102
|
## Ask one question and exit
|
|
100
103
|
|
|
101
104
|
For quick tasks, pass the prompt directly:
|
data/doc/pan.md
CHANGED
|
@@ -8,39 +8,41 @@ Use it when you want to work from another browser or device on a trusted network
|
|
|
8
8
|
|
|
9
9
|
Pan is a small local HTTP server, not a hosted service. The machine running Kward performs model requests, reads and edits workspace files, runs tools, and stores sessions.
|
|
10
10
|
|
|
11
|
-
Pan requires HTTP Basic Auth. Add
|
|
11
|
+
Pan requires HTTP Basic Auth. Add a username and password to `~/.kward/config.json`:
|
|
12
12
|
|
|
13
13
|
```json
|
|
14
14
|
{
|
|
15
15
|
"pan_mode": {
|
|
16
|
-
"host": "0.0.0.0",
|
|
17
|
-
"port": 8765,
|
|
18
16
|
"username": "kward",
|
|
19
17
|
"password": "choose-a-long-private-password"
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
20
|
```
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
Pan listens on `127.0.0.1:8765` by default, so only browsers on the same machine can connect. Kward refuses to start Pan unless a username and password are available.
|
|
23
|
+
|
|
24
|
+
To keep the password out of `config.json`, omit `password` and provide it when starting Pan:
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
-
|
|
26
|
+
```bash
|
|
27
|
+
KWARD_PAN_PASSWORD="choose-a-long-private-password" kward pan
|
|
28
|
+
```
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
When stored in `config.json`, the password is plaintext. Do not reuse an important password or share the file. Environment variables avoid config-file storage but may still be visible to processes or shell-history tooling on your machine.
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
To use Pan from another device on a trusted LAN, explicitly listen on all interfaces:
|
|
32
33
|
|
|
33
34
|
```json
|
|
34
35
|
{
|
|
35
36
|
"pan_mode": {
|
|
36
|
-
"host": "
|
|
37
|
+
"host": "0.0.0.0",
|
|
37
38
|
"port": 8765,
|
|
38
|
-
"username": "kward"
|
|
39
|
-
"password": "choose-a-long-private-password"
|
|
39
|
+
"username": "kward"
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
+
Then start Pan with `KWARD_PAN_PASSWORD` or add the password to that configuration. Kward prints a plain-HTTP exposure warning whenever Pan binds to a non-loopback address.
|
|
45
|
+
|
|
44
46
|
## Start Pan
|
|
45
47
|
|
|
46
48
|
Run Pan from the project it should control:
|
|
@@ -56,12 +58,14 @@ Or select the workspace explicitly:
|
|
|
56
58
|
kward --working-directory ~/code/my-project pan
|
|
57
59
|
```
|
|
58
60
|
|
|
59
|
-
Kward prints the listening URL, workspace, and initial session path. With the default
|
|
61
|
+
Kward prints the listening URL, workspace, and initial session path. With the default loopback binding, open:
|
|
60
62
|
|
|
61
63
|
```text
|
|
62
|
-
http://
|
|
64
|
+
http://127.0.0.1:8765/
|
|
63
65
|
```
|
|
64
66
|
|
|
67
|
+
With an explicit `0.0.0.0` LAN binding, Kward detects and prints the machine's routed LAN address when available, such as `http://192.168.1.25:8765/`.
|
|
68
|
+
|
|
65
69
|
Your browser asks for the configured Basic Auth username and password.
|
|
66
70
|
|
|
67
71
|
Press `Ctrl+C` in the server terminal to stop Pan. Closing a browser tab does not stop the server or an active turn.
|
|
@@ -142,8 +146,8 @@ Pan exposes powerful agent tools through ordinary HTTP. Basic Auth protects ever
|
|
|
142
146
|
|
|
143
147
|
Use these precautions:
|
|
144
148
|
|
|
145
|
-
-
|
|
146
|
-
-
|
|
149
|
+
- Keep the default `127.0.0.1` binding when remote access is unnecessary.
|
|
150
|
+
- Bind to `0.0.0.0` only on a network and machine you trust.
|
|
147
151
|
- Do not expose the port directly to the public internet.
|
|
148
152
|
- Do not put Pan behind a public tunnel unless you provide a properly secured TLS/authentication boundary and understand the risk.
|
|
149
153
|
- Use a unique password and protect `config.json`.
|
data/doc/permissions.md
CHANGED
|
@@ -176,6 +176,7 @@ The policy runs before Kward dispatches a model-requested tool. It does not cons
|
|
|
176
176
|
- a permitted shell command can access files, processes, credentials, and network services available to your user account;
|
|
177
177
|
- command-text rules are useful review controls, not a reliable way to enforce network destinations or all subprocess behavior;
|
|
178
178
|
- direct commands that you type yourself—`!command`, `/capture`, `/shell`, and `/pty`—are treated as your actions and are outside this first policy scope;
|
|
179
|
+
- commands run by the transient `?` shell assistant go through the normal permission and hook checks but deliberately use the user-owned `/shell` process, so the command sandbox cannot contain them;
|
|
179
180
|
- plugins, hooks, and MCP servers are trusted local extensions with their own process access.
|
|
180
181
|
|
|
181
182
|
For sensitive work, use a restricted operating-system account, container, virtual machine, or disposable checkout. [Command sandboxing](sandboxing.md) is a separate, opt-in operating-system boundary for model-requested `run_shell_command` workers. It can add filesystem and child-network restrictions, but does not cover Kward's host process, extensions, or direct interactive commands.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Platform support
|
|
2
|
+
|
|
3
|
+
Kward is a terminal application built around Ruby, PTYs, filesystem tools, and operating-system command boundaries. The core agent works across Unix-like systems, while a few terminal and sandbox features depend on the host platform.
|
|
4
|
+
|
|
5
|
+
## Support matrix
|
|
6
|
+
|
|
7
|
+
| Platform | Support level | Notes |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| macOS | Supported | Primary support for the interactive TUI, PTY handoff, editor, shell, Pan, RPC, and Seatbelt command sandboxing. |
|
|
10
|
+
| Linux | Supported | Interactive TUI, PTY handoff, editor, shell, Pan, and RPC are supported. Bubblewrap is required for OS-enforced command sandboxing. |
|
|
11
|
+
| WSL | Best effort | Core CLI behavior should work under a current WSL environment. Clipboard, browser launch, inline images, PTY controls, and host integration vary by terminal and Windows configuration. |
|
|
12
|
+
| Native Windows | Unsupported | Kward currently depends on Unix-style PTY and process behavior. Use WSL rather than a native Windows Ruby installation. |
|
|
13
|
+
|
|
14
|
+
Kward requires Ruby 3.4 or newer. CI exercises Ruby 3.4 and the current Ruby release on Linux. Releases are developed and used on macOS as well.
|
|
15
|
+
|
|
16
|
+
## Terminal expectations
|
|
17
|
+
|
|
18
|
+
Use a modern UTF-8 terminal with ANSI control-sequence support. Basic chat works without optional graphics protocols. Some features depend on terminal capabilities:
|
|
19
|
+
|
|
20
|
+
- modified keys such as Shift+Return and Ctrl+Tab may be intercepted by the terminal;
|
|
21
|
+
- inline images require iTerm2 or a recognized Kitty-compatible terminal;
|
|
22
|
+
- full-screen child applications temporarily own the terminal through PTY handoff;
|
|
23
|
+
- Nerd Font project-file icons are opt-in because Kward cannot detect the configured font.
|
|
24
|
+
|
|
25
|
+
See [Interactive composer](composer.md) for keyboard fallbacks and [Embedded shell](shell.md) for PTY behavior.
|
|
26
|
+
|
|
27
|
+
## Sandboxing
|
|
28
|
+
|
|
29
|
+
Command sandboxing is opt-in and platform-specific:
|
|
30
|
+
|
|
31
|
+
- macOS uses Seatbelt profiles;
|
|
32
|
+
- Linux uses Bubblewrap and requires a host configuration that permits unprivileged namespaces;
|
|
33
|
+
- WSL support depends on the Linux distribution and host namespace policy;
|
|
34
|
+
- native Windows has no supported command sandbox backend.
|
|
35
|
+
|
|
36
|
+
When Kward cannot enforce a requested non-off sandbox mode, it fails closed rather than silently running the model-requested command without that boundary. See [Command sandboxing](sandboxing.md) for setup and exact limits.
|
|
37
|
+
|
|
38
|
+
## Reporting a platform problem
|
|
39
|
+
|
|
40
|
+
Run these commands first:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
ruby --version
|
|
44
|
+
kward --version
|
|
45
|
+
kward doctor
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
When opening a bug report, include the operating system, terminal, Ruby version, Kward version, and the smallest reproduction. Remove credentials, private paths, repository content, and sensitive command output before posting logs.
|