@diffexai/diffex 0.2.4 → 0.2.6

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.
Files changed (81) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/AGENTS.md +0 -11
  4. package/dist/core/agent-session.d.ts +0 -1
  5. package/dist/core/agent-session.js +3 -10
  6. package/dist/core/sdk.js +1 -1
  7. package/dist/core/system-prompt-production.d.ts +7 -0
  8. package/dist/core/system-prompt-production.js +102 -0
  9. package/dist/core/system-prompt.d.ts +2 -2
  10. package/dist/core/system-prompt.js +34 -35
  11. package/dist/core/tools/subagents.js +22 -9
  12. package/dist/modes/print-mode.js +12 -14
  13. package/dist/node_modules/@diffexai/diffex-agent-core/distribution-components.json +4 -4
  14. package/dist/node_modules/@diffexai/diffex-agent-core/distribution-files.json +1 -1
  15. package/dist/node_modules/@diffexai/diffex-agent-core/package.json +1 -1
  16. package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/.manifest.json +1 -1
  17. package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/amazon-bedrock.json +1 -1
  18. package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
  19. package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/fireworks.json +1 -1
  20. package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/mistral.json +1 -1
  21. package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/nvidia.json +1 -1
  22. package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/openrouter.json +1 -1
  23. package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
  24. package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/qwen-token-plan.json +1 -1
  25. package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  26. package/dist/node_modules/@diffexai/diffex-ai/distribution-components.json +3 -3
  27. package/dist/node_modules/@diffexai/diffex-ai/distribution-files.json +11 -11
  28. package/dist/node_modules/@diffexai/diffex-ai/package.json +1 -1
  29. package/dist/node_modules/@diffexai/diffex-client/distribution-components.json +3 -3
  30. package/dist/node_modules/@diffexai/diffex-client/distribution-files.json +1 -1
  31. package/dist/node_modules/@diffexai/diffex-client/package.json +1 -1
  32. package/dist/node_modules/@diffexai/diffex-harness-state/distribution-components.json +2 -2
  33. package/dist/node_modules/@diffexai/diffex-harness-state/distribution-files.json +1 -1
  34. package/dist/node_modules/@diffexai/diffex-harness-state/package.json +1 -1
  35. package/dist/node_modules/@diffexai/diffex-protocol/distribution-components.json +2 -2
  36. package/dist/node_modules/@diffexai/diffex-protocol/distribution-files.json +1 -1
  37. package/dist/node_modules/@diffexai/diffex-protocol/package.json +1 -1
  38. package/dist/node_modules/@diffexai/diffex-telemetry/distribution-components.json +2 -2
  39. package/dist/node_modules/@diffexai/diffex-telemetry/distribution-files.json +1 -1
  40. package/dist/node_modules/@diffexai/diffex-telemetry/package.json +1 -1
  41. package/dist/node_modules/@diffexai/diffex-tui/distribution-components.json +2 -2
  42. package/dist/node_modules/@diffexai/diffex-tui/distribution-files.json +1 -1
  43. package/dist/node_modules/@diffexai/diffex-tui/package.json +1 -1
  44. package/dist/server/create-harness.js +1 -1
  45. package/distribution-components.json +11 -11
  46. package/distribution-files.json +49 -41
  47. package/npm-shrinkwrap.json +2 -2
  48. package/package.json +1 -31
  49. package/release/distribution-manifest.json +4 -4
  50. package/release/install-package-lock.json +5 -5
  51. package/release/install-package.json +2 -2
  52. package/docs/compaction.md +0 -401
  53. package/docs/containerization.md +0 -84
  54. package/docs/custom-provider.md +0 -774
  55. package/docs/environment-variables.md +0 -88
  56. package/docs/evolution.md +0 -90
  57. package/docs/extensions.md +0 -2982
  58. package/docs/images/interactive-mode.png +0 -0
  59. package/docs/images/tree-view.png +0 -0
  60. package/docs/installation.md +0 -118
  61. package/docs/json.md +0 -91
  62. package/docs/keybindings.md +0 -241
  63. package/docs/llama-cpp.md +0 -99
  64. package/docs/models.md +0 -565
  65. package/docs/packages.md +0 -232
  66. package/docs/prompt-templates.md +0 -96
  67. package/docs/providers.md +0 -317
  68. package/docs/quickstart.md +0 -161
  69. package/docs/rpc.md +0 -1647
  70. package/docs/sdk.md +0 -1332
  71. package/docs/security.md +0 -66
  72. package/docs/session-format.md +0 -438
  73. package/docs/sessions.md +0 -162
  74. package/docs/settings.md +0 -341
  75. package/docs/shell-aliases.md +0 -13
  76. package/docs/skills.md +0 -227
  77. package/docs/terminal-setup.md +0 -152
  78. package/docs/themes.md +0 -326
  79. package/docs/tmux.md +0 -63
  80. package/docs/tui.md +0 -940
  81. package/docs/usage.md +0 -434
