@lazyingart/agintiflow 0.20.157 → 0.20.164

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 (41) hide show
  1. package/README.md +7 -3
  2. package/docs/external-skill-packs.md +59 -0
  3. package/docs/mcp.md +120 -0
  4. package/docs/npm-publishing.md +4 -2
  5. package/docs/skills-and-tools.md +35 -3
  6. package/docs/student-committee-supervisor.md +15 -11
  7. package/package.json +10 -3
  8. package/public/app.js +33 -0
  9. package/public/index.html +14 -0
  10. package/public/styles.css +9 -0
  11. package/references/bilingual-book-supervision-lessons.md +353 -0
  12. package/references/codex-session-cross-references.md +175 -0
  13. package/references/dynamic-step-budget-and-scs-auto.md +5 -5
  14. package/references/scs-evidence-validator-core-design.md +181 -0
  15. package/scripts/fixtures/mcp-stdio-smoke-server.mjs +71 -0
  16. package/scripts/npm-publish-from-env.js +96 -0
  17. package/scripts/smoke-capabilities.js +1 -0
  18. package/scripts/smoke-cli-chat.js +60 -12
  19. package/scripts/smoke-dynamic-step-budget.js +1 -1
  20. package/scripts/smoke-mcp.js +105 -0
  21. package/scripts/smoke-model-roles.js +209 -1
  22. package/scripts/smoke-skills.js +87 -1
  23. package/scripts/smoke-web-api.js +30 -0
  24. package/skills/browser-automation/SKILL.md +0 -1
  25. package/skills/skill-creator/SKILL.md +43 -0
  26. package/src/agent-runner.js +34 -2
  27. package/src/capabilities.js +29 -1
  28. package/src/cli.js +82 -5
  29. package/src/config.js +2 -1
  30. package/src/guardrails.js +5 -0
  31. package/src/interactive-cli.js +182 -32
  32. package/src/mcp/client-registry.js +267 -0
  33. package/src/mcp/config.js +260 -0
  34. package/src/mcp/policy.js +140 -0
  35. package/src/mcp/tool-bridge.js +156 -0
  36. package/src/model-client.js +152 -2
  37. package/src/scs-controller.js +111 -8
  38. package/src/scs-evidence.js +473 -0
  39. package/src/skill-library.js +221 -5
  40. package/src/skillmesh.js +1 -1
  41. package/web.js +46 -1
package/README.md CHANGED
@@ -56,8 +56,9 @@ Most agent tools are either a chat box with hidden state or an expensive one-mod
56
56
  | Writing without agent noise | `writing_specialist` drafts novels, books, scripts, essays, and paper prose in an isolated writing-only context, then the main agent handles files, formatting, citations, checks, and artifacts. |
57
57
  | Visual and web evidence | `read_image` reads screenshots/figures with typed perception artifacts, `web_research` saves sourced research artifacts, and `research_wrapper` can ask Codex `gpt-5.4-mini` medium for a strict-JSON second opinion. |
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
- | SCS for high-risk work | Student-Committee-Supervisor mode adds a typed gate: committee drafts, student approves/monitors, supervisor executes. Use `/scs` or `--scs auto`. |
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. |
61
+ | MCP without tool sprawl | Project/global MCP servers can be connected through a fixed guarded bridge. AgInTiFlow lists tools/resources/prompts and calls selected server tools without dumping untrusted remote tool schemas directly into every model turn. |
61
62
  | Local safety by default | Docker workspace mode, path guardrails, secret redaction, blocked npm publish/token commands, and visible logs keep the agent practical without making it opaque. |
62
63
 
63
64
  ## Quick Start
@@ -153,8 +154,10 @@ aginti --language de
153
154
  | Review current repo | `/review [focus]` |
154
155
  | Toggle SCS quality gate | `/scs` |
155
156
  | Use SCS only for complex work | `/scs auto` or `aginti --scs auto "task"` |
157
+ | Disable SCS for simple work | `/scs off` or `aginti --no-scs "task"` |
156
158
  | Control dynamic step budgets | `--dynamic-steps auto\|on\|off` |
157
159
  | Work with AAPS workflows | `aginti aaps status`, `/aaps validate` |
160
+ | Inspect or call MCP servers | `aginti mcp status`, `/mcp tools <server>`, `/mcp call <server> <tool> '{"arg":"value"}'` |
158
161
  | Choose models | `/route`, `/model`, `/spare`, `/wrapper`, `/auxiliary model` |
159
162
  | Switch permissions | `-s safe`, `-s normal`, `-s danger`, or `/safe`, `/normal`, `/danger` |
160
163
  | Enable Venice shortcut | `/venice` |
@@ -237,10 +240,11 @@ The website keeps the visual walkthrough in a carousel so this README can stay f
237
240
  | Patch workflow | Codex-style patch envelopes, unified diffs, exact replacements, hashes, compact diffs, and path guardrails. |
238
241
  | Parallel scouts | Optional scout calls for architecture, implementation, review, tests, git flow, research, symbol tracing, and dependency risk. |
