@dsmm/dsmm 0.1.8 → 0.2.0
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 +40 -22
- package/agent-presets/dsmm-builder/agent.cordis.yml +1949 -39
- package/agent-presets/dsmm-builder/preset.yml +1 -1
- package/agent-presets/dsmm-clarifier/agent.cordis.yml +436 -14
- package/agent-presets/dsmm-clarifier/preset.yml +1 -1
- package/agent-presets/dsmm-code-search/agent.cordis.yml +56 -14
- package/agent-presets/dsmm-code-search/preset.yml +1 -1
- package/agent-presets/dsmm-coding/agent.cordis.yml +588 -0
- package/agent-presets/dsmm-coding/preset.yml +3 -0
- package/agent-presets/dsmm-complex/agent.cordis.yml +1140 -0
- package/agent-presets/dsmm-complex/preset.yml +3 -0
- package/agent-presets/dsmm-creative/agent.cordis.yml +536 -12
- package/agent-presets/dsmm-creative/preset.yml +1 -1
- package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +1163 -0
- package/agent-presets/dsmm-cross-cutting/preset.yml +3 -0
- package/agent-presets/dsmm-deep/agent.cordis.yml +1173 -0
- package/agent-presets/dsmm-deep/preset.yml +3 -0
- package/agent-presets/dsmm-doc-search/agent.cordis.yml +56 -14
- package/agent-presets/dsmm-doc-search/preset.yml +1 -1
- package/agent-presets/dsmm-documenting/agent.cordis.yml +581 -0
- package/agent-presets/dsmm-documenting/preset.yml +3 -0
- package/agent-presets/dsmm-frontend/agent.cordis.yml +580 -0
- package/agent-presets/dsmm-frontend/preset.yml +3 -0
- package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +572 -0
- package/agent-presets/dsmm-hard-reasoning/preset.yml +3 -0
- package/agent-presets/dsmm-media-reader/agent.cordis.yml +56 -14
- package/agent-presets/dsmm-media-reader/preset.yml +1 -1
- package/agent-presets/dsmm-normal-task/agent.cordis.yml +546 -0
- package/agent-presets/dsmm-normal-task/preset.yml +3 -0
- package/agent-presets/dsmm-oracle/agent.cordis.yml +421 -12
- package/agent-presets/dsmm-oracle/preset.yml +1 -1
- package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +421 -12
- package/agent-presets/dsmm-oracle-2nd/preset.yml +1 -1
- package/agent-presets/dsmm-orchestrator/agent.cordis.yml +2023 -43
- package/agent-presets/dsmm-orchestrator/preset.yml +1 -1
- package/agent-presets/dsmm-plan-critic/agent.cordis.yml +416 -13
- package/agent-presets/dsmm-plan-critic/preset.yml +1 -1
- package/agent-presets/dsmm-planner/agent.cordis.yml +462 -13
- package/agent-presets/dsmm-planner/preset.yml +1 -1
- package/agent-presets/dsmm-quick/agent.cordis.yml +119 -0
- package/agent-presets/dsmm-quick/preset.yml +3 -0
- package/agent-presets/dsmm-research/agent.cordis.yml +141 -0
- package/agent-presets/dsmm-research/preset.yml +3 -0
- package/agent-presets/dsmm-reviewer/agent.cordis.yml +420 -13
- package/agent-presets/dsmm-reviewer/preset.yml +1 -1
- package/cordis.patch.yml +1 -5
- package/docs/agent-presets.md +64 -15
- package/docs/compatibility.md +67 -17
- package/docs/design.md +41 -0
- package/docs/lsp.md +12 -2
- package/docs/migration-from-ocmm.md +8 -0
- package/docs/profiles.md +42 -16
- package/docs/releasing.md +100 -28
- package/docs/roadmap.md +6 -0
- package/docs/runtime-recovery.md +12 -0
- package/docs/safety-guards.md +7 -3
- package/docs/settings-status.md +148 -7
- package/docs/skill-sync.md +52 -14
- package/lib/client/DeploymentPage.d.ts +18 -0
- package/lib/client/DeploymentPage.js +120 -0
- package/lib/client/ProfilesSection.js +4 -2
- package/lib/client/deployment-controller.d.ts +50 -0
- package/lib/client/deployment-controller.js +193 -0
- package/lib/client/deployment-data.d.ts +16 -0
- package/lib/client/deployment-data.js +109 -0
- package/lib/client/deployment-locales.d.ts +66 -0
- package/lib/client/deployment-locales.js +72 -0
- package/lib/client/index.js +50 -0
- package/lib/client/locales.d.ts +4 -0
- package/lib/client/locales.js +4 -2
- package/lib/client/plugins-contract.d.ts +27 -0
- package/lib/client/plugins-contract.js +2 -0
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.js +16 -0
- package/lib/client.js +1048 -29
- package/lib/commands.js +3 -0
- package/lib/config-file-store.d.ts +23 -0
- package/lib/config-file-store.js +67 -0
- package/lib/deployment-config.d.ts +37 -0
- package/lib/deployment-config.js +184 -0
- package/lib/dsh-home.d.ts +3 -0
- package/lib/dsh-home.js +10 -0
- package/lib/dsh-types.d.ts +12 -65
- package/lib/guards.d.ts +2 -1
- package/lib/guards.js +19 -2
- package/lib/index.d.ts +8 -1
- package/lib/index.js +115 -25
- package/lib/lsp.d.ts +13 -0
- package/lib/lsp.js +60 -0
- package/lib/mode.js +42 -47
- package/lib/model-routing.js +5 -2
- package/lib/modules.d.ts +27 -0
- package/lib/modules.js +21 -0
- package/lib/native-scope.d.ts +9 -0
- package/lib/native-scope.js +20 -0
- package/lib/plan-validation.js +6 -44
- package/lib/preset-materializer.js +2 -0
- package/lib/preset-registry.d.ts +1 -1
- package/lib/preset-registry.js +7 -4
- package/lib/preset-skills.d.ts +4 -1
- package/lib/preset-skills.js +60 -19
- package/lib/profile-remote.d.ts +14 -0
- package/lib/profile-remote.js +197 -4
- package/lib/profile-rpc.d.ts +24 -1
- package/lib/profile-rpc.js +139 -1
- package/lib/profile-runtime.d.ts +24 -0
- package/lib/profile-runtime.js +177 -33
- package/lib/profile-store.d.ts +45 -1
- package/lib/profile-store.js +236 -102
- package/lib/profile-types.d.ts +55 -0
- package/lib/prompt-content.d.ts +25 -0
- package/lib/prompt-content.js +27 -0
- package/lib/prompts.d.ts +8 -2
- package/lib/prompts.js +46 -34
- package/lib/role-policy.d.ts +51 -0
- package/lib/role-policy.js +224 -0
- package/lib/role-providers.d.ts +6 -2
- package/lib/role-providers.js +72 -39
- package/lib/role-subagents.d.ts +6 -2
- package/lib/role-subagents.js +187 -48
- package/lib/roles.d.ts +16 -4
- package/lib/roles.js +86 -186
- package/lib/runtime-recovery.js +16 -5
- package/lib/session-scope.js +2 -0
- package/lib/settings.d.ts +69 -1
- package/lib/settings.js +262 -91
- package/lib/skills.d.ts +24 -9
- package/lib/skills.js +114 -35
- package/lib/state.d.ts +10 -6
- package/lib/state.js +48 -49
- package/lib/status.d.ts +25 -0
- package/lib/status.js +47 -9
- package/locale/en.json +2 -2
- package/locale/zh.json +2 -2
- package/package.json +19 -2
- package/prompts/deepwork.md +144 -20
- package/prompts/source/agents/clarifier.md +45 -0
- package/prompts/source/agents/orchestrator.md +63 -0
- package/prompts/source/agents/plan-critic.md +25 -0
- package/prompts/source/agents/planner.md +19 -0
- package/prompts/source/agents/reviewer.md +17 -0
- package/prompts/source/catalog.json +548 -0
- package/prompts/source/category/coding.md +46 -0
- package/prompts/source/category/complex.md +29 -0
- package/prompts/source/category/creative.md +38 -0
- package/prompts/source/category/cross-cutting.md +52 -0
- package/prompts/source/category/deep.md +62 -0
- package/prompts/source/category/documenting.md +62 -0
- package/prompts/source/category/frontend.md +38 -0
- package/prompts/source/category/hard-reasoning.md +53 -0
- package/prompts/source/category/normal-task.md +27 -0
- package/prompts/source/category/quick.md +34 -0
- package/prompts/source/category/research.md +56 -0
- package/prompts/source/deepwork/claude-opus-5.md +28 -0
- package/prompts/source/deepwork/codex.md +9 -0
- package/prompts/source/deepwork/default.md +129 -0
- package/prompts/source/deepwork/gemini.md +184 -0
- package/prompts/source/deepwork/glm.md +256 -0
- package/prompts/source/deepwork/gpt.md +43 -0
- package/prompts/source/deepwork/kimi-k27.md +13 -0
- package/prompts/source/deepwork/planner.md +41 -0
- package/prompts/source/deepwork/swe-2.md +13 -0
- package/prompts/source/manifest.json +3118 -0
- package/prompts/source/shared/dsh-host-contract.md +6 -0
- package/prompts/source/shared/locale.md +8 -0
- package/prompts/source/shared/shell-safety.md +7 -0
- package/prompts/source/terminal/builder.md +13 -0
- package/prompts/source/terminal/clarifier.md +41 -0
- package/prompts/source/terminal/code-search.md +39 -0
- package/prompts/source/terminal/coding.md +41 -0
- package/prompts/source/terminal/complex.md +43 -0
- package/prompts/source/terminal/creative.md +41 -0
- package/prompts/source/terminal/cross-cutting.md +43 -0
- package/prompts/source/terminal/deep.md +43 -0
- package/prompts/source/terminal/doc-search.md +39 -0
- package/prompts/source/terminal/documenting.md +41 -0
- package/prompts/source/terminal/frontend.md +41 -0
- package/prompts/source/terminal/hard-reasoning.md +41 -0
- package/prompts/source/terminal/media-reader.md +39 -0
- package/prompts/source/terminal/normal-task.md +41 -0
- package/prompts/source/terminal/oracle-2nd.md +53 -0
- package/prompts/source/terminal/oracle.md +53 -0
- package/prompts/source/terminal/orchestrator.md +26 -0
- package/prompts/source/terminal/plan-critic.md +41 -0
- package/prompts/source/terminal/planner.md +42 -0
- package/prompts/source/terminal/quick.md +39 -0
- package/prompts/source/terminal/research.md +39 -0
- package/prompts/source/terminal/reviewer.md +53 -0
- package/skills/ast-grep/LICENSE +21 -0
- package/skills/ast-grep/README.md +138 -0
- package/skills/ast-grep/SKILL.md +284 -0
- package/skills/ast-grep/SOURCE +1 -0
- package/skills/ast-grep/install.ps1 +235 -0
- package/skills/ast-grep/install.sh +286 -0
- package/skills/ast-grep/references/cli.md +233 -0
- package/skills/ast-grep/references/install.md +168 -0
- package/skills/ast-grep/references/patterns.md +149 -0
- package/skills/ast-grep/references/pitfalls.md +305 -0
- package/skills/ast-grep/references/recipes.md +404 -0
- package/skills/ast-grep/references/sgconfig.md +250 -0
- package/skills/ast-grep/references/yaml-rules.md +511 -0
- package/skills/ast-grep/scripts/ast_grep_helper.py +760 -0
- package/skills/ast-grep/tests/smoke.ps1 +129 -0
- package/skills/ast-grep/tests/smoke.sh +212 -0
- package/skills/ast-grep/tests/test_resolver.py +154 -0
- package/skills/brainstorming/SKILL.md +102 -9
- package/skills/coding-agent-sessions/LICENSE-UPSTREAM.md +82 -0
- package/skills/coding-agent-sessions/NOTICE.md +24 -0
- package/skills/coding-agent-sessions/SKILL.md +144 -0
- package/skills/coding-agent-sessions/agents/openai.yaml +4 -0
- package/skills/coding-agent-sessions/pyrightconfig.json +5 -0
- package/skills/coding-agent-sessions/references/all-platforms.md +77 -0
- package/skills/coding-agent-sessions/references/claude.md +34 -0
- package/skills/coding-agent-sessions/references/codex.md +32 -0
- package/skills/coding-agent-sessions/references/opencode.md +45 -0
- package/skills/coding-agent-sessions/references/senpi.md +29 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/__init__.py +1 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/aside_scanner.py +140 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/claude.py +66 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +283 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/codex.py +105 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/file_scanners.py +275 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/jsonio.py +55 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/kiro_scanner.py +91 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/opencode.py +289 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +46 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/scanners.py +104 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_optional_scanners.py +203 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_scanners.py +177 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/timeparse.py +51 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/transcript.py +149 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/types.py +57 -0
- package/skills/coding-agent-sessions/scripts/find-agent-sessions.py +19 -0
- package/skills/coding-agent-sessions/scripts/tests/test_agent_sessions.py +322 -0
- package/skills/coding-agent-sessions/scripts/tests/test_aside_scanner.py +131 -0
- package/skills/coding-agent-sessions/scripts/tests/test_cli_contract.py +126 -0
- package/skills/coding-agent-sessions/scripts/tests/test_extended_scanners.py +262 -0
- package/skills/coding-agent-sessions/scripts/tests/test_optional_sqlite_scanners.py +79 -0
- package/skills/coding-agent-sessions/scripts/tests/test_pi_family_scanners.py +130 -0
- package/skills/debugging/SKILL.md +125 -4
- package/skills/debugging/references/logging.md +2 -0
- package/skills/debugging/references/methodology/00-setup.md +2 -0
- package/skills/debugging/references/methodology/02-investigate.md +8 -2
- package/skills/debugging/references/methodology/03-flaky-triage.md +3 -1
- package/skills/debugging/references/methodology/04-hard-reasoning-escalation.md +4 -2
- package/skills/debugging/references/methodology/05-escalate.md +2 -0
- package/skills/debugging/references/methodology/06-fix.md +2 -0
- package/skills/debugging/references/methodology/08-qa.md +2 -0
- package/skills/debugging/references/methodology/09-cleanup.md +2 -0
- package/skills/debugging/references/methodology/partial-runtime-evidence.md +4 -2
- package/skills/debugging/references/runtimes/bundled-js-binary.md +2 -0
- package/skills/debugging/references/runtimes/go.md +2 -0
- package/skills/debugging/references/runtimes/native-binary.md +2 -0
- package/skills/debugging/references/runtimes/node.md +2 -0
- package/skills/debugging/references/runtimes/python.md +2 -0
- package/skills/debugging/references/runtimes/rust.md +2 -0
- package/skills/debugging/references/scripts/dap.test.mjs +539 -0
- package/skills/debugging/references/scripts/fixture-adapter.mjs +164 -0
- package/skills/debugging/references/tools/dap.md +3 -1
- package/skills/debugging/references/tools/ghidra.md +2 -0
- package/skills/debugging/references/tools/playwright-cli.md +2 -0
- package/skills/debugging/references/tools/pwndbg.md +2 -0
- package/skills/debugging/references/tools/pwntools.md +2 -0
- package/skills/dispatching-parallel-agents/SKILL.md +94 -7
- package/skills/frontend/.frontend-materialized.json +856 -0
- package/skills/frontend/ATTRIBUTION.md +37 -0
- package/skills/frontend/LICENSE-Apache-2.0.txt +201 -0
- package/skills/frontend/LICENSE-taste-skill.txt +21 -0
- package/skills/frontend/LICENSE-ui-ux-pro-max.txt +21 -0
- package/skills/frontend/SKILL.md +142 -0
- package/skills/frontend/references/design/README.md +256 -0
- package/skills/frontend/references/design/_INDEX.md +206 -0
- package/skills/frontend/references/design/airbnb.md +393 -0
- package/skills/frontend/references/design/airtable.md +92 -0
- package/skills/frontend/references/design/apple.md +250 -0
- package/skills/frontend/references/design/aside.md +211 -0
- package/skills/frontend/references/design/binance.md +348 -0
- package/skills/frontend/references/design/bmw.md +183 -0
- package/skills/frontend/references/design/brutalist-skill.md +92 -0
- package/skills/frontend/references/design/bugatti.md +271 -0
- package/skills/frontend/references/design/cal.md +262 -0
- package/skills/frontend/references/design/claude.md +315 -0
- package/skills/frontend/references/design/clay.md +307 -0
- package/skills/frontend/references/design/clickhouse.md +284 -0
- package/skills/frontend/references/design/clone-from-url.md +69 -0
- package/skills/frontend/references/design/cohere.md +269 -0
- package/skills/frontend/references/design/coinbase.md +132 -0
- package/skills/frontend/references/design/composio.md +310 -0
- package/skills/frontend/references/design/cursor.md +312 -0
- package/skills/frontend/references/design/design-system-architecture.md +250 -0
- package/skills/frontend/references/design/elevenlabs.md +268 -0
- package/skills/frontend/references/design/expo.md +284 -0
- package/skills/frontend/references/design/ferrari.md +317 -0
- package/skills/frontend/references/design/figma.md +223 -0
- package/skills/frontend/references/design/framer.md +249 -0
- package/skills/frontend/references/design/gpt-tasteskill.md +74 -0
- package/skills/frontend/references/design/hashicorp.md +281 -0
- package/skills/frontend/references/design/ibm.md +335 -0
- package/skills/frontend/references/design/image-to-code-skill.md +1228 -0
- package/skills/frontend/references/design/imagegen-brandkit.md +798 -0
- package/skills/frontend/references/design/imagegen-frontend-mobile.md +1465 -0
- package/skills/frontend/references/design/imagegen-frontend-web.md +987 -0
- package/skills/frontend/references/design/interaction-skill.md +52 -0
- package/skills/frontend/references/design/intercom.md +149 -0
- package/skills/frontend/references/design/kraken.md +128 -0
- package/skills/frontend/references/design/lamborghini.md +291 -0
- package/skills/frontend/references/design/linear.app.md +370 -0
- package/skills/frontend/references/design/lovable.md +301 -0
- package/skills/frontend/references/design/mastercard.md +368 -0
- package/skills/frontend/references/design/meta.md +369 -0
- package/skills/frontend/references/design/minimalist-skill.md +85 -0
- package/skills/frontend/references/design/minimax.md +260 -0
- package/skills/frontend/references/design/mintlify.md +329 -0
- package/skills/frontend/references/design/miro.md +111 -0
- package/skills/frontend/references/design/mistral.ai.md +264 -0
- package/skills/frontend/references/design/mongodb.md +269 -0
- package/skills/frontend/references/design/nike.md +366 -0
- package/skills/frontend/references/design/notion.md +312 -0
- package/skills/frontend/references/design/nvidia.md +296 -0
- package/skills/frontend/references/design/ollama.md +270 -0
- package/skills/frontend/references/design/opencode.ai.md +284 -0
- package/skills/frontend/references/design/output-skill.md +49 -0
- package/skills/frontend/references/design/pinterest.md +233 -0
- package/skills/frontend/references/design/playstation.md +367 -0
- package/skills/frontend/references/design/posthog.md +259 -0
- package/skills/frontend/references/design/raycast.md +271 -0
- package/skills/frontend/references/design/react-dev-tooling-skill.md +232 -0
- package/skills/frontend/references/design/redesign-skill.md +178 -0
- package/skills/frontend/references/design/renault.md +314 -0
- package/skills/frontend/references/design/replicate.md +264 -0
- package/skills/frontend/references/design/resend.md +306 -0
- package/skills/frontend/references/design/revolut.md +188 -0
- package/skills/frontend/references/design/runwayml.md +247 -0
- package/skills/frontend/references/design/sanity.md +360 -0
- package/skills/frontend/references/design/sentry.md +265 -0
- package/skills/frontend/references/design/shopify.md +353 -0
- package/skills/frontend/references/design/soft-skill.md +98 -0
- package/skills/frontend/references/design/spacex.md +197 -0
- package/skills/frontend/references/design/spotify.md +249 -0
- package/skills/frontend/references/design/starbucks.md +583 -0
- package/skills/frontend/references/design/stitch-design-example.md +121 -0
- package/skills/frontend/references/design/stitch-skill.md +184 -0
- package/skills/frontend/references/design/stripe.md +325 -0
- package/skills/frontend/references/design/supabase.md +258 -0
- package/skills/frontend/references/design/superhuman.md +255 -0
- package/skills/frontend/references/design/taste-skill.md +1206 -0
- package/skills/frontend/references/design/tesla.md +289 -0
- package/skills/frontend/references/design/theverge.md +342 -0
- package/skills/frontend/references/design/together.ai.md +266 -0
- package/skills/frontend/references/design/uber.md +298 -0
- package/skills/frontend/references/design/vercel.md +313 -0
- package/skills/frontend/references/design/vodafone.md +426 -0
- package/skills/frontend/references/design/voltagent.md +326 -0
- package/skills/frontend/references/design/warp.md +256 -0
- package/skills/frontend/references/design/webflow.md +95 -0
- package/skills/frontend/references/design/wired.md +281 -0
- package/skills/frontend/references/design/wise.md +176 -0
- package/skills/frontend/references/design/x.ai.md +260 -0
- package/skills/frontend/references/design/zapier.md +331 -0
- package/skills/frontend/references/perfection/README.md +264 -0
- package/skills/frontend/references/perfection/react-perf-tooling.md +234 -0
- package/skills/frontend/references/ui-ux-db/README.md +659 -0
- package/skills/frontend/references/ui-ux-db/data/app-interface.csv +31 -0
- package/skills/frontend/references/ui-ux-db/data/charts.csv +26 -0
- package/skills/frontend/references/ui-ux-db/data/colors.csv +162 -0
- package/skills/frontend/references/ui-ux-db/data/google-fonts.csv +1924 -0
- package/skills/frontend/references/ui-ux-db/data/icons.csv +106 -0
- package/skills/frontend/references/ui-ux-db/data/landing.csv +35 -0
- package/skills/frontend/references/ui-ux-db/data/products.csv +162 -0
- package/skills/frontend/references/ui-ux-db/data/react-performance.csv +45 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/angular.csv +51 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/astro.csv +54 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/jetpack-compose.csv +53 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/laravel.csv +51 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/nuxt-ui.csv +51 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/nuxtjs.csv +59 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/react-native.csv +52 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/shadcn.csv +61 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/threejs.csv +54 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -0
- package/skills/frontend/references/ui-ux-db/data/styles.csv +85 -0
- package/skills/frontend/references/ui-ux-db/data/typography.csv +74 -0
- package/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +162 -0
- package/skills/frontend/references/ui-ux-db/data/ux-guidelines.csv +100 -0
- package/skills/frontend/references/ui-ux-db/data/web-interface.csv +31 -0
- package/skills/frontend/references/ui-ux-db/scripts/core.py +262 -0
- package/skills/frontend/references/ui-ux-db/scripts/design_system.py +1148 -0
- package/skills/frontend/references/ui-ux-db/scripts/search.py +114 -0
- package/skills/frontend/scripts/perfection/lighthouse-audit.py +201 -0
- package/skills/git-master/SKILL.md +112 -0
- package/skills/git-master/agents/openai.yaml +13 -0
- package/skills/init-deep/SKILL.md +279 -0
- package/skills/receiving-code-review/SKILL.md +112 -7
- package/skills/remove-ai-slops/SKILL.md +159 -8
- package/skills/requesting-code-review/SKILL.md +96 -3
- package/skills/requesting-code-review/code-reviewer.md +47 -0
- package/skills/subagent-driven-development/SKILL.md +176 -6
- package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +23 -0
- package/skills/subagent-driven-development/implementer-prompt.md +69 -0
- package/skills/subagent-driven-development/spec-reviewer-prompt.md +32 -0
- package/skills/using-git-worktrees/SKILL.md +141 -0
- package/skills/writing-plans/SKILL.md +121 -7
- package/skills/writing-plans/plan-document-reviewer-prompt.md +38 -0
package/lib/index.js
CHANGED
|
@@ -1,23 +1,34 @@
|
|
|
1
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
1
2
|
import { registerDeepworkCommand, registerDsmmStatusCommand } from "./commands.js";
|
|
2
3
|
import { registerSafetyGuards } from "./guards.js";
|
|
3
4
|
import { registerDeepworkPrompt } from "./mode.js";
|
|
5
|
+
import { registerAgentSkills } from "./preset-skills.js";
|
|
4
6
|
import { registerModelRouting } from "./model-routing.js";
|
|
5
7
|
import { registerRuntimeRecovery } from "./runtime-recovery.js";
|
|
6
8
|
import { reconcileRolePresets, resolveManagedPresetRoot } from "./preset-materializer.js";
|
|
7
|
-
import { registerHeadlessRoleTools } from "./role-subagents.js";
|
|
9
|
+
import { registerHeadlessRoleTools, registerNativeSubagentControls } from "./role-subagents.js";
|
|
8
10
|
import { registerRolePresets } from "./preset-registry.js";
|
|
9
11
|
import { registerRoleProviders } from "./role-providers.js";
|
|
12
|
+
import { DsmmRolePolicy } from "./role-policy.js";
|
|
13
|
+
import { registerLspRuntime } from "./lsp.js";
|
|
10
14
|
import { createProfileRuntime } from "./profile-runtime.js";
|
|
11
|
-
import {
|
|
12
|
-
import { DSMM_CONFIG_SCHEMA, registerSettings } from "./settings.js";
|
|
15
|
+
import { DsmmProfilesHost, registerConfigRpc } from "./profile-rpc.js";
|
|
16
|
+
import { DSMM_CONFIG_SCHEMA, DSMM_NATIVE_CONFIG_SCHEMA, registerSettings } from "./settings.js";
|
|
13
17
|
import { DeepworkModeController } from "./state.js";
|
|
14
18
|
import DsmmSessionPersistence from "./session-persistence.js";
|
|
15
19
|
import { isAbsolute } from "node:path";
|
|
16
20
|
import { createHash, randomUUID } from "node:crypto";
|
|
17
21
|
import { DsmmProfileError } from "./profiles.js";
|
|
22
|
+
import { DsmmDeploymentConfig } from "./deployment-config.js";
|
|
23
|
+
import { agentForScope } from "./native-scope.js";
|
|
24
|
+
import { projectDeepworkModule } from "./modules.js";
|
|
18
25
|
export const name = "dsmm";
|
|
19
26
|
export const inject = ["profileContext"];
|
|
20
|
-
|
|
27
|
+
// Direct public Config calls keep the complete plain flat ABI. Native Cordis
|
|
28
|
+
// consumes the same object's Standard Schema protocol for sparse volatile refs.
|
|
29
|
+
export const Config = new Proxy(DSMM_NATIVE_CONFIG_SCHEMA, {
|
|
30
|
+
apply(_target, _receiver, args) { return DSMM_CONFIG_SCHEMA(args[0] ?? {}); }
|
|
31
|
+
});
|
|
21
32
|
export { DSMM_ROLE_IDS, DSMM_ROLES, isDsmmRoleId, renderAgentCordis, renderPresetMetadata } from "./roles.js";
|
|
22
33
|
export { DSMM_MANAGED_PRESET_MARKER, materializeRolePresets, reconcileRolePresets, resolveManagedPresetRoot } from "./preset-materializer.js";
|
|
23
34
|
export { DSMM_GUARD_PREFIX, decidePostToolExecution, decidePreToolExecution, isSafetyScopeActive, registerSafetyGuards, truncateTextMiddle } from "./guards.js";
|
|
@@ -33,8 +44,29 @@ export { DSMM_STATUS_COMMAND, registerDsmmStatusCommand } from "./commands.js";
|
|
|
33
44
|
export { DSMM_STATUS_VERSION, createDsmmStatusSnapshot, formatDsmmStatus } from "./status.js";
|
|
34
45
|
export { DSMM_SKILL_NAMES, DEFAULT_DSMM_SETTINGS, MVP_SKILL_NAMES, isRoleEnabled, resolveConfig, resolveRoleRouting, registerSettings } from "./settings.js";
|
|
35
46
|
export { createProfileRuntime, DsmmProfileRuntime } from "./profile-runtime.js";
|
|
47
|
+
export { resolveDshHome } from "./dsh-home.js";
|
|
48
|
+
export { DsmmDeploymentConfig, parseGlobalConfig, editGlobalConfig } from "./deployment-config.js";
|
|
49
|
+
export { DSMM_MODULE_DESCRIPTORS, deepworkEnabled, projectDeepworkModule } from "./modules.js";
|
|
36
50
|
export { DEEPWORK_MODE_EVENT, DeepworkModeController, hasOpenTurn, isDeepworkActive } from "./state.js";
|
|
37
51
|
export function apply(ctx, config = {}) {
|
|
52
|
+
if (!(ctx instanceof Context))
|
|
53
|
+
return applyConfigured(ctx, config);
|
|
54
|
+
const deployment = new DsmmDeploymentConfig(ctx, config);
|
|
55
|
+
return deployment.readDesired().then((startup) => applyConfigured(ctx, config, deployment, startup));
|
|
56
|
+
}
|
|
57
|
+
function applyConfigured(ctx, config, deployment, startup) {
|
|
58
|
+
// Volatile desired saves retain live realms. An ordinary Loader remount must
|
|
59
|
+
// not replace already-admitted Agent policy/skill realms, including busy Agents.
|
|
60
|
+
if (ctx instanceof Context && ctx.fiber.entry !== undefined) {
|
|
61
|
+
const native = ctx;
|
|
62
|
+
const owner = ctx.fiber.entry;
|
|
63
|
+
native.on("loader/patch-context", (entry, next) => {
|
|
64
|
+
if (entry === owner && (native.get("agents")?.list().length ?? 0) > 0) {
|
|
65
|
+
throw new Error("dsmm deployment Config requires restart while Agents are admitted; runtime mode/profile changes use idle maintenance instead");
|
|
66
|
+
}
|
|
67
|
+
next();
|
|
68
|
+
}, { global: true });
|
|
69
|
+
}
|
|
38
70
|
const storage = config.sessionPersistence;
|
|
39
71
|
if (storage !== undefined) {
|
|
40
72
|
if (storage === null || typeof storage !== "object" || typeof storage.root !== "string" || !isAbsolute(storage.root)
|
|
@@ -42,19 +74,18 @@ export function apply(ctx, config = {}) {
|
|
|
42
74
|
|| storage.compression !== undefined && !["zstd", "none"].includes(storage.compression)) {
|
|
43
75
|
throw new Error("Deepwork sessionPersistence must preserve an explicit absolute native root and compression");
|
|
44
76
|
}
|
|
45
|
-
if (ctx
|
|
46
|
-
throw new Error("Deepwork sessionPersistence requires native
|
|
47
|
-
|
|
77
|
+
if (!(ctx instanceof Context))
|
|
78
|
+
throw new Error("Deepwork sessionPersistence requires a native Cordis Context");
|
|
79
|
+
const native = ctx;
|
|
80
|
+
if (native.get("sessionPersistence") !== undefined)
|
|
48
81
|
throw new Error("Disable the exact existing JSONL entry at startup before enabling Deepwork sessionPersistence; live replacement is refused");
|
|
49
|
-
const fiber =
|
|
50
|
-
|
|
51
|
-
throw new Error("Deepwork sessionPersistence startup registration failed");
|
|
52
|
-
return fiber.await().then(() => applyRuntime(ctx, config));
|
|
82
|
+
const fiber = native.plugin(DsmmSessionPersistence, storage);
|
|
83
|
+
return fiber.await().then(() => applyRuntime(ctx, config, deployment, startup));
|
|
53
84
|
}
|
|
54
|
-
return applyRuntime(ctx, config);
|
|
85
|
+
return applyRuntime(ctx, config, deployment, startup);
|
|
55
86
|
}
|
|
56
|
-
function applyRuntime(ctx, config) {
|
|
57
|
-
const controller = new DeepworkModeController(ctx);
|
|
87
|
+
function applyRuntime(ctx, config, deployment, startup) {
|
|
88
|
+
const controller = new DeepworkModeController(ctx, (agent) => getBoundSettings(agent).modules.deepwork.enabled);
|
|
58
89
|
let runtime;
|
|
59
90
|
let profileInitialization;
|
|
60
91
|
let requiresNativeProfiles = ctx.get !== undefined;
|
|
@@ -81,40 +112,86 @@ function applyRuntime(ctx, config) {
|
|
|
81
112
|
}
|
|
82
113
|
return admission;
|
|
83
114
|
};
|
|
115
|
+
getBoundSettings.moduleStates = (agent) => {
|
|
116
|
+
requireProfileAdmission();
|
|
117
|
+
return runtime?.getSettings.moduleStates?.(agent) ?? [projectDeepworkModule(getSettings(), startup, getBoundSettings.admission(agent))];
|
|
118
|
+
};
|
|
119
|
+
const rolePolicy = new DsmmRolePolicy(ctx, getBoundSettings, controller);
|
|
84
120
|
const getSettings = registerSettings(ctx, config, {
|
|
121
|
+
...(startup === undefined ? {} : { resolved: startup.settings }),
|
|
85
122
|
install(readyCtx, getReadySettings) {
|
|
123
|
+
const startupMounted = getReadySettings().modules.deepwork.enabled;
|
|
124
|
+
// The global editor belongs to core, not profile/DW installation success.
|
|
125
|
+
if (deployment !== undefined) {
|
|
126
|
+
readyCtx.provide?.("dsmmDeploymentConfig", deployment);
|
|
127
|
+
readyCtx.inject?.(["typert"], (rpcCtx) => {
|
|
128
|
+
registerConfigRpc(rpcCtx, deployment, getReadySettings(), () => runtime, startup?.sources);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
86
131
|
const install = (installCtx, settingsGetter) => {
|
|
87
|
-
|
|
132
|
+
if (startupMounted) {
|
|
133
|
+
registerDeepworkPrompt(installCtx, controller, settingsGetter, { section: startup === undefined ? config.section : startup.profile.section ?? startup.global.section });
|
|
134
|
+
registerAgentSkills(installCtx, controller, settingsGetter);
|
|
135
|
+
}
|
|
88
136
|
const installCommands = (commandCtx) => {
|
|
89
|
-
|
|
137
|
+
if (startupMounted)
|
|
138
|
+
registerDeepworkCommand(commandCtx, controller, settingsGetter);
|
|
90
139
|
registerDsmmStatusCommand(commandCtx, controller, settingsGetter);
|
|
91
140
|
};
|
|
92
141
|
if (installCtx.get !== undefined && installCtx.inject !== undefined)
|
|
93
142
|
installCtx.inject(["commands"], installCommands);
|
|
94
143
|
else
|
|
95
144
|
installCommands(installCtx);
|
|
96
|
-
|
|
145
|
+
if (!startupMounted)
|
|
146
|
+
return;
|
|
147
|
+
registerRoleProviders(installCtx, settingsGetter, getReadySettings, rolePolicy);
|
|
97
148
|
// Standing compositions are deployment-only and never replaced on a
|
|
98
149
|
// runtime profile selection. All routes are read from Agent bindings.
|
|
99
|
-
registerRolePresets(installCtx, getReadySettings);
|
|
100
150
|
const settings = getReadySettings();
|
|
101
|
-
const root = resolveManagedPresetRoot(settings);
|
|
151
|
+
const root = resolveManagedPresetRoot(settings, deployment === undefined ? process.env : { ...process.env, DSH_HOME: deployment.home });
|
|
102
152
|
if (root !== undefined)
|
|
103
153
|
reconcileRolePresets({ root, settings });
|
|
104
154
|
};
|
|
105
155
|
if (readyCtx.get === undefined) {
|
|
156
|
+
registerRolePresets(readyCtx, getReadySettings);
|
|
106
157
|
install(readyCtx, getReadySettings);
|
|
107
158
|
return;
|
|
108
159
|
}
|
|
109
160
|
requiresNativeProfiles = true;
|
|
110
161
|
const installProfiles = async (profileCtx) => {
|
|
111
|
-
|
|
162
|
+
if (startupMounted) {
|
|
163
|
+
await registerLspRuntime(profileCtx, getReadySettings().lsp, getBoundSettings);
|
|
164
|
+
await registerNativeSubagentControls(profileCtx);
|
|
165
|
+
}
|
|
166
|
+
// Standing definitions must exist before initialize audits retained
|
|
167
|
+
// Agents. A missing optional registry still installs later from this
|
|
168
|
+
// same frozen startup getter, without blocking unrelated Hosts.
|
|
169
|
+
const presets = registerRolePresets(profileCtx, getReadySettings);
|
|
170
|
+
if (profileCtx.get?.("agentPresets") !== undefined)
|
|
171
|
+
await presets;
|
|
172
|
+
runtime = await createProfileRuntime(profileCtx, getReadySettings(), { modeController: controller,
|
|
173
|
+
...(startup === undefined ? {} : { startup }), ...(deployment === undefined ? {} : { readDesired: () => deployment.readDesired() }),
|
|
174
|
+
subagentCapabilities: {
|
|
175
|
+
backgroundJobs: profileCtx.get?.("jobs") !== undefined && profileCtx.get?.("tools")?.get("job_output") !== undefined,
|
|
176
|
+
continuable: profileCtx.get?.("sessionPersistence") !== undefined && profileCtx.get?.("sessionQuery") !== undefined
|
|
177
|
+
&& profileCtx.get?.("subagents")?.getProvider("spawn")?.prepareContinuable !== undefined
|
|
178
|
+
&& profileCtx.get?.("tools")?.get("send_message") !== undefined
|
|
179
|
+
} });
|
|
112
180
|
profileCtx.provide?.("dsmmProfileRuntime", runtime);
|
|
113
181
|
const manager = runtime;
|
|
114
182
|
profileCtx.inject?.(["typert"], (rpcCtx) => {
|
|
115
|
-
|
|
183
|
+
new DsmmProfilesHost(rpcCtx, manager);
|
|
116
184
|
});
|
|
117
185
|
install(profileCtx, runtime.getSettings);
|
|
186
|
+
const admitIdentity = (agent) => {
|
|
187
|
+
rolePolicy.assertModuleAdmission(agent);
|
|
188
|
+
rolePolicy.admit(agent);
|
|
189
|
+
};
|
|
190
|
+
profileCtx.on?.("agent/created", ({ agent }) => { admitIdentity(agent); }, { global: true });
|
|
191
|
+
for (const agent of profileCtx.get?.("agents")?.list() ?? [])
|
|
192
|
+
admitIdentity(agent);
|
|
193
|
+
if (startupMounted)
|
|
194
|
+
await registerHeadlessRoleTools(profileCtx, controller, runtime.getSettings, rolePolicy);
|
|
118
195
|
};
|
|
119
196
|
if (readyCtx.inject !== undefined) {
|
|
120
197
|
const initialization = readyCtx.inject(["profileContext"], installProfiles);
|
|
@@ -124,10 +201,23 @@ function applyRuntime(ctx, config) {
|
|
|
124
201
|
throw new Error("dsmm native profiles require asynchronous profileContext injection");
|
|
125
202
|
}
|
|
126
203
|
});
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
204
|
+
if (getSettings().modules.deepwork.enabled) {
|
|
205
|
+
registerRuntimeRecovery(ctx, controller, getBoundSettings);
|
|
206
|
+
registerModelRouting(ctx, controller, getBoundSettings);
|
|
207
|
+
}
|
|
208
|
+
if (ctx.get !== undefined) {
|
|
209
|
+
ctx.on?.("system-prompt/assemble", async (_assembly, options, next) => {
|
|
210
|
+
const agent = agentForScope(ctx, options.scope);
|
|
211
|
+
if (agent !== undefined)
|
|
212
|
+
rolePolicy.assertModuleAdmission(agent);
|
|
213
|
+
return next();
|
|
214
|
+
}, { prepend: true, global: true });
|
|
215
|
+
ctx.on?.("agent/request", async (frame, next) => {
|
|
216
|
+
rolePolicy.assertModuleAdmission(frame.agent);
|
|
217
|
+
return next();
|
|
218
|
+
}, { prepend: true, global: true });
|
|
219
|
+
}
|
|
220
|
+
registerSafetyGuards(ctx, controller, getBoundSettings, ctx.get === undefined ? undefined : rolePolicy);
|
|
131
221
|
return profileInitialization;
|
|
132
222
|
}
|
|
133
223
|
// Cordis Loader introspects this object's Config/inject; a bare function loses
|
package/lib/lsp.d.ts
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
export declare const DSMM_LSP_SERVER_NAME = "dsmm_lsp";
|
|
2
2
|
export declare const DSMM_LSP_TOOL_NAMES: readonly ["status", "diagnostics", "goto_definition", "find_references", "find_symbol_related", "symbols", "prepare_rename", "rename", "format"];
|
|
3
3
|
export type DsmmLspToolName = (typeof DSMM_LSP_TOOL_NAMES)[number];
|
|
4
|
+
export interface DsmmLspRuntimeState {
|
|
5
|
+
state: "disabled" | "ready" | "unavailable";
|
|
6
|
+
diagnostic?: "host-anchor-unavailable" | "native-package-unavailable" | "native-tools-unavailable";
|
|
7
|
+
tools: readonly string[];
|
|
8
|
+
}
|
|
9
|
+
declare module "@deepseek-ai/cordis" {
|
|
10
|
+
interface Context {
|
|
11
|
+
dsmmLspState: () => DsmmLspRuntimeState;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/** Optional native package resolution is anchored by the trusted host, not home guesses or CLI paths. */
|
|
15
|
+
export declare function registerLspRuntime(ctx: Context, settings: DsmmLspSettings, getSettings?: import("./settings.js").DsmmSettingsGetter): Promise<void>;
|
|
4
16
|
export interface DsmmLspSettings {
|
|
5
17
|
enabled: boolean;
|
|
6
18
|
serverName: string;
|
|
@@ -27,4 +39,5 @@ export declare function toDshMcpClientConfig(input?: Partial<DsmmLspSettings>):
|
|
|
27
39
|
export declare function publicLspToolName(rawName: DsmmLspToolName, serverName?: string): string;
|
|
28
40
|
export declare function renderLspMcpPatch(input?: Partial<DsmmLspSettings>): string;
|
|
29
41
|
export declare function parseLspSmokeCommand(raw: string | undefined, fallback: readonly string[]): string[];
|
|
42
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
30
43
|
//# sourceMappingURL=lsp.d.ts.map
|
package/lib/lsp.js
CHANGED
|
@@ -10,6 +10,64 @@ export const DSMM_LSP_TOOL_NAMES = [
|
|
|
10
10
|
"rename",
|
|
11
11
|
"format"
|
|
12
12
|
];
|
|
13
|
+
/** Optional native package resolution is anchored by the trusted host, not home guesses or CLI paths. */
|
|
14
|
+
export async function registerLspRuntime(ctx, settings, getSettings) {
|
|
15
|
+
let state = { state: "disabled", tools: [] };
|
|
16
|
+
ctx.provide("dsmmLspState", () => state);
|
|
17
|
+
if (!settings.enabled)
|
|
18
|
+
return;
|
|
19
|
+
const anchor = ctx.get("profileContext")?.installAnchor;
|
|
20
|
+
const unavailable = (diagnostic) => {
|
|
21
|
+
state = { state: "unavailable", tools: [], diagnostic };
|
|
22
|
+
if (settings.failOnStartupError)
|
|
23
|
+
throw new Error(`DSMM LSP startup unavailable: ${diagnostic}`);
|
|
24
|
+
};
|
|
25
|
+
if (anchor === undefined) {
|
|
26
|
+
unavailable("host-anchor-unavailable");
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
let plugin;
|
|
30
|
+
try {
|
|
31
|
+
const modulePath = createRequire(anchor).resolve("@deepseek-ai/dsh-mcp-client");
|
|
32
|
+
plugin = await import(pathToFileURL(modulePath).href);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
unavailable("native-package-unavailable");
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (typeof plugin.apply !== "function") {
|
|
39
|
+
unavailable("native-package-unavailable");
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const before = new Map(ctx.get("tools")?.schemas().map((row) => [row.name, ctx.get("tools").get(row.name)]) ?? []);
|
|
43
|
+
try {
|
|
44
|
+
await ctx.plugin(plugin, toDshMcpClientConfig(settings)).await();
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
unavailable("native-tools-unavailable");
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const tools = ctx.get("tools");
|
|
51
|
+
const names = tools?.schemas().map((tool) => tool.name).filter((name) => name.startsWith(`mcp__${settings.serverName}__`)) ?? [];
|
|
52
|
+
if (names.length === 0) {
|
|
53
|
+
unavailable("native-tools-unavailable");
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (getSettings !== undefined) {
|
|
57
|
+
const owned = new Map(names.filter((name) => tools.get(name) !== before.get(name)).map((name) => [name, tools.get(name)]));
|
|
58
|
+
const dispose = tools.guard((execution) => execution.agent !== undefined
|
|
59
|
+
&& owned.has(execution.name) && owned.get(execution.name) === tools.get(execution.name, execution.agent)
|
|
60
|
+
&& !getSettings(execution.agent).modules.deepwork.enabled
|
|
61
|
+
? "Deepwork LSP is not admitted in this Agent" : undefined);
|
|
62
|
+
ctx.effect(() => dispose);
|
|
63
|
+
}
|
|
64
|
+
state = { state: "ready", tools: names };
|
|
65
|
+
ctx.on("tools/change", () => {
|
|
66
|
+
const names = tools.schemas().map((tool) => tool.name).filter((name) => name.startsWith(`mcp__${settings.serverName}__`));
|
|
67
|
+
state = names.length === 0 ? { state: "unavailable", diagnostic: "native-tools-unavailable", tools: [] } : { state: "ready", tools: names };
|
|
68
|
+
});
|
|
69
|
+
ctx.effect(() => () => { state = { state: "unavailable", diagnostic: "native-tools-unavailable", tools: [] }; });
|
|
70
|
+
}
|
|
13
71
|
export const DEFAULT_DSMM_LSP_SETTINGS = {
|
|
14
72
|
enabled: false,
|
|
15
73
|
serverName: "dsmm_lsp",
|
|
@@ -151,4 +209,6 @@ function isPlainYamlScalar(value) {
|
|
|
151
209
|
return false;
|
|
152
210
|
return !value.startsWith("---") && !value.startsWith("...");
|
|
153
211
|
}
|
|
212
|
+
import { createRequire } from "node:module";
|
|
213
|
+
import { pathToFileURL } from "node:url";
|
|
154
214
|
//# sourceMappingURL=lsp.js.map
|
package/lib/mode.js
CHANGED
|
@@ -1,62 +1,57 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Context, getTraceable } from "@deepseek-ai/cordis";
|
|
2
|
+
import { agentForScope, nativeAgentContext } from "./native-scope.js";
|
|
2
3
|
import { buildDeepworkPrompt } from "./prompts.js";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const header = context.agent?.session.requestHeader?.();
|
|
8
|
-
const { provider, model } = (header === undefined ? context.agent?.options : header.config) ?? {};
|
|
4
|
+
import { resolveEffectiveDsmmRole, resolveSelectedAgentPreset } from "./session-scope.js";
|
|
5
|
+
function routeFromAgent(agent) {
|
|
6
|
+
const header = agent.session.requestHeader?.();
|
|
7
|
+
const { provider, model } = (header === undefined ? agent.options : header.config) ?? {};
|
|
9
8
|
return typeof provider === "string" && typeof model === "string" ? { provider, model } : undefined;
|
|
10
9
|
}
|
|
11
10
|
export function registerDeepworkPrompt(readyCtx, controller, getSettings, config = {}) {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
order: getSettings().promptOrder,
|
|
15
|
-
interpolate: false,
|
|
16
|
-
text(context) {
|
|
17
|
-
const settings = getSettings(context.agent);
|
|
18
|
-
const preset = resolveSelectedAgentPreset(context.agent?.session);
|
|
19
|
-
const active = controller.active(context.agent, settings.defaultActive);
|
|
20
|
-
if (!active && !isDsmmRoleId(preset))
|
|
21
|
-
return "";
|
|
22
|
-
const skillPrompt = isDsmmRoleId(preset) ? "" : renderBundledSkillPrompt(enabledSkillNames(settings));
|
|
23
|
-
return buildDeepworkPrompt(settings, {
|
|
24
|
-
route: routeFromAgent(context),
|
|
25
|
-
selectedPreset: preset,
|
|
26
|
-
overrideSection: config.section,
|
|
27
|
-
skillPrompt
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
const installed = new WeakSet();
|
|
32
|
-
const install = (registry) => {
|
|
11
|
+
const agents = new Map();
|
|
12
|
+
const install = (ctx, registry, agent) => {
|
|
33
13
|
if (registry === undefined)
|
|
34
|
-
return;
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
14
|
+
return undefined;
|
|
15
|
+
const section = {
|
|
16
|
+
name: "dsmm:deepwork", order: getSettings().promptOrder, interpolate: false,
|
|
17
|
+
text(context) {
|
|
18
|
+
if (context.signal?.aborted)
|
|
19
|
+
return "";
|
|
20
|
+
const subject = agent !== undefined && context.scope === agent ? agent : agentForScope(readyCtx, context.scope);
|
|
21
|
+
if (subject === undefined)
|
|
22
|
+
return "";
|
|
23
|
+
const settings = getSettings(subject);
|
|
24
|
+
if (!settings.modules.deepwork.enabled || !controller.active(subject, settings.defaultActive))
|
|
25
|
+
return "";
|
|
26
|
+
return buildDeepworkPrompt(settings, { route: routeFromAgent(subject), selectedPreset: resolveSelectedAgentPreset(subject.session), roleId: resolveEffectiveDsmmRole(subject, settings, true) ?? null, overrideSection: config.section });
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
// Keep the caller's registration scope even when a primitive service is supplied.
|
|
30
|
+
const service = ctx instanceof Context ? getTraceable(ctx, registry) : registry;
|
|
31
|
+
return service.section(section);
|
|
45
32
|
};
|
|
46
|
-
|
|
47
|
-
? readyCtx.get("systemPrompt")
|
|
48
|
-
: readyCtx.systemPrompt;
|
|
49
|
-
install(registry);
|
|
33
|
+
install(readyCtx, readyCtx.get !== undefined ? readyCtx.get("systemPrompt") : readyCtx.systemPrompt);
|
|
50
34
|
const installForAgent = (agent) => {
|
|
35
|
+
agents.get(agent)?.();
|
|
36
|
+
agents.delete(agent);
|
|
37
|
+
const ctx = nativeAgentContext(agent);
|
|
51
38
|
const presets = readyCtx.get?.("agentPresets");
|
|
52
|
-
install(presets?.serviceFor(agent, "systemPrompt") ??
|
|
39
|
+
const dispose = install(ctx, presets?.serviceFor(agent, "systemPrompt") ?? ctx.get("systemPrompt"), agent);
|
|
40
|
+
if (dispose !== undefined)
|
|
41
|
+
agents.set(agent, dispose);
|
|
53
42
|
};
|
|
54
|
-
// Creation and blank-session selection both finish mounting before these events.
|
|
55
43
|
readyCtx.on?.("agent/created", ({ agent }) => installForAgent(agent), { global: true });
|
|
56
|
-
readyCtx.on?.("agent-preset/selected", (
|
|
57
|
-
const agent = readyCtx.get?.("agents")?.get(
|
|
44
|
+
readyCtx.on?.("agent-preset/selected", (id) => {
|
|
45
|
+
const agent = readyCtx.get?.("agents")?.get(id);
|
|
58
46
|
if (agent !== undefined)
|
|
59
47
|
installForAgent(agent);
|
|
60
48
|
}, { global: true });
|
|
49
|
+
readyCtx.on?.("agent/disposed", ({ agent }) => { agents.get(agent)?.(); agents.delete(agent); }, { global: true });
|
|
50
|
+
// Native fibers own each section. DSMM also releases the Agent-owned ones
|
|
51
|
+
// when its own plugin is unloaded while those Agents remain alive.
|
|
52
|
+
readyCtx.effect?.(() => () => { for (const dispose of agents.values())
|
|
53
|
+
dispose(); agents.clear(); });
|
|
54
|
+
for (const agent of readyCtx.get?.("agents")?.list() ?? [])
|
|
55
|
+
installForAgent(agent);
|
|
61
56
|
}
|
|
62
57
|
//# sourceMappingURL=mode.js.map
|
package/lib/model-routing.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isDsmmRoleId } from "./roles.js";
|
|
2
2
|
import { applyModelRoute, clearRoleRouteLock, effectiveRoleFallbackRoutes, establishRolePolicy, latestNativeModelSelection, nativeModelSelectionWasAccepted, orderedModelRoutes, persistedRoleRoute, pinRoleRoute, roleRouteLock, selectInitialModelRoute, sameExactModelRoute, sameModelRoute, takeAdmittedRecoveryRoute } from "./role-routing.js";
|
|
3
|
-
import {
|
|
3
|
+
import { resolveSelectedAgentPreset } from "./session-scope.js";
|
|
4
|
+
import { resolveAdmittedDsmmRole as resolveEffectiveDsmmRole } from "./role-policy.js";
|
|
4
5
|
import { childOwnedSessionEvents, sessionEvents } from "./session-scope.js";
|
|
5
6
|
import { isCurrentRecoveryStep } from "./recovery-policy.js";
|
|
6
7
|
export function isDeepseekV4ProRoute(config) {
|
|
@@ -58,6 +59,8 @@ export function registerModelRouting(ctx, controller, getSettings) {
|
|
|
58
59
|
if (frame.signal.aborted)
|
|
59
60
|
return downstream;
|
|
60
61
|
const settings = getSettings(frame.agent);
|
|
62
|
+
if (!settings.modules.deepwork.enabled)
|
|
63
|
+
return downstream;
|
|
61
64
|
const ordinaryRoot = frame.agent.session.header?.origin !== "subagent";
|
|
62
65
|
const admitted = takeAdmittedRecoveryRoute(frame);
|
|
63
66
|
const active = controller.active(frame.agent, settings.defaultActive);
|
|
@@ -150,7 +153,7 @@ export function registerModelRouting(ctx, controller, getSettings) {
|
|
|
150
153
|
const calibration = route === "flash" ? settings.deepseekFlashCalibration : settings.deepseekV4ProCalibration;
|
|
151
154
|
if (calibration === "off")
|
|
152
155
|
return downstream;
|
|
153
|
-
const preset = resolveSelectedAgentPreset(frame.agent?.session);
|
|
156
|
+
const preset = role ?? resolveSelectedAgentPreset(frame.agent?.session);
|
|
154
157
|
const inScope = active || isDsmmRoleId(preset);
|
|
155
158
|
if (!inScope)
|
|
156
159
|
return downstream;
|
package/lib/modules.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { DsmmDeploymentSnapshot, DsmmProfileAdmission, DsmmSettings } from "./settings.js";
|
|
2
|
+
/** Static first-party inventory, not a plugin/provider installation interface. */
|
|
3
|
+
export declare const DSMM_MODULE_DESCRIPTORS: readonly Readonly<{
|
|
4
|
+
id: "deepwork";
|
|
5
|
+
label: "Deepwork";
|
|
6
|
+
key: "modules.deepwork.enabled";
|
|
7
|
+
}>[];
|
|
8
|
+
export interface DsmmModuleState {
|
|
9
|
+
descriptor: typeof DSMM_MODULE_DESCRIPTORS[number];
|
|
10
|
+
hostBundleEnabled: "unknown";
|
|
11
|
+
desired: {
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
source: "defaults" | "global";
|
|
14
|
+
capture: "current-global" | "admission" | "startup";
|
|
15
|
+
};
|
|
16
|
+
startupMounted: boolean;
|
|
17
|
+
admitted: boolean | null;
|
|
18
|
+
nextRoot: {
|
|
19
|
+
admitted: boolean;
|
|
20
|
+
reason: "global-disabled" | "restart-required" | null;
|
|
21
|
+
};
|
|
22
|
+
reason: "global-disabled" | "restart-required" | "captured-off" | null;
|
|
23
|
+
pending: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare function deepworkEnabled(settings: DsmmSettings): boolean;
|
|
26
|
+
export declare function projectDeepworkModule(startup: DsmmSettings, desired?: DsmmDeploymentSnapshot, admission?: DsmmProfileAdmission, currentGlobal?: boolean): DsmmModuleState;
|
|
27
|
+
//# sourceMappingURL=modules.d.ts.map
|
package/lib/modules.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Static first-party inventory, not a plugin/provider installation interface. */
|
|
2
|
+
export const DSMM_MODULE_DESCRIPTORS = Object.freeze([
|
|
3
|
+
Object.freeze({ id: "deepwork", label: "Deepwork", key: "modules.deepwork.enabled" })
|
|
4
|
+
]);
|
|
5
|
+
export function deepworkEnabled(settings) { return settings.modules.deepwork.enabled; }
|
|
6
|
+
export function projectDeepworkModule(startup, desired, admission, currentGlobal = false) {
|
|
7
|
+
const enabled = desired?.settings.modules.deepwork.enabled ?? startup.modules.deepwork.enabled;
|
|
8
|
+
const mounted = deepworkEnabled(startup);
|
|
9
|
+
const admitted = admission === undefined ? null : deepworkEnabled(admission.settings);
|
|
10
|
+
const next = enabled && mounted;
|
|
11
|
+
const reason = !enabled ? "global-disabled" : !mounted ? "restart-required" : null;
|
|
12
|
+
return {
|
|
13
|
+
descriptor: { ...DSMM_MODULE_DESCRIPTORS[0] }, hostBundleEnabled: "unknown",
|
|
14
|
+
desired: { enabled, source: desired?.sources["modules.deepwork.enabled"] === "global" ? "global" : "defaults",
|
|
15
|
+
capture: currentGlobal ? "current-global" : admission === undefined ? "startup" : "admission" },
|
|
16
|
+
startupMounted: mounted, admitted, nextRoot: { admitted: next, reason },
|
|
17
|
+
reason: admitted === false && next ? "captured-off" : admitted === true ? null : reason,
|
|
18
|
+
pending: enabled !== mounted || admitted !== null && admitted !== next
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=modules.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import type { DshAgent, DshContext, DshSystemPromptContext } from "./dsh-types.js";
|
|
3
|
+
type NativeScopeKey = NonNullable<DshSystemPromptContext["scope"]>;
|
|
4
|
+
export declare const scopeOf: (ctx: Context) => NativeScopeKey | undefined, scopeParentOf: (key: NativeScopeKey) => NativeScopeKey | undefined;
|
|
5
|
+
export declare function nativeAgentContext(agent: DshAgent): Context;
|
|
6
|
+
/** A scope key is opaque; resolve identity against live Agents, not its fields. */
|
|
7
|
+
export declare function agentForScope(ctx: DshContext, key: object | undefined): DshAgent | undefined;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=native-scope.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
// Resolve through the declared SDK peer, not a developer/global installation.
|
|
4
|
+
const require = createRequire(import.meta.url);
|
|
5
|
+
const sdk = createRequire(require.resolve("@deepseek-ai/dsh-agent-preset-registry"));
|
|
6
|
+
const scope = sdk("@deepseek-ai/dsh-scope");
|
|
7
|
+
export const { scopeOf, scopeParentOf } = scope;
|
|
8
|
+
export function nativeAgentContext(agent) {
|
|
9
|
+
if (!(agent.ctx instanceof Context) || scopeOf(agent.ctx) !== agent) {
|
|
10
|
+
throw new Error("dsmm skills require the exact native Agent scope, never a shared preset/global scope");
|
|
11
|
+
}
|
|
12
|
+
return agent.ctx;
|
|
13
|
+
}
|
|
14
|
+
/** A scope key is opaque; resolve identity against live Agents, not its fields. */
|
|
15
|
+
export function agentForScope(ctx, key) {
|
|
16
|
+
if (key === undefined)
|
|
17
|
+
return undefined;
|
|
18
|
+
return ctx.get?.("agents")?.list().find((agent) => agent === key);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=native-scope.js.map
|
package/lib/plan-validation.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
1
|
import { isAbsolute, posix, relative, resolve, sep } from "node:path";
|
|
3
2
|
const GUARD_PREFIX = "[dsmm safety]";
|
|
4
3
|
const PLAN_PATH_PATTERN = /^(?:docs\/superpowers\/plans|\.omo\/plans)\/[^/]+\.md$/iu;
|
|
@@ -41,60 +40,23 @@ function malformedChecklistDecision(content) {
|
|
|
41
40
|
reason: `${GUARD_PREFIX} plan file contains a malformed checklist entry: ${malformed.trim()}`
|
|
42
41
|
};
|
|
43
42
|
}
|
|
44
|
-
function countMatches(content, search) {
|
|
45
|
-
let count = 0;
|
|
46
|
-
let start = 0;
|
|
47
|
-
while (start <= content.length - search.length) {
|
|
48
|
-
const match = content.indexOf(search, start);
|
|
49
|
-
if (match === -1)
|
|
50
|
-
break;
|
|
51
|
-
count += 1;
|
|
52
|
-
start = match + search.length;
|
|
53
|
-
}
|
|
54
|
-
return count;
|
|
55
|
-
}
|
|
56
|
-
function errorMessage(error) {
|
|
57
|
-
return error instanceof Error ? error.message : String(error);
|
|
58
|
-
}
|
|
59
43
|
function validateWrite(arguments_) {
|
|
60
44
|
if (typeof arguments_.content !== "string") {
|
|
61
45
|
return { kind: "deny", reason: `${GUARD_PREFIX} cannot validate plan write: content must be a string` };
|
|
62
46
|
}
|
|
63
47
|
return malformedChecklistDecision(arguments_.content);
|
|
64
48
|
}
|
|
65
|
-
function validateEdit(
|
|
49
|
+
function validateEdit(arguments_) {
|
|
66
50
|
if (typeof arguments_.old_string !== "string" || arguments_.old_string === "") {
|
|
67
|
-
return { kind: "deny", reason: `${GUARD_PREFIX} cannot validate plan edit
|
|
51
|
+
return { kind: "deny", reason: `${GUARD_PREFIX} cannot validate plan edit: old_string must be non-empty` };
|
|
68
52
|
}
|
|
69
53
|
if (typeof arguments_.new_string !== "string") {
|
|
70
|
-
return { kind: "deny", reason: `${GUARD_PREFIX} cannot validate plan edit
|
|
54
|
+
return { kind: "deny", reason: `${GUARD_PREFIX} cannot validate plan edit: new_string must be a string` };
|
|
71
55
|
}
|
|
72
56
|
if (arguments_.replace_all !== undefined && typeof arguments_.replace_all !== "boolean") {
|
|
73
|
-
return { kind: "deny", reason: `${GUARD_PREFIX} cannot validate plan edit
|
|
74
|
-
}
|
|
75
|
-
let current;
|
|
76
|
-
try {
|
|
77
|
-
current = readFileSync(target, "utf8");
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
return { kind: "deny", reason: `${GUARD_PREFIX} cannot read plan edit target ${suppliedPath}: ${errorMessage(error)}` };
|
|
81
|
-
}
|
|
82
|
-
const matchCount = countMatches(current, arguments_.old_string);
|
|
83
|
-
let finalDocument;
|
|
84
|
-
if (arguments_.replace_all === true) {
|
|
85
|
-
if (matchCount === 0) {
|
|
86
|
-
return { kind: "deny", reason: `${GUARD_PREFIX} cannot reconstruct plan edit for ${suppliedPath}: old_string was not found` };
|
|
87
|
-
}
|
|
88
|
-
finalDocument = current.split(arguments_.old_string).join(arguments_.new_string);
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
if (matchCount !== 1) {
|
|
92
|
-
return { kind: "deny", reason: `${GUARD_PREFIX} cannot reconstruct plan edit for ${suppliedPath}: expected exactly one old_string match, found ${String(matchCount)}` };
|
|
93
|
-
}
|
|
94
|
-
const match = current.indexOf(arguments_.old_string);
|
|
95
|
-
finalDocument = `${current.slice(0, match)}${arguments_.new_string}${current.slice(match + arguments_.old_string.length)}`;
|
|
57
|
+
return { kind: "deny", reason: `${GUARD_PREFIX} cannot validate plan edit: replace_all must be boolean` };
|
|
96
58
|
}
|
|
97
|
-
return
|
|
59
|
+
return { kind: "deny", reason: `${GUARD_PREFIX} unsupported-full-preview: protected plan edit requires an authorized complete pre-commit document preview, unavailable on rc.2. Use a complete document write; native permissions, observation and CAS still apply.` };
|
|
98
60
|
}
|
|
99
61
|
export function validatePlanMutation(exec) {
|
|
100
62
|
const name = exec.name.toLowerCase();
|
|
@@ -114,6 +76,6 @@ export function validatePlanMutation(exec) {
|
|
|
114
76
|
const targetRelative = normalizedPath(relative(cwd, target));
|
|
115
77
|
if (!PLAN_PATH_PATTERN.test(targetRelative))
|
|
116
78
|
return undefined;
|
|
117
|
-
return name === "write" ? validateWrite(arguments_) : validateEdit(
|
|
79
|
+
return name === "write" ? validateWrite(arguments_) : validateEdit(arguments_);
|
|
118
80
|
}
|
|
119
81
|
//# sourceMappingURL=plan-validation.js.map
|
|
@@ -53,6 +53,8 @@ export function materializeRolePresets(options) {
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
export function reconcileRolePresets({ root, settings, filesystem: filesystemOverride }) {
|
|
56
|
+
if (!settings.modules.deepwork.enabled)
|
|
57
|
+
return;
|
|
56
58
|
if (root.length === 0) {
|
|
57
59
|
throw new Error("dsmm preset materialization root must not be empty");
|
|
58
60
|
}
|
package/lib/preset-registry.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DshContext } from "./dsh-types.js";
|
|
2
2
|
import type { DsmmSettings } from "./settings.js";
|
|
3
3
|
/** Declare roles to DSH 0.2's native registry; directories are not discovery inputs. */
|
|
4
|
-
export declare function registerRolePresets(ctx: DshContext, getSettings: () => DsmmSettings): void
|
|
4
|
+
export declare function registerRolePresets(ctx: DshContext, getSettings: () => DsmmSettings): void | Promise<void>;
|
|
5
5
|
//# sourceMappingURL=preset-registry.d.ts.map
|