@softspark/ai-toolkit 4.29.2 → 4.30.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/README.md +44 -18
  3. package/app/.claude-plugin/plugin.json +1 -1
  4. package/app/ARCHITECTURE.md +2 -2
  5. package/app/mcp-templates/README.md +7 -2
  6. package/app/mcp-templates/rag-mcp-legal.json +11 -0
  7. package/app/mcp-templates/rag-mcp.json +11 -0
  8. package/app/surface.json +1 -0
  9. package/benchmarks/ecosystem-doctor-snapshot.json +29 -17
  10. package/bin/ai-toolkit.js +8 -0
  11. package/kb/history/completed/dsh-integration-plan-superseded.md +322 -0
  12. package/kb/history/completed/dsh-native-install-target-plan.md +331 -0
  13. package/kb/procedures/ecosystem-sync-sop.md +7 -5
  14. package/kb/procedures/maintenance-sop.md +1 -1
  15. package/kb/procedures/release-verification-sop.md +35 -5
  16. package/kb/reference/architecture-overview.md +24 -5
  17. package/kb/reference/cli-reference.md +1 -1
  18. package/kb/reference/dsh-compatibility.md +183 -0
  19. package/kb/reference/manifest-install.md +112 -5
  20. package/kb/reference/mcp-templates.md +11 -4
  21. package/kb/reference/plugin-pack-conventions.md +35 -18
  22. package/kb/reference/supported-tools-registry.md +30 -6
  23. package/llms-full.txt +1110 -50
  24. package/llms.txt +3 -0
  25. package/manifest.json +2 -2
  26. package/package.json +2 -2
  27. package/scripts/codex_skill_adapter.py +673 -34
  28. package/scripts/config_resolver.py +80 -14
  29. package/scripts/doctor.py +98 -20
  30. package/scripts/ecosystem_tools.json +51 -1
  31. package/scripts/generate_codex_skills.py +22 -20
  32. package/scripts/install.py +30 -13
  33. package/scripts/install_steps/ai_tools.py +97 -33
  34. package/scripts/install_steps/dsh.py +5063 -0
  35. package/scripts/install_steps/install_state.py +1645 -57
  36. package/scripts/mcp_editors.py +5 -2
  37. package/scripts/plugin.py +2495 -163
  38. package/scripts/plugin_mcp.py +279 -0
  39. package/scripts/plugin_rules.py +389 -0
  40. package/scripts/plugin_schema.py +139 -23
  41. package/scripts/uninstall.py +47 -4
  42. package/scripts/validate.py +421 -0
@@ -3,10 +3,10 @@ title: "SOP: Ecosystem Sync"
3
3
  category: procedures
4
4
  service: ai-toolkit
5
5
  tags: [sop, ecosystem, editors, generators, drift-detection, sync]
6
- version: "1.1.0"
6
+ version: "1.2.0"
7
7
  created: "2026-04-23"
8
- last_updated: "2026-07-10"
9
- description: "Quarterly (or event-triggered) sync procedure that detects documentation and capability drift in supported tools (Claude Code, Claude app, and 11 editors), analyses our generators and skills for missing features, and walks through the migration + generator-update workflow."
8
+ last_updated: "2026-08-31"
9
+ description: "Quarterly or event-triggered sync procedure for the 14 registry tools: Claude Code, Claude app, explicit-preview DSH, and 11 default editor integrations."
10
10
  ---
11
11
 
12
12
  # SOP: Ecosystem Sync
@@ -26,7 +26,7 @@ Keeps ai-toolkit aligned with the tools it integrates with. When an editor adds
26
26
  ## Quick Reference
27
27
 
28
28
  ```bash
29
- # Full check (all 13 tools, online)
29
+ # Full check (all 14 registry tools, online)
30
30
  python3 scripts/ecosystem_doctor.py --format text
31
31
 
32
32
  # Single tool
@@ -48,11 +48,13 @@ python3 scripts/ecosystem_doctor.py --offline --format text
48
48
 
49
49
  | File | Purpose |
50
50
  |------|---------|
51
- | `scripts/ecosystem_tools.json` | Authoritative registry: 13 tools with doc URLs, config paths, our generators, capability markers |
51
+ | `scripts/ecosystem_tools.json` | Authoritative registry: 14 tools with doc URLs, config paths, our generators, capability markers |
52
52
  | `benchmarks/ecosystem-doctor-snapshot.json` | Last-seen state (headings, content hash, markers, version) — updated via `--update` |
53
53
  | `scripts/ecosystem_doctor.py` | Drift detector |
54
54
  | `kb/reference/supported-tools-registry.md` | Human-readable view of the registry |
55
55
 
56
+ DSH is counted because the ecosystem doctor tracks its upstream documentation and reviewed version. It remains an explicit developer-preview target, not a default editor integration, and stays outside `--editors all` and auto-detection.
57
+
56
58
  ---
57
59
 
58
60
  ## Phase 1: Run the Doctor
@@ -313,7 +313,7 @@ python3 scripts/validate.py --strict
313
313
  ai-toolkit plugin list # show available packs
314
314
  ai-toolkit plugin install --editor claude <name> # install for Claude Code global target
315
315
  ai-toolkit plugin install --editor codex <name> # install for Codex global target
316
- ai-toolkit plugin install --editor all --all # install all 12 packs for both runtimes
316
+ ai-toolkit plugin install --editor all --all # install all available packs for all supported editors
317
317
  ai-toolkit plugin update --editor all --all # re-apply all installed packs after toolkit updates
318
318
  ai-toolkit plugin clean <name> # prune data older than 90 days
319
319
  ai-toolkit plugin clean <name> --days 30 # custom retention
@@ -2,11 +2,11 @@
2
2
  title: "SOP: Release Verification"
3
3
  category: procedures
4
4
  service: ai-toolkit
5
- tags: [sop, verification, release, smoke-test, install, update, qa, provenance, sarif]
6
- version: "1.7.0"
5
+ tags: [sop, verification, release, smoke-test, install, update, qa, provenance, sarif, dsh]
6
+ version: "1.8.0"
7
7
  created: "2026-04-08"
8
- last_updated: "2026-07-14"
9
- description: "End-to-end smoke test after installing or updating @softspark/ai-toolkit. Verifies CLI, native Codex and GitHub Copilot surfaces, Claude app export, doctor, validation, tests, eject, provenance, SARIF, and per-skill permissions."
8
+ last_updated: "2026-09-01"
9
+ description: "End-to-end smoke test after installing or updating @softspark/ai-toolkit. Verifies CLI, native Codex and GitHub Copilot surfaces, explicit DSH lifecycle, Claude app export, doctor, validation, tests, eject, provenance, SARIF, and per-skill permissions."
10
10
  ---
11
11
 
12
12
  # SOP: Release Verification
@@ -31,7 +31,7 @@ Verifies all critical paths from the user's perspective.
31
31
 
32
32
  ## Quick Checklist (TL;DR)
33
33
 
34
- 14 commands if all pass, the release is ready:
34
+ The 14 core commands below must pass. Releases that change DSH must also complete Phase 10.
35
35
 
36
36
  ```bash
37
37
  # Pre-commit (Phase 0)
@@ -444,6 +444,36 @@ app-native rules skill, bundled agents/skills, and plugin-relative Cowork hooks.
444
444
 
445
445
  ---
