@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
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { equal, editLayer, layerDiff, mergeLayer, record, validateEditorValue } from "./deployment-data.js";
|
|
2
|
+
class Refusal extends Error {
|
|
3
|
+
code;
|
|
4
|
+
constructor(code) {
|
|
5
|
+
super(code);
|
|
6
|
+
this.code = code;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
async function unwrap(promise) {
|
|
10
|
+
const result = await promise;
|
|
11
|
+
if (result.ok)
|
|
12
|
+
return result.value;
|
|
13
|
+
if (result.error.code === "dsmm-profiles/refused") {
|
|
14
|
+
const code = result.error.details.code;
|
|
15
|
+
throw new Refusal(["conflict", "validation", "not-owned"].includes(code) ? code : "unavailable");
|
|
16
|
+
}
|
|
17
|
+
throw new Refusal("transport");
|
|
18
|
+
}
|
|
19
|
+
/** Drafts and CAS baselines, never a second configuration authority. */
|
|
20
|
+
export class DeploymentController {
|
|
21
|
+
remote;
|
|
22
|
+
layer;
|
|
23
|
+
rowNamespace;
|
|
24
|
+
state = { snapshot: null, draft: {}, dirty: false, busy: false, issue: null, saved: false, session: null };
|
|
25
|
+
listeners = new Set();
|
|
26
|
+
generation = 0;
|
|
27
|
+
disposed = false;
|
|
28
|
+
baseline = {};
|
|
29
|
+
form = null;
|
|
30
|
+
invalid = new Set();
|
|
31
|
+
connection = null;
|
|
32
|
+
connectionBaseline;
|
|
33
|
+
stopConnection = null;
|
|
34
|
+
constructor(remote, layer, rowNamespace = null) {
|
|
35
|
+
this.remote = remote;
|
|
36
|
+
this.layer = layer;
|
|
37
|
+
this.rowNamespace = rowNamespace;
|
|
38
|
+
}
|
|
39
|
+
getSnapshot = () => this.state;
|
|
40
|
+
subscribe = (listener) => { this.listeners.add(listener); return () => this.listeners.delete(listener); };
|
|
41
|
+
dispose() { this.disposed = true; this.generation++; this.stopConnection?.(); this.listeners.clear(); this.form = null; }
|
|
42
|
+
bindConnection(source) {
|
|
43
|
+
this.stopConnection?.();
|
|
44
|
+
this.connection = source;
|
|
45
|
+
this.stopConnection = source.subscribe(() => {
|
|
46
|
+
if (this.disposed)
|
|
47
|
+
return;
|
|
48
|
+
this.generation++;
|
|
49
|
+
this.publish({ busy: false, issue: source.getSnapshot() === undefined ? "transport" : "conflict", saved: false });
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
forProfile(namespace) {
|
|
53
|
+
const controller = new DeploymentController(this.remote, "profile", namespace);
|
|
54
|
+
if (this.connection !== null)
|
|
55
|
+
controller.bindConnection(this.connection);
|
|
56
|
+
return controller;
|
|
57
|
+
}
|
|
58
|
+
currentConnection() { return this.connection === null || this.connection.getSnapshot() !== undefined && this.connection.getSnapshot() === this.connectionBaseline; }
|
|
59
|
+
setSession(session) { this.publish({ session }); }
|
|
60
|
+
publish(patch) {
|
|
61
|
+
if (this.disposed)
|
|
62
|
+
return;
|
|
63
|
+
this.state = { ...this.state, ...patch };
|
|
64
|
+
for (const listener of this.listeners)
|
|
65
|
+
listener();
|
|
66
|
+
}
|
|
67
|
+
attachForm(form) { this.form = form; }
|
|
68
|
+
setInvalid(path, invalid) {
|
|
69
|
+
if (this.invalid.has(path) === invalid)
|
|
70
|
+
return;
|
|
71
|
+
if (invalid)
|
|
72
|
+
this.invalid.add(path);
|
|
73
|
+
else
|
|
74
|
+
this.invalid.delete(path);
|
|
75
|
+
this.publish({ dirty: this.invalid.size > 0 || !equal(this.baseline, this.state.draft), saved: false });
|
|
76
|
+
}
|
|
77
|
+
canWriteProfile(snapshot = this.state.snapshot) {
|
|
78
|
+
const native = this.form?.state;
|
|
79
|
+
return this.currentConnection() && snapshot !== null && this.rowNamespace !== null && this.rowNamespace === snapshot.namespace
|
|
80
|
+
&& native?.status === "ready" && native.mode === "host" && native.writable
|
|
81
|
+
&& native.revision === snapshot.nativeFormRevision && snapshot.nativeForm !== null
|
|
82
|
+
&& equal(native.base ?? null, snapshot.nativeForm.base) && equal(native.user ?? null, snapshot.nativeForm.user);
|
|
83
|
+
}
|
|
84
|
+
edit(path, value) {
|
|
85
|
+
if (this.state.busy || this.disposed || this.state.snapshot === null || !this.currentConnection() || this.state.issue === "not-owned" || this.layer === "profile" && !this.canWriteProfile())
|
|
86
|
+
return;
|
|
87
|
+
const draft = editLayer(this.state.draft, path, value);
|
|
88
|
+
this.publish({ draft, dirty: this.invalid.size > 0 || !equal(this.baseline, draft), issue: null, saved: false });
|
|
89
|
+
}
|
|
90
|
+
async refresh(discard = false) {
|
|
91
|
+
if (this.disposed || this.state.busy)
|
|
92
|
+
return;
|
|
93
|
+
const generation = ++this.generation;
|
|
94
|
+
const connection = this.connection?.getSnapshot();
|
|
95
|
+
this.publish({ busy: true, saved: false });
|
|
96
|
+
try {
|
|
97
|
+
if (this.connection !== null && connection === undefined)
|
|
98
|
+
throw new Refusal("transport");
|
|
99
|
+
const snapshot = await unwrap(this.remote.describeSettings());
|
|
100
|
+
if (this.disposed || generation !== this.generation)
|
|
101
|
+
return;
|
|
102
|
+
const old = this.state.snapshot;
|
|
103
|
+
if (old !== null && (old.entryId !== snapshot.entryId || old.hostProfileKey !== snapshot.hostProfileKey))
|
|
104
|
+
throw new Refusal("unavailable");
|
|
105
|
+
if (this.state.dirty && !discard) {
|
|
106
|
+
const stale = !this.currentConnection() || (this.layer === "global" ? old?.globalRevision !== snapshot.globalRevision : old?.nativeRevision !== snapshot.nativeRevision || old?.globalRevision !== snapshot.globalRevision);
|
|
107
|
+
this.publish({ issue: stale ? "conflict" : null });
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
this.invalid.clear();
|
|
111
|
+
this.connectionBaseline = connection;
|
|
112
|
+
this.baseline = this.layer === "global" ? snapshot.global : record(snapshot.nativeForm?.user) ? snapshot.nativeForm.user : {};
|
|
113
|
+
this.publish({ snapshot, draft: structuredClone(this.baseline), dirty: false, issue: null });
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
if (!this.disposed && generation === this.generation)
|
|
118
|
+
this.publish({ issue: error instanceof Refusal ? error.code : "transport" });
|
|
119
|
+
}
|
|
120
|
+
finally {
|
|
121
|
+
if (!this.disposed && generation === this.generation)
|
|
122
|
+
this.publish({ busy: false });
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
async save() {
|
|
126
|
+
const { snapshot, draft, dirty, busy, issue } = this.state;
|
|
127
|
+
if (this.disposed || snapshot === null || !dirty || busy || issue !== null || !this.currentConnection() || this.invalid.size > 0 || this.layer === "profile" && !this.canWriteProfile())
|
|
128
|
+
return;
|
|
129
|
+
const schema = this.layer === "global" ? snapshot.schema : { ...snapshot.schema, fields: Object.fromEntries(Object.entries(snapshot.schema.fields ?? {}).filter(([key]) => key !== "modules")) };
|
|
130
|
+
const editable = { ...draft };
|
|
131
|
+
if (this.layer === "profile") {
|
|
132
|
+
if (!equal(editable.sessionPersistence, this.baseline.sessionPersistence)) {
|
|
133
|
+
this.publish({ issue: "validation" });
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
delete editable.sessionPersistence;
|
|
137
|
+
}
|
|
138
|
+
const lower = this.layer === "global" ? snapshot.defaults : mergeLayer(mergeLayer(snapshot.defaults, snapshot.global), snapshot.nativeForm?.base ?? {});
|
|
139
|
+
const candidate = mergeLayer(lower, editable);
|
|
140
|
+
const merged = (this.layer === "global" ? mergeLayer(candidate, snapshot.profile) : candidate);
|
|
141
|
+
delete merged.sessionPersistence;
|
|
142
|
+
if (!validateEditorValue(editable, schema, true) || !validateEditorValue(merged, snapshot.schema)) {
|
|
143
|
+
this.publish({ issue: "validation" });
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const edits = layerDiff(this.baseline, draft);
|
|
147
|
+
if (edits.length > 128) {
|
|
148
|
+
this.publish({ issue: "validation" });
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const generation = ++this.generation;
|
|
152
|
+
this.publish({ busy: true, saved: false });
|
|
153
|
+
try {
|
|
154
|
+
const current = await unwrap(this.remote.describeSettings());
|
|
155
|
+
if (this.disposed || generation !== this.generation)
|
|
156
|
+
return;
|
|
157
|
+
if (current.entryId !== snapshot.entryId || current.hostProfileKey !== snapshot.hostProfileKey || current.globalRevision !== snapshot.globalRevision)
|
|
158
|
+
throw new Refusal("conflict");
|
|
159
|
+
if (this.layer === "global")
|
|
160
|
+
await unwrap(this.remote.save({ expectedRevision: snapshot.globalRevision, edits }));
|
|
161
|
+
else {
|
|
162
|
+
if (current.nativeRevision !== snapshot.nativeRevision || !this.canWriteProfile(current))
|
|
163
|
+
throw new Refusal("conflict");
|
|
164
|
+
const form = this.form;
|
|
165
|
+
if (!await form.mutate(edits, snapshot.nativeFormRevision))
|
|
166
|
+
throw new Refusal("conflict");
|
|
167
|
+
}
|
|
168
|
+
if (this.disposed || generation !== this.generation)
|
|
169
|
+
return;
|
|
170
|
+
this.baseline = structuredClone(draft);
|
|
171
|
+
this.publish({ dirty: false, saved: true, issue: null });
|
|
172
|
+
// A successful durable save remains successful even if the follow-up read fails.
|
|
173
|
+
try {
|
|
174
|
+
const next = await unwrap(this.remote.describeSettings());
|
|
175
|
+
if (!this.disposed && generation === this.generation)
|
|
176
|
+
this.publish({ snapshot: next });
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
if (!this.disposed && generation === this.generation)
|
|
180
|
+
this.publish({ issue: "unavailable" });
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
catch (error) {
|
|
184
|
+
if (!this.disposed && generation === this.generation)
|
|
185
|
+
this.publish({ issue: error instanceof Refusal ? error.code : "transport" });
|
|
186
|
+
}
|
|
187
|
+
finally {
|
|
188
|
+
if (!this.disposed && generation === this.generation)
|
|
189
|
+
this.publish({ busy: false });
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=deployment-controller.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DeploymentAdmissionView, DeploymentEditorSnapshot, DeploymentSchemaNode } from "../profile-types.js";
|
|
2
|
+
import type { DeploymentPathEdit } from "../deployment-config.js";
|
|
3
|
+
export declare function record(value: unknown): value is Record<string, unknown>;
|
|
4
|
+
export declare function at(value: unknown, path: readonly string[]): unknown;
|
|
5
|
+
export declare function equal(a: unknown, b: unknown): boolean;
|
|
6
|
+
export declare function mergeLayer(base: unknown, override: unknown): unknown;
|
|
7
|
+
/** Strict JSON with duplicate-key rejection; never silently last-key-wins. */
|
|
8
|
+
export declare function parseAdvanced(text: string): unknown;
|
|
9
|
+
export declare function editLayer(base: Record<string, unknown>, path: readonly string[], value: unknown): Record<string, unknown>;
|
|
10
|
+
/** Preserve untouched sparse fields; arrays are one schema field, not indexed RPC paths. */
|
|
11
|
+
export declare function layerDiff(base: Record<string, unknown>, draft: Record<string, unknown>, prefix?: string[]): DeploymentPathEdit[];
|
|
12
|
+
export declare function validateEditorValue(value: unknown, schema: DeploymentSchemaNode, sparse?: boolean): boolean;
|
|
13
|
+
export declare function enumValues(schema: DeploymentSchemaNode): Array<string | number | boolean> | null;
|
|
14
|
+
export declare function visibleDeploymentPath(path: readonly string[]): boolean;
|
|
15
|
+
/** Only visible Host-projected inspector layers, never raw sparse editor input. */
|
|
16
|
+
export declare function inspectorPaths(snapshot: DeploymentEditorSnapshot, admitted: DeploymentAdmissionView | null): string[];
|
|
17
|
+
//# sourceMappingURL=deployment-data.d.ts.map
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { parseTree } from "jsonc-parser";
|
|
2
|
+
import { copyRouteJson, normalizeModelRouteJson } from "../route-json.js";
|
|
3
|
+
export function record(value) {
|
|
4
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
5
|
+
}
|
|
6
|
+
export function at(value, path) {
|
|
7
|
+
return path.reduce((node, key) => record(node) && Object.hasOwn(node, key) ? node[key] : undefined, value);
|
|
8
|
+
}
|
|
9
|
+
export function equal(a, b) {
|
|
10
|
+
if (record(a) && record(b))
|
|
11
|
+
return Object.keys(a).length === Object.keys(b).length && Object.keys(a).every(key => Object.hasOwn(b, key) && equal(a[key], b[key]));
|
|
12
|
+
if (Array.isArray(a) && Array.isArray(b))
|
|
13
|
+
return a.length === b.length && a.every((value, i) => equal(value, b[i]));
|
|
14
|
+
return a === b;
|
|
15
|
+
}
|
|
16
|
+
export function mergeLayer(base, override) {
|
|
17
|
+
if (!record(base) || !record(override))
|
|
18
|
+
return override;
|
|
19
|
+
return Object.fromEntries([...new Set([...Object.keys(base), ...Object.keys(override)])].map(key => [key,
|
|
20
|
+
Object.hasOwn(override, key) ? mergeLayer(base[key], override[key]) : base[key]]));
|
|
21
|
+
}
|
|
22
|
+
/** Strict JSON with duplicate-key rejection; never silently last-key-wins. */
|
|
23
|
+
export function parseAdvanced(text) {
|
|
24
|
+
if (text.trim() === "")
|
|
25
|
+
return undefined;
|
|
26
|
+
const errors = [];
|
|
27
|
+
const root = parseTree(text, errors, { disallowComments: true, allowTrailingComma: false });
|
|
28
|
+
const unique = (node) => {
|
|
29
|
+
if (node.type === "object") {
|
|
30
|
+
const keys = node.children.map(child => child.children[0].value);
|
|
31
|
+
if (new Set(keys).size !== keys.length)
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
return (node.children ?? []).every(unique);
|
|
35
|
+
};
|
|
36
|
+
if (root === undefined || errors.length || !unique(root))
|
|
37
|
+
throw new Error("Invalid JSON");
|
|
38
|
+
return JSON.parse(text);
|
|
39
|
+
}
|
|
40
|
+
export function editLayer(base, path, value) {
|
|
41
|
+
const next = structuredClone(base);
|
|
42
|
+
let node = next;
|
|
43
|
+
for (const key of path.slice(0, -1)) {
|
|
44
|
+
if (!record(node[key]))
|
|
45
|
+
node[key] = {};
|
|
46
|
+
node = node[key];
|
|
47
|
+
}
|
|
48
|
+
const key = path.at(-1);
|
|
49
|
+
if (value === undefined)
|
|
50
|
+
delete node[key];
|
|
51
|
+
else
|
|
52
|
+
node[key] = structuredClone(value);
|
|
53
|
+
return next;
|
|
54
|
+
}
|
|
55
|
+
/** Preserve untouched sparse fields; arrays are one schema field, not indexed RPC paths. */
|
|
56
|
+
export function layerDiff(base, draft, prefix = []) {
|
|
57
|
+
return [...new Set([...Object.keys(base), ...Object.keys(draft)])].flatMap(key => {
|
|
58
|
+
const path = [...prefix, key], before = base[key], after = draft[key];
|
|
59
|
+
if (equal(before, after))
|
|
60
|
+
return [];
|
|
61
|
+
if (!Object.hasOwn(draft, key))
|
|
62
|
+
return [{ op: "unset", path }];
|
|
63
|
+
if (record(before) && record(after))
|
|
64
|
+
return layerDiff(before, after, path);
|
|
65
|
+
return [{ op: "set", path, value: after }];
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
export function validateEditorValue(value, schema, sparse = false) {
|
|
69
|
+
if (schema.type === "transform")
|
|
70
|
+
return schema.inner !== undefined && validateEditorValue(value, schema.inner, sparse);
|
|
71
|
+
if (schema.type === "any") {
|
|
72
|
+
try {
|
|
73
|
+
copyRouteJson(value);
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (schema.type === "union")
|
|
81
|
+
return schema.alternatives?.some(node => validateEditorValue(value, node, sparse)) === true;
|
|
82
|
+
if (schema.type === "const")
|
|
83
|
+
return value === schema.value;
|
|
84
|
+
if (schema.type === "object" && schema.additionalProperties === "json") {
|
|
85
|
+
try {
|
|
86
|
+
if (schema.fields?.provider?.type === "string" && schema.fields.model?.type === "string") {
|
|
87
|
+
normalizeModelRouteJson(value, sparse, true);
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
copyRouteJson(value);
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (schema.type === "object" || schema.type === "dict")
|
|
97
|
+
return record(value) && (sparse || schema.type !== "object" || Object.entries(schema.fields ?? {}).every(([key, node]) => !node.required || Object.hasOwn(value, key))) && Object.entries(value).every(([key, child]) => {
|
|
98
|
+
if (["__proto__", "prototype", "constructor"].includes(key))
|
|
99
|
+
return false;
|
|
100
|
+
if (schema.keys !== undefined && !schema.keys.includes(key))
|
|
101
|
+
return false;
|
|
102
|
+
const node = schema.type === "dict" ? schema.inner : schema.fields !== undefined && Object.hasOwn(schema.fields, key) ? schema.fields[key] : undefined;
|
|
103
|
+
return node !== undefined ? validateEditorValue(child, node, sparse) : schema.type === "object" && schema.additionalProperties === "json";
|
|
104
|
+
});
|
|
105
|
+
if (schema.type === "array")
|
|
106
|
+
return Array.isArray(value) && (schema.max === undefined || value.length <= schema.max) && schema.inner !== undefined && value.every(child => validateEditorValue(child, schema.inner));
|
|
107
|
+
if (schema.type === "string" && schema.nonempty)
|
|
108
|
+
return typeof value === "string" && value.trim() !== "";
|
|
109
|
+
if (["string", "boolean", "number"].includes(schema.type))
|
|
110
|
+
return typeof value === schema.type && (typeof value !== "number" || Number.isFinite(value) && (schema.min === undefined || value >= schema.min) && (schema.max === undefined || value <= schema.max) && (schema.step === undefined || Number.isInteger(value / schema.step)));
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
export function enumValues(schema) {
|
|
114
|
+
return schema.type === "union" && schema.alternatives?.every(node => node.type === "const")
|
|
115
|
+
? schema.alternatives.map(node => node.value) : null;
|
|
116
|
+
}
|
|
117
|
+
export function visibleDeploymentPath(path) {
|
|
118
|
+
return path[0] !== "lsp" && (path[0] !== "permissionControl" || path.length === 1 || path.length === 2 && path[1] === "enabled");
|
|
119
|
+
}
|
|
120
|
+
/** Only visible Host-projected inspector layers, never raw sparse editor input. */
|
|
121
|
+
export function inspectorPaths(snapshot, admitted) {
|
|
122
|
+
const paths = new Set([...Object.keys(snapshot.sources), ...Object.keys(snapshot.startupSources ?? {}), ...Object.keys(snapshot.nextRoot?.sources ?? {}),
|
|
123
|
+
...Object.keys(snapshot.nextRoot?.captures ?? {}), ...Object.keys(admitted?.sources ?? {}), ...Object.keys(admitted?.captures ?? {})]);
|
|
124
|
+
const visit = (value, path) => {
|
|
125
|
+
if (!visibleDeploymentPath(path))
|
|
126
|
+
return;
|
|
127
|
+
if (record(value) && Object.keys(value).length)
|
|
128
|
+
for (const [key, child] of Object.entries(value))
|
|
129
|
+
visit(child, [...path, key]);
|
|
130
|
+
else if (path.length)
|
|
131
|
+
paths.add(path.join("."));
|
|
132
|
+
};
|
|
133
|
+
for (const value of [snapshot.desired, snapshot.startup, snapshot.nextRoot?.settings, admitted?.settings])
|
|
134
|
+
if (value !== undefined)
|
|
135
|
+
visit(value, []);
|
|
136
|
+
return [...paths].filter(path => visibleDeploymentPath(path.split("."))).sort();
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=deployment-data.js.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare const DEPLOYMENT_NS = "plugins.dsmm";
|
|
2
|
+
export declare const deploymentEn: {
|
|
3
|
+
title: string;
|
|
4
|
+
summary: string;
|
|
5
|
+
description: string;
|
|
6
|
+
global: string;
|
|
7
|
+
globalHint: string;
|
|
8
|
+
profile: string;
|
|
9
|
+
profileHint: string;
|
|
10
|
+
profileUnavailable: string;
|
|
11
|
+
unavailableForm: string;
|
|
12
|
+
ceiling: string;
|
|
13
|
+
hostUnknown: string;
|
|
14
|
+
boundaries: string;
|
|
15
|
+
core: string;
|
|
16
|
+
coreHint: string;
|
|
17
|
+
modelParametersHint: string;
|
|
18
|
+
permissionControlHint: string;
|
|
19
|
+
saveGlobal: string;
|
|
20
|
+
saveProfile: string;
|
|
21
|
+
saving: string;
|
|
22
|
+
refresh: string;
|
|
23
|
+
discard: string;
|
|
24
|
+
dirty: string;
|
|
25
|
+
saved: string;
|
|
26
|
+
inherit: string;
|
|
27
|
+
explicit: string;
|
|
28
|
+
defaultPin: string;
|
|
29
|
+
hostPin: string;
|
|
30
|
+
globalSource: string;
|
|
31
|
+
profileSource: string;
|
|
32
|
+
defaultsSource: string;
|
|
33
|
+
namedSource: string;
|
|
34
|
+
startupSource: string;
|
|
35
|
+
deploymentCapture: string;
|
|
36
|
+
desired: string;
|
|
37
|
+
startup: string;
|
|
38
|
+
next: string;
|
|
39
|
+
session: string;
|
|
40
|
+
noSession: string;
|
|
41
|
+
sessionUnavailable: string;
|
|
42
|
+
absent: string;
|
|
43
|
+
mixedSource: string;
|
|
44
|
+
inspectorStale: string;
|
|
45
|
+
pending: string;
|
|
46
|
+
unknown: string;
|
|
47
|
+
on: string;
|
|
48
|
+
off: string;
|
|
49
|
+
state: string;
|
|
50
|
+
module: string;
|
|
51
|
+
advanced: string;
|
|
52
|
+
advancedHint: string;
|
|
53
|
+
invalid: string;
|
|
54
|
+
conflict: string;
|
|
55
|
+
unavailable: string;
|
|
56
|
+
"not-owned": string;
|
|
57
|
+
validation: string;
|
|
58
|
+
transport: string;
|
|
59
|
+
namedIndependent: string;
|
|
60
|
+
};
|
|
61
|
+
export type DeploymentLocaleKey = keyof typeof deploymentEn;
|
|
62
|
+
export declare const deploymentZh: Record<DeploymentLocaleKey, string>;
|
|
63
|
+
declare module "@deepseek-ai/dsh-client-ui-slots" {
|
|
64
|
+
interface LocaleNamespaceMap {
|
|
65
|
+
"plugins.dsmm": DeploymentLocaleKey;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/** Stable public field names stay visible alongside localized context. */
|
|
69
|
+
export declare const deploymentFieldLabels: Record<string, [string, string]>;
|
|
70
|
+
//# sourceMappingURL=deployment-locales.d.ts.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export const DEPLOYMENT_NS = "plugins.dsmm";
|
|
2
|
+
export const deploymentEn = {
|
|
3
|
+
title: "DSMM", summary: "Global config and profile overrides",
|
|
4
|
+
description: "Layers save independently; native models and running sessions stay unchanged.",
|
|
5
|
+
global: "DSMM Global config", globalHint: "Shared by this Home’s DSH profiles. Unset fields use built-in defaults.",
|
|
6
|
+
profile: "Current DSH profile overrides", profileHint: "This entry only. Unset fields inherit Global config.",
|
|
7
|
+
profileUnavailable: "Unavailable",
|
|
8
|
+
unavailableForm: "No verified writable form. Open this entry’s bundle or row config to edit profile overrides.",
|
|
9
|
+
ceiling: "Deepwork master is Global-only; profiles and session modes cannot lift its captured ceiling.",
|
|
10
|
+
hostUnknown: "Host bundle status: unknown (separate switch).",
|
|
11
|
+
boundaries: "New roots capture saved settings within startup capabilities. Save does not restart the Host; startup-only changes require a separate Host restart, which may cancel sessions.",
|
|
12
|
+
core: "Core", coreHint: "Core-owned desired settings. Model-parameter passthrough is ordinary config, not a subplugin. The permission-control enabled flag is startup-pinned. Save does not change current-session admission; inspect desired, startup and admitted values below. Unavailable admission stays unknown.",
|
|
13
|
+
modelParametersHint: "Default On. Off retains saved custom/opaque model parameters without forwarding them, and DSMM reasoningEffort / reasoning_effort aliases use native defaults. Standard SDK parameters and explicit native root choices remain intact. Raw JSON and exact effort values remain editable; saving desired settings does not verify provider transport readiness.",
|
|
14
|
+
permissionControlHint: "Permission-control module desired switch (default On), captured at startup. Global/native Save does not remove current protections or prove runtime coverage. Rules and exact Root approvals use the separate Permission control page; a restart remains independent.",
|
|
15
|
+
saveGlobal: "Save Global config", saveProfile: "Save profile overrides", saving: "Saving…", refresh: "Refresh", discard: "Discard and reload", dirty: "Unsaved changes", saved: "Saved",
|
|
16
|
+
inherit: "Inherit", explicit: "Override", defaultPin: "Built-in default pinned", hostPin: "Host pin remains when cleared",
|
|
17
|
+
globalSource: "Global", profileSource: "DSH profile", defaultsSource: "Built-in default", namedSource: "Named/session", startupSource: "Startup capture", deploymentCapture: "Deployment capture",
|
|
18
|
+
desired: "Merged desired", startup: "Startup mounted / captured", next: "Next root", session: "Current-session admitted", noSession: "No active session: admission is unknown.",
|
|
19
|
+
sessionUnavailable: "Session admission unavailable. Reconnect and refresh the session separately.",
|
|
20
|
+
absent: "Absent", mixedSource: "Mixed sources", inspectorStale: "Saved state, not draft",
|
|
21
|
+
pending: "Pending independent restart", unknown: "Unknown", on: "On", off: "Off", state: "Field sources and effective state", module: "Deepwork module",
|
|
22
|
+
advanced: "Advanced JSON", advancedHint: "Schema keys only; omit to inherit. Arrays replace. No credentials or scripts; use existing providers.",
|
|
23
|
+
invalid: "Invalid field. Check type, bounds and keys; draft retained.",
|
|
24
|
+
conflict: "Revision conflict; draft retained. Review changes, then discard and reload. Refresh does not merge.",
|
|
25
|
+
unavailable: "Scope unavailable; draft retained. Reconnect and refresh.",
|
|
26
|
+
"not-owned": "Read-only: requires an authenticated local Host operator.",
|
|
27
|
+
validation: "Host rejected configuration; draft retained. Check fields and merged constraints.",
|
|
28
|
+
transport: "Disconnected; draft retained. Reconnect and refresh.",
|
|
29
|
+
namedIndependent: "Deepwork Profiles is a separate named JSONC runtime-resource editor in Settings. Saving here does not apply a named profile or select its model.",
|
|
30
|
+
};
|
|
31
|
+
export const deploymentZh = {
|
|
32
|
+
title: "DSMM", summary: "全局配置与当前配置覆盖",
|
|
33
|
+
description: "两层独立保存,不改原生模型或运行中会话。",
|
|
34
|
+
global: "DSMM 全局配置", globalHint: "同一 Home 的 DSH 配置共用;未设置字段使用内建默认值。",
|
|
35
|
+
profile: "当前 DSH 配置覆盖", profileHint: "仅此实例;未设置字段继承全局配置。",
|
|
36
|
+
profileUnavailable: "不可用",
|
|
37
|
+
unavailableForm: "没有已核验的可写表单。请打开此实例的 bundle 或条目配置以编辑覆盖。",
|
|
38
|
+
ceiling: "Deepwork 总开关仅全局可改;配置和会话模式不能突破已捕获上限。",
|
|
39
|
+
hostUnknown: "宿主整包状态:未知(独立开关)。",
|
|
40
|
+
boundaries: "新根会话在启动能力内采用已保存设置。保存不重启宿主;仅启动时生效的更改需另行重启宿主,可能取消会话。",
|
|
41
|
+
core: "Core 核心配置", coreHint: "Core 所有的 desired 意图配置。模型参数透传为普通配置,非子插件;权限控制 enabled 仅启动时捕获。保存不改变当前会话准入;下方可检查意图、启动与准入值,不可用的准入仍为未知。",
|
|
42
|
+
modelParametersHint: "默认开启。关闭后仍保存 custom/opaque 模型参数但不发送;DSMM reasoningEffort/reasoning_effort 两种别名采用原生默认值。标准 SDK 参数与根会话原生显式选择保留。仍可编辑原始 JSON 和精确 effort 值;保存意图不代表提供商传输已就绪。",
|
|
43
|
+
permissionControlHint: "权限控制子模块 desired 开关(默认开启),仅启动时捕获。Global/native 保存不移除当前保护,也不证明运行时覆盖。规则及精确 Root 批准在独立“权限控制”页处理;重启仍为独立操作。",
|
|
44
|
+
saveGlobal: "保存全局配置", saveProfile: "保存当前配置覆盖", saving: "正在保存…", refresh: "刷新", discard: "丢弃并重载", dirty: "未保存", saved: "已保存",
|
|
45
|
+
inherit: "继承", explicit: "覆盖", defaultPin: "固定为内建默认值", hostPin: "清除后仍有宿主固定值",
|
|
46
|
+
globalSource: "全局", profileSource: "DSH 配置", defaultsSource: "内建默认", namedSource: "具名/会话", startupSource: "启动捕获", deploymentCapture: "部署捕获",
|
|
47
|
+
desired: "合并后意图", startup: "启动挂载/捕获", next: "下一个根会话", session: "当前会话准入", noSession: "没有活动会话:准入状态未知。",
|
|
48
|
+
sessionUnavailable: "会话准入暂不可用;恢复连接后另行刷新会话。",
|
|
49
|
+
absent: "不存在", mixedSource: "混合来源", inspectorStale: "已保存状态,非草稿",
|
|
50
|
+
pending: "等待独立重启", unknown: "未知", on: "开启", off: "关闭", state: "字段来源与实际生效状态", module: "Deepwork 子模块",
|
|
51
|
+
advanced: "高级 JSON", advancedHint: "仅 schema 声明的键;省略为继承,数组整项替换。不填凭据或脚本,仅用已有提供商。",
|
|
52
|
+
invalid: "字段无效,请核对类型、范围与键;草稿保留。",
|
|
53
|
+
conflict: "版本冲突,草稿保留。核对后丢弃并重载;刷新不自动合并。",
|
|
54
|
+
unavailable: "作用域不可用,草稿保留;重连后刷新。",
|
|
55
|
+
"not-owned": "只读:需要本地宿主已认证 operator 权限。",
|
|
56
|
+
validation: "宿主拒绝配置,草稿保留;核对字段及合并约束。",
|
|
57
|
+
transport: "连接中断,草稿保留;重连后刷新。",
|
|
58
|
+
namedIndependent: "设置中的 Deepwork Profiles 是独立的具名 JSONC 运行时资源编辑器。在此保存不会应用具名配置或选择其模型。",
|
|
59
|
+
};
|
|
60
|
+
/** Stable public field names stay visible alongside localized context. */
|
|
61
|
+
export const deploymentFieldLabels = {
|
|
62
|
+
modelParameters: ["Model parameters", "模型参数"], passthrough: ["Model parameter passthrough", "模型参数透传"],
|
|
63
|
+
permissionControl: ["Permission-control module", "权限控制子模块"],
|
|
64
|
+
modules: ["Modules", "子模块"], skills: ["Skills", "技能"], roles: ["Agent roles", "Agent 角色"],
|
|
65
|
+
deepwork: ["Deepwork", "Deepwork"], deepseekV4ProCalibration: ["DeepSeek V4 Pro calibration", "DeepSeek V4 Pro 校准"], deepseekV4ProDefaultReasoningEffort: ["DeepSeek V4 Pro default reasoning", "DeepSeek V4 Pro 默认推理强度"], deepseekV4ProMaxReasoningPresets: ["DeepSeek V4 Pro max presets", "DeepSeek V4 Pro 最高强度预设"], deepseekFlashCalibration: ["DeepSeek Flash calibration", "DeepSeek Flash 校准"], deepseekFlashDefaultReasoningEffort: ["DeepSeek Flash default reasoning", "DeepSeek Flash 默认推理强度"], deepseekFlashMaxReasoningPresets: ["DeepSeek Flash max presets", "DeepSeek Flash 最高强度预设"],
|
|
66
|
+
roleRouting: ["Existing-provider routes", "已有提供商路由"], runtimePolicy: ["Routing and retry policy", "路由与重试策略"],
|
|
67
|
+
workflow: ["Workflow gates", "工作流关卡"], guards: ["Safety guards", "安全保护"], runtimeRecovery: ["Runtime recovery", "运行时恢复"],
|
|
68
|
+
subagents: ["Subagents", "子 Agent"], lsp: ["LSP", "LSP"], presets: ["Preset materialization", "预设物化"],
|
|
69
|
+
modeName: ["Mode name", "模式名称"], section: ["Prompt section", "提示词章节"], promptOrder: ["Prompt order", "提示词顺序"], defaultActive: ["Default Deepwork mode", "默认 Deepwork 模式"],
|
|
70
|
+
enabled: ["Enabled", "启用"], materialize: ["Materialize presets", "物化预设"], scope: ["Guard scope", "保护范围"],
|
|
71
|
+
plannerRootEnabled: ["Planner main-chat preset (restart required)", "Planner 主聊天预设(需重启)"],
|
|
72
|
+
shellCommandSafety: ["Shell command safety", "Shell 命令安全"], gitWriteGuard: ["Git write policy", "Git 写入策略"],
|
|
73
|
+
toolOutputTruncation: ["Tool output truncation", "工具输出截断"], maxInlineBytes: ["Inline byte limit", "内联字节上限"],
|
|
74
|
+
planFormatValidation: ["Plan format validation", "计划格式校验"], questionLabelHelper: ["Question labels", "提问标签"], maxLabelChars: ["Label character limit", "标签字符上限"], todoDisciplineHelper: ["Todo discipline", "待办纪律"],
|
|
75
|
+
enableRunInBackground: ["Allow background runs", "允许后台执行"], backgroundMode: ["Background mode", "后台模式"], maxDepth: ["Maximum depth", "最大深度"],
|
|
76
|
+
policy: ["Policy", "策略"], strictGates: ["Strict gates", "严格关卡"], reviewCap: ["Review limit", "审查上限"], finalReviewPolicy: ["Final review policy", "最终审查策略"],
|
|
77
|
+
retryOnStatusCodes: ["Retry HTTP statuses", "重试 HTTP 状态码"], retryOnCodes: ["Retry error codes", "重试错误码"], fallbackRoutes: ["Ordered fallback routes", "有序备用路由"], maxFallbackAttempts: ["Fallback attempt limit", "备用尝试上限"], idleContinuation: ["Idle continuation", "空闲继续"], maxContinuations: ["Continuation limit", "继续次数上限"], prompt: ["Continuation prompt", "继续提示词"],
|
|
78
|
+
root: ["Materialization directory", "物化目录"], strategy: ["Routing strategy", "路由策略"], rateLimit: ["Bounded rate-limit retry", "有界限流重试"], maxRetries: ["Retry limit", "重试上限"], initialDelayMs: ["Initial delay (ms)", "初始延迟(毫秒)"], maxDelayMs: ["Delay limit (ms)", "延迟上限(毫秒)"], maxTotalDelayMs: ["Total wait budget (ms)", "累计等待上限(毫秒)"], switchAfterRateLimits: ["Rate limits before switching", "切换前限流次数"], maxSwitches: ["Switch limit", "切换上限"],
|
|
79
|
+
serverName: ["LSP server name", "LSP 服务名称"], command: ["LSP command", "LSP 命令"], args: ["LSP arguments", "LSP 参数"], cwd: ["LSP working directory", "LSP 工作目录"], env: ["LSP environment", "LSP 环境变量"], toolCallTimeoutMs: ["LSP tool timeout (ms)", "LSP 工具超时(毫秒)"], failOnStartupError: ["Fail on LSP startup error", "LSP 启动错误时拒绝加载"],
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=deployment-locales.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PropsLocale } from "@deepseek-ai/dsh-client-ui-slots";
|
|
2
|
+
import type { ProfileDiagnostic, ProfileErrorInfo } from "../profile-types.js";
|
|
3
|
+
import type { ProfilesIssue } from "./controller.js";
|
|
4
|
+
/** Wire grammar is checked again at presentation; raw exception text is never retained. */
|
|
5
|
+
export declare function safeIssue(info: unknown): ProfilesIssue;
|
|
6
|
+
export declare function profileWarnings(warnings: ProfileDiagnostic[] | undefined): ProfileDiagnostic[];
|
|
7
|
+
export declare function draftWarnings(content: string): ProfileDiagnostic[];
|
|
8
|
+
export declare function ProfileWarnings({ warnings, t }: PropsLocale<"settings.dsmm-profiles"> & {
|
|
9
|
+
warnings?: ProfileDiagnostic[];
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
export declare function IssueDetails({ issue, t }: PropsLocale<"settings.dsmm-profiles"> & {
|
|
12
|
+
issue: ProfilesIssue | ProfileErrorInfo;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=diagnostics.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { findNodeAtLocation } from "jsonc-parser";
|
|
3
|
+
import { diagnostic, fieldLocation, inspectJsonDocument } from "../profile-diagnostics.js";
|
|
4
|
+
import { parseProfileDiagnostic, parseProfileErrorInfo } from "../profile-remote.js";
|
|
5
|
+
/** Wire grammar is checked again at presentation; raw exception text is never retained. */
|
|
6
|
+
export function safeIssue(info) {
|
|
7
|
+
try {
|
|
8
|
+
const parsed = parseProfileErrorInfo(info);
|
|
9
|
+
return { kind: "domain", code: parsed.code, ...(parsed.field === undefined ? {} : { field: parsed.field }),
|
|
10
|
+
...(parsed.reason === undefined ? {} : { reason: parsed.reason }), ...(parsed.location === undefined ? {} : { location: parsed.location }) };
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return { kind: "assembly", code: "unavailable" };
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export function profileWarnings(warnings) {
|
|
17
|
+
return (warnings ?? []).flatMap(value => {
|
|
18
|
+
try {
|
|
19
|
+
const warning = parseProfileDiagnostic(value);
|
|
20
|
+
return warning.severity === "warning" && warning.code === "blank-label" && warning.field === "label" ? [warning] : [];
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export function draftWarnings(content) {
|
|
28
|
+
const { tree, diagnostics } = inspectJsonDocument(content);
|
|
29
|
+
if (tree?.type !== "object" || diagnostics.length !== 0)
|
|
30
|
+
return [];
|
|
31
|
+
const node = findNodeAtLocation(tree, ["label"]);
|
|
32
|
+
if (node?.type !== "string")
|
|
33
|
+
return [];
|
|
34
|
+
const label = node.value;
|
|
35
|
+
if (label.length > 120 || /[\u0000-\u001f\u007f]/u.test(label) || label.trim() !== ""
|
|
36
|
+
|| new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(new TextEncoder().encode(label)) !== label)
|
|
37
|
+
return [];
|
|
38
|
+
return [diagnostic("blank-label", "label", fieldLocation(content, tree, "label"))];
|
|
39
|
+
}
|
|
40
|
+
export function ProfileWarnings({ warnings, t }) {
|
|
41
|
+
return _jsx(_Fragment, { children: profileWarnings(warnings).map(warning => _jsxs("div", { className: "dsmm-warning", "data-dsmm-warning": true, children: [_jsx("p", { children: t("warningMarker", { code: warning.code, field: warning.field }) }), _jsxs("details", { children: [_jsx("summary", { children: t("details") }), _jsx("p", { children: t("blankLabelWarning") })] })] }, `${warning.code}:${warning.field}`)) });
|
|
42
|
+
}
|
|
43
|
+
export function IssueDetails({ issue, t }) {
|
|
44
|
+
const safe = safeIssue({ code: issue.code, message: "", ...(issue.field === undefined ? {} : { field: issue.field }),
|
|
45
|
+
...(issue.reason === undefined ? {} : { reason: issue.reason }), ...(issue.location === undefined ? {} : { location: issue.location }) });
|
|
46
|
+
return _jsxs("div", { className: "dsmm-diagnostic", children: [_jsx("p", { children: t("blockingMarker", { code: safe.reason ?? safe.code, field: safe.field ?? "document" }) }), safe.location !== undefined && _jsx("p", { children: t("diagnosticLocation", { line: safe.location.line, column: safe.location.column }) }), safe.reason !== undefined && _jsxs("details", { children: [_jsx("summary", { children: t("details") }), _jsx("p", { children: t(DIAGNOSTIC_LABELS[safe.reason]) })] })] });
|
|
47
|
+
}
|
|
48
|
+
const DIAGNOSTIC_LABELS = {
|
|
49
|
+
"invalid-jsonc": "diagnosticJsonc", "duplicate-field": "diagnosticDuplicate", "unsafe-field": "diagnosticUnsafe", "unknown-field": "diagnosticUnknown",
|
|
50
|
+
"deprecated-field": "diagnosticDeprecated", "invalid-type": "diagnosticType", "unsupported-value": "diagnosticValue", "invalid-route": "diagnosticRoute",
|
|
51
|
+
"required-role": "diagnosticRequired", "deployment-ceiling": "diagnosticCeiling", "blank-label": "blankLabelWarning",
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=diagnostics.js.map
|
package/lib/client/index.d.ts
CHANGED
|
@@ -7,6 +7,10 @@ export { NS, en, zh } from "./locales.js";
|
|
|
7
7
|
export { TYPERT_REMOTE } from "../profile-remote.js";
|
|
8
8
|
export { SessionProfiles } from "./SessionProfiles.js";
|
|
9
9
|
export { structuredDocument, editStructuredPath, moveFallback } from "./structured.js";
|
|
10
|
+
export { ChildrenController } from "./children-controller.js";
|
|
11
|
+
export type { ChildrenActions, ChildrenSnapshot, ChildrenIssue } from "./children-controller.js";
|
|
12
|
+
export { ChildrenPanel } from "./ChildrenPanel.js";
|
|
13
|
+
export { ROLE_CONTROL_REMOTE } from "../role-control-remote.js";
|
|
10
14
|
/** No self-dependency on a namespace that this contribution has not mounted. */
|
|
11
15
|
export declare const inject: readonly ["slots", "locale", "remote"];
|
|
12
16
|
export declare function apply(ctx: Context): Promise<void>;
|