@lazyingart/agintiflow 0.20.196 → 0.20.198
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/.env.example +34 -0
- package/AGENTS.md +1 -1
- package/README.md +31 -17
- package/bin/aginti-public-research.js +33 -0
- package/bin/aginti-safe-chat.js +34 -0
- package/docs/auxiliary-image-generation.md +6 -0
- package/docs/external-skill-packs.md +1 -1
- package/docs/large-codebase-engineering.md +7 -7
- package/docs/local-first-agent-runtime.md +199 -0
- package/docs/machine-run.md +18 -0
- package/docs/model-selection.md +29 -12
- package/docs/patch-tools.md +1 -1
- package/docs/perception-and-web-research.md +9 -6
- package/docs/productive-agent-roadmap.md +2 -2
- package/docs/public-research-wrapper.md +162 -0
- package/docs/safe-chat.md +106 -0
- package/docs/self-development-supervision.md +2 -2
- package/docs/skills-and-tools.md +9 -5
- package/i18n/README.ar.md +24 -12
- package/i18n/README.de.md +24 -12
- package/i18n/README.es.md +24 -12
- package/i18n/README.fr.md +24 -12
- package/i18n/README.ja.md +24 -12
- package/i18n/README.ko.md +24 -12
- package/i18n/README.ru.md +24 -12
- package/i18n/README.vi.md +24 -12
- package/i18n/README.zh-Hans.md +24 -12
- package/i18n/README.zh-Hant.md +24 -12
- package/package.json +50 -6
- package/public/app.js +123 -277
- package/public/index.html +27 -15
- package/public/markdown-renderer.js +222 -0
- package/public/math-renderer.js +163 -0
- package/public/styles.css +59 -0
- package/references/agent-execution-policy-and-context-budget-2026-07-30.md +70 -0
- package/references/lazyingrouter-account-login-design.md +9 -8
- package/references/model-routing-provider-design.md +25 -16
- package/references/venice-model-reference.md +6 -4
- package/scripts/fixtures/local-first-agent-eval-fixtures.mjs +93 -0
- package/scripts/local-first-agent-eval.mjs +696 -0
- package/scripts/postinstall-webapp.js +2 -1
- package/scripts/seed-supervised-homework.js +330 -0
- package/scripts/smoke-agentlink.js +225 -0
- package/scripts/smoke-auth.js +10 -8
- package/scripts/smoke-auxiliary-tools.js +108 -3
- package/scripts/smoke-cli-chat.js +306 -5
- package/scripts/smoke-execution-policy.js +240 -0
- package/scripts/smoke-inbox.js +416 -0
- package/scripts/smoke-local-resource-policy.js +112 -0
- package/scripts/smoke-localllm-auto-max.js +393 -0
- package/scripts/smoke-localllm-model-tiers.js +365 -0
- package/scripts/smoke-localllm-provider.js +723 -0
- package/scripts/smoke-math-rendering.js +213 -0
- package/scripts/smoke-mcp.js +108 -1
- package/scripts/smoke-model-roles.js +94 -24
- package/scripts/smoke-perception-research.js +254 -0
- package/scripts/smoke-progressive-tool-selection.js +1178 -0
- package/scripts/smoke-public-research-wrapper.js +277 -0
- package/scripts/smoke-run-stdin.js +74 -0
- package/scripts/smoke-safe-chat.js +671 -0
- package/scripts/smoke-scs-evidence-visibility.js +107 -0
- package/scripts/smoke-session-runtime.js +385 -0
- package/scripts/smoke-truthful-completion.js +234 -0
- package/scripts/smoke-web-api.js +198 -7
- package/scripts/smoke-web-autostart.js +15 -0
- package/scripts/smoke-web-ui.js +34 -14
- package/scripts/smoke-writing-specialist-routing.js +200 -0
- package/src/agent-runner.js +855 -34
- package/src/auth-onboarding.js +20 -7
- package/src/auxiliary-tools.js +139 -22
- package/src/cli.js +257 -20
- package/src/config.js +222 -35
- package/src/context-budget-controller.js +176 -0
- package/src/execution-policy.js +84 -0
- package/src/guardrails.js +95 -9
- package/src/i18n.js +11 -11
- package/src/interactive-cli.js +202 -70
- package/src/json-specialist.js +31 -9
- package/src/local-auto-max.js +203 -0
- package/src/local-resource-policy.js +130 -0
- package/src/model-client.js +114 -31
- package/src/model-routing.js +382 -75
- package/src/perception-tools.js +148 -18
- package/src/postinstall-policy.js +9 -0
- package/src/progressive-tool-selection.js +695 -0
- package/src/project.js +71 -61
- package/src/provider-contract.js +309 -0
- package/src/provider-runtime.js +447 -0
- package/src/public-research-server.js +175 -0
- package/src/public-research-wrapper.js +517 -0
- package/src/safe-chat-server.js +231 -0
- package/src/safe-chat-wrapper.js +600 -0
- package/src/scs-evidence.js +9 -5
- package/src/session-runtime.js +626 -0
- package/src/session-store.js +499 -19
- package/src/task-profiles.js +8 -1
- package/src/tool-contract.js +291 -0
- package/src/web-db.js +49 -8
- package/src/writing-specialist.js +106 -34
- package/web.js +328 -138
package/.env.example
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Local-only credentials template. Copy to .env and keep it untracked.
|
|
2
|
+
# Do not commit real values.
|
|
3
|
+
|
|
4
|
+
# Default local-first text provider. Keep LocalLLM on loopback.
|
|
5
|
+
LOCALLLM_BASE_URL=http://127.0.0.1:8008/v1
|
|
6
|
+
LOCALLLM_API_KEY=local-dev-key
|
|
7
|
+
AGINTI_LOCALLLM_ROUTE_MODEL=localllm-fast
|
|
8
|
+
AGINTI_LOCALLLM_MAIN_MODEL=localllm-deep
|
|
9
|
+
AGINTI_LOCALLLM_MAX_MODEL=localllm-max
|
|
10
|
+
AGINTI_LOCALLLM_ALLOW_AUTO_MAX=false
|
|
11
|
+
AGINTI_LOCALLLM_VISION_MODEL=localllm-vision-xl
|
|
12
|
+
AGINTI_LOCALLLM_CONTEXT_TOKENS=32768
|
|
13
|
+
AGINTI_LOCALLLM_MAX_OUTPUT_TOKENS=8192
|
|
14
|
+
AGINTI_LOCALLLM_TOOL_SCHEMA_TOKENS=4096
|
|
15
|
+
|
|
16
|
+
# Auto-Max is off unless explicitly enabled. Enabled runs still require authenticated
|
|
17
|
+
# alias discovery plus a fresh RAM/swap/GPU headroom check before selecting Max.
|
|
18
|
+
# Hosted provider keys below never act as a LocalLLM failure fallback.
|
|
19
|
+
|
|
20
|
+
# Optional explicit hosted upgrades. They are never automatic fallbacks.
|
|
21
|
+
DEEPSEEK_API_KEY=
|
|
22
|
+
OPENAI_API_KEY=
|
|
23
|
+
AGINTI_ALLOW_HOSTED_IMAGE_PERCEPTION=false
|
|
24
|
+
AGINTI_ALLOW_HOSTED_WEB_RESEARCH=false
|
|
25
|
+
AGINTI_ALLOW_HOSTED_JSON_SPECIALIST=false
|
|
26
|
+
# A cross-provider writer needs both an explicit target and the permission below.
|
|
27
|
+
AGINTI_WRITING_PROVIDER=
|
|
28
|
+
AGINTI_WRITING_MODEL=
|
|
29
|
+
AGINTI_ALLOW_HOSTED_WRITING_SPECIALIST=false
|
|
30
|
+
|
|
31
|
+
# Optional local npm publish fallback. Prefer GitHub Actions Trusted Publishing.
|
|
32
|
+
NPM_TOKEN=
|
|
33
|
+
NODE_AUTH_TOKEN=
|
|
34
|
+
NPM_CONFIG_REGISTRY=https://registry.npmjs.org/
|
package/AGENTS.md
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
- `npm run smoke:coding-tools`: verify mock workspace writes, patches, and path guardrail blocks.
|
|
21
21
|
- `npm pack --dry-run`: inspect npm package contents before release.
|
|
22
22
|
|
|
23
|
-
Use `AGENT_PROVIDER=openai`, `AGENT_PROVIDER=deepseek`, or `AGENT_PROVIDER=mock`
|
|
23
|
+
Use `AGENT_PROVIDER=localllm` for the default loopback LocalLLM runtime. Select `AGENT_PROVIDER=openai`, `AGENT_PROVIDER=deepseek`, or another hosted provider only as an explicit upgrade; saved or ambient hosted keys authenticate that choice but never select it or create a fallback. Use `AGENT_PROVIDER=mock` for deterministic offline tests.
|
|
24
24
|
|
|
25
25
|
## Coding Style & Naming Conventions
|
|
26
26
|
|
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|