239
242
  | Image reading and web research | `read_image` uses OpenAI vision for workspace images when `OPENAI_API_KEY` is configured. `web_research` preserves source lists, and optional OpenAI hosted web search or `research_wrapper` can be used for higher-confidence research. |
240
- | SCS mode | Optional Student-Committee-Supervisor quality gate for complicated or risky tasks. |
243
+ | SCS mode | Default Student-Committee-Supervisor quality gate with independent planning, execution, and validation roles. |
241
244
  | AAPS adapter | Optional `@lazyingart/aaps` integration for `.aaps` workflow init, validate, parse, compile, dry-run, and run commands. |
242
245
  | Image generation | Optional GRS AI and Venice image tools with saved manifests and canvas artifact previews. |
243
- | Skill library | Built-in Markdown skills for code, websites, Android/iOS, Python, Rust, Java, LaTeX, writing, reviews, source ingestion/OCR, structured JSON, autonomous artifact pipelines, GitHub, AAPS, and more. |
246
+ | 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. |
247
+ | 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. |
244
248
  | Skill Mesh | Optional strict skill recording/sharing for reviewed reusable skill packs. If unused, AgInTiFlow runs normally without background sharing. |
245
249
  | Multilingual UI | CLI and docs language support for English, Japanese, Simplified/Traditional Chinese, Korean, French, Spanish, Arabic, Vietnamese, German, and Russian. |
246
250
 
