@dsmm/dsmm 0.1.9 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -58
- package/agent-presets/dsmm-builder/agent.cordis.yml +91 -186
- package/agent-presets/dsmm-builder/preset.yml +1 -1
- package/agent-presets/dsmm-clarifier/agent.cordis.yml +120 -17
- package/agent-presets/dsmm-clarifier/preset.yml +1 -1
- package/agent-presets/dsmm-code-search/agent.cordis.yml +72 -17
- package/agent-presets/dsmm-code-search/preset.yml +1 -1
- package/agent-presets/dsmm-coding/agent.cordis.yml +169 -0
- package/agent-presets/dsmm-coding/preset.yml +3 -0
- package/agent-presets/dsmm-complex/agent.cordis.yml +154 -0
- package/agent-presets/dsmm-complex/preset.yml +3 -0
- package/agent-presets/dsmm-creative/agent.cordis.yml +122 -15
- package/agent-presets/dsmm-creative/preset.yml +1 -1
- package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +179 -0
- package/agent-presets/dsmm-cross-cutting/preset.yml +3 -0
- package/agent-presets/dsmm-deep/agent.cordis.yml +189 -0
- package/agent-presets/dsmm-deep/preset.yml +3 -0
- package/agent-presets/dsmm-doc-search/agent.cordis.yml +72 -17
- package/agent-presets/dsmm-doc-search/preset.yml +1 -1
- package/agent-presets/dsmm-documenting/agent.cordis.yml +168 -0
- package/agent-presets/dsmm-documenting/preset.yml +3 -0
- package/agent-presets/dsmm-frontend/agent.cordis.yml +161 -0
- package/agent-presets/dsmm-frontend/preset.yml +3 -0
- package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +153 -0
- package/agent-presets/dsmm-hard-reasoning/preset.yml +3 -0
- package/agent-presets/dsmm-media-reader/agent.cordis.yml +72 -17
- package/agent-presets/dsmm-media-reader/preset.yml +1 -1
- package/agent-presets/dsmm-normal-task/agent.cordis.yml +127 -0
- package/agent-presets/dsmm-normal-task/preset.yml +3 -0
- package/agent-presets/dsmm-oracle/agent.cordis.yml +109 -15
- package/agent-presets/dsmm-oracle/preset.yml +1 -1
- package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +109 -15
- package/agent-presets/dsmm-oracle-2nd/preset.yml +1 -1
- package/agent-presets/dsmm-orchestrator/agent.cordis.yml +174 -190
- package/agent-presets/dsmm-orchestrator/preset.yml +1 -1
- package/agent-presets/dsmm-plan-critic/agent.cordis.yml +102 -16
- package/agent-presets/dsmm-plan-critic/preset.yml +1 -1
- package/agent-presets/dsmm-planner/agent.cordis.yml +134 -15
- package/agent-presets/dsmm-planner/preset.yml +1 -1
- package/agent-presets/dsmm-quick/agent.cordis.yml +132 -0
- package/agent-presets/dsmm-quick/preset.yml +3 -0
- package/agent-presets/dsmm-research/agent.cordis.yml +156 -0
- package/agent-presets/dsmm-research/preset.yml +3 -0
- package/agent-presets/dsmm-reviewer/agent.cordis.yml +108 -16
- package/agent-presets/dsmm-reviewer/preset.yml +1 -1
- package/cordis.patch.yml +1 -5
- package/docs/agent-presets.md +48 -15
- package/docs/compatibility.md +58 -68
- package/docs/deferred-native-approval-risk.md +19 -0
- package/docs/design.md +43 -2
- package/docs/lsp.md +12 -12
- package/docs/migration-from-ocmm.md +10 -2
- package/docs/model-routing.md +84 -59
- package/docs/native-permissions.md +35 -0
- package/docs/profiles.md +43 -64
- package/docs/releasing.md +159 -8
- package/docs/roadmap.md +77 -17
- package/docs/runtime-recovery.md +12 -0
- package/docs/safety-guards.md +7 -3
- package/docs/settings-status.md +46 -40
- package/docs/skill-sync.md +89 -14
- package/lib/child-admission-contract.d.ts +37 -0
- package/lib/child-admission-contract.js +2 -0
- package/lib/child-admission.d.ts +42 -0
- package/lib/child-admission.js +162 -0
- package/lib/child-capture.d.ts +81 -0
- package/lib/child-capture.js +203 -0
- package/lib/child-evidence.d.ts +17 -0
- package/lib/child-evidence.js +43 -0
- package/lib/client/ChildrenPanel.d.ts +43 -0
- package/lib/client/ChildrenPanel.js +82 -0
- package/lib/client/DeploymentPage.d.ts +18 -0
- package/lib/client/DeploymentPage.js +127 -0
- package/lib/client/EditableChoice.d.ts +17 -0
- package/lib/client/EditableChoice.js +49 -0
- package/lib/client/PermissionsPanel.d.ts +14 -0
- package/lib/client/PermissionsPanel.js +46 -0
- package/lib/client/ProfilesSection.js +32 -15
- package/lib/client/RoleAvailability.d.ts +7 -0
- package/lib/client/RoleAvailability.js +19 -0
- package/lib/client/SessionProfiles.js +27 -9
- package/lib/client/StructuredEditor.js +15 -7
- package/lib/client/children-controller.d.ts +98 -0
- package/lib/client/children-controller.js +296 -0
- package/lib/client/children-locales.d.ts +367 -0
- package/lib/client/children-locales.js +69 -0
- package/lib/client/controller.d.ts +6 -1
- package/lib/client/controller.js +14 -8
- package/lib/client/deployment-controller.d.ts +50 -0
- package/lib/client/deployment-controller.js +193 -0
- package/lib/client/deployment-data.d.ts +17 -0
- package/lib/client/deployment-data.js +138 -0
- package/lib/client/deployment-locales.d.ts +70 -0
- package/lib/client/deployment-locales.js +81 -0
- package/lib/client/diagnostics.d.ts +14 -0
- package/lib/client/diagnostics.js +53 -0
- package/lib/client/index.d.ts +4 -0
- package/lib/client/index.js +145 -1
- package/lib/client/locales.d.ts +58 -0
- package/lib/client/locales.js +38 -18
- package/lib/client/permission-client.d.ts +16 -0
- package/lib/client/permission-client.js +38 -0
- package/lib/client/permission-controller.d.ts +62 -0
- package/lib/client/permission-controller.js +149 -0
- package/lib/client/permission-locales.d.ts +114 -0
- package/lib/client/permission-locales.js +75 -0
- package/lib/client/plugins-contract.d.ts +27 -0
- package/lib/client/plugins-contract.js +2 -0
- package/lib/client/session-labels.js +4 -4
- package/lib/client/structured.js +19 -5
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.js +36 -0
- package/lib/client.js +6724 -1604
- 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/core-permission-authority.d.ts +18 -0
- package/lib/core-permission-authority.js +255 -0
- package/lib/core-permissions.d.ts +8 -0
- package/lib/core-permissions.js +33 -0
- package/lib/delivery-authority.d.ts +68 -0
- package/lib/delivery-authority.js +260 -0
- package/lib/deployment-config.d.ts +60 -0
- package/lib/deployment-config.js +205 -0
- package/lib/deployment-permission-rules.d.ts +55 -0
- package/lib/deployment-permission-rules.js +306 -0
- package/lib/dsh-home.d.ts +3 -0
- package/lib/dsh-home.js +10 -0
- package/lib/dsh-types.d.ts +22 -69
- package/lib/guards.d.ts +3 -2
- package/lib/guards.js +44 -6
- package/lib/host-llm-startup.d.ts +41 -0
- package/lib/host-llm-startup.js +65 -0
- package/lib/host-llm.d.ts +92 -0
- package/lib/host-llm.js +325 -0
- package/lib/index.d.ts +23 -5
- package/lib/index.js +383 -40
- package/lib/legacy-child-policy.d.ts +51 -0
- package/lib/legacy-child-policy.js +123 -0
- package/lib/legacy-read-composition.d.ts +20 -0
- package/lib/legacy-read-composition.js +144 -0
- package/lib/legacy-read-contracts.d.ts +157 -0
- package/lib/legacy-read-contracts.js +39 -0
- package/lib/legacy-read-host.d.ts +19 -0
- package/lib/legacy-read-host.js +67 -0
- package/lib/legacy-read-integration.d.ts +121 -0
- package/lib/legacy-read-integration.js +522 -0
- package/lib/legacy-read-proxy.d.ts +26 -0
- package/lib/legacy-read-proxy.js +237 -0
- package/lib/live-pi-ai-owner.d.ts +18 -0
- package/lib/live-pi-ai-owner.js +144 -0
- package/lib/llm-runtime.d.ts +11 -0
- package/lib/llm-runtime.js +21 -0
- package/lib/lsp.d.ts +13 -0
- package/lib/lsp.js +60 -0
- package/lib/managed-settings.d.ts +5 -0
- package/lib/managed-settings.js +14 -0
- package/lib/mode.js +42 -47
- package/lib/model-parameter-policy.d.ts +11 -0
- package/lib/model-parameter-policy.js +27 -0
- package/lib/model-routing.js +33 -19
- package/lib/modules.d.ts +35 -0
- package/lib/modules.js +37 -0
- package/lib/native-child-evidence.d.ts +42 -0
- package/lib/native-child-evidence.js +133 -0
- package/lib/native-pi-ai-wire.d.ts +37 -0
- package/lib/native-pi-ai-wire.js +261 -0
- package/lib/native-scope.d.ts +9 -0
- package/lib/native-scope.js +20 -0
- package/lib/permission-bash.d.ts +6 -0
- package/lib/permission-bash.js +7 -0
- package/lib/permission-control.d.ts +73 -0
- package/lib/permission-control.js +205 -0
- package/lib/permission-controller.d.ts +68 -0
- package/lib/permission-controller.js +317 -0
- package/lib/permission-errors.d.ts +7 -0
- package/lib/permission-errors.js +21 -0
- package/lib/permission-fs-search.d.ts +5 -0
- package/lib/permission-fs-search.js +7 -0
- package/lib/permission-fs.d.ts +5 -0
- package/lib/permission-fs.js +7 -0
- package/lib/permission-native-access.d.ts +11 -0
- package/lib/permission-native-access.js +6 -0
- package/lib/permission-native-command.d.ts +10 -0
- package/lib/permission-native-command.js +93 -0
- package/lib/permission-native-rules.d.ts +75 -0
- package/lib/permission-native-rules.js +278 -0
- package/lib/permission-pwsh.d.ts +6 -0
- package/lib/permission-pwsh.js +7 -0
- package/lib/permission-remote.d.ts +26 -0
- package/lib/permission-remote.js +53 -0
- package/lib/permission-rpc.d.ts +29 -0
- package/lib/permission-rpc.js +152 -0
- package/lib/permission-rules.d.ts +115 -0
- package/lib/permission-rules.js +256 -0
- package/lib/permission-settings.d.ts +45 -0
- package/lib/permission-settings.js +48 -0
- package/lib/permission-shell.d.ts +38 -0
- package/lib/permission-shell.js +150 -0
- package/lib/permission-web.d.ts +5 -0
- package/lib/permission-web.js +7 -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 +38 -24
- package/lib/preset-skills.d.ts +4 -1
- package/lib/preset-skills.js +60 -19
- package/lib/profile-diagnostics.d.ts +45 -0
- package/lib/profile-diagnostics.js +148 -0
- package/lib/profile-locale.d.ts +3 -0
- package/lib/profile-locale.js +2 -0
- package/lib/profile-remote.d.ts +22 -0
- package/lib/profile-remote.js +344 -27
- package/lib/profile-rpc.d.ts +25 -1
- package/lib/profile-rpc.js +143 -3
- package/lib/profile-runtime.d.ts +63 -0
- package/lib/profile-runtime.js +496 -77
- package/lib/profile-store.d.ts +56 -1
- package/lib/profile-store.js +377 -111
- package/lib/profile-types.d.ts +125 -1
- package/lib/profile-types.js +1 -0
- package/lib/profiles.d.ts +16 -2
- package/lib/profiles.js +156 -79
- package/lib/prompt-content.d.ts +25 -0
- package/lib/prompt-content.js +27 -0
- package/lib/prompts.d.ts +45 -4
- package/lib/prompts.js +157 -43
- package/lib/recovery-policy.js +20 -7
- package/lib/role-control-remote.d.ts +38 -0
- package/lib/role-control-remote.js +211 -0
- package/lib/role-control-rpc.d.ts +51 -0
- package/lib/role-control-rpc.js +377 -0
- package/lib/role-control-types.d.ts +92 -0
- package/lib/role-control-types.js +8 -0
- package/lib/role-invocation.d.ts +47 -0
- package/lib/role-invocation.js +135 -0
- package/lib/role-llm-runtime.d.ts +17 -0
- package/lib/role-llm-runtime.js +62 -0
- package/lib/role-llm.d.ts +31 -0
- package/lib/role-llm.js +66 -0
- package/lib/role-policy.d.ts +92 -0
- package/lib/role-policy.js +601 -0
- package/lib/role-providers.d.ts +7 -3
- package/lib/role-providers.js +74 -46
- package/lib/role-routing.d.ts +11 -2
- package/lib/role-routing.js +42 -25
- package/lib/role-runs.d.ts +135 -0
- package/lib/role-runs.js +304 -0
- package/lib/role-subagents.d.ts +63 -4
- package/lib/role-subagents.js +299 -47
- package/lib/roles.d.ts +20 -9
- package/lib/roles.js +87 -216
- package/lib/route-json.d.ts +19 -0
- package/lib/route-json.js +129 -0
- package/lib/routing-policy.d.ts +2 -0
- package/lib/routing-policy.js +12 -2
- package/lib/runtime-integration.d.ts +112 -0
- package/lib/runtime-integration.js +784 -0
- package/lib/runtime-recovery.js +34 -13
- package/lib/session-scope.js +2 -0
- package/lib/settings.d.ts +116 -14
- package/lib/settings.js +455 -149
- 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 +35 -1
- package/lib/status.js +58 -17
- package/lib/subagent-runtime.d.ts +45 -0
- package/lib/subagent-runtime.js +131 -0
- package/locale/en.json +2 -2
- package/locale/zh.json +2 -2
- package/package.json +112 -45
- package/patches/subagent-runtime.yml +15 -0
- package/prompts/deepseek-flash.md +1 -1
- package/prompts/deepseek-v4-pro.md +2 -2
- package/prompts/deepwork.md +153 -20
- package/prompts/source/agents/clarifier.md +47 -0
- package/prompts/source/agents/orchestrator.md +72 -0
- package/prompts/source/agents/plan-critic.md +29 -0
- package/prompts/source/agents/planner.md +21 -0
- package/prompts/source/agents/reviewer.md +23 -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 +40 -0
- package/prompts/source/category/cross-cutting.md +54 -0
- package/prompts/source/category/deep.md +64 -0
- package/prompts/source/category/documenting.md +68 -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 +58 -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 +136 -0
- package/prompts/source/deepwork/gemini.md +191 -0
- package/prompts/source/deepwork/glm.md +263 -0
- package/prompts/source/deepwork/gpt.md +49 -0
- package/prompts/source/deepwork/kimi-k27.md +13 -0
- package/prompts/source/deepwork/planner.md +44 -0
- package/prompts/source/deepwork/swe-2.md +13 -0
- package/prompts/source/manifest.json +3233 -0
- package/prompts/source/shared/dsh-host-contract.md +8 -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/scripts/cold-profile-composition.mjs +329 -0
- package/scripts/cold-profile-sources.mjs +238 -0
- package/scripts/migrate-cold-profile.mjs +315 -0
- package/skills/ast-grep/LICENSE +21 -0
- package/skills/ast-grep/README.md +138 -0
- package/skills/ast-grep/SKILL.md +287 -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 +123 -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 +147 -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 +130 -4
- package/skills/debugging/references/logging.md +2 -0
- package/skills/debugging/references/methodology/00-setup.md +16 -62
- package/skills/debugging/references/methodology/02-investigate.md +11 -5
- package/skills/debugging/references/methodology/03-flaky-triage.md +6 -4
- package/skills/debugging/references/methodology/04-hard-reasoning-escalation.md +6 -16
- package/skills/debugging/references/methodology/05-escalate.md +2 -0
- package/skills/debugging/references/methodology/06-fix.md +8 -6
- package/skills/debugging/references/methodology/08-qa.md +7 -5
- package/skills/debugging/references/methodology/09-cleanup.md +16 -152
- package/skills/debugging/references/methodology/partial-runtime-evidence.md +7 -18
- package/skills/debugging/references/runtimes/bundled-js-binary.md +3 -16
- package/skills/debugging/references/runtimes/go.md +2 -0
- package/skills/debugging/references/runtimes/native-binary.md +11 -54
- package/skills/debugging/references/runtimes/node.md +6 -15
- package/skills/debugging/references/runtimes/python.md +5 -15
- package/skills/debugging/references/runtimes/rust.md +4 -18
- 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 +4 -2
- package/skills/debugging/references/tools/ghidra.md +6 -15
- package/skills/debugging/references/tools/playwright-cli.md +5 -15
- package/skills/debugging/references/tools/pwndbg.md +2 -0
- package/skills/debugging/references/tools/pwntools.md +6 -16
- package/skills/dispatching-parallel-agents/SKILL.md +96 -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 +145 -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 +115 -0
- package/skills/git-master/agents/openai.yaml +13 -0
- package/skills/init-deep/SKILL.md +282 -0
- package/skills/receiving-code-review/SKILL.md +117 -7
- package/skills/remove-ai-slops/SKILL.md +160 -8
- package/skills/requesting-code-review/SKILL.md +98 -3
- package/skills/requesting-code-review/code-reviewer.md +59 -0
- package/skills/subagent-driven-development/SKILL.md +179 -6
- package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +23 -0
- package/skills/subagent-driven-development/implementer-prompt.md +87 -0
- package/skills/subagent-driven-development/spec-reviewer-prompt.md +37 -0
- package/skills/using-git-worktrees/SKILL.md +144 -0
- package/skills/writing-plans/SKILL.md +126 -7
- package/skills/writing-plans/plan-document-reviewer-prompt.md +47 -0
package/lib/profile-types.d.ts
CHANGED
|
@@ -1,14 +1,126 @@
|
|
|
1
1
|
/** Wire-only profile data: safe to import from the native browser client. */
|
|
2
2
|
import type { DsmmRoleId } from "./roles.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { DsmmModuleState } from "./modules.js";
|
|
4
|
+
import type { DsmmInvocationLevel, DsmmModelRoute, DsmmProfileScope } from "./settings.js";
|
|
5
|
+
import type { ProfileDiagnostic, ProfileDiagnosticCode, ProfileDiagnosticLocation } from "./profile-diagnostics.js";
|
|
6
|
+
export type { ProfileDiagnostic, ProfileDiagnosticCode, ProfileDiagnosticLocation } from "./profile-diagnostics.js";
|
|
7
|
+
export declare const DSMM_ROUTE_SOURCES: readonly ["inherited", "primary", "level", "invocation-route"];
|
|
8
|
+
export type DsmmRouteSource = typeof DSMM_ROUTE_SOURCES[number];
|
|
9
|
+
export type DsmmInitialRoleRoute = {
|
|
10
|
+
readonly status: "known";
|
|
11
|
+
readonly source: "invocation-capture";
|
|
12
|
+
readonly route: Readonly<DsmmModelRoute>;
|
|
13
|
+
} | {
|
|
14
|
+
readonly status: "unknown";
|
|
15
|
+
readonly reason: "missing-invocation-capture";
|
|
16
|
+
};
|
|
17
|
+
export type DsmmLiveRoleRoute = {
|
|
18
|
+
readonly status: "known";
|
|
19
|
+
readonly source: "own-native-request-header";
|
|
20
|
+
readonly route: Readonly<DsmmModelRoute>;
|
|
21
|
+
} | {
|
|
22
|
+
readonly status: "unknown";
|
|
23
|
+
readonly reason: "no-own-request-header" | "invalid-own-request-header" | "not-observed";
|
|
24
|
+
};
|
|
25
|
+
/** Exact child capture and own request observation; neither substitutes for the other. */
|
|
26
|
+
export type DsmmRoleRouteComparison = {
|
|
27
|
+
readonly childId: string;
|
|
28
|
+
readonly initialRoute: DsmmInitialRoleRoute;
|
|
29
|
+
readonly liveRoute: DsmmLiveRoleRoute;
|
|
30
|
+
};
|
|
31
|
+
export interface DsmmInvocationView {
|
|
32
|
+
role: DsmmRoleId;
|
|
33
|
+
label: string;
|
|
34
|
+
level: DsmmInvocationLevel;
|
|
35
|
+
routeSource: DsmmRouteSource;
|
|
36
|
+
/** Preflighted/actual native route, never inferred from raw wire arguments. */
|
|
37
|
+
route?: DsmmModelRoute;
|
|
38
|
+
mode: "one-shot" | "continuable";
|
|
39
|
+
runId?: string;
|
|
40
|
+
childId?: string;
|
|
41
|
+
jobId?: string;
|
|
42
|
+
routeComparison?: DsmmRoleRouteComparison;
|
|
43
|
+
}
|
|
44
|
+
export interface SubagentRuntimeAdmissionView {
|
|
45
|
+
binding: "stock" | "dsmm" | "unavailable";
|
|
46
|
+
deliveryFenceReady: boolean;
|
|
47
|
+
restartRequired: boolean;
|
|
48
|
+
reason?: "explicit-composition-required" | "duplicate-provider" | "authority-not-ready";
|
|
49
|
+
}
|
|
50
|
+
export interface DsmmRoleAvailabilityState {
|
|
51
|
+
id: DsmmRoleId;
|
|
52
|
+
required: boolean;
|
|
53
|
+
requiredReason?: "deepwork-planning" | "legacy-review";
|
|
54
|
+
startupAvailable: boolean;
|
|
55
|
+
deploymentEnabled: boolean;
|
|
56
|
+
namedEnabled?: boolean;
|
|
57
|
+
admitted: boolean;
|
|
58
|
+
reason?: "module-off" | "deployment-disabled" | "startup-unavailable" | "profile-disabled" | "required-role" | "current-root-disabled";
|
|
59
|
+
source: "defaults" | "global" | "profile" | "named-session";
|
|
60
|
+
capture: "startup" | "deployment" | "named-session";
|
|
61
|
+
}
|
|
62
|
+
/** Non-executable schema projection for the native deployment editor. */
|
|
63
|
+
export interface DeploymentSchemaNode {
|
|
64
|
+
type: string;
|
|
65
|
+
fields?: Record<string, DeploymentSchemaNode>;
|
|
66
|
+
inner?: DeploymentSchemaNode;
|
|
67
|
+
alternatives?: DeploymentSchemaNode[];
|
|
68
|
+
value?: string | number | boolean;
|
|
69
|
+
min?: number;
|
|
70
|
+
max?: number;
|
|
71
|
+
step?: number;
|
|
72
|
+
required?: boolean;
|
|
73
|
+
keys?: readonly string[];
|
|
74
|
+
nonempty?: boolean;
|
|
75
|
+
additionalProperties?: "json";
|
|
76
|
+
}
|
|
77
|
+
export interface DeploymentAdmissionView {
|
|
78
|
+
/** Captured execution semantics, not proof of a ready raw executor. */
|
|
79
|
+
modelParameterPolicy?: import("./model-parameter-policy.js").ResolvedModelParameterPolicy;
|
|
80
|
+
/** Host-redacted read-only view, never raw editor input or actual runtime settings. */
|
|
81
|
+
settings: Record<string, unknown>;
|
|
82
|
+
sources: Record<string, string>;
|
|
83
|
+
captures: Record<string, string>;
|
|
84
|
+
restartRequired: readonly string[];
|
|
85
|
+
named: {
|
|
86
|
+
id: string;
|
|
87
|
+
revision: string;
|
|
88
|
+
} | null;
|
|
89
|
+
}
|
|
90
|
+
export interface DeploymentEditorSnapshot {
|
|
91
|
+
entryId: string;
|
|
92
|
+
namespace: string | null;
|
|
93
|
+
hostProfileKey: string;
|
|
94
|
+
global: Record<string, unknown>;
|
|
95
|
+
globalRevision: string;
|
|
96
|
+
profile: Record<string, unknown>;
|
|
97
|
+
nativeRevision: string;
|
|
98
|
+
nativeFormRevision: number | null;
|
|
99
|
+
nativeForm: {
|
|
100
|
+
base: unknown;
|
|
101
|
+
user: unknown;
|
|
102
|
+
} | null;
|
|
103
|
+
/** Host-redacted inspector layers. global/profile/nativeForm remain C0 editor input. */
|
|
104
|
+
desired: Record<string, unknown>;
|
|
105
|
+
sources: Record<string, string>;
|
|
106
|
+
startup: Record<string, unknown>;
|
|
107
|
+
startupSources?: Record<string, string>;
|
|
108
|
+
defaults: Record<string, unknown>;
|
|
109
|
+
schema: DeploymentSchemaNode;
|
|
110
|
+
nextRoot: DeploymentAdmissionView | null;
|
|
111
|
+
modules: DsmmModuleState[];
|
|
112
|
+
}
|
|
4
113
|
import type { DsmmRateLimitPolicy, DsmmRoutingStrategy, DsmmRuntimePolicyConfig, DsmmRuntimePolicySettings } from "./routing-policy.js";
|
|
5
114
|
export type ProfileErrorCode = "validation" | "conflict" | "not-found" | "lock-timeout" | "unsafe-path" | "io" | "activation" | "corrupt-selection" | "limit" | "busy" | "maintenance" | "disposed" | "not-owned" | "unavailable" | "cancelled";
|
|
6
115
|
export interface ProfileErrorInfo {
|
|
116
|
+
reason?: ProfileDiagnosticCode;
|
|
117
|
+
location?: ProfileDiagnosticLocation;
|
|
7
118
|
code: ProfileErrorCode;
|
|
8
119
|
message: string;
|
|
9
120
|
field?: string;
|
|
10
121
|
}
|
|
11
122
|
export interface ProfileSummary {
|
|
123
|
+
warnings?: ProfileDiagnostic[];
|
|
12
124
|
id: string;
|
|
13
125
|
label?: string;
|
|
14
126
|
revision: string | null;
|
|
@@ -20,13 +132,18 @@ export interface ProfileSelectionState {
|
|
|
20
132
|
selectionRevision: string;
|
|
21
133
|
}
|
|
22
134
|
export interface ProfileSnapshot extends ProfileSelectionState {
|
|
135
|
+
selectedWarnings?: ProfileDiagnostic[];
|
|
23
136
|
profiles: ProfileSummary[];
|
|
24
137
|
selectionError?: ProfileErrorInfo;
|
|
25
138
|
/** Native deployment role inventory; excludes provider accounts and auth data. */
|
|
26
139
|
roles?: ProfileRoleMetadata[];
|
|
27
140
|
editorDefaults?: DsmmRuntimePolicySettings;
|
|
141
|
+
origin?: "central" | "legacy" | "explicit";
|
|
142
|
+
readOnly?: boolean;
|
|
143
|
+
writeRestriction?: string;
|
|
28
144
|
}
|
|
29
145
|
export interface ProfileReadResult {
|
|
146
|
+
warnings?: ProfileDiagnostic[];
|
|
30
147
|
id: string;
|
|
31
148
|
label?: string;
|
|
32
149
|
revision: string;
|
|
@@ -43,6 +160,7 @@ export interface ProfileSelectRequest {
|
|
|
43
160
|
expectedSelectionRevision: string;
|
|
44
161
|
}
|
|
45
162
|
export interface ProfileRoleMetadata {
|
|
163
|
+
availability?: DsmmRoleAvailabilityState;
|
|
46
164
|
id: DsmmRoleId;
|
|
47
165
|
label: string;
|
|
48
166
|
enabled: boolean;
|
|
@@ -60,6 +178,9 @@ export interface DsmmRoleRuntimeState {
|
|
|
60
178
|
totalDelayMs: number;
|
|
61
179
|
}
|
|
62
180
|
export interface SessionProfileSnapshot {
|
|
181
|
+
warnings?: ProfileDiagnostic[];
|
|
182
|
+
roles?: DsmmRoleAvailabilityState[];
|
|
183
|
+
subagentRuntime?: SubagentRuntimeAdmissionView;
|
|
63
184
|
sessionId: string;
|
|
64
185
|
globalDefault: ProfileSelectionState;
|
|
65
186
|
/** Current sidecar state: the authority for session-selection CAS. */
|
|
@@ -75,6 +196,9 @@ export interface SessionProfileSnapshot {
|
|
|
75
196
|
profileModel?: DsmmModelRoute;
|
|
76
197
|
/** Optional for older Hosts; explicit session intent always beats defaults. */
|
|
77
198
|
deepwork?: SessionDeepworkState;
|
|
199
|
+
/** Safe captured module admission; not a read of the current global editor. */
|
|
200
|
+
modules?: DsmmModuleState[];
|
|
201
|
+
configuration?: DeploymentAdmissionView;
|
|
78
202
|
}
|
|
79
203
|
export interface SessionDeepworkState {
|
|
80
204
|
active: boolean;
|
package/lib/profile-types.js
CHANGED
package/lib/profiles.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { DsmmPluginConfig, DsmmSettings } from "./settings.js";
|
|
2
2
|
import type { ProfileErrorCode, ProfileErrorInfo } from "./profile-types.js";
|
|
3
|
+
import type { ProfileDiagnostic, ProfileDiagnosticCode, ProfileDiagnosticLocation } from "./profile-diagnostics.js";
|
|
4
|
+
import type { DsmmRoleId } from "./roles.js";
|
|
3
5
|
export declare const MAX_PROFILE_BYTES: number;
|
|
4
6
|
export declare const MAX_PROFILE_COUNT = 128;
|
|
5
7
|
export declare const MAX_PROFILE_DIRECTORY_ENTRIES = 1024;
|
|
6
8
|
export declare const MAX_PROFILE_REVISIONS = 1024;
|
|
7
|
-
export type DsmmProfileOverlay = Pick<DsmmPluginConfig, "defaultActive" | "roleRouting" | "runtimePolicy" | "workflow" | "guards" | "runtimeRecovery" | "
|
|
9
|
+
export type DsmmProfileOverlay = Pick<DsmmPluginConfig, "modelParameters" | "defaultActive" | "roleRouting" | "runtimePolicy" | "workflow" | "guards" | "runtimeRecovery" | "roles" | "locale" | "deepseekV4ProCalibration" | "deepseekV4ProDefaultReasoningEffort" | "deepseekFlashCalibration" | "deepseekFlashDefaultReasoningEffort"> & {
|
|
10
|
+
subagents?: Pick<NonNullable<DsmmPluginConfig["subagents"]>, "toolTopology">;
|
|
11
|
+
};
|
|
8
12
|
export interface DsmmProfileDocument {
|
|
9
13
|
version: 1;
|
|
10
14
|
id: string;
|
|
@@ -14,13 +18,23 @@ export interface DsmmProfileDocument {
|
|
|
14
18
|
export declare class DsmmProfileError extends Error {
|
|
15
19
|
readonly code: ProfileErrorCode;
|
|
16
20
|
readonly field?: string;
|
|
17
|
-
|
|
21
|
+
readonly reason?: ProfileDiagnosticCode;
|
|
22
|
+
readonly location?: ProfileDiagnosticLocation;
|
|
23
|
+
constructor(code: ProfileErrorCode, message: string, field?: string, reason?: ProfileDiagnosticCode, location?: ProfileDiagnosticLocation);
|
|
18
24
|
toInfo(): ProfileErrorInfo;
|
|
19
25
|
}
|
|
20
26
|
export declare function profileErrorInfo(error: unknown, fallback?: ProfileErrorCode): ProfileErrorInfo;
|
|
21
27
|
export declare function validateProfileId(id: unknown): asserts id is string;
|
|
22
28
|
export declare function validateProfileRevision(revision: unknown, field?: string): asserts revision is string;
|
|
23
29
|
export declare function parseProfileDocument(content: string, expectedId?: string): DsmmProfileDocument;
|
|
30
|
+
export declare function validateProfileDocument(content: string, expectedId?: string): {
|
|
31
|
+
document?: DsmmProfileDocument;
|
|
32
|
+
diagnostics: ProfileDiagnostic[];
|
|
33
|
+
};
|
|
34
|
+
export declare function profileDocumentWarnings(document: DsmmProfileDocument | null): ProfileDiagnostic[];
|
|
35
|
+
export declare function validateProfileOverlay(input: unknown): asserts input is DsmmProfileOverlay;
|
|
24
36
|
export declare function mergeProfileConfig(baseline: DsmmPluginConfig, overlay: DsmmProfileOverlay): DsmmPluginConfig;
|
|
25
37
|
export declare function resolveProfileSettings(baseline: DsmmPluginConfig, overlay: DsmmProfileOverlay): DsmmSettings;
|
|
38
|
+
export declare function requiredDeepworkRoles(settings: Pick<DsmmSettings, "workflow">): DsmmRoleId[];
|
|
39
|
+
export declare function requiredReason(settings: Pick<DsmmSettings, "workflow">, role: DsmmRoleId): "deepwork-planning" | "legacy-review" | undefined;
|
|
26
40
|
//# sourceMappingURL=profiles.d.ts.map
|
package/lib/profiles.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { getNodeValue
|
|
1
|
+
import { getNodeValue } from "jsonc-parser";
|
|
2
2
|
import { DSMM_ROLE_IDS } from "./roles.js";
|
|
3
|
-
import { resolveConfig } from "./settings.js";
|
|
4
|
-
import { normalizeRateLimitOverrides, normalizeRoutingStrategy, normalizeRuntimePolicy } from "./routing-policy.js";
|
|
3
|
+
import { copyJson, DSMM_LOCALES, resolveConfig, normalizeLevelOverride } from "./settings.js";
|
|
4
|
+
import { DSMM_RATE_LIMIT_BOUNDS, normalizeRateLimitOverrides, normalizeRoutingStrategy, normalizeRuntimePolicy } from "./routing-policy.js";
|
|
5
|
+
import { DEPRECATED_DSMM_FIELDS, diagnostic, diagnosticSourcePath, DsmmConfigValidationError, fieldLocation, inspectJsonDocument } from "./profile-diagnostics.js";
|
|
6
|
+
import { normalizeModelRouteJson } from "./route-json.js";
|
|
5
7
|
export const MAX_PROFILE_BYTES = 128 * 1024;
|
|
6
8
|
export const MAX_PROFILE_COUNT = 128;
|
|
7
9
|
export const MAX_PROFILE_DIRECTORY_ENTRIES = 1024;
|
|
@@ -9,17 +11,23 @@ export const MAX_PROFILE_REVISIONS = 1024;
|
|
|
9
11
|
export class DsmmProfileError extends Error {
|
|
10
12
|
code;
|
|
11
13
|
field;
|
|
12
|
-
|
|
14
|
+
reason;
|
|
15
|
+
location;
|
|
16
|
+
constructor(code, message, field, reason, location) {
|
|
13
17
|
super(message);
|
|
14
18
|
this.name = "DsmmProfileError";
|
|
15
19
|
this.code = code;
|
|
16
20
|
this.field = field;
|
|
21
|
+
this.reason = reason;
|
|
22
|
+
this.location = location;
|
|
17
23
|
}
|
|
18
24
|
toInfo() {
|
|
19
|
-
return { code: this.code, message: this.message, ...(this.field === undefined ? {} : { field: this.field }) };
|
|
25
|
+
return { code: this.code, message: this.message, ...(this.field === undefined ? {} : { field: this.field }), ...(this.reason === undefined ? {} : { reason: this.reason }), ...(this.location === undefined ? {} : { location: this.location }) };
|
|
20
26
|
}
|
|
21
27
|
}
|
|
22
28
|
export function profileErrorInfo(error, fallback = "io") {
|
|
29
|
+
if (error instanceof DsmmConfigValidationError)
|
|
30
|
+
return { code: "validation", message: error.message, field: error.diagnostic.field, reason: error.diagnostic.code, ...(error.diagnostic.location === undefined ? {} : { location: error.diagnostic.location }) };
|
|
23
31
|
return error instanceof DsmmProfileError ? error.toInfo() : { code: fallback, message: "Deepwork profile operation failed; the previous selection and files were retained." };
|
|
24
32
|
}
|
|
25
33
|
export function validateProfileId(id) {
|
|
@@ -31,60 +39,127 @@ export function validateProfileRevision(revision, field = "expectedRevision") {
|
|
|
31
39
|
if (typeof revision !== "string" || !/^[a-f0-9]{64}$/u.test(revision))
|
|
32
40
|
invalid(field, "must be a SHA256 file revision");
|
|
33
41
|
}
|
|
34
|
-
const OVERLAY_FIELDS = ["defaultActive", "roleRouting", "runtimePolicy", "workflow", "guards", "runtimeRecovery", "
|
|
35
|
-
const FORBIDDEN_KEYS = new Set(["__proto__", "constructor", "prototype"]);
|
|
42
|
+
const OVERLAY_FIELDS = ["modelParameters", "defaultActive", "roleRouting", "runtimePolicy", "workflow", "guards", "runtimeRecovery", "roles", "locale", "subagents", "deepseekV4ProCalibration", "deepseekV4ProDefaultReasoningEffort", "deepseekFlashCalibration", "deepseekFlashDefaultReasoningEffort"];
|
|
36
43
|
export function parseProfileDocument(content, expectedId) {
|
|
44
|
+
const result = validateProfileDocument(content, expectedId);
|
|
45
|
+
const error = result.diagnostics.find(item => item.severity === "error");
|
|
46
|
+
if (error !== undefined)
|
|
47
|
+
throw new DsmmProfileError("validation", `${error.field}: ${error.reason}`, error.field, error.code, error.location);
|
|
48
|
+
return result.document;
|
|
49
|
+
}
|
|
50
|
+
export function validateProfileDocument(content, expectedId) {
|
|
37
51
|
if (typeof content !== "string")
|
|
38
|
-
|
|
52
|
+
return { diagnostics: [diagnostic("invalid-type", "content")] };
|
|
39
53
|
if (content.length > MAX_PROFILE_BYTES)
|
|
40
54
|
throw new DsmmProfileError("limit", "Profile files must not exceed 128 KiB.", "content");
|
|
41
55
|
const encoded = new TextEncoder().encode(content);
|
|
42
56
|
if (encoded.byteLength > MAX_PROFILE_BYTES)
|
|
43
57
|
throw new DsmmProfileError("limit", "Profile files must not exceed 128 KiB.", "content");
|
|
44
58
|
if (new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(encoded) !== content)
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
return { diagnostics: [diagnostic("invalid-type", "content")] };
|
|
60
|
+
const inspected = inspectJsonDocument(content);
|
|
61
|
+
if (inspected.diagnostics.length)
|
|
62
|
+
return { diagnostics: inspected.diagnostics };
|
|
63
|
+
const tree = inspected.tree;
|
|
64
|
+
try {
|
|
65
|
+
const document = record(getNodeValue(tree), "document");
|
|
66
|
+
keys(document, ["version", "id", "label", "settings"], "document");
|
|
67
|
+
if (document.version !== 1)
|
|
68
|
+
invalid("version", "must be 1", "unsupported-value");
|
|
69
|
+
validateProfileId(document.id);
|
|
70
|
+
if (expectedId !== undefined && document.id !== expectedId)
|
|
71
|
+
invalid("id", "must match the profile filename ID");
|
|
72
|
+
if (Object.hasOwn(document, "label")) {
|
|
73
|
+
if (typeof document.label !== "string" || document.label.length > 120 || /[\u0000-\u001F\u007F]/u.test(document.label)
|
|
74
|
+
|| new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(new TextEncoder().encode(document.label)) !== document.label)
|
|
75
|
+
invalid("label", "must be valid bounded text without controls");
|
|
76
|
+
}
|
|
77
|
+
const overlay = record(document.settings, "settings");
|
|
78
|
+
validateProfileOverlay(overlay);
|
|
79
|
+
const result = clone(document);
|
|
80
|
+
return { document: result, diagnostics: profileDocumentWarnings(result).map(info => ({ ...info, location: fieldLocation(content, tree, info.field) })) };
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
if (!(error instanceof DsmmProfileError) && !(error instanceof DsmmConfigValidationError))
|
|
84
|
+
throw error;
|
|
85
|
+
const code = error instanceof DsmmConfigValidationError ? error.diagnostic.code : error.reason ?? "invalid-type";
|
|
86
|
+
const field = error instanceof DsmmConfigValidationError ? error.diagnostic.field : error.field ?? "document";
|
|
87
|
+
return { diagnostics: [diagnostic(code, field, fieldLocation(content, tree, field, diagnosticSourcePath(error)))] };
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
export function profileDocumentWarnings(document) {
|
|
91
|
+
return document?.label !== undefined && document.label.trim() === "" ? [diagnostic("blank-label", "label")] : [];
|
|
92
|
+
}
|
|
93
|
+
export function validateProfileOverlay(input) {
|
|
94
|
+
let plain;
|
|
95
|
+
try {
|
|
96
|
+
plain = copyJson(input);
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
invalid("settings", "must be plain JSON");
|
|
100
|
+
}
|
|
101
|
+
const overlay = record(plain, "settings");
|
|
102
|
+
keys(overlay, OVERLAY_FIELDS, "settings");
|
|
62
103
|
optional(overlay, "defaultActive", bool, "settings");
|
|
104
|
+
optional(overlay, "modelParameters", (value, field) => {
|
|
105
|
+
const parameters = record(value, field);
|
|
106
|
+
keys(parameters, ["passthrough"], field);
|
|
107
|
+
optional(parameters, "passthrough", bool, field);
|
|
108
|
+
}, "settings");
|
|
63
109
|
for (const prefix of ["deepseekV4Pro", "deepseekFlash"]) {
|
|
64
110
|
optional(overlay, `${prefix}Calibration`, (value, field) => enumeration(value, ["off", "auto", "strict"], field), "settings");
|
|
65
111
|
optional(overlay, `${prefix}DefaultReasoningEffort`, (value, field) => enumeration(value, ["off", "low", "high"], field), "settings");
|
|
66
|
-
optional(overlay, `${prefix}MaxReasoningPresets`, roleList, "settings");
|
|
67
112
|
}
|
|
68
113
|
optional(overlay, "roleRouting", roleRouting, "settings");
|
|
69
114
|
optional(overlay, "runtimePolicy", runtimePolicy, "settings");
|
|
70
115
|
optional(overlay, "workflow", workflow, "settings");
|
|
71
116
|
optional(overlay, "guards", guards, "settings");
|
|
72
117
|
optional(overlay, "runtimeRecovery", recovery, "settings");
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
118
|
+
optional(overlay, "locale", (value, field) => enumeration(value, DSMM_LOCALES, field), "settings");
|
|
119
|
+
optional(overlay, "roles", (value, field) => {
|
|
120
|
+
const roles = record(value, field);
|
|
121
|
+
keys(roles, DSMM_ROLE_IDS, field);
|
|
122
|
+
for (const [role, enabled] of Object.entries(roles))
|
|
123
|
+
bool(enabled, `${field}.${role}`);
|
|
124
|
+
}, "settings");
|
|
125
|
+
optional(overlay, "subagents", (value, field) => {
|
|
126
|
+
const settings = record(value, field);
|
|
127
|
+
keys(settings, ["toolTopology"], field);
|
|
128
|
+
optional(settings, "toolTopology", (value, path) => enumeration(value, ["per-role", "parameterized"], path), field);
|
|
129
|
+
}, "settings");
|
|
130
|
+
const settings = resolveConfig(overlay);
|
|
131
|
+
for (const role of requiredDeepworkRoles(settings))
|
|
132
|
+
if (overlay.roles?.[role] === false)
|
|
133
|
+
invalid(`settings.roles.${role}`, "is required", "required-role");
|
|
82
134
|
}
|
|
83
135
|
export function mergeProfileConfig(baseline, overlay) {
|
|
84
|
-
return mergeRecords(baseline, overlay);
|
|
136
|
+
return mergeRecords(copyJson(baseline), copyJson(overlay));
|
|
85
137
|
}
|
|
86
138
|
export function resolveProfileSettings(baseline, overlay) {
|
|
87
|
-
|
|
139
|
+
const ceiling = resolveConfig(baseline);
|
|
140
|
+
const settings = resolveConfig(mergeProfileConfig(baseline, overlay));
|
|
141
|
+
for (const role of requiredDeepworkRoles(settings))
|
|
142
|
+
if (overlay.roles?.[role] === false)
|
|
143
|
+
invalid(`settings.roles.${role}`, "is required", "required-role");
|
|
144
|
+
for (const [role, enabled] of Object.entries(overlay.roles ?? {}))
|
|
145
|
+
if (enabled && (!ceiling.modules.deepwork.enabled || !ceiling.roles[role]))
|
|
146
|
+
invalid(`settings.roles.${role}`, "exceeds captured deployment", "deployment-ceiling");
|
|
147
|
+
return settings;
|
|
148
|
+
}
|
|
149
|
+
export function requiredDeepworkRoles(settings) {
|
|
150
|
+
const required = ["dsmm-orchestrator", "dsmm-planner", "dsmm-plan-critic"];
|
|
151
|
+
if (settings.workflow.policy === "legacy") {
|
|
152
|
+
if (settings.workflow.finalReviewPolicy !== "off")
|
|
153
|
+
required.push("dsmm-reviewer");
|
|
154
|
+
if (settings.workflow.finalReviewPolicy === "simple-oracle-complex-reviewer")
|
|
155
|
+
required.push("dsmm-oracle");
|
|
156
|
+
}
|
|
157
|
+
return required;
|
|
158
|
+
}
|
|
159
|
+
export function requiredReason(settings, role) {
|
|
160
|
+
if (!requiredDeepworkRoles(settings).includes(role))
|
|
161
|
+
return undefined;
|
|
162
|
+
return ["dsmm-orchestrator", "dsmm-planner", "dsmm-plan-critic"].includes(role) ? "deepwork-planning" : "legacy-review";
|
|
88
163
|
}
|
|
89
164
|
function mergeRecords(baseline, overlay) {
|
|
90
165
|
const result = {};
|
|
@@ -92,7 +167,7 @@ function mergeRecords(baseline, overlay) {
|
|
|
92
167
|
result[key] = clone(value);
|
|
93
168
|
for (const [key, value] of Object.entries(overlay)) {
|
|
94
169
|
// Routes are complete values, whereas each role's policy keys merge independently.
|
|
95
|
-
result[key] =
|
|
170
|
+
result[key] = !["primary", "low", "high", "max"].includes(key) && isRecord(value) && isRecord(result[key]) ? mergeRecords(result[key], value) : clone(value);
|
|
96
171
|
}
|
|
97
172
|
return result;
|
|
98
173
|
}
|
|
@@ -101,23 +176,6 @@ function clone(value) {
|
|
|
101
176
|
return value.map(clone);
|
|
102
177
|
return isRecord(value) ? mergeRecords({}, value) : value;
|
|
103
178
|
}
|
|
104
|
-
function validateTree(node, depth) {
|
|
105
|
-
if (depth > 32)
|
|
106
|
-
invalid("content", "exceeds the maximum JSON nesting depth");
|
|
107
|
-
if (node.type === "object") {
|
|
108
|
-
const found = new Set();
|
|
109
|
-
for (const property of node.children ?? []) {
|
|
110
|
-
const key = property.children?.[0]?.value;
|
|
111
|
-
if (typeof key !== "string" || FORBIDDEN_KEYS.has(key))
|
|
112
|
-
invalid("content", "contains an unsafe object key");
|
|
113
|
-
if (found.has(key))
|
|
114
|
-
invalid("content", "contains a duplicate object key; remove the duplicate before saving");
|
|
115
|
-
found.add(key);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
for (const child of node.children ?? [])
|
|
119
|
-
validateTree(child, depth + 1);
|
|
120
|
-
}
|
|
121
179
|
function isRecord(value) {
|
|
122
180
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
123
181
|
}
|
|
@@ -126,16 +184,22 @@ function record(value, field) {
|
|
|
126
184
|
invalid(field, "must be an object");
|
|
127
185
|
return value;
|
|
128
186
|
}
|
|
129
|
-
function keys(value, allowed, field,
|
|
130
|
-
|
|
131
|
-
|
|
187
|
+
function keys(value, allowed, field, _extra = "Remove unsupported fields before saving.") {
|
|
188
|
+
for (const key of DEPRECATED_DSMM_FIELDS)
|
|
189
|
+
if (Object.hasOwn(value, key))
|
|
190
|
+
throw new DsmmConfigValidationError("deprecated-field", [...field === "document" ? [] : field.split("."), key]);
|
|
191
|
+
for (const key of Object.keys(value)) {
|
|
192
|
+
if (!allowed.includes(key))
|
|
193
|
+
throw new DsmmConfigValidationError("unknown-field", [...field === "document" ? [] : field.split("."), key]);
|
|
194
|
+
}
|
|
132
195
|
}
|
|
133
196
|
function optional(value, key, validator, field) {
|
|
134
197
|
if (Object.hasOwn(value, key))
|
|
135
198
|
validator(value[key], `${field}.${key}`);
|
|
136
199
|
}
|
|
137
|
-
function invalid(field,
|
|
138
|
-
|
|
200
|
+
function invalid(field, _message, code = "invalid-type") {
|
|
201
|
+
const info = diagnostic(code, field);
|
|
202
|
+
throw new DsmmProfileError("validation", `${info.field}: ${info.reason}`, info.field, code);
|
|
139
203
|
}
|
|
140
204
|
function bool(value, field) {
|
|
141
205
|
if (typeof value !== "boolean")
|
|
@@ -147,7 +211,7 @@ function string(value, field, maximum) {
|
|
|
147
211
|
}
|
|
148
212
|
function enumeration(value, allowed, field) {
|
|
149
213
|
if (typeof value !== "string" || !allowed.includes(value))
|
|
150
|
-
invalid(field, `must be one of ${allowed.join(", ")}
|
|
214
|
+
invalid(field, `must be one of ${allowed.join(", ")}`, "unsupported-value");
|
|
151
215
|
}
|
|
152
216
|
function integer(value, field, minimum, maximum) {
|
|
153
217
|
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < minimum || value > maximum)
|
|
@@ -156,24 +220,15 @@ function integer(value, field, minimum, maximum) {
|
|
|
156
220
|
function array(value, field, maximum, validator) {
|
|
157
221
|
if (!Array.isArray(value) || value.length > maximum)
|
|
158
222
|
invalid(field, `must be an array with at most ${maximum} entries`);
|
|
159
|
-
|
|
160
|
-
validator(item, field);
|
|
161
|
-
}
|
|
162
|
-
function roleList(value, field) {
|
|
163
|
-
array(value, field, DSMM_ROLE_IDS.length, (role, path) => enumeration(role, DSMM_ROLE_IDS, path));
|
|
164
|
-
if (new Set(value).size !== value.length)
|
|
165
|
-
invalid(field, "must not contain duplicate roles");
|
|
223
|
+
value.forEach((item, index) => validator(item, `${field}[${index}]`));
|
|
166
224
|
}
|
|
167
225
|
function route(value, field) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
invalid(
|
|
173
|
-
|
|
174
|
-
if (item.model.includes("://"))
|
|
175
|
-
invalid(`${field}.model`, "must reference a native model ID, not a credential-bearing URL");
|
|
176
|
-
optional(item, "reasoningEffort", (effort, path) => string(effort, path, 64), field);
|
|
226
|
+
try {
|
|
227
|
+
normalizeModelRouteJson(value);
|
|
228
|
+
}
|
|
229
|
+
catch {
|
|
230
|
+
invalid(field, "must be a valid model route", "invalid-route");
|
|
231
|
+
}
|
|
177
232
|
}
|
|
178
233
|
function routeList(value, field) {
|
|
179
234
|
array(value, field, 32, route);
|
|
@@ -184,7 +239,23 @@ function roleRouting(value, field) {
|
|
|
184
239
|
for (const [role, raw] of Object.entries(item)) {
|
|
185
240
|
const path = `${field}.${role}`;
|
|
186
241
|
const policy = record(raw, path);
|
|
187
|
-
keys(policy, ["primary", "fallbackRoutes", "strategy", "rateLimit"], path);
|
|
242
|
+
keys(policy, ["primary", "fallbackRoutes", "strategy", "rateLimit", "levels"], path);
|
|
243
|
+
optional(policy, "levels", (value, field) => {
|
|
244
|
+
if (role === "dsmm-orchestrator")
|
|
245
|
+
invalid(field, "root model is native-owned", "unsupported-value");
|
|
246
|
+
const levels = record(value, field);
|
|
247
|
+
if (Object.hasOwn(levels, "normal"))
|
|
248
|
+
invalid(`${field}.normal`, "normal is a read-only default alias", "unsupported-value");
|
|
249
|
+
keys(levels, ["low", "high", "max"], field);
|
|
250
|
+
for (const [level, override] of Object.entries(levels)) {
|
|
251
|
+
const at = `${field}.${level}`;
|
|
252
|
+
normalizeLevelOverride(override, at);
|
|
253
|
+
if (isRecord(override) && (Object.hasOwn(override, "provider") || Object.hasOwn(override, "model")))
|
|
254
|
+
route(override, at);
|
|
255
|
+
else
|
|
256
|
+
string(override.reasoningEffort, `${at}.reasoningEffort`, 64);
|
|
257
|
+
}
|
|
258
|
+
}, path);
|
|
188
259
|
optional(policy, "primary", route, path);
|
|
189
260
|
optional(policy, "fallbackRoutes", routeList, path);
|
|
190
261
|
optional(policy, "strategy", strategy, path);
|
|
@@ -196,10 +267,16 @@ function strategy(value, field) {
|
|
|
196
267
|
normalizeRoutingStrategy(value);
|
|
197
268
|
}
|
|
198
269
|
catch {
|
|
199
|
-
invalid(field, "must be startup-lock or rate-limit-fallback");
|
|
270
|
+
invalid(field, "must be startup-lock or rate-limit-fallback", "unsupported-value");
|
|
200
271
|
}
|
|
201
272
|
}
|
|
202
273
|
function rateLimit(value, field) {
|
|
274
|
+
const item = record(value, field);
|
|
275
|
+
keys(item, Object.keys(DSMM_RATE_LIMIT_BOUNDS), field);
|
|
276
|
+
for (const [key, value] of Object.entries(item)) {
|
|
277
|
+
const [min, max] = DSMM_RATE_LIMIT_BOUNDS[key];
|
|
278
|
+
integer(value, `${field}.${key}`, min, max);
|
|
279
|
+
}
|
|
203
280
|
try {
|
|
204
281
|
normalizeRateLimitOverrides(value);
|
|
205
282
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { DsmmDelegationGroup, DsmmRoleMode } from "./roles.js";
|
|
2
|
+
export declare function readPromptAsset(path: string): string;
|
|
3
|
+
export interface SourceRoleContent {
|
|
4
|
+
id: string;
|
|
5
|
+
sourceId: string;
|
|
6
|
+
kind: "role" | "category";
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
order: number;
|
|
10
|
+
mode: DsmmRoleMode;
|
|
11
|
+
enabledByDefault: boolean;
|
|
12
|
+
access: "read-only" | "write";
|
|
13
|
+
delegation: DsmmDelegationGroup;
|
|
14
|
+
allowedChildren: string[];
|
|
15
|
+
childBuilderAllowedChildren?: string[];
|
|
16
|
+
promptArtifact: string | null;
|
|
17
|
+
terminalArtifact: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const SOURCE_ROLE_CATALOG: readonly SourceRoleContent[];
|
|
20
|
+
export declare function splitCategory(text: string): {
|
|
21
|
+
base: string;
|
|
22
|
+
calibrations: Map<string, string>;
|
|
23
|
+
};
|
|
24
|
+
export declare function buildRolePersona(role: SourceRoleContent): string;
|
|
25
|
+
//# sourceMappingURL=prompt-content.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
// This content-only dependency must not import settings or model routing:
|
|
5
|
+
// roles need it during ESM initialization, including prompts-first imports.
|
|
6
|
+
const sourceRoot = join(dirname(dirname(fileURLToPath(import.meta.url))), "prompts", "source");
|
|
7
|
+
const assets = new Map();
|
|
8
|
+
export function readPromptAsset(path) {
|
|
9
|
+
let text = assets.get(path);
|
|
10
|
+
if (text === undefined) {
|
|
11
|
+
text = readFileSync(join(sourceRoot, path), "utf8").trim();
|
|
12
|
+
assets.set(path, text);
|
|
13
|
+
}
|
|
14
|
+
return text;
|
|
15
|
+
}
|
|
16
|
+
export const SOURCE_ROLE_CATALOG = JSON.parse(readPromptAsset("catalog.json"));
|
|
17
|
+
export function splitCategory(text) {
|
|
18
|
+
const calibrations = new Map();
|
|
19
|
+
const base = text.replace(/\r?\n?<model-calibration model="([^"]+)">\r?\n([\s\S]*?)\r?\n<\/model-calibration>\r?\n?/gu, (_block, model, calibration) => { calibrations.set(model, calibration.trim()); return "\n"; }).trim();
|
|
20
|
+
return { base, calibrations };
|
|
21
|
+
}
|
|
22
|
+
export function buildRolePersona(role) {
|
|
23
|
+
const source = role.promptArtifact === null ? role.description : readPromptAsset(role.promptArtifact.replace("prompts/source/", ""));
|
|
24
|
+
const body = role.kind === "category" ? splitCategory(source).base : source;
|
|
25
|
+
return [`You are ${role.name} (role ID: ${role.id}).`, readPromptAsset("shared/locale.md"), body, readPromptAsset("shared/dsh-host-contract.md"), readPromptAsset(role.terminalArtifact.replace("prompts/source/", ""))].filter(Boolean).join("\n\n---\n\n");
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=prompt-content.js.map
|