|
|
14
14
|

|
|
15
15
|

|
|
16
|
-

|
|
17
17
|

|
|
18
18
|

|
|
19
19
|

|
|
@@ -49,12 +49,12 @@ Most agent tools are either a chat box with hidden state or an expensive one-mod
|
|
|
49
49
|
|
|
50
50
|
| Principle | What it means in practice |
|
|
51
51
|
| --- | --- |
|
|
52
|
-
|
|
|
52
|
+
| Local intelligence changes the architecture | The baseline uses the sibling LocalLLM gateway for private route and main lanes. Stronger hosted models remain explicit upgrades, not hidden fallbacks. |
|
|
53
53
|
| Inspectable beats mysterious | Plans, tool calls, file diffs, command output, canvas artifacts, and session events are saved and resumable. |
|
|
54
54
|
| Disciplined by default | `AGINTI.md` starts with a behavior contract: surface ambiguity, keep edits surgical, avoid speculative complexity, verify outcomes, and respect permission blockers. |
|
|
55
|
-
| Role-based models | Route, main, spare, wrapper, and auxiliary image roles are separate.
|
|
56
|
-
| Writing without agent noise | `writing_specialist` drafts novels, books, scripts, essays, and paper prose in an isolated writing-only context
|
|
57
|
-
| Visual and web evidence | `read_image`
|
|
55
|
+
| Role-based models | Route, main, spare, wrapper, and auxiliary image roles are separate. LocalLLM supplies the default fast/deep lanes; DeepSeek, OpenAI, OpenRouter, Qwen, and Venice are optional explicit routes. |
|
|
56
|
+
| Writing without agent noise | `writing_specialist` drafts novels, books, scripts, essays, and paper prose in an isolated writing-only context on the active provider. Cross-provider writing requires explicit permission; ambient keys and model arguments cannot silently switch a LocalLLM session to a hosted model. The main agent then handles files, formatting, citations, checks, and artifacts. |
|
|
57
|
+
| Visual and web evidence | `read_image` uses the loopback LocalLLM vision model in local sessions and never falls through to a hosted provider. `web_research` saves sourced snippet artifacts for local synthesis. OpenAI perception/research and wrapper second opinions require explicit provider/tool permission. |
|
|
58
58
|
| Scouts before big work | Parallel scouts can cheaply map architecture, tests, risks, symbols, and integration points before the main executor edits anything. |
|
|
59
59
|
| SCS by default | Student-Committee-Supervisor mode adds a typed gate: committee drafts, student approves/monitors, supervisor executes. Use `/scs off` or `--no-scs` only when speed matters more than validation. |
|
|
60
60
|
| AAPS for large workflows | AAPS describes top-down agentic pipeline scripts; AgInTiFlow can act as the interactive backend that validates, compiles, and executes those workflows. |
|
|
@@ -85,7 +85,9 @@ aginti init --template aaps
|
|
|
85
85
|
aginti init --template supervision
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
By default, AgInTiFlow connects to the sibling LocalLLM gateway at `http://127.0.0.1:8008/v1`, using `localllm-fast` for routing and the installed 30B-A3B Q4 `localllm-deep` for substantive coding and agent work. The Q8 `localllm-max` remains resource-gated on every new or resumed run (24 GiB available RAM, no more than 75% swap use, and 40 GiB aggregate free NVIDIA memory). The automatic Vision policy requires both a trusted image-input signal and confirmed model capability; the shipped CLI/web currently use the readiness-checked local `read_image` tool or an explicit `localllm-vision-xl` selection rather than inferring vision from prompt keywords. Routing does not load a model. Startup checks the LocalLLM service, its Ollama runtime, selected aliases, and any required Max headroom before inference. A local failure stops with an actionable error; it never silently sends the task to a hosted provider.
|
|
89
|
+
|
|
90
|
+
Hosted providers are optional, explicit upgrades. When you select DeepSeek, OpenAI, OpenRouter, Qwen, or Venice, the auth wizard can save that provider's key account-wide in `~/.agintiflow/.env` with restricted permissions. Current project `.aginti/.env` files can still override account defaults when needed. You can rerun setup any time:
|
|
89
91
|
|
|
90
92
|
```bash
|
|
91
93
|
aginti auth
|
|
@@ -100,6 +102,7 @@ Provider signup and key pages:
|
|
|
100
102
|
|
|
101
103
|
| Provider | Register / key page | API base URL used by AgInTiFlow |
|
|
102
104
|
| --- | --- | --- |
|
|
105
|
+
| LocalLLM | Local sibling service; no signup | `http://127.0.0.1:8008/v1` |
|
|
103
106
|
| DeepSeek | [https://platform.deepseek.com/api_keys](https://platform.deepseek.com/api_keys) | `https://api.deepseek.com` |
|
|
104
107
|
| OpenRouter | [https://openrouter.ai/settings/keys](https://openrouter.ai/settings/keys) | `https://openrouter.ai/api/v1` |
|
|
105
108
|
| Venice | [https://venice.ai/settings/api](https://venice.ai/settings/api) | `https://api.venice.ai/api/v1` |
|
|
@@ -109,7 +112,7 @@ Provider signup and key pages:
|
|
|
109
112
|
|
|
110
113
|
The CLI quietly auto-starts or reuses the local web UI from the same project. It tries `http://127.0.0.1:3210` first, then `3211`, `3212`, and so on if the port is already occupied by another project. The active URL is shown in the CLI launch header. If startup is blocked, stale, or unavailable, the same header row shows the recovery hint; run `/webapp [port]` inside the CLI to retry, `/webapp stop [port]` to stop the compatible local webapp, or `/webapp restart [port]` to stop and relaunch the local webapp with the current project and canonical `~/.agintiflow` session home. Use `/webapp disable` or `aginti webapp disable` to persistently disable automatic webapp startup and update-time restarts; use `/webapp enable` or `aginti webapp enable` to restore them. After a successful `aginti update` or accepted startup auto-update, AgInTiFlow restarts the compatible local webapp only when webapp auto-start is enabled.
|
|
111
114
|
|
|
112
|
-
|
|
115
|
+
Global CLI installation also makes a best-effort, non-blocking webapp initialization. Project dependency installs remain side-effect free by default; set `AGINTIFLOW_POSTINSTALL_WEBAPP=1` only when a local dependency install should start Studio. Installation never fails because the optional local webapp could not start.
|
|
113
116
|
|
|
114
117
|
Launch the web UI explicitly when you want a foreground web server:
|
|
115
118
|
|
|
@@ -152,6 +155,9 @@ aginti --language de
|
|
|
152
155
|
| Goal | Command |
|
|
153
156
|
| --- | --- |
|
|
154
157
|
| Start interactive chat | `aginti` or `aginti chat` |
|
|
158
|
+
| Run one clean machine turn | `printf '%s\n' 'task' \| aginti run --stdin --json --task-profile chatops --no-scs -s safe` |
|
|
159
|
+
| Start the narrow public-research backend | Project-local `./node_modules/.bin/aginti-public-research --port 3211`; see [deployment boundary](docs/public-research-wrapper.md) |
|
|
160
|
+
| Start the authenticated text-only fallback | Project-local `./node_modules/.bin/aginti-safe-chat --port 3212`; see [safe-chat boundary](docs/safe-chat.md) |
|
|
155
161
|
| Start local web app | Auto-starts with `aginti`; detached command is `aginti webapp`; disable/enable auto-start with `aginti webapp disable` / `aginti webapp enable`; stop with `aginti webapp stop`; restart with `aginti webapp restart`; foreground mode is `aginti web --port 3210` |
|
|
156
162
|
| Save provider keys | `aginti auth`, `/auth`, `/login` |
|
|
157
163
|
| Review current repo | `/review [focus]` |
|
|
@@ -177,7 +183,7 @@ aginti --language de
|
|
|
177
183
|
| Sync reviewed skills | `aginti skillmesh status`, `aginti skillmesh sync` |
|
|
178
184
|
| Update CLI | `aginti update` |
|
|
179
185
|
|
|
180
|
-
Interactive chat supports slash completion, Up/Down selectors, a newest-first resume selector with direct Space pagination, multiline input with `Ctrl+J`, full resume history, Markdown rendering, visible run status, ASAP pipe messages during a run, and clean interruption/resume with `Ctrl+C`. Installed interactive commands also check npm for a newer AgInTiFlow release and show an update/skip selector; source checkouts and non-TTY automation are left alone.
|
|
186
|
+
Interactive chat supports slash completion, Up/Down selectors, a newest-first resume selector with direct Space pagination, multiline input with `Ctrl+J`, full resume history, Markdown rendering, visible run status, ASAP pipe messages during a run, and clean interruption/resume with `Ctrl+C`. A resumed session keeps its versioned provider/model/tool-policy snapshot; current preferences do not silently change it, and explicit changes use revision checks. Installed interactive commands also check npm for a newer AgInTiFlow release and show an update/skip selector; source checkouts and non-TTY automation are left alone.
|
|
181
187
|
|
|
182
188
|
AgInTiFlow treats `maxSteps` as an initial budget, not a silent infinite loop. By default, real-provider runs can receive a bounded extension only near the limit, only when recent tool/file/artifact evidence shows concrete progress, and never to bypass permission, package, host, or secret guardrails. Use `--dynamic-steps off` for a strict hard stop, or `--dynamic-steps on` to test the budget gate in mock/offline runs.
|
|
183
189
|
|
|
@@ -239,15 +245,15 @@ The website keeps the visual walkthrough in a carousel so this README can stay f
|
|
|
239
245
|
| File tools | `inspect_project`, `list_files`, `read_file`, `search_files`, `write_file`, `apply_patch`, `open_workspace_file`, `preview_workspace`, and `read_image`. |
|
|
240
246
|
| Shell tools | Guarded host or Docker workspace shell execution with package-install policy and command safety checks. |
|
|
241
247
|
| Browser tools | Playwright browser actions with lazy startup and optional domain allowlists. |
|
|
242
|
-
| Model routing |
|
|
248
|
+
| Model routing | LocalLLM Fast/Deep defaults, explicit and resource-gated Max, image-capability-gated Vision XL, explicit DeepSeek/OpenAI/OpenRouter/Qwen/Venice/mock routes, and optional spare/wrapper/auxiliary models. |
|
|
243
249
|
| Writing specialist | A dedicated writing-only LLM call for prose, chapters, scripts, books, essays, research-paper sections, and revisions, with formatter handoff notes for Markdown/LaTeX/Final Draft. |
|
|
244
250
|
| Patch workflow | Codex-style patch envelopes, unified diffs, exact replacements, hashes, compact diffs, and path guardrails. |
|
|
245
251
|
| Parallel scouts | Optional scout calls for architecture, implementation, review, tests, git flow, research, symbol tracing, and dependency risk. |
|
|
246
|
-
| Image reading and web research |
|
|
252
|
+
| Image reading and web research | LocalLLM sessions send pixels only to the loopback vision endpoint. `web_research` preserves source lists for the active model to synthesize. Hosted OpenAI and wrapper paths are explicit opt-ins, never credential-driven fallbacks. |
|
|
247
253
|
| SCS mode | Default Student-Committee-Supervisor quality gate with independent planning, execution, and validation roles. |
|
|
248
254
|
| AAPS adapter | Optional `@lazyingart/aaps` integration for `.aaps` workflow init, validate, parse, compile, dry-run, and run commands. |
|
|
249
255
|
| AgentLink | Local-first collaboration between AgInTi sessions through boards, typed messages, action contracts, safe summaries, and evidence bundles. |
|
|
250
|
-
| Image generation | Optional GRS AI and Venice image tools with saved manifests and canvas
|
|
256
|
+
| Image generation | Optional, default-off GRS AI and Venice image tools with saved manifests and canvas previews. Credentials authenticate the selected provider but never select or fail over providers. |
|
|
251
257
|
| Skill library | Built-in Markdown skills plus project-local `.aginti/skills/<id>/SKILL.md` skills for reusable workflow knowledge that should not be hard-coded into the runtime. |
|
|
252
258
|
| External skill packs | Whole Agent Skills repositories can be loaded as grouped packs without flattening. A sibling `../scientific-agent-skills` checkout is discovered as the `scientific` category, so commands like `aginti skills rdkit` and `aginti skills "single cell scanpy"` expose K-Dense Scientific Agent Skills when present. |
|
|
253
259
|
| Skill Mesh | Optional strict skill recording/sharing for reviewed reusable skill packs. If unused, AgInTiFlow runs normally without background sharing. |
|
|
@@ -259,11 +265,11 @@ AgInTiFlow does not treat "the model" as one global setting. It has roles:
|
|
|
259
265
|
|
|
260
266
|
| Role | Default | Purpose |
|
|
261
267
|
| --- | --- | --- |
|
|
262
|
-
| Route | `
|
|
263
|
-
| Main | `
|
|
264
|
-
| Spare | `
|
|
268
|
+
| Route | `localllm/localllm-fast` | Local planner, triage, short tasks, and routing decisions. |
|
|
269
|
+
| Main | `localllm/localllm-deep` | Local complex executor for coding, debugging, writing, research, and long tasks. |
|
|
270
|
+
| Spare | `localllm/localllm-deep` medium | Local cross-check lane; a hosted spare requires explicit selection. |
|
|
265
271
|
| Wrapper | `codex/gpt-5.5` medium | Optional external coding-agent advisor; `research_wrapper` defaults to `gpt-5.4-mini` medium for image/web second opinions. |
|
|
266
|
-
| Auxiliary | `grsai/nano-banana-2` |
|
|
272
|
+
| Auxiliary | `grsai/nano-banana-2` (off) | Explicitly enabled image generation and other non-text helper tools; no credential-driven provider failover. |
|
|
267
273
|
|
|
268
274
|
Useful selectors:
|
|
269
275
|
|
|
@@ -277,7 +283,7 @@ Useful selectors:
|
|
|
277
283
|
/venice
|
|
278
284
|
```
|
|
279
285
|
|
|
280
|
-
Venice routes can be used for optional uncensored or less restricted creative work. DeepSeek
|
|
286
|
+
Venice routes can be used for optional uncensored or less restricted creative work. DeepSeek and the other hosted providers remain explicit upgrades for tasks that benefit from them. See [docs/model-selection.md](docs/model-selection.md), [docs/local-first-agent-runtime.md](docs/local-first-agent-runtime.md), and [references/venice-model-reference.md](references/venice-model-reference.md).
|
|
281
287
|
OpenRouter is available as a first-class OpenAI-compatible provider with one key and company-grouped model buckets such as OpenRouter OpenAI, Anthropic, Google, DeepSeek, Qwen, Meta, Mistral, Moonshot, and xAI.
|
|
282
288
|
|
|
283
289
|
## AAPS And Large Workflows
|
|
@@ -353,6 +359,13 @@ Detailed runtime notes are in [docs/runtime-modes-and-autonomy.md](docs/runtime-
|
|
|
353
359
|
Common environment variables:
|
|
354
360
|
|
|
355
361
|
```bash
|
|
362
|
+
AGENT_PROVIDER=localllm
|
|
363
|
+
LOCALLLM_BASE_URL=http://127.0.0.1:8008/v1
|
|
364
|
+
LOCALLLM_API_KEY=local-dev-key
|
|
365
|
+
AGINTI_LOCALLLM_ROUTE_MODEL=localllm-fast
|
|
366
|
+
AGINTI_LOCALLLM_MAIN_MODEL=localllm-deep
|
|
367
|
+
|
|
368
|
+
# Optional explicit hosted upgrades; never automatic LocalLLM fallbacks.
|
|
356
369
|
DEEPSEEK_API_KEY=...
|
|
357
370
|
OPENAI_API_KEY=...
|
|
358
371
|
OPENROUTER_API_KEY=...
|
|
@@ -361,7 +374,6 @@ OPENROUTER_MODEL=openrouter/auto
|
|
|
361
374
|
QWEN_API_KEY=...
|
|
362
375
|
VENICE_API_KEY=...
|
|
363
376
|
GRSAI_API_KEY=...
|
|
364
|
-
AGENT_PROVIDER=deepseek
|
|
365
377
|
AGENT_ROUTING_MODE=smart
|
|
366
378
|
AGINTI_TASK_PROFILE=auto
|
|
367
379
|
AGINTI_LANGUAGE=en
|
|
@@ -395,11 +407,13 @@ More detail:
|
|
|
395
407
|
| AAPS adapter | [docs/aaps.md](docs/aaps.md) |
|
|
396
408
|
| AgentLink | [docs/agentlink.md](docs/agentlink.md) |
|
|
397
409
|
| Model selection and roles | [docs/model-selection.md](docs/model-selection.md) |
|
|
410
|
+
| Local-first provider and agent boundary | [docs/local-first-agent-runtime.md](docs/local-first-agent-runtime.md) |
|
|
398
411
|
| SCS mode | [docs/student-committee-supervisor.md](docs/student-committee-supervisor.md) |
|
|
399
412
|
| Large-codebase engineering | [docs/large-codebase-engineering.md](docs/large-codebase-engineering.md) |
|
|
400
413
|
| Runtime modes and autonomy | [docs/runtime-modes-and-autonomy.md](docs/runtime-modes-and-autonomy.md) |
|
|
401
414
|
| Skills and tools | [docs/skills-and-tools.md](docs/skills-and-tools.md) |
|
|
402
415
|
| Image reading and web research | [docs/perception-and-web-research.md](docs/perception-and-web-research.md) |
|
|
416
|
+
| Server-owned text-only fallback | [docs/safe-chat.md](docs/safe-chat.md) |
|
|
403
417
|
| Skill Mesh | [docs/skillmesh.md](docs/skillmesh.md) |
|
|
404
418
|
| Housekeeping logs | [docs/housekeeping.md](docs/housekeeping.md) |
|
|
405
419
|
| npm publishing | [docs/npm-publishing.md](docs/npm-publishing.md) |
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { listenPublicResearchServer } from "../src/public-research-server.js";
|
|
3
|
+
|
|
4
|
+
function optionValue(argv, name) {
|
|
5
|
+
const index = argv.indexOf(name);
|
|
6
|
+
return index >= 0 ? argv[index + 1] : "";
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const argv = process.argv.slice(2);
|
|
10
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
11
|
+
console.log("Usage: aginti-public-research [--host 127.0.0.1] [--port 3211]");
|
|
12
|
+
console.log("Starts only the fail-closed public research API; it does not start AgInTiFlow Studio or chat.");
|
|
13
|
+
process.exit(0);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const running = await listenPublicResearchServer({
|
|
17
|
+
host: optionValue(argv, "--host") || undefined,
|
|
18
|
+
port: optionValue(argv, "--port") || undefined,
|
|
19
|
+
}).catch((error) => {
|
|
20
|
+
console.error(`aginti-public-research unavailable: ${error instanceof Error ? error.message : String(error)}`);
|
|
21
|
+
process.exitCode = 1;
|
|
22
|
+
return null;
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
if (running) {
|
|
26
|
+
console.log(`aginti-public-research: ${running.url}`);
|
|
27
|
+
const stop = () => {
|
|
28
|
+
running.server.close(() => process.exit(0));
|
|
29
|
+
setTimeout(() => process.exit(1), 1500).unref?.();
|
|
30
|
+
};
|
|
31
|
+
process.once("SIGINT", stop);
|
|
32
|
+
process.once("SIGTERM", stop);
|
|
33
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { listenSafeChatServer } from "../src/safe-chat-server.js";
|
|
3
|
+
import { redactSensitiveText } from "../src/redaction.js";
|
|
4
|
+
|
|
5
|
+
function optionValue(argv, name) {
|
|
6
|
+
const index = argv.indexOf(name);
|
|
7
|
+
return index >= 0 ? argv[index + 1] : "";
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const argv = process.argv.slice(2);
|
|
11
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
12
|
+
console.log("Usage: aginti-safe-chat [--host 127.0.0.1] [--port 3212]");
|
|
13
|
+
console.log("Starts the authenticated loopback-only, server-owned DeepSeek text fallback.");
|
|
14
|
+
process.exit(0);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const running = await listenSafeChatServer({
|
|
18
|
+
host: optionValue(argv, "--host") || undefined,
|
|
19
|
+
port: optionValue(argv, "--port") || undefined,
|
|
20
|
+
}).catch((error) => {
|
|
21
|
+
console.error(`aginti-safe-chat unavailable: ${redactSensitiveText(error instanceof Error ? error.message : String(error))}`);
|
|
22
|
+
process.exitCode = 1;
|
|
23
|
+
return null;
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
if (running) {
|
|
27
|
+
console.log(`aginti-safe-chat: ${running.url}`);
|
|
28
|
+
const stop = () => {
|
|
29
|
+
running.server.close(() => process.exit(0));
|
|
30
|
+
setTimeout(() => process.exit(1), 1500).unref?.();
|
|
31
|
+
};
|
|
32
|
+
process.once("SIGINT", stop);
|
|
33
|
+
process.once("SIGTERM", stop);
|
|
34
|
+
}
|
|
@@ -7,6 +7,8 @@ AgInTiFlow separates **skills** from **tools**:
|
|
|
7
7
|
|
|
8
8
|
The optional image-generation skills are `image_generation` and `venice_image_generation`. Both use the deterministic `generate_image` tool.
|
|
9
9
|
|
|
10
|
+
Hosted image generation is off by default. Enable the auxiliary mode explicitly with `/auxiliary on`, `/auxiliary image`, the corresponding UI toggle, or `allowAuxiliaryTools=true`. Merely storing `GRSAI` or `VENICE_API_KEY` does not expose or authorize `generate_image` in an agent run.
|
|
11
|
+
|
|
10
12
|
`generate_image` is a raster-image tool. It does not produce true SVG/vector output. If a caller requests `svg`, the tool records
|
|
11
13
|
`requestedFormat: "svg"`, generates a PNG fallback with `actualFormat: "png"`, and returns a `formatNotice`. If the task truly requires
|
|
12
14
|
editable vectors, use AgInTiFlow file tools to write deterministic SVG/LaTeX/HTML instead of calling `generate_image`.
|
|
@@ -32,6 +34,8 @@ Inside interactive chat, use either spelling:
|
|
|
32
34
|
|
|
33
35
|
Keys are saved in `~/.agintiflow/.env` by default as `GRSAI` or `VENICE_API_KEY` with `0600` permissions. Project `.aginti/.env` can override them. The CLI and web app only report whether a key exists; they never return raw values.
|
|
34
36
|
|
|
37
|
+
Provider selection is independent of key discovery. The selected auxiliary provider remains GRS AI or Venice for the whole call. If its key is missing or the request fails, the tool stops visibly; it never switches to the other provider because that provider's ambient key happens to exist. When no provider is selected, the deterministic default is GRS AI.
|
|
38
|
+
|
|
35
39
|
## Runtime Flow
|
|
36
40
|
|
|
37
41
|
For image, cover, poster, illustration, photo, or logo-concept requests, the model can call:
|
|
@@ -118,3 +122,5 @@ Generated images are sent to the canvas automatically when available.
|
|
|
118
122
|
## Guardrails
|
|
119
123
|
|
|
120
124
|
Output paths must stay inside the project workspace. Secret paths, `.git`, `node_modules` writes, and oversized reference images are blocked. Reference images may be workspace files, HTTPS URLs, or data URLs.
|
|
125
|
+
|
|
126
|
+
The mode gate is enforced inside `generate_image` as well as in progressive tool exposure, so a handcrafted model tool call cannot bypass a disabled auxiliary mode.
|
|
@@ -6,7 +6,7 @@ them into AgInTiFlow's built-in `skills/` directory.
|
|
|
6
6
|
|
|
7
7
|
## Scientific Agent Skills
|
|
8
8
|
|
|
9
|
-
When
|
|
9
|
+
When a sibling `../scientific-agent-skills` checkout exists,
|
|
10
10
|
AgInTiFlow automatically discovers it as:
|
|
11
11
|
|
|
12
12
|
- pack: `scientific-agent-skills`
|
|
@@ -13,11 +13,11 @@ Local agent references informed the design:
|
|
|
13
13
|
- Claw-style `doctor` discipline: check health and environment before treating system symptoms as code bugs.
|
|
14
14
|
- Claude/Codex-style context discipline: read project instructions, manifests, entry points, and failing tests before touching broad files.
|
|
15
15
|
|
|
16
|
-
The shared pattern is not “put the whole repo in context.” It is: build a cheap map, choose the next exact evidence, edit with deterministic patches, verify, then compact what changed. AgInTiFlow
|
|
16
|
+
The shared pattern is not “put the whole repo in context.” It is: build a cheap map, choose the next exact evidence, edit with deterministic patches, verify, then compact what changed. AgInTiFlow can use bounded scout calls on the explicitly selected provider to add more independent eyes around that loop, not to replace it.
|
|
17
17
|
|
|
18
18
|
## Skill vs Tool
|
|
19
19
|
|
|
20
|
-
The `large-codebase` profile is a skill: it changes the model’s engineering behavior. It tells
|
|
20
|
+
The `large-codebase` profile is a skill: it changes the model’s engineering behavior. It tells the active main model—LocalLLM Deep by default—to orient first, plan minimally, patch incrementally, and verify.
|
|
21
21
|
|
|
22
22
|
The `inspect_project` function is a tool: it deterministically scans the workspace and returns:
|
|
23
23
|
|
|
@@ -48,7 +48,7 @@ Mature coding agents avoid keeping an entire growing project in the prompt. AgIn
|
|
|
48
48
|
- Project map: `inspect_project` summaries, language counts, source/test directories, and recommended reads.
|
|
49
49
|
- Active evidence: exact search hits, selected files, failing command output, and compact git status/diff.
|
|
50
50
|
- Patch context: only the nearby code needed for `apply_patch`, plus before/after hashes and compact diffs.
|
|
51
|
-
- Scout synthesis:
|
|
51
|
+
- Scout synthesis: bounded parallel scouts use the explicitly selected provider, then a coordinator summary is injected instead of every long transcript becoming permanent context.
|
|
52
52
|
|
|
53
53
|
This keeps the main executor sober: it knows where it is in the repo, but it still re-reads exact files before editing and validates with commands rather than trusting stale memory.
|
|
54
54
|
|
|
@@ -84,7 +84,7 @@ aginti --profile large-codebase "fix the failing tests"
|
|
|
84
84
|
|
|
85
85
|
or choose **Large codebase engineering** in the web task-profile dropdown.
|
|
86
86
|
|
|
87
|
-
Smart routing sends this profile to
|
|
87
|
+
Smart routing sends this profile to LocalLLM Deep even when the user prompt is short. Hosted providers are used only when selected explicitly; their presence in saved or ambient credentials does not activate them or create a fallback.
|
|
88
88
|
|
|
89
89
|
## Auto Profile Behavior
|
|
90
90
|
|
|
@@ -100,11 +100,11 @@ aginti "fix the Rust workspace build"
|
|
|
100
100
|
aginti "repair the Docker setup and run the Node tests"
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-
These route to
|
|
103
|
+
These route to LocalLLM Deep when the complexity score is high enough.
|
|
104
104
|
|
|
105
105
|
## Parallel Scout Mode
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
Complex tasks can use several short advisory calls before the main executor starts. When explicitly enabled, AgInTiFlow runs bounded scouts in parallel on the selected provider:
|
|
108
108
|
|
|
109
109
|
- Architect: decomposes the task and identifies first files/logs/commands.
|
|
110
110
|
- Implementer: predicts patch boundaries and focused checks.
|
|
@@ -139,7 +139,7 @@ aginti --no-web-search "work fully offline"
|
|
|
139
139
|
|
|
140
140
|
## Cross-Language Playbook
|
|
141
141
|
|
|
142
|
-
AgInTiFlow gives
|
|
142
|
+
AgInTiFlow gives the active executor stack-specific reminders without hardcoding a solution:
|
|
143
143
|
|
|
144
144
|
- JS/TS: inspect package scripts and lockfiles, then run focused `node`, `tsc`, or test commands.
|
|
145
145
|
- Python: inspect `pyproject.toml` or requirements, prefer project-local venv/conda/Docker, then run focused pytest/module checks.
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Local-First Agent Runtime
|
|
2
|
+
|
|
3
|
+
Status: active architecture and implementation goal
|
|
4
|
+
|
|
5
|
+
## Objective
|
|
6
|
+
|
|
7
|
+
AgInTiFlow must remain a general agent that can plan, select tools, execute guarded work, verify evidence, and finish truthfully. Its dependable baseline is the sibling LocalLLM service. DeepSeek, OpenAI, and other hosted providers remain optional upgrades, never hidden prerequisites or silent fallbacks.
|
|
8
|
+
|
|
9
|
+
The projects stay decoupled:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
AgInTiFlow orchestration
|
|
13
|
+
-> provider/capability contract
|
|
14
|
+
-> LocalLLM /v1 (baseline)
|
|
15
|
+
-> DeepSeek / OpenAI / compatible gateways (explicit upgrades)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
AgInTiFlow owns sessions, plans, permissions, tool dispatch, idempotency, context compaction, recovery, and verification. LocalLLM owns bounded stateless inference. AgInTiFlow must not depend on LocalLLM's web UI, SQLite conversations, or `/api/agent/*` management routes.
|
|
19
|
+
|
|
20
|
+
## Baseline provider contract
|
|
21
|
+
|
|
22
|
+
The canonical provider id is `localllm`. User-facing aliases `local`, `local-llm`, and `local_llm` may normalize to it, but raw engine labels such as `ollama` or `lmstudio` must not silently become LocalLLM. Saved sessions and events use the canonical id.
|
|
23
|
+
|
|
24
|
+
Default connection:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
base URL: http://127.0.0.1:8008/v1
|
|
28
|
+
placeholder key: local-dev-key
|
|
29
|
+
health: http://127.0.0.1:8008/healthz
|
|
30
|
+
models: authenticated GET /v1/models
|
|
31
|
+
route lane: localllm-fast
|
|
32
|
+
main lane: localllm-deep
|
|
33
|
+
maximum lane: localllm-max
|
|
34
|
+
vision: localllm-vision-xl
|
|
35
|
+
embedding: localllm-embed (sibling-service alias; not an AgInTi text-routing tier)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The default bearer value used by the local deployment is an interoperability placeholder, not a security boundary. Configuration must still send it as a normal bearer token and must never log it. Local endpoints remain loopback-only. A non-loopback LocalLLM base URL is rejected instead of quietly exporting prompts.
|
|
39
|
+
|
|
40
|
+
Readiness requires both `health.ok === true` and `health.ollama.ok === true`, followed by an authenticated `/v1/models` check that confirms the requested alias exists. Health alone is not sufficient.
|
|
41
|
+
|
|
42
|
+
The installed local ladder is capability- and resource-aware. `localllm-fast` handles short routing and bounded work; substantive coding and agent tasks use the 30B-A3B Q4 `localllm-deep` lane. The 30B-A3B Q8 `localllm-max` lane remains explicitly selectable, but every new or resumed Max run performs a fresh pre-inference gate after authenticated alias discovery. It requires at least 24 GiB available host RAM, swap use no higher than 75%, and 40 GiB aggregate free NVIDIA memory (Q8 weights plus working reserve). Missing GPU telemetry fails closed. Automatic Max is off by default and requires `AGINTI_LOCALLLM_ALLOW_AUTO_MAX=true`; an eligible run confirms the configured Max alias and fresh headroom before upgrading the actual model client from Deep. If the optional upgrade cannot be proven safe, it continues on Deep rather than failing. The automatic Vision policy requires both a trusted image-input signal and confirmed model capability. The shipped CLI/web currently reach vision through the local `read_image` tool or explicit `localllm-vision-xl` selection; both paths readiness-check the selected alias, and prompt keywords alone never activate Vision XL.
|
|
43
|
+
|
|
44
|
+
## Provider-neutral capabilities
|
|
45
|
+
|
|
46
|
+
Provider identity and model capability are separate. The current public provider contract normalizes `provider`, `label`, `openaiCompatible`, `local`, `requiresApiKey`, `toolProtocol`, `structuredOutput`, `supportsReasoningEffort`, and `textToolFallback`. The reusable target contract will expand that record with model- and runtime-specific fields instead of scattering provider-name checks:
|
|
47
|
+
|
|
48
|
+
```text
|
|
49
|
+
local
|
|
50
|
+
requiresApiKey
|
|
51
|
+
nativeTools
|
|
52
|
+
textToolFallback
|
|
53
|
+
jsonObject
|
|
54
|
+
strictJsonSchema
|
|
55
|
+
vision
|
|
56
|
+
embeddings
|
|
57
|
+
reasoningEffort
|
|
58
|
+
effectiveContext
|
|
59
|
+
maxOutput
|
|
60
|
+
maxConcurrency
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Current LocalLLM request policy starts conservatively:
|
|
64
|
+
|
|
65
|
+
- native OpenAI-compatible function calls are tried first and locally validated;
|
|
66
|
+
- parallel tool calls are disabled;
|
|
67
|
+
- `json_object` plus strict post-validation is preferred over recursive `oneOf`/`$defs` schemas;
|
|
68
|
+
- a bounded text-tool protocol is a fallback path, not the default;
|
|
69
|
+
- remote images are fetched only when web access is enabled and any configured domain allowlist permits them; the provider receives bounded data URLs rather than the original remote URL;
|
|
70
|
+
- cancellation closes the active HTTP request; it does not imply provider-side rollback;
|
|
71
|
+
- the main agent loop is sequential, but the general runtime does not yet enforce a provider-wide semaphore across sessions; explicitly enabled scouts and specialist batches use their own bounded concurrency.
|
|
72
|
+
|
|
73
|
+
DeepSeek and OpenAI use the same normalized interface. A stronger model may receive a larger context, broader tool set, or higher step budget, but it does not get weaker permissions or a different truthfulness contract.
|
|
74
|
+
|
|
75
|
+
## Local-model execution ladder
|
|
76
|
+
|
|
77
|
+
The runtime should choose the least expensive lane that can satisfy the request:
|
|
78
|
+
|
|
79
|
+
1. **Direct answer** — ordinary conversation or a bounded knowledge question, with no tool schemas.
|
|
80
|
+
2. **Focused agent** — one task-shaped tool bundle, a small step budget, and no separate planning call unless needed.
|
|
81
|
+
3. **Thorough agent** — explicit plan, broader task-shaped tools, evidence checks, and context compaction.
|
|
82
|
+
4. **Supervised/SCS** — high-risk or long work with separate review and truthful blocker handling.
|
|
83
|
+
|
|
84
|
+
This is progressive capability disclosure, not capability removal. A focused coding request initially needs workspace inspection, search/read, patch/write, a guarded command, and finish. It does not need browser, MCP, writing, image, AgentLink, tmux, and research schemas in the same first call. A later turn may add a capability only when task routing or observed evidence justifies it.
|
|
85
|
+
|
|
86
|
+
Suggested compact bundles:
|
|
87
|
+
|
|
88
|
+
| Bundle | Initial tools |
|
|
89
|
+
| --- | --- |
|
|
90
|
+
| Workspace/code | `inspect_project`, `list_files`, `search_files`, `read_file`, `apply_patch`, `write_file`, `run_command`, `finish` |
|
|
91
|
+
| Browser | `open_url`, `click`, `type`, `scroll`, `press`, `back`, `wait`, `finish` |
|
|
92
|
+
| Research | `web_search`, `web_research`, `finish` |
|
|
93
|
+
| Long job | `start_long_job`, `long_job_status`, `finish` |
|
|
94
|
+
| Coordination | selected AgentLink or tmux tools plus `finish` |
|
|
95
|
+
|
|
96
|
+
Disabled tools stay impossible to dispatch even if a model names them in text or JSON.
|
|
97
|
+
|
|
98
|
+
## Tool-call recovery
|
|
99
|
+
|
|
100
|
+
Every model-selected action passes the same server-side registry and argument validator. Model output is never executable authority.
|
|
101
|
+
|
|
102
|
+
For one agent step:
|
|
103
|
+
|
|
104
|
+
1. Try a simple native function call.
|
|
105
|
+
2. Reject unknown, disabled, duplicate, malformed, or over-budget calls locally.
|
|
106
|
+
3. If the provider/model is known to need repair, request one plain JSON or text-protocol repair with only the relevant tools.
|
|
107
|
+
4. Revalidate the repair from scratch.
|
|
108
|
+
5. If repair fails, return a deterministic safe blocker or use an explicitly configured stronger lane.
|
|
109
|
+
|
|
110
|
+
Never replay a mutating tool merely because a model request timed out. The persisted tool ledger must prove a call has not already completed before retrying it.
|
|
111
|
+
|
|
112
|
+
Plain assistant content with no tool call is a valid finish only when the execution policy permits a direct answer or the evidence ledger shows the requested work is already complete. Otherwise the runtime asks once for the missing action/evidence, then stops truthfully instead of pretending completion.
|
|
113
|
+
|
|
114
|
+
## Context and output budgets
|
|
115
|
+
|
|
116
|
+
Character-only history accounting is not enough because tool schemas and UTF-8 density also consume context. The request budget includes:
|
|
117
|
+
|
|
118
|
+
```text
|
|
119
|
+
system instructions
|
|
120
|
+
+ selected tool schemas
|
|
121
|
+
+ conversation and compacted evidence
|
|
122
|
+
+ current task/snapshot
|
|
123
|
+
+ output reserve
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Conservative LocalLLM defaults:
|
|
127
|
+
|
|
128
|
+
- configured request envelope: 32K total context, including messages, selected tool schemas, and output allowance;
|
|
129
|
+
- planning response: at most 2K output inside that same configured request envelope;
|
|
130
|
+
- normal agent step: an 8K output allowance and 4K tool-schema reserve leave a 20K compaction input ceiling under the default 32K envelope;
|
|
131
|
+
- final answer: at most 8K output unless the task explicitly requires more;
|
|
132
|
+
- compaction target: preserve goal, permissions, plan, unresolved blockers, file/tool evidence, and recent turns;
|
|
133
|
+
- concurrency is controlled by each execution path: the main loop is sequential, while explicitly enabled batch/helper paths may issue bounded parallel requests.
|
|
134
|
+
|
|
135
|
+
If a model returns empty visible content and no valid tool call, retry once with a compacted prompt and adequate output headroom. Repeated emptiness becomes a visible model limitation, not an infinite loop.
|
|
136
|
+
|
|
137
|
+
## Durable session runtime
|
|
138
|
+
|
|
139
|
+
Each session stores a versioned, revisioned runtime snapshot containing only safe provider, model-role, tool-policy, sandbox, context-budget, wrapper, auxiliary, and network-scope choices. It never stores API keys, bearer values, base URLs, environment maps, clients, callbacks, or abort signals.
|
|
140
|
+
|
|
141
|
+
On resume, the saved snapshot is authoritative. Current shell variables and current web preferences cannot silently replace its provider or role models. Credentials are freshly resolved for the saved provider after the snapshot is loaded. An explicit runtime change must carry the current revision; stale changes and continuations fail with a conflict before readiness checks or model-client creation. Web preferences seed new sessions only. The same contract applies to CLI, interactive, and web continuations.
|
|
142
|
+
|
|
143
|
+
Legacy sessions without a snapshot are migrated conservatively: route, main, and spare roles all inherit their saved top-level provider/model so migration cannot introduce a hosted lane. The web execution gate serializes same-process continuations; independent processes should not concurrently mutate one session.
|
|
144
|
+
|
|
145
|
+
## Hosted upgrades and privacy
|
|
146
|
+
|
|
147
|
+
Cloud escalation is opt-in and visible. A local failure must not silently send the workspace, prompt, images, tool results, or compacted history to DeepSeek/OpenAI.
|
|
148
|
+
|
|
149
|
+
An escalation policy records:
|
|
150
|
+
|
|
151
|
+
```text
|
|
152
|
+
allowed providers
|
|
153
|
+
reason for escalation
|
|
154
|
+
maximum context exported
|
|
155
|
+
whether artifacts/images may leave the host
|
|
156
|
+
whether the user approved this run or configured a durable policy
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Provider failure before any tool executes may retry or switch according to that policy. After a tool executes, failover reuses the persisted result and never repeats the action without an idempotency proof.
|
|
160
|
+
|
|
161
|
+
## Evaluation gates
|
|
162
|
+
|
|
163
|
+
Offline deterministic tests run on every change:
|
|
164
|
+
|
|
165
|
+
- LocalLLM defaults, aliases, loopback enforcement, and no-key onboarding;
|
|
166
|
+
- smart route/main selection for `localllm-fast` and `localllm-deep`;
|
|
167
|
+
- compact tool bundle size and disabled-tool rejection;
|
|
168
|
+
- valid native tool call and complete tool-result round trip;
|
|
169
|
+
- malformed arguments, unknown tool, duplicate call id, and one bounded repair;
|
|
170
|
+
- no-tool direct answer versus incomplete-work retry/blocker;
|
|
171
|
+
- timeout before output, cancellation, and no post-cancel dispatch;
|
|
172
|
+
- context calculation includes tool schemas and output reserve;
|
|
173
|
+
- no silent hosted fallback;
|
|
174
|
+
- session resume preserves provider, model, capability profile, and executed-tool ledger.
|
|
175
|
+
|
|
176
|
+
Live compatibility tests are opt-in because they load local models:
|
|
177
|
+
|
|
178
|
+
| Lane | Minimum cases |
|
|
179
|
+
| --- | --- |
|
|
180
|
+
| `localllm-pocket` / 4B (direct sibling-service compatibility alias, not an automatic AgInTi tier) | direct answer, one-tool selection, malformed-output recovery, truthful blocker |
|
|
181
|
+
| `localllm-fast` / 8B | focused code inspection/edit/test loop, cancellation, resumed turn |
|
|
182
|
+
| `localllm-deep` / 30B-A3B Q4 | multi-step plan, repair after failed tool evidence, long-context compaction |
|
|
183
|
+
| `localllm-max` / 30B-A3B Q8 | explicit opt-in, resource preflight, highest-fidelity local code task |
|
|
184
|
+
| `localllm-vision-xl` / 30B-A3B Q4 | attached-image understanding with no keyword-only activation |
|
|
185
|
+
| DeepSeek/OpenAI | same fixtures, plus explicit escalation and stronger-model quality comparison |
|
|
186
|
+
|
|
187
|
+
Record pass/fail, latency, prompt size, tool accuracy, repair count, repeated-call count, completion truthfulness, and peak context. Quality promotion requires deterministic safety gates first; a fluent answer is not evidence that work completed.
|
|
188
|
+
|
|
189
|
+
## Delivery sequence
|
|
190
|
+
|
|
191
|
+
1. Add the provider contract and make LocalLLM the credential-free local-first default.
|
|
192
|
+
2. Remove DeepSeek-only assumptions from routing, auth, specialists, CLI, web settings, and saved preferences.
|
|
193
|
+
3. Add provider-aware request budgets and progressive tool disclosure.
|
|
194
|
+
4. Add bounded native-tool repair and incomplete-work detection.
|
|
195
|
+
5. Add offline conformance fixtures, then opt-in live LocalLLM evaluations.
|
|
196
|
+
6. Add explicit cloud escalation policy and comparative quality routing.
|
|
197
|
+
7. Expose the provider-neutral agent runtime as a reusable library/API so LocalLLM may later mount AgInTi capabilities without importing AgInTiFlow UI or storage internals.
|
|
198
|
+
|
|
199
|
+
The final integration direction is dependency inversion: LocalLLM can call a packaged AgInTi runtime adapter later, and AgInTiFlow can call any conforming inference provider today. Neither repository becomes the other's internal implementation detail.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Machine Run Interface
|
|
2
|
+
|
|
3
|
+
Use `aginti run` when another local application needs one AgInTiFlow turn without interactive CLI output.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
printf '%s\n' 'Summarize this evidence.' |
|
|
7
|
+
aginti run --stdin --json --task-profile chatops --no-scs -s safe
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
`--json` writes exactly one JSON object to stdout:
|
|
11
|
+
|
|
12
|
+
```json
|
|
13
|
+
{"ok":true,"sessionId":"...","result":"...","stopped":false,"failed":false,"reason":""}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Runtime headers, plans, tool logs, and sandbox diagnostics are suppressed. A missing key, timeout, empty result, or stopped run returns `ok: false` and a nonzero exit code. Callers must forward only `result`, never stderr or the full runtime state.
|
|
17
|
+
|
|
18
|
+
The `chatops` profile treats the current request as the sole source of authority. It avoids unrelated workspace artifacts and does not use tools for simple conversation. Use `-s safe` for read-only routing and research. Use `-s normal` with the default Docker workspace only when the request needs current-project artifacts. Do not use `-s danger` for unattended chat transports.
|