@@ -0,0 +1,59 @@
1
+ # External Skill Packs
2
+
3
+ AgInTiFlow can load reviewed external Agent Skills repositories as grouped skill
4
+ packs. This keeps large third-party collections intact instead of flattening
5
+ them into AgInTiFlow's built-in `skills/` directory.
6
+
7
+ ## Scientific Agent Skills
8
+
9
+ When `/home/lachlan/ProjectsLFS/Agent/scientific-agent-skills` exists,
10
+ AgInTiFlow automatically discovers it as:
11
+
12
+ - pack: `scientific-agent-skills`
13
+ - label: `Scientific Agent Skills`
14
+ - category: `scientific`
15
+ - skills directory: `scientific-skills/`
16
+
17
+ The skills are shown as `source=external-pack category=scientific
18
+ pack=scientific-agent-skills` in `aginti skills`.
19
+
20
+ Example:
21
+
22
+ ```bash
23
+ aginti skills rdkit
24
+ aginti skills "single cell scanpy"
25
+ ```
26
+
27
+ The original repository remains a separate checkout. AgInTiFlow only reads
28
+ `*/SKILL.md` files and preserves each skill's local references, scripts, and
29
+ assets in that checkout.
30
+
31
+ ## Generic Pack Loading
32
+
33
+ Set `AGINTIFLOW_SKILL_PACKS` to one or more pack roots separated by the platform
34
+ path delimiter or commas:
35
+
36
+ ```bash
37
+ AGINTIFLOW_SKILL_PACKS=/path/to/pack-a:/path/to/pack-b aginti skills
38
+ ```
39
+
40
+ Each pack may contain one of these layouts:
41
+
42
+ - `scientific-skills/<skill-id>/SKILL.md`
43
+ - `skills/<skill-id>/SKILL.md`
44
+ - `<skill-id>/SKILL.md`
45
+
46
+ AgInTiFlow supports both its native frontmatter (`id`, `label`, `description`,
47
+ `triggers`, `tools`) and the broader Agent Skills dialect used by K-Dense
48
+ (`name`, `description`, `allowed-tools`, nested `metadata`).
49
+
50
+ ## Design Rules
51
+
52
+ - External packs are optional. Missing packs do not block startup.
53
+ - Built-in and project-local skills win on ID collisions.
54
+ - External pack skills are selected only when their name, triggers, or
55
+ description match the task.
56
+ - Skills are prompt guidance, not trusted executable tools. Scripts inside a
57
+ pack still run only through AgInTiFlow's normal command policy.
58
+ - Pack metadata is retained in CLI, web config, capability reports, and prompt
59
+ context so users can see where a skill came from.
package/docs/mcp.md ADDED
@@ -0,0 +1,120 @@
1
+ # AgInTiFlow MCP Bridge
2
+
3
+ AgInTiFlow supports MCP as a guarded runtime bridge. MCP is separate from Markdown skills: skills add prompt guidance, while MCP servers expose executable tools, resources, and prompts.
4
+
5
+ ## Configuration
6
+
7
+ AgInTiFlow loads MCP servers from these sources, later sources overriding earlier server IDs:
8
+
9
+ - Global: `~/.agintiflow/mcp.json`
10
+ - Project: `.aginti/mcp.json`
11
+ - Extra paths: `AGINTIFLOW_MCP_CONFIG`, separated by the OS path delimiter or commas
12
+ - Inline JSON: `AGINTIFLOW_MCP_CONFIG_JSON`
13
+ - Inline server map: `AGINTIFLOW_MCP_SERVERS`
14
+
15
+ Claude-style `mcpServers` and plain `servers` maps are both accepted.
16
+
17
+ ```json
18
+ {
19
+ "mcpServers": {
20
+ "filesystem-readonly": {
21
+ "transport": "stdio",
22
+ "command": "node",
23
+ "args": ["./tools/filesystem-mcp.js"],
24
+ "trust": "read-only",
25
+ "readOnly": true,
26
+ "allowedTools": ["list_files", "read_file"]
27
+ },
28
+ "research": {
29
+ "transport": "http",
30
+ "url": "http://127.0.0.1:4321/mcp",
31
+ "trust": "untrusted"
32
+ }
33
+ }
34
+ }
35
+ ```
36
+
37
+ ## CLI And Chat
38
+
39
+ Inspect MCP status:
40
+
41
+ ```bash
42
+ aginti mcp status
43
+ aginti mcp config --json
44
+ aginti mcp tools filesystem-readonly
45
+ aginti mcp resources filesystem-readonly
46
+ aginti mcp read filesystem-readonly aginti://example/resource
47
+ aginti mcp prompts research
48
+ aginti mcp prompt research summarize '{"topic":"protein design"}'
49
+ aginti mcp call filesystem-readonly read_file '{"path":"README.md"}'
50
+ aginti mcp restart filesystem-readonly
51
+ ```
52
+
53
+ Inside the interactive CLI:
54
+
55
+ ```text
56
+ /mcp status
57
+ /mcp tools filesystem-readonly
58
+ /mcp call filesystem-readonly read_file {"path":"README.md"}
59
+ /mcp off
60
+ /mcp on
61
+ ```
62
+
63
+ ## Runtime Model Contract
64
+
65
+ The model sees a fixed bridge toolset:
66
+
67
+ - `mcp_list_servers`
68
+ - `mcp_list_tools`
69
+ - `mcp_call_tool`
70
+ - `mcp_list_resources`
71
+ - `mcp_read_resource`
72
+ - `mcp_list_prompts`
73
+ - `mcp_get_prompt`
74
+
75
+ AgInTiFlow intentionally does not dump every remote MCP tool into the model by default. This avoids tool-name collisions, tool poisoning, and unbounded prompt growth. Remote tool descriptions, resources, prompts, and results are always untrusted context and never override system, developer, user, project, or permission instructions.
76
+
77
+ ## Policy
78
+
79
+ MCP calls pass through AgInTiFlow policy:
80
+
81
+ - Stdio servers require shell tools to be enabled.
82
+ - Stdio server commands are host processes, even when the agent shell sandbox is Docker. AgInTiFlow checks them against host command policy and requires `trust=trusted` or `allowHostProcess=true` when the command is broader than the narrow read-only host allowlist.
83
+ - `allowedTools` and `deniedTools` are enforced before a tool call.
84
+ - `readOnly` servers block mutating-looking tools unless explicitly trusted.
85
+ - Mutating-looking tools require `allowedTools`, `trust=trusted`, `allowAllTools=true`, or a trusted destructive run mode.
86
+ - Safe mode blocks reading resources/prompts from `trust=untrusted` servers.
87
+ - Secret-like fields in returned data are redacted before logs and model context.
88
+
89
+ Every MCP operation records normal AgInTiFlow tool events, so sessions remain auditable through CLI logs, web run output, and session event JSONL.
90
+
91
+ ## Web UI
92
+
93
+ The web UI exposes configured MCP servers in the capability panel and `/api/mcp`:
94
+
95
+ ```bash
96
+ curl http://127.0.0.1:3210/api/mcp
97
+ curl -X POST http://127.0.0.1:3210/api/mcp \
98
+ -H 'content-type: application/json' \
99
+ -d '{"argv":["tools","filesystem-readonly"]}'
100
+ ```
101
+
102
+ Use the MCP toggle in Advanced Settings to disable bridge tools for a run without changing project configuration.
103
+
104
+ ## Current Scope
105
+
106
+ Implemented now:
107
+
108
+ - Config loading and redacted public summaries.
109
+ - Stdio client lifecycle with lazy startup, request timeouts, stderr capture, and shutdown.
110
+ - Streamable HTTP client lifecycle.
111
+ - Guarded bridge tools in the model loop.
112
+ - CLI `/mcp` and `aginti mcp` commands.
113
+ - Web API and status panel.
114
+ - Smoke coverage with a real local stdio MCP server.
115
+
116
+ Not implemented yet:
117
+
118
+ - OAuth and elicitation UX.
119
+ - Dynamic direct tool registration such as `mcp__server__tool`.
120
+ - AgInTiFlow acting as an MCP server for external clients.
@@ -38,8 +38,10 @@ Trusted Publishing is preferred. A local automation token can be used only for b
38
38
  ```bash
39
39
  cp .env.example .env
40
40
  # Add NPM_TOKEN or NODE_AUTH_TOKEN locally only.
41
- set -a && source .env && set +a
42
- npm publish --access public
41
+ npm run publish:env:whoami
42
+ npm run publish:env
43
43
  ```
44
44
 