Binary file
Binary file
@@ -1,118 +0,0 @@
1
- # Install, update, and remove Diffex
2
-
3
- Diffex is distributed through npmjs.org as `@diffexai/diffex`.
4
- Use Node.js 22.19.0 or newer and npm on macOS or Linux, on arm64 or x64.
5
- Windows, Android/Termux, standalone binaries, and additional installation channels are not accepted release targets.
6
- The hosted runtime image is for the cloud service.
7
-
8
- ## Install and verify
9
-
10
- ```sh
11
- node --version
12
- npm --version
13
- npm install -g --ignore-scripts --registry=https://registry.npmjs.org @diffexai/diffex
14
- diffex --version
15
- diffex --help
16
- diffex --list-models
17
- ```
18
-
19
- Only the CLI package is needed; its internal Diffex modules are included.
20
- `--ignore-scripts` disables dependency installation scripts.
21
- Npm verifies downloaded package bytes against registry integrity metadata.
22
- For a reproducible installation, replace the package argument with `@diffexai/diffex@<verified-version>`, using an exact version you have checked on npmjs.org.
23
-
24
- The executable directory is `$(npm prefix -g)/bin` on supported platforms.
25
- If `diffex` is not found, add that directory to your shell's PATH:
26
-
27
- ```sh
28
- export PATH="$(npm prefix -g)/bin:$PATH"
29
- command -v diffex
30
- diffex --version
31
- ```
32
-
33
- Persist the PATH setting in your shell configuration if necessary.
34
- Use a Node version manager or a user-writable npm prefix when the global directory is not writable.
35
- Changing Node installations can change the npm prefix; check `command -v diffex` after switching.
36
-
37
- Start `diffex` in your project directory, use `/login` to configure your provider, and send a short prompt.
38
- See [Quickstart](quickstart.md) and [Providers](providers.md) for authentication and execution.
39
-
40
- ## Upgrade
41
-
42
- ```sh
43
- diffex update --self
44
- diffex --version
45
- ```
46
-
47
- Self-update validates the response from `https://api.diffex.ai/api/latest-version` and installs exactly `@diffexai/diffex@<verified-version>` using the detected package manager.
48
- It rejects malformed metadata, foreign package names, redirects, and unavailable discovery before starting installation.
49
- `--force` permits reinstalling a verified release; it does not bypass identity checks.
50
- The discovery service can report no generally announced release even when a bootstrap package exists on npm.
51
-
52
- To install a reviewed npm version directly, including when discovery has no release:
53
-
54
- ```sh
55
- npm install -g --ignore-scripts --registry=https://registry.npmjs.org '@diffexai/diffex@<verified-version>'
56
- diffex --version
57
- ```
58
-
59
- Replace `<verified-version>` before running the command.
60
- Use your original npm prefix if it differs from the active default.
61
- Legacy clients that still trust Pi cannot migrate just by contacting the Diffex endpoint.
62
- Install the canonical package directly with the command above, then verify `command -v diffex` and `diffex --version`.
63
-
64
- ## Recover an interrupted installation
65
-
66
- Npm owns replacement of an npm installation.
67
- If an update was interrupted or `diffex` no longer starts, repeat the pinned npm install command with the same verified version and prefix, then check `diffex --version` and `diffex --help`.
68
- Do not remove your user-data directory to repair an executable installation.
69
- Npm can begin filesystem replacement before a download finishes.
70
- If retrying reports `ENOTEMPTY` while renaming to a `.diffex-...` backup, move that reported backup directory aside.
71
- If npm instead reports `ENOTEMPTY` while removing a dependency inside `$(npm root -g)/@diffexai/diffex`, move that complete CLI installation directory aside.
72
- This preserves the partially installed package and lets npm install into an empty destination.
73
- Use a separate backup directory and retry:
74
-
75
- ```sh
76
- DIFFEX_RECOVERY_FROM='/exact/affected/CLI/installation/or/backup'
77
- DIFFEX_RECOVERY_DIR="$(mktemp -d)"
78
- mv "$DIFFEX_RECOVERY_FROM" "$DIFFEX_RECOVERY_DIR/"
79
- npm install -g --ignore-scripts --registry=https://registry.npmjs.org '@diffexai/diffex@<verified-version>'
80
- diffex --version
81
- diffex --help
82
- ```
83
-
84
- Replace both placeholders with the affected Diffex installation or backup path and the verified version.
85
- Move only the `@diffexai/diffex` package directory or its reported `.diffex-...` backup, preserving it until the repaired installation works.
86
- Do not move the global prefix, its shared `node_modules`, or another package.
87
- This procedure does not move or delete your settings or sessions.
88
-
89
- ## Remove
90
-
91
- ```sh
92
- npm uninstall -g --ignore-scripts @diffexai/diffex
93
- command -v diffex
94
- ```
95
-
96
- Use the npm prefix that installed the executable.
97
- The final command should find no executable unless another installation remains on PATH.
98
- If your shell caches command locations, open a new terminal or refresh its command cache.
99
-
100
- Removal retains settings, credentials, sessions, installed extensions, and harness data under `~/.diffex/agent/`, or the directory selected by `DIFFEX_CODING_AGENT_DIR`.
101
- Project `.diffex` directories and any separately configured session directory are also retained.
102
- Keep this data for reinstallation; delete it separately only if you intend to erase it.
103
-
104
- ## Bun package installations
105
-
106
- The same npm package can also be installed by Bun while running on Node:
107
-
108
- ```sh
109
- bun install -g --ignore-scripts @diffexai/diffex
110
- diffex --version
111
- diffex update --self
112
- bun uninstall -g @diffexai/diffex
113
- ```
114
-
115
- Use `bun pm bin -g` to locate Bun's global executable directory and add it to PATH.
116
- Pin direct upgrades to the reviewed `@diffexai/diffex@<verified-version>` in the install command.
117
- Use the manager that owns the installation for repair and removal.
118
- User data follows the same retention policy.
package/docs/json.md DELETED
@@ -1,91 +0,0 @@
1
- # JSON Event Stream Mode
2
-
3
- ```bash
4
- diffex --mode json "Your prompt"
5
- ```
6
-
7
- Outputs all session events as JSON lines to stdout. Useful for integrating Diffex into other tools or custom UIs.
8
-
9
- ## Event Types
10
-
11
- Wire events use `JsonAgentSessionEvent`. It matches
12
- [`AgentSessionEvent`](https://github.com/diffexai/diffex/blob/main/packages/coding-agent/src/core/agent-session.ts)
13
- except that streaming message updates omit cumulative snapshots:
14
-
15
- ```typescript
16
- type WithoutPartial<T> = T extends { partial: unknown } ? Omit<T, "partial"> : T;
17
-
18
- type JsonAgentSessionEvent =
19
- | Exclude<AgentSessionEvent, { type: "message_update" }>
20
- | {
21
- type: "message_update";
22
- assistantMessageEvent: WithoutPartial<AssistantMessageEvent>;
23
- };
24
- ```
25
-
26
- `queue_update` emits the full pending steering and follow-up queues whenever they change. `compaction_start` and `compaction_end` cover both manual and automatic compaction.
27
-
28
- Other base events come from
29
- [`AgentEvent`](https://github.com/diffexai/diffex/blob/main/packages/agent/src/types.ts):
30
-
31
- ```typescript
32
- type AgentEvent =
33
- // Agent lifecycle
34
- | { type: "agent_start" }
35
- | { type: "agent_end"; messages: AgentMessage[] }
36
- // Turn lifecycle
37
- | { type: "turn_start" }
38
- | { type: "turn_end"; message: AgentMessage; toolResults: ToolResultMessage[] }
39
- // Message lifecycle
40
- | { type: "message_start"; message: AgentMessage }
41
- | { type: "message_update"; message: AgentMessage; assistantMessageEvent: AssistantMessageEvent }
42
- | { type: "message_end"; message: AgentMessage }
43
- // Tool execution
44
- | { type: "tool_execution_start"; toolCallId: string; toolName: string; args: any }
45
- | { type: "tool_execution_update"; toolCallId: string; toolName: string; args: any; partialResult: any }
46
- | { type: "tool_execution_end"; toolCallId: string; toolName: string; result: any; isError: boolean };
47
- ```
48
-
49
- ## Message Types
50
-
51
- Base messages from [`packages/ai/src/types.ts`](https://github.com/diffexai/diffex/blob/main/packages/ai/src/types.ts#L134):
52
- - `UserMessage` (line 134)
53
- - `AssistantMessage` (line 140)
54
- - `ToolResultMessage` (line 152)
55
-
56
- Extended messages from [`packages/coding-agent/src/core/messages.ts`](https://github.com/diffexai/diffex/blob/main/packages/coding-agent/src/core/messages.ts#L29):
57
- - `BashExecutionMessage` (line 29)
58
- - `CustomMessage` (line 46)
59
- - `BranchSummaryMessage` (line 55)
60
- - `CompactionSummaryMessage` (line 62)
61
-
62
- ## Output Format
63
-
64
- Each line is a JSON object. The first line is the session header:
65
-
66
- ```json
67
- {"type":"session","version":3,"id":"uuid","timestamp":"...","cwd":"/path"}
68
- ```
69
-
70
- Followed by events as they occur:
71
-
72
- ```json
73
- {"type":"agent_start"}
74
- {"type":"turn_start"}
75
- {"type":"message_start","message":{"role":"assistant","content":[],...}}
76
- {"type":"message_update","assistantMessageEvent":{"type":"text_delta","contentIndex":0,"delta":"Hello"}}
77
- {"type":"message_end","message":{...}}
78
- {"type":"turn_end","message":{...},"toolResults":[]}
79
- {"type":"agent_end","messages":[...]}
80
- ```
81
-
82
- `message_update` records are delta-only. They omit both the cumulative `message` field and
83
- `assistantMessageEvent.partial` to keep stream size linear. Use `contentIndex` and `delta`
84
- to assemble live text, thinking, or tool-call arguments if needed. `message_end` contains
85
- the final authoritative message.
86
-
87
- ## Example
88
-
89
- ```bash
90
- diffex --mode json "List files" 2>/dev/null | jq -c 'select(.type == "message_end")'
91
- ```
@@ -1,241 +0,0 @@
1
- # Keybindings
2
-
3
- All keyboard shortcuts can be customized via `~/.diffex/agent/keybindings.json`. Each action can be bound to one or more keys.
4
-
5
- The config file uses the same namespaced keybinding ids that Diffex uses internally and that extension authors use in `keyHint()` and injected `keybindings` managers.
6
-
7
- Older configs using pre-namespaced ids such as `cursorUp` or `expandTools` are migrated automatically to the namespaced ids on startup.
8
-
9
- After editing `keybindings.json`, run `/reload` in Diffex to apply the changes without restarting the session.
10
-
11
- ## Key Format
12
-
13
- `modifier+key` where modifiers are `ctrl`, `shift`, `alt`, `super` (combinable) and keys are:
14
-
15
- - **Letters:** `a-z`
16
- - **Digits:** `0-9`
17
- - **Special:** `escape`, `esc`, `enter`, `return`, `tab`, `space`, `backspace`, `delete`, `insert`, `clear`, `home`, `end`, `pageUp`, `pageDown`, `up`, `down`, `left`, `right`
18
- - **Function:** `f1`-`f12`
19
- - **Symbols:** `` ` ``, `-`, `=`, `[`, `]`, `\`, `;`, `'`, `,`, `.`, `/`, `!`, `@`, `#`, `$`, `%`, `^`, `&`, `*`, `(`, `)`, `_`, `+`, `|`, `~`, `{`, `}`, `:`, `<`, `>`, `?`
20
-
21
- Modifier combinations: `ctrl+shift+x`, `alt+ctrl+x`, `ctrl+shift+alt+x`, `super+k`, `ctrl+super+k`, `ctrl+1`, etc.
22
-
23
- `super` bindings require a terminal that reports the modifier separately, typically through the Kitty keyboard protocol. They may not work in terminals without that support.
24
-
25
- ## All Actions
26
-
27
- ### TUI Editor Cursor Movement
28
-
29
- | Keybinding id | Default | Description |
30
- |--------|---------|-------------|
31
- | `tui.editor.cursorUp` | `up` | Move cursor up, browsing older history at the top |
32
- | `tui.editor.cursorDown` | `down` | Move cursor down, browsing newer history at the bottom |
33
- | `tui.editor.historyPrevious` | *(none)* | Select the previous prompt history entry |
34
- | `tui.editor.historyNext` | *(none)* | Select the next prompt history entry |
35
- | `tui.editor.cursorLeft` | `left`, `ctrl+b` | Move cursor left |
36
- | `tui.editor.cursorRight` | `right`, `ctrl+f` | Move cursor right |
37
- | `tui.editor.cursorWordLeft` | `alt+left`, `ctrl+left`, `alt+b` | Move cursor word left |
38
- | `tui.editor.cursorWordRight` | `alt+right`, `ctrl+right`, `alt+f` | Move cursor word right |
39
- | `tui.editor.cursorLineStart` | `home`, `ctrl+home`, `ctrl+a` | Move to line start |
40
- | `tui.editor.cursorLineEnd` | `end`, `ctrl+end`, `ctrl+e` | Move to line end |
41
- | `tui.editor.jumpForward` | `ctrl+]` | Jump forward to character |
42
- | `tui.editor.jumpBackward` | `ctrl+alt+]` | Jump backward to character |
43
- | `tui.editor.pageUp` | `pageUp`, `ctrl+pageUp` | Scroll up by page |
44
- | `tui.editor.pageDown` | `pageDown`, `ctrl+pageDown` | Scroll down by page |
45
-
46
- The dedicated history actions always change history entries, regardless of the cursor position in a multiline prompt. Explicit history bindings take precedence over application actions while the main editor is focused, so binding `tui.editor.historyPrevious` to `ctrl+p` overrides model cycling in that context without changing `Ctrl+P` in selectors.
47
-
48
- ### TUI Editor Deletion
49
-
50
- | Keybinding id | Default | Description |
51
- |--------|---------|-------------|
52
- | `tui.editor.deleteCharBackward` | `backspace` | Delete character backward |
53
- | `tui.editor.deleteCharForward` | `delete`, `ctrl+d` | Delete character forward |
54
- | `tui.editor.deleteWordBackward` | `ctrl+w`, `alt+backspace` | Delete word backward |
55
- | `tui.editor.deleteWordForward` | `alt+d`, `alt+delete` | Delete word forward |
56
- | `tui.editor.deleteToLineStart` | `ctrl+u` | Delete to line start |
57
- | `tui.editor.deleteToLineEnd` | `ctrl+k` | Delete to line end |
58
-
59
- ### TUI Input
60
-
61
- | Keybinding id | Default | Description |
62
- |--------|---------|-------------|
63
- | `tui.input.newLine` | `shift+enter`, `ctrl+j` | Insert new line |
64
- | `tui.input.submit` | `enter` | Submit input |
65
- | `tui.input.tab` | `tab` | Tab / autocomplete |
66
-
67
- ### TUI Kill Ring
68
-
69
- | Keybinding id | Default | Description |
70
- |--------|---------|-------------|
71
- | `tui.editor.yank` | `ctrl+y` | Paste most recently deleted text |
72
- | `tui.editor.yankPop` | `alt+y` | Cycle through deleted text after yank |
73
- | `tui.editor.undo` | `ctrl+-` | Undo last edit |
74
-
75
- ### TUI Clipboard and Selection
76
-
77
- | Keybinding id | Default | Description |
78
- |--------|---------|-------------|
79
- | `tui.input.copy` | `ctrl+c` | Copy selection |
80
- | `tui.select.up` | `up` | Move selection up |
81
- | `tui.select.down` | `down` | Move selection down |
82
- | `tui.select.pageUp` | `pageUp` | Page up in list |
83
- | `tui.select.pageDown` | `pageDown` | Page down in list |
84
- | `tui.select.confirm` | `enter` | Confirm selection |
85
- | `tui.select.cancel` | `escape`, `ctrl+c` | Cancel selection |
86
-
87
- ### TUI Fullscreen Viewport
88
-
89
- These actions apply when interactive mode uses `--tui-mode fullscreen` and target the primary transcript scroll region. Two-finger trackpad and mouse-wheel input scroll the region under the pointer, falling back to the transcript over the fixed editor/status/footer dock. Clicking an OSC 8 hyperlink opens it in the default handler. Dragging with the primary mouse button selects text and copies it to the clipboard; holding at the transcript's top or bottom edge auto-scrolls into off-screen content.
90
-
91
- Fullscreen transcript bindings take precedence over editor bindings. The default unmodified navigation keys therefore control the transcript in fullscreen mode, while their `ctrl` variants continue to control the editor. Outside fullscreen mode, both variants control the editor.
92
-
93
- | Key | Default mode | Fullscreen mode |
94
- |-----|--------------|-----------------|
95
- | `home`, `end` | Editor | Transcript |
96
- | `ctrl+home`, `ctrl+end` | Editor | Editor |
97
- | `pageUp`, `pageDown` | Editor | Transcript |
98
- | `ctrl+pageUp`, `ctrl+pageDown` | Editor | Editor |
99
-
100
- This routing remains configurable through the ordinary action bindings. For example, `"tui.altScreen.pageUp": "ctrl+pageUp"` makes `pageUp` control the editor and `ctrl+pageUp` control the transcript in fullscreen mode. Bind `tui.altScreen.halfPageUp` and `tui.altScreen.halfPageDown` for smaller transcript steps while keeping the full-page bindings. Setting `"tui.altScreen.pageUp": []` disables that transcript shortcut entirely. User bindings replace the defaults for that action.
101
-
102
- | Keybinding id | Default | Description |
103
- |--------|---------|-------------|
104
- | `tui.altScreen.pageUp` | `pageUp` | Scroll the transcript up by one page |
105
- | `tui.altScreen.pageDown` | `pageDown` | Scroll the transcript down by one page |
106
- | `tui.altScreen.halfPageUp` | *(none)* | Scroll the transcript up by half a page |
107
- | `tui.altScreen.halfPageDown` | *(none)* | Scroll the transcript down by half a page |
108
- | `tui.altScreen.previousPrompt` | `ctrl+shift+up` | Jump to the previous marked message |
109
- | `tui.altScreen.nextPrompt` | `ctrl+shift+down` | Jump to the next marked message |
110
- | `tui.altScreen.top` | `home` | Scroll to the beginning of the transcript |
111
- | `tui.altScreen.bottom` | `end` | Scroll to the transcript end and follow new output |
112
-
113
- ### Application
114
-
115
- | Keybinding id | Default | Description |
116
- |--------|---------|-------------|
117
- | `app.interrupt` | `escape` | Cancel / abort |
118
- | `app.clear` | `ctrl+c` | Clear editor (first) / exit (second) |
119
- | `app.exit` | `ctrl+d` | Exit (when editor empty) |
120
- | `app.suspend` | `ctrl+z` (none on Windows) | Suspend to background |
121
- | `app.editor.external` | `ctrl+g` | Open in external editor (`externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere) |
122
- | `app.clipboard.pasteImage` | `ctrl+v` (`alt+v` on Windows) | Paste image or text from clipboard |
123
-
124
- ### Sessions
125
-
126
- | Keybinding id | Default | Description |
127
- |--------|---------|-------------|
128
- | `app.session.new` | *(none)* | Start a new session (`/new`) |
129
- | `app.session.tree` | *(none)* | Open session tree navigator (`/tree`) |
130
- | `app.session.fork` | *(none)* | Fork current session (`/fork`) |
131
- | `app.session.resume` | *(none)* | Open session resume picker (`/resume`) |
132
- | `app.session.togglePath` | `ctrl+p` | Toggle path display |
133
- | `app.session.toggleSort` | `ctrl+s` | Toggle sort mode |
134
- | `app.session.toggleNamedFilter` | `ctrl+n` | Toggle named-only filter |
135
- | `app.session.rename` | `ctrl+r` | Rename session |
136
- | `app.session.delete` | `ctrl+d` | Delete session |
137
- | `app.session.deleteNoninvasive` | `ctrl+backspace` | Delete session when query is empty |
138
-
139
- ### Collaboration Modes, Models, and Thinking
140
-
141
- | Keybinding id | Default | Description |
142
- |--------|---------|-------------|
143
- | `app.mode.toggle` | `shift+tab` | Toggle Default and Plan collaboration modes |
144
- | `app.model.select` | `ctrl+l` | Open model selector |
145
- | `app.model.cycleForward` | `ctrl+p` | Cycle to next model |
146
- | `app.model.cycleBackward` | `shift+ctrl+p` | Cycle to previous model |
147
- | `app.thinking.cycle` | *(none)* | Cycle thinking level |
148
- | `app.thinking.toggle` | `ctrl+t` | Collapse or expand thinking blocks |
149
-
150
- Shift+Tab enters or leaves interactive Plan mode. Select a model through `/model` or Ctrl+L to choose its thinking level; bind `app.thinking.cycle` explicitly if you also want a shortcut for cycling it.
151
-
152
- ### Display and Message Queue
153
-
154
- | Keybinding id | Default | Description |
155
- |--------|---------|-------------|
156
- | `app.tools.expand` | `ctrl+o` | Collapse or expand tool output |
157
- | `app.message.copy` | `ctrl+x` | Copy the last assistant message, or the selected message in `/tree` |
158
- | `app.message.followUp` | `alt+enter` | Queue follow-up message |
159
- | `app.message.dequeue` | `alt+up` | Restore queued messages to editor |
160
-
161
- ### Tree Navigation
162
-
163
- | Keybinding id | Default | Description |
164
- |--------|---------|-------------|
165
- | `app.tree.foldOrUp` | `ctrl+left`, `alt+left` | Fold current branch segment, or jump to the previous segment start |
166
- | `app.tree.unfoldOrDown` | `ctrl+right`, `alt+right` | Unfold current branch segment, or jump to the next segment start or branch end |
167
- | `app.tree.editLabel` | `shift+l` | Edit the label on the selected tree node |
168
- | `app.tree.toggleLabelTimestamp` | `shift+t` | Toggle label timestamps in the tree |
169
- | `app.tree.filter.default` | `ctrl+d` | Set tree filter to default view |
170
- | `app.tree.filter.noTools` | `ctrl+t` | Toggle tree filter that hides tool results |
171
- | `app.tree.filter.userOnly` | `ctrl+u` | Toggle tree filter that shows only user messages |
172
- | `app.tree.filter.labeledOnly` | `ctrl+l` | Toggle tree filter that shows only labeled entries |
173
- | `app.tree.filter.all` | `ctrl+a` | Toggle tree filter that shows all entries |
174
- | `app.tree.filter.cycleForward` | `ctrl+o` | Cycle tree filter forward |
175
- | `app.tree.filter.cycleBackward` | `shift+ctrl+o` | Cycle tree filter backward |
176
-
177
- ### Skills Selector
178
-
179
- Used inside the skill picker opened via `/skills`.
180
-
181
- | Keybinding id | Default | Description |
182
- |--------|---------|-------------|
183
- | `app.skills.toggle` | `space` | Enable or disable the current skill without closing the selector |
184
-
185
- ### Scoped Models Selector
186
-
187
- Used inside the scoped models selector (opened via `/scoped-models`).
188
-
189
- | Keybinding id | Default | Description |
190
- |--------|---------|-------------|
191
- | `app.models.save` | `ctrl+s` | Save current model selection to settings |
192
- | `app.models.enableAll` | `ctrl+a` | Enable all models (or all matching the current search) |
193
- | `app.models.clearAll` | `ctrl+x` | Clear all models (or all matching the current search) |
194
- | `app.models.toggleProvider` | `ctrl+p` | Toggle all models for the current provider |
195
- | `app.models.reorderUp` | `alt+up` | Move the selected model up in the cycle order |
196
- | `app.models.reorderDown` | `alt+down` | Move the selected model down in the cycle order |
197
-
198
- ## Custom Configuration
199
-
200
- Create `~/.diffex/agent/keybindings.json`:
201
-
202
- ```json
203
- {
204
- "tui.editor.historyPrevious": "ctrl+p",
205
- "tui.editor.historyNext": "ctrl+n",
206
- "tui.editor.deleteWordBackward": ["ctrl+w", "alt+backspace"]
207
- }
208
- ```
209
-
210
- Each action can have a single key or an array of keys. User config overrides defaults.
211
-
212
- On native Windows, `app.suspend` has no default binding because Windows terminals do not support Unix job control. If you bind it manually, Diffex shows a status message instead of suspending. In WSL, the normal Linux `ctrl+z`/`fg` behavior still applies.
213
-
214
- ### Emacs Example
215
-
216
- ```json
217
- {
218
- "tui.editor.historyPrevious": "ctrl+p",
219
- "tui.editor.historyNext": "ctrl+n",
220
- "tui.editor.cursorLeft": ["left", "ctrl+b"],
221
- "tui.editor.cursorRight": ["right", "ctrl+f"],
222
- "tui.editor.cursorWordLeft": ["alt+left", "alt+b"],
223
- "tui.editor.cursorWordRight": ["alt+right", "alt+f"],
224
- "tui.editor.deleteCharForward": ["delete", "ctrl+d"],
225
- "tui.editor.deleteCharBackward": ["backspace", "ctrl+h"],
226
- "tui.input.newLine": ["shift+enter", "ctrl+j"]
227
- }
228
- ```
229
-
230
- ### Vim Example
231
-
232
- ```json
233
- {
234
- "tui.editor.cursorUp": ["up", "alt+k"],
235
- "tui.editor.cursorDown": ["down", "alt+j"],
236
- "tui.editor.cursorLeft": ["left", "alt+h"],
237
- "tui.editor.cursorRight": ["right", "alt+l"],
238
- "tui.editor.cursorWordLeft": ["alt+left", "alt+b"],
239
- "tui.editor.cursorWordRight": ["alt+right", "alt+w"]
240
- }
241
- ```
package/docs/llama-cpp.md DELETED
@@ -1,99 +0,0 @@
1
- # llama.cpp
2
-
3
- Diffex supports the [llama.cpp](https://github.com/ggml-org/llama.cpp) router server. The router discovers multiple GGUF models and loads or unloads them on demand.
4
-
5
- Use a current llama.cpp build with router support. Follow the [build instructions](https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md) or install a [prebuilt release](https://github.com/ggml-org/llama.cpp/releases) for your platform.
6
-
7
- ## Start the router
8
-
9
- Start `llama-server` without `--model` or `-m`. Passing a model starts single-model mode instead of router mode.
10
-
11
- ```bash
12
- llama-server \
13
- --models-dir ~/models \
14
- --no-models-autoload \
15
- --jinja \
16
- --host 127.0.0.1 \
17
- --port 8080 \
18
- -ngl 999 \
19
- -c 32768
20
- ```
21
-
22
- Important options:
23
-
24
- - `--models-dir ~/models` discovers local GGUF files.
25
- - `--no-models-autoload` keeps loading explicit through `/llama`.
26
- - `--jinja` enables compatible chat templates and tool calling.
27
- - `-ngl 999` offloads as many layers as possible to the GPU.
28
- - `-c 32768` sets the context window for each loaded model. Omit it to use the model's native context, which may require substantially more memory.
29
-
30
- A single-file model can sit directly in the model directory. Put multimodal and multi-shard models in separate subdirectories:
31
-
32
- ```text
33
- ~/models/
34
- ├── llama-3.2-1b-Q4_K_M.gguf
35
- ├── gemma-3-4b-it-Q4_K_M/
36
- │ ├── gemma-3-4b-it-Q4_K_M.gguf
37
- │ └── mmproj-F16.gguf
38
- └── large-model-Q4_K_M/
39
- ├── large-model-Q4_K_M-00001-of-00003.gguf
40
- ├── large-model-Q4_K_M-00002-of-00003.gguf
41
- └── large-model-Q4_K_M-00003-of-00003.gguf
42
- ```
43
-
44
- Restart the router after manually adding files. For per-model context sizes and other options, use [llama.cpp model presets](https://github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md#model-presets).
45
-
46
- ## Configure Diffex
47
-
48
- Start Diffex and configure the provider:
49
-
50
- ```text
51
- /login llama.cpp
52
- ```
53
-
54
- Enter the router URL and optional API key. The default URL is `http://127.0.0.1:8080`.
55
-
56
- Environment variables can configure the same values without `/login`:
57
-
58
- ```bash
59
- export LLAMA_BASE_URL=http://127.0.0.1:8080
60
- export LLAMA_API_KEY=optional-secret
61
- diffex
62
- ```
63
-
64
- If the server uses an API key, start `llama-server` with the matching `--api-key` value. Keep `--host 127.0.0.1` for local-only access.
65
-
66
- ## Manage models
67
-
68
- Run:
69
-
70
- ```text
71
- /llama
72
- ```
73
-
74
- - Select an unloaded model to load it.
75
- - Select a loaded model to unload it.
76
- - Select **Download model…**, search Hugging Face, then choose a repository and quantization. Exact `owner/repository[:quant]` values also work.
77
- - Press Escape during a load or download to confirm cancellation.
78
-
79
- Hugging Face search uses `HF_TOKEN` when set, then checks `$HF_TOKEN_PATH`, `$HF_HOME/token`, `$XDG_CACHE_HOME/huggingface/token`, and `~/.cache/huggingface/token`. Search also works without authentication, subject to lower rate limits. Diffex warns before downloading gated repositories and links to their access page. The llama.cpp server performs the download, so its process must also have `HF_TOKEN` when the selected repository requires access.
80
-
81
- If other models are loaded, Diffex asks whether to unload them first or keep them loaded. Diffex does not silently unload models and never deletes model files. The router may be shared with other clients, so `/llama` always displays the router's current state.
82
-
83
- Only loaded models appear in `/model`. After loading a model, run `/model` to select it for the current Diffex session.
84
-
85
- If the router disconnects, `/llama` shows **Retry** and **Close**. Retry reconnects and refreshes model state without replaying the interrupted operation.
86
-
87
- ## Troubleshooting
88
-
89
- Check that the router is reachable:
90
-
91
- ```bash
92
- curl http://127.0.0.1:8080/health
93
- curl http://127.0.0.1:8080/models
94
- ```
95
-
96
- - **No models in `/llama`:** Check `--models-dir`, the directory layout, and restart the router.
97
- - **Model missing from `/model`:** Load it with `/llama` first.
98
- - **Load fails or uses too much memory:** Lower `-c` or unload another model.
99
- - **Server is not in router mode:** Start it without `--model`, `-m`, or `-hf`.