mixdog 1.2.0 → 1.2.1
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/README.md +7 -5
- package/package.json +1 -1
- package/src/defaults/shipped-history.json +4 -0
- package/src/defaults/skills/pptx/SKILL.md +6 -6
- package/src/defaults/skills/pptx/references/review.md +6 -4
- package/src/defaults/skills/pptx/scripts/source-extract.mjs +1 -1
- package/src/defaults/skills/setup/references/actions.md +13 -3
- package/src/defaults/skills/visualize/SKILL.md +12 -9
- package/src/rules/shared/60-verification.md +3 -1
- package/src/rules/shared/70-delivery.md +4 -2
- package/src/runtime/agent/orchestrator/cache-mtime.mjs +26 -5
- package/src/runtime/agent/orchestrator/config.mjs +10 -4
- package/src/runtime/agent/orchestrator/context/collect.mjs +2 -1
- package/src/runtime/agent/orchestrator/context/deferred-tools.mjs +11 -5
- package/src/runtime/agent/orchestrator/context/skill-catalog.mjs +74 -21
- package/src/runtime/agent/orchestrator/mcp/client-config.mjs +86 -8
- package/src/runtime/agent/orchestrator/mcp/client-handshake.mjs +5 -1
- package/src/runtime/agent/orchestrator/mcp/client-transport.mjs +65 -7
- package/src/runtime/agent/orchestrator/mcp/client.mjs +128 -44
- package/src/runtime/agent/orchestrator/mcp/lazy-output-validator.mjs +25 -0
- package/src/runtime/agent/orchestrator/mcp/plugin-placeholders.mjs +54 -0
- package/src/runtime/agent/orchestrator/providers/account-pool.mjs +108 -17
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +19 -11
- package/src/runtime/agent/orchestrator/providers/auto-effort.mjs +9 -0
- package/src/runtime/agent/orchestrator/providers/command-code-oauth-login.mjs +337 -0
- package/src/runtime/agent/orchestrator/providers/command-code-oauth-tokens.mjs +159 -0
- package/src/runtime/agent/orchestrator/providers/command-code-oauth.mjs +444 -0
- package/src/runtime/agent/orchestrator/providers/cursor-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/custom-provider.mjs +7 -4
- package/src/runtime/agent/orchestrator/providers/effort-configuration.mjs +9 -2
- package/src/runtime/agent/orchestrator/providers/gemini.mjs +41 -28
- package/src/runtime/agent/orchestrator/providers/lib/gemini-model-catalog.mjs +7 -1
- package/src/runtime/agent/orchestrator/providers/model-proxy-bridge.mjs +1080 -0
- package/src/runtime/agent/orchestrator/providers/model-proxy-channel.d.mts +15 -0
- package/src/runtime/agent/orchestrator/providers/model-proxy-channel.mjs +35 -0
- package/src/runtime/agent/orchestrator/providers/oauth-credential-probes.mjs +12 -0
- package/src/runtime/agent/orchestrator/providers/oauth-usage.mjs +6 -5
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-send.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat-models.mjs +6 -2
- package/src/runtime/agent/orchestrator/providers/openai-compat-options.mjs +11 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-xai-send.mjs +2 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat.mjs +9 -3
- package/src/runtime/agent/orchestrator/providers/openai-ws.mjs +4 -4
- package/src/runtime/agent/orchestrator/providers/registry.mjs +35 -9
- package/src/runtime/agent/orchestrator/runtime-core/effort.mjs +3 -0
- package/src/runtime/agent/orchestrator/runtime-core/extension-scopes.mjs +15 -55
- package/src/runtime/agent/orchestrator/runtime-core/goal-control.mjs +15 -2
- package/src/runtime/agent/orchestrator/runtime-core/plugin-mcp.mjs +267 -84
- package/src/runtime/agent/orchestrator/runtime-core/skill-tool-loading.mjs +4 -1
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog-schema.mjs +21 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog.mjs +54 -3
- package/src/runtime/agent/orchestrator/session/catalog-db/index.mjs +284 -0
- package/src/runtime/agent/orchestrator/session/catalog-db/schema.mjs +268 -0
- package/src/runtime/agent/orchestrator/session/catalog-db/sqlite-gate.mjs +27 -0
- package/src/runtime/agent/orchestrator/session/catalog-db/worker.mjs +628 -0
- package/src/runtime/agent/orchestrator/session/compact/messages.mjs +6 -2
- package/src/runtime/agent/orchestrator/session/conversation-import/claude.mjs +184 -0
- package/src/runtime/agent/orchestrator/session/conversation-import/codex.mjs +136 -0
- package/src/runtime/agent/orchestrator/session/conversation-import/convert.mjs +128 -0
- package/src/runtime/agent/orchestrator/session/conversation-import/imported-session.mjs +127 -0
- package/src/runtime/agent/orchestrator/session/conversation-import/turns.mjs +101 -0
- package/src/runtime/agent/orchestrator/session/explicit-skills.mjs +83 -5
- package/src/runtime/agent/orchestrator/session/imported-message.mjs +11 -0
- package/src/runtime/agent/orchestrator/session/loop/completion-guards.mjs +2 -1
- package/src/runtime/agent/orchestrator/session/loop/loop-state.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn.mjs +3 -2
- package/src/runtime/agent/orchestrator/session/loop/send-phase.mjs +6 -4
- package/src/runtime/agent/orchestrator/session/loop/steering.mjs +4 -3
- package/src/runtime/agent/orchestrator/session/loop/tool-helpers.mjs +3 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-queue.mjs +12 -3
- package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +3 -1
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-auto-effort.mjs +20 -12
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-execute.mjs +9 -2
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-loop-options.mjs +4 -0
- package/src/runtime/agent/orchestrator/session/manager/pending-message-entry.mjs +17 -4
- package/src/runtime/agent/orchestrator/session/manager.mjs +0 -1
- package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +4 -3
- package/src/runtime/agent/orchestrator/session/store/listing.mjs +6 -2
- package/src/runtime/agent/orchestrator/session/store/summary-cache.mjs +6 -0
- package/src/runtime/agent/orchestrator/session/store-summary-catalog.mjs +817 -0
- package/src/runtime/agent/orchestrator/session/store-summary-fields.mjs +7 -0
- package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +19 -12
- package/src/runtime/agent/orchestrator/session/store-summary-reader-catalog-fixture.mjs +158 -0
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +183 -374
- package/src/runtime/agent/orchestrator/session/synthetic-user-envelope.mjs +3 -1
- package/src/runtime/agent/orchestrator/session/tool-batch/pre-dispatch.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/transcript-restore/restore.mjs +21 -2
- package/src/runtime/agent/orchestrator/session/transcript-restore/user-text.mjs +38 -17
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/invocation-plan.mjs +17 -1
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/spawn-env.mjs +4 -0
- package/src/runtime/agent/orchestrator/tools/builtin/lib/list-helpers.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/path-diagnostics.mjs +6 -6
- package/src/runtime/agent/orchestrator/tools/builtin/read-range-index.mjs +173 -22
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-guards.mjs +8 -4
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-tool.mjs +5 -4
- package/src/runtime/agent/orchestrator/tools/builtin/read-source-windows.mjs +15 -2
- package/src/runtime/agent/orchestrator/tools/builtin/search-glob-tool.mjs +13 -10
- package/src/runtime/agent/orchestrator/tools/builtin/search-grep-tool.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/search-path-diagnostics.mjs +17 -12
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch/root-resolution.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch/apply-patch/codex-batch.mjs +4 -4
- package/src/runtime/agent/orchestrator/tools/patch/apply-patch/route.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/patch/orchestrator.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch/read-redirects.mjs +34 -30
- package/src/runtime/agent/orchestrator/tools/patch/sequence/units.mjs +7 -7
- package/src/runtime/agent/orchestrator/tools/patch/sequence.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/shell-snapshot.mjs +4 -0
- package/src/runtime/attachments/store.d.mts +3 -0
- package/src/runtime/channels/lib/owned-runtime/owned-start.mjs +1 -1
- package/src/runtime/channels/lib/webhook/session-dispatch.mjs +16 -4
- package/src/runtime/channels/lib/worker-main.mjs +17 -14
- package/src/runtime/computer-bridge/linux-readiness.mjs +0 -2
- package/src/runtime/effort-judge/judge-client.mjs +56 -18
- package/src/runtime/memory/lib/memory.mjs +1 -1
- package/src/runtime/memory/lib/session-ingest.mjs +2 -2
- package/src/runtime/shared/atomic-file.mjs +25 -4
- package/src/runtime/shared/extension-scopes.mjs +5 -3
- package/src/runtime/shared/file-lock.mjs +37 -11
- package/src/runtime/shared/llm/anthropic-effort.mjs +14 -0
- package/src/runtime/shared/llm/model-catalog.mjs +0 -12
- package/src/runtime/shared/llm/provider-catalog-registry.mjs +6 -0
- package/src/runtime/shared/plugin-manifest.mjs +18 -9
- package/src/runtime/shared/pristine-execution-contract.json +9 -2
- package/src/runtime/shared/pristine-execution.mjs +28 -4
- package/src/runtime/shared/provider-accounts.mjs +124 -20
- package/src/runtime/shared/provider-api-key.mjs +12 -0
- package/src/runtime/shared/shell-display.mjs +9 -3
- package/src/runtime/shared/skill-mentions.d.mts +10 -0
- package/src/runtime/shared/skill-mentions.mjs +133 -0
- package/src/runtime/shared/skill-script-runtime.mjs +264 -0
- package/src/runtime/shared/tool-primitives.mjs +35 -2
- package/src/runtime/shared/turn-worktree-snapshot.mjs +25 -5
- package/src/runtime/shared/worker-requests.mjs +15 -2
- package/src/session-runtime/automation-agents.mjs +8 -2
- package/src/session-runtime/boot/apis.mjs +55 -0
- package/src/session-runtime/boot/config.mjs +5 -2
- package/src/session-runtime/boot/facade.mjs +1 -0
- package/src/session-runtime/boot/infrastructure.mjs +29 -18
- package/src/session-runtime/conversation-import/discovery.mjs +698 -0
- package/src/session-runtime/conversation-import/service.mjs +369 -0
- package/src/session-runtime/cwd-plugins/cwd-apply.mjs +10 -5
- package/src/session-runtime/cwd-plugins/plugin-status.mjs +47 -42
- package/src/session-runtime/mcp-glue/connect.mjs +57 -10
- package/src/session-runtime/mcp-glue/plugin-servers.mjs +499 -0
- package/src/session-runtime/mcp-glue/server-catalog.mjs +115 -30
- package/src/session-runtime/mcp-glue.mjs +22 -2
- package/src/session-runtime/new-session-config.mjs +3 -2
- package/src/session-runtime/notification-bus.mjs +9 -2
- package/src/session-runtime/provider-auth/accounts.mjs +33 -15
- package/src/session-runtime/provider-models/web-search-catalog.mjs +5 -1
- package/src/session-runtime/provider-readiness.mjs +16 -10
- package/src/session-runtime/resource-extension-sync.mjs +20 -5
- package/src/session-runtime/resource-mcp-api.mjs +101 -77
- package/src/session-runtime/resource-plugins-api.mjs +29 -41
- package/src/session-runtime/resource-scope-decorate.mjs +6 -8
- package/src/session-runtime/resource-skills-api.mjs +23 -2
- package/src/session-runtime/schedule-session-run.mjs +1 -1
- package/src/session-runtime/services/channel-session-router.mjs +4 -1
- package/src/session-runtime/services/hook-bus/command-handler.mjs +4 -1
- package/src/session-runtime/services/hook-bus/handlers.mjs +7 -3
- package/src/session-runtime/services/provider-admin.mjs +64 -18
- package/src/session-runtime/services/usage-dashboard-model.mjs +3 -0
- package/src/session-runtime/setup-tool/executor.mjs +12 -1
- package/src/session-runtime/setup-tool/extended-actions.mjs +1 -0
- package/src/session-runtime/setup-tool/settings-contract.mjs +1 -0
- package/src/session-runtime/setup-tool/tool-defs.mjs +7 -1
- package/src/session-runtime/skills-api.mjs +7 -3
- package/src/session-runtime/turn/turn-run/ask-callbacks.mjs +1 -0
- package/src/session-runtime/webhook-session-run.mjs +16 -4
- package/src/skill-script-entry.mjs +36 -0
- package/src/standalone/daemon-stored-session-views.mjs +11 -3
- package/src/standalone/daemon.mjs +41 -4
- package/src/standalone/session-protocol.mjs +5 -0
- package/src/standalone/session-service/session-calls/session-action.mjs +6 -1
- package/src/tui/App.jsx +9 -1
- package/src/tui/app/app-view/floating-panel.jsx +9 -1
- package/src/tui/app/app-view.jsx +6 -0
- package/src/tui/app/extension-pickers/plugins-pickers.mjs +35 -16
- package/src/tui/app/model-options.mjs +2 -0
- package/src/tui/app/skill-mention-palette.mjs +88 -0
- package/src/tui/app/slash-palette.mjs +23 -7
- package/src/tui/app/transcript-row-estimate.mjs +11 -3
- package/src/tui/app/use-prompt-draft-flow.mjs +7 -2
- package/src/tui/app/use-prompt-state.mjs +5 -0
- package/src/tui/components/Message.jsx +22 -1
- package/src/tui/components/PromptInput.jsx +21 -3
- package/src/tui/components/SlashCommandPalette.jsx +12 -3
- package/src/tui/components/TranscriptItem.jsx +9 -1
- package/src/tui/components/prompt-input/key-handler.mjs +21 -8
- package/src/tui/components/user-message-skills.mjs +38 -0
- package/src/tui/dist/index.mjs +507 -171
- package/src/tui/session/queue-helpers.mjs +7 -2
- package/src/tui/session/session-api/extensions.mjs +4 -2
- package/src/tui/session/session-api/settings.mjs +7 -0
- package/src/tui/session/session-flow/drain.mjs +14 -4
- package/src/tui/session/tui-steering-persist.mjs +25 -9
- package/src/tui/session/turn.mjs +17 -0
- package/src/runtime/effort-judge/previous-human-request.mjs +0 -162
- package/src/runtime/effort-judge/verified-context-input.mjs +0 -10
package/README.md
CHANGED
|
@@ -6,8 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
The open-source coding agent that uses 63% fewer tokens.
|
|
9
|
+
<br>
|
|
10
|
+
<a href="#installation"><b>Download ↓</b></a>
|
|
9
11
|
</p>
|
|
10
12
|
|
|
13
|
+
https://github.com/user-attachments/assets/af515dc9-b0fb-4b6a-aaa1-1d82db792ed0
|
|
14
|
+
|
|
11
15
|
<p align="center">
|
|
12
16
|
<a href="https://github.com/tribgames/mixdog/releases/latest/download/mixdog-desktop-win-x64.exe"><img src="https://raw.githubusercontent.com/tribgames/mixdog/main/docs/assets/download-windows.svg" alt="Download for Windows" height="48"></a>
|
|
13
17
|
|
|
@@ -30,8 +34,6 @@
|
|
|
30
34
|
<a href="#documentation"><b>Docs</b></a>
|
|
31
35
|
</p>
|
|
32
36
|
|
|
33
|
-
https://github.com/user-attachments/assets/af515dc9-b0fb-4b6a-aaa1-1d82db792ed0
|
|
34
|
-
|
|
35
37
|
## Highlights
|
|
36
38
|
|
|
37
39
|
- [63% fewer tokens](#benchmarks) than Codex CLI on the same model, at the
|
|
@@ -116,9 +118,9 @@ shell networking — headless exec is not an offline sandbox. Run
|
|
|
116
118
|
|
|
117
119
|
<p align="center">
|
|
118
120
|
<picture>
|
|
119
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/tribgames/mixdog/main/
|
|
120
|
-
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/tribgames/mixdog/main/
|
|
121
|
-
<img alt="Bar chart: Mixdog vs Codex CLI on Terminal-Bench 2.1" src="https://raw.githubusercontent.com/tribgames/mixdog/main/
|
|
121
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/tribgames/mixdog/main/design/promo/tb21-sol-vs-codex-dark.svg">
|
|
122
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/tribgames/mixdog/main/design/promo/tb21-sol-vs-codex-light.svg">
|
|
123
|
+
<img alt="Bar chart: Mixdog vs Codex CLI on Terminal-Bench 2.1" src="https://raw.githubusercontent.com/tribgames/mixdog/main/design/promo/tb21-sol-vs-codex-light.svg">
|
|
122
124
|
</picture>
|
|
123
125
|
</p>
|
|
124
126
|
|
package/package.json
CHANGED
|
@@ -285,9 +285,11 @@
|
|
|
285
285
|
"07802a61d913c3fb7c431774e7f4ebb7",
|
|
286
286
|
"0a34c5b6011578bebdb6cca63edfcec4",
|
|
287
287
|
"0ddf9f9845e1fcfc76d81592d6a71e70",
|
|
288
|
+
"0e044c22eb0786162ebb33a30f3bd5ae",
|
|
288
289
|
"44171df8144101dc74bf21f72cb5b7c0",
|
|
289
290
|
"48247c1645fd94aad7711082d4512c49",
|
|
290
291
|
"4f94016363acccd788a724a2d414744e",
|
|
292
|
+
"56e474f78faafae39aebe921ccff112d",
|
|
291
293
|
"6358ad25dd07a2f92ad65c249a4f360b",
|
|
292
294
|
"7fb12aeb07b79ae113c0deb0a90c6da7",
|
|
293
295
|
"804afd71ebc3f68614a4dc419af4b98e",
|
|
@@ -319,6 +321,7 @@
|
|
|
319
321
|
"0d5c8c6e2349addf71d2ed2b4c1ccb1f",
|
|
320
322
|
"0d6926aaca2890da9347f15a826546e3",
|
|
321
323
|
"0f14ba0a3d8b3896b717dc144bbe49a4",
|
|
324
|
+
"15d86146cfbd58d85adf0c25cf1d683f",
|
|
322
325
|
"1c317db86e1ff80a5c4102e09e36f5fb",
|
|
323
326
|
"242f11864abdef90fa0cc9cb4599a579",
|
|
324
327
|
"29a347c4d3a2f773fa92c627260301ba",
|
|
@@ -364,6 +367,7 @@
|
|
|
364
367
|
"fe0512acbb2fc8f80c5961b9f44aa5e2"
|
|
365
368
|
],
|
|
366
369
|
"visualize": [
|
|
370
|
+
"aa3531bfc4fd6ec3820493d0c190cc75",
|
|
367
371
|
"f65924f0691284ad31000469a9855b62"
|
|
368
372
|
],
|
|
369
373
|
"xlsx": [
|
|
@@ -23,9 +23,9 @@ The model designs; the runtime converts and measures. Write HTML/CSS for the act
|
|
|
23
23
|
|---|---|---|
|
|
24
24
|
| **New deck**, or a redesign the user wants rebuilt | one `author` call per deck: HTML slides in `script` by default (`references/html.md`), or a pptxgenjs script (§2-§4) when the kit's devices are wanted or no local browser exists; a new deck is never assembled from `batch` operations | `author` returns `audit.status: 'pass'`; `render` on that session returns the pages and a `reviewToken` |
|
|
25
25
|
| **Existing deck** — template fill, partial rewrite, reorder, merging decks | `open` → `snapshot` → `batch` slide and shape operations (§6); a new page is a duplicated source page, never a runtime-composed one | every `batch` returns its own `audit` for the edited slides |
|
|
26
|
-
| **Read or extract** — outline, text, or figures from a deck, or the material a deck is built from | `open` + a paged `snapshot` (`pages:[…]` or `cursor:`), or
|
|
26
|
+
| **Read or extract** — outline, text, or figures from a deck, or the material a deck is built from | `open` + a paged `snapshot` (`pages:[…]` or `cursor:`), or `${MIXDOG_SKILL_NODE} "${MIXDOG_SKILL_DIR}/scripts/source-extract.mjs" <file>` for blocks with citable locators | blocks prefixed `[slide 4]`, `[p3]`, `[Sheet1!B4]`, `[line 42]` |
|
|
27
27
|
|
|
28
|
-
Prerequisites: the Office capability (`metadata.requires`) — its portable backend needs no installed PowerPoint, and Office on Windows is used in the background when present; fonts that render reliably for the recipient; a signed-in `media` lane only for generated pictures; an explicit `--provider` and `--model` for the reviewer and page-QC scripts, which reuse the existing sign-in and never ask for credentials.
|
|
28
|
+
Prerequisites: the Office capability (`metadata.requires`) — its portable backend needs no installed PowerPoint, and Office on Windows is used in the background when present; fonts that render reliably for the recipient; a signed-in `media` lane only for generated pictures; an explicit `--provider` and `--model` for the reviewer and page-QC scripts, which reuse the existing sign-in and never ask for credentials. Run bundled scripts with `${MIXDOG_SKILL_NODE}` (on PATH in any shell), never plain `node`.
|
|
29
29
|
|
|
30
30
|
## 1. Load routing
|
|
31
31
|
| File | Owns | Read when |
|
|
@@ -59,10 +59,10 @@ Prerequisites: the Office capability (`metadata.requires`) — its portable back
|
|
|
59
59
|
**Bounded refinement**: fix factual and material visual defects before taste edits. Keep each pass focused on the highest-impact changes. After two unsuccessful corrections of the same defect, preserve the last valid artifact and report the limitation rather than cycling for a higher score. This limit is not permission to call an inadequate design complete. If an asset fails, repair or replace it; if it is removed, recompose the space it owned.
|
|
60
60
|
8. **Page QC (new decks; skip for a one-page edit)**: after the measured audit, `qa render:false`, and the first render, check overflow, clipping, collision, canvas edge, contrast, and distortion; never redesign, reword, add, or delete. In Solo, Lead reviews directly. Only with workflow-approved delegation, use the runner below: each fresh fixer sees one page's image, inventory, and measured defects, uses only office, and edits a working copy. The runner adopts it only if defects did not grow and no other page changed. For this delegated route, `close` the session before running:
|
|
61
61
|
```text
|
|
62
|
-
|
|
62
|
+
${MIXDOG_SKILL_NODE} "${MIXDOG_SKILL_DIR}/scripts/qc-pages.mjs" <deck.pptx> --provider <provider> --model <model> --output qc-report.json [--pages 1-12] [--no-vision]
|
|
63
63
|
```
|
|
64
64
|
Provider and model are explicit, as for the reviewer; `--no-vision` runs the geometry read only (a text-only model, or no renderer); at most 20 pages per run. Read the report (`pages[].reason`: improved, polished as unchanged, clean, scope, regression, audit_failed, execution_failed). A page whose run never replied is not a page that passed: `execution_failed` counts into `failed`, turns `ok` false, and exits the command, so rerun those pages before delivery rather than reading the report as clean. Then `open` the deck again and `render` it: the QC edits invalidate the earlier `reviewToken`, and a reopened session no longer carries the brief, which is why the brief read (`qa render:false`) comes before this step.
|
|
65
|
-
9. Reader and art director pass — read the contact sheet for sequence and full-size pages for detail. For substantial new work, use the source questions in `references/review.md`; its separate reviewer procedure (
|
|
65
|
+
9. Reader and art director pass — read the contact sheet for sequence and full-size pages for detail. For substantial new work, use the source questions in `references/review.md`; its separate reviewer procedure (`${MIXDOG_SKILL_NODE} "${MIXDOG_SKILL_DIR}/scripts/review-deck.mjs" packet.json --provider <provider> --model <model> --output review.json`) requires workflow-approved delegation. Otherwise, explicitly label the pass self-review. Check the reader's answers against the original source key, then judge message visibility, focal hierarchy, and coherent variation before consulting `deck.rhythm`.
|
|
66
66
|
**Output**: a slide-specific keep/fix decision with the visible reason. Resolve phrase-breaking wraps, weak evidence, and accidental empty regions; do not move a title merely to vary the sequence or change a successful page to reach a quota. Select at most two high-impact design revisions per pass; zero is valid.
|
|
67
67
|
**Default — reuse the review**: small text, shape or data edits use `batch`, not re-author; every `batch` returns its own `audit` for the edited slides, read before the next edit. Portable renders report `changedPages` and `reusedPages` for up to 12 requested pages: inspect changed pages and carry forward the unchanged pages' critique. Shared resources invalidate the cache conservatively; PDF export remains whole-document. COM and long-deck contact sheets refresh normally. Always use the new complete render token, never the previous approval.
|
|
68
68
|
10. `office action:'finalize' session:<id> design:{ reviewed:true, reviewToken, critique:[...] }` — reuses a complete current preview, checks the document, saves, validates, and closes. Use the token from the final complete render; after detail-page inspection, restore a complete render before finalizing. An edit invalidates the previous approval. `fixes` lists work still owed; applied fixes belong in `note`. A render/export failure leaves the deliverable unfinished: preserve the session and artifacts, report the failure, and never substitute a manual save for successful finalize. Finalize an authored deck in its authoring session: a deck reopened in `mode:'background'` is re-saved by PowerPoint, which rewrites the theme, layout, and embedded-workbook parts, and the validation baseline then reports `changed_protected_part` / `lost_protected_part` against the file it opened. Done when finalize reports the saved, validated file and the session is closed.
|
|
@@ -84,7 +84,7 @@ Prerequisites: the Office capability (`metadata.requires`) — its portable back
|
|
|
84
84
|
```
|
|
85
85
|
**Hard rule — the plan is the page's contract**: every slide's plan line names its job, relationship, move, composition move, carriers, texture, and rhythm before any geometry exists, so the design is decided before it is drawn. **The runtime gates on it** from two slides up: `author` refuses a deck whose brief has no `slide plan:` line (`plan_missing`), whose plan leaves a slide unwritten (`plan_slide_unplanned`), whose line names no job or carriers (`plan_incomplete`), or whose page does not carry what its own line named (`plan_promise_missing`) — `reason: plan_gate` with the slides listed, the previous deck and its session untouched, and the answer is the plan line or the page, not a retry. A single-slide specimen is not gated, and a stale slide count stays information (`plan_count_mismatch`). A thin request gets a defensible brief invented from the subject, never blank fields. The `facts:`, `directions:`, and `slide plan:` lines may wrap across comment lines; each continuation line is read as more ` · ` items — so ` · ` is the separator and never appears inside a value or a source (write "관측치와 측정", not "관측치·측정"; a fact cut at an inner ` · ` silently disappears and every figure it carried becomes `number_without_fact`). → runtime `plan_gate` at author (`plan_missing`, `plan_slide_unplanned`, `plan_incomplete`, `plan_promise_missing`); `plan_count_mismatch` in qa
|
|
86
86
|
**Hard rule — every figure has a fact**: `facts:` lists each number the deck will show, with its source (a page, a cell, a URL, or "user brief"). Dates and slide numbers are exempt. A chart series is one fact listing its values in order (`F3 운영비 1Q–6Q 10.5 10.8 9.1 7.9 7.0 6.5 — 재무팀 시트 B4:G4`); the values in the script's `chart()` call are copied from that line. With source material, the fact sheet is written first; without it, the facts come from the request and say so. **The runtime gates on it**: `author` reads the staged deck and refuses to land one that shows a figure no fact covers (`reason: facts_gate`, the figures listed per slide) — the previous deck and its session stay untouched, and the answer is the facts line, not a retry. A sketch or template with no source at all declares `facts: sample — <why>`: every figure is illustrative, the deck lands with `factsMode: 'sample'`, and the delivery tells the user the numbers are examples. → runtime `facts_gate` at author; `number_without_fact`, `facts_missing`, `facts_illustrative` in qa
|
|
87
|
-
**Hard rule — supplied material is cited**: when the deck is built from files or pages the user gave, `sources:` names them and every fact's source points where a reader can open it — a page (`p.12`), a cell (`Sheet1!B4`), a section (`§3`), or a URL.
|
|
87
|
+
**Hard rule — supplied material is cited**: when the deck is built from files or pages the user gave, `sources:` names them and every fact's source points where a reader can open it — a page (`p.12`), a cell (`Sheet1!B4`), a section (`§3`), or a URL. `${MIXDOG_SKILL_NODE} "${MIXDOG_SKILL_DIR}/scripts/source-extract.mjs" <file>` prints the material as blocks already prefixed with those locators, which is what the fact sheet quotes. A figure that came from somewhere else (a conversation, a live system) says so in its own source. → runtime `fact_without_locator` (advisory)
|
|
88
88
|
|
|
89
89
|
## 4. Script contract and library boundaries
|
|
90
90
|
- The kit prelude creates `pres` (`pptxgenjs`, `LAYOUT_WIDE` 13.33 × 7.5 in, coordinates in inches) and every helper; a script that declares its own `pres` runs without the prelude. Available modules: `pptxgenjs`, `sharp`, `node:fs`, `node:path`, `node:buffer`; no network and no photo library. Icons come from the injected `ICON` (256 offline Lucide stroke icons; `ICON.names` lists them, the kit's `icon()` / `iconRow()` place them) — a feature marker, a list prefix, or a stage glyph is an icon by name, never a Unicode emoji or a hand-drawn shape.
|
|
@@ -113,7 +113,7 @@ The runtime absorbs what it can (one `a:pPr` per paragraph; package validation a
|
|
|
113
113
|
| A secondary-axis combo needs `valAxes` and `catAxes` with two entries each | PowerPoint drops the chart → runtime `chart_axis_undeclared` |
|
|
114
114
|
|
|
115
115
|
## 5. QA and finalize
|
|
116
|
-
**Content before pixels**: read the deck's text once against the fact sheet —
|
|
116
|
+
**Content before pixels**: read the deck's text once against the fact sheet — `${MIXDOG_SKILL_NODE} "${MIXDOG_SKILL_DIR}/scripts/source-extract.mjs" <deck.pptx>` on the saved file, or the snapshot's `text` — for missing material, typos, and order; a wrong order or a dropped fact is cheaper to catch in text than on a contact sheet. → manual
|
|
117
117
|
Then inspect every rendered slide in this order. Read actual phrase endings, compare peer baselines and gaps, trace each connector to its intended boundary, and check that labels belong to the right object. Record a visible keep/fix reason rather than inferring a pass from a clean QA report. Hard hits need correction; the runtime's actual severity and source determine what blocks finalize. "Manual" means only the rendered image shows it.
|
|
118
118
|
|
|
119
119
|
**Preview fidelity**: the portable preview is LibreOffice, and it spaces Hangul and CJK *chart category labels* by character — `1분기` is drawn as `1 분기` while the chart part holds the unspaced string, and PowerPoint draws it unspaced. Check the string (`source-extract.mjs` or the chart's `c:v` values) before treating it as a defect; slide text is unaffected.
|
|
@@ -52,12 +52,14 @@ policy. Provider and model must be explicit; it uses the existing sign-in, never
|
|
|
52
52
|
asks to paste credentials. This is context separation, not an OS filesystem
|
|
53
53
|
sandbox or proof that the model's judgement is unbiased.
|
|
54
54
|
|
|
55
|
-
Run from the Project
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
Run it from the Project with the command `SKILL.md` §2 step 9 carries, which
|
|
56
|
+
the runtime resolved when the skill loaded. It starts with the launcher command
|
|
57
|
+
named there (on the shell tool's PATH), not plain `node`, which cannot load the
|
|
58
|
+
script in every installation. Its shape, with `<pptx-skill-directory>` the
|
|
59
|
+
`<base-dir>` the runtime printed:
|
|
58
60
|
|
|
59
61
|
```text
|
|
60
|
-
|
|
62
|
+
<launcher command from SKILL.md> "<pptx-skill-directory>/scripts/review-deck.mjs" packet.json --provider <provider> --model <model> --output review.json
|
|
61
63
|
```
|
|
62
64
|
|
|
63
65
|
Packet format (all paths relative to the packet file unless absolute):
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// portable session that is closed without saving; anything else is read as
|
|
7
7
|
// UTF-8 text. Output is bounded by --chars (default 4000) and every block is
|
|
8
8
|
// cut at BLOCK_CHARS, so a large source never floods the context.
|
|
9
|
-
//
|
|
9
|
+
// ${MIXDOG_SKILL_NODE} "${MIXDOG_SKILL_DIR}/scripts/source-extract.mjs" <file> [--chars 4000]
|
|
10
10
|
import { access, readFile } from 'node:fs/promises';
|
|
11
11
|
import { extname, resolve } from 'node:path';
|
|
12
12
|
import { pathToFileURL } from 'node:url';
|
|
@@ -57,7 +57,7 @@ Read this when choosing a `setup` mutation.
|
|
|
57
57
|
| Refresh a plugin checkout | `update_plugin` |
|
|
58
58
|
| Enable or disable a plugin | `set_plugin_enabled` |
|
|
59
59
|
| Remove a plugin | `remove_plugin` |
|
|
60
|
-
|
|
|
60
|
+
| Turn back on and reconnect every MCP server a plugin declares | `enable_plugin_mcp` |
|
|
61
61
|
| Available hosted models and their options; optionally one provider, native-search capable only, or a refreshed catalog | `list_models` |
|
|
62
62
|
| Agent orchestration, independent of workflow instructions | `set_orchestration_mode` |
|
|
63
63
|
| Safe MCP edit metadata, excluding raw connection/credential values | `get_mcp_server` |
|
|
@@ -204,8 +204,18 @@ markers are read with `status desktop`.
|
|
|
204
204
|
- Environment/header maps are partial patches. Omitted keys are preserved;
|
|
205
205
|
`null` explicitly removes one key, including a stored credential.
|
|
206
206
|
- Plugin enablement moves its contributed skills and MCP integrations together.
|
|
207
|
-
-
|
|
208
|
-
|
|
207
|
+
- A registered plugin's MCP servers (its `.mcp.json` and manifest
|
|
208
|
+
`mcpServers`) appear automatically with `source: "plugin"` and `plugin` /
|
|
209
|
+
`pluginServer` in `status mcp`; nothing is copied into the MCP list. A plugin
|
|
210
|
+
server runs only while both the plugin and the server are enabled;
|
|
211
|
+
`set_mcp_enabled` toggles the server, `set_plugin_enabled` the plugin, and
|
|
212
|
+
`set_extension_scope` limits it (the plugin's scope still applies).
|
|
213
|
+
`add_mcp_server`, `save_mcp_server`, and `remove_mcp_server` refuse plugin
|
|
214
|
+
servers. Declaration problems and naming conflicts are reported as
|
|
215
|
+
`declarationErrors` and `warnings`.
|
|
216
|
+
- `enable_plugin_mcp` turns every server the plugin declares back on and
|
|
217
|
+
reconnects them; a disabled plugin stays disabled, and it fails for a plugin
|
|
218
|
+
that declares no MCP servers.
|
|
209
219
|
|
|
210
220
|
## Desktop, Projects, and automation
|
|
211
221
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: visualize
|
|
3
|
-
description: Show mockups, design options, diagrams, and finished artifacts
|
|
4
|
-
when_to_use: 'Mockups
|
|
3
|
+
description: Show mockups, design options, diagrams, and finished artifacts in the side panel beside the chat.
|
|
4
|
+
when_to_use: 'Mockups, previews, design options, diagrams, or showing any finished artifact; not code alone.'
|
|
5
5
|
metadata:
|
|
6
6
|
requires: visualize
|
|
7
7
|
dependencies:
|
|
@@ -68,13 +68,16 @@ testing a page belong to `browser`.
|
|
|
68
68
|
panel keeps each saved state as a version (v1…vN) the user can step back
|
|
69
69
|
to, compare side by side, or restore, so never copy the file to keep an
|
|
70
70
|
old version. The user can also point at the page: their message then carries a
|
|
71
|
-
`<visualize_feedback>` block of numbered pins (`pin N` = the
|
|
72
|
-
saw), each with
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
`<visualize_feedback>` block of numbered pins (`pin N` = the pin numbered
|
|
72
|
+
N they saw), each with its label, note, tab, project-relative file and
|
|
73
|
+
`kind` (pane kind + element or region). An HTML element pin adds its
|
|
74
|
+
selector, `inside` path, trimmed HTML, key styles and box; a region pin
|
|
75
|
+
(an HTML drag, a document, PDF, image, diagram, or video frame) adds its
|
|
76
|
+
area, plus `elements` for an HTML drag and `time` for a video. The crop
|
|
77
|
+
image "visualize pin N" comes when there is one (`crop: none` otherwise).
|
|
78
|
+
Answer pin by pin by number and act on what the selector or area names;
|
|
79
|
+
secret values arrive as `[redacted]`, so never restore them from the crop
|
|
80
|
+
or guess them.
|
|
78
81
|
8. **After approval**: implement from the approved mockup; its values are the
|
|
79
82
|
spec. When the work needs a record, `export` the approved tab to PNG or PDF
|
|
80
83
|
beside the page (`export` with `format` and a project-relative `output`,
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
independent invariants, never from the output itself or from recall.
|
|
6
6
|
- After all edits, cover each required check once: one runner per runtime,
|
|
7
7
|
independent checks in parallel; no read/list/diff to confirm your own
|
|
8
|
-
writes; rerun only failed or invalidated checks.
|
|
8
|
+
writes; rerun only failed or invalidated checks. If repeated fixes leave
|
|
9
|
+
the same failure unchanged, test the underlying assumptions before
|
|
10
|
+
another fix.
|
|
9
11
|
- Use supplied commands unchanged except inputs, else documented defaults; no
|
|
10
12
|
stricter flags or unrequested suites.
|
|
11
13
|
- Warnings or blocked checks never justify editing passing code. Fix obsolete
|
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
`src/app.ts:42`); files outside the Project always by absolute path; never a
|
|
9
9
|
bare name, a path relative to another folder, or a `file://` URI.
|
|
10
10
|
- Deliver requested visual artifacts (SVG, diagrams, HTML pages) as saved files
|
|
11
|
-
and give their path
|
|
12
|
-
|
|
11
|
+
and give their path; never open them in the system browser or paste their
|
|
12
|
+
source unless the user asks.
|
|
13
|
+
<!-- tools: visualize -->
|
|
14
|
+
- Open each finished artifact beside the chat with `visualize open` when available.
|
|
13
15
|
|
|
14
16
|
<!-- tools: git -->
|
|
15
17
|
- A commit request includes selecting and staging its changes; a stage-only
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
1
2
|
import { statSync, readdirSync } from 'node:fs';
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -14,6 +15,28 @@ import { statSync, readdirSync } from 'node:fs';
|
|
|
14
15
|
*/
|
|
15
16
|
export function maxMtimeRecursive(paths, depth = 3) {
|
|
16
17
|
let max = 0;
|
|
18
|
+
walkMtimes(paths, depth, (_p, m) => {
|
|
19
|
+
if (m > max) max = m;
|
|
20
|
+
});
|
|
21
|
+
return max;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Exact change signature over the same walk as maxMtimeRecursive: every
|
|
26
|
+
* stat'ed path with its own mtime, so any single path changing (even to an
|
|
27
|
+
* older time) changes the result. Compare for equality only.
|
|
28
|
+
*
|
|
29
|
+
* @param {string[]} paths
|
|
30
|
+
* @param {number} [depth=3]
|
|
31
|
+
* @returns {string}
|
|
32
|
+
*/
|
|
33
|
+
export function mtimeSignatureRecursive(paths, depth = 3) {
|
|
34
|
+
const parts = [];
|
|
35
|
+
walkMtimes(paths, depth, (p, m) => parts.push(`${p}:${m}`));
|
|
36
|
+
return createHash('sha1').update(parts.join('\n')).digest('hex');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function walkMtimes(paths, depth, visit) {
|
|
17
40
|
function walk(p, d) {
|
|
18
41
|
let st;
|
|
19
42
|
try {
|
|
@@ -22,7 +45,7 @@ export function maxMtimeRecursive(paths, depth = 3) {
|
|
|
22
45
|
return;
|
|
23
46
|
}
|
|
24
47
|
if (st.isDirectory()) {
|
|
25
|
-
|
|
48
|
+
visit(p, st.mtimeMs);
|
|
26
49
|
if (d <= 0) return;
|
|
27
50
|
let entries;
|
|
28
51
|
try {
|
|
@@ -36,17 +59,15 @@ export function maxMtimeRecursive(paths, depth = 3) {
|
|
|
36
59
|
walk(child, d - 1);
|
|
37
60
|
} else if (e.isFile() && (e.name.endsWith('.md') || e.name.endsWith('.json'))) {
|
|
38
61
|
try {
|
|
39
|
-
|
|
40
|
-
if (m > max) max = m;
|
|
62
|
+
visit(child, statSync(child).mtimeMs);
|
|
41
63
|
} catch {
|
|
42
64
|
/* unreadable entry: skipped like a missing path */
|
|
43
65
|
}
|
|
44
66
|
}
|
|
45
67
|
}
|
|
46
68
|
} else {
|
|
47
|
-
|
|
69
|
+
visit(p, st.mtimeMs);
|
|
48
70
|
}
|
|
49
71
|
}
|
|
50
72
|
for (const p of paths) walk(p, depth);
|
|
51
|
-
return max;
|
|
52
73
|
}
|
|
@@ -4,10 +4,7 @@ import { mergeStoredProviders } from './config-providers-merge.mjs';
|
|
|
4
4
|
import { normalizeExtensionScopes } from '../../shared/extension-scopes.mjs';
|
|
5
5
|
import { applyConfigPatch, diffConfig } from '../../shared/config-patch.mjs';
|
|
6
6
|
import { normalizeWorkflowSelection } from '../../shared/orchestration.mjs';
|
|
7
|
-
import {
|
|
8
|
-
DEFAULT_INSTRUCTION_FILES_MODE,
|
|
9
|
-
normalizeInstructionFilesMode,
|
|
10
|
-
} from '../../shared/instruction-files-mode.mjs';
|
|
7
|
+
import { DEFAULT_INSTRUCTION_FILES_MODE, normalizeInstructionFilesMode } from '../../shared/instruction-files-mode.mjs';
|
|
11
8
|
import {
|
|
12
9
|
DEFAULT_DISABLED_AGENT_ROSTER,
|
|
13
10
|
canonicalizeAgentRouteStorage,
|
|
@@ -45,6 +42,7 @@ import {
|
|
|
45
42
|
import { oauthCredentialProbeState, isOAuthProviderAvailable } from './providers/oauth-credential-probes.mjs';
|
|
46
43
|
import { normalizeDeveloperConfig } from '../../shared/developer-options.mjs';
|
|
47
44
|
import { normalizeWorktreeSettings } from '../../shared/worktrees/settings.mjs';
|
|
45
|
+
import { normalizePluginMcpIntents } from './runtime-core/plugin-mcp.mjs';
|
|
48
46
|
|
|
49
47
|
export const {
|
|
50
48
|
PROFILE_LANGUAGES,
|
|
@@ -114,6 +112,8 @@ export function buildDefaultConfig(options = {}) {
|
|
|
114
112
|
providers['grok-oauth'] = oauthEntry('grok-oauth');
|
|
115
113
|
// Muse Code subscription (Meta Muse Spark), enabled from its stored key.
|
|
116
114
|
providers['muse-code-oauth'] = oauthEntry('muse-code-oauth');
|
|
115
|
+
// Command Code Provider API, enabled from its stored Studio API key.
|
|
116
|
+
providers['command-code-oauth'] = oauthEntry('command-code-oauth');
|
|
117
117
|
// Dev-only providers (Settings → Developer → Providers, one option each):
|
|
118
118
|
// omitted entirely from the default config while their option is off so
|
|
119
119
|
// they never surface in settings.
|
|
@@ -253,6 +253,7 @@ export function loadConfig(options = {}) {
|
|
|
253
253
|
const loaded = canonicalizeAgentRouteStorage({
|
|
254
254
|
providers: mergedProviders,
|
|
255
255
|
mcpServers,
|
|
256
|
+
pluginMcp: normalizePluginMcpIntents(raw.pluginMcp),
|
|
256
257
|
presets: withDefaultPresets(normalizedPresets),
|
|
257
258
|
default: raw.default || null,
|
|
258
259
|
maintenance: { ...DEFAULT_MAINTENANCE, ...normalizedMaint },
|
|
@@ -305,6 +306,7 @@ export function loadConfig(options = {}) {
|
|
|
305
306
|
return {
|
|
306
307
|
...defaults,
|
|
307
308
|
mcpServers: {},
|
|
309
|
+
pluginMcp: {},
|
|
308
310
|
presets: DEFAULT_PRESETS.map((p) => ({ ...p })),
|
|
309
311
|
default: null,
|
|
310
312
|
maintenance: { ...DEFAULT_MAINTENANCE },
|
|
@@ -432,6 +434,10 @@ function buildAgentSaveBuilder(config) {
|
|
|
432
434
|
modules,
|
|
433
435
|
builtins,
|
|
434
436
|
};
|
|
437
|
+
// Per-server intent for plugin-declared MCP servers; empty stays absent.
|
|
438
|
+
const pluginMcp = normalizePluginMcpIntents(config.pluginMcp);
|
|
439
|
+
if (Object.keys(pluginMcp).length) next.pluginMcp = pluginMcp;
|
|
440
|
+
else delete next.pluginMcp;
|
|
435
441
|
// Developer options (developer-options.mjs); an empty set stays absent.
|
|
436
442
|
if (Object.keys(developer).length) next.developer = developer;
|
|
437
443
|
else if (Object.hasOwn(config, 'developer')) delete next.developer;
|
|
@@ -13,11 +13,12 @@ export {
|
|
|
13
13
|
collectSkillsCached,
|
|
14
14
|
filterSkillsExcludingDisabled,
|
|
15
15
|
invalidateSkillsCache,
|
|
16
|
-
invalidateSkillsMtimeGate,
|
|
17
16
|
isSkillDisabled,
|
|
18
17
|
loadSkillResource,
|
|
19
18
|
skillBodyPresentInSession,
|
|
20
19
|
skillMissingFeature,
|
|
20
|
+
skillOutsideScope,
|
|
21
|
+
skillOutsideScopeError,
|
|
21
22
|
} from './skill-catalog.mjs';
|
|
22
23
|
export {
|
|
23
24
|
composeSystemPrompt,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Deferred-pool and MCP-instruction manifests injected into BP2.
|
|
2
|
+
import { parseMcpToolName } from '../../../shared/tool-primitives.mjs';
|
|
2
3
|
|
|
3
4
|
export function compactPromptManifestText(value, max = 250) {
|
|
4
5
|
const text = String(value || '')
|
|
@@ -100,16 +101,21 @@ function sanitizeMcpInstructionText(text, max = MCP_INSTRUCTION_MAX_CHARS) {
|
|
|
100
101
|
* names per server doubled the MCP share of the BP2 prefix (2026-08-05 audit).
|
|
101
102
|
* Server membership stays evident from the mcp__<server>__ name prefix.
|
|
102
103
|
*/
|
|
103
|
-
function buildMcpInstructionsManifest(mcpServerInstructions, poolNames) {
|
|
104
|
+
function buildMcpInstructionsManifest(mcpServerInstructions, poolNames, catalog = []) {
|
|
104
105
|
const map = mcpServerInstructions && typeof mcpServerInstructions === 'object' ? mcpServerInstructions : {};
|
|
105
106
|
const pool = [
|
|
106
107
|
...new Set((Array.isArray(poolNames) ? poolNames : []).map((name) => sanitizeManifestName(name)).filter(Boolean)),
|
|
107
108
|
];
|
|
109
|
+
// Tool definitions carry their server (shortened names cannot be parsed).
|
|
110
|
+
const byName = new Map();
|
|
111
|
+
for (const tool of Array.isArray(catalog) ? catalog : []) {
|
|
112
|
+
const name = String(tool?.name || '').trim();
|
|
113
|
+
if (name && !byName.has(name)) byName.set(name, tool);
|
|
114
|
+
}
|
|
108
115
|
const deferredServers = new Set();
|
|
109
116
|
for (const name of pool) {
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
112
|
-
deferredServers.add(match[1]);
|
|
117
|
+
const server = parseMcpToolName(byName.get(name) || name)?.server;
|
|
118
|
+
if (server) deferredServers.add(server);
|
|
113
119
|
}
|
|
114
120
|
const servers = [...deferredServers]
|
|
115
121
|
.filter((server) => sanitizeManifestName(server) && sanitizeMcpInstructionText(map[server]))
|
|
@@ -170,7 +176,7 @@ function composeDeferredBp2Manifest(session, pool) {
|
|
|
170
176
|
const parts = [];
|
|
171
177
|
const deferredManifest = buildDeferredToolManifest(deferredManifestEntries(session, pool));
|
|
172
178
|
if (deferredManifest) parts.push(deferredManifest);
|
|
173
|
-
const mcpManifest = buildMcpInstructionsManifest(session.mcpServerInstructions, pool);
|
|
179
|
+
const mcpManifest = buildMcpInstructionsManifest(session.mcpServerInstructions, pool, session.deferredToolCatalog);
|
|
174
180
|
if (mcpManifest) parts.push(mcpManifest);
|
|
175
181
|
return parts.join('\n\n');
|
|
176
182
|
}
|
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
|
|
4
4
|
import { readFileSync, existsSync, readdirSync } from 'node:fs';
|
|
5
5
|
import { basename, dirname, join } from 'node:path';
|
|
6
|
-
import { maxMtimeRecursive } from '../cache-mtime.mjs';
|
|
6
|
+
import { maxMtimeRecursive, mtimeSignatureRecursive } from '../cache-mtime.mjs';
|
|
7
7
|
import { mixdogHome, resolvePluginData, mixdogRoot } from '../../../shared/plugin-paths.mjs';
|
|
8
|
-
import { pluginSkillsRoots } from '../../../shared/plugin-manifest.mjs';
|
|
8
|
+
import { PLUGIN_MANIFEST_FILES, pluginSkillsRoots } from '../../../shared/plugin-manifest.mjs';
|
|
9
9
|
import {
|
|
10
10
|
parseSkillDocument,
|
|
11
11
|
SKILL_TRIGGER_LISTING_MAX,
|
|
12
12
|
SKILL_TRIGGER_LISTING_MIN,
|
|
13
13
|
} from '../../../shared/skill-document.mjs';
|
|
14
14
|
import { readSkillToolDependencies, skillToolDependenciesRoot } from '../../../shared/skill-tool-dependencies.mjs';
|
|
15
|
+
import { SKILL_LAUNCHER_COMMAND } from '../../../shared/skill-script-runtime.mjs';
|
|
15
16
|
import { loadConfig, normalizeSkillsConfig } from '../config.mjs';
|
|
16
17
|
import { builtinFeatureActive, withGrandfatheredBuiltins } from '../runtime-core/builtin-features.mjs';
|
|
17
18
|
import { SKILL_TOOL } from '../runtime-core/tool-defs.mjs';
|
|
@@ -88,6 +89,32 @@ function pluginSkillDirs() {
|
|
|
88
89
|
return dirs;
|
|
89
90
|
}
|
|
90
91
|
|
|
92
|
+
/** Paths whose own mtime (no recursion) gates the skill list for enabled
|
|
93
|
+
* registered plugins: every manifest file, plus the nearest existing ancestor
|
|
94
|
+
* of each candidate skills root (so a skills dir created later is noticed). */
|
|
95
|
+
function pluginShallowWatchPaths() {
|
|
96
|
+
const registryPath = pluginRegistryPath();
|
|
97
|
+
let registry;
|
|
98
|
+
try {
|
|
99
|
+
registry = JSON.parse(readFileSync(registryPath, 'utf-8'));
|
|
100
|
+
} catch {
|
|
101
|
+
return [];
|
|
102
|
+
}
|
|
103
|
+
const paths = [];
|
|
104
|
+
for (const entry of Array.isArray(registry?.plugins) ? registry.plugins : []) {
|
|
105
|
+
if (entry?.enabled === false) continue;
|
|
106
|
+
const root = entry && typeof entry.root === 'string' ? entry.root : null;
|
|
107
|
+
if (!root || !existsSync(root)) continue;
|
|
108
|
+
for (const rel of PLUGIN_MANIFEST_FILES) paths.push(join(root, ...rel.split('/')));
|
|
109
|
+
for (const skillsDir of pluginSkillsRoots(root)) {
|
|
110
|
+
let dir = skillsDir;
|
|
111
|
+
while (!existsSync(dir) && dirname(dir) !== dir) dir = dirname(dir);
|
|
112
|
+
paths.push(dir);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return paths;
|
|
116
|
+
}
|
|
117
|
+
|
|
91
118
|
export function readSafe(path) {
|
|
92
119
|
try {
|
|
93
120
|
if (!existsSync(path)) return null;
|
|
@@ -216,24 +243,39 @@ function followsBuiltinFeature(skill) {
|
|
|
216
243
|
return skill?.source === 'builtin' && Array.isArray(skill.requires) && skill.requires.length > 0;
|
|
217
244
|
}
|
|
218
245
|
|
|
219
|
-
function findCachedSkillByKey(key) {
|
|
220
|
-
return collectSkillsCached(null).find((entry) => normalizeSkillNameKey(entry.name) === key);
|
|
246
|
+
function findCachedSkillByKey(key, skills = null) {
|
|
247
|
+
return (skills || collectSkillsCached(null)).find((entry) => normalizeSkillNameKey(entry.name) === key);
|
|
221
248
|
}
|
|
222
249
|
|
|
223
|
-
|
|
250
|
+
/** `skills`: optional snapshot from one collectSkillsCached() call, reused so a
|
|
251
|
+
* batch of per-skill checks scans the disk once. */
|
|
252
|
+
export function isSkillDisabled(name, config = null, skills = null) {
|
|
224
253
|
const n = normalizeSkillNameKey(name);
|
|
225
254
|
if (!n) return false;
|
|
226
|
-
const skill = findCachedSkillByKey(n);
|
|
255
|
+
const skill = findCachedSkillByKey(n, skills);
|
|
227
256
|
if (!followsBuiltinFeature(skill) && getDisabledSkillNameSet(config).has(n)) return true;
|
|
228
257
|
return Boolean(skill && missingFeature(skill, featureConfig(config)));
|
|
229
258
|
}
|
|
230
259
|
|
|
231
260
|
/** The built-in feature a skill needs that is not active, or null. */
|
|
232
|
-
export function skillMissingFeature(name, config = null) {
|
|
233
|
-
const skill = findCachedSkillByKey(normalizeSkillNameKey(name));
|
|
261
|
+
export function skillMissingFeature(name, config = null, skills = null) {
|
|
262
|
+
const skill = findCachedSkillByKey(normalizeSkillNameKey(name), skills);
|
|
234
263
|
return skill ? missingFeature(skill, featureConfig(config)) : null;
|
|
235
264
|
}
|
|
236
265
|
|
|
266
|
+
/** True when an installed skill exists but its (or its plugin's) project scope
|
|
267
|
+
* excludes `cwd` — the same scope rule filterSkillsExcludingDisabled applies. */
|
|
268
|
+
export function skillOutsideScope(name, cwd, config = null, skills = null) {
|
|
269
|
+
const skill = findCachedSkillByKey(normalizeSkillNameKey(name), skills);
|
|
270
|
+
if (!skill) return false;
|
|
271
|
+
return !skillAllowedForCwd(extensionScopesFromConfig(featureConfig(config)), skill, cwd);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/** The Skill tool result for a skill skillOutsideScope refuses. */
|
|
275
|
+
export function skillOutsideScopeError(name) {
|
|
276
|
+
return `Error: skill "${name}" is not available in this project (its project scope excludes the current folder)`;
|
|
277
|
+
}
|
|
278
|
+
|
|
237
279
|
/**
|
|
238
280
|
* Skills a session may see: not switched off, feature available, and — when
|
|
239
281
|
* `cwd` is given — inside the skill's (or its plugin's) project scope. Without
|
|
@@ -260,8 +302,6 @@ export function collectPromptSkillsCached(cwd, config = null) {
|
|
|
260
302
|
}
|
|
261
303
|
// --- Global skill cache (mtime-based) ---
|
|
262
304
|
const _skillsCache = new Map();
|
|
263
|
-
const _mtimeCache = new Map();
|
|
264
|
-
const _MTIME_TTL_MS = 2000;
|
|
265
305
|
|
|
266
306
|
export function collectSkillsCached(cwd) {
|
|
267
307
|
if (skillsDisabled()) return [];
|
|
@@ -273,32 +313,41 @@ export function collectSkillsCached(cwd) {
|
|
|
273
313
|
skillsDirs.push(...pluginSkillDirs().map(({ dir }) => dir), ...builtinSkillDirs());
|
|
274
314
|
// registry.json itself gates plugin add/remove: removal deletes the
|
|
275
315
|
// plugin's skills dir (so no dir mtime advances), but saveRegistry()
|
|
276
|
-
// always rewrites this file.
|
|
316
|
+
// always rewrites this file. mtimeSignatureRecursive stats plain files directly.
|
|
277
317
|
const registryPath = pluginRegistryPath();
|
|
278
318
|
if (registryPath) skillsDirs.push(registryPath);
|
|
279
|
-
|
|
319
|
+
// Exact, un-timed gate: stat every call. The shallow watch list covers
|
|
320
|
+
// manifest edits and skill roots that do not exist yet.
|
|
321
|
+
const signature = `${mtimeSignatureRecursive(skillsDirs)}|${mtimeSignatureRecursive(pluginShallowWatchPaths(), 0)}`;
|
|
280
322
|
const entry = _skillsCache.get(key);
|
|
281
|
-
if (entry && entry.
|
|
323
|
+
if (entry && entry.signature === signature) {
|
|
282
324
|
return entry.value;
|
|
283
325
|
}
|
|
284
326
|
const skills = collectSkills(cwd);
|
|
285
|
-
_skillsCache.set(key, { value: skills,
|
|
327
|
+
_skillsCache.set(key, { value: skills, signature });
|
|
286
328
|
capMapSize(_skillsCache);
|
|
287
329
|
return skills;
|
|
288
330
|
}
|
|
289
331
|
export function invalidateSkillsCache(cwd) {
|
|
290
332
|
void cwd;
|
|
291
333
|
_skillsCache.clear();
|
|
292
|
-
_mtimeCache.clear();
|
|
293
334
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Directory the model hands to external processes for a skill. A packaged
|
|
338
|
+
* desktop runtime reads built-in skills from inside `runtime.asar`, which only
|
|
339
|
+
* Electron can open; the build ships them as real files beside the archive
|
|
340
|
+
* under `runtime.asar.unpacked`, so a built-in skill's directory points there.
|
|
341
|
+
* Every other source keeps its own on-disk directory.
|
|
342
|
+
*/
|
|
343
|
+
export function skillExecutionDir(dir, source) {
|
|
344
|
+
if (source !== 'builtin') return dir;
|
|
345
|
+
return String(dir).replace(/([\\/])runtime\.asar(?=[\\/]|$)/, '$1runtime.asar.unpacked');
|
|
298
346
|
}
|
|
299
347
|
|
|
300
348
|
/**
|
|
301
|
-
* Load full skill content plus its on-disk directory (for base-dir + ${MIXDOG_SKILL_DIR}
|
|
349
|
+
* Load full skill content plus its on-disk directory (for base-dir + ${MIXDOG_SKILL_DIR};
|
|
350
|
+
* ${MIXDOG_SKILL_NODE} is resolved at render time in buildSkillResultEnvelope).
|
|
302
351
|
*/
|
|
303
352
|
export function loadSkillResource(name, cwd) {
|
|
304
353
|
const skillName = String(name || '').trim();
|
|
@@ -311,7 +360,7 @@ export function loadSkillResource(name, cwd) {
|
|
|
311
360
|
try {
|
|
312
361
|
return {
|
|
313
362
|
content: parseSkillDocument(content).body,
|
|
314
|
-
dir: dirname(skill.filePath),
|
|
363
|
+
dir: skillExecutionDir(dirname(skill.filePath), skill.source),
|
|
315
364
|
filePath: skill.filePath,
|
|
316
365
|
source: skill.source || 'global',
|
|
317
366
|
toolDependencies: skill.toolDependencies || [],
|
|
@@ -335,6 +384,10 @@ export function buildSkillResultEnvelope(name, content, skillDir) {
|
|
|
335
384
|
const escapedName = escapeSkillXmlText(name);
|
|
336
385
|
let body = String(content == null ? '' : content);
|
|
337
386
|
let dirLine = '';
|
|
387
|
+
// `${MIXDOG_SKILL_NODE}` runs a bundled script on this daemon's own runtime
|
|
388
|
+
// (plain node cannot load runtime internals from a packaged archive). It is
|
|
389
|
+
// one shell-neutral command name that model shells find on their PATH.
|
|
390
|
+
body = body.replace(/\$\{MIXDOG_SKILL_NODE\}/g, SKILL_LAUNCHER_COMMAND);
|
|
338
391
|
if (skillDir) {
|
|
339
392
|
const normDir = String(skillDir).replace(/\\/g, '/');
|
|
340
393
|
body = body.replace(/\$\{MIXDOG_SKILL_DIR\}/g, normDir);
|