45
+ `publish:env` reads `.env`, writes a temporary npm config, runs npm with that config, and deletes it. Do not use global `~/.npmrc` for agent-driven publishing because it can be stale, point at the wrong account, or leak between projects.
46
+
45
47
  Never commit `.env`, `.npmrc`, npm tokens, OTPs, npm debug logs, or generated credential material. The runtime command policy intentionally blocks npm publish and npm token commands during agent runs.
@@ -4,7 +4,7 @@ AgInTiFlow separates **skills** from **tools** so the agent can stay general whi
4
4
 
5
5
  ## Definitions
6
6
 
7
- **Skill**: Markdown guidance stored at `skills/<id>/SKILL.md`. A skill describes when to use a workflow, what to inspect first, which outputs matter, and which tools are usually useful. Skills are prompt context, not executable code.
7
+ **Skill**: Markdown guidance stored at built-in `skills/<id>/SKILL.md` or project-local `.aginti/skills/<id>/SKILL.md`. A skill describes when to use a workflow, what to inspect first, which outputs matter, and which tools are usually useful. Skills are prompt context, not executable code.
8
8
 
9
9
  **Tool**: A deterministic or bounded callable capability exposed to the model, such as `inspect_project`, `read_file`, `apply_patch`, `run_command`, `web_search`, `web_research`, `read_image`, `writing_specialist`, `research_wrapper`, `generate_image`, `preview_workspace`, `tmux_capture_pane`, or `send_to_canvas`.
10
10
 
@@ -12,7 +12,35 @@ AgInTiFlow separates **skills** from **tools** so the agent can stay general whi
12
12
 
13
13
  ## Built-In Skills
14
14
 
15
- The package ships built-in skills for code engineering, website/app building, LaTeX manuscripts, books, Microsoft Word documents, image generation, GitHub maintenance, system maintenance, source ingestion/OCR, structured JSON, autonomous artifact pipelines, tmux session control, Android, R/Stan, Python, C/C++, shell scripting, AAPS, novel writing, and supervision/student-agent training.
15
+ The package ships built-in skills for code engineering, website/app building, LaTeX manuscripts, books, Microsoft Word documents, image generation, GitHub maintenance, system maintenance, source ingestion/OCR, structured JSON, autonomous artifact pipelines, tmux session control, Android, R/Stan, Python, C/C++, shell scripting, AAPS, skill creation, novel writing, and supervision/student-agent training.
16
+
17
+ ## External Skill Packs
18
+
19
+ AgInTiFlow can also load whole external Agent Skills repositories as grouped
20
+ skill packs. This is for large curated collections that should remain intact,
21
+ with their own references, scripts, assets, and upstream history.
22
+
23
+ The current default scientific pack integration looks for the sibling checkout:
24
+
25
+ ```bash
26
+ /home/lachlan/ProjectsLFS/Agent/scientific-agent-skills
27
+ ```
28
+
29
+ When present, it appears as `source=external-pack category=scientific
30
+ pack=scientific-agent-skills`:
31
+
32
+ ```bash
33
+ aginti skills rdkit
34
+ aginti skills "single cell scanpy"
35
+ ```
36
+
37
+ For arbitrary pack roots, set:
38
+
39
+ ```bash
40
+ AGINTIFLOW_SKILL_PACKS=/path/to/pack-a:/path/to/pack-b aginti skills
41
+ ```
42
+
43
+ See [External Skill Packs](external-skill-packs.md).
16
44
 
17
45
  List them from a project:
18
46
 
@@ -53,10 +81,14 @@ Selected skills are injected into the plan and execution prompts. The LLM still
53
81
 
54
82
  ## Adding A Skill
55
83
 
56
- Create `skills/<id>/SKILL.md` with valid YAML frontmatter and a short Markdown body. Keep descriptions strings, not YAML arrays, because loaders expect `id`, `label`, and `description` as scalar strings.
84
+ For a reusable project workflow, create `.aginti/skills/<id>/SKILL.md` with valid YAML frontmatter and a short Markdown body. These skills are loaded from the current project, shown as `source=project-local`, and are preferred for task-specific knowledge that should not become core runtime policy.
85
+
86
+ Built-in package skills live at `skills/<id>/SKILL.md`. Keep descriptions strings, not YAML arrays, because loaders expect `id`, `label`, and `description` as scalar strings.
57
87
 
58
88
  Good skills are small, actionable, and tool-aware. They should say what to inspect, what to create or verify, and what to avoid. They should not hard-code one exact task.
59
89
 
90
+ Use the built-in `skill-creator` skill when the user asks AgInTiFlow to learn or document a reusable method. It should create project-local skills first, then propose SkillMesh sharing only after the workflow has been validated.
91
+
60
92
  For visual or current-information tasks, prefer:
61
93
 
62
94
  - `read_image` for screenshots, plots, diagrams, microscopy images, scanned text, and UI debugging.
@@ -1,13 +1,13 @@
1
1
  # Student-Committee-Supervisor Mode
2
2
 
3
- Student-Committee-Supervisor mode, or SCS, is an optional quality gate for complicated AgInTiFlow tasks.
3
+ Student-Committee-Supervisor mode, or SCS, is the default quality gate for AgInTiFlow tasks.
4
4
 
