Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

chore(agent): sync docs and trim internal exports

Rahman368b6c9a6cec
diff --git a/CLAUDE.md b/CLAUDE.md
index 8182e053..b1cea758 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -348,8 +348,11 @@ the real runtime and working analogue before changing a tool or skill contract.
it AND `tools/call` re-checks it — a client can call a name it was never shown.
- **Tool names are a cross-repo contract.** `rahmanef63/connectors-gateway` registered
mso as a connector on 2026-08-17 and historically pinned a subset of the MCP names as
- literal `x-upstream` strings. MSO itself currently exposes 31 tools (16 read, 10 write,
- 3 exec); `GET /mcp` plus `_meta.toolset` expose the current version/hash/name manifest.
+ literal `x-upstream` strings.
+ <!-- mcp-toolset: server=1.6.0 version=2026.09.02.7 tools=66 read=32 write=22 exec=12 -->
+ MSO currently exposes **67 transport tools**: **66 model/operator tools** (32 read, 22 write,
+ 12 exec) plus the app-only `workflow_status` bridge; `GET /mcp` plus `_meta.toolset` expose
+ the current version/hash/name manifest.
Treat the gateway mapping as a separate cross-repo contract and verify it before renaming. Renaming or removing
a tool here breaks it with **no error in either repo** — `parity.test.ts` guards the
Alfa axis, not this one. Read `docs/CONNECTORS-GATEWAY-INTEGRATION.md` before touching
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md
index d3794bf1..5641d9af 100644
--- a/docs/ARCHITECTURE.md
+++ b/docs/ARCHITECTURE.md
@@ -40,7 +40,9 @@ flowchart LR
| Host operations | `lib/host/*` | Filesystem roots, credential denylist, process/system operations, audit. |
| Web host API | `/api/v1/*` | Live-role-gated routes; unknown mutations fail up to Owner and routes delegate into `lib/host`. |
| CLI | `bin/mso` | Another frontend over the same web API; bare `mso` starts the interactive agent and `docs/CLI.md` is generated from the help contract. |
-| Terminal MSO Agent | `scripts/mso-agent.mjs`, `/api/v1/agent-tools` | Streams through `/api/assistant`, discovers the canonical MCP catalog, and requires terminal approval before write/exec calls. |
+| Terminal MSO Agent | `scripts/mso-agent.mjs`, `mso-agent-turn.mjs`, `mso-agent-layout.mjs`, `mso-agent-errors.mjs`, `/api/v1/agent-tools` | Streams through `/api/assistant`, discovers the canonical MCP catalog, renders sectioned Assistant/work/local/error output, and preserves exact approval + recoverable mutation-outcome semantics. |
+| Local Agent messaging | `lib/agent/local-agent-*`, `/api/v1/local-agents`, `scripts/mso-agent-local.mjs` | Same-principal presence + durable mailbox + SSE delivery; active human mentions require a live receiver and never require an Agent Card. |
+| Same-session subagents | `lib/agent/subagent-runner.ts`, `lib/mcp/tools-subagents.ts` | Bounded foreground isolated child runs behind an exec-scope delegation boundary; no recursive/background worker is created. |
| Infrastructure providers | `lib/infra/*`, `/api/v1/infra/*` | Owner-private Dokploy/Cloudflare/Hostinger state and bounded provider clients; secrets never enter model tool arguments. |
| Alfa | `frontend/slices/assistant/host-tools/*` | Stable tool catalog; reads run immediately, mutations require human approval. |
| MCP | `lib/mcp/*`, `/mcp`, `/oauth/*` | OAuth 2.1 + PKCE; `read < write < exec` token scope. |
@@ -158,9 +160,10 @@ park a visible Approve/Deny card. The complete semantic contract is
**MCP** is for external clients such as ChatGPT, Claude.ai and Cursor. Its catalog lives in
`lib/mcp/`; access is controlled by the OAuth token scope rather than Alfa approval cards.
-At the current toolset it exposes 56 transport tools: 55 model/operator tools (28 read, 22 write, 5 exec) plus the app-only `workflow_status` progress bridge. Project-specific
+<!-- mcp-toolset: server=1.6.0 version=2026.09.02.7 tools=66 read=32 write=22 exec=12 -->
+At the current toolset it exposes **67 transport tools**: **66 model/operator tools** (32 read, 22 write, 12 exec) plus the app-only `workflow_status` progress bridge. Project-specific
function names remain data behind `project_capabilities` / `project_function_call`, so one
-project cannot dynamically rewrite the global MCP tool prefix.
+project cannot dynamically rewrite the global MCP tool prefix. `GET /mcp` remains the live count/hash authority.
See `docs/MCP.md` for protocol/security internals, `docs/A2A.md` for peer-agent delegation, and `docs/CHATGPT-PLUGIN.md` for the
ChatGPT-facing setup and diagrams.
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index b6f46367..ae9efb12 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -24,6 +24,14 @@ this is the *what*, and it is what Settings → About shows as “What's new”.
- `agent` make restart process-safe
- `a2a` harden remote v1 delegation
+**Docs**
+
+- `testing` record 1.12 live verification
+
+**Chores**
+
+- `agent` sync docs and trim internal exports
+
## 2026-09-01
**Added**
diff --git a/docs/CHATGPT-PLUGIN.md b/docs/CHATGPT-PLUGIN.md
index 1f5f8734..5d17e2b2 100644
--- a/docs/CHATGPT-PLUGIN.md
+++ b/docs/CHATGPT-PLUGIN.md
@@ -145,7 +145,7 @@ A token sees a scope prefix; there is no per-project or per-agent hidden tool fi
`tools/list` filters the catalog and `tools/call` independently re-checks the required
scope.
-### `read` — 29 model/operator tools
+### `read` — 32 model/operator tools
- `a2a_agent_discover`
- `a2a_agents_list`
@@ -167,6 +167,9 @@ scope.
- `fs_usage`
- `infra_provider_doctor`
- `infra_providers_list`
+- `local_agent_inbox`
+- `local_agent_request_wait`
+- `local_agents_list`
- `project_capabilities`
- `projects_list`
- `screen_capture`
@@ -176,7 +179,8 @@ scope.
- `sys_processes`
- `sys_stats`
- `tool_forge_candidates`
-### `write` — read + 20 tools
+
+### `write` — read + 22 tools (54 visible at write scope)
- `a2a_agent_register`
- `a2a_agent_remove`
@@ -194,20 +198,24 @@ scope.
- `fs_upload_file`
- `fs_write`
- `hostinger_dns_upsert`
+- `local_agent_message_send`
+- `local_agent_reply`
- `tool_forge_propose`
- `workflow_cancel`
- `workflow_finish`
- `workflow_start`
-### `exec` — write + 10 tools
+### `exec` — write + 12 tools (66 visible at exec scope)
+- `a2a_handoff`
- `a2a_message_send`
- `a2a_task_cancel`
-- `a2a_handoff`
+- `agent_subagent_run`
- `browser_power`
- `exec_job_cancel`
- `exec_job_start`
- `exec_run`
+- `local_agent_request`
- `project_function_call`
- `tool_forge_evaluate`
- `tool_forge_promote`
@@ -238,11 +246,13 @@ locally with `mso provider set <id>` rather than pasting credentials into a Chat
### A2A peer delegation
ChatGPT can use `a2a_agent_discover`/`a2a_agents_list` to find peers, then the exec-scope
-`a2a_message_send` or `a2a_handoff` to delegate explicit work. `a2a_task_get` polls the remote
-task and `a2a_task_cancel` requests cancellation; register/remove only mutate MSO's local public
-Agent Card registry. MSO never auto-forwards this ChatGPT conversation, private agent memory, or
-raw MSO session/workflow ids to a peer. Current A2A is outbound/public-HTTPS/anonymous only and
-fails closed for Agent Cards that require credentials. See [`A2A.md`](./A2A.md).
+`a2a_message_send` or `a2a_handoff` to delegate explicit work. `a2a_task_get` reads a remote
+task and `a2a_task_cancel` requests cancellation; register/remove mutate only MSO's sanitized peer
+registry. Outbound peers may be anonymous or use a private API-key/Bearer/OAuth2 credential profile
+configured by the owner outside the message payload. MSO can also expose an authenticated inbound A2A
+server when an explicit public HTTPS origin exists, but that inbound bearer/task lifecycle is separate from
+this ChatGPT MCP token. MSO never auto-forwards this ChatGPT conversation, private agent memory, or raw
+MSO session/workflow ids to a peer. See [`A2A.md`](./A2A.md).
## 6. Tool-snapshot refresh: the part most often missed
@@ -255,9 +265,9 @@ Settings → MCP:
```text
server: 1.6.0
-toolset: 2026.09.02.3
+toolset: 2026.09.02.7
hash: <live schema hash>
-count: 59 model/operator tools (+ 1 app-only bridge)
+count: 66 model/operator tools (+ 1 app-only bridge)
```
Use this sequence after an MSO MCP change:
diff --git a/docs/COGNITIVE-RUNTIME.md b/docs/COGNITIVE-RUNTIME.md
index f1b2603f..01f5373e 100644
--- a/docs/COGNITIVE-RUNTIME.md
+++ b/docs/COGNITIVE-RUNTIME.md
@@ -138,7 +138,7 @@ scenarios before making that claim.
## Current P2 + A2A baseline
-On the development host after P2 + outbound A2A integration:
+Benchmark snapshot captured on the development host after P2 + outbound A2A integration (before later Local Agent/subagent catalog growth):
| Metric | MSO P2 + A2A | Hermes local baseline |
|---|---:|---:|
@@ -151,7 +151,7 @@ On the development host after P2 + outbound A2A integration:
| Typed-memory fixture accuracy | 100% (8/8) | not implemented in this harness |
| Deterministic routing / memory resolution | yes / yes | not the same benchmark |
-The existing learned-recipe store currently reports **179 successful / 186 total workflows (96.2%)**, but those recipes predate the P1 quality schema, so step-level telemetry coverage correctly starts at **0%** rather than fabricating historical tool-error/retry data. New or re-learned recipes carry `qualityVersion: 1`; coverage grows naturally from real post-P1 executions.
+At that P1/P2 rollout snapshot, the learned-recipe store reported **179 successful / 186 total workflows (96.2%)**. Those recipes predated the P1 quality schema, so step-level telemetry coverage correctly started at **0%** rather than fabricating historical tool-error/retry data. New or re-learned recipes carry `qualityVersion: 1`; coverage grows naturally from real post-P1 executions.
A non-interactive full MSO tool loop is now available as `mso agent --oneshot <prompt> --json`. It defaults to read-only autonomous approval; write/exec require explicit `--approve-scope write|exec`. The cross-agent harness uses a private scratch read task whose nonce and values exist only in a file. A first smoke proved MSO on `openai-codex/gpt-5.6-terra`; Hermes failed because its local configuration does not expose an `openai` provider and OpenClaw rejected that model override for agent `main`, so the harness correctly returned **`comparable=false`**. That is connectivity/configuration evidence, not a ranking.
@@ -163,7 +163,7 @@ P1 supplies typed/provenance-aware temporal memory, deterministic retrieval eval
Forge only creates inert candidates from repeated high-quality recipes. Skill candidates are deterministic redacted guidance; executable project-function candidates require an exec-scope verified recipe and may reference only existing project-owned Node code. Fixtures run in the dedicated cached Docker sandbox with no network and a read-only project mount. Evaluation records current toolset, candidate/target state, source SHA-256 and exact sandbox image evidence; promotion requires literal confirmation and immediately repeats the checks. A candidate cannot silently raise scope, overwrite an existing capability, or turn generated text into host-executable code.
-Outbound A2A v1 remains orthogonal: it adds remote-agent delegation, while Forge turns repeated **local verified procedures** into reviewed project capabilities. The combined routing benchmark covers both surfaces with 100% required-tool recall while selecting only 15.4 of 60 tools on average.
+Outbound A2A v1 remains orthogonal: it adds remote-agent delegation, while Forge turns repeated **local verified procedures** into reviewed project capabilities. That recorded combined routing benchmark covered both surfaces with 100% required-tool recall while selecting 15.4 of the then-current 60 tools on average; current catalog size is intentionally read from the live MCP descriptor instead of rewriting this historical benchmark.
The next phase should continue from measured primitives:
diff --git a/docs/CONNECTORS-GATEWAY-INTEGRATION.md b/docs/CONNECTORS-GATEWAY-INTEGRATION.md
index e50bf377..7f520bb1 100644
--- a/docs/CONNECTORS-GATEWAY-INTEGRATION.md
+++ b/docs/CONNECTORS-GATEWAY-INTEGRATION.md
@@ -37,34 +37,27 @@ Before changing an MCP tool name:
## Current MSO catalog
-### Read (29 model/operator)
+### Read (32 model/operator)
-`a2a_agent_discover`, `a2a_agents_list`, `a2a_task_get`, `agent_memory_read`, `agent_memory_search`, `agent_session_current`, `agent_session_resume`, `agent_sessions_list`,
-`apps_list`, `apps_logs`, `browser_status`, `cloudflare_zones_list`, `dokploy_projects_list`,
-`exec_job_status`, `fs_list`, `fs_read`, `fs_search`, `fs_usage`, `infra_provider_doctor`,
-`infra_providers_list`, `project_capabilities`, `projects_list`, `screen_capture`, `skills_list`,
-`skills_read`, `skills_search`, `sys_processes`, `sys_stats`, `tool_forge_candidates`.
+`a2a_agent_discover`, `a2a_agents_list`, `a2a_task_get`, `agent_memory_read`, `agent_memory_search`, `agent_session_current`, `agent_session_resume`, `agent_sessions_list`, `apps_list`, `apps_logs`, `browser_status`, `cloudflare_zones_list`, `dokploy_projects_list`, `exec_job_status`, `fs_list`, `fs_read`, `fs_search`, `fs_usage`, `infra_provider_doctor`, `infra_providers_list`, `local_agent_inbox`, `local_agent_request_wait`, `local_agents_list`, `project_capabilities`, `projects_list`, `screen_capture`, `skills_list`, `skills_read`, `skills_search`, `sys_processes`, `sys_stats`, `tool_forge_candidates`.
-### Write (20 beyond read)
+### Write (22 beyond read)
-`a2a_agent_register`, `a2a_agent_remove`,
-`agent_memory_forget`, `agent_memory_remember`, `agent_session_note`, `agent_session_rename`,
-`apps_power`, `cloudflare_dns_upsert`, `dokploy_project_ensure`, `fs_copy`, `fs_delete`,
-`fs_mkdir`, `fs_move`, `fs_upload_file`, `fs_write`, `hostinger_dns_upsert`,
-`tool_forge_propose`, `workflow_cancel`, `workflow_finish`, `workflow_start`.
+`a2a_agent_register`, `a2a_agent_remove`, `agent_memory_forget`, `agent_memory_remember`, `agent_session_note`, `agent_session_rename`, `apps_power`, `cloudflare_dns_upsert`, `dokploy_project_ensure`, `fs_copy`, `fs_delete`, `fs_mkdir`, `fs_move`, `fs_upload_file`, `fs_write`, `hostinger_dns_upsert`, `local_agent_message_send`, `local_agent_reply`, `tool_forge_propose`, `workflow_cancel`, `workflow_finish`, `workflow_start`.
-### Exec (10 beyond write)
+### Exec (12 beyond write)
-`a2a_message_send`, `a2a_task_cancel`, `a2a_handoff`, `browser_power`, `exec_job_cancel`, `exec_job_start`, `exec_run`, `project_function_call`, `tool_forge_evaluate`, `tool_forge_promote`.
+`a2a_handoff`, `a2a_message_send`, `a2a_task_cancel`, `agent_subagent_run`, `browser_power`, `exec_job_cancel`, `exec_job_start`, `exec_run`, `local_agent_request`, `project_function_call`, `tool_forge_evaluate`, `tool_forge_promote`.
### App-only bridge (1)
`workflow_status` is exposed for the MCP Apps progress widget and is not part of the model/operator action catalog.
-A2A adds eight stable generic action names rather than one action per peer. A gateway should pass
+A2A adds eight stable generic MCP action names rather than one action per peer. A gateway should pass
the registered alias/id or public Agent Card URL as the `target`; it must not synthesize hidden
-conversation context. Current MSO A2A is outbound, public-HTTPS, anonymous-only and rejects peers
-whose Agent Card requires credentials. Full semantics live in [`A2A.md`](./A2A.md).
+conversation context. Current MSO supports anonymous outbound peers plus private API-key/Bearer/OAuth2
+credential profiles, streaming task operations, and an optional authenticated inbound A2A server when an
+explicit public HTTPS origin exists. Full trust/credential semantics live in [`A2A.md`](./A2A.md).
## Scope and workflow compatibility
diff --git a/docs/INFRASTRUCTURE-PROVIDERS.md b/docs/INFRASTRUCTURE-PROVIDERS.md
index b9f87724..ffdafda6 100644
--- a/docs/INFRASTRUCTURE-PROVIDERS.md
+++ b/docs/INFRASTRUCTURE-PROVIDERS.md
@@ -18,7 +18,7 @@ Bare `mso` is the interactive setup/operations agent:
mso # launch MSO Agent
mso agent # explicit alias
mso --continue # resume latest durable Agent session
-mso --resume <query> # resume by index/id/short-id/title
+mso --resume <query> # resume by @name/index/id/short-id/title
mso models # configure AI provider/API/OAuth connections
mso models add openai-codex # connect ChatGPT subscription OAuth without switching model
mso model # choose active model from connected providers
@@ -49,24 +49,31 @@ interactive prompt — but uses original MSO ASCII artwork and MSO's own tool/ru
Agent slash commands are:
```text
-/models /model /status /context /statusbar /title
+/models /model /status /context /statusbar /rename /title
/session /sessions /resume /setup /providers /provider <id>
-/doctor /tools /skills /clear /exit
+/doctor /tools /agents /message /delegate /spawn /inbox
+/skills /skill /clear /exit
```
Slash skills expose runtime state instead of looking identical to ordinary commands: `◇ ready`
uses the normal skill color, `◆ queued` is amber after selection for the next message, and `✓ invoked`
-is green after the skill was actually attached to a model request. `/skills` and the compact status line
+is green after the skill was actually attached to a model request. `/skills` and the bottom telemetry footer
show the same state, so the signal is consistent rather than decorative.
-The prompt status line is dynamic: active `provider/model`, approximate current context (`ctx ~…`)
-with a catalog context-window denominator when available, provider-reported token usage when the
-upstream exposes it, turn count, last-turn duration, durable session id and working directory.
-`/status` expands the same information. Context without tokenizer/provider metadata is deliberately
-labeled approximate rather than presented as an exact token count. `/sessions` lists durable sessions;
-`/resume` opens a picker or accepts `latest`, a list index, exact/short id, exact title or unique title
-substring. The CLI equivalents are `mso --continue` and `mso --resume <query>`. Session discovery
-remains scoped to the authenticated principal; resume never bypasses principal/session isolation.
+MSO 1.12 uses an identity-first bottom composer: `Input · @name` separates editing state from the transcript,
+`@name ›` is the prompt, and permission is shown independently as `mode ask|auto|yolo`. With `/statusbar on`
+(the default), that footer also shows active `provider/model`, approximate current context (`ctx ~…`),
+provider-reported token usage when available, turn count, last-turn duration, session/title state and working
+directory; `/statusbar off` keeps only mode + Tab-cycle guidance. `/status` expands the same diagnostics.
+Context without tokenizer/provider metadata is deliberately approximate. `/sessions` lists durable sessions;
+`/resume` opens a picker or accepts `latest`, `@name`, list index, exact/short id, exact title or unique title
+substring. The CLI equivalents are `mso --continue` and `mso --resume <query>`. Session discovery remains
+scoped to the authenticated principal; resume never bypasses principal/session isolation.
+
+Assistant output, tool/subagent progress, Local Agent traffic, and recoverable interaction errors are separated
+by full-width `Assistant`, `Agent work`, `Local agent`, and `Error` dividers. Recoverable API/transport failures
+never auto-repeat an uncertain write/exec mutation; verify target state before retrying a mutation whose outcome
+is reported as `uncertain`.
## 2. One tool catalog, two transports
@@ -86,11 +93,13 @@ flowchart LR
I --> HS[Hostinger]
```
-Read tools may run immediately. Every `write` or `exec` request from the terminal pauses on
-an exact-call approval prompt; there is no session-wide mutation allowlist. MSO renders the
-complete canonical tool name + nested input before approval, shows its SHA-256, and the server
-recomputes that digest before dispatch so changing any field invalidates approval. Calls larger
-than 32 KiB are refused by the terminal agent rather than approved from a truncated preview.
+Read tools may run immediately. In normal `ask` mode, every `write` or `exec` request pauses on
+one compact `Approval needed: <tool> — <action>` line; there is no session-wide mutation allowlist.
+Enter opens the redacted-safe exact-call details (tool, scope, bounded args summary and canonical SHA-256),
+then a separate explicit `allow` or `deny` decision is required. The server recomputes the digest before
+dispatch so changing any field invalidates approval. Auto-write/YOLO may skip the human prompt only within
+their documented scope, but still compute/send exact payload binding. Calls larger than 32 KiB are refused
+rather than approved from a truncated preview.
The server independently requires an Owner session, applies the deployment's MCP scope ceiling,
re-checks the tool scope, rate-limits the operation and writes its normal audit trail. Terminal
approval is therefore an additional interaction guard, not a replacement for server authorization.
diff --git a/docs/INSTALL.md b/docs/INSTALL.md
index cb84d388..002fa2d3 100644
--- a/docs/INSTALL.md
+++ b/docs/INSTALL.md
@@ -162,12 +162,12 @@ verify with `mso provider doctor`.
After an AI provider is connected, bare `mso` launches the interactive MSO Agent. The agent
uses the canonical MCP tool catalog internally: reads run directly, while write/exec calls
-pause for terminal approval. Skill lifecycle is explicit in the slash palette and status line:
+pause for terminal approval. Skill lifecycle is explicit in the slash palette and bottom telemetry footer:
`◇ ready` means discoverable/executable, `◆ queued` means selected for the next user message,
and `✓ invoked` means the skill instructions were actually attached to a model turn. The terminal
transcript uses full-width dividers for Assistant, Agent work, Local agent, and recoverable Error sections.
The bottom composer is separated by an `Input · @name` divider, uses `@name ›` as its identity prompt, and
-keeps `mode ask|auto|yolo` in the footer; Tab cycles that mode in place. Recoverable HTTP/API errors keep
+keeps `mode ask|auto|yolo` in the footer; Tab cycles that mode in place. `/statusbar off` collapses the footer to mode-only telemetry, while `/statusbar on` restores model/context/session details. Recoverable HTTP/API errors keep
the interaction/session intact and never auto-repeat an uncertain write/exec call. The composer also
follows conventional controls: Ctrl+C clears a draft, exits an empty prompt, or interrupts
an active turn; Ctrl+D deletes right/exits on empty; Ctrl+L clears the screen; Ctrl+W deletes the previous
diff --git a/docs/LOCAL-AGENTS.md b/docs/LOCAL-AGENTS.md
index bff2ae40..b29d2c12 100644
--- a/docs/LOCAL-AGENTS.md
+++ b/docs/LOCAL-AGENTS.md
@@ -1,6 +1,6 @@
# Local Agents — native same-host session messaging
-MSO 1.11 keeps **local session messaging** separate from **remote A2A v1** and adds explicit request/reply correlation plus mention routing.
+Since MSO 1.11, **local session messaging** is separate from **remote A2A v1**, with explicit request/reply correlation and mention routing; MSO 1.12 keeps that transport contract and gives Local Agent traffic its own terminal section.
Local Agents is the host-local transport for live MSO sessions. It does not use Agent Cards, peer registration, public URLs, A2A credentials, or the A2A JSON-RPC protocol. Remote agents still use the standard A2A v1 surface documented in [A2A.md](./A2A.md).
@@ -39,6 +39,8 @@ Useful TUI commands:
/inbox
```
+In MSO 1.12 terminal output, inbound/outbound peer traffic is rendered under a full-width `Local agent` divider. The bottom composer remains a separate `Input · @name` area, so an async peer event can redraw above an in-progress draft without becoming a user turn or obscuring the current session identity.
+
A leading `@rahman …` resolves **active agents only**, where active means both a current presence lease and `consumerConnected=true`. If `rahman` is offline/ended or its receiver has disconnected while the lease is still in its grace window, the mention fails clearly and does not silently queue a new request. This prevents a typo/stale handle from becoming a delayed surprise response. The lower-level `local_agent_message_send`/`mso agents send` compatibility surface may still explicitly address a known offline session and retain durable queued delivery.
From the ordinary shell, the same native route has an explicit CLI group for scripting/inspection:
@@ -192,6 +194,6 @@ No external broker, database, daemon, or framework is required.
## Relationship to legacy same-host A2A helpers
-Older `mso a2a local ...` one-shot delegation/virtual-loopback-card helpers remain for backward compatibility and protocol testing. They are **not** the transport used by `/agents`, `/message`, local `/delegate`, the Local Agents MCP tools, or live inbox delivery in MSO 1.11.
+Older `mso a2a local ...` one-shot delegation/virtual-loopback-card helpers remain for backward compatibility and protocol testing. They are **not** the transport used by `/agents`, `/message`, local `/delegate`, the Local Agents MCP tools, or live inbox delivery in MSO 1.11+ / current MSO.
New same-host communication should use Local Agents. Public/remote interoperability should use A2A v1.
diff --git a/docs/MCP.md b/docs/MCP.md
index 9fbf1f7c..ea4c5ff0 100644
--- a/docs/MCP.md
+++ b/docs/MCP.md
@@ -75,9 +75,9 @@ Picked per token, on the consent screen, capped by `OS_MCP_MAX_SCOPE`. The highe
| Scope | Tools |
|---|---|
-| `read` | `a2a_agent_discover` `a2a_agents_list` `a2a_task_get` `agent_memory_read` `agent_memory_search` `agent_session_current` `agent_session_resume` `agent_sessions_list` `fs_list` `fs_read` `fs_search` `fs_usage` `sys_stats` `sys_processes` `apps_list` `apps_logs` `projects_list` `project_capabilities` `skills_list` `skills_read` `skills_search` `screen_capture` `browser_status` `exec_job_status` `infra_providers_list` `infra_provider_doctor` `dokploy_projects_list` `cloudflare_zones_list` `local_agents_list` `local_agent_inbox` |
-| `write` | + `a2a_agent_register` `a2a_agent_remove` `agent_memory_forget` `agent_memory_remember` `agent_session_note` `agent_session_rename` `workflow_start` `workflow_cancel` `workflow_finish` `fs_write` `fs_upload_file` `fs_mkdir` `fs_move` `fs_copy` `fs_delete` `apps_power` `dokploy_project_ensure` `cloudflare_dns_upsert` `hostinger_dns_upsert` `local_agent_message_send` `local_agent_reply` |
-| `exec` | + `a2a_message_send` `a2a_task_cancel` `a2a_handoff` `project_function_call` `exec_run` `exec_job_start` `exec_job_cancel` `browser_power` `agent_subagent_run` |
+| `read` | `a2a_agent_discover` `a2a_agents_list` `a2a_task_get` `agent_memory_read` `agent_memory_search` `agent_session_current` `agent_session_resume` `agent_sessions_list` `apps_list` `apps_logs` `browser_status` `cloudflare_zones_list` `dokploy_projects_list` `exec_job_status` `fs_list` `fs_read` `fs_search` `fs_usage` `infra_provider_doctor` `infra_providers_list` `local_agent_inbox` `local_agent_request_wait` `local_agents_list` `project_capabilities` `projects_list` `screen_capture` `skills_list` `skills_read` `skills_search` `sys_processes` `sys_stats` `tool_forge_candidates` |
+| `write` | + `a2a_agent_register` `a2a_agent_remove` `agent_memory_forget` `agent_memory_remember` `agent_session_note` `agent_session_rename` `apps_power` `cloudflare_dns_upsert` `dokploy_project_ensure` `fs_copy` `fs_delete` `fs_mkdir` `fs_move` `fs_upload_file` `fs_write` `hostinger_dns_upsert` `local_agent_message_send` `local_agent_reply` `tool_forge_propose` `workflow_cancel` `workflow_finish` `workflow_start` |
+| `exec` | + `a2a_handoff` `a2a_message_send` `a2a_task_cancel` `agent_subagent_run` `browser_power` `exec_job_cancel` `exec_job_start` `exec_run` `local_agent_request` `project_function_call` `tool_forge_evaluate` `tool_forge_promote` |
Alfa — the in-app assistant — overlaps the same host capabilities under dot.case names,
and `lib/mcp/parity.test.ts` fails if one surface gains a tool the other lacks
@@ -98,9 +98,9 @@ two catalogs stay separate on purpose (different transport and guard) but may no
drift by accident.
**These tool names are also a cross-repo contract.** `rahmanef63/connectors-gateway`
-registered mso as a connector on 2026-08-17 and pins 15 of these names as strings; a
-rename here breaks it with no error in either repo, and `parity.test.ts` does not cover
-that axis. See [`CONNECTORS-GATEWAY-INTEGRATION.md`](./CONNECTORS-GATEWAY-INTEGRATION.md)
+registered mso as a connector on 2026-08-17 and historically pinned a subset of these names as literal strings; a
+rename here can break that mapping with no error in either repo, and `parity.test.ts` does not cover
+that axis. Verify the gateway repository before changing a tool name. See [`CONNECTORS-GATEWAY-INTEGRATION.md`](./CONNECTORS-GATEWAY-INTEGRATION.md)
before renaming or removing a tool.
The tiering is about blast radius, not about which layer the call lands in.
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index 8811d203..809f2c6a 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -2,6 +2,14 @@
Running log of what shipped each phase. Newest at top.
+## 2026-09-03 — MSO 1.12 documentation and Agent contract cleanup
+
+- **Full Markdown audit:** reviewed all 71 authored Markdown files in the repository, preserving dated release/audit/design evidence while correcting current-reference drift. Structural validation reports zero malformed fence/heading issues and all 125 relative Markdown links resolve.
+- **Current Agent docs:** synchronized `TESTING-HANDOFF`, Local Agents, install/provider guidance, troubleshooting, architecture and the documentation map with the shipped 1.12 identity-first composer, sectioned transcript, compact exact approval and recoverable `not_started | completed | uncertain` mutation semantics. Historical 1.8–1.11 release notes remain intact rather than being rewritten as if they were current instructions.
+- **MCP/A2A drift fixed:** current references now agree on server `1.6.0`, toolset `2026.09.02.7`, 67 transport tools = 66 model/operator tools (32 read / 22 write / 12 exec) + app-only `workflow_status`. Stale 31/29/59/56-tool claims and obsolete anonymous-only A2A wording were removed from current docs; historical benchmark snapshots were relabeled as snapshots instead of live metrics.
+- **Docs gate strengthened:** `check-docs.mjs` now verifies the MCP marker in architecture/operator docs and exact scope membership in `docs/MCP.md`, `docs/CHATGPT-PLUGIN.md`, and `docs/CONNECTORS-GATEWAY-INTEGRATION.md`, so a future tool addition cannot leave one human catalog silently stale.
+- **Unused surface cleanup:** removed the dead `coreToolNames()` helper and stopped exporting Agent constants/helpers that are private implementation details while retaining every internally used behavior. No compatibility placeholder or public CLI/MCP capability was removed.
+
## 2026-09-02 — MSO 1.12.0 sectioned Agent TUI + recoverable API failures
- **Identity-first bottom composer:** the old `[ask] ›` prompt is replaced by the short durable handle (`@milo ›`). A full-width `Input · @milo` divider separates transcript from editing state; permission moves to the dynamic footer as `mode ask|auto|yolo`, and empty-prompt Tab repaints only that footer. Wrapped input, resize redraw, prompt history, and keyboard editing remain intact.
diff --git a/docs/README.md b/docs/README.md
index c28a5591..05494292 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -20,12 +20,12 @@ evidence and review freshness. The repository quality gate runs both automatical
| Document | Contract |
|---|---|
| [`../README.md`](../README.md) | Product overview and quickstart |
-| [`ARCHITECTURE.md`](./ARCHITECTURE.md) | Current runtime, shell, role, host, MCP and deployment architecture |
+| [`ARCHITECTURE.md`](./ARCHITECTURE.md) | Current runtime, shell, role, host, Agent/Local Agent/subagent, MCP and deployment architecture |
| [`COGNITIVE-RUNTIME.md`](./COGNITIVE-RUNTIME.md) | Provider-neutral MCP/session/context/tool-routing runtime and benchmark contract |
| [`COMPARISON.md`](./COMPARISON.md) | Generated product comparison methodology, evidence and notes |
| [`COMPETITIVE-ROADMAP.md`](./COMPETITIVE-ROADMAP.md) | Executed comparison plan, deliberate specialist boundaries and next investments |
| [`INSTALL.md`](./INSTALL.md) | Owner installation, TLS, updates, backup and uninstall |
-| [`INFRASTRUCTURE-PROVIDERS.md`](./INFRASTRUCTURE-PROVIDERS.md) | Interactive MSO Agent, Dokploy/Cloudflare/Hostinger credentials, tools and deployment boundary |
+| [`INFRASTRUCTURE-PROVIDERS.md`](./INFRASTRUCTURE-PROVIDERS.md) | Interactive MSO Agent TUI/approval/error contract plus Dokploy/Cloudflare/Hostinger credentials, tools and deployment boundary |
| [`DEVELOPMENT.md`](./DEVELOPMENT.md) | Development and release workflow |
| [`SECURITY-ASSURANCE.md`](./SECURITY-ASSURANCE.md) | Repeatable security verification lanes, public evidence, and claim boundaries |
| [`CLI.md`](./CLI.md) | Generated `mso` CLI contract |
diff --git a/docs/TESTING-HANDOFF.md b/docs/TESTING-HANDOFF.md
index 7fcfece3..70bedf0e 100644
--- a/docs/TESTING-HANDOFF.md
+++ b/docs/TESTING-HANDOFF.md
@@ -4,9 +4,9 @@ Update this file at the end of every manual or automated test session. Keep it f
## Current status
-The v1.10 findings below are implemented and deployed in **MSO 1.11.1** (`3e06c70`). The historical session logs remain below as evidence of what was observed. Do not re-open resolved findings from prose alone: reproduce against the current build first. The current open work is the sectioned terminal conversation layout and recoverable HTTP/API error UX described below.
+The current deployed baseline is **MSO CLI 1.12.0** with toolset `2026.09.02.7`; use `mso --version` plus `/api/health` for the exact Git build because documentation-only release commits also advance that identity. The v1.10/v1.11 findings and the v1.12 sectioned-terminal/recoverable-error work below are resolved and retained as historical test evidence. Do not re-open a resolved finding from prose alone: reproduce it against the current build first. There is no known 1.12 release blocker in this handoff.
-Resolved in the candidate:
+Current verified behavior:
- every durable session has a unique short public `name` (`milo`, `luna`, `nara`, …) independent from its longer `title`; `/rename` changes the handle and `/title` changes the description;
- human `@name` mention routing resolves active agents only; internal `agent-a` aliases remain compatibility data for explicit APIs;
- composer drafts wrap dynamically to terminal width/height, repaint on resize, and ↑/↓ navigate visual rows before history;
@@ -15,12 +15,26 @@ Resolved in the candidate:
- `local_agent_request` has MCP-dispatch coverage and remains a fresh bounded worker, never a claim to wake/control another terminal/ChatGPT process;
- standalone Local Agent MCP tests isolate the A2A worker import boundary instead of failing on Vitest's unresolved `server-only`;
- exact write/exec approval defaults to one compact safe line; Enter opens redacted-safe details plus the unchanged canonical digest, and a separate explicit `allow` / `deny` decision is required.
+- the terminal separates `Assistant`, `Agent work`, `Local agent`, `Error`, and `Input · @name` with full-width dividers; the composer identity is `@name ›` and permission lives in the bottom footer as `mode ask|auto|yolo`;
+- recoverable HTTP/API failures preserve the interaction and correlation state, classify mutation outcome as `not_started`, `completed`, or `uncertain`, redact safe error summaries, and never auto-retry an uncertain write/exec mutation.
## Copy prompt for Agent Alpha
```text
You are taking over MSO testing work in /home/rahman/projects/mso.
+Read docs/TESTING-HANDOFF.md first. Current verified baseline: CLI 1.12.0, toolset 2026.09.02.7; resolve the exact live Git build from `mso --version`/`/api/health`. Preserve existing work and do not re-open resolved v1.10-v1.12 findings unless you can reproduce them against the current build.
+
+For a new issue: record the exact reproduction, distinguish durable state from live receiver/process state, avoid duplicate write/exec retries when outcome is uncertain, add the smallest focused regression, run typecheck plus the relevant contract tests, then update this handoff with factual results.
+```
+
+### Resolved historical takeover prompt
+
+The prompt below is retained because it records the acceptance criteria that produced 1.11/1.12. It is **not current open work**.
+
+```text
+You are taking over MSO testing work in /home/rahman/projects/mso.
+
Read docs/TESTING-HANDOFF.md first. Preserve existing uncommitted changes unless they directly conflict with the requested fix.
Implement and verify the open items below:
@@ -46,6 +60,37 @@ Validation minimum: focused unit tests for success, offline target, absent subsc
## Session log
+### 2026-09-03 — repository docs + unused Agent surface audit
+
+**Goal**
+- Make every current MSO document consistent with the shipped 1.12 Agent/runtime contract without deleting still-valid historical evidence.
+- Remove only demonstrably unused recent Agent code/surface and strengthen machine checks against future documentation drift.
+
+**Changed**
+- Audited all 71 repository Markdown files; current references were synchronized while `PROGRESS`, generated changelog, dated audits/plans and older release evidence were preserved as historical records.
+- Corrected current MCP scope/count catalogs to 66 model/operator tools (32 read / 22 write / 12 exec) plus app-only `workflow_status`, and corrected current A2A docs to include authenticated outbound credentials, streaming and optional authenticated inbound serving.
+- Updated 1.12 terminal/provider/install/Local Agent/architecture/troubleshooting guidance and replaced the stale takeover prompt with a current-baseline prompt while retaining the resolved old prompt as historical acceptance evidence.
+- Strengthened `check-docs.mjs` so architecture/operator markers plus MCP, ChatGPT and connectors scope partitions must match source exactly.
+- Removed dead `coreToolNames()` and made implementation-only Agent helpers private instead of exporting unused internal API.
+
+**Verified before release gate**
+- Markdown inventory: **71 files**; structural issues: **0**.
+- Relative Markdown links: **125 checked / 0 broken**.
+- Stale current-claim sweep for obsolete 31/29/59/56-tool counts, old toolset sample and anonymous-only A2A wording: **clean**.
+- `node scripts/check-docs.mjs`: PASS — **53 checked project docs, 66 model MCP tools + 1 app-only bridge, 22 slices, 10 AppShell feature dirs**.
+- `npm run typecheck`: PASS after the documentation/checker and unused-export cleanup.
+
+**Repository-wide verification**
+- Targeted Agent/docs regression: **10 test files / 45 tests passed**.
+- Full release verification PASS with exit 0: `bun run verify` (typecheck, lint, coverage/full test suite, docs/architecture checks, dependency audit) followed by `bash scripts/verify-build.sh` for the out-of-tree production build.
+- Lint remains **0 errors / 9 existing max-lines warnings**; this audit adds no warning-only file.
+- Dependency audit: `bun audit` reports **No vulnerabilities found**.
+- Final Agent dead-code scan: **0 dead top-level helpers**; the removed `coreToolNames()` was the only definition-only function found before cleanup.
+- Final Markdown validation remains **71 files / 125 relative links / 0 structural issues / 0 broken links**; strengthened `check-docs.mjs` passes.
+
+**Open work / handoff**
+- No known documentation, Agent-contract, dependency-audit, or build blocker. Future tool additions/renames should update source first and let the strengthened docs gate identify every stale MCP scope/count representation instead of manually copying counts.
+
### 2026-09-02 — sectioned terminal + recoverable API failures
**Goal**
@@ -165,6 +210,9 @@ Validation minimum: focused unit tests for success, offline target, absent subsc
### 2026-09-02 — terminal HTTP/API error resilience
+**Resolution**
+- Shipped in MSO CLI 1.12.0 (`eeaaa27`) and live-verified before the final testing-doc sync (`be0e436`). The requirements below are retained as the original acceptance evidence.
+
**Observed**
- During a documentation-only update, the file write succeeded, but the next tool/UI step surfaced an HTTP 400 and interrupted the visible flow before the assistant could confirm completion.
diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md
index 811e28a9..c9441625 100644
--- a/docs/TROUBLESHOOTING.md
+++ b/docs/TROUBLESHOOTING.md
@@ -234,6 +234,23 @@ Integrated Code Terminal uses the editor/project working directory passed as `cw
the opened file/project path is inside an allowed writable root; otherwise host cwd
resolution falls back/refuses according to the host policy.
+
+## MSO Agent terminal
+
+### MSO Agent shows an `Error` section after HTTP/API failure
+
+MSO 1.12 treats recoverable terminal API/transport failures as an interaction state instead of silently ending the conversation. The `Error` section shows only a bounded/redacted summary and reports the mutation outcome as `not_started`, `completed`, or `uncertain`. The durable session, correlation rows, permission mode and an active composer draft are preserved.
+
+- `not_started` — no mutation in that turn was dispatched; fix the underlying API/runtime issue and continue.
+- `completed` — the mutation finished before the later failure; **do not repeat it** merely because the follow-up model/API step failed.
+- `uncertain` — a write/exec request may have reached the server before the transport failed; inspect the target state first, then retry only if verification proves the mutation did not happen. MSO never auto-retries this state.
+
+If the service itself is unhealthy, use `mso doctor`, `mso service status`, or the relevant read/status tool before attempting another mutation. Never paste raw request bodies, cookies, tokens, or hidden transcript data into a retry.
+
+### Permission/details interaction was interrupted
+
+In `ask` mode the default approval view is one compact `Approval needed: <tool> — <action>` line. Enter opens redacted-safe exact-call details and the canonical digest; a separate explicit `allow` or `deny` decision is still required. If the approval interaction fails before that decision, MSO keeps pending approval metadata but does **not** infer approval. Continue/re-open the action and make an explicit decision.
+
## Camoufox Browser
### Browser says Camoufox is not installed
diff --git a/scripts/check-docs.mjs b/scripts/check-docs.mjs
index 1230b719..2bb585e1 100755
--- a/scripts/check-docs.mjs
+++ b/scripts/check-docs.mjs
@@ -48,16 +48,71 @@ for (const name of appOnlyTools) {
const counts = { read: 0, write: 0, exec: 0 };
for (const scope of documentedTools.values()) counts[scope] += 1;
const marker = `server=${server} version=${version} tools=${documentedTools.size} read=${counts.read} write=${counts.write} exec=${counts.exec}`;
-for (const file of ["docs/MCP.md", "docs/CHATGPT-PLUGIN.md", "docs/CONNECTORS-GATEWAY-INTEGRATION.md"]) {
+const markerDocs = ["docs/MCP.md", "docs/CHATGPT-PLUGIN.md", "docs/CONNECTORS-GATEWAY-INTEGRATION.md", "docs/ARCHITECTURE.md", "CLAUDE.md"];
+for (const file of markerDocs) {
const text = read(file);
if (!text.includes(`<!-- mcp-toolset: ${marker} -->`)) {
fail.push(`${file}: MCP marker stale; expected ${marker}`);
}
+}
+for (const file of ["docs/MCP.md", "docs/CHATGPT-PLUGIN.md", "docs/CONNECTORS-GATEWAY-INTEGRATION.md"]) {
+ const text = read(file);
for (const name of documentedTools.keys()) {
if (!text.includes(`\`${name}\``)) fail.push(`${file}: MCP tool ${name} is not documented`);
}
}
+// ChatGPT's human scope catalog must match source scope membership, not merely contain every name somewhere.
+const chatgpt = read("docs/CHATGPT-PLUGIN.md");
+const scopeOrder = ["read", "write", "exec"];
+for (let i = 0; i < scopeOrder.length; i += 1) {
+ const scope = scopeOrder[i];
+ const next = scopeOrder[i + 1];
+ const expected = [...documentedTools].filter(([, value]) => value === scope).map(([name]) => name).sort();
+ const heading = scope === "read"
+ ? `### \`read\` — ${expected.length} model/operator tools`
+ : `### \`${scope}\` — ${scope === "write" ? "read" : "write"} + ${expected.length} tools`;
+ if (!chatgpt.includes(heading)) fail.push(`docs/CHATGPT-PLUGIN.md: stale ${scope} scope heading; expected ${heading}`);
+ const start = chatgpt.indexOf(`### \`${scope}\` —`);
+ const end = next ? chatgpt.indexOf(`### \`${next}\` —`, start + 1) : chatgpt.indexOf("\n`exec_run` is full host shell power", start + 1);
+ if (start < 0 || end < 0) {
+ fail.push(`docs/CHATGPT-PLUGIN.md: could not parse ${scope} scope block`);
+ continue;
+ }
+ const actual = [...chatgpt.slice(start, end).matchAll(/^- \`([^\`]+)\`/gm)].map((match) => match[1]).sort();
+ if (actual.join("\n") !== expected.join("\n")) {
+ fail.push(`docs/CHATGPT-PLUGIN.md: ${scope} scope tool list differs from source catalog`);
+ }
+}
+
+// MCP.md's scope table must match source membership exactly.
+const mcpDoc = read("docs/MCP.md");
+for (const scope of scopeOrder) {
+ const expected = [...documentedTools].filter(([, value]) => value === scope).map(([name]) => name).sort();
+ const row = mcpDoc.split("\n").find((line) => line.startsWith(`| \`${scope}\` |`));
+ if (!row) { fail.push(`docs/MCP.md: missing ${scope} scope row`); continue; }
+ const actual = [...row.matchAll(/`([^`]+)`/g)].map((match) => match[1]).filter((name) => name !== scope).sort();
+ if (actual.join("\n") !== expected.join("\n")) fail.push(`docs/MCP.md: ${scope} scope row differs from source catalog`);
+}
+
+// The connectors contract repeats the scope partition for cross-repo mapping review.
+const connectorDoc = read("docs/CONNECTORS-GATEWAY-INTEGRATION.md");
+const connectorLabels = { read: "Read", write: "Write", exec: "Exec" };
+for (let i = 0; i < scopeOrder.length; i += 1) {
+ const scope = scopeOrder[i];
+ const next = scopeOrder[i + 1];
+ const expected = [...documentedTools].filter(([, value]) => value === scope).map(([name]) => name).sort();
+ const expectedHeading = scope === "read"
+ ? `### Read (${expected.length} model/operator)`
+ : `### ${connectorLabels[scope]} (${expected.length} beyond ${scope === "write" ? "read" : "write"})`;
+ if (!connectorDoc.includes(expectedHeading)) fail.push(`docs/CONNECTORS-GATEWAY-INTEGRATION.md: stale ${scope} heading; expected ${expectedHeading}`);
+ const start = connectorDoc.indexOf(`### ${connectorLabels[scope]} (`);
+ const end = next ? connectorDoc.indexOf(`### ${connectorLabels[next]} (`, start + 1) : connectorDoc.indexOf("### App-only bridge", start + 1);
+ if (start < 0 || end < 0) { fail.push(`docs/CONNECTORS-GATEWAY-INTEGRATION.md: could not parse ${scope} block`); continue; }
+ const actual = [...connectorDoc.slice(start, end).matchAll(/`([^`]+)`/g)].map((match) => match[1]).sort();
+ if (actual.join("\n") !== expected.join("\n")) fail.push(`docs/CONNECTORS-GATEWAY-INTEGRATION.md: ${scope} scope list differs from source catalog`);
+}
+
// --- Slice catalog counts.
const dirs = (p) => readdirSync(join(ROOT, p), { withFileTypes: true }).filter((x) => x.isDirectory()).map((x) => x.name);
const sliceCount = dirs("frontend/slices").length;
diff --git a/scripts/mso-agent-context.mjs b/scripts/mso-agent-context.mjs
index ca95e194..cdff7ba0 100644
--- a/scripts/mso-agent-context.mjs
+++ b/scripts/mso-agent-context.mjs
@@ -1,7 +1,7 @@
-export const DEFAULT_MODEL_HISTORY_BUDGET = 48_000;
-export const MAX_MODEL_HISTORY_BUDGET = 120_000;
+const DEFAULT_MODEL_HISTORY_BUDGET = 48_000;
+const MAX_MODEL_HISTORY_BUDGET = 120_000;
-export function estimateContextTokens(value) {
+function estimateContextTokens(value) {
let raw = "";
try { raw = typeof value === "string" ? value : JSON.stringify(value ?? ""); }
catch { raw = String(value ?? ""); }
diff --git a/scripts/mso-agent-layout.mjs b/scripts/mso-agent-layout.mjs
index d27d2f70..1f04448e 100644
--- a/scripts/mso-agent-layout.mjs
+++ b/scripts/mso-agent-layout.mjs
@@ -13,7 +13,7 @@ const LABELS = {
function plain(value) { return String(value ?? "").replace(/\x1b\[[0-9;]*m/g, ""); }
function width(value) { return Array.from(plain(value)).length; }
-export function tuiColumns(output = process.stdout) {
+function tuiColumns(output = process.stdout) {
return Math.max(24, Number(output?.columns || 100));
}
diff --git a/scripts/mso-agent-local.mjs b/scripts/mso-agent-local.mjs
index 89d7cc6d..c5e30ed9 100644
--- a/scripts/mso-agent-local.mjs
+++ b/scripts/mso-agent-local.mjs
@@ -29,13 +29,13 @@ export function formatLocalAgentEvent(message, colors = C) {
return `${colors.c}${colors.bold}${prefix}${kind}${colors.reset} ${indented}`;
}
-export function formatLocalAgentRelay(message, colors = C) {
+function formatLocalAgentRelay(message, colors = C) {
const prefix = agentPrefix(message?.senderLabel);
const text = String(message?.text || "").replace(/\r/g, "").replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g, "");
return `${colors.c}${colors.bold}${prefix} → user${colors.reset} ${text.replace(/\n/g, "\n ")}`;
}
-export function correlatedRelayRequest(history, message) {
+function correlatedRelayRequest(history, message) {
if (message?.intent !== "reply" || message?.requiresUserRelay !== true || !message?.replyToMessageId || !message?.correlationId) return null;
return (Array.isArray(history) ? history : []).find((row) =>
row?.role === "local_request" && String(row.messageId || "") === String(message.replyToMessageId) &&
diff --git a/scripts/mso-agent-permissions.mjs b/scripts/mso-agent-permissions.mjs
index 4029f891..ac89e1b7 100644
--- a/scripts/mso-agent-permissions.mjs
+++ b/scripts/mso-agent-permissions.mjs
@@ -1,4 +1,4 @@
-export const PERMISSION_MODES = [
+const PERMISSION_MODES = [
{ id: "ask", label: "Ask", detail: "Confirm every write and exec call", tone: "safe" },
{ id: "auto", label: "Auto-write", detail: "Approve writes; still ask before exec", tone: "auto" },
{ id: "yolo", label: "YOLO", detail: "Approve write and exec automatically", tone: "danger" },
diff --git a/scripts/mso-agent-skills.mjs b/scripts/mso-agent-skills.mjs
index 7ff58a09..4ec8305b 100644
--- a/scripts/mso-agent-skills.mjs
+++ b/scripts/mso-agent-skills.mjs
@@ -23,7 +23,7 @@ export function skillRuntimeState(session, skill) {
return "ready";
}
-export function skillStateVisual(state, C) {
+function skillStateVisual(state, C) {
if (state === "blocked") return { marker: "!", label: "blocked", color: C.warn };
if (state === "queued") return { marker: "◆", label: "queued", color: C.warn };
if (state === "invoking") return { marker: "◆", label: "invoking", color: C.c };
diff --git a/scripts/mso-agent-slash.mjs b/scripts/mso-agent-slash.mjs
index b9a24040..0a574b0c 100644
--- a/scripts/mso-agent-slash.mjs
+++ b/scripts/mso-agent-slash.mjs
@@ -6,7 +6,7 @@ import {
slashSkillNames,
} from "./mso-agent-skills.mjs";
-export const BUILTIN_SLASH_ITEMS = [
+const BUILTIN_SLASH_ITEMS = [
{ text: "/help", meta: "Show commands and shortcuts", kind: "command" },
{
text: "/models",
diff --git a/scripts/mso-agent-status.mjs b/scripts/mso-agent-status.mjs
index 8ddabe82..90a9a5e8 100644
--- a/scripts/mso-agent-status.mjs
+++ b/scripts/mso-agent-status.mjs
@@ -17,7 +17,7 @@ export function estimateTokens(value) {
return Math.max(0, Math.ceil(Buffer.byteLength(text, "utf8") / 4));
}
-export function historyContextEstimate(history) {
+function historyContextEstimate(history) {
return (Array.isArray(history) ? history : []).reduce((sum, row) => sum + estimateTokens(row), 0);
}
@@ -93,7 +93,7 @@ export function statusParts(session, cwd = process.cwd()) {
}
-export function detailedStatus(session, cwd = process.cwd()) {
+function detailedStatus(session, cwd = process.cwd()) {
const cfg = session?.state?.config || {};
const ctx = contextStatus(session?.history, session?.state?.modelMeta);
const usage = session?.usage || { inputTokens: 0, outputTokens: 0, totalTokens: 0 };
diff --git a/scripts/mso-agent-tool-router.mjs b/scripts/mso-agent-tool-router.mjs
index d023fdf5..ea3d8dd6 100644
--- a/scripts/mso-agent-tool-router.mjs
+++ b/scripts/mso-agent-tool-router.mjs
@@ -56,7 +56,7 @@ function messageText(row) {
return "";
}
-export function turnSearchText(history = [], skillContext = null) {
+function turnSearchText(history = [], skillContext = null) {
const recent = history.slice(-8).map(messageText).filter(Boolean).join("\n");
const skill = skillContext?.content ? String(skillContext.content).slice(0, 16000) : "";
return `${recent}\n${skill}`.slice(-48000);
@@ -132,5 +132,3 @@ export function selectToolsForTurn(allTools = [], history = [], skillContext = n
softLimit: maxActive,
};
}
-
-export function coreToolNames() { return [...CORE_TOOL_NAMES]; }