@dsmm/dsmm 0.1.9 → 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 -24
- 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 +61 -13
- package/docs/design.md +41 -0
- package/docs/lsp.md +12 -2
- package/docs/migration-from-ocmm.md +8 -0
- package/docs/profiles.md +41 -15
- package/docs/releasing.md +78 -8
- 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/runtime-recovery.js
CHANGED
|
@@ -2,7 +2,8 @@ import { createUserMessage, expandAssistantStream } from "@deepseek-ai/dsh-llm";
|
|
|
2
2
|
import { foldDurableRecoveryWork, isCurrentRecoveryStep } from "./recovery-policy.js";
|
|
3
3
|
import { isDsmmRoleId } from "./roles.js";
|
|
4
4
|
import { applyModelRoute, isUnavailableRouteFailure, latestNativeModelSelection, liveRolePolicyIdentity, recordAdmittedRecoveryRoute, roleRouteLock, sameModelRoute, selectInitialModelRoute } from "./role-routing.js";
|
|
5
|
-
import { childOwnedSessionEvents,
|
|
5
|
+
import { childOwnedSessionEvents, resolveSelectedAgentPreset, sessionEvents } from "./session-scope.js";
|
|
6
|
+
import { resolveAdmittedDsmmRole as resolveEffectiveDsmmRole } from "./role-policy.js";
|
|
6
7
|
import { resolveRoleRuntimePolicy } from "./routing-policy.js";
|
|
7
8
|
const installedContexts = new WeakSet();
|
|
8
9
|
const RECOVERY_WARNING = "dsmm runtime recovery refused an unproven or exhausted retry";
|
|
@@ -70,6 +71,10 @@ export function registerRuntimeRecovery(ctx, controller, getSettings) {
|
|
|
70
71
|
let disposeRequestError;
|
|
71
72
|
let disposeTurnStopping;
|
|
72
73
|
let disposeAssistantStream;
|
|
74
|
+
const live = (agent) => {
|
|
75
|
+
const agents = ctx.get?.("agents");
|
|
76
|
+
return agents === undefined || agent.id !== undefined && agents.get(agent.id) === agent;
|
|
77
|
+
};
|
|
73
78
|
const reset = () => {
|
|
74
79
|
const request = disposeRequest;
|
|
75
80
|
const requestError = disposeRequestError;
|
|
@@ -96,7 +101,7 @@ export function registerRuntimeRecovery(ctx, controller, getSettings) {
|
|
|
96
101
|
};
|
|
97
102
|
try {
|
|
98
103
|
disposeAssistantStream = ctx.on("agent/assistant-stream", ({ agent, frame }) => {
|
|
99
|
-
if (!active)
|
|
104
|
+
if (!active || !live(agent) || !getSettings(agent).modules.deepwork.enabled)
|
|
100
105
|
return;
|
|
101
106
|
if (frame.type === "start") {
|
|
102
107
|
const settings = getSettings(agent);
|
|
@@ -149,8 +154,10 @@ export function registerRuntimeRecovery(ctx, controller, getSettings) {
|
|
|
149
154
|
}, { prepend: true });
|
|
150
155
|
disposeRequest = ctx.on("agent/request", async (frame, next) => {
|
|
151
156
|
const downstream = await next();
|
|
157
|
+
if (!active || !live(frame.agent))
|
|
158
|
+
return downstream;
|
|
152
159
|
const pending = pendingByAgent.get(frame.agent);
|
|
153
|
-
if (pending === undefined)
|
|
160
|
+
if (pending === undefined || !getSettings(frame.agent).modules.deepwork.enabled)
|
|
154
161
|
return downstream;
|
|
155
162
|
if (latestNativeModelSelection(frame.agent)?.seq !== pending.manualSelectionSeq) {
|
|
156
163
|
pendingByAgent.delete(frame.agent);
|
|
@@ -185,10 +192,14 @@ export function registerRuntimeRecovery(ctx, controller, getSettings) {
|
|
|
185
192
|
return applyModelRoute(downstream, pending.route);
|
|
186
193
|
}, { prepend: true });
|
|
187
194
|
disposeRequestError = ctx.on("agent/request-error", async (frame, next) => {
|
|
195
|
+
if (!active || !live(frame.agent) || frame.signal.aborted)
|
|
196
|
+
return undefined;
|
|
188
197
|
let settings;
|
|
189
198
|
let role;
|
|
190
199
|
try {
|
|
191
200
|
settings = getSettings(frame.agent);
|
|
201
|
+
if (!settings.modules.deepwork.enabled)
|
|
202
|
+
return await next();
|
|
192
203
|
role = resolveEffectiveDsmmRole(frame.agent, settings, controller.active(frame.agent, settings.defaultActive));
|
|
193
204
|
}
|
|
194
205
|
catch {
|
|
@@ -264,7 +275,7 @@ export function registerRuntimeRecovery(ctx, controller, getSettings) {
|
|
|
264
275
|
}
|
|
265
276
|
const currentSettings = getSettings(frame.agent);
|
|
266
277
|
const currentRole = resolveEffectiveDsmmRole(frame.agent, currentSettings, controller.active(frame.agent, currentSettings.defaultActive));
|
|
267
|
-
if (!active || frame.signal.aborted || currentRole !== role
|
|
278
|
+
if (!active || !live(frame.agent) || frame.signal.aborted || currentRole !== role
|
|
268
279
|
|| liveRolePolicyIdentity(frame.agent, currentSettings, currentRole, getSettings.admission?.(frame.agent).epoch) !== policy
|
|
269
280
|
|| roleRouteLock(frame.agent, policy) !== lock || lock.generation !== expectedGeneration
|
|
270
281
|
|| attemptsByAgent.get(frame.agent) !== attempt || !isCurrentRecoveryStep(recoveryEvents(frame.agent), frame.turn, frame.step)
|
|
@@ -294,7 +305,7 @@ export function registerRuntimeRecovery(ctx, controller, getSettings) {
|
|
|
294
305
|
try {
|
|
295
306
|
const settings = getSettings(frame.agent);
|
|
296
307
|
const continuation = settings.runtimeRecovery.idleContinuation;
|
|
297
|
-
if (!settings.runtimeRecovery.enabled || !continuation.enabled || frame.signal.aborted)
|
|
308
|
+
if (!active || !live(frame.agent) || !settings.modules.deepwork.enabled || !settings.runtimeRecovery.enabled || !continuation.enabled || frame.signal.aborted)
|
|
298
309
|
return;
|
|
299
310
|
const preset = resolveSelectedAgentPreset(frame.agent.session);
|
|
300
311
|
const inScope = controller.active(frame.agent, settings.defaultActive) || isDsmmRoleId(preset);
|
package/lib/session-scope.js
CHANGED
|
@@ -25,6 +25,8 @@ export function childOwnedSessionEvents(session) {
|
|
|
25
25
|
}
|
|
26
26
|
/** Parent preset/persona inheritance is deliberately not delegated role authority. */
|
|
27
27
|
export function resolveEffectiveDsmmRole(agent, settings, modeActive) {
|
|
28
|
+
if (!settings.modules.deepwork.enabled)
|
|
29
|
+
return undefined;
|
|
28
30
|
let role;
|
|
29
31
|
if (agent.session.header?.origin === "subagent") {
|
|
30
32
|
const own = childOwnedSessionEvents(agent.session);
|
package/lib/settings.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { DsmmLspSettings } from "./lsp.js";
|
|
|
4
4
|
import type { DsmmRoleId } from "./roles.js";
|
|
5
5
|
import type { DsmmSkillName } from "./skills.js";
|
|
6
6
|
import type { DsmmRateLimitPolicy, DsmmRoutingStrategy, DsmmRuntimePolicyConfig, DsmmRuntimePolicySettings } from "./routing-policy.js";
|
|
7
|
+
import type { DeploymentSchemaNode } from "./profile-types.js";
|
|
7
8
|
export type { DsmmRateLimitPolicy, DsmmRoutingStrategy, DsmmRuntimePolicyConfig, DsmmRuntimePolicySettings } from "./routing-policy.js";
|
|
8
9
|
export { resolveRoleRuntimePolicy } from "./routing-policy.js";
|
|
9
10
|
export { DSMM_SKILL_NAMES, MVP_SKILL_NAMES } from "./skills.js";
|
|
@@ -23,6 +24,12 @@ export interface DsmmPresetSettings {
|
|
|
23
24
|
materialize: boolean;
|
|
24
25
|
root?: string;
|
|
25
26
|
}
|
|
27
|
+
export interface DsmmSubagentSettings {
|
|
28
|
+
enableRunInBackground: boolean;
|
|
29
|
+
backgroundMode: "one-shot" | "continuable";
|
|
30
|
+
/** Omitted delegates to the native host limit (rc.2 default 1). */
|
|
31
|
+
maxDepth?: number;
|
|
32
|
+
}
|
|
26
33
|
export interface DsmmGuardSettings {
|
|
27
34
|
scope: DsmmGuardScope;
|
|
28
35
|
shellCommandSafety: boolean;
|
|
@@ -73,6 +80,12 @@ type DsmmRuntimeRecoveryConfig = Partial<Omit<DsmmRuntimeRecoverySettings, "fall
|
|
|
73
80
|
idleContinuation?: Partial<DsmmRuntimeRecoverySettings["idleContinuation"]>;
|
|
74
81
|
};
|
|
75
82
|
export interface DsmmPluginConfig {
|
|
83
|
+
/** Only global deployment input; native/legacy profile transport rejects it. */
|
|
84
|
+
modules?: {
|
|
85
|
+
deepwork?: {
|
|
86
|
+
enabled?: boolean;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
76
89
|
/** Startup-only native storage binding; never a runtime-profile field. */
|
|
77
90
|
sessionPersistence?: {
|
|
78
91
|
root: string;
|
|
@@ -93,12 +106,18 @@ export interface DsmmPluginConfig {
|
|
|
93
106
|
roleRouting?: DsmmRoleRouting;
|
|
94
107
|
runtimePolicy?: DsmmRuntimePolicyConfig;
|
|
95
108
|
presets?: Partial<DsmmPresetSettings>;
|
|
109
|
+
subagents?: Partial<DsmmSubagentSettings>;
|
|
96
110
|
workflow?: Partial<DsmmWorkflowSettings>;
|
|
97
111
|
guards?: DsmmGuardConfig;
|
|
98
112
|
runtimeRecovery?: DsmmRuntimeRecoveryConfig;
|
|
99
113
|
lsp?: Partial<DsmmLspSettings>;
|
|
100
114
|
}
|
|
101
115
|
export interface DsmmSettings {
|
|
116
|
+
modules: {
|
|
117
|
+
deepwork: {
|
|
118
|
+
enabled: boolean;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
102
121
|
modeName: string;
|
|
103
122
|
defaultActive: boolean;
|
|
104
123
|
promptOrder: number;
|
|
@@ -113,6 +132,7 @@ export interface DsmmSettings {
|
|
|
113
132
|
roleRouting: DsmmRoleRouting;
|
|
114
133
|
runtimePolicy: DsmmRuntimePolicySettings;
|
|
115
134
|
presets: DsmmPresetSettings;
|
|
135
|
+
subagents: DsmmSubagentSettings;
|
|
116
136
|
workflow: DsmmWorkflowSettings;
|
|
117
137
|
guards: DsmmGuardSettings;
|
|
118
138
|
runtimeRecovery: DsmmRuntimeRecoverySettings;
|
|
@@ -127,10 +147,45 @@ export interface DsmmProfileAdmission {
|
|
|
127
147
|
} | null;
|
|
128
148
|
epoch: string;
|
|
129
149
|
scope: DsmmProfileScope;
|
|
150
|
+
deployment?: DsmmDeploymentSnapshot;
|
|
151
|
+
restartRequired?: readonly string[];
|
|
152
|
+
sources?: Record<string, "defaults" | "global" | "profile" | "named-session">;
|
|
153
|
+
sourceCaptures?: {
|
|
154
|
+
startup?: {
|
|
155
|
+
globalRevision: string;
|
|
156
|
+
nativeRevision: string;
|
|
157
|
+
};
|
|
158
|
+
/** Deployment refers to this admission's captured desired snapshot, never latest disk. */
|
|
159
|
+
fields: Record<string, "startup" | "deployment" | "named-session">;
|
|
160
|
+
};
|
|
161
|
+
store?: {
|
|
162
|
+
origin: "central" | "legacy" | "explicit";
|
|
163
|
+
readOnly: boolean;
|
|
164
|
+
writeRestriction?: string;
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
export interface DsmmDeploymentSnapshot {
|
|
168
|
+
settings: DsmmSettings;
|
|
169
|
+
global: DsmmPluginConfig;
|
|
170
|
+
profile: DsmmPluginConfig;
|
|
171
|
+
globalRevision: string;
|
|
172
|
+
nativeRevision: string;
|
|
173
|
+
/** Native configForms CAS when its public descriptor is available; raw hash is not that CAS. */
|
|
174
|
+
nativeFormRevision?: number;
|
|
175
|
+
nativeNamespace?: string;
|
|
176
|
+
/** Public native base/user provenance; profile above is the assembled explicit entry layer. */
|
|
177
|
+
nativeForm?: {
|
|
178
|
+
base?: unknown;
|
|
179
|
+
user?: unknown;
|
|
180
|
+
};
|
|
181
|
+
entryId: string;
|
|
182
|
+
hostProfileKey: string;
|
|
183
|
+
sources: Record<string, "defaults" | "global" | "profile">;
|
|
130
184
|
}
|
|
131
185
|
/** Runtime consumers pass their Agent so immutable profile admission is retained. */
|
|
132
186
|
export type DsmmSettingsGetter = ((agent?: DshAgent) => DsmmSettings) & {
|
|
133
187
|
admission?: (agent?: DshAgent) => DsmmProfileAdmission;
|
|
188
|
+
moduleStates?: (agent?: DshAgent) => import("./modules.js").DsmmModuleState[];
|
|
134
189
|
};
|
|
135
190
|
export interface DsmmResolvedRoleRuntimePolicy {
|
|
136
191
|
readonly strategy: DsmmRoutingStrategy;
|
|
@@ -139,16 +194,29 @@ export interface DsmmResolvedRoleRuntimePolicy {
|
|
|
139
194
|
readonly fallbackRoutes: readonly Readonly<DsmmModelRoute>[];
|
|
140
195
|
readonly fallbackSource: "role" | "global";
|
|
141
196
|
}
|
|
142
|
-
export declare const DSMM_SETTINGS_NAMESPACE = "dsmm";
|
|
143
197
|
export declare const DSMM_STATUS_COMMAND = "dsmm-status";
|
|
144
198
|
export interface RegisterSettingsOptions {
|
|
199
|
+
/** Already resolved/captured internal settings, never external profile input. */
|
|
200
|
+
resolved?: DsmmSettings;
|
|
145
201
|
onChange?: (settings: DsmmSettings) => void;
|
|
146
202
|
install?: (readyCtx: DshContext, getSettings: () => DsmmSettings) => void;
|
|
147
203
|
}
|
|
148
204
|
export declare const DEFAULT_DSMM_SETTINGS: DsmmSettings;
|
|
205
|
+
/** Only data is transported. Defaults remain resolved by the existing authority. */
|
|
206
|
+
export declare function deploymentEditorSchema(): DeploymentSchemaNode;
|
|
149
207
|
export declare const DSMM_CONFIG_SCHEMA: Schema<DsmmPluginConfig>;
|
|
208
|
+
export declare const DSMM_NATIVE_CONFIG_SCHEMA: Schema<DsmmPluginConfig>;
|
|
150
209
|
export declare const DSMM_SETTINGS_SCHEMA: Schema<DsmmSettings>;
|
|
151
210
|
export declare function resolveConfig(config?: DsmmPluginConfig): DsmmSettings;
|
|
211
|
+
/** Reject references, accessors, prototypes and non-JSON data before any merge. */
|
|
212
|
+
export declare function copyJson<T>(input: T): T;
|
|
213
|
+
export declare function freezeSettings<T>(input: T): T;
|
|
214
|
+
/** Sparse grammar and full semantic validation are separate from native refs. */
|
|
215
|
+
export declare function validateSparseConfig(input: unknown, global?: boolean): DsmmPluginConfig;
|
|
216
|
+
export declare function validateDeploymentPath(path: readonly string[]): void;
|
|
217
|
+
export declare function mergeConfigLayers(...layers: DsmmPluginConfig[]): DsmmPluginConfig;
|
|
218
|
+
export declare function resolveDeployment(global: DsmmPluginConfig, profile: DsmmPluginConfig): DsmmSettings;
|
|
219
|
+
export declare function validateResolvedSettings(settings: DsmmSettings): DsmmSettings;
|
|
152
220
|
export declare function resolveRoleRouting(input: DsmmRoleRouting | undefined): DsmmRoleRouting;
|
|
153
221
|
export declare function isRoleEnabled(settings: DsmmSettings, role: DsmmRoleId): boolean;
|
|
154
222
|
export declare function resolveGuardSettings(config: DsmmPluginConfig["guards"]): DsmmGuardSettings;
|
package/lib/settings.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import Schema from "@deepseek-ai/schemastery";
|
|
2
2
|
import { DEFAULT_DSMM_LSP_SETTINGS, resolveLspSettings } from "./lsp.js";
|
|
3
|
-
import { DSMM_ROLE_IDS } from "./roles.js";
|
|
3
|
+
import { DSMM_ROLES, DSMM_ROLE_IDS } from "./roles.js";
|
|
4
4
|
import { DSMM_SKILL_NAMES } from "./skills.js";
|
|
5
|
-
import { DEFAULT_DSMM_RUNTIME_POLICY, normalizeRateLimitOverrides, normalizeRoutingStrategy, normalizeRuntimePolicy, resolveRoleRuntimePolicy } from "./routing-policy.js";
|
|
5
|
+
import { DEFAULT_DSMM_RUNTIME_POLICY, DSMM_RATE_LIMIT_BOUNDS, normalizeRateLimitOverrides, normalizeRoutingStrategy, normalizeRuntimePolicy, resolveRoleRuntimePolicy } from "./routing-policy.js";
|
|
6
6
|
export { resolveRoleRuntimePolicy } from "./routing-policy.js";
|
|
7
7
|
export { DSMM_SKILL_NAMES, MVP_SKILL_NAMES } from "./skills.js";
|
|
8
|
-
export const DSMM_SETTINGS_NAMESPACE = "dsmm";
|
|
9
8
|
export const DSMM_STATUS_COMMAND = "dsmm-status";
|
|
10
9
|
export const DEFAULT_DSMM_SETTINGS = {
|
|
10
|
+
modules: { deepwork: { enabled: true } },
|
|
11
11
|
modeName: "deepwork",
|
|
12
12
|
defaultActive: false,
|
|
13
13
|
promptOrder: 50,
|
|
@@ -24,6 +24,7 @@ export const DEFAULT_DSMM_SETTINGS = {
|
|
|
24
24
|
presets: {
|
|
25
25
|
materialize: false
|
|
26
26
|
},
|
|
27
|
+
subagents: { enableRunInBackground: false, backgroundMode: "one-shot" },
|
|
27
28
|
workflow: {
|
|
28
29
|
policy: "risk-based",
|
|
29
30
|
strictGates: true,
|
|
@@ -66,29 +67,26 @@ function createDefaultSkillSettings() {
|
|
|
66
67
|
return Object.fromEntries(DSMM_SKILL_NAMES.map((id) => [id, true]));
|
|
67
68
|
}
|
|
68
69
|
function createDefaultRoleSettings() {
|
|
69
|
-
return Object.fromEntries(
|
|
70
|
-
}
|
|
71
|
-
const SKILLS_SCHEMA = Schema.object(
|
|
72
|
-
brainstorming: Schema.boolean().default(DEFAULT_DSMM_SETTINGS.skills.brainstorming),
|
|
73
|
-
"writing-plans": Schema.boolean().default(DEFAULT_DSMM_SETTINGS.skills["writing-plans"]),
|
|
74
|
-
"requesting-code-review": Schema.boolean().default(DEFAULT_DSMM_SETTINGS.skills["requesting-code-review"]),
|
|
75
|
-
"receiving-code-review": Schema.boolean().default(DEFAULT_DSMM_SETTINGS.skills["receiving-code-review"]),
|
|
76
|
-
"subagent-driven-development": Schema.boolean().default(DEFAULT_DSMM_SETTINGS.skills["subagent-driven-development"]),
|
|
77
|
-
"dispatching-parallel-agents": Schema.boolean().default(DEFAULT_DSMM_SETTINGS.skills["dispatching-parallel-agents"]),
|
|
78
|
-
"remove-ai-slops": Schema.boolean().default(DEFAULT_DSMM_SETTINGS.skills["remove-ai-slops"])
|
|
79
|
-
});
|
|
70
|
+
return Object.fromEntries(DSMM_ROLES.map((role) => [role.id, role.enabledByDefault]));
|
|
71
|
+
}
|
|
72
|
+
const SKILLS_SCHEMA = Schema.object(Object.fromEntries(DSMM_SKILL_NAMES.map((name) => [name, Schema.boolean().default(DEFAULT_DSMM_SETTINGS.skills[name])])));
|
|
80
73
|
const ROLES_SCHEMA = Schema.object(Object.fromEntries(DSMM_ROLE_IDS.map((id) => [id, Schema.boolean().default(DEFAULT_DSMM_SETTINGS.roles[id])])));
|
|
81
74
|
const MODEL_ROUTE_SCHEMA = Schema.object({
|
|
82
75
|
provider: Schema.string().required(),
|
|
83
76
|
model: Schema.string().required(),
|
|
84
77
|
reasoningEffort: Schema.string()
|
|
85
78
|
});
|
|
79
|
+
const RATE_LIMIT_CONFIG_SCHEMA = Schema.object(Object.fromEntries(Object.keys(DEFAULT_DSMM_RUNTIME_POLICY.rateLimit).map((key) => [key, Schema.number()])));
|
|
80
|
+
const ROUTING_STRATEGY_CONFIG_SCHEMA = Schema.union([Schema.const("startup-lock"), Schema.const("rate-limit-fallback")]);
|
|
81
|
+
const RUNTIME_POLICY_CONFIG_SCHEMA = Schema.object({ strategy: ROUTING_STRATEGY_CONFIG_SCHEMA, rateLimit: RATE_LIMIT_CONFIG_SCHEMA });
|
|
82
|
+
const ROLE_FALLBACK_ROUTE_LIMIT = 32;
|
|
83
|
+
const ROLE_FALLBACK_ROUTES_SCHEMA = Schema.array(MODEL_ROUTE_SCHEMA);
|
|
86
84
|
// A dictionary retains unknown keys for fail-closed validation by the resolver.
|
|
87
85
|
const ROLE_ROUTING_SCHEMA = Schema.dict(Schema.object({
|
|
88
86
|
primary: Schema.union([Schema.const(undefined), MODEL_ROUTE_SCHEMA]),
|
|
89
|
-
fallbackRoutes: Schema.union([Schema.const(undefined),
|
|
90
|
-
strategy:
|
|
91
|
-
rateLimit:
|
|
87
|
+
fallbackRoutes: Schema.union([Schema.const(undefined), ROLE_FALLBACK_ROUTES_SCHEMA]),
|
|
88
|
+
strategy: ROUTING_STRATEGY_CONFIG_SCHEMA,
|
|
89
|
+
rateLimit: RATE_LIMIT_CONFIG_SCHEMA
|
|
92
90
|
}).required()).default({});
|
|
93
91
|
// Schemastery treats null like an omitted default. Validate the untouched map
|
|
94
92
|
// before object defaults can erase an explicitly malformed routing policy.
|
|
@@ -109,6 +107,11 @@ const PRESETS_SCHEMA = Schema.object({
|
|
|
109
107
|
materialize: Schema.boolean().default(DEFAULT_DSMM_SETTINGS.presets.materialize),
|
|
110
108
|
root: Schema.string()
|
|
111
109
|
});
|
|
110
|
+
const SUBAGENTS_SCHEMA = Schema.object({
|
|
111
|
+
enableRunInBackground: Schema.boolean().default(false),
|
|
112
|
+
backgroundMode: Schema.union([Schema.const("one-shot"), Schema.const("continuable")]).default("one-shot"),
|
|
113
|
+
maxDepth: Schema.number().step(1).min(0).max(Number.MAX_SAFE_INTEGER)
|
|
114
|
+
});
|
|
112
115
|
const FINAL_REVIEW_POLICY_SCHEMA = Schema.union([
|
|
113
116
|
Schema.const("simple-oracle-complex-reviewer"),
|
|
114
117
|
Schema.const("reviewer-only"),
|
|
@@ -194,32 +197,95 @@ const LSP_SCHEMA = Schema.object({
|
|
|
194
197
|
toolCallTimeoutMs: Schema.number().default(DEFAULT_DSMM_SETTINGS.lsp.toolCallTimeoutMs),
|
|
195
198
|
failOnStartupError: Schema.boolean().default(DEFAULT_DSMM_SETTINGS.lsp.failOnStartupError)
|
|
196
199
|
});
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
200
|
+
const CONFIG_FIELDS_SCHEMA = Schema.object({
|
|
201
|
+
sessionPersistence: Schema.union([Schema.const(undefined), Schema.object({
|
|
202
|
+
root: Schema.string().required(),
|
|
203
|
+
compression: Schema.union([Schema.const("zstd"), Schema.const("none")])
|
|
204
|
+
})]),
|
|
205
|
+
modeName: Schema.string().default(DEFAULT_DSMM_SETTINGS.modeName),
|
|
206
|
+
section: Schema.string(),
|
|
207
|
+
defaultActive: Schema.boolean().default(DEFAULT_DSMM_SETTINGS.defaultActive),
|
|
208
|
+
promptOrder: Schema.number().default(DEFAULT_DSMM_SETTINGS.promptOrder),
|
|
209
|
+
deepseekV4ProCalibration: DEEPSEEK_CALIBRATION_SCHEMA,
|
|
210
|
+
deepseekV4ProDefaultReasoningEffort: DEEPSEEK_DEFAULT_REASONING_EFFORT_SCHEMA,
|
|
211
|
+
deepseekV4ProMaxReasoningPresets: DEEPSEEK_MAX_REASONING_PRESETS_SCHEMA,
|
|
212
|
+
deepseekFlashCalibration: DEEPSEEK_CALIBRATION_SCHEMA,
|
|
213
|
+
deepseekFlashDefaultReasoningEffort: DEEPSEEK_DEFAULT_REASONING_EFFORT_SCHEMA,
|
|
214
|
+
deepseekFlashMaxReasoningPresets: DEEPSEEK_MAX_REASONING_PRESETS_SCHEMA,
|
|
215
|
+
skills: SKILLS_SCHEMA,
|
|
216
|
+
roles: ROLES_SCHEMA,
|
|
217
|
+
roleRouting: ROLE_ROUTING_SCHEMA,
|
|
218
|
+
runtimePolicy: RUNTIME_POLICY_CONFIG_SCHEMA,
|
|
219
|
+
presets: PRESETS_SCHEMA,
|
|
220
|
+
subagents: SUBAGENTS_SCHEMA,
|
|
221
|
+
workflow: WORKFLOW_CONFIG_SCHEMA,
|
|
222
|
+
guards: GUARDS_SCHEMA,
|
|
223
|
+
runtimeRecovery: RUNTIME_RECOVERY_SCHEMA,
|
|
224
|
+
lsp: LSP_SCHEMA
|
|
225
|
+
});
|
|
226
|
+
const MODULES_SCHEMA = Schema.object({ deepwork: Schema.object({ enabled: Schema.boolean() }) });
|
|
227
|
+
const GLOBAL_FIELDS_SCHEMA = Schema.object({ ...CONFIG_FIELDS_SCHEMA.dict, modules: MODULES_SCHEMA });
|
|
228
|
+
/** Only data is transported. Defaults remain resolved by the existing authority. */
|
|
229
|
+
export function deploymentEditorSchema() {
|
|
230
|
+
const project = (schema) => ({
|
|
231
|
+
type: schema.type,
|
|
232
|
+
...(schema.dict === undefined ? {} : { fields: Object.fromEntries(Object.entries(schema.dict).filter(([key]) => key !== "sessionPersistence").map(([key, child]) => {
|
|
233
|
+
const node = project(child);
|
|
234
|
+
if (schema === MODEL_ROUTE_SCHEMA)
|
|
235
|
+
node.nonempty = true;
|
|
236
|
+
if (schema === RATE_LIMIT_CONFIG_SCHEMA) {
|
|
237
|
+
const [min, max] = DSMM_RATE_LIMIT_BOUNDS[key];
|
|
238
|
+
Object.assign(node, { min, max, step: 1 });
|
|
239
|
+
}
|
|
240
|
+
return [key, node];
|
|
241
|
+
})) }),
|
|
242
|
+
...(schema.inner === undefined ? {} : { inner: project(schema.inner) }),
|
|
243
|
+
...(schema.list === undefined ? {} : { alternatives: schema.list.map(project) }),
|
|
244
|
+
...(["string", "number", "boolean"].includes(typeof schema.value) ? { value: schema.value } : {}),
|
|
245
|
+
...(typeof schema.meta.min === "number" ? { min: schema.meta.min } : {}),
|
|
246
|
+
...(typeof schema.meta.max === "number" ? { max: schema.meta.max } : {}),
|
|
247
|
+
...(typeof schema.meta.step === "number" ? { step: schema.meta.step } : {}),
|
|
248
|
+
...(schema.meta.required === true ? { required: true } : {}),
|
|
249
|
+
...(schema === ROLE_ROUTING_SCHEMA ? { keys: [...DSMM_ROLE_IDS] } : {}),
|
|
250
|
+
...(schema === ROLE_FALLBACK_ROUTES_SCHEMA ? { max: ROLE_FALLBACK_ROUTE_LIMIT } : {})
|
|
251
|
+
});
|
|
252
|
+
return project(GLOBAL_FIELDS_SCHEMA);
|
|
253
|
+
}
|
|
254
|
+
/** Transport nodes carry no business defaults. Only deployment input is volatile. */
|
|
255
|
+
function sparseSchema(schema) {
|
|
256
|
+
const { default: _default, required: _required, ...meta } = schema.meta;
|
|
257
|
+
return new Schema({ ...schema, meta,
|
|
258
|
+
...(schema.dict === undefined ? {} : { dict: Object.fromEntries(Object.entries(schema.dict).map(([key, child]) => [key, sparseSchema(child)])) }),
|
|
259
|
+
...(schema.inner === undefined ? {} : { inner: sparseSchema(schema.inner) }),
|
|
260
|
+
...(schema.list === undefined ? {} : { list: schema.list.map(sparseSchema) }) });
|
|
261
|
+
}
|
|
262
|
+
const TRANSPORT_FIELDS_SCHEMA = sparseSchema(CONFIG_FIELDS_SCHEMA);
|
|
263
|
+
export const DSMM_CONFIG_SCHEMA = Schema.intersect([
|
|
264
|
+
Schema.transform(Schema.any(), (input) => { resolveConfig(validateSparseConfig(input ?? {})); return {}; }),
|
|
265
|
+
sparseSchema(CONFIG_FIELDS_SCHEMA)
|
|
266
|
+
]).default({});
|
|
267
|
+
for (const [key, schema] of Object.entries(TRANSPORT_FIELDS_SCHEMA.dict)) {
|
|
268
|
+
if (key !== "sessionPersistence")
|
|
269
|
+
TRANSPORT_FIELDS_SCHEMA.set(key, schema.volatile());
|
|
270
|
+
}
|
|
271
|
+
// Native forms require a fixed object root: volatile nodes cannot sit under an
|
|
272
|
+
// intersection. Keep that schema intact and validate through the public protocol.
|
|
273
|
+
export const DSMM_NATIVE_CONFIG_SCHEMA = new Proxy(TRANSPORT_FIELDS_SCHEMA.default({}), {
|
|
274
|
+
apply(target, receiver, args) {
|
|
275
|
+
validateSparseConfig(args[0] ?? {});
|
|
276
|
+
return Reflect.apply(target, receiver, args);
|
|
277
|
+
},
|
|
278
|
+
get(target, key, receiver) {
|
|
279
|
+
if (key !== "~standard")
|
|
280
|
+
return Reflect.get(target, key, receiver);
|
|
281
|
+
return { version: 1, vendor: "schemastery", validate(input) {
|
|
282
|
+
validateSparseConfig(input ?? {});
|
|
283
|
+
return target["~standard"].validate(input);
|
|
284
|
+
} };
|
|
285
|
+
}
|
|
286
|
+
});
|
|
222
287
|
export const DSMM_SETTINGS_SCHEMA = Schema.intersect([ROLE_ROUTING_VALIDATION_SCHEMA, Schema.object({
|
|
288
|
+
modules: Schema.object({ deepwork: Schema.object({ enabled: Schema.boolean().default(true) }) }),
|
|
223
289
|
modeName: Schema.string().default(DEFAULT_DSMM_SETTINGS.modeName),
|
|
224
290
|
defaultActive: Schema.boolean().default(DEFAULT_DSMM_SETTINGS.defaultActive),
|
|
225
291
|
promptOrder: Schema.number().default(DEFAULT_DSMM_SETTINGS.promptOrder),
|
|
@@ -234,6 +300,7 @@ export const DSMM_SETTINGS_SCHEMA = Schema.intersect([ROLE_ROUTING_VALIDATION_SC
|
|
|
234
300
|
roleRouting: ROLE_ROUTING_SCHEMA,
|
|
235
301
|
runtimePolicy: Schema.any(),
|
|
236
302
|
presets: PRESETS_SCHEMA,
|
|
303
|
+
subagents: SUBAGENTS_SCHEMA,
|
|
237
304
|
workflow: WORKFLOW_SCHEMA,
|
|
238
305
|
guards: GUARDS_SCHEMA,
|
|
239
306
|
runtimeRecovery: RUNTIME_RECOVERY_SCHEMA,
|
|
@@ -241,6 +308,7 @@ export const DSMM_SETTINGS_SCHEMA = Schema.intersect([ROLE_ROUTING_VALIDATION_SC
|
|
|
241
308
|
})]).default({});
|
|
242
309
|
export function resolveConfig(config = {}) {
|
|
243
310
|
const settings = {
|
|
311
|
+
modules: { deepwork: { enabled: config.modules?.deepwork?.enabled ?? DEFAULT_DSMM_SETTINGS.modules.deepwork.enabled } },
|
|
244
312
|
modeName: normalizeModeName(config.modeName),
|
|
245
313
|
defaultActive: config.defaultActive ?? DEFAULT_DSMM_SETTINGS.defaultActive,
|
|
246
314
|
promptOrder: config.promptOrder ?? DEFAULT_DSMM_SETTINGS.promptOrder,
|
|
@@ -255,6 +323,7 @@ export function resolveConfig(config = {}) {
|
|
|
255
323
|
roleRouting: resolveRoleRouting(config.roleRouting),
|
|
256
324
|
runtimePolicy: normalizeRuntimePolicy(Object.hasOwn(config, "runtimePolicy") ? validatePresentRuntimePolicy(config.runtimePolicy) : undefined),
|
|
257
325
|
presets: resolvePresetSettings(config.presets),
|
|
326
|
+
subagents: SUBAGENTS_SCHEMA(config.subagents ?? {}),
|
|
258
327
|
workflow: resolveWorkflowSettings(config.workflow),
|
|
259
328
|
guards: resolveGuardSettings(config.guards),
|
|
260
329
|
runtimeRecovery: resolveRuntimeRecoverySettings(config.runtimeRecovery),
|
|
@@ -264,6 +333,148 @@ export function resolveConfig(config = {}) {
|
|
|
264
333
|
resolveRoleRuntimePolicy(settings, role);
|
|
265
334
|
return settings;
|
|
266
335
|
}
|
|
336
|
+
/** Reject references, accessors, prototypes and non-JSON data before any merge. */
|
|
337
|
+
export function copyJson(input) {
|
|
338
|
+
const active = new Set();
|
|
339
|
+
const copy = (value, depth) => {
|
|
340
|
+
if (depth > 32)
|
|
341
|
+
throw new TypeError("Deepwork configuration nesting is too deep");
|
|
342
|
+
if (value === null || typeof value === "boolean" || typeof value === "string")
|
|
343
|
+
return value;
|
|
344
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
345
|
+
return value;
|
|
346
|
+
if (typeof value !== "object" || value === null || active.has(value))
|
|
347
|
+
throw new TypeError("Deepwork configuration must be plain JSON data");
|
|
348
|
+
const prototype = Object.getPrototypeOf(value);
|
|
349
|
+
if (Array.isArray(value) ? prototype !== Array.prototype : prototype !== Object.prototype && prototype !== null)
|
|
350
|
+
throw new TypeError("Deepwork configuration must use plain objects");
|
|
351
|
+
if (Object.getOwnPropertySymbols(value).length > 0)
|
|
352
|
+
throw new TypeError("Deepwork configuration must not contain symbols");
|
|
353
|
+
active.add(value);
|
|
354
|
+
const result = Array.isArray(value) ? [] : {};
|
|
355
|
+
for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(value))) {
|
|
356
|
+
if (Array.isArray(value) && key === "length")
|
|
357
|
+
continue;
|
|
358
|
+
if (["__proto__", "prototype", "constructor"].includes(key) || !Object.hasOwn(descriptor, "value") || !descriptor.enumerable)
|
|
359
|
+
throw new TypeError("Deepwork configuration contains an unsafe property");
|
|
360
|
+
if (Array.isArray(value) && !/^(0|[1-9][0-9]*)$/u.test(key))
|
|
361
|
+
throw new TypeError("Deepwork configuration arrays must contain only elements");
|
|
362
|
+
Reflect.set(result, key, copy(descriptor.value, depth + 1));
|
|
363
|
+
}
|
|
364
|
+
if (Array.isArray(value) && Object.keys(result).length !== value.length)
|
|
365
|
+
throw new TypeError("Deepwork configuration arrays must not have holes");
|
|
366
|
+
active.delete(value);
|
|
367
|
+
return result;
|
|
368
|
+
};
|
|
369
|
+
return copy(input, 0);
|
|
370
|
+
}
|
|
371
|
+
export function freezeSettings(input) {
|
|
372
|
+
const result = copyJson(input);
|
|
373
|
+
const freeze = (value) => {
|
|
374
|
+
if (value === null || typeof value !== "object")
|
|
375
|
+
return;
|
|
376
|
+
for (const child of Object.values(value))
|
|
377
|
+
freeze(child);
|
|
378
|
+
Object.freeze(value);
|
|
379
|
+
};
|
|
380
|
+
freeze(result);
|
|
381
|
+
return result;
|
|
382
|
+
}
|
|
383
|
+
function validateShape(value, schema) {
|
|
384
|
+
if (value === null || value === undefined)
|
|
385
|
+
throw new TypeError("Deepwork explicit configuration must not be null or undefined");
|
|
386
|
+
if (schema.type === "object") {
|
|
387
|
+
if (typeof value !== "object" || Array.isArray(value))
|
|
388
|
+
throw new TypeError("Deepwork configuration field must be an object");
|
|
389
|
+
for (const [key, child] of Object.entries(value)) {
|
|
390
|
+
const field = schema.dict !== undefined && Object.hasOwn(schema.dict, key) ? schema.dict[key] : undefined;
|
|
391
|
+
if (field === undefined)
|
|
392
|
+
throw new TypeError("Deepwork configuration contains an unknown field");
|
|
393
|
+
validateShape(child, field);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
else if (schema.type === "dict") {
|
|
397
|
+
if (typeof value !== "object" || Array.isArray(value))
|
|
398
|
+
throw new TypeError("Deepwork configuration field must be an object");
|
|
399
|
+
for (const child of Object.values(value))
|
|
400
|
+
validateShape(child, schema.inner);
|
|
401
|
+
}
|
|
402
|
+
else if (schema.type === "array") {
|
|
403
|
+
if (!Array.isArray(value))
|
|
404
|
+
throw new TypeError("Deepwork configuration field must be an array");
|
|
405
|
+
for (const child of value)
|
|
406
|
+
validateShape(child, schema.inner);
|
|
407
|
+
}
|
|
408
|
+
else if (schema.type === "union") {
|
|
409
|
+
for (const child of schema.list ?? []) {
|
|
410
|
+
try {
|
|
411
|
+
validateShape(value, child);
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
catch { /* Try the other declared alternatives. */ }
|
|
415
|
+
}
|
|
416
|
+
throw new TypeError("Deepwork configuration field does not match its declared type");
|
|
417
|
+
}
|
|
418
|
+
else {
|
|
419
|
+
schema(value);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
/** Sparse grammar and full semantic validation are separate from native refs. */
|
|
423
|
+
export function validateSparseConfig(input, global = false) {
|
|
424
|
+
const config = copyJson(input);
|
|
425
|
+
validateShape(config, global ? GLOBAL_FIELDS_SCHEMA : CONFIG_FIELDS_SCHEMA);
|
|
426
|
+
if (global && Object.hasOwn(config, "sessionPersistence"))
|
|
427
|
+
throw new TypeError("Native session storage is not a global deployment field");
|
|
428
|
+
// A deployment layer may override one primary-route member and inherit the
|
|
429
|
+
// others. Validate its present members here; resolveDeployment validates the
|
|
430
|
+
// complete route only after both sparse layers have merged.
|
|
431
|
+
const routing = config.roleRouting === undefined ? undefined : copyJson(config.roleRouting);
|
|
432
|
+
for (const policy of Object.values(routing ?? {})) {
|
|
433
|
+
if (policy?.primary !== undefined && (!Object.hasOwn(policy.primary, "provider") || !Object.hasOwn(policy.primary, "model")))
|
|
434
|
+
delete policy.primary;
|
|
435
|
+
}
|
|
436
|
+
const settings = resolveConfig({ ...config, ...(routing === undefined ? {} : { roleRouting: routing }) });
|
|
437
|
+
DSMM_SETTINGS_SCHEMA(settings);
|
|
438
|
+
return config;
|
|
439
|
+
}
|
|
440
|
+
export function validateDeploymentPath(path) {
|
|
441
|
+
let schema = GLOBAL_FIELDS_SCHEMA;
|
|
442
|
+
if (path.length === 0 || path[0] === "sessionPersistence")
|
|
443
|
+
throw new TypeError("Not an editable deployment field");
|
|
444
|
+
for (const key of path) {
|
|
445
|
+
if (schema.type === "union")
|
|
446
|
+
schema = schema.list?.find((node) => node.type === "object") ?? schema;
|
|
447
|
+
const child = schema.type === "object" ? schema.dict !== undefined && Object.hasOwn(schema.dict, key) ? schema.dict[key] : undefined : schema.type === "dict" ? schema.inner : undefined;
|
|
448
|
+
if (child === undefined)
|
|
449
|
+
throw new TypeError("Unknown deployment field path");
|
|
450
|
+
schema = child;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
export function mergeConfigLayers(...layers) {
|
|
454
|
+
const merge = (base, overlay) => {
|
|
455
|
+
const result = copyJson(base);
|
|
456
|
+
for (const [key, value] of Object.entries(overlay)) {
|
|
457
|
+
const previous = result[key];
|
|
458
|
+
result[key] = value !== null && typeof value === "object" && !Array.isArray(value)
|
|
459
|
+
&& previous !== null && typeof previous === "object" && !Array.isArray(previous)
|
|
460
|
+
? merge(previous, value) : copyJson(value);
|
|
461
|
+
}
|
|
462
|
+
return result;
|
|
463
|
+
};
|
|
464
|
+
return layers.reduce((base, layer) => merge(base, copyJson(layer)), {});
|
|
465
|
+
}
|
|
466
|
+
export function resolveDeployment(global, profile) {
|
|
467
|
+
const merged = mergeConfigLayers(validateSparseConfig(global, true), validateSparseConfig(profile));
|
|
468
|
+
const settings = resolveConfig(merged);
|
|
469
|
+
validateResolvedSettings(settings);
|
|
470
|
+
return freezeSettings(settings);
|
|
471
|
+
}
|
|
472
|
+
export function validateResolvedSettings(settings) {
|
|
473
|
+
const plain = copyJson(settings);
|
|
474
|
+
validateShape(plain, GLOBAL_FIELDS_SCHEMA);
|
|
475
|
+
DSMM_SETTINGS_SCHEMA(plain);
|
|
476
|
+
return plain;
|
|
477
|
+
}
|
|
267
478
|
function validatePresentRuntimePolicy(value) {
|
|
268
479
|
if (value === undefined)
|
|
269
480
|
throw new TypeError("dsmm runtimePolicy must be an object when present");
|
|
@@ -293,7 +504,7 @@ export function resolveRoleRouting(input) {
|
|
|
293
504
|
if (Object.hasOwn(value, "primary"))
|
|
294
505
|
policy.primary = normalizeExplicitRoute(value.primary);
|
|
295
506
|
if (Object.hasOwn(value, "fallbackRoutes")) {
|
|
296
|
-
if (!Array.isArray(value.fallbackRoutes) || value.fallbackRoutes.length >
|
|
507
|
+
if (!Array.isArray(value.fallbackRoutes) || value.fallbackRoutes.length > ROLE_FALLBACK_ROUTE_LIMIT)
|
|
297
508
|
throw new TypeError("dsmm roleRouting fallbackRoutes must be an array with at most 32 entries");
|
|
298
509
|
policy.fallbackRoutes = [];
|
|
299
510
|
for (const entry of value.fallbackRoutes) {
|
|
@@ -421,53 +632,13 @@ function normalizePositiveInteger(value, defaultValue) {
|
|
|
421
632
|
return Math.floor(value);
|
|
422
633
|
}
|
|
423
634
|
export function registerSettings(ctx, config = {}, options = {}) {
|
|
424
|
-
|
|
425
|
-
//
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
let getSettings = () => base;
|
|
433
|
-
let attached = false;
|
|
434
|
-
const installedSettingsByReadyContext = new WeakMap();
|
|
435
|
-
const ready = (readyCtx, settings) => {
|
|
436
|
-
if (settings === undefined || installedSettingsByReadyContext.get(readyCtx) === settings)
|
|
437
|
-
return;
|
|
438
|
-
const scope = settings.register(DSMM_SETTINGS_NAMESPACE, DSMM_SETTINGS_SCHEMA, { base, applies: "restart" });
|
|
439
|
-
const previousGetSettings = getSettings;
|
|
440
|
-
const previousAttached = attached;
|
|
441
|
-
getSettings = () => resolveConfig(scope.get());
|
|
442
|
-
try {
|
|
443
|
-
options.onChange?.(getSettings());
|
|
444
|
-
options.install?.(readyCtx, () => getSettings());
|
|
445
|
-
installedSettingsByReadyContext.set(readyCtx, settings);
|
|
446
|
-
readyCtx.effect?.(() => () => {
|
|
447
|
-
if (installedSettingsByReadyContext.get(readyCtx) === settings)
|
|
448
|
-
installedSettingsByReadyContext.delete(readyCtx);
|
|
449
|
-
});
|
|
450
|
-
attached = true;
|
|
451
|
-
}
|
|
452
|
-
catch (error) {
|
|
453
|
-
if (installedSettingsByReadyContext.get(readyCtx) === settings)
|
|
454
|
-
installedSettingsByReadyContext.delete(readyCtx);
|
|
455
|
-
getSettings = previousGetSettings;
|
|
456
|
-
attached = previousAttached;
|
|
457
|
-
throw error;
|
|
458
|
-
}
|
|
459
|
-
};
|
|
460
|
-
if (ctx.inject !== undefined) {
|
|
461
|
-
ctx.inject(["settings", "systemPrompt"], (readyCtx) => ready(readyCtx, readyCtx.settings));
|
|
462
|
-
return () => getSettings();
|
|
463
|
-
}
|
|
464
|
-
if (Object.prototype.hasOwnProperty.call(ctx, "settings")) {
|
|
465
|
-
ready(ctx, Object.getOwnPropertyDescriptor(ctx, "settings")?.value);
|
|
466
|
-
}
|
|
467
|
-
if (!attached) {
|
|
468
|
-
options.onChange?.(getSettings());
|
|
469
|
-
options.install?.(ctx, () => getSettings());
|
|
470
|
-
}
|
|
471
|
-
return () => getSettings();
|
|
635
|
+
// Loader owns entry identity, Config validation, revision and persistent patch.
|
|
636
|
+
// Each non-volatile reload receives a new deployment baseline. Profiles stay
|
|
637
|
+
// on the existing immutable admission path, never a parallel settings store.
|
|
638
|
+
const base = freezeSettings(options.resolved === undefined ? resolveConfig(validateSparseConfig(config)) : validateResolvedSettings(options.resolved));
|
|
639
|
+
const getSettings = () => base;
|
|
640
|
+
options.onChange?.(base);
|
|
641
|
+
options.install?.(ctx, getSettings);
|
|
642
|
+
return getSettings;
|
|
472
643
|
}
|
|
473
644
|
//# sourceMappingURL=settings.js.map
|