5
- It is intentionally separate from the normal fast pipeline. Small requests should stay cheap and direct. SCS is for work where a weak plan, repeated failed action, or premature finish would be expensive.
5
+ It separates planning, execution, and validation so the executor does not grade its own work. Use `--no-scs` or `/scs off` only when latency matters more than independent validation.
6
6
 
7
7
  ## Commands
8
8
 
9
9
  ```bash
10
- aginti --scs "fix this complicated project and verify it"
10
+ aginti "fix this complicated project and verify it"
11
11
  aginti --scs auto "migrate this app and run the checks"
12
12
  aginti --no-scs "answer this simple question"
13
13
  ```
@@ -22,7 +22,7 @@ Inside interactive chat:
22
22
  /scs status
23
23
  ```
24
24
 
25
- `/scs` without arguments toggles the feature: off becomes on, and on/auto becomes off.
25
+ `/scs` without arguments toggles the feature: off becomes on, and on/auto becomes off. The default for new sessions is `on`.
26
26
 
27
27
  ## Role Contract
28
28
 
@@ -47,6 +47,8 @@ When SCS is active:
47
47
  - Failed, blocked, suspicious, or mismatched tools trigger a bounded student validator review.
48
48
  - Every fourth execution step triggers a bounded progress review for long runs.
49
49
  - `finish` and assistant-content completion pass through a final student gate.
50
+ - A deterministic task contract and evidence ledger are built under the student gate. The contract records required evidence categories such as file, command, artifact, browser, visual, git, or publish evidence. The ledger classifies recent tool and event evidence into those categories.
51
+ - The final gate compares the contract, approved plan, executor finish claim, and evidence ledger. A model approval cannot override missing deterministic evidence for evidence-bearing tasks unless the run is reporting a real external blocker.
50
52
  - If the student validator rejects progress or finish, the runtime asks the committee for a new phase plan and sends that plan back through the student gate before the supervisor continues.
51
53
  - Decisions are persisted as `scs.*` events and the phase pack is saved as a session artifact.
52
54
 
@@ -59,23 +61,23 @@ The current implementation is deliberately bounded:
59
61
 
60
62
  ## Auto Mode
61
63
 
62
- `/scs auto` and `--scs auto` activate SCS for complex, risky, or long-running work. Signals include:
64
+ `/scs auto` and `--scs auto` are still available when a user wants cheaper routing for simple turns. Auto mode activates SCS for complex, risky, or long-running work. Signals include:
63
65
 
64
66
  - high smart-routing complexity score;
65
67
  - profiles such as code, app, Android/iOS, large-codebase, GitHub, maintenance, security, LaTeX, research, and supervision;
66
68
  - prompts mentioning multi-file work, regressions, builds, deployments, tmux, emulators, Docker, PDFs, or similar high-friction workflows.
67
69
 
68
- Auto mode stays off for simple turns.
70
+ Auto mode stays off for simple turns, but it is not the default.
69
71
 
70
72
  ## Dynamic Step Budgets
71
73
 
72
74
  AgInTiFlow treats `maxSteps` as the initial run budget. Near the boundary, the runtime may grant a bounded extension only when recent tool/file/artifact evidence shows concrete progress and no permission blocker is being bypassed.
73
75
 
74
- Normal mode uses a lightweight deterministic monitor. `/scs on` and activated `/scs auto` runs add the SCS student budget gate, which can emit `extend_steps`, `deny_extension`, or `rethink_plan`. More steps never escalate permissions, package policy, host access, destructive actions, or secret access. Use `--dynamic-steps off` when a strict hard stop is required. The detailed design is tracked in [references/dynamic-step-budget-and-scs-auto.md](../references/dynamic-step-budget-and-scs-auto.md).
76
+ Normal mode uses a lightweight deterministic monitor. Default SCS runs and activated `/scs auto` runs add the SCS student budget gate, which can emit `extend_steps`, `deny_extension`, or `rethink_plan`. More steps never escalate permissions, package policy, host access, destructive actions, or secret access. Use `--dynamic-steps off` when a strict hard stop is required. The detailed design is tracked in [references/dynamic-step-budget-and-scs-auto.md](../references/dynamic-step-budget-and-scs-auto.md).
75
77
 
76
- ## When To Use It
78
+ ## When To Keep It On
77
79
 
78
- Use SCS for:
80
+ Keep SCS on for:
79
81
 
80
82
  - large coding tasks with ambiguous scope;
81
83
  - Android/iOS/system tasks where environment checks matter;
@@ -84,7 +86,7 @@ Use SCS for:
84
86
  - paper/LaTeX work where final artifacts need evidence;
85
87
  - self-supervision or capability-training runs.
86
88
 
87
- Avoid SCS for:
89
+ Turn SCS off only for:
88
90
 
89
91
  - `ls`, `pwd`, short factual answers, and small one-file edits;
90
92
  - tasks where latency matters more than plan quality;
@@ -114,6 +116,8 @@ These are saved in the normal session event log under `~/.agintiflow/sessions/<s
114
116
 