446
446
 
447
+ ## Phase 10: Explicit DSH Qualification (v4.30.0+)
448
+
449
+ Run this phase whenever the release changes the `dsh` target, package pins, preset lifecycle, or DSH compatibility documentation. Use a new task-specific `DSH_HOME`; never replace `HOME` or reuse a regular profile.
450
+
451
+ Prerequisites: DSH `0.1.1-rc.2`, pnpm `>=11.7.0,<12.0.0`, Codex logged in through ChatGPT, Claude Code logged in natively, and GitHub Copilot CLI logged in natively. Do not supply provider API keys.
452
+
453
+ ```bash
454
+ DSH_SMOKE_ROOT="$(mktemp -d)"
455
+ export DSH_HOME="$DSH_SMOKE_ROOT/dsh-home"
456
+
457
+ ai-toolkit dsh install --profile web
458
+ ai-toolkit dsh doctor --profile web
459
+ dsh --profile web --host 127.0.0.1 --port 0 --no-open
460
+ ```
461
+
462
+ In a new `softspark-orchestrator` session, select the `codex` provider and run two standalone marker prompts:
463
+
464
+ 1. `subagent_claude_code` returns an exact child marker, then the Codex parent returns its exact completion marker.
465
+ 2. `subagent_gemini_copilot` returns an exact child marker, then the Codex parent returns its exact completion marker.
466
+
467
+ Stop DSH, then remove only the managed profile artifacts:
468
+
469
+ ```bash
470
+ ai-toolkit dsh uninstall --profile web --yes
471
+ ```
472
+
473
+ **Verify:** both tool results have `isError=false`, both turns end as `completed`, `doctor` reports no recovery requirement before uninstall, and an unrelated preset fixture remains unchanged. Preserve only redacted event sequence evidence; never attach credentials, auth files, or full private prompts.
474
+
475
+ ---
476
+
447
477
  ## Troubleshooting
448
478
 
449
479
  ### `ai-toolkit: command not found`
@@ -3,17 +3,17 @@ title: "AI Toolkit - Architecture Overview"
3
3
  category: reference
4
4
  service: ai-toolkit
5
5
  tags: [architecture, overview, design, structure]
6
- version: "1.8.0"
6
+ version: "1.10.0"
7
7
  created: "2026-03-23"
8
- last_updated: "2026-08-19"
9
- description: "Architecture of ai-toolkit: directory layout, Claude app export, global install model, editor-aware MCP install, Codex translation layer, skill tiers, and integration with projects."
8
+ last_updated: "2026-09-01"
9
+ description: "Architecture of ai-toolkit: install ownership, runtime adapters, the explicit DSH target, skill tiers, and project integration."
10
10
  ---
11
11
 
12
12
  # AI Toolkit Architecture
13
13
 
14
14
  ## Purpose
15
15
 
16
- Shared, project-agnostic AI development toolkit for Claude Code, Claude Chat/Cowork, and compatible assistants such as Cursor, Devin, Copilot, Gemini, Cline, Roo/Zoo Code, Aider, Augment, and Google Antigravity. Provides agents, skills, lifecycle hooks, persona presets, and runtime-specific plugin packaging.
16
+ Shared, project-agnostic AI development toolkit for Claude Code, Claude Chat/Cowork, compatible assistants, and the explicit developer-preview DSH target. Provides agents, skills, lifecycle hooks, persona presets, and runtime-specific plugin packaging.
17
17
 
18
18
  ## Design Principles
19
19
 
@@ -117,6 +117,7 @@ Machine (global) Project (local)
117
117
  **`ai-toolkit install --local`** — run per project. Always installs Claude Code configs (CLAUDE.md, settings.local.json, constitution.md, language rules). Editor configs are opt-in via `--editors`:
118
118
  - `--editors all` — install all 11 editors (Cursor, Windsurf, Cline, Roo, Aider, Augment, Copilot, Antigravity, Codex, Gemini, opencode)
119
119
  - `--editors cursor,aider` — install only selected editors
120
+ - `--editors dsh` requires explicit selection. Its DSH-specific output is project `.agents/skills`; the normal `--local` Claude files, detected language rules, and generic project outputs still apply. DSH is excluded from `all`, auto-detection, and defaults.
120
121
  - (no flag) — auto-detect from existing project files; `update --local` picks up whatever editors already have configs
121
122
 
122
123
  Each editor gets its documented directory-based format. Copilot receives root
@@ -139,6 +140,10 @@ packs can layer their rules, skills, and hooks onto that Codex user target.
139
140
 
140
141
  Claude Chat/Desktop/Cowork is deliberately outside `--editors`: the app does not scan filesystem configuration under `~/.claude`. `ai-toolkit claude-app export` creates a self-contained plugin ZIP with skills, agents, Cowork hooks, app-native rules, and bundled hook dependencies. It also emits the compact text that users paste into Cowork global instructions. Updating requires re-export and re-upload because the app owns its plugin store.
141
142
 
143
+ DSH profile mutation is also outside generic installation. `ai-toolkit dsh install|update|doctor|uninstall --profile web` names both the integration and profile. It manages only `@softspark/dsh-codex@1.0.0`, `@softspark/dsh-orchestrator@1.0.1`, the released preset, and their ownership record. Vendor CLIs own login and credentials. DSH `0.1.1-rc.2` is the only reviewed host version.
144
+
145
+ Both DSH preview paths are read-only. Project `--dry-run` resolves `extends` without persisting its lockfile and changes no project or `DSH_HOME` entry. Profile lifecycle `--dry-run` changes no package, preset, state, profile, or authentication surface.
146
+
142
147
  If a project already has `.mcp.json`, local install mirrors its `mcpServers`
143
148
  entries into `.claude/settings.local.json` plus any selected editors with
144
149
  project-scoped native MCP files: `.cursor/mcp.json`, `.github/mcp.json`,
@@ -150,6 +155,10 @@ project-scoped native MCP files: `.cursor/mcp.json`, `.github/mcp.json`,
150
155
  |---------|--------|-------------|
151
156
  | `install` | `~/.claude/` | First-time: per-file symlinks + JSON merge + marker injection + rules |
152
157
  | `install --local` | `./` | Claude Code configs + editors via `--editors` (auto-detect or explicit) |
158
+ | `install --local --editors dsh` | `./` | Generic local outputs plus the shared `.agents/skills` catalog; no DSH profile writes |
159
+ | `dsh install|update --profile <name>` | `$DSH_HOME/profiles/<name>` | Exact SoftSpark package and preset lifecycle |
160
+ | `dsh doctor --profile <name>` | DSH profile and ai-toolkit state | Read-only runtime, ownership, drift, and recovery diagnostics |
161
+ | `dsh uninstall --profile <name>` | Managed DSH package, preset, and state entries | Ownership-checked removal that preserves unrelated profile content |
153
162
  | `claude-app export` | output ZIP + Markdown | Uploadable Claude Chat/Cowork plugin and global instructions |
154
163
  | `update` | `~/.claude/` | Re-apply after npm update or after add-rule/remove-rule |
155
164
  | `update --local` | `./` | Re-apply + refresh project-local configs |
@@ -246,6 +255,16 @@ translation and hook-compatibility model when targeting the global Codex layer.
246
255
 
247
256
  See `kb/reference/codex-cli-compatibility.md` for the detailed mapping.
