qriton 0.3.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Marius Dima
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,372 @@
1
+ # Qriton CLI
2
+
3
+ Qriton CLI is the terminal coding agent. It runs on infrastructure you control. Local models, hosted APIs, and the session record stay in one place: the conversation, the tools, and the memory move with the work, not with the provider.
4
+
5
+ ```
6
+ qriton
7
+ ```
8
+
9
+ ## First session
10
+
11
+ Install [Node](https://nodejs.org) 22.16 or later on the 22.x line, or Node 24. Install [Ollama](https://ollama.com) and leave it running.
12
+
13
+ ```bash
14
+ npm install -g qriton
15
+ qriton pull qwen3.5:4b
16
+ qriton
17
+ ```
18
+
19
+ `qriton` starts on `qwen3.5:4b`. `qriton --light` uses that model for one bounded session: an 8K context, thinking disabled, and keyword memory. If the pull or the model does not start, run `qriton doctor`.
20
+
21
+ From the project directory, ask for a change. Qriton CLI shows the edit and waits.
22
+
23
+ ```text
24
+ Approval · File change
25
+ - # qriton
26
+ + # Qriton
27
+
28
+ [y approve] · n reject · a allow kind
29
+ ```
30
+
31
+ `y` writes the file. `n` leaves it unchanged. Nothing is written before you answer.
32
+
33
+ With this local model, the prompt and the files Qriton CLI reads stay on this machine. Selecting Grok, Claude, or OpenAI sends that context to the provider. The commands are below, after the description of the product.
34
+
35
+ ## What it is for
36
+
37
+ Qriton CLI keeps the evidence of a coding session attached to the session. You can change the model, resume the work, and inspect what was remembered.
38
+
39
+ **Local execution.** Models run through [Ollama](https://ollama.com) on your machine. A bare model name selects a local model. `qriton pull` downloads it. `qriton --light` runs a bounded session: 8K context, thinking disabled, keyword memory.
40
+
41
+ **Any model API, in the same session.** A prefix selects xAI, Anthropic, or OpenAI. `OPENAI_BASE_URL` selects an OpenAI-compatible endpoint, including OpenRouter, Groq, vLLM, and LM Studio. `/model` changes the model during a task. The transcript, approvals, and memory remain.
42
+
43
+ **Memory with a history.** Facts are stored as a graph: nodes, edges, revisions, and full-text search. A repeated fact reinforces the current one. A corrected fact keeps the previous wording. A fact that no longer applies can be removed. A pinned fact is retained. The next session recalls from that record.
44
+
45
+ **Hopfield recall.** `qriton pull bge-m3` installs the embedding model. With embeddings enabled, recall also reads the query against an energy landscape. A low-energy query matches a known basin. A high-energy query is new. A query between two basins — eureka — returns both. `/memory probe` compares ordinary recall with that reading. Keyword and graph recall remain available without embeddings.
46
+
47
+ **HLM.** The [HLM workbench](docs/hlm.md) keeps a base model's weights frozen and applies a reversible memory overlay: preview, compare the next token, apply, evaluate, restore. The operation is on the local model. It does not replace the model conducting the coding session.
48
+
49
+ **Energy Language.** The [Energy Language workbench](docs/energy.md) is programmable memory for a supported Hopfield checkpoint. Edits are staged, evaluated, and restored from bounded scripts. The source checkpoint is preserved.
50
+
51
+ **Research with sources.** `research` queries several angles, reads the selected pages, and returns the passages that address the question, with numbered sources.
52
+
53
+ **A session you can resume.** `qriton --continue` restores the latest session in this directory. `/sessions` lists them. See [session recovery](docs/session-recovery.md). `qriton capabilities` reports what is installed, without loading a model.
54
+
55
+ The runtime adds the terminal interface, provider SDKs, Hopfield analysis, and controlled HTTP.
56
+
57
+ ## Where it fits
58
+
59
+ Qriton CLI is for work that should stay on infrastructure you control, with the model treated as something you can switch and, for HLM and Energy Language, inspect.
60
+
61
+ | | Qriton CLI | Claude Code | Codex CLI | Aider | Cursor |
62
+ |---|---|---|---|---|---|
63
+ | Form | Terminal | Terminal | Terminal | Terminal | IDE |
64
+ | Model | On your machine through Ollama, or xAI, Anthropic, OpenAI, and any OpenAI-compatible API | Claude | OpenAI | On your machine, or an API you select | Selected hosted models in the editor |
65
+ | One session across models | Yes. `/model` keeps the transcript, approvals, and memory | Within Claude | Within OpenAI | Yes | Yes |
66
+ | What is retained | A graph of facts, with revisions, plus the session | Instructions and session notes | Project instructions | The repository, through git | The codebase in the editor |
67
+ | The model itself | HLM can apply a reversible memory overlay. Energy Language can edit a Hopfield checkpoint | The coding model is the product | The coding model is the product | The coding model is the product | The coding model is the product |
68
+ | Choose it for | A local session, a record of what was decided, and direct operations on a local model | Claude as the coding system | Codex in the terminal | Git-centred pairing with a model you choose | An editor built around the agent |
69
+
70
+ The table describes the shape of each product. It is not a quality ranking.
71
+
72
+ ## Another model
73
+
74
+ The first session stays on this machine. To use another provider in that same session:
75
+
76
+ ```bash
77
+ qriton auth xai # https://console.x.ai
78
+ qriton --model grok-4.6
79
+ qriton --model grok-build-0.1
80
+
81
+ qriton auth anthropic
82
+ qriton --model anthropic/claude-opus-5
83
+
84
+ qriton auth openai
85
+ qriton --model openai/gpt-5-mini
86
+ ```
87
+
88
+ `qriton auth` stores a key in the macOS Keychain, libsecret, or a private file on this machine. The same names work as `XAI_API_KEY`, `ANTHROPIC_API_KEY`, and `OPENAI_API_KEY`. An OpenAI-compatible server needs no extra adapter:
89
+
90
+ ```bash
91
+ export OPENAI_BASE_URL=https://openrouter.ai/api/v1 # also Groq, vLLM, LM Studio
92
+ ```
93
+
94
+ Set `network.allowHostedFallback` in user configuration when a hosted model should be available alongside Ollama. A managed machine can run shell, Git, and Python through the container profile in the [deployment guide](docs/production-operations.md).
95
+
96
+ Check everything is wired up:
97
+
98
+ ```bash
99
+ qriton doctor
100
+ ```
101
+
102
+ ## Use
103
+
104
+ ```bash
105
+ qriton # interactive
106
+ qriton "why does the build fail" # interactive, with a first prompt
107
+ qriton -p "list the exported types" # answer once, print, exit
108
+ qriton -p --mode auto-edit "fix the typo" # allow file edits without a prompt
109
+ qriton --plan "how would I add auth" # read-only investigation
110
+ qriton -C ~/code/other-project # work somewhere else
111
+ qriton --continue # resume the latest session here
112
+ qriton resume # same
113
+ qriton --image shot.png "what is wrong here"
114
+ ```
115
+
116
+ ### Approval modes
117
+
118
+ Writes and shell commands are confirmed before they run. Use `/auto on` to run them without approval prompts for this session, and `/auto off` to restore confirmations. `/auto` toggles, and `Shift+Tab` cycles modes only when the composer is empty and idle. In an open list it moves to the previous choice. The footer always shows the current mode and auto-run status.
119
+
120
+ [Network policy](docs/network-policy.md) can limit destinations to this machine or to an exact list of origins. A restricted profile runs shell, Git, and Python through the [container profile](docs/production-operations.md).
121
+
122
+ You can also use `/mode` or a startup flag:
123
+
124
+ | Mode | Files | Shell |
125
+ |---|---|---|
126
+ | `suggest` (default) | confirm | confirm |
127
+ | `auto-edit` | apply | confirm |
128
+ | `full-auto` (`--yolo`) | apply | run |
129
+ | `plan` (`--plan`) | blocked | blocked |
130
+
131
+ At an approval prompt: `y` approve, `a` always allow that kind, `n` reject, `v` expand the preview. Or use `Tab`/`Shift+Tab` or `←`/`→` to select a bracketed choice and `Enter` to confirm it. The initial selection is approve once; `Esc` always rejects. Use `↑`/`↓` or `Page Up`/`Page Down` to inspect long previews. The input draft is preserved while the approval owns the keyboard.
132
+
133
+ ### Models
134
+
135
+ `/models` opens a searchable list across the available backends. OpenAI coding models appear by newest family first; the current model is marked without being moved above newer choices. Audio, image, embedding and other specialized endpoints are excluded, and dated snapshots are hidden when a rolling alias is available. Type to filter, use arrows or `Tab`/`Shift+Tab` to move, then `Enter` to switch. Browsing does not warm or load a model; selection uses the normal model-switch flow. `Esc` returns to the draft. `/model <name>` also switches directly, keeping the transcript and memory:
136
+
137
+ ```
138
+ /model grok-4.6
139
+ /model grok-build-0.1
140
+ /model anthropic/claude-opus-5
141
+ /model openai/gpt-5.6-sol
142
+ /model qwen2.5-coder:7b bare names mean Ollama
143
+ ```
144
+
145
+ A bare `claude-*`, `gpt-*`, or `grok-*` routes correctly without the prefix. Ollama names containing slashes, like `hf.co/user/repo`, are left alone.
146
+
147
+ A practical division of work is to inspect with a local model, switch to a hosted model for the edit, and switch back. The session is unchanged.
148
+
149
+ OpenAI reasoning models use the Responses API, including Codex and GPT-5.6 tool calls. Requests use `store: false`; encrypted reasoning continuity stays in the local session and is replayed only to the same endpoint and model. Custom OpenAI-compatible endpoints retain Chat Completions. `/models` lists what the configured account offers. See [OpenAI's migration guide](https://developers.openai.com/api/docs/guides/migrate-to-responses).
150
+
151
+ ### Ollama servers and local feedback
152
+
153
+ `/servers` opens a choice between checking this computer and scanning the local network. `/servers local` checks `127.0.0.1:11434`; `/servers scan` checks up to 255 addresses on attached private IPv4 subnets, on port 11434, with eight probes at a time and short timeouts. Large subnets are limited to the surrounding /24. A scan can miss servers on other ports, other subnets, IPv6, or behind a firewall. Discovery checks version and model metadata only; it does not load models or send prompts. Use Escape to cancel.
154
+
155
+ Choose a discovered server with Enter, or use `/server <url>`. Qriton verifies it and saves the Ollama address; `/models` shows models from that server with its address. The coding model stays as it is until you select one. A private IPv4 server you choose may use HTTP. Other remote services use HTTPS. To expose an Ollama server to your LAN, configure its bind address as described in the [Ollama FAQ](https://docs.ollama.com/faq#how-can-i-expose-ollama-on-my-network).
156
+
157
+ `/feedback` opens a multiline feedback composer. Enter saves, Ctrl+J adds a line, and Escape cancels. `/feedback <text>` saves directly. Reports are private files under `~/.qriton/feedback/` (or `$QRITON_HOME/feedback/`), containing only what you type, the Qriton version, timestamp and report ID. Conversation history, credentials and workspace files are not attached. Feedback is separate from project memory and is never uploaded; no feedback API is configured.
158
+
159
+ ### Commands
160
+
161
+ Type `/` to discover commands. `↑`/`↓` moves the highlighted suggestion, `Tab` fills it, and `Esc` closes suggestions without clearing the draft. `Enter` fills a partial command first; press it again to run the completed command. Common options are suggested too: try `/theme `, `/mode `, `/auto `, `/queue ` or `/auth `.
162
+
163
+ `/sessions` opens a searchable list of conversations in the current workspace. Filter by title, model or ID; use arrows or `Tab`/`Shift+Tab` to navigate, `Enter` to resume, and `Esc` to return. The footer shows shortcuts for the active control. See [terminal interaction principles](docs/terminal-interaction.md) for the keyboard contract and current scope.
164
+
165
+ | | |
166
+ |---|---|
167
+ | `/help` | commands and shortcuts |
168
+ | `/theme light\|dark` | switch and save colors for a white or dark terminal background |
169
+ | `/queue [pause\|resume\|clear]` | inspect, pause, resume, or cancel pending instructions |
170
+ | `/model <name>` | switch chat model, any backend |
171
+ | `/fast <name>` | switch the fast model (memory, compact) |
172
+ | `/models` | browse, filter and select a chat model |
173
+ | `/auth` | which API keys are stored |
174
+ | `/usage` | token and cost log |
175
+ | `/sessions` | browse, filter and resume saved conversations here |
176
+ | `/save` | save the current conversation or retry a failed save |
177
+ | `/resume [id]` | continue a saved session |
178
+ | `/image <path>` | attach a screenshot to the next message |
179
+ | `/pull <name>` | download a local model |
180
+ | `/mode <mode>` | change approval mode |
181
+ | `/auto [on\|off]` | toggle automatic writes and commands for this session |
182
+ | `/policy` | inspect effective configuration, trust and managed limits |
183
+ | `/memory` | graph stats and recent entries |
184
+ | `/capabilities` | configured features, optional HLM installations and commands to try; no model load |
185
+ | `/energy [command]` | inspect, preview, apply, evaluate and restore HLM checkpoint edits |
186
+ | `/hlm [command]` | Qriton HF models, local completion, frozen/active comparison and reviewed factual-memory edits |
187
+ | `/memory probe <query>` | compare plain and Hopfield recall without reinforcing memories |
188
+ | `/recall <query>` | search memory |
189
+ | `/remember <text>` | save a pinned memory yourself |
190
+ | `/forget <id>` | drop a memory |
191
+ | `/sweep` | forget everything that has faded |
192
+ | `/unload` | free the memory local models are holding |
193
+ | `/stats` | context use, tokens per second, active backends |
194
+ | `/clear` | reset the conversation |
195
+
196
+ The composer stays at the bottom of the terminal and grows up to six lines. Longer drafts scroll around the cursor. `Ctrl+J` inserts a newline, and a trailing `\` continues a line. `↑`/`↓` move within multiline drafts or walk prompt history on a single line. `Page Up`/`Page Down` scroll the conversation; reaching the bottom resumes following new output. `Esc` interrupts a running turn, and `Ctrl+C` twice exits. The interactive UI uses the alternate screen and restores your terminal on exit; saved sessions retain the conversation.
197
+
198
+ Use `/theme light` on a white terminal background for dark body text and readable secondary text. The input uses a native blinking caret on supported terminals, with no application animation timer. The terminal controls its blink timing and any fade effect.
199
+
200
+ You can type an addition or correction while Qriton works and press **Enter**. The pending instruction appears above the composer and joins the current task at the next safe step. Actions that have not started are deferred until the model has considered the update; a running tool finishes first. **Esc** interrupts immediately and pauses pending input. `/queue` shows pending instructions, `/queue pause` holds them, `/queue resume` continues, and `/queue clear` cancels them. Failed or interrupted turns pause remaining requests. If the current operation cannot receive updates, pending requests run afterward, one at a time. `/exit` also works during a running turn. Approval dialogs retain their decision keys, and settings commands wait until the agent is idle with no pending requests.
201
+
202
+ The pending queue holds up to ten requests for the current session; it is not restored after exit. Once an update is added to the task, it becomes part of the normal saved conversation. A full queue leaves your draft intact.
203
+
204
+ When a model ends an execution request with a routine chat question such as “approve these edits to continue,” Qriton makes one recovery attempt directing it to concrete tool calls. The UI shows this handoff. The reminder grants no permission and leaves the selected approval mode unchanged. Missing choices, credentials, plan-only requests and consequential actions still need the appropriate user input; rejected tools are never unblocked by this recovery. A repeated stall reports unfinished work instead of looping or claiming completion.
205
+
206
+ Unattended runs reject actions that need approval in `suggest` mode. Choose `--mode auto-edit` for file edits or `--mode full-auto` for explicitly unattended shell work. `--plan` blocks writes even if a model emits an unadvertised tool call. Exit codes are 0 for completion, 3 for rejected actions, 130 for interruption, and 1 for provider errors, truncation, a repeated approval stall, or an exhausted step limit.
207
+
208
+ Resuming a session restores its model unless `--model` overrides it. The current invocation's approval mode remains in force. `-C` selects both the workspace and its project configuration.
209
+
210
+ ## HLM and Energy Language
211
+
212
+ Both are optional and run locally. Python and PyTorch are installed separately. The model conducting the coding session is unchanged.
213
+
214
+ HLM keeps a published base model frozen and stages a memory overlay. `qriton hlm catalog` lists the releases. The [walkthrough](docs/hlm.md) covers setup.
215
+
216
+ ```sh
217
+ qriton hlm compare hlm5-1b "The capital of Veldoria is"
218
+ qriton hlm preview hlm5-1b examples/hlm/memorize.hlm examples/hlm/controls.json
219
+ qriton hlm apply <proposal-id>
220
+ qriton hlm evaluate <proposal-id>
221
+ qriton hlm restore <proposal-id>
222
+ ```
223
+
224
+ Energy Language does the reversible edit for a supported Hopfield checkpoint, using a bounded script. The [guide](docs/energy.md) covers the runtime and the evaluation suite. Apply and restore ask for approval.
225
+
226
+ ```sh
227
+ qriton energy doctor
228
+ qriton energy inspect models/model.pt
229
+ qriton energy preview models/model.pt examples/energy/edit.hlm
230
+ qriton energy apply <proposal-id>
231
+ qriton energy evaluate <proposal-id>
232
+ qriton energy restore <proposal-id>
233
+ ```
234
+
235
+ ## Tools
236
+
237
+ | Tool | What it does |
238
+ |---|---|
239
+ | `read_file`, `write_file`, `edit_file` | read, create, and patch files |
240
+ | `list_dir`, `glob`, `grep` | explore and search the workspace |
241
+ | `shell` | run commands, with a denylist and a timeout |
242
+ | `git_status`, `git_diff`, `git_commit` | inspect and commit; commits need an explicit file list |
243
+ | `web_search`, `fetch_url` | find pages, read one page |
244
+ | `research` | search, crawl, rank, and cite |
245
+ | `remember`, `recall` | save and retrieve memories |
246
+ | `update_memory`, `forget` | correct or drop a memory |
247
+ | `link_memory`, `memory_graph` | connect memories, inspect connections |
248
+ | `plan` | track a multi-step task |
249
+
250
+ Read-only tools run in parallel and never prompt. Everything else is serialised behind approval.
251
+
252
+ ## Configuration
253
+
254
+ `~/.qriton/config.json`, or `.qriton/config.json` in a project to override per workspace. Project configuration requires an explicit grant: run `qriton trust show`, review the file, then `qriton trust grant <fingerprint>`. Changes require a new grant. `qriton doctor policy` inspects effective settings and their origins offline; `/policy` shows the active session. See [workspace configuration trust](docs/workspace-trust.md).
255
+
256
+ `qriton` already starts on `qwen3.5:4b`. Save this file to keep an 8K context and embeddings for later sessions. `qriton --light` still applies the bounded session for a single run, with keyword memory for that run. The `model` field also accepts `grok-4.6`, `anthropic/claude-opus-5`, `openai/gpt-5-mini`, or any model served through `OPENAI_BASE_URL`.
257
+
258
+ ```jsonc
259
+ {
260
+ "model": "qwen3.5:4b",
261
+ "fastModel": "qwen3.5:4b", // summarising, memory extraction
262
+ "embedModel": "bge-m3:latest",
263
+ "keepAlive": "30s", // how long Ollama retains the model
264
+ "releaseOnExit": true, // release the model when Qriton exits
265
+ "contextTokens": 8192,
266
+ "reasoning": "off",
267
+ "maxOutputTokens": 1024, // ceiling per step
268
+ "maxSteps": 8,
269
+ "approvalMode": "suggest",
270
+ "search": { "backend": "auto", "fetchTopN": 4 },
271
+ "memory": { "seedK": 8, "hops": 1, "recallLimit": 10, "autoCapture": true, "embeddings": true, "hopfield": true }
272
+ }
273
+ ```
274
+
275
+ `qriton pull bge-m3` fills `embedModel`. With embeddings on, `/memory probe` can compare plain recall and the Hopfield reading.
276
+
277
+ ### Environment
278
+
279
+ | | |
280
+ |---|---|
281
+ | `OLLAMA_HOST` | Ollama server, default `http://127.0.0.1:11434` |
282
+ | `QRITON_MODEL` | override the chat model |
283
+ | `XAI_API_KEY` | use Grok models |
284
+ | `ANTHROPIC_API_KEY` | use Claude models |
285
+ | `OPENAI_API_KEY` | use OpenAI models |
286
+ | `OPENAI_BASE_URL` | any OpenAI-compatible server |
287
+ | `TAVILY_API_KEY` / `BRAVE_API_KEY` | better search ranking |
288
+ | `SEARXNG_URL` | use your own SearXNG instance |
289
+ | `QRITON_DEBUG=1` | debug log at `~/.qriton/debug.log` |
290
+
291
+ ### Project instructions
292
+
293
+ Drop a `QRITON.md` in the repo root and it is loaded into every session. `AGENTS.md` and `CLAUDE.md` are picked up too.
294
+
295
+ ## How it fits together
296
+
297
+ ```
298
+ cli.tsx ──► Agent ──► ProviderRegistry ──► Ollama (local, streaming)
299
+ │ ├─► xAI (Grok)
300
+ │ ├─► Anthropic (official SDK)
301
+ │ └─► OpenAI (official SDK, or any compatible API)
302
+ │
303
+ ├─► ToolRegistry ──► fs · shell · web · memory · plan
304
+ │
305
+ ├─► MemoryStore ──► nodes, edges, revisions, full-text search
306
+ │ vectors held in memory, cosine ranked
307
+ │
308
+ ├─► Embedder ──► bge-m3 through the configured Ollama server
309
+ │
310
+ ├─► HLM ──► frozen base model, reversible memory overlay
311
+ │
312
+ └─► Energy ──► reversible edits to a Hopfield checkpoint
313
+ ```
314
+
315
+ Every provider normalises to one event stream, so the agent loop never learns which backend it is talking to. The translation each one needs is real, though: Anthropic takes the system prompt as a top-level parameter and requires all parallel tool results in a single user message, while OpenAI takes one message per result with a `tool_call_id`.
316
+
317
+ The system prompt is built once per session and never rewritten. Ollama caches the prompt prefix between requests, and changing the system message would force a full reprocess of several thousand tokens on every step. Per-turn content such as recalled memories goes into the user message instead, so history only ever grows and the cache keeps paying off.
318
+
319
+ When the transcript passes 75% of the context window, the older half is summarised by the fast model and recent turns are kept verbatim.
320
+
321
+ Models without native tool support use fenced `tool` blocks.
322
+
323
+ ## Speed
324
+
325
+ Most of the elapsed time is model inference. The first turn sends roughly a 3,600-token prefix, covering the system prompt and tool schemas. Later turns send only the new tokens. Two measurements describe the result:
326
+
327
+ | | |
328
+ |---|---|
329
+ | prompt processing | how long before the first token appears |
330
+ | token generation | how fast the answer streams |
331
+
332
+ `/stats` shows tokens per second after each turn. `--light` shortens local turns, and `maxOutputTokens` caps each step.
333
+
334
+ ### Context budget
335
+
336
+ Qriton compacts automatically before the next request exceeds its estimated input budget. It keeps complete tool exchanges that fit, preserves the newest user instructions and attachments, and carries a bounded record of the task plan into the summary. Large file reads no longer force the last eight messages to stay in context. Long tool results show an explicit shortening notice; request narrower file ranges or filtered command output to recover omitted detail.
337
+
338
+ The summary request uses the fast model's context window. Compaction leaves the system prompt stable and does not change approval mode. `/compact` requests it manually, and `/stats` shows estimated usage.
339
+
340
+ ### Memory pressure
341
+
342
+ A local model resides in memory alongside the other processes on the machine:
343
+
344
+ - The model is **released when qriton exits**, rather than staying pinned for the rest of its keep-alive. Turn this off with `"releaseOnExit": false`.
345
+ - `keepAlive` defaults to 10 minutes, so a resumed turn does not reload the model immediately.
346
+ - The embedding model gets its own 2-minute keep-alive, because it loads in under a second.
347
+ - Switching models with `/model` releases the one you left.
348
+ - `/unload` releases resident models without ending the session.
349
+
350
+ `--light` uses an 8K context, four CPU inference threads, 1,024 output tokens per step, eight steps per turn and thinking off. Main and fast tasks use the same model. Keyword and graph recall stay available, and chat residency expires after 30 seconds idle.
351
+
352
+ A hosted model leaves local inference unloaded. With `--model openai/gpt-5-mini` or `--model anthropic/claude-opus-5`, the only local model left is the embedder, and only while it is working.
353
+
354
+ The `reasoning` setting chooses whether a model's scratchpad is shown in its own channel or left inline. `"on"` keeps the scratchpad separate from the reply.
355
+
356
+ ## Development
357
+
358
+ Local [Shield scanning](docs/shield.md) checks retrieved content and withholds recognized credentials. `qriton shield status` and `qriton shield scan SKILL.md` run offline.
359
+
360
+ ```bash
361
+ npm run dev # esbuild watch
362
+ npm test # unit tests
363
+ npm run typecheck
364
+ ```
365
+
366
+ `qriton memory reembed` refreshes stored vectors with the current embedder and keeps each fact's history.
367
+
368
+ ## License
369
+
370
+ MIT
371
+
372
+ The [deployment guide](docs/production-operations.md) covers installation, the container profile, memory authorization, backup and restore, and rollback.
@@ -0,0 +1,201 @@
1
+ # Bundled Qriton Shield
2
+
3
+ The CLI bundles local scanner code from @qriton/shield 3.3.0 (Apache-2.0). The integration calls its standalone scanners and adapts their output; it does not modify the upstream package.
4
+
5
+ Qriton Shield
6
+ Copyright 2024-2026 Qriton Technologies
7
+
8
+ This product includes software developed by Qriton Technologies
9
+ (https://qriton.com).
10
+
11
+
12
+ Apache License
13
+ Version 2.0, January 2004
14
+ http://www.apache.org/licenses/
15
+
16
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
17
+
18
+ 1. Definitions.
19
+
20
+ "License" shall mean the terms and conditions for use, reproduction,
21
+ and distribution as defined by Sections 1 through 9 of this document.
22
+
23
+ "Licensor" shall mean the copyright owner or entity authorized by
24
+ the copyright owner that is granting the License.
25
+
26
+ "Legal Entity" shall mean the union of the acting entity and all
27
+ other entities that control, are controlled by, or are under common
28
+ control with that entity. For the purposes of this definition,
29
+ "control" means (i) the power, direct or indirect, to cause the
30
+ direction or management of such entity, whether by contract or
31
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
32
+ outstanding shares, or (iii) beneficial ownership of such entity.
33
+
34
+ "You" (or "Your") shall mean an individual or Legal Entity
35
+ exercising permissions granted by this License.
36
+
37
+ "Source" form shall mean the preferred form for making modifications,
38
+ including but not limited to software source code, documentation
39
+ source, and configuration files.
40
+
41
+ "Object" form shall mean any form resulting from mechanical
42
+ transformation or translation of a Source form, including but
43
+ not limited to compiled object code, generated documentation,
44
+ and conversions to other media types.
45
+
46
+ "Work" shall mean the work of authorship, whether in Source or
47
+ Object form, made available under the License, as indicated by a
48
+ copyright notice that is included in or attached to the work
49
+ (an example is provided in the Appendix below).
50
+
51
+ "Derivative Works" shall mean any work, whether in Source or Object
52
+ form, that is based on (or derived from) the Work and for which the
53
+ editorial revisions, annotations, elaborations, or other modifications
54
+ represent, as a whole, an original work of authorship. For the purposes
55
+ of this License, Derivative Works shall not include works that remain
56
+ separable from, or merely link (or bind by name) to the interfaces of,
57
+ the Work and Derivative Works thereof.
58
+
59
+ "Contribution" shall mean any work of authorship, including
60
+ the original version of the Work and any modifications or additions
61
+ to that Work or Derivative Works thereof, that is intentionally
62
+ submitted to the Licensor for inclusion in the Work by the copyright owner
63
+ or by an individual or Legal Entity authorized to submit on behalf of
64
+ the copyright owner. For the purposes of this definition, "submitted"
65
+ means any form of electronic, verbal, or written communication sent
66
+ to the Licensor or its representatives, including but not limited to
67
+ communication on electronic mailing lists, source code control systems,
68
+ and issue tracking systems that are managed by, or on behalf of, the
69
+ Licensor for the purpose of discussing and improving the Work, but
70
+ excluding communication that is conspicuously marked or otherwise
71
+ designated in writing by the copyright owner as "Not a Contribution."
72
+
73
+ "Contributor" shall mean Licensor and any individual or Legal Entity
74
+ on behalf of whom a Contribution has been received by the Licensor and
75
+ subsequently incorporated within the Work.
76
+
77
+ 2. Grant of Copyright License. Subject to the terms and conditions of
78
+ this License, each Contributor hereby grants to You a perpetual,
79
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
80
+ copyright license to reproduce, prepare Derivative Works of,
81
+ publicly display, publicly perform, sublicense, and distribute the
82
+ Work and such Derivative Works in Source or Object form.
83
+
84
+ 3. Grant of Patent License. Subject to the terms and conditions of
85
+ this License, each Contributor hereby grants to You a perpetual,
86
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
87
+ (except as stated in this section) patent license to make, have made,
88
+ use, offer to sell, sell, import, and otherwise transfer the Work,
89
+ where such license applies only to those patent claims licensable
90
+ by such Contributor that are necessarily infringed by their
91
+ Contribution(s) alone or by combination of their Contribution(s)
92
+ with the Work to which such Contribution(s) was submitted. If You
93
+ institute patent litigation against any entity (including a
94
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
95
+ or a Contribution incorporated within the Work constitutes direct
96
+ or contributory patent infringement, then any patent licenses
97
+ granted to You under this License for that Work shall terminate
98
+ as of the date such litigation is filed.
99
+
100
+ 4. Redistribution. You may reproduce and distribute copies of the
101
+ Work or Derivative Works thereof in any medium, with or without
102
+ modifications, and in Source or Object form, provided that You
103
+ meet the following conditions:
104
+
105
+ (a) You must give any other recipients of the Work or
106
+ Derivative Works a copy of this License; and
107
+
108
+ (b) You must cause any modified files to carry prominent notices
109
+ stating that You changed the files; and
110
+
111
+ (c) You must retain, in the Source form of any Derivative Works
112
+ that You distribute, all copyright, patent, trademark, and
113
+ attribution notices from the Source form of the Work,
114
+ excluding those notices that do not pertain to any part of
115
+ the Derivative Works; and
116
+
117
+ (d) If the Work includes a "NOTICE" text file as part of its
118
+ distribution, then any Derivative Works that You distribute must
119
+ include a readable copy of the attribution notices contained
120
+ within such NOTICE file, excluding any notices that do not
121
+ pertain to any part of the Derivative Works, in at least one
122
+ of the following places: within a NOTICE text file distributed
123
+ as part of the Derivative Works; within the Source form or
124
+ documentation, if provided along with the Derivative Works; or,
125
+ within a display generated by the Derivative Works, if and
126
+ wherever such third-party notices normally appear. The contents
127
+ of the NOTICE file are for informational purposes only and
128
+ do not modify the License. You may add Your own attribution
129
+ notices within Derivative Works that You distribute, alongside
130
+ or as an addendum to the NOTICE text from the Work, provided
131
+ that such additional attribution notices cannot be construed
132
+ as modifying the License.
133
+
134
+ You may add Your own copyright statement to Your modifications and
135
+ may provide additional or different license terms and conditions
136
+ for use, reproduction, or distribution of Your modifications, or
137
+ for any such Derivative Works as a whole, provided Your use,
138
+ reproduction, and distribution of the Work otherwise complies with
139
+ the conditions stated in this License.
140
+
141
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
142
+ any Contribution intentionally submitted for inclusion in the Work
143
+ by You to the Licensor shall be under the terms and conditions of
144
+ this License, without any additional terms or conditions.
145
+ Notwithstanding the above, nothing herein shall supersede or modify
146
+ the terms of any separate license agreement you may have executed
147
+ with Licensor regarding such Contributions.
148
+
149
+ 6. Trademarks. This License does not grant permission to use the trade
150
+ names, trademarks, service marks, or product names of the Licensor,
151
+ except as required for reasonable and customary use in describing the
152
+ origin of the Work and reproducing the content of the NOTICE file.
153
+
154
+ 7. Disclaimer of Warranty. Unless required by applicable law or
155
+ agreed to in writing, Licensor provides the Work (and each
156
+ Contributor provides its Contributions) on an "AS IS" BASIS,
157
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
158
+ implied, including, without limitation, any warranties or conditions
159
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
160
+ PARTICULAR PURPOSE. You are solely responsible for determining the
161
+ appropriateness of using or redistributing the Work and assume any
162
+ risks associated with Your exercise of permissions under this License.
163
+
164
+ 8. Limitation of Liability. In no event and under no legal theory,
165
+ whether in tort (including negligence), contract, or otherwise,
166
+ unless required by applicable law (such as deliberate and grossly
167
+ negligent acts) or agreed to in writing, shall any Contributor be
168
+ liable to You for damages, including any direct, indirect, special,
169
+ incidental, or consequential damages of any character arising as a
170
+ result of this License or out of the use or inability to use the
171
+ Work (including but not limited to damages for loss of goodwill,
172
+ work stoppage, computer failure or malfunction, or any and all
173
+ other commercial damages or losses), even if such Contributor
174
+ has been advised of the possibility of such damages.
175
+
176
+ 9. Accepting Warranty or Additional Liability. While redistributing
177
+ the Work or Derivative Works thereof, You may choose to offer,
178
+ and charge a fee for, acceptance of support, warranty, indemnity,
179
+ or other liability obligations and/or rights consistent with this
180
+ License. However, in accepting such obligations, You may act only
181
+ on Your own behalf and on Your sole responsibility, not on behalf
182
+ of any other Contributor, and only if You agree to indemnify,
183
+ defend, and hold each Contributor harmless for any liability
184
+ incurred by, or claims asserted against, such Contributor by reason
185
+ of your accepting any such warranty or additional liability.
186
+
187
+ END OF TERMS AND CONDITIONS
188
+
189
+ Copyright 2024-2026 Qriton Technologies
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,14 @@
1
+ FROM node:24-trixie-slim@sha256:8ec5d7557396cfe32d21c3f9c13072355ceab22b584578ca4bb28af31120cffe
2
+ RUN apt-get update && apt-get install -y --no-install-recommends git python3 coreutils ca-certificates \
3
+ && rm -rf /var/lib/apt/lists/*
4
+ RUN npm install --global --ignore-scripts --no-audit --no-fund npm@12.0.2
5
+ # The published CLI's development-only dependencies include unavailable packages.
6
+ # They are not part of this runtime toolchain or its dependency patch operation.
7
+ RUN node -e 'const fs=require("node:fs"),p="/usr/local/lib/node_modules/npm/package.json",v=JSON.parse(fs.readFileSync(p));delete v.devDependencies;fs.writeFileSync(p,JSON.stringify(v,null,2)+"\n")' \
8
+ && npm install --prefix /usr/local/lib/node_modules/npm --omit=dev --ignore-scripts --no-audit --no-fund --save-exact \
9
+ brace-expansion@5.0.9 ip-address@10.3.1 tar@7.5.21 undici@6.28.0 \
10
+ && npm cache clean --force
11
+ # npm 12.0.2 still bundles the vulnerable revisions; keep these compatible
12
+ # dependency fixes pinned until a reviewed upstream npm release includes them.
13
+ # Configure the resulting immutable image ID/digest, never this build's mutable tag.
14
+ WORKDIR /workspace