115
117
  Browser and CDP helper commands are reviewed by evidence, not only by exit status. If a click or selector command reports `ok: true` but returns broad whole-page text, repeated navigation/history/sidebar text, or no scoped target evidence, SCS treats the result as suspicious and asks the supervisor to verify state or switch to a precise selector before continuing.
116
118
 
119
+ For upload, browser, visual, media, or external-service tasks, a successful helper command is not enough by itself. The ledger must include evidence that proves the requested state, such as the active page, visible count, screenshot, output artifact, build/test output, or committed/published state.
120
+
117
121
  ## Design Reference
118
122
 
119
- The deeper design research lives in [references/student-committee-supervisor-mode.md](../references/student-committee-supervisor-mode.md). The important design choice is that SCS is a typed event gate, not a free-form debate. Internal roles emit structured decisions, and the runtime decides what those decisions are allowed to do.
123
+ The deeper design research lives in [references/student-committee-supervisor-mode.md](../references/student-committee-supervisor-mode.md) and [references/scs-evidence-validator-core-design.md](../references/scs-evidence-validator-core-design.md). The important design choice is that SCS is a typed event gate, not a free-form debate. Internal roles emit structured decisions, and the runtime decides what those decisions are allowed to do.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazyingart/agintiflow",
3
- "version": "0.20.157",
3
+ "version": "0.20.164",
4
4
  "type": "module",
5
5
  "description": "AgInTiFlow is a project-aware agent workspace for hybrid wet-dry R&D, hardware-aware intelligence, software automation, and industrial workflows.",
6
6
  "license": "Apache-2.0",
@@ -48,6 +48,7 @@
48
48
  "references/notes/*.md",
49
49
  "references/run_design_scan.sh",
50
50
  "scripts/install-docker-ubuntu.sh",
51
+ "scripts/npm-publish-from-env.js",
51
52
  "scripts/setup-agent-toolchain-docker.sh",
52
53
  "scripts/real-deepseek-capabilities.js",
53
54
  "scripts/postinstall-webapp.js",
@@ -62,6 +63,8 @@
62
63
  "scripts/smoke-capabilities.js",
63
64
  "scripts/smoke-auto-update.js",
64
65
  "scripts/smoke-inbox.js",
66
+ "scripts/smoke-mcp.js",
67
+ "scripts/fixtures/mcp-stdio-smoke-server.mjs",
65
68
  "scripts/smoke-model-roles.js",
66
69
  "scripts/smoke-platform.js",
67
70
  "scripts/smoke-perception-research.js",
@@ -87,7 +90,7 @@
87
90
  "scripts": {
88
91
  "start": "node run.js",
89
92
  "web": "node web.js",
90
- "check": "node --check run.js && node --check web.js && node --check bin/aginti-cli.js && node --check src/*.js && node --check scripts/seed-supervised-homework.js",
93
+ "check": "node --check run.js && node --check web.js && node --check bin/aginti-cli.js && node --check src/*.js && node --check src/mcp/*.js && node --check public/app.js && node --check scripts/seed-supervised-homework.js && node --check scripts/smoke-mcp.js && node --check scripts/fixtures/mcp-stdio-smoke-server.mjs",
91
94
  "setup:toolchain-docker": "scripts/setup-agent-toolchain-docker.sh",
92
95
  "smoke:coding-tools": "node scripts/smoke-coding-tools.js",
93
96
  "smoke:dynamic-step-budget": "node scripts/smoke-dynamic-step-budget.js",
@@ -101,6 +104,7 @@
101
104
  "smoke:skillmesh": "node scripts/smoke-skillmesh.js",
102
105
  "smoke:toolchain-docker": "node scripts/smoke-toolchain-docker.js",
103
106
  "smoke:inbox": "node scripts/smoke-inbox.js",
107
+ "smoke:mcp": "node scripts/smoke-mcp.js",
104
108
  "smoke:model-roles": "node scripts/smoke-model-roles.js",
105
109
  "smoke:platform": "node scripts/smoke-platform.js",
106
110
  "smoke:perception-research": "node scripts/smoke-perception-research.js",
@@ -116,11 +120,14 @@
116
120
  "postinstall": "node scripts/postinstall-webapp.js",
117
121
  "supervision:seed": "node scripts/seed-supervised-homework.js",
118
122
  "storage:migrate": "node bin/aginti-cli.js storage migrate",
119
- "test": "npm run check && npm run smoke:runtime-compat && npm run smoke:autoupdate && npm run smoke:web-api && npm run smoke:web-autostart && npm run smoke:webapp-command && npm run smoke:web-port-fallback && npm run smoke:docker-command && npm run smoke:coding-tools && npm run smoke:dynamic-step-budget && npm run smoke:aaps-adapter && npm run smoke:auxiliary-tools && npm run smoke:perception-research && npm run smoke:auth && npm run smoke:canvas-artifacts && npm run smoke:capabilities && npm run smoke:model-roles && npm run smoke:platform && npm run smoke:permission-modes && npm run smoke:skills && npm run smoke:skillmesh && npm run smoke:tmux-tools && npm run smoke:cli-chat && npm run smoke:inbox",
123
+ "publish:env": "node scripts/npm-publish-from-env.js publish --access public",
124
+ "publish:env:whoami": "node scripts/npm-publish-from-env.js whoami",
125
+ "test": "npm run check && npm run smoke:runtime-compat && npm run smoke:autoupdate && npm run smoke:web-api && npm run smoke:web-autostart && npm run smoke:webapp-command && npm run smoke:web-port-fallback && npm run smoke:docker-command && npm run smoke:coding-tools && npm run smoke:dynamic-step-budget && npm run smoke:aaps-adapter && npm run smoke:auxiliary-tools && npm run smoke:perception-research && npm run smoke:auth && npm run smoke:canvas-artifacts && npm run smoke:capabilities && npm run smoke:mcp && npm run smoke:model-roles && npm run smoke:platform && npm run smoke:permission-modes && npm run smoke:skills && npm run smoke:skillmesh && npm run smoke:tmux-tools && npm run smoke:cli-chat && npm run smoke:inbox",
120
126
  "pack:dry-run": "npm pack --dry-run",
121
127
  "smoke:capabilities": "node scripts/smoke-capabilities.js"
122
128
  },