248
257
 
258
+ ### DSH Explicit Target
259
+
260
+ The DSH target reuses the Codex `.agents/skills` emitter. Canonical skill ownership stays under `app/skills`. DSH invocation metadata is validated before emission because invalid camel-case fields, non-boolean invocation values, and nested discovery entries fail closed upstream.
261
+
262
+ The profile lifecycle is a separate transaction boundary. It stores exact package-tree and preset identity under the shared ai-toolkit state path selected by `AI_TOOLKIT_HOME`, `SOFTSPARK_HOME`, or the default `~/.softspark/ai-toolkit`. A DSH lifecycle lock plus state compare-and-swap checks protect concurrent writers. Collision or rollback ambiguity preserves user data and reports doctor-visible recovery paths.
263
+
264
+ Codex remains the parent model through its local app server. The released preset adds one-shot Claude Code and GitHub Copilot Gemini delegation tools. ai-toolkit does not handle provider API keys or login state. GitHub Copilot policy and AI credits apply to the Gemini route. Direct Google, Antigravity, and Gemini API-key routes are unsupported.
265
+
266
+ See `kb/reference/dsh-compatibility.md` for the exact command, version, authentication, and recovery contract. Real-profile Phase 3 qualification is pending.
267
+
249
268
  ## MCP Rendering Layer
250
269
 
251
270
  `.mcp.json` is the canonical project-level template format. ai-toolkit can render that configuration into editor-native MCP files through `scripts/mcp_editors.py`.
