@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/commands.js
CHANGED
|
@@ -8,6 +8,8 @@ export function parseDeepworkCommandInput(rawInput) {
|
|
|
8
8
|
}
|
|
9
9
|
async function handleDeepworkCommand(controller, getSettings, invocation) {
|
|
10
10
|
const parsed = parseDeepworkCommandInput(invocation.rawInput);
|
|
11
|
+
if (parsed.action === "on" && !getSettings(invocation.agent).modules.deepwork.enabled)
|
|
12
|
+
return { kind: "error", text: "Deepwork module is not admitted in this session; mode cannot enable it." };
|
|
11
13
|
await controller.select(invocation.agent, parsed.action === "on", getSettings(invocation.agent).defaultActive);
|
|
12
14
|
if (parsed.action === "on" && parsed.message !== "") {
|
|
13
15
|
await invocation.agent.steer?.(createUserMessage({
|
|
@@ -28,6 +30,7 @@ function handleDsmmStatusCommand(controller, getSettings, invocation) {
|
|
|
28
30
|
agent: invocation.agent,
|
|
29
31
|
settings,
|
|
30
32
|
admission: getSettings.admission?.(invocation.agent),
|
|
33
|
+
modules: getSettings.moduleStates?.(invocation.agent),
|
|
31
34
|
modeActive: controller.active(invocation.agent, settings.defaultActive)
|
|
32
35
|
});
|
|
33
36
|
return {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ProfileStoreOptions } from "./profile-store.js";
|
|
2
|
+
export declare const MAX_CONFIG_FILE_BYTES = 65536;
|
|
3
|
+
export interface ConfigFileReadResult {
|
|
4
|
+
content: string | null;
|
|
5
|
+
revision: string;
|
|
6
|
+
}
|
|
7
|
+
/** Trusted backend only: the caller resolves the public SDK home and validates sparse JSON. */
|
|
8
|
+
export declare class FixedConfigFileStore {
|
|
9
|
+
private readonly directory;
|
|
10
|
+
private readonly path;
|
|
11
|
+
private readonly identities;
|
|
12
|
+
private readonly timeoutMs;
|
|
13
|
+
private readonly pollMs;
|
|
14
|
+
private readonly rename;
|
|
15
|
+
constructor(home: string, options?: ProfileStoreOptions);
|
|
16
|
+
read(): ConfigFileReadResult;
|
|
17
|
+
save(content: string, expectedRevision: string, assertCurrent?: () => void): Promise<{
|
|
18
|
+
content: string;
|
|
19
|
+
revision: string;
|
|
20
|
+
}>;
|
|
21
|
+
private validateRoot;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=config-file-store.d.ts.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { renameSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { profileStoreFilePrimitives as files } from "./profile-store.js";
|
|
4
|
+
import { DsmmProfileError, validateProfileRevision } from "./profiles.js";
|
|
5
|
+
export const MAX_CONFIG_FILE_BYTES = 65536;
|
|
6
|
+
/** Trusted backend only: the caller resolves the public SDK home and validates sparse JSON. */
|
|
7
|
+
export class FixedConfigFileStore {
|
|
8
|
+
directory;
|
|
9
|
+
path;
|
|
10
|
+
identities = new Map();
|
|
11
|
+
timeoutMs;
|
|
12
|
+
pollMs;
|
|
13
|
+
rename;
|
|
14
|
+
constructor(home, options = {}) {
|
|
15
|
+
this.directory = join(files.trustedHome(home), "plugins", "dsmm");
|
|
16
|
+
this.path = join(this.directory, "config.json");
|
|
17
|
+
this.timeoutMs = files.boundedOption(options.lockTimeoutMs, 2000, 0, 30000);
|
|
18
|
+
this.pollMs = files.boundedOption(options.lockPollMs, 25, 1, 1000);
|
|
19
|
+
this.rename = options.rename ?? renameSync;
|
|
20
|
+
this.validateRoot(false);
|
|
21
|
+
}
|
|
22
|
+
read() {
|
|
23
|
+
try {
|
|
24
|
+
this.validateRoot(false);
|
|
25
|
+
if (files.status(this.path) === undefined) {
|
|
26
|
+
this.validateRoot(false);
|
|
27
|
+
if (files.status(this.path) !== undefined)
|
|
28
|
+
throw new DsmmProfileError("conflict", "Global configuration changed while being read. Refresh before retrying.");
|
|
29
|
+
return { content: null, revision: "absent" };
|
|
30
|
+
}
|
|
31
|
+
const file = files.regularFile(this.path, MAX_CONFIG_FILE_BYTES);
|
|
32
|
+
this.validateRoot(false);
|
|
33
|
+
return { content: file.content, revision: file.revision };
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
if (error instanceof DsmmProfileError)
|
|
37
|
+
throw error;
|
|
38
|
+
throw new DsmmProfileError("io", "Global configuration could not be read safely.");
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async save(content, expectedRevision, assertCurrent) {
|
|
42
|
+
if (typeof content !== "string")
|
|
43
|
+
throw new DsmmProfileError("validation", "Global configuration must be UTF-8 text.", "content");
|
|
44
|
+
if (content.length > MAX_CONFIG_FILE_BYTES)
|
|
45
|
+
throw new DsmmProfileError("limit", "Global configuration must not exceed 64 KiB.", "content");
|
|
46
|
+
const bytes = Buffer.from(content, "utf8");
|
|
47
|
+
if (bytes.length > MAX_CONFIG_FILE_BYTES)
|
|
48
|
+
throw new DsmmProfileError("limit", "Global configuration must not exceed 64 KiB.", "content");
|
|
49
|
+
if (bytes.toString("utf8") !== content)
|
|
50
|
+
throw new DsmmProfileError("validation", "Global configuration must round-trip through UTF-8.", "content");
|
|
51
|
+
if (expectedRevision !== "absent")
|
|
52
|
+
validateProfileRevision(expectedRevision);
|
|
53
|
+
return files.locked(this.directory, ".config.lock", (create) => this.validateRoot(create), this.timeoutMs, this.pollMs, (assertLock) => {
|
|
54
|
+
const recheck = () => {
|
|
55
|
+
if (this.read().revision !== expectedRevision)
|
|
56
|
+
throw new DsmmProfileError("conflict", "Global configuration changed. Refresh before saving; existing bytes were retained.");
|
|
57
|
+
};
|
|
58
|
+
recheck();
|
|
59
|
+
files.atomicReplace(this.path, bytes, recheck, assertLock, this.rename, assertCurrent);
|
|
60
|
+
return { content, revision: files.digest(bytes) };
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
validateRoot(create) {
|
|
64
|
+
files.validateDirectories(this.directory, create, true, this.identities);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=config-file-store.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { DshContext } from "./dsh-types.js";
|
|
2
|
+
import { FixedConfigFileStore } from "./config-file-store.js";
|
|
3
|
+
import type { DsmmDeploymentSnapshot, DsmmPluginConfig } from "./settings.js";
|
|
4
|
+
export type DeploymentPathEdit = {
|
|
5
|
+
op: "set";
|
|
6
|
+
path: string[];
|
|
7
|
+
value: unknown;
|
|
8
|
+
} | {
|
|
9
|
+
op: "unset";
|
|
10
|
+
path: string[];
|
|
11
|
+
};
|
|
12
|
+
export interface GlobalConfigSaveRequest {
|
|
13
|
+
expectedRevision: string;
|
|
14
|
+
edits: DeploymentPathEdit[];
|
|
15
|
+
}
|
|
16
|
+
export interface GlobalConfigSnapshot {
|
|
17
|
+
config: DsmmPluginConfig;
|
|
18
|
+
revision: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function parseGlobalConfig(content: string | null): DsmmPluginConfig;
|
|
21
|
+
/** Only schema fields, never filesystem paths or array indexes. Full candidate is revalidated. */
|
|
22
|
+
export declare function editGlobalConfig(config: DsmmPluginConfig, edits: DeploymentPathEdit[]): DsmmPluginConfig;
|
|
23
|
+
/** One native entry's desired reader and one fixed global base; no scheduler or mirror. */
|
|
24
|
+
export declare class DsmmDeploymentConfig {
|
|
25
|
+
private readonly ctx;
|
|
26
|
+
private readonly config;
|
|
27
|
+
readonly home: string;
|
|
28
|
+
readonly store: FixedConfigFileStore;
|
|
29
|
+
readonly entryId: string;
|
|
30
|
+
readonly hostProfileKey: string;
|
|
31
|
+
constructor(ctx: DshContext, config: DsmmPluginConfig);
|
|
32
|
+
private profile;
|
|
33
|
+
readGlobal(): Promise<GlobalConfigSnapshot>;
|
|
34
|
+
readDesired(): Promise<DsmmDeploymentSnapshot>;
|
|
35
|
+
saveGlobal(request: GlobalConfigSaveRequest, assertAuthority: () => void): Promise<GlobalConfigSnapshot>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=deployment-config.d.ts.map
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
3
|
+
import { parseTree } from "jsonc-parser";
|
|
4
|
+
import { resolveDshHome } from "./dsh-home.js";
|
|
5
|
+
import { FixedConfigFileStore } from "./config-file-store.js";
|
|
6
|
+
import { copyJson, freezeSettings, resolveDeployment, validateDeploymentPath, validateSparseConfig } from "./settings.js";
|
|
7
|
+
import { DsmmProfileError } from "./profiles.js";
|
|
8
|
+
import { resolve } from "node:path";
|
|
9
|
+
function configurationError() { throw new DsmmProfileError("validation", "Deepwork deployment configuration is invalid; restore valid plain JSON before saving or admitting a new session."); }
|
|
10
|
+
function validateJsonTree(node, depth = 0) {
|
|
11
|
+
if (depth > 64)
|
|
12
|
+
configurationError();
|
|
13
|
+
if (node.type === "object") {
|
|
14
|
+
const names = (node.children ?? []).map((property) => property.children?.[0]?.value);
|
|
15
|
+
if (new Set(names).size !== names.length)
|
|
16
|
+
configurationError();
|
|
17
|
+
}
|
|
18
|
+
for (const child of node.children ?? [])
|
|
19
|
+
validateJsonTree(child, depth + 1);
|
|
20
|
+
}
|
|
21
|
+
export function parseGlobalConfig(content) {
|
|
22
|
+
if (content === null)
|
|
23
|
+
return {};
|
|
24
|
+
const errors = [];
|
|
25
|
+
const tree = parseTree(content, errors, { disallowComments: true, allowTrailingComma: false, allowEmptyContent: false });
|
|
26
|
+
if (tree?.type !== "object" || errors.length > 0)
|
|
27
|
+
configurationError();
|
|
28
|
+
validateJsonTree(tree);
|
|
29
|
+
try {
|
|
30
|
+
return validateSparseConfig(JSON.parse(content), true);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return configurationError();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/** Only schema fields, never filesystem paths or array indexes. Full candidate is revalidated. */
|
|
37
|
+
export function editGlobalConfig(config, edits) {
|
|
38
|
+
let result = copyJson(config);
|
|
39
|
+
if (!Array.isArray(edits) || edits.length > 128)
|
|
40
|
+
configurationError();
|
|
41
|
+
for (const input of edits) {
|
|
42
|
+
const edit = copyJson(input);
|
|
43
|
+
if (edit === null || typeof edit !== "object" || !["set", "unset"].includes(edit.op)
|
|
44
|
+
|| Object.keys(edit).some((key) => !["op", "path", ...edit.op === "set" ? ["value"] : []].includes(key))
|
|
45
|
+
|| edit.op === "set" && !Object.hasOwn(edit, "value")
|
|
46
|
+
|| !Array.isArray(edit.path) || edit.path.length === 0 || edit.path.length > 8
|
|
47
|
+
|| edit.path.some((key) => typeof key !== "string" || !/^[a-zA-Z][a-zA-Z0-9_-]*$/u.test(key) || ["constructor", "prototype", "__proto__"].includes(key)))
|
|
48
|
+
configurationError();
|
|
49
|
+
try {
|
|
50
|
+
validateDeploymentPath(edit.path);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
configurationError();
|
|
54
|
+
}
|
|
55
|
+
let node = result;
|
|
56
|
+
for (const key of edit.path.slice(0, -1)) {
|
|
57
|
+
const child = node[key];
|
|
58
|
+
if (child !== undefined && (child === null || typeof child !== "object" || Array.isArray(child)))
|
|
59
|
+
configurationError();
|
|
60
|
+
node = (node[key] ??= {});
|
|
61
|
+
}
|
|
62
|
+
const key = edit.path.at(-1);
|
|
63
|
+
if (edit.op === "set")
|
|
64
|
+
node[key] = copyJson(edit.value);
|
|
65
|
+
else
|
|
66
|
+
Reflect.deleteProperty(node, key);
|
|
67
|
+
try {
|
|
68
|
+
result = validateSparseConfig(result, true);
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
configurationError();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
function hash(input) { return createHash("sha256").update(JSON.stringify(input)).digest("hex"); }
|
|
77
|
+
function presentValue(parsed, raw) {
|
|
78
|
+
if (raw !== null && typeof raw === "object" && !Array.isArray(raw)) {
|
|
79
|
+
if (parsed === null || typeof parsed !== "object")
|
|
80
|
+
configurationError();
|
|
81
|
+
return Object.fromEntries(Object.entries(raw).map(([key, value]) => [key, presentValue(Reflect.get(parsed, key), value)]));
|
|
82
|
+
}
|
|
83
|
+
return copyJson(parsed);
|
|
84
|
+
}
|
|
85
|
+
function sources(global, profile, settings) {
|
|
86
|
+
const result = {};
|
|
87
|
+
const walk = (value, path, lower, upper) => {
|
|
88
|
+
if (value !== null && typeof value === "object" && !Array.isArray(value)) {
|
|
89
|
+
for (const [key, child] of Object.entries(value))
|
|
90
|
+
walk(child, [...path, key], lower !== null && typeof lower === "object" ? Reflect.get(lower, key) : undefined, upper !== null && typeof upper === "object" ? Reflect.get(upper, key) : undefined);
|
|
91
|
+
}
|
|
92
|
+
else
|
|
93
|
+
result[path.join(".")] = upper !== undefined ? "profile" : lower !== undefined ? "global" : "defaults";
|
|
94
|
+
};
|
|
95
|
+
walk(settings, [], global, profile);
|
|
96
|
+
if (global.workflow?.policy === undefined && profile.workflow?.policy === undefined) {
|
|
97
|
+
const legacyControls = (config) => ["strictGates", "reviewCap", "finalReviewPolicy"].some((key) => config.workflow !== undefined && Object.hasOwn(config.workflow, key));
|
|
98
|
+
if (legacyControls(profile))
|
|
99
|
+
result["workflow.policy"] = "profile";
|
|
100
|
+
else if (legacyControls(global))
|
|
101
|
+
result["workflow.policy"] = "global";
|
|
102
|
+
}
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
/** One native entry's desired reader and one fixed global base; no scheduler or mirror. */
|
|
106
|
+
export class DsmmDeploymentConfig {
|
|
107
|
+
ctx;
|
|
108
|
+
config;
|
|
109
|
+
home;
|
|
110
|
+
store;
|
|
111
|
+
entryId;
|
|
112
|
+
hostProfileKey;
|
|
113
|
+
constructor(ctx, config) {
|
|
114
|
+
this.ctx = ctx;
|
|
115
|
+
this.config = config;
|
|
116
|
+
const profile = ctx.get?.("profileContext");
|
|
117
|
+
this.home = resolveDshHome(profile?.home);
|
|
118
|
+
this.store = new FixedConfigFileStore(this.home);
|
|
119
|
+
const entry = ctx instanceof Context ? ctx.fiber.entry : undefined;
|
|
120
|
+
this.entryId = entry?.id ?? "trusted-direct";
|
|
121
|
+
const identity = profile?.dir === undefined ? "trusted-direct" : resolve(profile.dir);
|
|
122
|
+
this.hostProfileKey = hash([process.platform === "win32" ? identity.toLowerCase() : identity, this.entryId]);
|
|
123
|
+
}
|
|
124
|
+
profile() {
|
|
125
|
+
const entry = this.ctx instanceof Context ? this.ctx.fiber.entry : undefined;
|
|
126
|
+
const raw = entry === undefined ? Object.fromEntries(Object.entries(this.config).flatMap(([key, parsed]) => {
|
|
127
|
+
const value = parsed !== null && typeof parsed === "object" && "get" in parsed && typeof parsed.get === "function" ? parsed.get() : parsed;
|
|
128
|
+
return value === undefined ? [] : [[key, value]];
|
|
129
|
+
})) : entry.options.config ?? {};
|
|
130
|
+
try {
|
|
131
|
+
const presence = validateSparseConfig(raw);
|
|
132
|
+
const snapshot = {};
|
|
133
|
+
for (const key of Object.keys(presence)) {
|
|
134
|
+
const parsed = Reflect.get(this.config, key);
|
|
135
|
+
const value = parsed !== null && typeof parsed === "object" && "get" in parsed && typeof parsed.get === "function" ? parsed.get() : parsed;
|
|
136
|
+
snapshot[key] = presentValue(value, Reflect.get(presence, key));
|
|
137
|
+
}
|
|
138
|
+
return { config: validateSparseConfig(snapshot), revision: hash(presence) };
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
return configurationError();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
async readGlobal() {
|
|
145
|
+
const file = await this.store.read();
|
|
146
|
+
return { config: parseGlobalConfig(file.content), revision: file.revision };
|
|
147
|
+
}
|
|
148
|
+
async readDesired() {
|
|
149
|
+
const profile = this.profile();
|
|
150
|
+
const global = await this.readGlobal();
|
|
151
|
+
let settings;
|
|
152
|
+
try {
|
|
153
|
+
settings = resolveDeployment(global.config, profile.config);
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
return configurationError();
|
|
157
|
+
}
|
|
158
|
+
const entry = this.ctx instanceof Context ? this.ctx.fiber.entry : undefined;
|
|
159
|
+
const descriptor = entry === undefined ? undefined : this.ctx.get?.("settings")?.describe({ redactSecrets: true }).find((row) => row.ns === entry.options.id);
|
|
160
|
+
if (this.profile().revision !== profile.revision || this.store.read().revision !== global.revision)
|
|
161
|
+
throw new DsmmProfileError("conflict", "Deployment sources changed while projecting native state; refresh before retrying.");
|
|
162
|
+
return freezeSettings({ settings, global: global.config, profile: profile.config, globalRevision: global.revision, nativeRevision: profile.revision,
|
|
163
|
+
entryId: this.entryId, hostProfileKey: this.hostProfileKey, ...(entry === undefined ? {} : { nativeNamespace: entry.options.id }),
|
|
164
|
+
...(descriptor === undefined ? {} : { nativeFormRevision: descriptor.revision, nativeForm: {
|
|
165
|
+
...(descriptor.base === undefined ? {} : { base: descriptor.base }), ...(descriptor.user === undefined ? {} : { user: descriptor.user })
|
|
166
|
+
} }), sources: sources(global.config, profile.config, settings) });
|
|
167
|
+
}
|
|
168
|
+
async saveGlobal(request, assertAuthority) {
|
|
169
|
+
assertAuthority();
|
|
170
|
+
const current = await this.readGlobal();
|
|
171
|
+
if (current.revision !== request.expectedRevision)
|
|
172
|
+
throw new DsmmProfileError("conflict", "The global base changed; refresh before saving.");
|
|
173
|
+
const config = editGlobalConfig(current.config, request.edits);
|
|
174
|
+
try {
|
|
175
|
+
resolveDeployment(config, this.profile().config);
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
configurationError();
|
|
179
|
+
}
|
|
180
|
+
const saved = await this.store.save(`${JSON.stringify(config, null, 2)}\n`, request.expectedRevision, assertAuthority);
|
|
181
|
+
return { config, revision: saved.revision };
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=deployment-config.js.map
|
package/lib/dsh-home.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
const require = createRequire(import.meta.url);
|
|
3
|
+
// filesystem declares this public peer; incidental preset-registry resolution is not a contract.
|
|
4
|
+
const sdk = createRequire(require.resolve("@deepseek-ai/dsh-skill-filesystem"));
|
|
5
|
+
const home = sdk("@deepseek-ai/dsh-home-paths");
|
|
6
|
+
if (typeof home.resolveDshHome !== "function")
|
|
7
|
+
throw new Error("Deepwork requires the public rc.2 DSH home resolver");
|
|
8
|
+
/** Trusted host/fixture input only, never a model or RPC root argument. */
|
|
9
|
+
export const resolveDshHome = home.resolveDshHome;
|
|
10
|
+
//# sourceMappingURL=dsh-home.js.map
|
package/lib/dsh-types.d.ts
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
get(): T;
|
|
3
|
-
watch?(callback: (next: T, prev: T) => void | Promise<void>): () => void;
|
|
4
|
-
}
|
|
5
|
-
export interface DshSettingsRegistry {
|
|
6
|
-
register<T>(namespace: string, schema: unknown, options: {
|
|
7
|
-
base: Partial<T>;
|
|
8
|
-
applies?: "live" | "restart";
|
|
9
|
-
}): SettingsScope<T>;
|
|
10
|
-
}
|
|
1
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
11
2
|
export interface DshSessionEvent {
|
|
12
3
|
type: string;
|
|
13
4
|
data?: unknown;
|
|
@@ -62,7 +53,6 @@ export interface DshLlmCallConfig {
|
|
|
62
53
|
temperature?: number;
|
|
63
54
|
maxTokens?: number;
|
|
64
55
|
stop?: unknown;
|
|
65
|
-
[key: string]: unknown;
|
|
66
56
|
}
|
|
67
57
|
export interface DshLlmFailure {
|
|
68
58
|
readonly message: string;
|
|
@@ -73,24 +63,20 @@ export interface DshLlmFailure {
|
|
|
73
63
|
}
|
|
74
64
|
export interface DshEpochHeader {
|
|
75
65
|
config: DshLlmCallConfig;
|
|
76
|
-
[key: string]: unknown;
|
|
77
66
|
}
|
|
78
67
|
export interface DshReasoningEffortInfo {
|
|
79
68
|
id: string;
|
|
80
69
|
name: string;
|
|
81
|
-
[key: string]: unknown;
|
|
82
70
|
}
|
|
83
71
|
export interface DshModelReasoningInfo {
|
|
84
72
|
efforts: readonly DshReasoningEffortInfo[];
|
|
85
73
|
defaultEffort?: string;
|
|
86
|
-
[key: string]: unknown;
|
|
87
74
|
}
|
|
88
75
|
export interface DshResolvedModelInfo {
|
|
89
76
|
provider: string;
|
|
90
77
|
id: string;
|
|
91
78
|
name: string;
|
|
92
79
|
reasoning?: DshModelReasoningInfo;
|
|
93
|
-
[key: string]: unknown;
|
|
94
80
|
}
|
|
95
81
|
export interface DshLlmRuntime {
|
|
96
82
|
resolveModelInfo(provider: string, model: string, signal?: AbortSignal): Promise<DshResolvedModelInfo>;
|
|
@@ -163,28 +149,13 @@ export type DshGoalChangeEventData = {
|
|
|
163
149
|
};
|
|
164
150
|
clearedAt: number;
|
|
165
151
|
};
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
export interface DshSystemPromptSection {
|
|
171
|
-
name: string;
|
|
172
|
-
order: number;
|
|
173
|
-
interpolate?: boolean;
|
|
152
|
+
type NativePromptRegistry = Context["systemPrompt"];
|
|
153
|
+
export type DshSystemPromptContext = Pick<NonNullable<Parameters<NativePromptRegistry["assemble"]>[0]>, "scope" | "signal">;
|
|
154
|
+
export type DshSystemPromptSection = Omit<Parameters<NativePromptRegistry["section"]>[0], "text"> & {
|
|
174
155
|
text(context: DshSystemPromptContext): string;
|
|
175
|
-
}
|
|
156
|
+
};
|
|
176
157
|
export interface DshSystemPromptRegistry {
|
|
177
|
-
section(section: DshSystemPromptSection):
|
|
178
|
-
}
|
|
179
|
-
export interface DshPromptAssembly {
|
|
180
|
-
sections: Array<{
|
|
181
|
-
name: string;
|
|
182
|
-
text: string;
|
|
183
|
-
interpolate?: boolean;
|
|
184
|
-
}>;
|
|
185
|
-
contexts: unknown[];
|
|
186
|
-
tools: unknown[];
|
|
187
|
-
variables: Record<string, string | undefined>;
|
|
158
|
+
section(section: DshSystemPromptSection): ReturnType<NativePromptRegistry["section"]>;
|
|
188
159
|
}
|
|
189
160
|
export interface DshCommandInvocation {
|
|
190
161
|
agent: DshAgent;
|
|
@@ -207,27 +178,11 @@ export interface DshCommandsRegistry {
|
|
|
207
178
|
handler(invocation: DshCommandInvocation): DshCommandResult | Promise<DshCommandResult>;
|
|
208
179
|
}): unknown;
|
|
209
180
|
}
|
|
210
|
-
export
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
provider?: string;
|
|
216
|
-
resourceBase?: {
|
|
217
|
-
kind: "directory";
|
|
218
|
-
path: string;
|
|
219
|
-
} | {
|
|
220
|
-
kind: "opaque";
|
|
221
|
-
description: string;
|
|
222
|
-
};
|
|
223
|
-
invocation?: {
|
|
224
|
-
modelInvocable: boolean;
|
|
225
|
-
userInvocable: boolean;
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
export interface DshSkillRegistry {
|
|
229
|
-
register(skill: DshSkillRegistration): unknown;
|
|
230
|
-
}
|
|
181
|
+
export type DshSkillRegistry = Pick<Context["skills"], "registerProvider" | "snapshot" | "list" | "get">;
|
|
182
|
+
export type DshSkillRegistration = NonNullable<Awaited<ReturnType<DshSkillRegistry["get"]>>>;
|
|
183
|
+
export type DshSkillProvider = ReturnType<Parameters<DshSkillRegistry["registerProvider"]>[0]>;
|
|
184
|
+
export type DshSkillCandidate = Parameters<DshSkillProvider["get"]>[0];
|
|
185
|
+
export type DshSkillLookupOptions = Parameters<DshSkillProvider["list"]>[0];
|
|
231
186
|
export interface DshContentBlock {
|
|
232
187
|
type: string;
|
|
233
188
|
text?: string;
|
|
@@ -280,14 +235,6 @@ export interface DshToolRuntime {
|
|
|
280
235
|
get?(name: string): unknown;
|
|
281
236
|
}
|
|
282
237
|
export type DshEventListener = (...args: any[]) => any;
|
|
283
|
-
export interface DshInjectedServices {
|
|
284
|
-
settings?: DshSettingsRegistry;
|
|
285
|
-
skills?: DshSkillRegistry;
|
|
286
|
-
commands?: DshCommandsRegistry;
|
|
287
|
-
tools?: DshToolRuntime;
|
|
288
|
-
llm?: DshLlmRuntime;
|
|
289
|
-
[key: string]: unknown;
|
|
290
|
-
}
|
|
291
238
|
export interface PreStepFrame {
|
|
292
239
|
agent: DshAgent;
|
|
293
240
|
signal: AbortSignal;
|
|
@@ -300,7 +247,6 @@ export interface PreStepDecision {
|
|
|
300
247
|
export interface DshContext {
|
|
301
248
|
agents?: DshAgentsRegistry;
|
|
302
249
|
subagents?: import("./role-providers.js").DsmmSubagentRegistry;
|
|
303
|
-
settings?: DshSettingsRegistry;
|
|
304
250
|
systemPrompt?: DshSystemPromptRegistry;
|
|
305
251
|
skills?: DshSkillRegistry;
|
|
306
252
|
commands?: DshCommandsRegistry;
|
|
@@ -329,4 +275,5 @@ export interface DshContext {
|
|
|
329
275
|
warn(message: string, ...args: unknown[]): void;
|
|
330
276
|
};
|
|
331
277
|
}
|
|
278
|
+
export {};
|
|
332
279
|
//# sourceMappingURL=dsh-types.d.ts.map
|
package/lib/guards.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { DshContext, DshPostToolDecision, DshPreToolDecision, DshToolExecution, DshToolExecutionResult } from "./dsh-types.js";
|
|
2
2
|
import type { DsmmSettings, DsmmSettingsGetter } from "./settings.js";
|
|
3
3
|
import type { DeepworkModeController } from "./state.js";
|
|
4
|
+
import type { DsmmRolePolicy } from "./role-policy.js";
|
|
4
5
|
export declare const DSMM_GUARD_PREFIX = "[dsmm safety]";
|
|
5
6
|
export declare function truncateTextMiddle(text: string, maxBytes: number, toolName: string): string;
|
|
6
7
|
export declare function isSafetyScopeActive(exec: DshToolExecution, settings: DsmmSettings, controller: DeepworkModeController): boolean;
|
|
7
8
|
export declare function decidePreToolExecution(exec: DshToolExecution, settings: DsmmSettings, controller: DeepworkModeController): DshPreToolDecision | undefined;
|
|
8
9
|
export declare function decidePostToolExecution(exec: DshToolExecution, result: Readonly<DshToolExecutionResult>, decision: DshPostToolDecision, settings: DsmmSettings, controller: DeepworkModeController): DshPostToolDecision;
|
|
9
|
-
export declare function registerSafetyGuards(ctx: DshContext, controller: DeepworkModeController, getSettings: DsmmSettingsGetter): void;
|
|
10
|
+
export declare function registerSafetyGuards(ctx: DshContext, controller: DeepworkModeController, getSettings: DsmmSettingsGetter, rolePolicy?: DsmmRolePolicy): void;
|
|
10
11
|
//# sourceMappingURL=guards.d.ts.map
|
package/lib/guards.js
CHANGED
|
@@ -2,6 +2,7 @@ import { isDsmmRoleId } from "./roles.js";
|
|
|
2
2
|
import { resolveSelectedAgentPreset } from "./session-scope.js";
|
|
3
3
|
import { validatePlanMutation } from "./plan-validation.js";
|
|
4
4
|
import { classifyKnownGitWrite, classifyShellDialectViolation } from "./shell-command.js";
|
|
5
|
+
import { resolveAdmittedDsmmRole } from "./role-policy.js";
|
|
5
6
|
export const DSMM_GUARD_PREFIX = "[dsmm safety]";
|
|
6
7
|
const STRUCTURED_TODO_PATTERN = /^\[[^\]]+\]\s+\[[^\]]+\]\s+to\s+.+\s+-\s+expect\s+.+/u;
|
|
7
8
|
function asRecord(value) {
|
|
@@ -78,6 +79,10 @@ export function isSafetyScopeActive(exec, settings, controller) {
|
|
|
78
79
|
return false;
|
|
79
80
|
if (settings.guards.scope === "always")
|
|
80
81
|
return true;
|
|
82
|
+
if (!settings.modules.deepwork.enabled)
|
|
83
|
+
return false;
|
|
84
|
+
if (exec.agent !== undefined && resolveAdmittedDsmmRole(exec.agent, settings, false) !== undefined)
|
|
85
|
+
return true;
|
|
81
86
|
if (controller.active(exec.agent, settings.defaultActive))
|
|
82
87
|
return true;
|
|
83
88
|
return isDsmmRoleId(resolveSelectedAgentPreset(exec.agent?.session));
|
|
@@ -204,6 +209,8 @@ export function decidePreToolExecution(exec, settings, controller) {
|
|
|
204
209
|
const git = gitWriteDecision(exec, settings);
|
|
205
210
|
if (git !== undefined)
|
|
206
211
|
return git;
|
|
212
|
+
if (!settings.modules.deepwork.enabled)
|
|
213
|
+
return undefined;
|
|
207
214
|
if (settings.guards.planFormatValidation) {
|
|
208
215
|
const plan = validatePlanMutation(exec);
|
|
209
216
|
if (plan !== undefined)
|
|
@@ -221,7 +228,7 @@ export function decidePreToolExecution(exec, settings, controller) {
|
|
|
221
228
|
}
|
|
222
229
|
export function decidePostToolExecution(exec, result, decision, settings, controller) {
|
|
223
230
|
const truncation = settings.guards.toolOutputTruncation;
|
|
224
|
-
if (!truncation.enabled || !isSafetyScopeActive(exec, settings, controller))
|
|
231
|
+
if (!settings.modules.deepwork.enabled || !truncation.enabled || !isSafetyScopeActive(exec, settings, controller))
|
|
225
232
|
return decision;
|
|
226
233
|
if (result.isError || decision.kind !== "accept" || "value" in decision)
|
|
227
234
|
return decision;
|
|
@@ -234,8 +241,18 @@ export function decidePostToolExecution(exec, result, decision, settings, contro
|
|
|
234
241
|
content: [{ type: "text", text: truncateTextMiddle(text, truncation.maxInlineBytes, exec.name) }]
|
|
235
242
|
};
|
|
236
243
|
}
|
|
237
|
-
export function registerSafetyGuards(ctx, controller, getSettings) {
|
|
244
|
+
export function registerSafetyGuards(ctx, controller, getSettings, rolePolicy) {
|
|
245
|
+
const tools = ctx.get?.("tools");
|
|
246
|
+
if (rolePolicy !== undefined && tools !== undefined) {
|
|
247
|
+
const guard = tools.guard((execution) => execution.agent === undefined ? undefined : rolePolicy.toolDenial(execution.agent, execution.name, tools));
|
|
248
|
+
ctx.effect?.(() => guard);
|
|
249
|
+
}
|
|
238
250
|
ctx.on?.("tools/pre-execute", async (exec, next) => {
|
|
251
|
+
// Role authority precedes optional workflow helpers in every tool realm;
|
|
252
|
+
// turning common/guards off cannot grant a read-only role a mutation.
|
|
253
|
+
const denied = exec.agent === undefined ? undefined : rolePolicy?.toolDenial(exec.agent, exec.name);
|
|
254
|
+
if (denied !== undefined)
|
|
255
|
+
return { kind: "deny", reason: denied };
|
|
239
256
|
const decision = decidePreToolExecution(exec, getSettings(exec.agent), controller);
|
|
240
257
|
if (decision === undefined)
|
|
241
258
|
return next();
|
package/lib/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { DSMM_ROLE_IDS, DSMM_ROLES, isDsmmRoleId, renderAgentCordis, renderPrese
|
|
|
10
10
|
export { DSMM_MANAGED_PRESET_MARKER, materializeRolePresets, reconcileRolePresets, resolveManagedPresetRoot } from "./preset-materializer.js";
|
|
11
11
|
export { DSMM_GUARD_PREFIX, decidePostToolExecution, decidePreToolExecution, isSafetyScopeActive, registerSafetyGuards, truncateTextMiddle } from "./guards.js";
|
|
12
12
|
export { DEFAULT_DSMM_LSP_SETTINGS, DSMM_LSP_SERVER_NAME, DSMM_LSP_TOOL_NAMES, parseLspSmokeCommand, publicLspToolName, renderLspMcpPatch, resolveLspSettings, toDshMcpClientConfig } from "./lsp.js";
|
|
13
|
-
export type { DshMcpStdioConfig, DsmmLspSettings, DsmmLspToolName } from "./lsp.js";
|
|
13
|
+
export type { DshMcpStdioConfig, DsmmLspSettings, DsmmLspToolName, DsmmLspRuntimeState } from "./lsp.js";
|
|
14
14
|
export { classifyModelFamily } from "./model-family.js";
|
|
15
15
|
export type { DsmmModelFamily } from "./model-family.js";
|
|
16
16
|
export { desiredDeepseekEffort, isDeepseekV4ProRoute, registerModelRouting, selectAdvertisedEffort } from "./model-routing.js";
|
|
@@ -27,7 +27,14 @@ export type { DsmmStatusSnapshot } from "./status.js";
|
|
|
27
27
|
export type { AgentRequestErrorFrame, AgentRequestFrame, AgentTurnStoppingFrame, DshEpochHeader, DshGoalChangeEventData, DshGoalSnapshot, DshLlmCallConfig, DshLlmFailure, DshModelReasoningInfo, DshReasoningEffortInfo, DshRequestErrorAction, DshRequestHeaderEventData, DshResolvedModelInfo, DshStepBoundaryEventData, DshTodoItem, DshTodoWriteEventData } from "./dsh-types.js";
|
|
28
28
|
export { DSMM_SKILL_NAMES, DEFAULT_DSMM_SETTINGS, MVP_SKILL_NAMES, isRoleEnabled, resolveConfig, resolveRoleRouting, registerSettings } from "./settings.js";
|
|
29
29
|
export type { DeepseekCalibration, DeepseekDefaultReasoningEffort, DsmmFinalReviewPolicy, DsmmGitWritePolicy, DsmmGuardScope, DsmmGuardSettings, DsmmPluginConfig, DsmmModelRoute, DsmmRoleRoutingConfig, DsmmRoleRouting, DsmmRecoveryRoute, DsmmRuntimeRecoverySettings, DsmmSettings, DsmmSettingsGetter, DsmmSkillName, DsmmWorkflowSettings, MvpSkillName } from "./settings.js";
|
|
30
|
+
export type { DsmmSubagentSettings } from "./settings.js";
|
|
30
31
|
export { createProfileRuntime, DsmmProfileRuntime } from "./profile-runtime.js";
|
|
32
|
+
export { resolveDshHome } from "./dsh-home.js";
|
|
33
|
+
export { DsmmDeploymentConfig, parseGlobalConfig, editGlobalConfig } from "./deployment-config.js";
|
|
34
|
+
export type { GlobalConfigSnapshot, GlobalConfigSaveRequest, DeploymentPathEdit } from "./deployment-config.js";
|
|
35
|
+
export type { DsmmDeploymentSnapshot } from "./settings.js";
|
|
36
|
+
export { DSMM_MODULE_DESCRIPTORS, deepworkEnabled, projectDeepworkModule } from "./modules.js";
|
|
37
|
+
export type { DsmmModuleState } from "./modules.js";
|
|
31
38
|
export type { DsmmProfileRuntimeStore, DsmmProfileRuntimeOptions } from "./profile-runtime.js";
|
|
32
39
|
export { DEEPWORK_MODE_EVENT, DeepworkModeController, hasOpenTurn, isDeepworkActive } from "./state.js";
|
|
33
40
|
export declare function apply(ctx: DshContext, config?: Config): void | Promise<void>;
|