123
129
  "dependencies": {
130
+ "@modelcontextprotocol/sdk": "^1.29.0",
124
131
  "express": "^5.1.0",
125
132
  "openai": "^6.3.0",
126
133
  "playwright": "^1.55.0"
package/public/app.js CHANGED
@@ -84,6 +84,7 @@ const translations = {
84
84
  shellToolLabel: "Enable shell tool",
85
85
  fileToolLabel: "Enable file tools",
86
86
  auxiliaryToolLabel: "Enable auxiliary skills",
87
+ mcpToolLabel: "Enable MCP bridge",
87
88
  webSearchLabel: "Enable web search",
88
89
  parallelScoutsLabel: "Parallel DeepSeek scouts",
89
90
  parallelScoutCountLabel: "Scout count",
@@ -114,6 +115,8 @@ const translations = {
114
115
  wrappersOffLabel: "wrapper tools off",
115
116
  wrapperCapabilityTitle: "Agent wrappers",
116
117
  workspaceCapabilityTitle: "Workspace files",
118
+ mcpCapabilityTitle: "MCP servers",
119
+ mcpEmpty: "No MCP servers configured.",
117
120
  workspaceToolsLabel: "File tools",
118
121
  workspaceChangesEmpty: "No file changes yet.",
119
122
  changedLabel: "changed",
@@ -695,6 +698,7 @@ const stopRunButton = document.querySelector("#stop-run");
695
698
  const keyStatusEl = document.querySelector("#key-status");
696
699
  const allowAuxiliaryToolsField = document.querySelector("#allowAuxiliaryTools");
697
700
  const allowWebSearchField = document.querySelector("#allowWebSearch");
701
+ const allowMcpToolsField = document.querySelector("#allowMcpTools");
698
702
  const allowParallelScoutsField = document.querySelector("#allowParallelScouts");
699
703
  const parallelScoutCountField = document.querySelector("#parallelScoutCount");
700
704
  const allowWrapperToolsField = document.querySelector("#allowWrapperTools");
@@ -704,6 +708,9 @@ const wrapperGridEl = document.querySelector("#wrapper-grid");
704
708
  const workspaceStatusEl = document.querySelector("#workspace-status");
705
709
  const workspaceToolsEl = document.querySelector("#workspace-tools");
706
710
  const workspaceChangesEl = document.querySelector("#workspace-changes");
711
+ const mcpStatusEl = document.querySelector("#mcp-status");
712
+ const mcpGridEl = document.querySelector("#mcp-grid");
713
+ const mcpWarningsEl = document.querySelector("#mcp-warnings");
707
714
  const sandboxStatusEl = document.querySelector("#sandbox-status");
708
715
  const sandboxLogsEl = document.querySelector("#sandbox-logs");
709
716
  const checkSandboxButton = document.querySelector("#check-sandbox");
@@ -776,6 +783,7 @@ let lastWrappers = [];
776
783
  let lastSandbox = null;
777
784
  let lastWorkspace = null;
778
785
  let lastWorkspaceActivity = [];
786
+ let lastMcp = null;
779
787
  let managedSessionId = "";
780
788
  let artifactItems = [];
781
789
  let selectedArtifactId = "";
@@ -975,6 +983,28 @@ function renderWorkspacePanel(workspace = lastWorkspace, activity = lastWorkspac
975
983
  .join("");
976
984
  }
977
985
 
986
+ function renderMcpPanel(mcp = lastMcp) {
987
+ lastMcp = mcp || null;
988
+ if (!mcpStatusEl || !mcpGridEl || !mcpWarningsEl) return;
989
+ const servers = mcp?.servers || [];
990
+ const enabled = servers.filter((server) => server.enabled).length;
991
+ mcpStatusEl.textContent = servers.length
992
+ ? `${enabled}/${servers.length} enabled · config=${(mcp.loadedPaths || []).length || 0}`
993
+ : t("mcpEmpty");
994
+ mcpGridEl.innerHTML = servers
995
+ .map(
996
+ (server) => `
997
+ <div class="capability-chip" data-ready="${Boolean(server.enabled)}">
998
+ <strong>${escapeHtml(server.id || server.label || "mcp")}</strong>
999
+ <span>${escapeHtml(server.transport || "")} · trust=${escapeHtml(server.trust || "untrusted")}</span>
1000
+ </div>
1001
+ `
1002
+ )
1003
+ .join("");
1004
+ mcpWarningsEl.textContent = (mcp?.warnings || []).join("\n");
1005
+ mcpWarningsEl.hidden = !(mcp?.warnings || []).length;
1006
+ }
1007
+
978
1008
  function renderSandboxStatus(status = lastSandbox) {
979
1009
  lastSandbox = status;
980
1010
  if (!status) {
@@ -1352,6 +1382,7 @@ function formPayload() {
1352
1382
  allowFileTools: document.querySelector("#allowFileTools").checked,
1353
1383
  allowAuxiliaryTools: allowAuxiliaryToolsField?.checked ?? true,
1354
1384
  allowWebSearch: allowWebSearchField?.checked ?? true,
1385
+ allowMcpTools: allowMcpToolsField?.checked ?? true,
1355
1386
  allowParallelScouts: allowParallelScoutsField?.checked ?? true,
1356
1387
  parallelScoutCount: Math.min(Math.max(Number(parallelScoutCountField?.value) || 3, 1), 10),
1357
1388
  allowWrapperTools: allowWrapperToolsField.checked,
@@ -3064,6 +3095,7 @@ async function loadConfig() {
3064
3095
  document.querySelector("#allowFileTools").checked = prefs.allowFileTools ?? true;
3065
3096
  if (allowAuxiliaryToolsField) allowAuxiliaryToolsField.checked = prefs.allowAuxiliaryTools ?? true;
3066
3097
  if (allowWebSearchField) allowWebSearchField.checked = prefs.allowWebSearch ?? true;
3098
+ if (allowMcpToolsField) allowMcpToolsField.checked = prefs.allowMcpTools ?? true;
3067
3099
  if (allowParallelScoutsField) allowParallelScoutsField.checked = prefs.allowParallelScouts ?? true;
3068
3100
  if (parallelScoutCountField) parallelScoutCountField.value = String(prefs.parallelScoutCount || 3);
3069
3101
  allowWrapperToolsField.checked = prefs.allowWrapperTools ?? false;
@@ -3076,6 +3108,7 @@ async function loadConfig() {
3076
3108
  renderProjectStatus(data.project);
3077
3109
  renderWrapperStatus(data.wrappers || []);
3078
3110
  renderWorkspacePanel(data.workspace, []);
3111
+ renderMcpPanel(data.mcp || null);
3079
3112
  await refreshWorkspaceChanges();
3080
3113
  renderSandboxLogs(data.sandbox?.logs || []);
3081
3114
  updateRoutingHint();
package/public/index.html CHANGED
@@ -287,6 +287,15 @@
287
287
  <div id="workspace-changes" class="workspace-changes"></div>
288
288
  </section>
289
289
 
290
+ <section class="capability-card mcp-card">
291
+ <div>
292
+ <h2 data-i18n="mcpCapabilityTitle">MCP servers</h2>
293
+ <p id="mcp-status" class="subtle wrapper-status"></p>
294
+ </div>
295
+ <div id="mcp-grid" class="capability-grid"></div>
296
+ <pre id="mcp-warnings" class="sandbox-logs mcp-warnings"></pre>
297
+ </section>
298
+
290
299
  <section class="sandbox-card">
291
300
  <div class="header-row">
292
301
  <div>
@@ -429,6 +438,11 @@
429
438
  <span class="switch" aria-hidden="true"></span>
430
439
  <span data-i18n="auxiliaryToolLabel">Enable auxiliary skills</span>
431
440
  </label>
441
+ <label class="switch-label">
442
+ <input id="allowMcpTools" name="allowMcpTools" type="checkbox" checked />
443
+ <span class="switch" aria-hidden="true"></span>
444
+ <span data-i18n="mcpToolLabel">Enable MCP bridge</span>
445
+ </label>
432
446
  <label class="switch-label">
433
447
  <input id="allowParallelScouts" name="allowParallelScouts" type="checkbox" checked />
434
448
  <span class="switch" aria-hidden="true"></span>
package/public/styles.css CHANGED
@@ -687,6 +687,15 @@ button.danger {
687
687
  background: linear-gradient(135deg, rgba(255, 253, 250, 0.9), rgba(239, 246, 255, 0.72));
688
688
  }
689
689
 
690
+ .mcp-card {
691
+ border-color: rgba(15, 118, 110, 0.18);
692
+ background: linear-gradient(135deg, rgba(255, 253, 250, 0.92), rgba(204, 251, 241, 0.32));
693
+ }
694
+
695
+ .mcp-warnings[hidden] {
696
+ display: none;
697
+ }
698
+
690
699
  .workspace-changes {
691
700
  display: grid;
692
701
  gap: 8px;