@@ -369,7 +388,7 @@ Severity levels: HIGH (blocks deployment), WARN (should fix), INFO (best practic
369
388
  ## Extension Points
370
389
 
371
390
  ### MCP Templates
372
- `app/mcp-templates/` contains 26 ready-to-use MCP server config templates. Opt-in via `ai-toolkit install --modules mcp-templates` or activated automatically with `--profile strict|full`.
391
+ `app/mcp-templates/` contains 28 ready-to-use MCP server config templates. Opt-in via `ai-toolkit install --modules mcp-templates` or activated automatically with `--profile strict|full`.
373
392
 
374
393
  ### Language Rules
375
394
  `app/rules/` provides language-specific rule files covering 13 languages (TypeScript, Python, Go, Rust, Java, Kotlin, Swift, Dart, C#, PHP, C++, Ruby, common). Auto-detected from project files via `--auto-detect` or selectable with `--modules rules-<lang>`. See README.md for current count.
@@ -47,7 +47,7 @@ Usage: ai-toolkit <command> [options]
47
47
 
48
48
  | Command | Description |
49
49
  |---------|-------------|
50
- | `mcp list` | List available MCP server templates (26 templates) |
50
+ | `mcp list` | List available MCP server templates (28 templates) |
51
51
  | `mcp editors` | List editors with native MCP config adapters and scopes |
52
52
  | `mcp add <name> [names...]` | Add MCP server template(s) to `.mcp.json` |
53
53
  | `mcp install --editor <name[,..]> [names...]` | Install templates into native editor MCP config |
@@ -0,0 +1,183 @@
1
+ ---
2
+ title: "AI Toolkit - DSH Compatibility"
3
+ category: reference
4
+ service: ai-toolkit
5
+ tags: [dsh, deepseek-harness, subscriptions, lifecycle, compatibility]
6
+ version: "1.7.0"
7
+ created: "2026-08-31"
8
+ last_updated: "2026-09-01"
9
+ description: "Compatibility contract for project skills and the explicit SoftSpark package lifecycle in DeepSeek Harness."
10
+ ---
11
+
12
+ # DSH Compatibility
13
+
14
+ ## Summary
15
+
16
+ ai-toolkit supports DeepSeek Harness as an explicit developer-preview target. The integration is maintained by SoftSpark as a community compatibility layer. DeepSeek AI has not endorsed it.
17
+
18
+ The reviewed runtime is DSH `0.1.1-rc.2`. Newer upstream prereleases are not covered until they pass the same qualification. Isolated pre-tag and exact-registry post-release profiles completed the Claude Code and Copilot Gemini marker roundtrips through a Codex parent on 2026-09-01.
19
+
20
+ ## Project vs Profile Outputs
21
+
22
+ | Surface | Command | Managed output | Explicit non-output |
23
+ |---|---|---|---|
24
+ | Project install | `ai-toolkit install --local --editors dsh` | `CLAUDE.md`, `.claude/settings.local.json`, `.claude/constitution.md`, detected language rules, other generic local outputs, and the DSH-specific one-level `.agents/skills/<name>/SKILL.md` catalog with bundled resources | No `$DSH_HOME` writes, npm package changes, profile changes, preset changes, or credential reads |
25
+ | DSH profile | `ai-toolkit dsh install --profile web` | Two exact npm dependencies in the named profile, the released `softspark-orchestrator` preset, and ai-toolkit ownership state | No project files, provider login, API keys, unrelated plugins, or user presets |
26
+
27
+ DSH is excluded from `--editors all`, auto-detection, default profiles, and default editor selection. Naming `dsh` without `--local` is not a supported project install route.
28
+
29
+ Project `--dry-run` resolves and validates `extends`, then plans the generic local outputs and `.agents/skills` catalog without creating, changing, or deleting a project entry. It does not create or update `.softspark-toolkit.lock.json`, and it does not mutate `DSH_HOME`, packages, profiles, state, or authentication.
30
+
31
+ ## Local and Global Commands
32
+
33
+ ```bash
34
+ # Generic local outputs plus DSH-specific project skills
35
+ ai-toolkit install --local --editors dsh
36
+
37
+ # Read-only project preview
38
+ ai-toolkit install --local --editors dsh --dry-run
39
+
40
+ # Explicit machine profile lifecycle
41
+ ai-toolkit dsh install --profile web
42
+ ai-toolkit dsh update --profile web
43
+ ai-toolkit dsh doctor --profile web
44
+ ai-toolkit dsh uninstall --profile web --yes
45
+ ```
46
+
47
+ The DSH profile defaults to `web` when `--profile` is omitted. `DSH_HOME` selects the DSH root and defaults to `~/.dsh`. Profile mutation is never an implicit side effect of local installation, global installation, update, or generic uninstall.
48
+
49
+ ## Exact Pins
50
+
51
+ | Component | Reviewed version | Role |
52
+ |---|---:|---|
53
+ | DeepSeek Harness | `0.1.1-rc.2` | Profile host and plugin manager |
54
+ | pnpm | `>=11.7.0,<12.0.0` | Package manager used by the DSH plugin command |
55
+ | `@softspark/dsh-codex` | `1.0.0` | Codex parent provider through local `codex app-server` |
56
+ | `@softspark/dsh-orchestrator` | `1.0.1` | Claude Code and GitHub Copilot Gemini delegation bundle plus released preset |
57
+
58
+ Install and update use exact package arguments with `--save-exact`. Arbitrary DSH prereleases and unpinned SoftSpark packages are outside this contract.
59
+
60
+ The reviewed DSH tag declares `pnpm@11.7.0`. The isolated cold-install environment used Corepack pnpm `11.24.0`, so the lifecycle accepts stable pnpm releases from `11.7.0` through the end of major 11. Before it creates the lifecycle lock or changes a profile, it resolves exact DSH and pnpm command paths from the minimal child `PATH`, records their command and resolved-file identities, and runs their version probes with a five-second bound. Missing, nonzero, timed-out, malformed, or unsupported pnpm probes fail with no package, preset, state, or lifecycle artifact.
61
+
62
+ ## Subscription and Authentication Boundaries
63
+
64
+ ai-toolkit does not log in to a model provider, accept a provider API key, read a vendor credential store, copy tokens, or add credentials to state. Each vendor CLI owns authentication:
65
+
66
+ | Route | Login owner | Subscription or billing boundary |
67
+ |---|---|---|
68
+ | Codex parent | `codex login` and `codex login status` | ChatGPT subscription managed by Codex |
69
+ | Claude delegate | `claude auth login` | Claude Max or Pro managed by Claude Code |
70
+ | Gemini delegate | `copilot login` | Active GitHub Copilot plan and GitHub AI credits |
71
+
72
+ Lifecycle subprocesses receive only `HOME`, the validated `DSH_HOME`, `PATH`, and locale or temporary-directory settings when present. Provider and registry secret environment variables are not forwarded. Vendor CLI output is not copied into lifecycle error messages.
73
+
74
+ ## DSH, Codex, Claude, and Copilot Topology
75
+
76
+ ```text
77
+ DSH session using SoftSpark Orchestrator
78
+ |
79
+ +-> @softspark/dsh-codex
80
+ | -> local codex app-server
81
+ | -> Codex-owned ChatGPT authentication and parent thread
82
+ |
83
+ +-> subagent_claude_code
84
+ | -> DSH Claude Code provider
85
+ | -> Claude Code native login
86
+ |
87
+ +-> subagent_gemini_copilot
88
+ -> GitHub Copilot CLI ACP server
89
+ -> Gemini 3.6 Flash under GitHub policy and AI credits
90
+ ```
91
+
92
+ Codex is the parent provider. The preset keeps the optional Codex subagent row disabled. Claude Code and Copilot Gemini receive bounded standalone delegation tasks.
93
+
94
+ ## Invocation Metadata and Shared Skill Ownership
95
+
96
+ DSH and Codex share the project `.agents/skills` output. `app/skills/<name>/` remains canonical. `scripts/generate_codex_skills.py` emits native links or adapted wrappers, so ai-toolkit does not maintain a second DSH-specific skill catalog.
97
+
98
+ DSH discovers one-level `<name>/SKILL.md` bundles and flat `<name>.md` entries. Names must use lowercase kebab-case. The required fields are `name` and `description`. Optional invocation fields use `user-invocable` and `disable-model-invocation` with boolean values. Camel-case spellings or invalid boolean values fail closed and remove the skill from discovery. Nested `SKILL.md` entries are not supported, but resources inside a valid bundle remain available.
99
+
100
+ The preset owns the session composition and external delegation tools. It does not copy the 44 ai-toolkit agent definitions into 44 DSH presets or subagents.
101
+
102
+ ## Lifecycle State and Recovery
103
+
104
+ State resolves in this order:
105
+
106
+ 1. `$AI_TOOLKIT_HOME/state.json` when `AI_TOOLKIT_HOME` is set.
107
+ 2. `$SOFTSPARK_HOME/ai-toolkit/state.json` when `SOFTSPARK_HOME` is set.
108
+ 3. `~/.softspark/ai-toolkit/state.json` by default.
109
+
110
+ The DSH record stores the canonical DSH home, profile, exact package versions, package-tree identity, preset path, preset hash, ownership flags, and timestamps. It stores no package contents, prompts, credentials, authentication paths, or child-process environment.
111
+
112
+ The published npm packages own their installed code. The canonical preset source is `@softspark/dsh-orchestrator/agent-presets/softspark-orchestrator` inside the exact installed package. ai-toolkit copies and verifies that tree. It does not reconstruct the preset.
113
+
114
+ Mutations first take a nonblocking exclusive POSIX `flock` on the already pinned `DSH_HOME` directory descriptor, then claim the bounded canonical lifecycle lock and use the shared state lock with compare-and-swap publication. Directory locking is independent of the replaceable lock filename. It remains held across sentinel scans, package and preset mutation, normal canonical-lock release, or recovery-sentinel creation plus file and directory `fsync`. A competing lifecycle must acquire the same directory lock before it can scan recovery state or claim the canonical name. The immutable prerequisite record is revalidated after lock acquisition and before every package mutation or package rollback. A replaced or removed executable, or a new earlier `pnpm` PATH shadow, blocks the command. The verified pnpm command directory is placed first in the child PATH so DSH's literal `pnpm` lookup resolves to the probed command. Install, update, and uninstall verify the profile manifest, package trees, preset identity, and unrelated dependencies before and after each external package-manager command. Rollback restores the immutable pre-operation target. It does not reinterpret concurrent bytes as owned data.
115
+
116
+ Each DSH plugin add, update, remove, or rollback command has a 300-second process bound, separate from the short prerequisite probe. This bound accommodates cold package resolution without promising registry or network latency. Every mutation starts DSH in a dedicated POSIX session and process group. A timeout or interruption signals the complete group, escalates from `SIGTERM` to `SIGKILL` when needed, and waits for confirmed group exit before rollback. If exit cannot be confirmed, package rollback is blocked and deterministic inspection steps are reported. Child stdout and stderr remain suppressed from user-facing errors.
117
+
118
+ Process-group signals are allowed only while the unreaped DSH supervisor still binds its PID to that group. If the supervisor identity is lost before escalation, the lifecycle fails closed instead of signaling a group identifier that the operating system could reuse. Before `Popen`, the calling thread blocks `SIGINT` with `pthread_sigmask`. It restores the previous mask only inside a catchable region that covers `communicate`, final PGID inspection, and command postconditions, then restores the mask again in `finally`. Any `BaseException` after spawn runs full process-tree teardown before propagation. Repeated `SIGINT` cannot escape the bounded TERM, KILL, and wait sequence.
119
+
120
+ An unconfirmed process-tree exit first verifies that `$DSH_HOME/.ai-toolkit-lifecycle.lock` still names the held inode, then creates and syncs a transaction-unique process-tree recovery sentinel. It rewrites the canonical lock as a recovery gate only while that identity remains exact. A removed or renamed lock leaves the sentinel as the gate; a foreign replacement is neither overwritten nor deleted. Install, update, and uninstall scan these sentinels before and after claiming the canonical lock, so recovery blocks DSH invocation even when the original lock name was displaced. `doctor` reports every gate's process-group identifier, original profile path, and exact artifact path. ai-toolkit never clears these gates automatically: the operator must verify that the recorded process group has exited, inspect the profile, and only then remove every named recovery artifact.
121
+
122
+ An identity conflict preserves the conflicting path and creates a doctor-visible recovery marker instead of deleting or replacing it. User plugins, dependencies, presets, profile patches, and unrelated state keys remain outside ai-toolkit ownership. Secure mutation and process-tree termination require POSIX primitives available on Linux, WSL, and macOS. Native Windows mutation is unsupported and fails before the lifecycle lock.
123
+
124
+ Profile lifecycle `--dry-run` is read-only. It runs the bounded DSH and pnpm prerequisite probes, but it does not create state, acquire a lock, invoke the plugin manager, or create profile paths. It can therefore report a missing or unsupported prerequisite without leaving lifecycle output.
125
+
126
+ ## Unsupported Google, Antigravity, and API-Key Routes
127
+
128
+ This integration does not provide direct Google AI Pro or Ultra login, Gemini CLI OAuth, Antigravity login, Gemini API keys, DeepSeek API keys, Anthropic API keys, or OpenAI API keys. Gemini is available only through the GitHub Copilot CLI ACP route described above.
129
+
130
+ The first native target also excludes DSH hook bridging, MCP bridging, arbitrary preset import, automatic profile selection, and full ai-toolkit agent mapping. Generic `ai-toolkit uninstall` does not mutate DSH profiles.
131
+
132
+ ## Behavioral Limits
133
+
134
+ - Claude Code and Copilot delegation are one-shot child tasks. Each child receives the task and workspace directory, not the parent conversation history.
135
+ - Copilot runs with no available tools, rejects permission requests, disables built-in MCP servers, remote control, custom instructions, and auto-update, and uses a 30-credit session cap.
136
+ - Child effects completed before cancellation are not rolled back.
137
+ - Workspace content selected by a vendor CLI may leave the machine under that vendor's product terms and account policy.
138
+ - Codex owns its built-in tools, sandbox, approval policy, thread state, and model execution. ai-toolkit does not reproduce those controls inside DSH.
139
+ - Existing DSH sessions keep the preset generation with which they started. Restart DSH and open a new session after install or update.
140
+
141
+ ## Uninstall, Update, and Doctor
142
+
143
+ `ai-toolkit dsh update` changes only a recorded profile whose managed package and preset identities match state. It installs the current reviewed pins, then publishes the new state after all postconditions pass.
144
+
145
+ `ai-toolkit dsh doctor` is read-only. It reports the DSH runtime version, pnpm availability and version, package pins, package-tree and preset ownership, state consistency, lifecycle lock recovery artifacts, staging paths, and recovery markers. A recovery marker keeps `Recovery needed: yes` visible until the operator resolves the named paths.
146
+
147
+ `ai-toolkit dsh uninstall --yes` removes only the recorded SoftSpark packages, preset, and profile state. Drift or ownership ambiguity stops removal. Unrelated profile dependencies, patch files, presets, and state keys remain unchanged.
148
+
149
+ ## Verification
150
+
151
+ Run the static and isolated checks without modifying a regular DSH profile:
152
+
153
+ ```bash
154
+ bats tests/test_ecosystem_doctor.bats
155
+ bats tests/test_dsh.bats
156
+ python3 scripts/ecosystem_doctor.py --tool dsh --offline --format text
157
+ python3 scripts/validate.py --strict
158
+
159
+ ai-toolkit install --local --editors dsh --dry-run
160
+ ai-toolkit dsh install --profile web --dry-run
161
+ ai-toolkit dsh update --profile web --dry-run
162
+ ai-toolkit dsh doctor --profile web
163
+ ai-toolkit dsh uninstall --profile web --dry-run --yes
164
+ ```
165
+
166
+ Phase 3 real-profile qualification completed with a task-specific `DSH_HOME`, exact published package artifacts, and native vendor logins. The pre-tag candidate and exact npm registry package both produced successful child and parent markers through `subagent_claude_code` and `subagent_gemini_copilot`; no provider API key was supplied or handled. The isolated DSH processes stopped cleanly and the unrelated profile fixture remained intact.
167
+
168
+ ## Preview and Upstream Drift
169
+
170
+ DeepSeek Harness describes itself as a developer preview with compatibility-breaking changes. The upstream release feed published `0.1.2-alpha.2` after the reviewed `0.1.1-rc.2` line. ai-toolkit does not adopt that prerelease by inference.
171
+
172
+ Use the registry doctor to detect documentation, capability-marker, and local version changes. A new upstream version requires source review, focused fixture updates, isolated real-profile qualification, and explicit pin changes before support moves.
173
+
174
+ ## Sources
175
+
176
+ - [DeepSeek Harness documentation](https://deepseek-harness.github.io/deepseek-harness/)
177
+ - [DeepSeek Harness releases](https://github.com/deepseek-ai/deepseek-harness/releases)
178
+ - [Reviewed DSH 0.1.1-rc.2 release](https://github.com/deepseek-ai/deepseek-harness/releases/tag/dsh-v0.1.1-rc.2)
179
+ - [Reviewed DSH package-manager declaration](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.1.1-rc.2/package.json)
180
+ - [Reviewed DSH CLI profile and plugin contract](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.1.1-rc.2/apps/cli/reference/README.md)
181
+ - [Reviewed DSH skill discovery contract](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.1.1-rc.2/docs/subsystems/skills.md)
182
+ - [PATH: kb/reference/manifest-install.md]
183
+ - [PATH: kb/history/completed/dsh-native-install-target-plan.md]
@@ -2,11 +2,11 @@
2
2
  title: "Manifest-Driven Install System"
3
3
  category: reference
4
4
  service: ai-toolkit
5
- tags: [install, manifest, modules, profiles, auto-detect, state-tracking]
6
- version: "1.0.0"
5
+ tags: [install, manifest, modules, profiles, auto-detect, state-tracking, dsh]
6
+ version: "1.16.0"
7
7
  created: "2026-04-07"
8
- last_updated: "2026-04-07"
9
- description: "Reference for the manifest-driven install system: 17 modules, 4 profiles, auto-detection, and state tracking in ~/.softspark/ai-toolkit/state.json."
8
+ last_updated: "2026-09-01"
9
+ description: "Reference for manifest-driven project installation, explicit DSH profile lifecycle management, and ownership state in ~/.softspark/ai-toolkit/state.json."
10
10
  ---
11
11
 
12
12
  # Manifest-Driven Install System
@@ -39,7 +39,7 @@ Modules are defined in `manifest.json` at the repository root. There are 17 modu
39
39
  | `rules-php` | PHP-specific rules (5 files) | auto-detect |
40
40
  | `rules-cpp` | C++-specific rules (5 files) | auto-detect |
41
41
  | `rules-ruby` | Ruby-specific rules (5 files) | auto-detect |
42
- | `mcp-templates` | 26 MCP server config templates | strict, full |
42
+ | `mcp-templates` | 28 MCP server config templates | strict, full |
43
43
 
44
44
  ## Profiles
45
45
 
@@ -119,6 +119,64 @@ ai-toolkit status
119
119
 
120
120
  Re-applies installed modules, skipping files whose content hash has not changed since last install. Implemented in `scripts/install_steps/install_state.py`.
121
121
 
122
+ ## Explicit DSH Profile Lifecycle
123
+
124
+ The DSH project target and the DSH profile lifecycle are separate operations:
125
+
126
+ ```bash
127
+ # Generic local outputs plus DSH-specific project skills. No DSH profile change.
128
+ ai-toolkit install --local --editors dsh
129
+
130
+ # Read-only project plan, including extends resolution.
131
+ ai-toolkit install --local --editors dsh --dry-run
132
+
133
+ # Explicit global DSH profile mutation. The default profile is web.
134
+ ai-toolkit dsh install --profile web
135
+ ai-toolkit dsh update --profile web
136
+ ai-toolkit dsh doctor --profile web
137
+ ai-toolkit dsh uninstall --profile web --yes
138
+ ```
139
+
140
+ The project command is explicit-only. DSH is excluded from `--editors all`, auto-detection, default profiles, and default editor selection. Its DSH-specific output is `.agents/skills`; the generic `--local` Claude files, detected language rules, and other project outputs still apply. It never writes below `DSH_HOME`.
141
+
142
+ Project `--dry-run` resolves and validates `extends` without persisting `.softspark-toolkit.lock.json`, then plans every generic and DSH-specific project output without changing the project tree. Existing lock bytes and metadata remain unchanged. It also makes no DSH package, profile, state, or authentication change.
143
+
144
+ `DSH_HOME` selects the DSH root. The default is `~/.dsh`. It must resolve to an absolute, non-symlink managed root. Profile identifiers accept 1 to 64 lowercase letters, digits, periods, underscores, or hyphens.
145
+
146
+ The lifecycle supports DSH `0.1.1-rc.2`, stable pnpm `>=11.7.0,<12.0.0`, `@softspark/dsh-codex@1.0.0`, and `@softspark/dsh-orchestrator@1.0.1`. The DSH tag declares `pnpm@11.7.0`, while isolated cold-install qualification used Corepack pnpm `11.24.0`. It invokes the plugin manager with bounded argv-array subprocesses:
147
+
148
+ ```text
149
+ dsh plugin --profile web add @softspark/dsh-codex@1.0.0 --save-exact
150
+ dsh plugin --profile web add @softspark/dsh-orchestrator@1.0.1 --save-exact
151
+ ```
152
+
153
+ The orchestrator preset is copied from the installed package:
154
+
155
+ ```text
156
+ $DSH_HOME/profiles/web/node_modules/@softspark/dsh-orchestrator/agent-presets/softspark-orchestrator
157
+ -> $DSH_HOME/.agent-presets/softspark-orchestrator
158
+ ```
159
+
160
+ The lifecycle refuses unowned same-name plugins and presets. An unchanged owned install is idempotent. Update and uninstall require every recorded package-tree entry and the preset tree to match current bytes, types, paths, links, and POSIX modes. Generic `ai-toolkit uninstall` does not mutate DSH profiles or remove their ownership state. Use `ai-toolkit dsh uninstall` explicitly.
161
+
162
+ The persisted `packages` map is the ownership baseline, not the desired version target. Its key set must contain exactly the two managed package names, each value must be an exact version, and its keys must match the stored package-tree inventories. After a reviewed pin bump, `update` verifies the on-disk manifest and trees against those recorded versions, installs the current reviewed pins, and replaces the state record only after all postconditions pass. `uninstall` verifies and removes the recorded owned package names even when the current reviewed pins are newer. Rollback always restores the exact versions captured before the operation.
163
+
164
+ A zero exit status from DSH is not sufficient to commit a lifecycle operation. Immediately before and after every plugin add or remove, ai-toolkit rereads the profile manifest and the complete managed package trees under the lifecycle lock. A changed, malformed, unexpected, or newly introduced managed entry stops the next external mutation and preserves the concurrent bytes. The managed packages must have the exact recorded pins or be fully absent for uninstall. Dependency entries outside the two managed package names must remain unchanged. A false-success postcondition leaves ownership state uncommitted.
165
+
166
+ Each stored package inventory uses a domain-separated SHA-256 over stable, length-prefixed records. A record contains the entry type, relative path, POSIX mode, and type-specific metadata. Regular-file metadata contains the byte length and per-file SHA-256. Symlink metadata contains the target text. Traversal is bounded to 100,000 entries and 128 levels, never follows symlinks, and rejects special files. The state stores hashes and metadata only. It stores no package contents, credentials, authentication paths, or child-process environment.
167
+
168
+ Rollback gives every package-manager recovery command an explicit target derived from the immutable pre-operation snapshot. The target contains the managed package inventory, the exact target package tree, the unchanged non-target package trees, and the pre-operation unrelated dependencies. A successful child exit is accepted only when all four match. A post-command observation is evidence, never a new target. Target drift or unreadable state blocks every later package-manager recovery call, preserves the current bytes, creates a transaction-unique doctor-visible recovery marker, and prints `ai-toolkit dsh doctor --profile <name>` plus deterministic manual inspection paths. This rule applies to install, update, and uninstall rollback.
169
+
170
+ Before the first mutation, the lifecycle resolves exact DSH and pnpm command paths from the minimal child `PATH`. It records each command path, resolved path, device, inode, type, mode, size, timestamps, and symlink target when applicable. It runs both version probes with a five-second bound and requires pnpm to parse inside the supported range. Missing, nonzero, timed-out, malformed, or unsupported pnpm probes fail before the lifecycle lock and leave no package, preset, state, or lock artifact.
171
+
172
+ Profile lifecycle `--dry-run` performs read-only runtime, package-manager, and ownership preflight. It prints the exact planned argv and paths. It does not acquire a lifecycle or state lock, create a directory, write state, or start a package-manager mutation. Mutating install, update, and uninstall operations first acquire a nonblocking exclusive POSIX `flock` on the pinned `DSH_HOME` directory descriptor, then hold `$DSH_HOME/.ai-toolkit-lifecycle.lock` from preflight through mutation, rollback, cleanup, and recovery. The directory lock is independent of that replaceable filename. It remains held while a recovery sentinel is created with `O_EXCL` and while both its file and parent directory are synced; release occurs only after normal canonical-lock release or durable sentinel publication. Every competing lifecycle must acquire the same directory lock before sentinel scans and canonical claim. Lock acquisition pins the exact lexical `DSH_HOME` parent and root directory descriptors and passes that one resolved home through the full operation. The prerequisite record is revalidated after the lock and before every package mutation or rollback. Replacement, removal, in-place identity drift, and a new earlier PATH shadow fail closed. The verified pnpm command directory leads the child PATH. Every internal mutation and each external DSH command verifies that the lexical path still names the pinned device, inode, and directory kind. Preset parents, staging trees, recovery containers, copied children, and recovery markers are opened by walking from that root descriptor with no-follow operations. Creation, copy, cleanup, and recovery use descriptor-relative system calls and retain the parent and child device and inode identities through postcondition checks. A mismatch blocks state success and later package commands, preserves both roots, and reports recovery. The child process receives only the verified canonical path. The canonical lock is claimed as a regular non-symlink with exclusive descriptor-relative creation and waits for at most one second. A write, `fsync`, close, or interruption during lock initialization removes only the captured lock inode. If that cleanup cannot complete, the command reports a doctor-visible lock recovery artifact and the next lifecycle command remains fail-closed. Release uses the pinned root descriptor, atomically relocates the lock without replacement, and deletes it only after its device and inode still match the transaction. A displaced root never redirects lock cleanup into its replacement. `doctor` is read-only and does not acquire the lifecycle lock.
173
+
174
+ If process-tree termination cannot be confirmed, the lifecycle does not enter package rollback or normal lock release. Before writing recovery metadata it verifies that the canonical lock still names the held device and inode, then creates and syncs a transaction-unique `unconfirmed-process-tree` sentinel in the pinned DSH root. It rewrites the held inode only after a second canonical identity check. A removed or renamed canonical lock therefore leaves the recognized sentinel, while a foreign replacement remains byte-identical. Lock acquisition checks process-tree sentinels before and after claiming the canonical name, and every later install, update, or uninstall fails before DSH invocation. `doctor` prints the recorded process group, original profile path, and every exact gate file. Recovery is deliberately manual: verify that the process group has exited, inspect the preserved profile, and only then remove every named gate. Group signaling is permitted only while the unreaped DSH supervisor still binds the group identifier; after that identity is lost, the command preserves the gate rather than risk signaling a reused PGID. Repeated `SIGINT` is deferred or retried through the bounded TERM, KILL, and wait sequence.
175
+
176
+ Doctor reports runtime compatibility, pnpm availability and version, installed package versions, complete package-tree ownership, preset ownership and hash drift, state consistency, legacy recovery collisions, transaction-unique recovery containers, preserved staging, and whether recovery is required.
177
+
178
+ The lifecycle never runs login commands, reads vendor credential stores, accepts provider API keys, or forwards provider and registry secret environment variables. Codex, Claude Code, and GitHub Copilot own login state. GitHub AI credits apply to Copilot Gemini delegation. Direct Google AI Pro or Ultra, Gemini CLI OAuth, Antigravity, and Gemini API-key routes are unsupported. Prerequisite probes have a five-second bound. DSH plugin mutations and package rollback commands have a separate 300-second bound suitable for cold resolution, without promising registry or network latency. Each mutation uses a dedicated POSIX session and process group on Linux, WSL, or macOS. The calling thread blocks `SIGINT` with `pthread_sigmask` before `Popen`, restores its previous mask inside one catchable region covering communication and final PGID checks, and restores the mask in `finally`. Every `BaseException` after spawn triggers complete process-tree teardown before propagation. Timeout and interruption require confirmed group exit before rollback; an unconfirmed exit blocks rollback. POSIX directory `flock`, process groups, and thread signal masks are mandatory mutation primitives. Native Windows mutation is unsupported and fails before lifecycle writes. Failed child-process stdout and stderr are never included in user-facing errors. Errors expose only the safe command outcome, such as exit status, timeout, or interruption. Recovery argv contains only the validated DSH executable, profile, fixed package names, and exact pinned versions.
179
+
122
180
  ## State Tracking
123
181
 
124
182
  Installed module state is persisted to `~/.softspark/ai-toolkit/state.json`:
@@ -131,14 +189,61 @@ Installed module state is persisted to `~/.softspark/ai-toolkit/state.json`:
131
189
  "last_updated": "2026-04-07T10:00:00Z",
132
190
  "file_hashes": {
133
191
  "app/hooks/session-start.sh": "abc123..."
192
+ },
193
+ "dsh": {
194
+ "profiles": {
195
+ "web": {
196
+ "dsh_home": "/Users/example/.dsh",
197
+ "profile": "web",
198
+ "packages": {
199
+ "@softspark/dsh-codex": "1.0.0",
200
+ "@softspark/dsh-orchestrator": "1.0.1"
201
+ },
202
+ "package_trees": {
203
+ "@softspark/dsh-codex": {
204
+ "digest": "<canonical-tree-sha256>",
205
+ "entries": [
206
+ {"type": "directory", "path": ".", "mode": 493},
207
+ {"type": "file", "path": "package.json", "mode": 420, "size": 53, "sha256": "<file-sha256>"}
208
+ ]
209
+ },
210
+ "@softspark/dsh-orchestrator": {
211
+ "digest": "<canonical-tree-sha256>",
212
+ "entries": [
213
+ {"type": "directory", "path": ".", "mode": 493}
214
+ ]
215
+ }
216
+ },
217
+ "preset_path": "/Users/example/.dsh/.agent-presets/softspark-orchestrator",
218
+ "preset_hash": "<sha256>",
219
+ "owned": true,
220
+ "installed_at": "2026-08-29T08:00:00Z",
221
+ "last_updated": "2026-08-29T08:00:00Z"
222
+ }
223
+ }
134
224
  }
135
225
  }
136
226
  ```
137
227
 
138
228
  - `installed_modules` — used by `update` to know which modules to re-apply
139
229
  - `file_hashes` — used to skip unchanged files during `update`
230
+ - `dsh.profiles` records the DSH home, profile, exact package versions, canonical package-tree inventories, preset path and hash, ownership, and timestamps
140
231
  - The file is written after every successful install or update
141
232
 
233
+ Every shared state writer uses the canonical path from `AI_TOOLKIT_HOME`, `SOFTSPARK_HOME`, or the default `~/.softspark/ai-toolkit/state.json` and cooperates through the same bounded `.state.lock`. Where the host provides descriptor-relative atomic primitives, the lock context pins the state parent device and inode. Transaction reads, snapshots, compare-and-swap merges, private temporary creation, writes, `fsync`, publication, mode changes, cleanup, and lock release then address entries relative to that same open parent descriptor. A DSH lifecycle snapshot also records this parent identity and requires the final install, update, uninstall, and rollback state transaction to reopen that exact lexical path and match the same device and inode. The lexical parent binding is checked before publication and release. Replacing the state directory therefore fails without publishing into the replacement or losing either root. Generic install, MCP, and editor state writers retain the portable state contract on every supported Python platform. They use this pinned atomic publisher when available and otherwise publish a private temporary with the platform's atomic replacement primitive while holding the shared lock.
234
+
235
+ DSH ownership mutation has a stricter platform gate. It requires Linux, WSL, or macOS support for pinned-directory, no-follow, no-replace, and atomic-exchange operations. The lifecycle checks both its DSH filesystem primitives and the state publisher before it creates the state root, state lock, lifecycle lock, temporary, or profile artifact. Secure state lock creation addresses `.state.lock` relative to a pinned no-follow parent descriptor and keeps that descriptor open through release. DSH state publication uses an atomic exchange for an existing file or a no-replace rename for first creation. The writer validates the displaced device, inode, and content digest before cleanup. A mismatched inode is restored or preserved for manual recovery instead of being overwritten or deleted. A bounded retry merges unrelated concurrent state keys. A concurrent change to the same DSH profile is preserved and reported as a recovery conflict.
236
+
237
+ Records created before package-tree inventories were introduced are intentionally not migrated by assumption. `doctor` reports the invalid ownership state. Reinstall the explicit DSH integration after inspecting or removing the old record. Update and uninstall never claim unknown package bytes as owned.
238
+
239
+ DSH mutations snapshot the profile manifest, managed package trees, base-directory existence, prior state, and preset before the first external mutation. Interruption and cleanup failure run the same rollback as package failure. Cleanup uses an entry-level inventory of device, inode, kind, digest, and symlink target. Snapshot recreation walks every ancestor without following symlinks, pins the destination parent, and uses descriptor-relative no-clobber creation for files, directories, and symlinks. File and directory modes are restored with `fchmod` only after pinning the exact inode. Post-creation and post-mode checks bind type, inode, mode, digest, and link target to the pinned parent. Unsupported primitives fail before any write, and an inode or ancestor mismatch remains untouched and doctor-visible. Manifest removal, manifest restoration, and transaction-created profile-directory pruning first relocate the candidate without replacement through pinned parent descriptors, then validate the moved inode and content before cleanup. A mismatch remains at its concurrent path or in a reported recovery container. Cleanup never unlinks, replaces, or removes a concurrently substituted file, symlink, or directory. A transaction-created `.agent-presets` parent is removed only when its identity is unchanged and it remains empty.
240
+
241
+ Update and uninstall revalidate the owned preset identity and content immediately before relocation. The transaction atomically claims a private mode-0700 recovery container with a cryptographically random suffix, then moves the preset to its previously absent `managed-preset` child. It never replaces a caller-provided recovery path. The relocated payload remains bound to the captured device, inode, kind, digest, and symlink target; that same identity is checked immediately and again before every restore or removal. A byte-identical replacement is therefore preserved and reported instead of being treated as transaction-owned. Managed dependency entries must contain exact semantic versions; malformed or non-string values fail before DSH is invoked. A clean-profile rollback removes transaction-created manifest and base directories when they remain unchanged. Existing profile manifests are restored byte-for-byte, and missing pre-existing package entries are recreated without overwriting collisions.
242
+
243
+ If byte-identical rollback cannot finish, the command returns nonzero and prints every exact safely quoted residual path plus deterministic recovery steps. One failed package recovery command does not authorize the next package command: the loop immediately rechecks the rollback-blocked flag and complete package identity after success or failure, records doctor and inspection actions, and stops package mutation on drift. Independent preset cleanup and state restoration still run, so their failures are aggregated without replacing the original error. Every surviving staging or recovery path remains listed and doctor-visible, so no operation reports success while its owned recovery data survives. Update staging cleanup removes only transaction-owned entries and reports every surviving staging path, including concurrent additions. Package-filesystem and cleanup residuals create transaction-unique `.softspark-orchestrator.ai-toolkit-package.<token>` containers. `ai-toolkit dsh doctor --profile <name>` reports `Recovery needed: yes` until manual recovery is complete.
244
+
245
+ Real-profile qualification with the published packages and native subscription logins remains pending Phase 3. Static, fixture, and dry-run success is not evidence that this qualification has completed.
246
+
142
247
  ## Implementation Files
143
248
 
144
249
  | File | Purpose |
@@ -146,6 +251,7 @@ Installed module state is persisted to `~/.softspark/ai-toolkit/state.json`:
146
251
  | `manifest.json` | Module and profile definitions |
147
252
  | `scripts/install_steps/detect_language.py` | Auto-detect project language from marker files |
148
253
  | `scripts/install_steps/install_state.py` | Read/write `~/.softspark/ai-toolkit/state.json` |
254
+ | `scripts/install_steps/dsh.py` | Explicit DSH install, update, doctor, uninstall, and recovery lifecycle |
149
255
 
150
256
  ## Backward Compatibility
151
257
 
@@ -163,3 +269,4 @@ No existing install scripts or CI configurations need changes.
163
269
  - [PATH: kb/reference/language-rules.md] — language rules structure and auto-detection detail
164
270
  - [PATH: kb/reference/mcp-templates.md] — MCP server templates (the `mcp-templates` module)
165
271
  - [PATH: kb/reference/architecture-overview.md] — overall install model
272
+ - [PATH: kb/reference/dsh-compatibility.md] - DSH commands, topology, authentication, and preview limits
@@ -3,17 +3,17 @@ title: "MCP Server Templates"
3
3
  category: reference
4
4
  service: ai-toolkit
5
5
  tags: [mcp, templates, servers, configuration, editors, inject-mcp, external-templates]
6
- version: "1.5.0"
6
+ version: "1.6.0"
7
7
  created: "2026-04-07"
8
- last_updated: "2026-08-21"
9
- description: "Reference for 26 built-in MCP server templates, external template injection via inject-mcp, and native editor MCP installation support."
8
+ last_updated: "2026-08-31"
9
+ description: "Reference for 28 built-in MCP server templates, external template injection via inject-mcp, and native editor MCP installation support."
10
10
  ---
11
11
 
12
12
  # MCP Server Templates
13
13
 
14
14
  ## Overview
15
15
 
16
- ai-toolkit ships 26 ready-to-use MCP server configuration templates in `app/mcp-templates/`. Each template is a JSON file that defines the canonical `mcpServers` block for a specific service. Templates can be merged into the project's `.mcp.json` and rendered into editor-native MCP config files via the `ai-toolkit mcp` CLI subcommand.
16
+ ai-toolkit ships 28 ready-to-use MCP server configuration templates in `app/mcp-templates/`. Each template is a JSON file that defines the canonical `mcpServers` block for a specific service. Templates can be merged into the project's `.mcp.json` and rendered into editor-native MCP config files via the `ai-toolkit mcp` CLI subcommand.
17
17
 
18
18
  **External templates:** Tools outside the toolkit (MCP servers, plugins, custom integrations) can register their own MCP templates via `ai-toolkit inject-mcp <file|url>` -- the toolkit caches the template, tags every server with a `_source` field, and propagates the config to every editor that exposes a `global_path`. URL-sourced templates are auto-refreshed on every `ai-toolkit update`. See [PATH: kb/reference/extension-api.md] for the inject-mcp / remove-mcp reference.
19
19
 
@@ -79,6 +79,7 @@ loads `.codex/config.toml` only for trusted project layers.
79
79
  | `filesystem` | Local filesystem access for reading, writing, and searching files | — |
80
80
  | `git` | Git repository inspection: diffs, logs, branches | — |
81
81
  | `github` | GitHub API: issues, PRs, repos, code search | `GITHUB_PERSONAL_ACCESS_TOKEN` |
82
+ | `jira` | Jira multi-instance routing, ADF, caching, and comment templates | — |
82
83
  | `google-drive` | Google Drive file search, reading, and management | `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET`, `GOOGLE_REDIRECT_URI` |
83
84
  | `google-maps` | Google Maps geocoding, directions, place search | `GOOGLE_MAPS_API_KEY` |
84
85
  | `grafana` | Grafana dashboard queries, alerting, and data source management | `GRAFANA_URL`, `GRAFANA_API_KEY` |
@@ -87,6 +88,8 @@ loads `.codex/config.toml` only for trusted project layers.
87
88
  | `notion` | Notion workspace: pages, databases, content management | `NOTION_API_KEY` |
88
89
  | `postgres` | PostgreSQL database access, schema inspection, analysis | — |
89
90
  | `puppeteer` | Browser automation: screenshots, navigation, web scraping | — |
91
+ | `rag-mcp` | General knowledge-base RAG over HTTP MCP (localhost port 8081 by default) | — |
92
+ | `rag-mcp-legal` | Polish legal RAG over HTTP MCP (localhost port 8082 by default) | — |
90
93
  | `redis` | Redis cache inspection, data management, and monitoring | `REDIS_URL` |
91
94
  | `sentry` | Sentry error tracking: issue search, event details, alerting | `SENTRY_AUTH_TOKEN`, `SENTRY_ORG` |
92
95
  | `sequential-thinking` | Step-by-step reasoning and problem decomposition | — |
@@ -120,6 +123,10 @@ Each template is a JSON file with the following structure:
120
123
  - `mcpServers` — the block merged verbatim into `.mcp.json`
121
124
  - `env` values use `${VAR_NAME}` placeholders that must be set in the shell environment or `.env` file before Claude Code starts
122
125
 
126
+ `rag-mcp` and `rag-mcp-legal` expose unauthenticated HTTP MCP endpoints by
127
+ design. Keep the default localhost binding, use a VPN, or protect remote access
128
+ with a restricted reverse proxy.
129
+
123
130
  ## Example: Adding GitHub and PostgreSQL
124
131
 
125
132
  ```bash