@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/profile-runtime.d.ts
CHANGED
|
@@ -4,7 +4,12 @@ import type { ProfileReadResult, ProfileSaveRequest, ProfileSelectRequest, Profi
|
|
|
4
4
|
import type { DsmmProfileDocument } from "./profiles.js";
|
|
5
5
|
import type { DsmmProfileAdmission, DsmmSettings, DsmmSettingsGetter } from "./settings.js";
|
|
6
6
|
import { DeepworkModeController } from "./state.js";
|
|
7
|
+
import type { DsmmDeploymentSnapshot } from "./settings.js";
|
|
8
|
+
import type { DeploymentAdmissionView } from "./profile-types.js";
|
|
7
9
|
export interface DsmmProfileRuntimeStore {
|
|
10
|
+
readonly readOnly?: boolean;
|
|
11
|
+
readonly origin?: "central" | "legacy" | "explicit";
|
|
12
|
+
readonly writeRestriction?: string;
|
|
8
13
|
loadSelection(): Promise<LoadedProfileSelection>;
|
|
9
14
|
describe(): Promise<ProfileSnapshot>;
|
|
10
15
|
read(id: string): Promise<ProfileReadResult>;
|
|
@@ -23,8 +28,17 @@ export interface DsmmProfileRuntimeOptions {
|
|
|
23
28
|
/** Trusted test/integration seam, never a wire-supplied path or callback. */
|
|
24
29
|
validateCandidate?: (settings: DsmmSettings) => void | Promise<void>;
|
|
25
30
|
modeController?: DeepworkModeController;
|
|
31
|
+
/** Awaited once per new ordinary root; never used by children or idle switches. */
|
|
32
|
+
readDesired?: () => Promise<DsmmDeploymentSnapshot>;
|
|
33
|
+
startup?: DsmmDeploymentSnapshot;
|
|
34
|
+
/** Frozen actual native startup substrate; omission is the trusted legacy seam. */
|
|
35
|
+
subagentCapabilities?: {
|
|
36
|
+
backgroundJobs: boolean;
|
|
37
|
+
continuable: boolean;
|
|
38
|
+
};
|
|
26
39
|
}
|
|
27
40
|
interface AdmittedProfile extends ProfileSelectionState, DsmmProfileAdmission {
|
|
41
|
+
baseline: DsmmSettings;
|
|
28
42
|
}
|
|
29
43
|
/** Global defaults admit new roots; scoped idle switches replace one root's epoch. */
|
|
30
44
|
export declare class DsmmProfileRuntime {
|
|
@@ -33,6 +47,7 @@ export declare class DsmmProfileRuntime {
|
|
|
33
47
|
private readonly options;
|
|
34
48
|
readonly getSettings: DsmmSettingsGetter;
|
|
35
49
|
private current;
|
|
50
|
+
private currentDocument;
|
|
36
51
|
private readonly baseline;
|
|
37
52
|
private readonly bound;
|
|
38
53
|
private readonly admitting;
|
|
@@ -51,12 +66,21 @@ export declare class DsmmProfileRuntime {
|
|
|
51
66
|
describe(): Promise<ProfileSnapshot>;
|
|
52
67
|
read(id: string): Promise<ProfileReadResult>;
|
|
53
68
|
save(request: ProfileSaveRequest): Promise<ProfileReadResult>;
|
|
69
|
+
getStartupSettings(): DsmmSettings;
|
|
70
|
+
/** Preview uses the admission path but neither binds nor creates an Agent. */
|
|
71
|
+
previewDeployment(desired: DsmmDeploymentSnapshot): DeploymentAdmissionView;
|
|
72
|
+
describeDeployment(agent?: DshAgent): Promise<{
|
|
73
|
+
startup: DsmmDeploymentSnapshot | null;
|
|
74
|
+
desired: DsmmDeploymentSnapshot | null;
|
|
75
|
+
admission: DsmmProfileAdmission;
|
|
76
|
+
}>;
|
|
54
77
|
select(request: ProfileSelectRequest): Promise<ProfileSnapshot>;
|
|
55
78
|
private prepare;
|
|
56
79
|
private profileAdmission;
|
|
57
80
|
private declaredProfileModel;
|
|
58
81
|
private agents;
|
|
59
82
|
private bind;
|
|
83
|
+
private bindChild;
|
|
60
84
|
private owner;
|
|
61
85
|
private assertRoot;
|
|
62
86
|
private admit;
|
package/lib/profile-runtime.js
CHANGED
|
@@ -4,20 +4,24 @@ import { ProfileStore, validateSessionProfileId } from "./profile-store.js";
|
|
|
4
4
|
import { DsmmProfileError, resolveProfileSettings } from "./profiles.js";
|
|
5
5
|
import { DSMM_ROLES, isRootRole } from "./roles.js";
|
|
6
6
|
import { roleRouteRuntimeState, selectInitialModelRoute } from "./role-routing.js";
|
|
7
|
-
import {
|
|
7
|
+
import { sessionEvents } from "./session-scope.js";
|
|
8
|
+
import { resolveAdmittedDsmmRole as resolveEffectiveDsmmRole } from "./role-policy.js";
|
|
8
9
|
import { DeepworkModeController, hasOpenTurn } from "./state.js";
|
|
9
10
|
import { resolveRoleRuntimePolicy } from "./settings.js";
|
|
11
|
+
import { freezeSettings } from "./settings.js";
|
|
12
|
+
import { resolveDshHome } from "./dsh-home.js";
|
|
13
|
+
import { lstatSync } from "node:fs";
|
|
14
|
+
import { projectDeepworkModule } from "./modules.js";
|
|
15
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
16
|
+
import { readOnlySettings, readOnlySettingSources } from "./status.js";
|
|
17
|
+
function deploymentAdmissionView(admission) {
|
|
18
|
+
return { settings: { ...readOnlySettings(admission.settings) }, sources: readOnlySettingSources(admission.sources ?? {}),
|
|
19
|
+
captures: readOnlySettingSources(admission.sourceCaptures?.fields ?? {}), restartRequired: [...admission.restartRequired ?? []], named: admission.profile === null ? null : { ...admission.profile } };
|
|
20
|
+
}
|
|
21
|
+
// Exact live native children retain their capture across DSMM runtime replacement.
|
|
22
|
+
const childAdmissions = new WeakMap();
|
|
10
23
|
function immutableSettings(settings) {
|
|
11
|
-
|
|
12
|
-
const freeze = (value) => {
|
|
13
|
-
if (typeof value !== "object" || value === null || Object.isFrozen(value))
|
|
14
|
-
return;
|
|
15
|
-
for (const entry of Object.values(value))
|
|
16
|
-
freeze(entry);
|
|
17
|
-
Object.freeze(value);
|
|
18
|
-
};
|
|
19
|
-
freeze(copy);
|
|
20
|
-
return copy;
|
|
24
|
+
return freezeSettings(settings);
|
|
21
25
|
}
|
|
22
26
|
/** Global defaults admit new roots; scoped idle switches replace one root's epoch. */
|
|
23
27
|
export class DsmmProfileRuntime {
|
|
@@ -26,6 +30,7 @@ export class DsmmProfileRuntime {
|
|
|
26
30
|
options;
|
|
27
31
|
getSettings = (agent) => agent === undefined ? this.current.settings : this.bind(agent).settings;
|
|
28
32
|
current;
|
|
33
|
+
currentDocument = null;
|
|
29
34
|
baseline;
|
|
30
35
|
bound = new WeakMap();
|
|
31
36
|
admitting = new WeakSet();
|
|
@@ -39,24 +44,26 @@ export class DsmmProfileRuntime {
|
|
|
39
44
|
this.store = store;
|
|
40
45
|
this.options = options;
|
|
41
46
|
this.baseline = immutableSettings(baseline);
|
|
42
|
-
this.mode = options.modeController ?? new DeepworkModeController({ get: (name) => ctx.get?.(name) });
|
|
47
|
+
this.mode = options.modeController ?? new DeepworkModeController({ get: (name) => ctx.get?.(name) }, (agent) => this.getSettings(agent).modules.deepwork.enabled);
|
|
43
48
|
this.current = this.prepare(null, { selectedId: null, appliedRevision: null, selectionRevision: "absent" });
|
|
44
49
|
this.getSettings.admission = (agent) => this.admission(agent);
|
|
50
|
+
this.getSettings.moduleStates = (agent) => { const admission = this.admission(agent); return [projectDeepworkModule(this.baseline, admission.deployment, admission)]; };
|
|
45
51
|
}
|
|
46
52
|
async initialize() {
|
|
47
53
|
const selection = await this.store.loadSelection();
|
|
54
|
+
this.currentDocument = selection.document === null ? null : freezeSettings(selection.document);
|
|
48
55
|
this.current = this.prepare(selection.document, selection);
|
|
49
56
|
this.ctx.on?.("agent/created", async ({ agent, signal }) => {
|
|
50
57
|
// Factory initialization already owns native maintenance: never whenIdle
|
|
51
58
|
// or reserve maintenance from inside this serial creation listener.
|
|
52
59
|
await this.admit(agent, signal);
|
|
53
60
|
}, { global: true, prepend: true });
|
|
54
|
-
this.ctx.on?.("agent/disposed", ({ agent }) => { this.disposedAgents.add(agent); }, { global: true });
|
|
61
|
+
this.ctx.on?.("agent/disposed", ({ agent }) => { this.disposedAgents.add(agent); childAdmissions.delete(agent); }, { global: true });
|
|
55
62
|
this.ctx.effect?.(() => () => { this.disposed = true; });
|
|
56
63
|
// Installation into an already-running host treats those Agents as admitted
|
|
57
64
|
// now, while all later profile switches continue to preserve their snapshot.
|
|
58
65
|
for (const agent of this.agents()?.list() ?? [])
|
|
59
|
-
await this.admit(agent);
|
|
66
|
+
await this.admit(agent, undefined, this.options.startup);
|
|
60
67
|
}
|
|
61
68
|
admission(agent) { return agent === undefined ? this.current : this.bind(agent); }
|
|
62
69
|
async getSession(agent) {
|
|
@@ -69,11 +76,13 @@ export class DsmmProfileRuntime {
|
|
|
69
76
|
if ((disk.admissionEpoch === null && admitted.scope !== "global-default") || (disk.admissionEpoch !== null && (disk.admissionEpoch !== admitted.epoch || disk.selectedId !== admitted.selectedId || disk.appliedRevision !== admitted.appliedRevision))) {
|
|
70
77
|
throw new DsmmProfileError("conflict", "The session choice changed outside this Host. Its admitted policy was retained; refresh or resume explicitly.");
|
|
71
78
|
}
|
|
72
|
-
const reason = this.switching.has(agent) ? "maintenance" : agent.status === "running" ? "busy" : agent.runMaintenance === undefined ? "unavailable" : undefined;
|
|
79
|
+
const reason = this.store.readOnly ? "unavailable" : this.switching.has(agent) ? "maintenance" : agent.status === "running" ? "busy" : agent.runMaintenance === undefined ? "unavailable" : undefined;
|
|
73
80
|
const role = resolveEffectiveDsmmRole(agent, admitted.settings, this.mode.active(agent, admitted.settings.defaultActive));
|
|
74
81
|
const profileModel = this.declaredProfileModel(admitted.settings, role);
|
|
75
82
|
return { sessionId: agent.id, globalDefault: selectionState(this.current), selection: selectionState(disk), admittedSelection: selectionState(admitted), scope: admitted.scope,
|
|
76
83
|
rolePolicy: roleRouteRuntimeState(agent, admitted.settings, role, admitted.epoch), deepwork: this.mode.describe(agent, admitted.settings.defaultActive),
|
|
84
|
+
modules: [projectDeepworkModule(this.baseline, admitted.deployment, admitted)],
|
|
85
|
+
configuration: deploymentAdmissionView(admitted),
|
|
77
86
|
...(profileModel === undefined ? {} : { profileModel }),
|
|
78
87
|
admissionEpoch: admitted.epoch, switchAllowed: reason === undefined, ...(reason === undefined ? {} : { switchUnavailableReason: reason }) };
|
|
79
88
|
}
|
|
@@ -91,11 +100,11 @@ export class DsmmProfileRuntime {
|
|
|
91
100
|
if (this.bind(agent) !== admitted || admitted.epoch !== request.expectedAdmissionEpoch || mode.revision !== request.expectedModeRevision) {
|
|
92
101
|
throw new DsmmProfileError("conflict", "The session profile, preset or mode changed. Refresh before retrying.");
|
|
93
102
|
}
|
|
94
|
-
if (mode.locked)
|
|
95
|
-
throw new DsmmProfileError("validation", "A DW preset owns its Deepwork composition.");
|
|
96
103
|
assertAuthority?.();
|
|
97
104
|
};
|
|
98
105
|
assertCurrent();
|
|
106
|
+
if (request.active && !admitted.settings.modules.deepwork.enabled)
|
|
107
|
+
throw new DsmmProfileError("unavailable", "Deepwork module is not admitted in this session; changing mode cannot enable it.", "modules.deepwork.enabled");
|
|
99
108
|
if (agent.status === "running")
|
|
100
109
|
throw new DsmmProfileError("busy", "Wait for the session to become idle.");
|
|
101
110
|
if (agent.runMaintenance === undefined)
|
|
@@ -159,8 +168,9 @@ export class DsmmProfileRuntime {
|
|
|
159
168
|
assertCurrent(maintenanceSignal);
|
|
160
169
|
const epoch = newEpoch();
|
|
161
170
|
let profileModel;
|
|
171
|
+
let committed;
|
|
162
172
|
const result = await this.store.selectSession(request, epoch, async (document) => {
|
|
163
|
-
const prepared = immutableSettings(resolveProfileSettings(
|
|
173
|
+
const prepared = immutableSettings(resolveProfileSettings(admitted.baseline, document?.settings ?? {}));
|
|
164
174
|
await this.validate(prepared, agent, maintenanceSignal);
|
|
165
175
|
const role = resolveEffectiveDsmmRole(agent, prepared, this.mode.active(agent, prepared.defaultActive));
|
|
166
176
|
profileModel = this.declaredProfileModel(prepared, role);
|
|
@@ -169,13 +179,17 @@ export class DsmmProfileRuntime {
|
|
|
169
179
|
}, {
|
|
170
180
|
assertCurrent: () => assertCurrent(maintenanceSignal),
|
|
171
181
|
committed: (selection, settings) => {
|
|
172
|
-
|
|
182
|
+
committed = this.profileAdmission(selection, settings, epoch, request.id === null ? "deployment-baseline" : "session-override", admitted.baseline, admitted.deployment, admitted.restartRequired, selection.document);
|
|
183
|
+
this.bound.set(agent, committed);
|
|
184
|
+
this.mode.changed(agent);
|
|
173
185
|
}
|
|
174
186
|
});
|
|
175
187
|
// A committed selection remains a successful transaction even if a
|
|
176
188
|
// queued wake or disposal wins immediately when maintenance releases.
|
|
177
189
|
return { sessionId: request.sessionId, globalDefault: selectionState(this.current), selection: selectionState(result.selection), admittedSelection: selectionState(result.selection),
|
|
178
190
|
deepwork: this.mode.describe(agent, result.prepared.defaultActive),
|
|
191
|
+
modules: [projectDeepworkModule(this.baseline, committed.deployment, committed)],
|
|
192
|
+
configuration: deploymentAdmissionView(committed),
|
|
179
193
|
...(profileModel === undefined ? {} : { profileModel }),
|
|
180
194
|
scope: request.id === null ? "deployment-baseline" : "session-override", admissionEpoch: epoch, switchAllowed: true };
|
|
181
195
|
}
|
|
@@ -221,26 +235,110 @@ export class DsmmProfileRuntime {
|
|
|
221
235
|
}
|
|
222
236
|
read(id) { return this.store.read(id); }
|
|
223
237
|
save(request) { return this.store.save(request); }
|
|
238
|
+
getStartupSettings() { return this.baseline; }
|
|
239
|
+
/** Preview uses the admission path but neither binds nor creates an Agent. */
|
|
240
|
+
previewDeployment(desired) {
|
|
241
|
+
return deploymentAdmissionView(this.prepare(this.currentDocument, this.current, this.current.epoch, "global-default", desired));
|
|
242
|
+
}
|
|
243
|
+
async describeDeployment(agent) {
|
|
244
|
+
const desired = await this.options.readDesired?.();
|
|
245
|
+
return { startup: this.options.startup ?? null, desired: desired ?? null, admission: this.admission(agent) };
|
|
246
|
+
}
|
|
224
247
|
select(request) {
|
|
225
248
|
const operation = this.selectionQueue.then(async () => {
|
|
249
|
+
let selectedDocument = null;
|
|
250
|
+
const baseline = this.current.baseline;
|
|
226
251
|
const result = await this.store.select(request, async (document) => {
|
|
227
|
-
|
|
252
|
+
selectedDocument = document === null ? null : freezeSettings(document);
|
|
253
|
+
const prepared = immutableSettings(resolveProfileSettings(baseline, document?.settings ?? {}));
|
|
228
254
|
await this.validate(prepared);
|
|
229
255
|
return prepared;
|
|
230
256
|
});
|
|
231
257
|
// There is no await between successful durable commit and publication of
|
|
232
258
|
// the complete settings value. Draft saves never reach this assignment.
|
|
233
|
-
this.current = this.profileAdmission(result.selection, result.prepared, newEpoch(), "global-default");
|
|
259
|
+
this.current = this.profileAdmission(result.selection, result.prepared, newEpoch(), "global-default", baseline, this.options.startup, this.current.restartRequired, selectedDocument);
|
|
260
|
+
this.currentDocument = selectedDocument;
|
|
234
261
|
return this.describe();
|
|
235
262
|
});
|
|
236
263
|
this.selectionQueue = operation.catch(() => undefined);
|
|
237
264
|
return operation;
|
|
238
265
|
}
|
|
239
|
-
prepare(document, selection, epoch = newEpoch(), scope = "global-default") {
|
|
240
|
-
|
|
266
|
+
prepare(document, selection, epoch = newEpoch(), scope = "global-default", deployment = this.options.startup) {
|
|
267
|
+
const desired = deployment?.settings ?? this.baseline;
|
|
268
|
+
const effective = structuredClone(desired);
|
|
269
|
+
const restartRequired = [];
|
|
270
|
+
effective.modules.deepwork.enabled = desired.modules.deepwork.enabled && this.baseline.modules.deepwork.enabled;
|
|
271
|
+
if (desired.modules.deepwork.enabled && !this.baseline.modules.deepwork.enabled)
|
|
272
|
+
restartRequired.push("modules.deepwork.enabled");
|
|
273
|
+
for (const role of DSMM_ROLES) {
|
|
274
|
+
if (desired.roles[role.id] && !this.baseline.roles[role.id])
|
|
275
|
+
restartRequired.push(`roles.${role.id}`);
|
|
276
|
+
effective.roles[role.id] = desired.roles[role.id] && this.baseline.roles[role.id];
|
|
277
|
+
}
|
|
278
|
+
const capability = desired.subagents.backgroundMode === "continuable" ? this.options.subagentCapabilities?.continuable : this.options.subagentCapabilities?.backgroundJobs;
|
|
279
|
+
if (desired.subagents.enableRunInBackground && capability === false) {
|
|
280
|
+
effective.subagents.enableRunInBackground = false;
|
|
281
|
+
restartRequired.push("subagents");
|
|
282
|
+
}
|
|
283
|
+
for (const key of ["modeName", "promptOrder", "presets", "lsp"]) {
|
|
284
|
+
if (JSON.stringify(desired[key]) !== JSON.stringify(this.baseline[key]))
|
|
285
|
+
restartRequired.push(key);
|
|
286
|
+
Object.assign(effective, { [key]: this.baseline[key] });
|
|
287
|
+
}
|
|
288
|
+
if (deployment !== undefined && this.options.startup !== undefined
|
|
289
|
+
&& (deployment.profile.section ?? deployment.global.section) !== (this.options.startup.profile.section ?? this.options.startup.global.section))
|
|
290
|
+
restartRequired.push("section");
|
|
291
|
+
const baseline = immutableSettings(effective);
|
|
292
|
+
return this.profileAdmission(selection, immutableSettings(resolveProfileSettings(baseline, document?.settings ?? {})), epoch, scope, baseline, deployment, restartRequired, document);
|
|
241
293
|
}
|
|
242
|
-
profileAdmission(selection, settings, epoch, scope) {
|
|
243
|
-
|
|
294
|
+
profileAdmission(selection, settings, epoch, scope, baseline = this.baseline, deployment = this.options.startup, restartRequired = [], document = null) {
|
|
295
|
+
const sources = { ...deployment?.sources };
|
|
296
|
+
const fields = Object.fromEntries(Object.keys(sources).map((path) => [path, "deployment"]));
|
|
297
|
+
const pinStartup = (prefix) => {
|
|
298
|
+
const matches = (path) => path === prefix || path.startsWith(`${prefix}.`);
|
|
299
|
+
for (const path of Object.keys(sources).filter(matches)) {
|
|
300
|
+
delete sources[path];
|
|
301
|
+
delete fields[path];
|
|
302
|
+
}
|
|
303
|
+
for (const [path, source] of Object.entries(this.options.startup?.sources ?? {}).filter(([path]) => matches(path))) {
|
|
304
|
+
sources[path] = source;
|
|
305
|
+
fields[path] = "startup";
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
for (const key of ["modeName", "promptOrder", "presets", "lsp"])
|
|
309
|
+
pinStartup(key);
|
|
310
|
+
if (deployment?.settings.modules.deepwork.enabled && !baseline.modules.deepwork.enabled)
|
|
311
|
+
pinStartup("modules.deepwork.enabled");
|
|
312
|
+
for (const role of DSMM_ROLES) {
|
|
313
|
+
if (deployment?.settings.roles[role.id] && !baseline.roles[role.id])
|
|
314
|
+
pinStartup(`roles.${role.id}`);
|
|
315
|
+
}
|
|
316
|
+
const mark = (value, path) => {
|
|
317
|
+
if (value !== null && typeof value === "object" && !Array.isArray(value)) {
|
|
318
|
+
for (const [key, child] of Object.entries(value))
|
|
319
|
+
mark(child, [...path, key]);
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
sources[path.join(".")] = "named-session";
|
|
323
|
+
fields[path.join(".")] = "named-session";
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
for (const [role, policy] of Object.entries(document?.settings.roleRouting ?? {})) {
|
|
327
|
+
if (policy?.primary === undefined)
|
|
328
|
+
continue;
|
|
329
|
+
const prefix = `roleRouting.${role}.primary.`;
|
|
330
|
+
for (const path of Object.keys(sources).filter((path) => path.startsWith(prefix))) {
|
|
331
|
+
delete sources[path];
|
|
332
|
+
delete fields[path];
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
mark(document?.settings ?? {}, []);
|
|
336
|
+
return Object.freeze({ ...selectionState(selection), settings, baseline, epoch, scope, ...(deployment === undefined ? {} : { deployment }),
|
|
337
|
+
...(this.store.origin === undefined ? {} : { store: Object.freeze({ origin: this.store.origin, readOnly: this.store.readOnly === true,
|
|
338
|
+
...(this.store.writeRestriction === undefined ? {} : { writeRestriction: this.store.writeRestriction }) }) }),
|
|
339
|
+
sources: Object.freeze(sources), sourceCaptures: Object.freeze({ fields: Object.freeze(fields), ...(this.options.startup === undefined ? {} : { startup: Object.freeze({
|
|
340
|
+
globalRevision: this.options.startup.globalRevision, nativeRevision: this.options.startup.nativeRevision
|
|
341
|
+
}) }) }), restartRequired: Object.freeze([...restartRequired]), profile: selection.selectedId === null || selection.appliedRevision === null ? null : Object.freeze({ id: selection.selectedId, revision: selection.appliedRevision }) });
|
|
244
342
|
}
|
|
245
343
|
declaredProfileModel(settings, role) {
|
|
246
344
|
const primary = role === undefined ? undefined : settings.roleRouting[role]?.primary;
|
|
@@ -263,10 +361,25 @@ export class DsmmProfileRuntime {
|
|
|
263
361
|
// The native factory enters the exact child/owner pair before announcing
|
|
264
362
|
// creation. Durable lineage and inherited persona never establish ownership.
|
|
265
363
|
const parent = this.owner(agent);
|
|
266
|
-
const admitted = parent
|
|
364
|
+
const admitted = this.bindChild(agent, parent) ?? this.current;
|
|
267
365
|
this.bound.set(agent, admitted);
|
|
268
366
|
return admitted;
|
|
269
367
|
}
|
|
368
|
+
bindChild(agent, parent) {
|
|
369
|
+
const retained = childAdmissions.get(agent);
|
|
370
|
+
if (retained !== undefined) {
|
|
371
|
+
const registry = this.agents();
|
|
372
|
+
if (parent !== retained.parent || registry?.get !== undefined && (agent.id === undefined || registry.get(agent.id) !== agent)) {
|
|
373
|
+
throw new DsmmProfileError("not-owned", "The retained child's exact live owner changed; its captured admission was not rebound.");
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
if (parent === undefined)
|
|
377
|
+
return undefined;
|
|
378
|
+
const admission = retained?.admission ?? this.bind(parent);
|
|
379
|
+
this.bound.set(agent, admission);
|
|
380
|
+
childAdmissions.set(agent, { parent, admission });
|
|
381
|
+
return admission;
|
|
382
|
+
}
|
|
270
383
|
owner(agent) {
|
|
271
384
|
const agents = this.agents();
|
|
272
385
|
return agent.id === undefined ? undefined : agents?.list().find((candidate) => candidate !== agent && agents.isOwnedBy(agent.id, candidate));
|
|
@@ -282,20 +395,20 @@ export class DsmmProfileRuntime {
|
|
|
282
395
|
throw new DsmmProfileError("not-owned", "Session profile selection requires the exact live ordinary root Agent.");
|
|
283
396
|
}
|
|
284
397
|
}
|
|
285
|
-
async admit(agent, signal) {
|
|
398
|
+
async admit(agent, signal, startup) {
|
|
286
399
|
if (this.bound.has(agent))
|
|
287
400
|
return;
|
|
288
401
|
const parent = this.owner(agent);
|
|
289
|
-
if (parent !== undefined)
|
|
290
|
-
this.bound.set(agent, this.bind(parent));
|
|
402
|
+
if (this.bindChild(agent, parent) !== undefined)
|
|
291
403
|
return;
|
|
292
|
-
}
|
|
293
404
|
if (agent.id === undefined) {
|
|
294
405
|
this.bind(agent);
|
|
295
406
|
return;
|
|
296
407
|
}
|
|
297
408
|
this.admitting.add(agent);
|
|
298
409
|
try {
|
|
410
|
+
signal?.throwIfAborted();
|
|
411
|
+
const deployment = startup ?? await this.options.readDesired?.();
|
|
299
412
|
signal?.throwIfAborted();
|
|
300
413
|
const selection = await this.store.loadSessionSelection(agent.id);
|
|
301
414
|
signal?.throwIfAborted();
|
|
@@ -304,13 +417,25 @@ export class DsmmProfileRuntime {
|
|
|
304
417
|
const registry = this.agents();
|
|
305
418
|
if (registry?.get !== undefined && registry.get(agent.id) !== agent)
|
|
306
419
|
throw new DsmmProfileError("not-owned", "The live session changed during profile admission.");
|
|
307
|
-
|
|
420
|
+
const candidate = selection.admissionEpoch === null
|
|
421
|
+
? this.options.readDesired === undefined ? this.current : this.prepare(this.currentDocument, this.current, newEpoch(), "global-default", deployment)
|
|
422
|
+
: this.prepare(selection.document, selection, selection.admissionEpoch, selection.selectedId === null ? "deployment-baseline" : "session-override", deployment);
|
|
423
|
+
if (this.options.readDesired !== undefined)
|
|
424
|
+
await this.validate(candidate.settings, agent, signal, startup !== undefined);
|
|
425
|
+
signal?.throwIfAborted();
|
|
426
|
+
if (this.disposed || this.disposedAgents.has(agent))
|
|
427
|
+
throw new DsmmProfileError("disposed", "The session was disposed during deployment admission.");
|
|
428
|
+
if (registry?.get !== undefined && registry.get(agent.id) !== agent)
|
|
429
|
+
throw new DsmmProfileError("not-owned", "The live session changed during deployment admission.");
|
|
430
|
+
this.bound.set(agent, candidate);
|
|
308
431
|
}
|
|
309
432
|
finally {
|
|
310
433
|
this.admitting.delete(agent);
|
|
311
434
|
}
|
|
312
435
|
}
|
|
313
|
-
async validate(settings, agent, signal) {
|
|
436
|
+
async validate(settings, agent, signal, auditCatalog = true) {
|
|
437
|
+
if (!settings.modules.deepwork.enabled)
|
|
438
|
+
return;
|
|
314
439
|
if (this.options.validateCandidate !== undefined) {
|
|
315
440
|
await this.options.validateCandidate(settings);
|
|
316
441
|
return;
|
|
@@ -328,6 +453,11 @@ export class DsmmProfileRuntime {
|
|
|
328
453
|
}
|
|
329
454
|
}
|
|
330
455
|
}
|
|
456
|
+
// New-root capture validates deployment/schema and standing capability, not
|
|
457
|
+
// dormant role routes. Actual root requests and role/alias preflight own
|
|
458
|
+
// model selection. Named Apply and retained-root startup keep full audits.
|
|
459
|
+
if (!auditCatalog)
|
|
460
|
+
return;
|
|
331
461
|
const nativeAgent = agent ?? (this.agents()?.list() ?? []).find((candidate) => candidate.ctx?.get?.("llm")?.resolveCallConfig !== undefined);
|
|
332
462
|
const inherited = nativeAgent?.options;
|
|
333
463
|
const inheritedRoute = inherited?.provider === undefined || inherited.model === undefined ? undefined
|
|
@@ -372,7 +502,21 @@ export async function createProfileRuntime(ctx, baseline, options = {}) {
|
|
|
372
502
|
const profile = ctx.get?.("profileContext");
|
|
373
503
|
if (typeof profile?.dir !== "string" || profile.dir.trim() === "")
|
|
374
504
|
throw new DsmmProfileError("activation", "Deepwork profiles require the native deployment profile directory.");
|
|
375
|
-
const
|
|
505
|
+
const legacy = join(profile.dir, "dsmm-profiles");
|
|
506
|
+
let exists = false;
|
|
507
|
+
try {
|
|
508
|
+
lstatSync(legacy);
|
|
509
|
+
exists = true;
|
|
510
|
+
}
|
|
511
|
+
catch (error) {
|
|
512
|
+
if (!(error !== null && typeof error === "object" && "code" in error && error.code === "ENOENT"))
|
|
513
|
+
throw new DsmmProfileError("unsafe-path", "The current profile's legacy store could not be safely checked.");
|
|
514
|
+
}
|
|
515
|
+
// Loader callers use its actual public entry key. The old trusted non-Loader
|
|
516
|
+
// constructor path has one compatibility namespace, not a guessed entry.
|
|
517
|
+
const entry = options.startup?.entryId ?? (ctx instanceof Context ? ctx.fiber.entry?.id : undefined) ?? "trusted-direct";
|
|
518
|
+
const store = exists ? ProfileStore.fromLegacy(legacy) : ProfileStore.fromCentral(resolveDshHome(profile.home), profile.dir, entry);
|
|
519
|
+
const runtime = new DsmmProfileRuntime(ctx, baseline, store, options);
|
|
376
520
|
await runtime.initialize();
|
|
377
521
|
return runtime;
|
|
378
522
|
}
|
package/lib/profile-store.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Stats } from "node:fs";
|
|
1
2
|
import type { ProfileReadResult, ProfileSaveRequest, ProfileSelectRequest, ProfileSelectionState, ProfileSnapshot, SessionProfileSelectRequest } from "./profile-types.js";
|
|
2
3
|
import type { DsmmProfileDocument } from "./profiles.js";
|
|
3
4
|
export type SaveProfileRequest = ProfileSaveRequest;
|
|
@@ -23,15 +24,32 @@ export interface ProfileStoreOptions {
|
|
|
23
24
|
/** Narrow test seam for a failed atomic replacement; never delete the old target. */
|
|
24
25
|
rename?: (source: string, destination: string) => void;
|
|
25
26
|
}
|
|
27
|
+
interface ProfileFile {
|
|
28
|
+
bytes: Buffer;
|
|
29
|
+
content: string;
|
|
30
|
+
revision: string;
|
|
31
|
+
}
|
|
32
|
+
type DirectoryIdentities = Map<string, Stats>;
|
|
33
|
+
export interface ProfileStoreMetadata {
|
|
34
|
+
origin: "central" | "legacy" | "explicit";
|
|
35
|
+
readOnly: boolean;
|
|
36
|
+
writeRestriction?: string;
|
|
37
|
+
}
|
|
26
38
|
/** This directory is supplied by the Host, never by a remote method parameter. */
|
|
27
39
|
export declare class ProfileStore {
|
|
28
40
|
readonly profileDir: string;
|
|
41
|
+
readonly stateDir: string;
|
|
29
42
|
private readonly timeoutMs;
|
|
30
43
|
private readonly pollMs;
|
|
31
44
|
private readonly rename;
|
|
32
45
|
private rootIdentity?;
|
|
46
|
+
readonly origin: ProfileStoreMetadata["origin"];
|
|
47
|
+
private readonly hostProfile?;
|
|
48
|
+
private readonly identities;
|
|
33
49
|
constructor(profileDir: string, options?: ProfileStoreOptions);
|
|
34
|
-
|
|
50
|
+
static fromCentral(home: string, canonicalHostProfile: string, actualEntryId: string, options?: ProfileStoreOptions): ProfileStore;
|
|
51
|
+
static fromLegacy(legacyDir: string, options?: ProfileStoreOptions): ProfileStore;
|
|
52
|
+
describe(): Promise<ProfileSnapshot & ProfileStoreMetadata>;
|
|
35
53
|
read(id: string): Promise<ProfileReadResult>;
|
|
36
54
|
save(request: ProfileSaveRequest): Promise<ProfileReadResult>;
|
|
37
55
|
loadSelection(): Promise<LoadedProfileSelection>;
|
|
@@ -54,7 +72,33 @@ export declare class ProfileStore {
|
|
|
54
72
|
private publishRevision;
|
|
55
73
|
private atomicReplace;
|
|
56
74
|
private validateRoot;
|
|
75
|
+
private validateState;
|
|
76
|
+
private metadata;
|
|
77
|
+
get readOnly(): boolean;
|
|
78
|
+
get writeRestriction(): string | undefined;
|
|
79
|
+
private assertWritable;
|
|
80
|
+
private readOperation;
|
|
57
81
|
private locked;
|
|
58
82
|
}
|
|
83
|
+
declare function locked<T>(directory: string, lockName: string, validateRoot: (create: boolean) => void, timeoutMs: number, pollMs: number, operation: (assertLock: () => void) => T | Promise<T>): Promise<T>;
|
|
84
|
+
declare function atomicReplace(target: string, bytes: Buffer, beforeRename: (temporary: string) => void, assertAuthority: () => void, rename: (source: string, destination: string) => void, assertCurrent?: () => void): void;
|
|
85
|
+
declare function trustedHome(home: string): string;
|
|
86
|
+
/** @internal Shared only by the fixed config file adapter; not a wire-path storage API. */
|
|
87
|
+
export declare const profileStoreFilePrimitives: {
|
|
88
|
+
trustedHome: typeof trustedHome;
|
|
89
|
+
validateDirectories: typeof validateDirectories;
|
|
90
|
+
status: typeof status;
|
|
91
|
+
regularFile: typeof regularFile;
|
|
92
|
+
digest: typeof digest;
|
|
93
|
+
boundedOption: typeof boundedOption;
|
|
94
|
+
locked: typeof locked;
|
|
95
|
+
atomicReplace: typeof atomicReplace;
|
|
96
|
+
};
|
|
97
|
+
declare function boundedOption(value: number | undefined, fallback: number, minimum: number, maximum: number): number;
|
|
98
|
+
declare function digest(bytes: Buffer): string;
|
|
99
|
+
declare function status(path: string): Stats | undefined;
|
|
100
|
+
declare function validateDirectories(directory: string, create: boolean, allowMissing?: boolean, identities?: DirectoryIdentities): boolean;
|
|
101
|
+
declare function regularFile(path: string, maximum: number): ProfileFile;
|
|
59
102
|
export declare function validateSessionProfileId(id: unknown): asserts id is string;
|
|
103
|
+
export {};
|
|
60
104
|
//# sourceMappingURL=profile-store.d.ts.map
|