dsh-pstack 0.2.0-beta.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -3
- package/README.md +148 -84
- package/README.zh.md +198 -0
- package/assets/pstack-config-entry.png +0 -0
- package/cordis.patch.yml +105 -27
- package/dist/client.mjs +2341 -0
- package/dist/client.mjs.map +1 -0
- package/dist/host-contract-CUPSpeNk.d.mts +22 -0
- package/dist/index.d.mts +49 -238
- package/dist/index.mjs +250 -123
- package/dist/models.d.mts +44 -0
- package/dist/models.mjs +201 -0
- package/dist/paths-BT77khwm.mjs +48 -0
- package/dist/pstack/LICENSE +21 -0
- package/dist/pstack/README.md +291 -0
- package/dist/pstack/agents/poteto-agent.md +9 -0
- package/{assets → dist/pstack}/docs/guide/01-setup.md +13 -11
- package/{assets → dist/pstack}/docs/guide/02-poteto-mode.md +4 -4
- package/{assets → dist/pstack}/docs/guide/04-design.md +4 -4
- package/{assets → dist/pstack}/docs/guide/05-build-and-clean.md +2 -2
- package/{assets → dist/pstack}/docs/guide/06-verify-and-ship.md +13 -3
- package/{assets → dist/pstack}/docs/guide/07-overnight.md +15 -13
- package/{assets → dist/pstack}/docs/guide/09-make-it-yours.md +6 -2
- package/{assets → dist/pstack}/docs/guide/10-recipes-and-pitfalls.md +7 -5
- package/{assets → dist/pstack}/docs/guide/README.md +1 -1
- package/dist/pstack/docs/harness/dsh.md +98 -0
- package/{assets → dist/pstack}/skills/architect/SKILL.md +12 -12
- package/dist/pstack/skills/arena/SKILL.md +50 -0
- package/{assets → dist/pstack}/skills/automate-me/SKILL.md +14 -14
- package/{assets → dist/pstack}/skills/benchmark-checklist/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/blast-radius/SKILL.md +4 -6
- package/{assets → dist/pstack}/skills/correct/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/create-formal-verification-skill/SKILL.md +4 -2
- package/{assets → dist/pstack}/skills/create-verification-skill/SKILL.md +5 -5
- package/dist/pstack/skills/figure-it-out/SKILL.md +54 -0
- package/dist/pstack/skills/how/SKILL.md +38 -0
- package/{assets → dist/pstack}/skills/in-your-own-words/SKILL.md +1 -1
- package/dist/pstack/skills/interrogate/SKILL.md +33 -0
- package/{assets → dist/pstack}/skills/ketchup/SKILL.md +3 -5
- package/dist/pstack/skills/ketchup-video/SKILL.md +29 -0
- package/{assets → dist/pstack}/skills/maintain-formal-verification-skill/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/maintain-verification-skill/SKILL.md +3 -3
- package/dist/pstack/skills/make-bot-ui/SKILL.md +117 -0
- package/dist/pstack/skills/no-comments/SKILL.md +26 -0
- package/{assets → dist/pstack}/skills/poteto-help/SKILL.md +34 -31
- package/{assets → dist/pstack}/skills/poteto-help/references/prompting.md +1 -1
- package/{assets → dist/pstack}/skills/poteto-help/references/recipes.md +3 -3
- package/{assets → dist/pstack}/skills/poteto-mode/SKILL.md +20 -19
- package/dist/pstack/skills/poteto-mode/playbooks/authoring-a-skill.md +12 -0
- package/dist/pstack/skills/poteto-mode/playbooks/autonomous-run.md +13 -0
- package/dist/pstack/skills/poteto-mode/playbooks/autopilot-full.md +25 -0
- package/dist/pstack/skills/poteto-mode/playbooks/autopilot-stack.md +8 -0
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/babysit.md +4 -4
- package/dist/pstack/skills/poteto-mode/playbooks/bug-fix.md +15 -0
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/eval.md +3 -3
- package/dist/pstack/skills/poteto-mode/playbooks/feature.md +21 -0
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/hillclimb.md +3 -3
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/investigation.md +2 -2
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/multi-phase-plan.md +23 -23
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/opening-a-pr.md +6 -6
- package/dist/pstack/skills/poteto-mode/playbooks/orchestrate.md +25 -0
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/pause-safely.md +2 -2
- package/dist/pstack/skills/poteto-mode/playbooks/perf-issue.md +25 -0
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/prototype.md +4 -4
- package/dist/pstack/skills/poteto-mode/playbooks/refactoring.md +16 -0
- package/dist/pstack/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
- package/dist/pstack/skills/poteto-mode/playbooks/session-pickup.md +11 -0
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/shipping.md +2 -2
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/trace-forensics.md +2 -2
- package/dist/pstack/skills/poteto-mode/playbooks/visual-parity.md +11 -0
- package/dist/pstack/skills/poteto-mode/playbooks/worktree-cleanup.md +12 -0
- package/{assets → dist/pstack}/skills/poteto-mode/scripts/check-plan.mjs +6 -8
- package/dist/pstack/skills/poteto-mode/scripts/check-plan.test.mjs +128 -0
- package/{assets/skills/poteto-mode/scripts/check-plan.test.mjs → dist/pstack/skills/poteto-mode/scripts/expect.mjs} +12 -101
- package/dist/pstack/skills/poteto-mode/scripts/support.mjs +93 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/cli.mjs +123 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/cli.test.mjs +217 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.mjs +119 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/github.mjs +626 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/github.test.mjs +521 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/policy.mjs +657 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/policy.test.mjs +523 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/render.mjs +106 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/types.mjs +9 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/watch-pr.mjs +5 -0
- package/{assets → dist/pstack}/skills/poteto-mode/scripts/worktree-audit.mjs +15 -22
- package/dist/pstack/skills/poteto-mode/scripts/worktree-audit.test.mjs +134 -0
- package/{assets → dist/pstack}/skills/principle-attack-the-premise/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-boundary-discipline/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-encode-lessons-in-structure/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-exhaust-the-design-space/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-experience-first/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-explain-the-number/SKILL.md +3 -2
- package/{assets → dist/pstack}/skills/principle-fix-root-causes/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-laziness-protocol/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-make-operations-idempotent/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-minimize-reader-load/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-model-the-domain/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-never-block-on-the-human/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-outcome-oriented-execution/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-prove-it-works/SKILL.md +2 -2
- package/{assets → dist/pstack}/skills/principle-redesign-from-first-principles/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-separate-before-serializing-shared-state/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-sequence-verifiable-units/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-subtract-before-you-add/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-test-behavior-not-implementation/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-type-system-discipline/SKILL.md +1 -1
- package/dist/pstack/skills/recall/SKILL.md +37 -0
- package/dist/pstack/skills/reflect/SKILL.md +71 -0
- package/{assets → dist/pstack}/skills/reflect/references/divergent-reviewer.md +4 -4
- package/{assets → dist/pstack}/skills/reflect/references/judgment-reviewer.md +2 -2
- package/{assets → dist/pstack}/skills/reflect/references/synthesizer.md +5 -5
- package/{assets → dist/pstack}/skills/reflect/references/tooling-reviewer.md +2 -2
- package/dist/pstack/skills/setup-pstack/SKILL.md +80 -0
- package/{assets → dist/pstack}/skills/sharpen/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/show-me-your-work/SKILL.md +8 -8
- package/{assets → dist/pstack}/skills/show-me-your-work/scripts/log.mjs +1 -3
- package/dist/pstack/skills/show-me-your-work/scripts/log.test.mjs +56 -0
- package/dist/pstack/skills/statechart/SKILL.md +82 -0
- package/dist/pstack/skills/statechart/references/render.md +93 -0
- package/dist/pstack/skills/statechart/scripts/backends/cfg.mjs +31 -0
- package/dist/pstack/skills/statechart/scripts/backends/mermaid.mjs +186 -0
- package/dist/pstack/skills/statechart/scripts/backends/plain-text.mjs +62 -0
- package/dist/pstack/skills/statechart/scripts/backends/report.mjs +84 -0
- package/dist/pstack/skills/statechart/scripts/frontends/config.mjs +268 -0
- package/dist/pstack/skills/statechart/scripts/frontends/dot.mjs +67 -0
- package/dist/pstack/skills/statechart/scripts/frontends/marks.mjs +94 -0
- package/dist/pstack/skills/statechart/scripts/frontends/messages.mjs +48 -0
- package/dist/pstack/skills/statechart/scripts/frontends/spec.mjs +101 -0
- package/dist/pstack/skills/statechart/scripts/frontends/trace.mjs +39 -0
- package/dist/pstack/skills/statechart/scripts/frontends/value.mjs +180 -0
- package/dist/pstack/skills/statechart/scripts/frontends/verdict.mjs +40 -0
- package/dist/pstack/skills/statechart/scripts/frontends/view.mjs +99 -0
- package/dist/pstack/skills/statechart/scripts/ir.mjs +277 -0
- package/dist/pstack/skills/statechart/scripts/passes/annotate.mjs +92 -0
- package/dist/pstack/skills/statechart/scripts/passes/label.mjs +210 -0
- package/dist/pstack/skills/statechart/scripts/passes/lift.mjs +84 -0
- package/dist/pstack/skills/statechart/scripts/passes/loop-check.mjs +47 -0
- package/dist/pstack/skills/statechart/scripts/passes/paths.mjs +72 -0
- package/dist/pstack/skills/statechart/scripts/passes/reach.mjs +135 -0
- package/dist/pstack/skills/statechart/scripts/passes/region-check.mjs +82 -0
- package/dist/pstack/skills/statechart/scripts/passes/regions.mjs +268 -0
- package/dist/pstack/skills/statechart/scripts/pipeline.mjs +72 -0
- package/dist/pstack/skills/statechart/scripts/run.mjs +440 -0
- package/dist/pstack/skills/statechart/scripts/statechart.mjs +155 -0
- package/dist/pstack/skills/statechart/scripts/statechart.test.mjs +198 -0
- package/dist/pstack/skills/statechart/scripts/worker.mjs +31 -0
- package/dist/pstack/skills/swarm/SKILL.md +43 -0
- package/{assets → dist/pstack}/skills/tdd/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/teach/SKILL.md +2 -2
- package/{assets → dist/pstack}/skills/technical-writing/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/typescript-best-practices/SKILL.md +3 -6
- package/{assets → dist/pstack}/skills/why/SKILL.md +8 -8
- package/dist/remote.d.mts +27 -0
- package/dist/remote.mjs +234 -0
- package/dist/role-config-NNn5r1JX.mjs +415 -0
- package/dist/role-manifest-C3fUzjLI.d.mts +19 -0
- package/dist/role-wire-DZwTn2wF.d.mts +55 -0
- package/dist/roles.d.mts +18 -0
- package/dist/roles.mjs +323 -0
- package/dist/script.d.mts +9 -111
- package/dist/script.mjs +32 -329
- package/dist/skill.d.mts +38 -0
- package/dist/skill.mjs +183 -0
- package/dist/skills/authored/decision-audit/SKILL.md +103 -0
- package/dist/skills/authored/decision-audit/SKILL.zh.md +103 -0
- package/dist/skills/authored/decision-audit/references/recover-commit.md +17 -0
- package/dist/skills/authored/decision-audit/references/recover-commit.zh.md +17 -0
- package/dist/skills/authored/decision-write/SKILL.md +133 -0
- package/dist/skills/authored/decision-write/SKILL.zh.md +133 -0
- package/dist/skills/authored/decision-write/references/land.md +48 -0
- package/dist/skills/authored/decision-write/references/land.zh.md +48 -0
- package/dist/skills/authored/decision-write/references/scope.md +16 -0
- package/dist/skills/authored/decision-write/references/scope.zh.md +16 -0
- package/dist/skills/authored/docs-drift/SKILL.md +120 -0
- package/dist/skills/authored/docs-drift/SKILL.zh.md +120 -0
- package/dist/skills/authored/setup-project-docs/SKILL.md +63 -0
- package/dist/skills/authored/setup-project-docs/SKILL.zh.md +63 -0
- package/dist/skills/authored/setup-project-docs/references/decision-conventions.md +13 -0
- package/dist/skills/authored/setup-project-docs/references/decision-conventions.zh.md +13 -0
- package/dist/skills/vendored/retro/SKILL.md +44 -0
- package/dist/skills/vendored/retro/agents/openai.yaml +5 -0
- package/dist/skills/vendored/writing-for-agents/SKILL-MECHANICS.md +22 -0
- package/dist/skills/vendored/writing-for-agents/SKILL.md +81 -0
- package/dist/skills/vendored/writing-for-agents/agents/openai.yaml +3 -0
- package/dist/subagent.d.mts +54 -206
- package/dist/subagent.mjs +258 -963
- package/locale/en.json +3 -2
- package/locale/zh.json +3 -2
- package/package.json +93 -66
- package/assets/agents/poteto-agent.md +0 -8
- package/assets/docs/harness/dsh.md +0 -60
- package/assets/docs/pstack-models.example.md +0 -54
- package/assets/skills/arena/SKILL.md +0 -50
- package/assets/skills/figure-it-out/SKILL.md +0 -54
- package/assets/skills/how/SKILL.md +0 -38
- package/assets/skills/interrogate/SKILL.md +0 -71
- package/assets/skills/interrogate/references/code-quality-review.md +0 -47
- package/assets/skills/interrogate/references/lead-judgment.md +0 -39
- package/assets/skills/interrogate/references/reviewer-prompt.md +0 -62
- package/assets/skills/interrogate/references/rubric.md +0 -77
- package/assets/skills/no-comments/SKILL.md +0 -26
- package/assets/skills/poteto-mode/playbooks/authoring-a-skill.md +0 -12
- package/assets/skills/poteto-mode/playbooks/autonomous-run.md +0 -15
- package/assets/skills/poteto-mode/playbooks/autopilot-full.md +0 -25
- package/assets/skills/poteto-mode/playbooks/autopilot-stack.md +0 -12
- package/assets/skills/poteto-mode/playbooks/bug-fix.md +0 -15
- package/assets/skills/poteto-mode/playbooks/feature.md +0 -21
- package/assets/skills/poteto-mode/playbooks/orchestrate.md +0 -112
- package/assets/skills/poteto-mode/playbooks/perf-issue.md +0 -25
- package/assets/skills/poteto-mode/playbooks/refactoring.md +0 -16
- package/assets/skills/poteto-mode/playbooks/runtime-forensics.md +0 -11
- package/assets/skills/poteto-mode/playbooks/session-pickup.md +0 -11
- package/assets/skills/poteto-mode/playbooks/visual-parity.md +0 -11
- package/assets/skills/poteto-mode/playbooks/worktree-cleanup.md +0 -20
- package/assets/skills/poteto-mode/scripts/orch/orch.mjs +0 -4282
- package/assets/skills/poteto-mode/scripts/orch/orch.test.mjs +0 -2042
- package/assets/skills/poteto-mode/scripts/watch-pr/cli.test.mjs +0 -5101
- package/assets/skills/poteto-mode/scripts/watch-pr/github.test.mjs +0 -1177
- package/assets/skills/poteto-mode/scripts/watch-pr/policy.test.mjs +0 -1441
- package/assets/skills/poteto-mode/scripts/watch-pr/watch-pr.mjs +0 -4601
- package/assets/skills/recall/SKILL.md +0 -37
- package/assets/skills/reflect/SKILL.md +0 -69
- package/assets/skills/setup-pstack/SKILL.md +0 -67
- package/assets/skills/swarm/SKILL.md +0 -43
- package/dist/frontmatter-BQX3ekwP.mjs +0 -229
- package/dist/frontmatter-BQX3ekwP.mjs.map +0 -1
- package/dist/history.d.mts +0 -429
- package/dist/history.mjs +0 -1129
- package/dist/history.mjs.map +0 -1
- package/dist/host-contract-o47JH_r8.d.mts +0 -527
- package/dist/index.mjs.map +0 -1
- package/dist/paths-D_JlVmBk.mjs +0 -42
- package/dist/paths-D_JlVmBk.mjs.map +0 -1
- package/dist/script.mjs.map +0 -1
- package/dist/subagent.mjs.map +0 -1
- /package/{static/icon.png → assets/logo.png} +0 -0
- /package/{assets → dist/pstack}/agents/comment-sicko.md +0 -0
- /package/{assets → dist/pstack}/docs/guide/03-understand.md +0 -0
- /package/{assets → dist/pstack}/docs/guide/08-principles.md +0 -0
- /package/{assets → dist/pstack}/docs/guide/images/design.jpg +0 -0
- /package/{assets → dist/pstack}/docs/guide/images/overnight.jpg +0 -0
- /package/{assets → dist/pstack}/docs/guide/images/recipes.jpg +0 -0
- /package/{assets → dist/pstack}/docs/guide/images/router.jpg +0 -0
- /package/{assets → dist/pstack}/docs/guide/images/understanding.jpg +0 -0
- /package/{assets → dist/pstack}/docs/guide/images/verification.jpg +0 -0
- /package/{assets → dist/pstack}/skills/architect/references/design-red-flags.md +0 -0
- /package/{assets → dist/pstack}/skills/architect/references/rationale-template.md +0 -0
- /package/{assets → dist/pstack}/skills/architect/references/runner-prompt.md +0 -0
- /package/{assets → dist/pstack}/skills/bro/SKILL.md +0 -0
- /package/{assets → dist/pstack}/skills/create-verification-skill/references/feature-map-example/README.md +0 -0
- /package/{assets → dist/pstack}/skills/create-verification-skill/references/feature-map-example/create-note.md +0 -0
- /package/{assets → dist/pstack}/skills/create-verification-skill/references/feature-map-example/search.md +0 -0
- /package/{assets → dist/pstack}/skills/how/references/explainer-prompt.md +0 -0
- /package/{assets → dist/pstack}/skills/how/references/explorer-prompt.md +0 -0
- /package/{assets → dist/pstack}/skills/poteto-mode/references/bugbot-triage.md +0 -0
- /package/{assets → dist/pstack}/skills/principle-build-the-lever/SKILL.md +0 -0
- /package/{assets → dist/pstack}/skills/principle-foundational-thinking/SKILL.md +0 -0
- /package/{assets → dist/pstack}/skills/principle-guard-the-context-window/SKILL.md +0 -0
- /package/{assets → dist/pstack}/skills/show-me-your-work/references/decision-log-template.tsv +0 -0
- /package/{assets → dist/pstack}/skills/typescript-best-practices/references/patterns.md +0 -0
- /package/{assets → dist/pstack}/skills/unslop/SKILL.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/epistemics.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/investigator-prompt.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/source-playbook.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/code-archaeology.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/databricks.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/datadog.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/incident-postmortem.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/linear.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/notion.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/sentry.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/slack.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/synthesizer-prompt.md +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.mjs","names":["COLOR_TEXT","COLOR_SECONDARY","COLOR_CAPTION","COLOR_BORDER","COLOR_SURFACE","COLOR_ERROR","COLOR_SUCCESS","COLOR_WARN","statusColor","buttonStyle","useState","NS","base","catalogs","COLOR_TEXT","useState","useState","createPortal","useId","ROLES_NS","rolesCatalogs","PLUGINS_NS","pluginsCatalogs"],"sources":["../src/remote.ts","../src/internal/optional-plugins.ts","../src/client/optional-plugins-state.ts","../src/client/OptionalPluginsPage.tsx","../src/client/state.ts","../src/client/locales.ts","../src/client/RoleSettingsPage.tsx","../src/client/PstackBundleConfigDialog.tsx","../src/client/optional-plugins-locales.ts","../src/client/index.ts"],"sourcesContent":["/**\n * Hand-written Typert Remote metadata for the role configuration page.\n *\n * The repository has no Typert generation chain, so this artifact supplies the\n * same consumer-facing contract a generated `./remote` artifact would: strict\n * input and result codecs plus the `methods` index the Client mounts with\n * `ctx.remote.$mount()`. The Host registers these identical descriptors with\n * `ctx.typert.register()`, which selects strict validation instead of the\n * Gateway's SRC fallback.\n *\n * No Node imports: the Client bundle inlines this module.\n */\n\nimport type {\n InvocationDescriptor,\n InvocationParameterDescriptor,\n RemoteResult,\n TypertClientRemote,\n TypertCodec,\n TypertRemoteContribution,\n TypertRemoteInfo,\n TypertRemoteMethod,\n TypertSchema,\n} from \"@deepseek-ai/dsh-typert-protocol\";\n\nimport type { CatalogueResult } from \"./models.ts\";\nimport type {\n RoleFileSnapshot,\n SaveRoleRequest,\n SaveRoleResult,\n RouteView,\n} from \"./internal/role-wire.ts\";\n\n/** npm package that owns these methods. */\nexport const REMOTE_PACKAGE = \"dsh-pstack\";\n\n/** Cordis service key and wire namespace of the Host role service. */\nexport const ROLES_SERVICE = \"pstackRoles\";\n\ntype StrictCodec<Value> = Extract<TypertCodec<Value>, { readonly mode: \"strict\" }>;\n\nfunction jsonCodec<Value>(\n typeSymbol: string,\n parse: (value: unknown) => Value,\n decode?: (value: unknown) => Value,\n): StrictCodec<Value> {\n return {\n mode: \"strict\",\n typeSymbol,\n create: () => ({ parse }),\n ...(decode === undefined ? {} : { decode }),\n };\n}\n\nfunction parameter(\n wire: string,\n typeSymbol: string,\n parse: (value: unknown) => unknown,\n): InvocationParameterDescriptor {\n return { name: wire, wire, source: \"json\", codec: jsonCodec(typeSymbol, parse) };\n}\n\nfunction parseRecord(value: unknown, subject: string): Record<string, unknown> {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n throw new TypeError(`${subject} must be an object`);\n }\n return value as Record<string, unknown>;\n}\n\nfunction parseRoute(value: unknown, subject: string): RouteView {\n const record = parseRecord(value, subject);\n if (record[\"kind\"] === \"inherit\") {\n const alias = record[\"alias\"] ?? \"inherit-parent\";\n if (alias !== \"inherit-parent\" && alias !== \"auto\") {\n throw new TypeError(`${subject}.alias must be \"inherit-parent\" or \"auto\"`);\n }\n return { kind: \"inherit\", alias };\n }\n if (record[\"kind\"] !== \"route\") throw new TypeError(`${subject}.kind is unknown`);\n const provider = record[\"provider\"];\n const model = record[\"model\"];\n const effort = record[\"effort\"];\n if (typeof provider !== \"string\" || provider.trim() === \"\") {\n throw new TypeError(`${subject}.provider must be a non-empty string`);\n }\n if (typeof model !== \"string\" || model.trim() === \"\") {\n throw new TypeError(`${subject}.model must be a non-empty string`);\n }\n if (effort !== undefined && (typeof effort !== \"string\" || effort.trim() === \"\")) {\n throw new TypeError(`${subject}.effort must be a non-empty string when present`);\n }\n return {\n kind: \"route\",\n provider,\n model,\n ...(typeof effort === \"string\" ? { effort } : {}),\n };\n}\n\n/** Parse one save request from the wire. */\nexport function parseSaveRoleRequest(value: unknown): SaveRoleRequest {\n const record = parseRecord(value, \"the save request\");\n if (typeof record[\"key\"] !== \"string\") throw new TypeError(\"the save request must name a role\");\n const routes = record[\"routes\"];\n if (!Array.isArray(routes)) throw new TypeError(\"the save request must carry a route list\");\n return {\n key: record[\"key\"],\n routes: routes.map((route, index) => parseRoute(route, `routes[${index}]`)),\n };\n}\n\nfunction parseRoleFileIssue(value: unknown): RoleFileSnapshot[\"issues\"][number] {\n const record = parseRecord(value, \"a role file issue\");\n if (typeof record[\"message\"] !== \"string\")\n throw new TypeError(\"a role file issue needs a message\");\n const line = record[\"line\"];\n if (line !== undefined && typeof line !== \"number\") {\n throw new TypeError(\"a role file issue line must be a number\");\n }\n return { ...(typeof line === \"number\" ? { line } : {}), message: record[\"message\"] };\n}\n\nfunction parseRoleView(value: unknown, index: number): RoleFileSnapshot[\"roles\"][number] {\n const record = parseRecord(value, `roles[${index}]`);\n if (typeof record[\"key\"] !== \"string\")\n throw new TypeError(`roles[${index}].key must be a string`);\n if (record[\"shape\"] !== \"single\" && record[\"shape\"] !== \"list\") {\n throw new TypeError(`roles[${index}].shape is unknown`);\n }\n if (typeof record[\"configured\"] !== \"boolean\") {\n throw new TypeError(`roles[${index}].configured must be a boolean`);\n }\n const routes = record[\"routes\"];\n const issues = record[\"issues\"];\n if (!Array.isArray(routes) || !Array.isArray(issues)) {\n throw new TypeError(`roles[${index}] must carry routes and issues arrays`);\n }\n const line = record[\"line\"];\n return {\n key: record[\"key\"],\n shape: record[\"shape\"],\n configured: record[\"configured\"],\n ...(typeof line === \"number\" ? { line } : {}),\n routes: routes.map((route, routeIndex) =>\n parseRoute(route, `roles[${index}].routes[${routeIndex}]`),\n ),\n issues: issues.map((issue) => String(issue)),\n };\n}\n\n/** Parse a role-file snapshot from the wire. */\nexport function parseRoleFileSnapshot(value: unknown): RoleFileSnapshot {\n const record = parseRecord(value, \"the role file snapshot\");\n const status = record[\"status\"];\n if (status !== \"missing\" && status !== \"loaded\" && status !== \"unreadable\") {\n throw new TypeError(\"the role file snapshot status is unknown\");\n }\n if (typeof record[\"path\"] !== \"string\")\n throw new TypeError(\"the role file snapshot path must be a string\");\n if (typeof record[\"canSave\"] !== \"boolean\") {\n throw new TypeError(\"the role file snapshot canSave must be a boolean\");\n }\n const roles = record[\"roles\"];\n const issues = record[\"issues\"];\n if (!Array.isArray(roles) || !Array.isArray(issues)) {\n throw new TypeError(\"the role file snapshot must carry roles and issues arrays\");\n }\n const reason = record[\"reason\"];\n const budget = record[\"budget\"];\n return {\n path: record[\"path\"],\n status,\n ...(typeof reason === \"string\" ? { reason } : {}),\n ...(typeof budget === \"string\" ? { budget } : {}),\n roles: roles.map((role, index) => parseRoleView(role, index)),\n issues: issues.map(parseRoleFileIssue),\n canSave: record[\"canSave\"],\n };\n}\n\n/** Parse a save result from the wire. */\nexport function parseSaveRoleResult(value: unknown): SaveRoleResult {\n const record = parseRecord(value, \"the save result\");\n if (record[\"ok\"] === true) {\n return { ok: true, snapshot: parseRoleFileSnapshot(record[\"snapshot\"]) };\n }\n if (record[\"ok\"] === false && typeof record[\"reason\"] === \"string\") {\n return { ok: false, reason: record[\"reason\"] };\n }\n throw new TypeError(\"the save result must be ok with a snapshot or refused with a reason\");\n}\n\n/** Parse the live catalogue the page offers. */\nexport function parseCatalogue(value: unknown): CatalogueResult {\n const record = parseRecord(value, \"the catalogue\");\n const providers = record[\"providers\"];\n if (!Array.isArray(providers)) throw new TypeError(\"the catalogue must carry providers\");\n if (typeof record[\"truncated\"] !== \"boolean\") {\n throw new TypeError(\"the catalogue truncated flag must be a boolean\");\n }\n return {\n providers: providers.map((provider, index) => {\n const entry = parseRecord(provider, `providers[${index}]`);\n if (typeof entry[\"provider\"] !== \"string\" || typeof entry[\"name\"] !== \"string\") {\n throw new TypeError(`providers[${index}] needs provider and name strings`);\n }\n const models = entry[\"models\"];\n if (!Array.isArray(models))\n throw new TypeError(`providers[${index}].models must be an array`);\n return {\n provider: entry[\"provider\"],\n name: entry[\"name\"],\n ...(typeof entry[\"error\"] === \"string\" ? { error: entry[\"error\"] } : {}),\n models: models.map((model, modelIndex) => {\n const item = parseRecord(model, `providers[${index}].models[${modelIndex}]`);\n if (\n typeof item[\"route\"] !== \"string\" ||\n typeof item[\"id\"] !== \"string\" ||\n typeof item[\"name\"] !== \"string\"\n ) {\n throw new TypeError(\n `providers[${index}].models[${modelIndex}] needs route, id, and name strings`,\n );\n }\n const efforts = item[\"efforts\"];\n if (!Array.isArray(efforts) || efforts.some((effort) => typeof effort !== \"string\")) {\n throw new TypeError(\n `providers[${index}].models[${modelIndex}].efforts must be strings`,\n );\n }\n return {\n route: item[\"route\"],\n id: item[\"id\"],\n name: item[\"name\"],\n ...(typeof item[\"description\"] === \"string\"\n ? { description: item[\"description\"] }\n : {}),\n ...(typeof item[\"contextWindow\"] === \"number\"\n ? { contextWindow: item[\"contextWindow\"] }\n : {}),\n ...(typeof item[\"maxTokens\"] === \"number\" ? { maxTokens: item[\"maxTokens\"] } : {}),\n efforts,\n ...(typeof item[\"defaultEffort\"] === \"string\"\n ? { defaultEffort: item[\"defaultEffort\"] }\n : {}),\n ...(typeof item[\"error\"] === \"string\" ? { error: item[\"error\"] } : {}),\n };\n }),\n };\n }),\n truncated: record[\"truncated\"],\n };\n}\n\ninterface MethodOptions<Input extends object, Output> {\n readonly method: string;\n readonly parameters: readonly InvocationParameterDescriptor[];\n readonly result: StrictCodec<Output>;\n readonly cancellation?: boolean;\n readonly invoke: (\n remote: TypertClientRemote,\n input: Input,\n signal?: AbortSignal,\n ) => Promise<RemoteResult<Output>>;\n}\n\nfunction directMethod<Input extends object, Output>(\n options: MethodOptions<Input, Output>,\n): TypertRemoteMethod<Input, Output> {\n const descriptor: InvocationDescriptor = {\n id: `${REMOTE_PACKAGE}#${ROLES_SERVICE}/${options.method}`,\n service: ROLES_SERVICE,\n namespace: ROLES_SERVICE,\n method: options.method,\n invocation: { kind: \"direct\" },\n parameters: options.parameters,\n result: options.result,\n ...(options.cancellation === true ? { cancellation: { parameter: \"signal\" } } : {}),\n };\n const input = {\n create(): TypertSchema<Input> {\n return {\n parse(value: unknown): Input {\n const record = parseRecord(value, \"the method input\");\n const parsed: Record<string, unknown> = {};\n for (const item of options.parameters) {\n if (record[item.wire] !== undefined) {\n const codec = item.codec as StrictCodec<unknown>;\n parsed[item.wire] = codec.create().parse(record[item.wire]);\n }\n }\n return parsed as Input;\n },\n };\n },\n };\n const method = {\n ...descriptor,\n input: () => input,\n invoke(\n remote: TypertClientRemote,\n named: Input,\n signal?: AbortSignal,\n ): Promise<RemoteResult<Output>> {\n const namespace = Reflect.get(remote as object, ROLES_SERVICE) as Record<\n string,\n (...args: unknown[]) => Promise<RemoteResult<Output>>\n >;\n const values = options.parameters.map(\n (item) => (named as Record<string, unknown>)[item.wire],\n );\n if (options.cancellation === true) values.push(signal);\n return namespace[options.method]!(...values);\n },\n };\n return method as TypertRemoteMethod<Input, Output>;\n}\n\nconst statusMethod = directMethod<Record<string, never>, RoleFileSnapshot>({\n method: \"status\",\n parameters: [],\n result: jsonCodec(\"PstackRoleFileSnapshot\", parseRoleFileSnapshot, parseRoleFileSnapshot),\n invoke: (remote) =>\n (remote as unknown as PstackRolesNamespace).pstackRoles.status() as Promise<\n RemoteResult<RoleFileSnapshot>\n >,\n});\n\nconst catalogueMethod = directMethod<Record<string, never>, CatalogueResult>({\n method: \"catalogue\",\n parameters: [],\n result: jsonCodec(\"PstackRoleCatalogue\", parseCatalogue, parseCatalogue),\n cancellation: true,\n invoke: (remote, _input, signal) =>\n (remote as unknown as PstackRolesNamespace).pstackRoles.catalogue(signal) as Promise<\n RemoteResult<CatalogueResult>\n >,\n});\n\nconst saveMethod = directMethod<SaveRoleRequest, SaveRoleResult>({\n method: \"save\",\n parameters: [\n parameter(\"request\", \"PstackSaveRoleRequest\", (value) => {\n parseSaveRoleRequest(value);\n return value;\n }),\n ],\n result: jsonCodec(\"PstackSaveRoleResult\", parseSaveRoleResult, parseSaveRoleResult),\n cancellation: true,\n invoke: (remote, request, signal) =>\n (remote as unknown as PstackRolesNamespace).pstackRoles.save(request, signal) as Promise<\n RemoteResult<SaveRoleResult>\n >,\n});\n\n/** The typed Client face installed by `$mount`. */\nexport interface PstackRolesNamespace {\n readonly pstackRoles: {\n status(): Promise<RemoteResult<RoleFileSnapshot>>;\n catalogue(signal?: AbortSignal): Promise<RemoteResult<CatalogueResult>>;\n save(request: SaveRoleRequest, signal?: AbortSignal): Promise<RemoteResult<SaveRoleResult>>;\n };\n}\n\n/** Mountable contribution the Client passes to `ctx.remote.$mount()`. */\nexport const pstackRolesRemote: TypertRemoteInfo = {\n package: REMOTE_PACKAGE,\n descriptors: [statusMethod, catalogueMethod, saveMethod] as InvocationDescriptor[],\n methods: {\n [`${ROLES_SERVICE}/status`]: statusMethod,\n [`${ROLES_SERVICE}/catalogue`]: catalogueMethod,\n [`${ROLES_SERVICE}/save`]: saveMethod,\n } as TypertRemoteInfo[\"methods\"],\n};\n\n/** The same descriptors registered by the Host as its strict definitions. */\nexport const pstackRolesContribution: TypertRemoteContribution = pstackRolesRemote;\n","/**\n * The optional DSH plugins pstack recommends on its Plugins page.\n *\n * This module is the single source for the `OPT-*` catalogue used by the page\n * and by the tests that check it against the harness adapter document and both\n * READMEs. `bundle` names the package the plugin manager can switch; rows\n * without one are package groups that only carry documentation guidance.\n */\n\n/** The optional-plugin ids documented by the pstack harness adapter. */\nexport type OptionalPluginId =\n | \"OPT-01\"\n | \"OPT-02\"\n | \"OPT-03\"\n | \"OPT-04\"\n | \"OPT-05\"\n | \"OPT-06\"\n | \"OPT-07\"\n | \"OPT-08\"\n | \"OPT-09\";\n\n/** The task-scenario groups the page renders. */\nexport type OptionalPluginGroup = \"sessions\" | \"verification\" | \"multi-agent\";\n\n/** One documented optional plugin row. */\nexport interface OptionalPluginDefinition {\n /** `OPT-*` id from the harness adapter's table. */\n readonly id: OptionalPluginId;\n /** Task-scenario group. */\n readonly group: OptionalPluginGroup;\n /** Packages named by the documentation row, in documentation order. */\n readonly packages: readonly string[];\n /** The bundle `pluginManager.setBundleEnabled` addresses; absent for non-bundle rows. */\n readonly bundle?: string;\n /** Included in the default recommendation and in “enable recommended plugins”. */\n readonly recommended?: boolean;\n /** User-suggested entry, shown with its own tag and never in the default set. */\n readonly suggested?: boolean;\n /** Entry that only warns about a conflict and cannot be switched here. */\n readonly conflict?: boolean;\n /** Whether this page may offer a switch for the bundle. */\n readonly switchable?: boolean;\n}\n\n/** Group order shared by the page and its tests. */\nexport const OPTIONAL_PLUGIN_GROUPS: readonly OptionalPluginGroup[] = [\n \"sessions\",\n \"verification\",\n \"multi-agent\",\n];\n\n/** The complete optional-plugin catalogue in documentation order. */\nexport const OPTIONAL_PLUGINS: readonly OptionalPluginDefinition[] = [\n {\n id: \"OPT-01\",\n group: \"sessions\",\n packages: [\n \"@deepseek-ai/dsh-experimental-worktree\",\n \"@deepseek-ai/dsh-experimental-tool-worktree\",\n ],\n bundle: \"@deepseek-ai/dsh-experimental-tool-worktree\",\n recommended: true,\n },\n {\n id: \"OPT-02\",\n group: \"sessions\",\n packages: [\"@deepseek-ai/dsh-experimental-forge-bundle\"],\n bundle: \"@deepseek-ai/dsh-experimental-forge-bundle\",\n suggested: true,\n },\n {\n id: \"OPT-03\",\n group: \"verification\",\n packages: [\n \"@deepseek-ai/dsh-browser-use\",\n \"@deepseek-ai/dsh-experimental-browser-use-stagehand-native\",\n \"@deepseek-ai/dsh-experimental-browser-use-playwright-mcp\",\n \"@deepseek-ai/dsh-experimental-browser-use-chrome-devtools-mcp\",\n ],\n },\n {\n id: \"OPT-04\",\n group: \"verification\",\n packages: [\"@deepseek-ai/dsh-cua-bundle\"],\n bundle: \"@deepseek-ai/dsh-cua-bundle\",\n },\n {\n id: \"OPT-05\",\n group: \"verification\",\n packages: [\"@deepseek-ai/dsh-experimental-terminal-bundle\"],\n bundle: \"@deepseek-ai/dsh-experimental-terminal-bundle\",\n },\n {\n id: \"OPT-06\",\n group: \"sessions\",\n packages: [\"@deepseek-ai/dsh-experimental-session-search\"],\n bundle: \"@deepseek-ai/dsh-experimental-session-search\",\n recommended: true,\n },\n {\n id: \"OPT-07\",\n group: \"verification\",\n packages: [\"@deepseek-ai/dsh-mcp-client\"],\n },\n {\n id: \"OPT-08\",\n group: \"multi-agent\",\n packages: [\"@deepseek-ai/dsh-experimental-agent-team-profile\"],\n bundle: \"@deepseek-ai/dsh-experimental-agent-team-profile\",\n conflict: true,\n switchable: false,\n },\n {\n id: \"OPT-09\",\n group: \"multi-agent\",\n packages: [\"@deepseek-ai/dsh-experimental-ralph-bundle\"],\n bundle: \"@deepseek-ai/dsh-experimental-ralph-bundle\",\n },\n];\n\n/** The default recommendation set, in enable order. */\nexport const DEFAULT_RECOMMENDED_PLUGINS: readonly OptionalPluginId[] = [\"OPT-01\", \"OPT-06\"];\n\n/** Find one catalogue row by id. */\nexport function optionalPlugin(id: OptionalPluginId): OptionalPluginDefinition {\n const found = OPTIONAL_PLUGINS.find((plugin) => plugin.id === id);\n if (found === undefined) throw new Error(`unknown optional plugin ${id}`);\n return found;\n}\n\n/** Bundle packages the one-click action enables, in documented order. */\nexport function recommendedBundleNames(): readonly string[] {\n return OPTIONAL_PLUGINS.filter(\n (plugin) => plugin.recommended === true && plugin.bundle !== undefined,\n ).map((plugin) => plugin.bundle as string);\n}\n","/**\n * Pure state and small async operations for the optional-plugin recommendation\n * section. Keeping status derivation and the one-click sequence here lets the\n * browser tests cover every decision without mounting the Plugins page.\n *\n * The two wire shapes below mirror the public `BundleInfo` and `ChangeResult`\n * fields this page reads from `pluginManager` (DSH 0.2.2-alpha.2), the same way\n * `remote.ts` hand-writes the role Remote contract.\n */\n\nimport {\n OPTIONAL_PLUGINS,\n type OptionalPluginDefinition,\n type OptionalPluginId,\n} from \"../internal/optional-plugins.ts\";\n\n/** The bundle facts the recommendation section reads. */\nexport interface BundleSnapshot {\n readonly name: string;\n readonly availability: \"installation\" | \"profile\" | \"missing\";\n readonly enabled: boolean;\n readonly installed: boolean;\n readonly optional: boolean;\n readonly error?: { readonly code: string; readonly diagnostic?: string };\n}\n\n/** The change facts the page reports. */\nexport interface BundleChange {\n readonly application: \"applied\" | \"restart-required\" | \"overridden\" | \"failed\" | \"cancelled\";\n readonly enabled?: boolean;\n readonly error?: { readonly code: string; readonly diagnostic?: string };\n}\n\n/** The status a recommendation row shows. */\nexport type OptionalPluginStatus = \"enabled\" | \"off\" | \"missing\" | \"unsupported-platform\" | \"error\";\n\n/** One catalogue row joined with the live bundle inventory. */\nexport interface OptionalPluginRow {\n readonly definition: OptionalPluginDefinition;\n readonly status: OptionalPluginStatus;\n readonly enabled: boolean;\n /** Whether the page offers a switch for this row. */\n readonly canToggle: boolean;\n}\n\n/** Read one bundle's display status, including platform and file failures. */\nexport function optionalPluginStatus(bundle: BundleSnapshot | undefined): OptionalPluginStatus {\n if (bundle === undefined) return \"missing\";\n if (bundle.error?.code === \"unsupported-platform\") return \"unsupported-platform\";\n if (bundle.availability === \"missing\") return \"missing\";\n if (bundle.error !== undefined) return \"error\";\n return bundle.enabled ? \"enabled\" : \"off\";\n}\n\n/** Join the catalogue with the Host's bundle list. */\nexport function optionalPluginRows(\n bundles: readonly BundleSnapshot[] | undefined,\n): readonly OptionalPluginRow[] {\n const byName = new Map((bundles ?? []).map((bundle) => [bundle.name, bundle]));\n return OPTIONAL_PLUGINS.map((definition) => {\n const bundle = definition.bundle === undefined ? undefined : byName.get(definition.bundle);\n const status = definition.bundle === undefined ? \"missing\" : optionalPluginStatus(bundle);\n return {\n definition,\n status,\n enabled: status === \"enabled\",\n canToggle:\n definition.bundle !== undefined &&\n definition.switchable !== false &&\n (status === \"off\" || status === \"enabled\"),\n };\n });\n}\n\n/** How many default-recommended plugins are not on yet, for activation guidance. */\nexport function remainingRecommendedCount(rows: readonly OptionalPluginRow[]): number {\n return rows.filter((row) => row.definition.recommended === true && row.status !== \"enabled\")\n .length;\n}\n\n/** The bundle names the one-click action should try, in catalogue order. */\nexport function recommendedTargets(rows: readonly OptionalPluginRow[]): readonly string[] {\n return rows\n .filter((row) => row.definition.recommended === true && row.definition.bundle !== undefined)\n .map((row) => row.definition.bundle as string);\n}\n\n/** One row's attempted outcome; `error` is a rejected Remote call. */\nexport interface RecommendedOutcome {\n readonly id: OptionalPluginId;\n readonly bundle: string;\n readonly application: BundleChange[\"application\"] | \"error\";\n}\n\n/** Aggregate result of “enable recommended plugins”. */\nexport interface RecommendedSummary {\n readonly applied: number;\n readonly restartRequired: number;\n readonly failed: number;\n readonly skipped: number;\n readonly outcomes: readonly RecommendedOutcome[];\n}\n\n/** The narrow plugin-manager face the section needs. */\nexport interface OptionalPluginsApi {\n listBundles(): Promise<readonly BundleSnapshot[]>;\n setBundleEnabled(name: string, enabled: boolean): Promise<BundleChange>;\n}\n\n/**\n * Enable the default recommendation one bundle at a time and keep going after\n * failures so the summary reports every attempted step.\n */\nexport async function enableRecommendedPlugins(\n api: Pick<OptionalPluginsApi, \"setBundleEnabled\">,\n rows: readonly OptionalPluginRow[],\n): Promise<RecommendedSummary> {\n const outcomes: RecommendedOutcome[] = [];\n let applied = 0;\n let restartRequired = 0;\n let failed = 0;\n let skipped = 0;\n for (const row of rows) {\n if (row.definition.recommended !== true || row.definition.bundle === undefined) continue;\n if (row.status === \"enabled\") continue;\n if (row.status !== \"off\") {\n skipped += 1;\n continue;\n }\n try {\n const result = await api.setBundleEnabled(row.definition.bundle, true);\n outcomes.push({\n id: row.definition.id,\n bundle: row.definition.bundle,\n application: result.application,\n });\n if (result.application === \"applied\") applied += 1;\n else if (result.application === \"restart-required\") restartRequired += 1;\n else failed += 1;\n } catch {\n outcomes.push({\n id: row.definition.id,\n bundle: row.definition.bundle,\n application: \"error\",\n });\n failed += 1;\n }\n }\n return { applied, restartRequired, failed, skipped, outcomes };\n}\n\n/** Minimal Persistent-storage face, kept injectable for tests. */\nexport interface GuidanceStorage {\n getItem(key: string): string | null;\n setItem(key: string, value: string): void;\n}\n\n/** The one-time activation guidance marker. */\nexport const GUIDANCE_DISMISSED_KEY = \"dsh-pstack.recommended-plugins.guidance.v1\";\n\n/** Browser storage, or undefined outside a browser or when access throws. */\nexport function browserStorage(): GuidanceStorage | undefined {\n if (typeof window === \"undefined\") return undefined;\n try {\n return window.localStorage;\n } catch {\n return undefined;\n }\n}\n\n/** Whether the activation guidance was already dismissed in this browser. */\nexport function guidanceDismissed(storage: GuidanceStorage | undefined): boolean {\n try {\n return storage?.getItem(GUIDANCE_DISMISSED_KEY) === \"1\";\n } catch {\n return false;\n }\n}\n\n/** Remember that the activation guidance must not appear again. */\nexport function dismissGuidance(storage: GuidanceStorage | undefined): void {\n try {\n storage?.setItem(GUIDANCE_DISMISSED_KEY, \"1\");\n } catch {\n // A browser that refuses storage may still use the page; guidance is best effort.\n }\n}\n","/**\n * Recommended optional plugins on the dsh-pstack bundle page, plus the\n * one-time activation guidance offered after the bundle is switched on.\n *\n * The page only reads `pluginManager.listBundles()` when it opens. Every\n * profile change goes through a button the person pressed.\n */\n\nimport { useEffect, useState, type CSSProperties, type ReactElement } from \"react\";\nimport type { InjectFace, PropsLocale, PropsRuntime } from \"@deepseek-ai/dsh-client-ui-slots\";\nimport type {} from \"@deepseek-ai/dsh-client-ui-plugin-manager/client\";\n\nimport {\n OPTIONAL_PLUGIN_GROUPS,\n type OptionalPluginGroup,\n type OptionalPluginId,\n} from \"../internal/optional-plugins.ts\";\nimport {\n browserStorage,\n dismissGuidance,\n enableRecommendedPlugins,\n guidanceDismissed,\n optionalPluginRows,\n remainingRecommendedCount,\n type BundleChange,\n type BundleSnapshot,\n type OptionalPluginRow,\n type OptionalPluginStatus,\n type OptionalPluginsApi,\n} from \"./optional-plugins-state.ts\";\nimport {\n NS,\n type PstackPluginsLocaleKey,\n type PstackPluginsTranslate,\n} from \"./optional-plugins-locales.ts\";\n\n/** Registration face shared by the recommendation section and activation guidance. */\nexport type OptionalPluginsFace = { readonly optionalPlugins: OptionalPluginsApi };\n\nconst COLOR_TEXT = \"var(--dsw-alias-label-primary)\";\nconst COLOR_SECONDARY = \"var(--dsw-alias-label-secondary)\";\nconst COLOR_CAPTION = \"var(--dsw-alias-label-caption)\";\nconst COLOR_BORDER = \"var(--dsw-alias-border-l3)\";\nconst COLOR_SURFACE = \"var(--dsw-alias-bg-layer-1)\";\nconst COLOR_ERROR = \"var(--dsw-alias-state-error-primary)\";\nconst COLOR_SUCCESS = \"var(--dsw-alias-state-success-primary)\";\nconst COLOR_WARN = \"var(--dsw-alias-state-warn-primary)\";\n\nconst STATUS_KEY: Record<OptionalPluginStatus, PstackPluginsLocaleKey> = {\n enabled: \"pluginStatusEnabled\",\n off: \"pluginStatusOff\",\n missing: \"pluginStatusMissing\",\n \"unsupported-platform\": \"pluginStatusUnsupportedPlatform\",\n error: \"pluginStatusError\",\n};\n\nconst GROUP_KEY: Record<OptionalPluginGroup, PstackPluginsLocaleKey> = {\n sessions: \"groupSessions\",\n verification: \"groupVerification\",\n \"multi-agent\": \"groupMultiAgent\",\n};\n\nconst COPY: Record<\n OptionalPluginId,\n { readonly title: PstackPluginsLocaleKey; readonly detail: PstackPluginsLocaleKey }\n> = {\n \"OPT-01\": { title: \"opt01Title\", detail: \"opt01Detail\" },\n \"OPT-02\": { title: \"opt02Title\", detail: \"opt02Detail\" },\n \"OPT-03\": { title: \"opt03Title\", detail: \"opt03Detail\" },\n \"OPT-04\": { title: \"opt04Title\", detail: \"opt04Detail\" },\n \"OPT-05\": { title: \"opt05Title\", detail: \"opt05Detail\" },\n \"OPT-06\": { title: \"opt06Title\", detail: \"opt06Detail\" },\n \"OPT-07\": { title: \"opt07Title\", detail: \"opt07Detail\" },\n \"OPT-08\": { title: \"opt08Title\", detail: \"opt08Detail\" },\n \"OPT-09\": { title: \"opt09Title\", detail: \"opt09Detail\" },\n};\n\nfunction statusColor(status: OptionalPluginStatus): string {\n if (status === \"enabled\") return COLOR_SUCCESS;\n if (status === \"error\") return COLOR_ERROR;\n if (status === \"missing\" || status === \"unsupported-platform\") return COLOR_WARN;\n return COLOR_CAPTION;\n}\n\nfunction buttonStyle(primary = false): CSSProperties {\n return {\n border: `1px solid ${primary ? \"transparent\" : COLOR_BORDER}`,\n borderRadius: 8,\n padding: \"5px 12px\",\n cursor: \"pointer\",\n font: \"inherit\",\n background: primary ? \"var(--dsw-alias-brand-primary)\" : \"transparent\",\n color: primary ? \"var(--dsw-alias-label-primary-foreground)\" : COLOR_TEXT,\n };\n}\n\nfunction tagStyle(color: string): CSSProperties {\n return {\n border: `1px solid ${color}`,\n borderRadius: 999,\n padding: \"1px 8px\",\n color,\n fontSize: 12,\n whiteSpace: \"nowrap\",\n };\n}\n\n/** Whether one row is a package group the plugin manager cannot switch. */\nexport function isNonBundleRow(row: OptionalPluginRow): boolean {\n return row.definition.bundle === undefined;\n}\n\n/** Text for one change result. */\nexport function changeResultText(\n application: BundleChange[\"application\"] | \"error\",\n t: PstackPluginsTranslate,\n reason?: string,\n): string {\n if (application === \"applied\") return t(\"resultApplied\");\n if (application === \"restart-required\") return t(\"resultRestartRequired\");\n if (application === \"failed\" || application === \"error\")\n return t(\"resultFailed\", { reason: reason ?? application });\n if (application === \"overridden\") return t(\"resultOverridden\");\n return t(\"resultCancelled\");\n}\n\nfunction errorText(error: unknown): string {\n if (typeof error === \"object\" && error !== null && \"message\" in error) {\n return String((error as { message: unknown }).message);\n }\n return String(error);\n}\n\n/** Pure view of the recommendation section. */\nexport interface OptionalPluginsViewProps {\n readonly rows: readonly OptionalPluginRow[];\n readonly status: \"loading\" | \"ready\" | \"error\";\n readonly loadError?: string | undefined;\n readonly busyId?: OptionalPluginId | undefined;\n readonly bulkBusy?: boolean | undefined;\n readonly messages: Readonly<\n Record<string, { readonly tone: \"ok\" | \"error\"; readonly text: string }>\n >;\n readonly summary?: string | undefined;\n readonly onToggle: (id: OptionalPluginId, enabled: boolean) => void;\n readonly onEnableRecommended: () => void;\n readonly onRetry: () => void;\n readonly t: PstackPluginsTranslate;\n}\n\n/** Render the recommendation section; all decisions come from props. */\nexport function OptionalPluginsView(props: OptionalPluginsViewProps): ReactElement {\n const {\n rows,\n status,\n loadError,\n busyId,\n bulkBusy = false,\n messages,\n summary,\n onToggle,\n onEnableRecommended,\n onRetry,\n t,\n } = props;\n const offRecommended = rows.filter(\n (row) => row.definition.recommended === true && row.status === \"off\",\n ).length;\n\n return (\n <section\n data-optional-plugins\n style={{\n display: \"grid\",\n gap: 12,\n padding: \"4px 0 18px\",\n color: COLOR_TEXT,\n }}\n >\n <header style={{ display: \"grid\", gap: 6 }}>\n <h3 style={{ margin: 0, fontSize: 16 }}>{t(\"optionalPluginsTitle\")}</h3>\n <p style={{ margin: 0, color: COLOR_SECONDARY, fontSize: 13, lineHeight: 1.5 }}>\n {t(\"optionalPluginsSubtitle\")}\n </p>\n </header>\n\n {status === \"loading\" ? (\n <div style={{ color: COLOR_SECONDARY }}>{t(\"optionalLoading\")}</div>\n ) : status === \"error\" ? (\n <div style={{ display: \"flex\", gap: 10, alignItems: \"center\", color: COLOR_ERROR }}>\n <span>{t(\"optionalLoadFailed\", { message: loadError ?? \"\" })}</span>\n <button type=\"button\" style={buttonStyle()} onClick={onRetry}>\n {t(\"optionalRetry\")}\n </button>\n </div>\n ) : (\n <>\n <div style={{ display: \"flex\", gap: 8, alignItems: \"center\", flexWrap: \"wrap\" }}>\n <button\n type=\"button\"\n style={buttonStyle(true)}\n onClick={onEnableRecommended}\n disabled={bulkBusy || offRecommended === 0}\n >\n {bulkBusy ? t(\"enablingRecommended\") : t(\"enableRecommended\")}\n </button>\n <button type=\"button\" style={buttonStyle()} onClick={onRetry} disabled={bulkBusy}>\n {t(\"optionalRefresh\")}\n </button>\n <span style={{ color: COLOR_CAPTION, fontSize: 12 }}>{t(\"recommendedHint\")}</span>\n </div>\n {summary === undefined ? null : (\n <div data-optional-summary style={{ color: COLOR_SECONDARY, fontSize: 12 }}>\n {summary}\n </div>\n )}\n {OPTIONAL_PLUGIN_GROUPS.map((group) => {\n const groupRows = rows.filter((row) => row.definition.group === group);\n if (groupRows.length === 0) return null;\n return (\n <section key={group} style={{ display: \"grid\", gap: 8 }}>\n <h4 style={{ margin: \"6px 0 0\", fontSize: 13, color: COLOR_SECONDARY }}>\n {t(GROUP_KEY[group])}\n </h4>\n {groupRows.map((row) => (\n <OptionalPluginCard\n key={row.definition.id}\n row={row}\n busy={busyId === row.definition.id || bulkBusy}\n message={messages[row.definition.id]}\n onToggle={onToggle}\n t={t}\n />\n ))}\n </section>\n );\n })}\n </>\n )}\n </section>\n );\n}\n\nfunction OptionalPluginCard(props: {\n readonly row: OptionalPluginRow;\n readonly busy: boolean;\n readonly message: { readonly tone: \"ok\" | \"error\"; readonly text: string } | undefined;\n readonly onToggle: (id: OptionalPluginId, enabled: boolean) => void;\n readonly t: PstackPluginsTranslate;\n}): ReactElement {\n const { row, busy, message, onToggle, t } = props;\n const { definition } = row;\n const copy = COPY[definition.id];\n const nonBundle = isNonBundleRow(row);\n return (\n <article\n data-optional-plugin={definition.id}\n data-optional-status={row.status}\n style={{\n display: \"grid\",\n gap: 8,\n border: `1px solid ${COLOR_BORDER}`,\n borderRadius: 12,\n padding: 12,\n background: COLOR_SURFACE,\n }}\n >\n <header style={{ display: \"flex\", gap: 8, alignItems: \"baseline\", flexWrap: \"wrap\" }}>\n <strong style={{ fontSize: 14 }}>{t(copy.title)}</strong>\n <span style={{ color: COLOR_CAPTION, fontSize: 12 }}>{definition.id}</span>\n <span data-optional-status-label style={tagStyle(statusColor(row.status))}>\n {t(STATUS_KEY[row.status])}\n </span>\n {definition.recommended === true ? (\n <span style={tagStyle(COLOR_SUCCESS)}>{t(\"recommendedTag\")}</span>\n ) : null}\n {definition.suggested === true ? (\n <span style={tagStyle(COLOR_SECONDARY)}>{t(\"suggestedTag\")}</span>\n ) : null}\n {definition.conflict === true ? (\n <span style={tagStyle(COLOR_ERROR)}>{t(\"conflictTag\")}</span>\n ) : null}\n </header>\n <code\n style={{\n color: COLOR_SECONDARY,\n fontSize: 12,\n overflowWrap: \"anywhere\",\n fontFamily: \"var(--dsh-font-family-code)\",\n }}\n >\n {definition.packages.join(\" · \")}\n </code>\n <p style={{ margin: 0, color: COLOR_SECONDARY, fontSize: 12, lineHeight: 1.5 }}>\n {t(copy.detail)}\n </p>\n {definition.conflict === true ? (\n <p role=\"alert\" style={{ margin: 0, color: COLOR_ERROR, fontSize: 12, lineHeight: 1.5 }}>\n {t(\"conflictWarning\")}\n </p>\n ) : null}\n {nonBundle ? (\n <p style={{ margin: 0, color: COLOR_CAPTION, fontSize: 12 }}>{t(\"nonBundleGuidance\")}</p>\n ) : null}\n <footer style={{ display: \"flex\", gap: 8, alignItems: \"center\", flexWrap: \"wrap\" }}>\n {row.canToggle ? (\n <button\n type=\"button\"\n style={buttonStyle()}\n disabled={busy}\n onClick={() => onToggle(definition.id, row.status !== \"enabled\")}\n >\n {row.status === \"enabled\" ? t(\"disablePlugin\") : t(\"enablePlugin\")}\n </button>\n ) : null}\n {busy ? (\n <span style={{ color: COLOR_CAPTION, fontSize: 12 }}>{t(\"pluginWorking\")}</span>\n ) : null}\n {message === undefined ? null : (\n <span\n data-optional-message\n style={{ color: message.tone === \"ok\" ? COLOR_SUCCESS : COLOR_ERROR, fontSize: 12 }}\n >\n {message.text}\n </span>\n )}\n </footer>\n </article>\n );\n}\n\n/** Loads bundle status and owns the recommendation section's two actions. */\nexport function OptionalPluginsSection(\n props: OptionalPluginsFace & PropsLocale<typeof NS>,\n): ReactElement {\n const { optionalPlugins: api, t } = props;\n const [bundles, setBundles] = useState<readonly BundleSnapshot[] | undefined>(undefined);\n const [loadError, setLoadError] = useState<string | undefined>(undefined);\n const [status, setStatus] = useState<\"loading\" | \"ready\" | \"error\">(\"loading\");\n const [busyId, setBusyId] = useState<OptionalPluginId | undefined>(undefined);\n const [bulkBusy, setBulkBusy] = useState(false);\n const [messages, setMessages] = useState<Record<string, { tone: \"ok\" | \"error\"; text: string }>>(\n {},\n );\n const [summary, setSummary] = useState<string | undefined>(undefined);\n const [reloadToken, setReloadToken] = useState(0);\n\n useEffect(() => {\n let cancelled = false;\n setStatus(\"loading\");\n setLoadError(undefined);\n void api.listBundles().then(\n (next) => {\n if (cancelled) return;\n setBundles(next);\n setStatus(\"ready\");\n },\n (error: unknown) => {\n if (cancelled) return;\n setLoadError(errorText(error));\n setStatus(\"error\");\n },\n );\n return () => {\n cancelled = true;\n };\n }, [api, reloadToken]);\n\n const rows = optionalPluginRows(bundles);\n const reload = (): void => setReloadToken((value) => value + 1);\n\n const toggle = (id: OptionalPluginId, enabled: boolean): void => {\n const row = rows.find((candidate) => candidate.definition.id === id);\n const bundle = row?.definition.bundle;\n if (bundle === undefined) return;\n setBusyId(id);\n setMessages((current) => {\n const { [id]: _ignored, ...rest } = current;\n return rest;\n });\n void api.setBundleEnabled(bundle, enabled).then(\n (result) => {\n setBusyId(undefined);\n setMessages((current) => ({\n ...current,\n [id]: {\n tone: result.application === \"failed\" ? \"error\" : \"ok\",\n text: changeResultText(\n result.application,\n t,\n result.error?.diagnostic ?? result.error?.code,\n ),\n },\n }));\n reload();\n },\n (error: unknown) => {\n setBusyId(undefined);\n setMessages((current) => ({\n ...current,\n [id]: { tone: \"error\", text: changeResultText(\"error\", t, errorText(error)) },\n }));\n reload();\n },\n );\n };\n\n const enableAll = (): void => {\n setBulkBusy(true);\n setSummary(undefined);\n setMessages({});\n void enableRecommendedPlugins(api, rows).then((result) => {\n const next: Record<string, { tone: \"ok\" | \"error\"; text: string }> = {};\n for (const outcome of result.outcomes) {\n next[outcome.id] = {\n tone:\n outcome.application === \"failed\" || outcome.application === \"error\" ? \"error\" : \"ok\",\n text: changeResultText(outcome.application, t),\n };\n }\n setMessages(next);\n setSummary(\n t(\"recommendedSummary\", {\n applied: result.applied,\n restart: result.restartRequired,\n failed: result.failed,\n skipped: result.skipped,\n }),\n );\n setBulkBusy(false);\n reload();\n });\n };\n\n return (\n <OptionalPluginsView\n rows={rows}\n status={status}\n loadError={loadError}\n busyId={busyId}\n bulkBusy={bulkBusy}\n messages={messages}\n summary={summary}\n onToggle={toggle}\n onEnableRecommended={enableAll}\n onRetry={reload}\n t={t}\n />\n );\n}\n\n/** Pure view of the one-time activation guidance. */\nexport function OptionalPluginsActivationView(props: {\n readonly count: number;\n readonly onOpen: () => void;\n readonly onDismiss: () => void;\n readonly t: PstackPluginsTranslate;\n}): ReactElement {\n const { count, onOpen, onDismiss, t } = props;\n return (\n <section\n data-optional-activation\n style={{\n display: \"flex\",\n gap: 10,\n alignItems: \"center\",\n flexWrap: \"wrap\",\n border: `1px solid ${COLOR_BORDER}`,\n borderRadius: 12,\n padding: \"10px 12px\",\n background: COLOR_SURFACE,\n color: COLOR_TEXT,\n }}\n >\n <span style={{ fontSize: 13 }}>{t(\"guidanceTitle\", { count })}</span>\n <button type=\"button\" style={buttonStyle(true)} onClick={onOpen}>\n {t(\"guidanceOpen\")}\n </button>\n <button type=\"button\" style={buttonStyle()} onClick={onDismiss}>\n {t(\"guidanceDismiss\")}\n </button>\n </section>\n );\n}\n\n/** One-time guidance shown after dsh-pstack itself is switched on. */\nexport function OptionalPluginsActivation(\n props: PropsRuntime<\"plugins.bundle.activation\"> &\n PropsLocale<typeof NS> &\n InjectFace<OptionalPluginsFace>,\n): ReactElement | null {\n const { optionalPlugins: api, t, onDismiss, onOpenDetails } = props;\n const [count, setCount] = useState<number | undefined>(undefined);\n\n useEffect(() => {\n if (guidanceDismissed(browserStorage())) {\n setCount(0);\n return;\n }\n let cancelled = false;\n void api.listBundles().then(\n (bundles) => {\n if (cancelled) return;\n setCount(remainingRecommendedCount(optionalPluginRows(bundles)));\n },\n () => {\n if (cancelled) return;\n setCount(0);\n },\n );\n return () => {\n cancelled = true;\n };\n }, [api]);\n\n useEffect(() => {\n if (count !== undefined && count > 0) dismissGuidance(browserStorage());\n }, [count]);\n\n if (count === undefined || count === 0) return null;\n return (\n <OptionalPluginsActivationView\n count={count}\n onOpen={() => {\n dismissGuidance(browserStorage());\n onOpenDetails();\n }}\n onDismiss={() => {\n dismissGuidance(browserStorage());\n onDismiss();\n }}\n t={t}\n />\n );\n}\n","/**\n * Pure draft state for the role configuration page.\n *\n * Keeping selection, comparison, and display formatting here lets the browser\n * tests cover every form decision without mounting the Cordis Client tree.\n */\n\nimport type { CatalogueResult, ModelEntry, ProviderEntry } from \"../models.ts\";\nimport type { RoleFileSnapshot, RoleView, RouteView } from \"../internal/role-wire.ts\";\n\n/** One editable route. */\nexport type DraftRoute = RouteView;\n\nexport type RoleDrafts = Readonly<Record<string, readonly DraftRoute[]>>;\n\n/** The implicit value of a role absent from the file. */\nexport function inheritRoute(alias: \"inherit-parent\" | \"auto\" = \"inherit-parent\"): DraftRoute {\n return { kind: \"inherit\", alias };\n}\n\n/** Copy every role into an editable draft, falling back to `inherit-parent`. */\nexport function draftsFromSnapshot(snapshot: RoleFileSnapshot): Record<string, DraftRoute[]> {\n const drafts: Record<string, DraftRoute[]> = {};\n for (const role of snapshot.roles) {\n drafts[role.key] =\n role.routes.length === 0 ? [inheritRoute()] : role.routes.map((route) => ({ ...route }));\n }\n return drafts;\n}\n\n/** Copy one role's current value back into a draft. */\nexport function draftsForRole(role: RoleView): DraftRoute[] {\n return role.routes.length === 0 ? [inheritRoute()] : role.routes.map((route) => ({ ...route }));\n}\n\n/** The exact save payload one card sends. */\nexport function saveRequestFor(\n key: string,\n routes: readonly DraftRoute[],\n): {\n key: string;\n routes: DraftRoute[];\n} {\n return { key, routes: routes.map((route) => ({ ...route })) };\n}\n\n/** Structural comparison used by dirty and reset checks. */\nexport function sameRoutes(left: readonly DraftRoute[], right: readonly DraftRoute[]): boolean {\n if (left.length !== right.length) return false;\n return left.every((route, index) => sameRoute(route, right[index] as DraftRoute));\n}\n\n/** Structural comparison of one route. */\nexport function sameRoute(left: DraftRoute, right: DraftRoute): boolean {\n if (left.kind !== right.kind) return false;\n if (left.kind === \"inherit\" && right.kind === \"inherit\") return left.alias === right.alias;\n if (left.kind === \"route\" && right.kind === \"route\") {\n return (\n left.provider === right.provider && left.model === right.model && left.effort === right.effort\n );\n }\n return false;\n}\n\n/** Display text of one route, matching the role-file grammar. */\nexport function formatRoute(route: DraftRoute): string {\n if (route.kind === \"inherit\") return route.alias;\n return route.effort === undefined\n ? `${route.provider}/${route.model}`\n : `${route.provider}/${route.model} [${route.effort}]`;\n}\n\n/** Replace one route in place. */\nexport function replaceRoute(\n routes: readonly DraftRoute[],\n index: number,\n route: DraftRoute,\n): DraftRoute[] {\n return routes.map((current, position) => (position === index ? route : current));\n}\n\n/** Append one route, defaulting to `inherit-parent` for a new list entry. */\nexport function appendRoute(routes: readonly DraftRoute[]): DraftRoute[] {\n return [...routes, inheritRoute()];\n}\n\n/** Remove one route without ever leaving a list role empty. */\nexport function removeRoute(routes: readonly DraftRoute[], index: number): DraftRoute[] {\n if (routes.length <= 1) return [...routes];\n return routes.filter((_route, position) => position !== index);\n}\n\n/** Provider entries in catalogue order. */\nexport function providerChoices(catalogue: CatalogueResult | undefined): readonly ProviderEntry[] {\n return catalogue?.providers ?? [];\n}\n\n/** The models one provider advertises, or an empty list when the provider is gone. */\nexport function modelChoices(\n catalogue: CatalogueResult | undefined,\n provider: string,\n): readonly ModelEntry[] {\n return catalogue?.providers.find((entry) => entry.provider === provider)?.models ?? [];\n}\n\n/** One model's declared efforts. */\nexport function effortChoices(\n catalogue: CatalogueResult | undefined,\n provider: string,\n model: string,\n): readonly string[] {\n return modelChoices(catalogue, provider).find((entry) => entry.id === model)?.efforts ?? [];\n}\n\n/** Whether the current provider still exists in the live directory. */\nexport function providerKnown(catalogue: CatalogueResult | undefined, provider: string): boolean {\n return catalogue?.providers.some((entry) => entry.provider === provider) ?? false;\n}\n\n/** Client-side shape check; the Host validates providers and efforts on save. */\nexport function draftIssues(role: RoleView, routes: readonly DraftRoute[]): readonly string[] {\n if (routes.length === 0) return [\"keep at least one route\"];\n if (role.shape === \"single\" && routes.length !== 1)\n return [\"a single-route role needs exactly one route\"];\n return [];\n}\n","/** Product copy for the pstack role model configuration page. */\n\nimport type { LocaleCatalog } from \"./i18n.ts\";\n\nexport const NS = \"pstackRoles\";\n\n/** Source dictionary: its key set is the contract every locale must satisfy. */\nconst base = {\n title: \"Role model configuration\",\n subtitle: \"Edit $DSH_HOME/pstack-models.mdc. Saving a role changes only that role.\",\n file: \"File\",\n status: \"Status\",\n statusMissing: \"missing\",\n statusLoaded: \"loaded\",\n statusUnreadable: \"unreadable\",\n budget: \"Budget\",\n fileIssues: \"File issues\",\n line: \"Line {line}\",\n role: \"Role\",\n configuredLine: \"line {line}\",\n notConfigured: \"not configured\",\n inheritParent: \"inherit-parent\",\n auto: \"auto\",\n provider: \"Provider\",\n unavailable: \"unavailable\",\n model: \"Model\",\n effort: \"Effort\",\n effortUnset: \"not set\",\n effortDefault: \"default ({effort})\",\n effortBaselineTitle: \"Effort adapts to the task\",\n effortBaselineIntro:\n \"This is the starting level. It can move up or down as the task changes in difficulty; it is not fixed.\",\n addRoute: \"Add route\",\n removeRoute: \"Remove route\",\n save: \"Save\",\n saving: \"Saving…\",\n saved: \"Saved\",\n reset: \"Reset\",\n resetting: \"Resetting…\",\n loadFailed: \"Could not read the role configuration: {message}\",\n retry: \"Retry\",\n loading: \"Loading role configuration…\",\n unreadableBody: \"This file cannot be edited until it becomes readable: {reason}\",\n noCatalogue: \"The live model directory is unavailable; provider and model lists are empty.\",\n saveRejected: \"Save rejected: {reason}\",\n roleIssues: \"Role file issue: {message}\",\n catalogueUnavailable: \"Model directory unavailable\",\n truncated: \"The model directory was truncated; some providers or models are not listed.\",\n roleFeatureRefactoringName: \"Feature & refactoring\",\n roleFeatureRefactoringDescription: \"For new features and code refactoring.\",\n roleBugFixName: \"Bug fix\",\n roleBugFixDescription: \"For diagnosing and fixing defects.\",\n rolePerfIssueName: \"Performance\",\n rolePerfIssueDescription: \"For investigating and fixing performance issues.\",\n roleHillclimbName: \"Hillclimb\",\n roleHillclimbDescription: \"For iterative improvements guided by measurable results.\",\n roleJudgmentAndProseName: \"Judgment & prose\",\n roleJudgmentAndProseDescription: \"For judgment calls, writing, and refining prose.\",\n roleHardestTasksName: \"Hardest tasks\",\n roleHardestTasksDescription:\n \"For complex design, concurrency, algorithms, and other difficult tasks.\",\n roleHowExplorerName: \"How · explorer\",\n roleHowExplorerDescription: \"For exploring code and tracing how a system works.\",\n roleHowExplainerName: \"How · explainer\",\n roleHowExplainerDescription: \"For explaining architecture and runtime behavior.\",\n roleWhyInvestigatorsName: \"Why · investigators\",\n roleWhyInvestigatorsDescription: \"For gathering evidence about decisions and their rationale.\",\n roleWhySynthesizerName: \"Why · synthesizer\",\n roleWhySynthesizerDescription: \"For synthesizing evidence into a cited explanation.\",\n roleReflectToolingName: \"Reflect · tooling\",\n roleReflectToolingDescription: \"For reviewing tooling lessons from the current session.\",\n roleReflectJudgmentDivergentSynthesizerName: \"Reflect · judgment & synthesis\",\n roleReflectJudgmentDivergentSynthesizerDescription:\n \"For reviewing judgments, challenging conclusions, and synthesizing lessons.\",\n roleArenaRunnersName: \"Arena · runners\",\n roleArenaRunnersDescription: \"For generating competing candidates in parallel.\",\n roleArenaCrossJudgePoolName: \"Arena · judges\",\n roleArenaCrossJudgePoolDescription: \"For independently comparing Arena candidates.\",\n roleSwarmWorkersName: \"Swarm · workers\",\n roleSwarmWorkersDescription: \"For parallel implementation and verification tasks.\",\n roleArchitectRunnersName: \"Architect · runners\",\n roleArchitectRunnersDescription: \"For proposing competing designs before implementation.\",\n roleInterrogateReviewersName: \"Interrogate · reviewers\",\n roleInterrogateReviewersDescription: \"For adversarial review of changes and designs.\",\n} as const;\n\n/** Key union registered with the DSH locale namespace table. */\nexport type PstackRolesLocaleKey = keyof typeof base;\n\ntype RoleTranslate = (key: PstackRolesLocaleKey) => string;\n\n/** Role keys map to the exact locale keys that name and describe them. */\nconst roleCopyKeys: Readonly<\n Record<\n string,\n { readonly name: PstackRolesLocaleKey; readonly description: PstackRolesLocaleKey }\n >\n> = {\n \"feature, refactoring\": {\n name: \"roleFeatureRefactoringName\",\n description: \"roleFeatureRefactoringDescription\",\n },\n \"bug-fix\": { name: \"roleBugFixName\", description: \"roleBugFixDescription\" },\n \"perf-issue\": { name: \"rolePerfIssueName\", description: \"rolePerfIssueDescription\" },\n hillclimb: { name: \"roleHillclimbName\", description: \"roleHillclimbDescription\" },\n \"judgment and prose\": {\n name: \"roleJudgmentAndProseName\",\n description: \"roleJudgmentAndProseDescription\",\n },\n \"hardest tasks\": { name: \"roleHardestTasksName\", description: \"roleHardestTasksDescription\" },\n \"how explorer\": { name: \"roleHowExplorerName\", description: \"roleHowExplorerDescription\" },\n \"how explainer\": { name: \"roleHowExplainerName\", description: \"roleHowExplainerDescription\" },\n \"why investigators\": {\n name: \"roleWhyInvestigatorsName\",\n description: \"roleWhyInvestigatorsDescription\",\n },\n \"why synthesizer\": {\n name: \"roleWhySynthesizerName\",\n description: \"roleWhySynthesizerDescription\",\n },\n \"reflect tooling\": {\n name: \"roleReflectToolingName\",\n description: \"roleReflectToolingDescription\",\n },\n \"reflect judgment, divergent, synthesizer\": {\n name: \"roleReflectJudgmentDivergentSynthesizerName\",\n description: \"roleReflectJudgmentDivergentSynthesizerDescription\",\n },\n \"arena runners\": { name: \"roleArenaRunnersName\", description: \"roleArenaRunnersDescription\" },\n \"arena cross-judge pool\": {\n name: \"roleArenaCrossJudgePoolName\",\n description: \"roleArenaCrossJudgePoolDescription\",\n },\n \"swarm workers\": { name: \"roleSwarmWorkersName\", description: \"roleSwarmWorkersDescription\" },\n \"architect runners\": {\n name: \"roleArchitectRunnersName\",\n description: \"roleArchitectRunnersDescription\",\n },\n \"interrogate reviewers\": {\n name: \"roleInterrogateReviewersName\",\n description: \"roleInterrogateReviewersDescription\",\n },\n};\n\n/** Complete dictionaries, one entry per supported locale. */\nexport const catalogs = {\n en: base,\n zh: {\n title: \"角色模型配置\",\n subtitle: \"编辑 $DSH_HOME/pstack-models.mdc。每次保存只改动你保存的那个角色。\",\n file: \"文件\",\n status: \"状态\",\n statusMissing: \"缺失\",\n statusLoaded: \"已加载\",\n statusUnreadable: \"不可读\",\n budget: \"预算\",\n fileIssues: \"文件问题\",\n line: \"第 {line} 行\",\n role: \"角色\",\n configuredLine: \"第 {line} 行\",\n notConfigured: \"未配置\",\n inheritParent: \"继承父级\",\n auto: \"自动\",\n provider: \"提供方\",\n unavailable: \"不可用\",\n model: \"模型\",\n effort: \"推理强度\",\n effortUnset: \"未指定\",\n effortDefault: \"默认({effort})\",\n effortBaselineTitle: \"推理强度随任务难度调整\",\n effortBaselineIntro: \"这里选择的是起步值,实际强度会根据任务难度上下浮动,不是固定值。\",\n addRoute: \"添加路由\",\n removeRoute: \"删除路由\",\n save: \"保存\",\n saving: \"保存中…\",\n saved: \"已保存\",\n reset: \"重置\",\n resetting: \"重置中…\",\n loadFailed: \"无法读取角色配置:{message}\",\n retry: \"重试\",\n loading: \"正在读取角色配置…\",\n unreadableBody: \"文件可读之前无法编辑:{reason}\",\n noCatalogue: \"实时模型目录不可用,提供方与模型列表为空。\",\n saveRejected: \"保存被拒绝:{reason}\",\n roleIssues: \"角色文件问题:{message}\",\n catalogueUnavailable: \"模型目录不可用\",\n truncated: \"模型目录已截断;部分提供方或模型未显示。\",\n roleFeatureRefactoringName: \"功能开发与重构\",\n roleFeatureRefactoringDescription: \"用于新功能开发和代码重构。\",\n roleBugFixName: \"缺陷修复\",\n roleBugFixDescription: \"用于定位并修复缺陷。\",\n rolePerfIssueName: \"性能优化\",\n rolePerfIssueDescription: \"用于排查并解决性能问题。\",\n roleHillclimbName: \"迭代优化\",\n roleHillclimbDescription: \"用于根据可量化的结果持续改进。\",\n roleJudgmentAndProseName: \"判断与文字\",\n roleJudgmentAndProseDescription: \"用于需要判断、写作或润色的任务。\",\n roleHardestTasksName: \"高难度任务\",\n roleHardestTasksDescription: \"用于复杂设计、并发、算法等高难度任务。\",\n roleHowExplorerName: \"How · 代码探索\",\n roleHowExplorerDescription: \"用于探索代码,梳理系统的工作方式。\",\n roleHowExplainerName: \"How · 原理讲解\",\n roleHowExplainerDescription: \"用于解释架构和运行流程。\",\n roleWhyInvestigatorsName: \"Why · 证据调查\",\n roleWhyInvestigatorsDescription: \"用于调查决策依据并收集证据。\",\n roleWhySynthesizerName: \"Why · 证据综合\",\n roleWhySynthesizerDescription: \"用于综合证据,形成有出处的解释。\",\n roleReflectToolingName: \"Reflect · 工具复盘\",\n roleReflectToolingDescription: \"用于复盘当前会话中的工具使用经验。\",\n roleReflectJudgmentDivergentSynthesizerName: \"Reflect · 判断与综合\",\n roleReflectJudgmentDivergentSynthesizerDescription: \"用于复盘判断、挑战结论并综合经验。\",\n roleArenaRunnersName: \"Arena · 候选方案\",\n roleArenaRunnersDescription: \"用于并行生成相互竞争的候选方案。\",\n roleArenaCrossJudgePoolName: \"Arena · 交叉评审\",\n roleArenaCrossJudgePoolDescription: \"用于独立比较 Arena 的候选方案。\",\n roleSwarmWorkersName: \"Swarm · 并行执行\",\n roleSwarmWorkersDescription: \"用于并行执行实现和验证任务。\",\n roleArchitectRunnersName: \"Architect · 方案设计\",\n roleArchitectRunnersDescription: \"用于在实现前并行提出候选设计。\",\n roleInterrogateReviewersName: \"Interrogate · 对抗评审\",\n roleInterrogateReviewersDescription: \"用于对改动或设计进行对抗性评审。\",\n },\n} satisfies LocaleCatalog<PstackRolesLocaleKey>;\n\n/** Localized role name and usage, keyed by the exact role-file key. */\nexport function rolePresentation(\n key: string,\n t: RoleTranslate,\n): { readonly name: string; readonly description: string } {\n const copy = roleCopyKeys[key];\n return copy === undefined\n ? { name: key, description: \"\" }\n : { name: t(copy.name), description: t(copy.description) };\n}\n","/** Role configuration section inside the bundle configuration dialog for `$DSH_HOME/pstack-models.mdc`. */\n\nimport { useEffect, useState, type CSSProperties, type ReactElement } from \"react\";\nimport type { PropsLocale } from \"@deepseek-ai/dsh-client-ui-slots\";\nimport type {} from \"@deepseek-ai/dsh-client-ui-plugin-manager/client\";\n\nimport type { CatalogueResult } from \"../models.ts\";\nimport type { RoleFileSnapshot, RoleView, SaveRoleRequest } from \"../internal/role-wire.ts\";\nimport {\n appendRoute,\n draftIssues,\n draftsFromSnapshot,\n effortChoices,\n formatRoute,\n inheritRoute,\n modelChoices,\n providerChoices,\n removeRoute,\n replaceRoute,\n sameRoutes,\n saveRequestFor,\n type DraftRoute,\n} from \"./state.ts\";\nimport { NS, rolePresentation, type PstackRolesLocaleKey } from \"./locales.ts\";\n\n/** Translation function supplied by the slot locale. */\nexport type Translate = (\n key: PstackRolesLocaleKey,\n vars?: Record<string, string | number>,\n) => string;\n\n/** Narrow bridge over the mounted Remote namespace. */\nexport interface PstackRolesApi {\n status(): Promise<RoleFileSnapshot>;\n catalogue(): Promise<CatalogueResult>;\n save(\n request: SaveRoleRequest,\n ): Promise<{ ok: true; snapshot: RoleFileSnapshot } | { ok: false; reason: string }>;\n}\n\n/** Props of the pure view used by tests and the slot container. */\nexport interface RoleSettingsViewProps {\n readonly snapshot: RoleFileSnapshot | null;\n readonly catalogue: CatalogueResult | undefined;\n readonly drafts: Readonly<Record<string, readonly DraftRoute[]>>;\n readonly busyKey?: string | undefined;\n readonly messages: Readonly<\n Record<string, { readonly tone: \"ok\" | \"error\"; readonly text: string }>\n >;\n readonly loadError?: string | undefined;\n readonly onRetry: () => void;\n readonly onRouteChange: (key: string, index: number, route: DraftRoute) => void;\n readonly onAddRoute: (key: string) => void;\n readonly onRemoveRoute: (key: string, index: number) => void;\n readonly onSave: (key: string) => void;\n readonly onReset: (key: string) => void;\n readonly t: Translate;\n}\n\nconst COLOR_TEXT = \"var(--dsw-alias-label-primary)\";\nconst COLOR_SECONDARY = \"var(--dsw-alias-label-secondary)\";\nconst COLOR_CAPTION = \"var(--dsw-alias-label-caption)\";\nconst COLOR_BORDER = \"var(--dsw-alias-border-l3)\";\nconst COLOR_SURFACE = \"var(--dsw-alias-bg-layer-1)\";\nconst COLOR_ERROR = \"var(--dsw-alias-state-error-primary)\";\nconst COLOR_SUCCESS = \"var(--dsw-alias-state-success-primary)\";\nconst COLOR_WARN = \"var(--dsw-alias-state-warn-primary)\";\nconst FONT_CODE = \"var(--dsh-font-family-code)\";\n\nfunction statusColor(status: RoleFileSnapshot[\"status\"]): string {\n if (status === \"loaded\") return COLOR_SUCCESS;\n if (status === \"unreadable\") return COLOR_ERROR;\n return COLOR_WARN;\n}\n\nfunction buttonStyle(primary = false): CSSProperties {\n return {\n border: `1px solid ${primary ? \"transparent\" : COLOR_BORDER}`,\n borderRadius: 8,\n padding: \"5px 12px\",\n cursor: \"pointer\",\n font: \"inherit\",\n background: primary ? \"var(--dsw-alias-brand-primary)\" : \"transparent\",\n color: primary ? \"var(--dsw-alias-label-primary-foreground)\" : COLOR_TEXT,\n };\n}\n\nfunction fieldStyle(basis: number, fullWidth = false): CSSProperties {\n return {\n flex: fullWidth ? \"1 1 auto\" : `1 1 ${basis}px`,\n width: fullWidth ? \"100%\" : 0,\n minWidth: 0,\n height: 34,\n padding: \"5px 8px\",\n boxSizing: \"border-box\",\n border: `1px solid ${COLOR_BORDER}`,\n borderRadius: 8,\n background: COLOR_SURFACE,\n color: COLOR_TEXT,\n font: \"inherit\",\n lineHeight: \"22px\",\n textOverflow: \"ellipsis\",\n };\n}\n\nfunction statusLabel(t: Translate, status: RoleFileSnapshot[\"status\"]): string {\n if (status === \"loaded\") return t(\"statusLoaded\");\n if (status === \"unreadable\") return t(\"statusUnreadable\");\n return t(\"statusMissing\");\n}\n\nfunction routeSelection(route: DraftRoute): string {\n return route.kind === \"inherit\" ? `__inherit__:${route.alias}` : route.provider;\n}\n\nfunction fromSelection(selection: string): DraftRoute {\n if (selection === \"__inherit__:inherit-parent\") return inheritRoute(\"inherit-parent\");\n if (selection === \"__inherit__:auto\") return inheritRoute(\"auto\");\n return { kind: \"route\", provider: selection, model: \"\" };\n}\n\nfunction RoleRouteRow(props: {\n readonly role: RoleView;\n readonly index: number;\n readonly route: DraftRoute;\n readonly routes: readonly DraftRoute[];\n readonly catalogue: CatalogueResult | undefined;\n readonly readOnly: boolean;\n readonly onChange: (index: number, route: DraftRoute) => void;\n readonly onRemove: (index: number) => void;\n readonly t: Translate;\n}): ReactElement {\n const { role, index, route, routes, catalogue, readOnly, onChange, onRemove, t } = props;\n const providers = providerChoices(catalogue);\n const models = route.kind === \"route\" ? modelChoices(catalogue, route.provider) : [];\n const efforts =\n route.kind === \"route\" ? effortChoices(catalogue, route.provider, route.model) : [];\n const providerMissing =\n route.kind === \"route\" && !providers.some((entry) => entry.provider === route.provider);\n const modelMissing =\n route.kind === \"route\" &&\n !models.some((entry) => entry.id === route.model) &&\n route.model !== \"\";\n const effortMissing =\n route.kind === \"route\" &&\n route.effort !== undefined &&\n route.effort !== \"\" &&\n !efforts.includes(route.effort);\n\n return (\n <div style={{ display: \"grid\", gap: 8 }}>\n <select\n aria-label={`${role.key} ${t(\"provider\")}`}\n value={routeSelection(route)}\n disabled={readOnly}\n onChange={(event) => {\n const next = fromSelection(event.target.value);\n if (next.kind === \"route\") {\n const firstModel = modelChoices(catalogue, next.provider)[0];\n return onChange(index, {\n ...next,\n model: firstModel?.id ?? \"\",\n ...(firstModel?.defaultEffort === undefined\n ? {}\n : { effort: firstModel.defaultEffort }),\n });\n }\n onChange(index, next);\n }}\n style={fieldStyle(0, true)}\n >\n <option value=\"__inherit__:inherit-parent\">{t(\"inheritParent\")}</option>\n <option value=\"__inherit__:auto\">{t(\"auto\")}</option>\n {providers.map((provider) => (\n <option key={provider.provider} value={provider.provider}>\n {provider.name === provider.provider\n ? provider.provider\n : `${provider.name} (${provider.provider})`}\n </option>\n ))}\n {providerMissing ? (\n <option value={route.provider}>{`${route.provider} (${t(\"unavailable\")})`}</option>\n ) : null}\n </select>\n\n {route.kind === \"route\" ? (\n <div style={{ display: \"flex\", gap: 8, alignItems: \"center\", flexWrap: \"wrap\" }}>\n <select\n aria-label={`${role.key} ${t(\"model\")}`}\n value={route.model}\n disabled={readOnly}\n onChange={(event) => {\n const model = event.target.value;\n const entry = models.find((candidate) => candidate.id === model);\n onChange(index, {\n kind: \"route\",\n provider: route.provider,\n model,\n ...(entry?.defaultEffort === undefined ? {} : { effort: entry.defaultEffort }),\n });\n }}\n style={fieldStyle(220)}\n >\n <option value=\"\" disabled>\n {t(\"model\")}\n </option>\n {models.map((model) => (\n <option key={model.id} value={model.id}>\n {model.id}\n </option>\n ))}\n {modelMissing ? <option value={route.model}>{route.model}</option> : null}\n </select>\n <select\n aria-label={`${role.key} ${t(\"effort\")}`}\n value={route.effort ?? \"\"}\n disabled={readOnly}\n onChange={(event) => {\n const effort = event.target.value;\n onChange(index, {\n kind: \"route\",\n provider: route.provider,\n model: route.model,\n ...(effort === \"\" ? {} : { effort }),\n });\n }}\n style={fieldStyle(140)}\n >\n <option value=\"\">{t(\"effortUnset\")}</option>\n {efforts.map((effort) => {\n const model = models.find((candidate) => candidate.id === route.model);\n const defaultEffort = model?.defaultEffort === effort;\n return (\n <option key={effort} value={effort}>\n {defaultEffort ? t(\"effortDefault\", { effort }) : effort}\n </option>\n );\n })}\n {effortMissing ? <option value={route.effort}>{route.effort}</option> : null}\n </select>\n </div>\n ) : null}\n\n {routes.length > 1 ? (\n <button\n type=\"button\"\n style={{ ...buttonStyle(), justifySelf: \"start\" }}\n onClick={() => onRemove(index)}\n disabled={readOnly}\n >\n {t(\"removeRoute\")}\n </button>\n ) : null}\n </div>\n );\n}\n\nfunction RoleCard(props: {\n readonly role: RoleView;\n readonly routes: readonly DraftRoute[];\n readonly catalogue: CatalogueResult | undefined;\n readonly busy: boolean;\n readonly readOnly: boolean;\n readonly message: { readonly tone: \"ok\" | \"error\"; readonly text: string } | undefined;\n readonly onRouteChange: (index: number, route: DraftRoute) => void;\n readonly onAddRoute: () => void;\n readonly onRemoveRoute: (index: number) => void;\n readonly onSave: () => void;\n readonly onReset: () => void;\n readonly t: Translate;\n}): ReactElement {\n const {\n role,\n routes,\n catalogue,\n busy,\n readOnly,\n message,\n onRouteChange,\n onAddRoute,\n onRemoveRoute,\n onSave,\n onReset,\n t,\n } = props;\n const issues = draftIssues(role, routes);\n const roleText = rolePresentation(role.key, t);\n const canReset =\n routes.length !== 1 || routes[0]?.kind !== \"inherit\" || routes[0]?.alias !== \"inherit-parent\";\n\n return (\n <section\n style={{\n border: `1px solid ${COLOR_BORDER}`,\n borderRadius: 12,\n padding: 14,\n display: \"grid\",\n gap: 10,\n background: COLOR_SURFACE,\n }}\n >\n <header style={{ display: \"grid\", gap: 5 }}>\n <div style={{ display: \"flex\", gap: 10, alignItems: \"baseline\", flexWrap: \"wrap\" }}>\n <strong style={{ color: COLOR_TEXT, fontSize: 14 }}>{roleText.name}</strong>\n <code style={{ color: COLOR_CAPTION, fontFamily: FONT_CODE, fontSize: 11 }}>\n {role.key}\n </code>\n <span style={{ color: COLOR_CAPTION, fontSize: 12 }}>\n {role.configured ? t(\"configuredLine\", { line: role.line ?? \"?\" }) : t(\"notConfigured\")}\n </span>\n </div>\n <p style={{ margin: 0, color: COLOR_SECONDARY, fontSize: 12, lineHeight: 1.5 }}>\n {roleText.description}\n </p>\n </header>\n <code style={{ color: COLOR_SECONDARY, fontFamily: FONT_CODE, fontSize: 12 }}>\n {readOnly ? t(\"statusUnreadable\") : routes.map((route) => formatRoute(route)).join(\" · \")}\n </code>\n {role.issues.map((issue, index) => (\n <div key={`${issue}-${index}`} style={{ color: COLOR_ERROR, fontSize: 12 }}>\n {t(\"roleIssues\", { message: issue })}\n </div>\n ))}\n {readOnly\n ? null\n : routes.map((route, index) => (\n <RoleRouteRow\n key={index}\n role={role}\n index={index}\n route={route}\n routes={routes}\n catalogue={catalogue}\n readOnly={readOnly}\n onChange={onRouteChange}\n onRemove={onRemoveRoute}\n t={t}\n />\n ))}\n {issues.map((issue, index) => (\n <div key={`${issue}-${index}`} style={{ color: COLOR_ERROR, fontSize: 12 }}>\n {issue}\n </div>\n ))}\n <footer style={{ display: \"flex\", gap: 8, alignItems: \"center\", flexWrap: \"wrap\" }}>\n {role.shape === \"list\" && !readOnly ? (\n <button type=\"button\" style={buttonStyle()} onClick={onAddRoute} disabled={busy}>\n {t(\"addRoute\")}\n </button>\n ) : null}\n <button\n type=\"button\"\n style={buttonStyle(true)}\n onClick={onSave}\n disabled={readOnly || busy || issues.length > 0}\n >\n {busy ? t(\"saving\") : t(\"save\")}\n </button>\n <button\n type=\"button\"\n style={buttonStyle()}\n onClick={onReset}\n disabled={readOnly || busy || !canReset}\n >\n {busy ? t(\"resetting\") : t(\"reset\")}\n </button>\n {message === undefined ? null : (\n <span\n style={{ color: message.tone === \"ok\" ? COLOR_SUCCESS : COLOR_ERROR, fontSize: 12 }}\n >\n {message.text}\n </span>\n )}\n </footer>\n </section>\n );\n}\n\nfunction RoleEffortNote({ t }: { readonly t: Translate }): ReactElement {\n return (\n <section\n style={{\n border: `1px solid ${COLOR_BORDER}`,\n borderRadius: 12,\n padding: \"12px 14px\",\n display: \"grid\",\n gap: 6,\n background: COLOR_SURFACE,\n color: COLOR_SECONDARY,\n fontSize: 12,\n lineHeight: 1.5,\n }}\n >\n <strong style={{ color: COLOR_TEXT, fontSize: 13 }}>{t(\"effortBaselineTitle\")}</strong>\n <p style={{ margin: 0 }}>{t(\"effortBaselineIntro\")}</p>\n </section>\n );\n}\n\n/** Pure view: all rendering decisions are explicit props. */\nexport function RoleSettingsView(props: RoleSettingsViewProps): ReactElement {\n const { snapshot, catalogue, drafts, busyKey, messages, loadError, onRetry, t } = props;\n return (\n <div style={{ display: \"grid\", gap: 16, padding: \"4px 0 20px\", color: COLOR_TEXT }}>\n <header style={{ display: \"grid\", gap: 6 }}>\n <h3 style={{ margin: 0, fontSize: 16 }}>{t(\"title\")}</h3>\n <p style={{ margin: 0, color: COLOR_SECONDARY, fontSize: 13, lineHeight: 1.5 }}>\n {t(\"subtitle\")}\n </p>\n </header>\n\n <RoleEffortNote t={t} />\n\n {snapshot === null ? (\n <div style={{ display: \"flex\", gap: 10, alignItems: \"center\", color: COLOR_SECONDARY }}>\n {loadError === undefined ? t(\"loading\") : t(\"loadFailed\", { message: loadError })}\n {loadError === undefined ? null : (\n <button type=\"button\" style={buttonStyle()} onClick={onRetry}>\n {t(\"retry\")}\n </button>\n )}\n </div>\n ) : (\n <>\n <section\n style={{\n border: `1px solid ${COLOR_BORDER}`,\n borderRadius: 12,\n padding: 14,\n display: \"grid\",\n gap: 6,\n background: COLOR_SURFACE,\n }}\n >\n <div style={{ display: \"flex\", gap: 8, alignItems: \"baseline\", flexWrap: \"wrap\" }}>\n <span style={{ fontSize: 12, color: COLOR_CAPTION }}>{t(\"file\")}</span>\n <code style={{ fontFamily: FONT_CODE, fontSize: 12, overflowWrap: \"anywhere\" }}>\n {snapshot.path}\n </code>\n <span\n style={{\n fontSize: 12,\n padding: \"1px 8px\",\n borderRadius: 999,\n border: `1px solid ${statusColor(snapshot.status)}`,\n color: statusColor(snapshot.status),\n }}\n >\n {statusLabel(t, snapshot.status)}\n </span>\n </div>\n {snapshot.budget === undefined ? null : (\n <div style={{ fontSize: 12, color: COLOR_SECONDARY }}>\n {t(\"budget\")}: <code style={{ fontFamily: FONT_CODE }}>{snapshot.budget}</code>\n </div>\n )}\n {snapshot.status === \"unreadable\" ? (\n <div style={{ fontSize: 12, color: COLOR_ERROR }}>\n {t(\"unreadableBody\", { reason: snapshot.reason ?? \"\" })}\n </div>\n ) : null}\n </section>\n\n {snapshot.issues.length === 0 ? null : (\n <section style={{ display: \"grid\", gap: 4 }}>\n <strong style={{ fontSize: 13 }}>{t(\"fileIssues\")}</strong>\n {snapshot.issues.map((issue, index) => (\n <div key={`${issue.message}-${index}`} style={{ color: COLOR_ERROR, fontSize: 12 }}>\n {issue.line === undefined\n ? issue.message\n : `${t(\"line\", { line: issue.line })}: ${issue.message}`}\n </div>\n ))}\n </section>\n )}\n\n {catalogue === undefined || catalogue.providers.length === 0 ? (\n <div style={{ color: COLOR_WARN, fontSize: 12 }}>{t(\"noCatalogue\")}</div>\n ) : catalogue.truncated ? (\n <div style={{ color: COLOR_CAPTION, fontSize: 12 }}>{t(\"truncated\")}</div>\n ) : null}\n\n <div style={{ display: \"grid\", gap: 10 }}>\n {snapshot.roles.map((role) => (\n <RoleCard\n key={role.key}\n role={role}\n routes={drafts[role.key] ?? [inheritRoute()]}\n catalogue={catalogue}\n busy={busyKey === role.key}\n readOnly={!snapshot.canSave}\n message={messages[role.key]}\n onRouteChange={(index, route) => props.onRouteChange(role.key, index, route)}\n onAddRoute={() => props.onAddRoute(role.key)}\n onRemoveRoute={(index) => props.onRemoveRoute(role.key, index)}\n onSave={() => props.onSave(role.key)}\n onReset={() => props.onReset(role.key)}\n t={t}\n />\n ))}\n </div>\n </>\n )}\n </div>\n );\n}\n\nfunction remoteError(error: unknown): string {\n if (typeof error === \"object\" && error !== null && \"message\" in error) {\n return String((error as { message: unknown }).message);\n }\n return String(error);\n}\n\n/** Props of the role configuration section rendered inside the bundle config dialog. */\nexport type RoleSettingsPageProps = PropsLocale<typeof NS> & {\n readonly api: PstackRolesApi;\n};\n\n/** Section container: owns loading, drafts, and the two Remote calls. */\nexport function RoleSettingsPage(props: RoleSettingsPageProps): ReactElement {\n const { api, t } = props;\n const [snapshot, setSnapshot] = useState<RoleFileSnapshot | null>(null);\n const [catalogue, setCatalogue] = useState<CatalogueResult | undefined>(undefined);\n const [drafts, setDrafts] = useState<Record<string, readonly DraftRoute[]>>({});\n const [messages, setMessages] = useState<Record<string, { tone: \"ok\" | \"error\"; text: string }>>(\n {},\n );\n const [busyKey, setBusyKey] = useState<string | undefined>(undefined);\n const [loadError, setLoadError] = useState<string | undefined>(undefined);\n const [reloadToken, setReloadToken] = useState(0);\n\n useEffect(() => {\n let cancelled = false;\n setLoadError(undefined);\n void Promise.all([api.status(), api.catalogue()]).then(\n ([nextSnapshot, nextCatalogue]) => {\n if (cancelled) return;\n setSnapshot(nextSnapshot);\n setCatalogue(nextCatalogue);\n setDrafts(draftsFromSnapshot(nextSnapshot));\n },\n (error: unknown) => {\n if (cancelled) return;\n setLoadError(remoteError(error));\n },\n );\n return () => {\n cancelled = true;\n };\n }, [api, reloadToken]);\n\n const updateRole = (key: string, next: readonly DraftRoute[]): void => {\n setDrafts((current) => ({ ...current, [key]: next }));\n setMessages((current) => {\n const { [key]: _ignored, ...rest } = current;\n return rest;\n });\n };\n\n const save = (key: string, routes: readonly DraftRoute[]): void => {\n setBusyKey(key);\n setMessages((current) => {\n const { [key]: _ignored, ...rest } = current;\n return rest;\n });\n void api.save(saveRequestFor(key, routes)).then(\n (result) => {\n setBusyKey(undefined);\n if (!result.ok) {\n setMessages((current) => ({\n ...current,\n [key]: { tone: \"error\", text: t(\"saveRejected\", { reason: result.reason }) },\n }));\n return;\n }\n setSnapshot(result.snapshot);\n setDrafts((current) => ({\n ...current,\n [key]: draftsFromSnapshot(result.snapshot)[key] ?? [inheritRoute()],\n }));\n setMessages((current) => ({ ...current, [key]: { tone: \"ok\", text: t(\"saved\") } }));\n },\n (error: unknown) => {\n setBusyKey(undefined);\n setMessages((current) => ({\n ...current,\n [key]: { tone: \"error\", text: t(\"saveRejected\", { reason: remoteError(error) }) },\n }));\n },\n );\n };\n\n return (\n <RoleSettingsView\n snapshot={snapshot}\n catalogue={catalogue}\n drafts={drafts}\n busyKey={busyKey}\n messages={messages}\n loadError={loadError}\n onRetry={() => setReloadToken((value) => value + 1)}\n onRouteChange={(key, index, route) => {\n const current = drafts[key] ?? [inheritRoute()];\n updateRole(key, replaceRoute(current, index, route));\n }}\n onAddRoute={(key) => updateRole(key, appendRoute(drafts[key] ?? [inheritRoute()]))}\n onRemoveRoute={(key, index) =>\n updateRole(key, removeRoute(drafts[key] ?? [inheritRoute()], index))\n }\n onSave={(key) => save(key, drafts[key] ?? [inheritRoute()])}\n onReset={(key) => save(key, [inheritRoute()])}\n t={t}\n />\n );\n}\n\n/** Whether one card differs from the saved value; exported for the container's tests. */\nexport function isRoleDirty(role: RoleView, routes: readonly DraftRoute[]): boolean {\n return !sameRoutes(role.routes.length === 0 ? [inheritRoute()] : role.routes, routes);\n}\n\n/** Formatting helper shared with tests and the page. */\nexport function routeText(route: DraftRoute): string {\n return formatRoute(route);\n}\n","/**\n * Configure action and Settings-style dialog for the dsh-pstack bundle detail\n * page.\n *\n * The bundle's configuration used to render inline on the detail page. It now\n * opens from the detail page header through `plugins.detail.actions`: the\n * action renders only for the dsh-pstack bundle, and the dialog keeps the\n * plugin manager's page untouched while it is open.\n */\n\nimport { useEffect, useId, useState, type CSSProperties, type ReactElement } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport type { InjectFace, PropsLocale, PropsRuntime } from \"@deepseek-ai/dsh-client-ui-slots\";\nimport type {} from \"@deepseek-ai/dsh-client-ui-plugin-manager/client\";\n\nimport { OptionalPluginsSection, type OptionalPluginsFace } from \"./OptionalPluginsPage.tsx\";\nimport {\n RoleSettingsPage,\n type PstackRolesApi,\n type RoleSettingsPageProps,\n} from \"./RoleSettingsPage.tsx\";\nimport { NS, type PstackPluginsTranslate } from \"./optional-plugins-locales.ts\";\n\nconst COLOR_TEXT = \"var(--dsw-alias-label-primary)\";\n\nconst overlayStyle: CSSProperties = {\n position: \"fixed\",\n inset: 0,\n zIndex: 1000,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n};\n\nconst maskStyle: CSSProperties = {\n position: \"absolute\",\n inset: 0,\n background: \"var(--dsw-alias-bg-mask-1)\",\n backdropFilter: \"var(--dsw-mask-blur)\",\n};\n\nconst panelStyle: CSSProperties = {\n position: \"relative\",\n zIndex: 1,\n display: \"grid\",\n gridTemplateColumns: \"204px minmax(0, 1fr)\",\n gridTemplateRows: \"auto minmax(0, 1fr)\",\n gridTemplateAreas: \"'title header' 'nav options'\",\n width: 800,\n height: \"min(800px, calc(100vh - 48px))\",\n maxWidth: \"calc(100vw - 48px)\",\n borderRadius: \"var(--dsw-radius-panel)\",\n overflow: \"hidden\",\n background: \"var(--dsw-alias-bg-layer-2)\",\n boxShadow: \"var(--dsw-elevation-prominent)\",\n color: COLOR_TEXT,\n};\n\nconst navTitleStyle: CSSProperties = {\n gridArea: \"title\",\n padding: \"22px 12px 8px 24px\",\n fontSize: 16,\n lineHeight: \"24px\",\n fontWeight: 500,\n color: COLOR_TEXT,\n};\n\nconst navStyle: CSSProperties = {\n gridArea: \"nav\",\n minWidth: 0,\n minHeight: 0,\n display: \"flex\",\n flexDirection: \"column\",\n padding: \"10px 12px 0\",\n boxSizing: \"border-box\",\n};\n\nconst navListStyle: CSSProperties = {\n display: \"flex\",\n flexDirection: \"column\",\n gap: 4,\n minHeight: 0,\n overflowY: \"auto\",\n};\n\nconst navLabelStyle: CSSProperties = {\n flex: 1,\n minWidth: 0,\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n textOverflow: \"ellipsis\",\n};\n\nconst headerStyle: CSSProperties = {\n gridArea: \"header\",\n display: \"flex\",\n alignItems: \"flex-start\",\n justifyContent: \"flex-end\",\n height: 54,\n padding: \"20px 14px 8px 10px\",\n boxSizing: \"border-box\",\n};\n\nconst closeStyle: CSSProperties = {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: 28,\n height: 28,\n padding: 0,\n border: \"none\",\n borderRadius: \"var(--dsw-radius-sm)\",\n background: \"transparent\",\n cursor: \"pointer\",\n color: COLOR_TEXT,\n};\n\nconst optionsStyle: CSSProperties = {\n gridArea: \"options\",\n minWidth: 0,\n minHeight: 0,\n padding: \"0 24px 24px\",\n overflowY: \"auto\",\n};\n\nfunction actionButtonStyle(): CSSProperties {\n return {\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 6,\n height: 28,\n padding: \"0 12px\",\n border: \"0.5px solid transparent\",\n borderRadius: \"var(--dsw-radius-sm)\",\n boxShadow: \"inset 0 0 0 var(--dsh-hairline-width, 0.5px) var(--dsw-alias-border-l3)\",\n background: \"transparent\",\n color: COLOR_TEXT,\n cursor: \"pointer\",\n font: \"inherit\",\n fontSize: 12,\n lineHeight: \"18px\",\n whiteSpace: \"nowrap\",\n };\n}\n\nfunction navCellStyle(active: boolean): CSSProperties {\n return {\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n height: 40,\n padding: \"9px 16px 9px 12px\",\n boxSizing: \"border-box\",\n border: \"none\",\n borderRadius: \"var(--dsw-radius-md)\",\n background: active ? \"var(--dsw-specific-sidebar-nav-item-active)\" : \"transparent\",\n cursor: \"pointer\",\n fontFamily: \"inherit\",\n fontSize: 14,\n lineHeight: \"22px\",\n fontWeight: 400,\n color: COLOR_TEXT,\n textAlign: \"left\",\n };\n}\n\n/** The two configuration sections the dialog switches between. */\nexport type PstackBundleConfigSection = \"plugins\" | \"roles\";\n\n/** Injection face shared by the detail action and the dialog view. */\nexport interface PstackBundleConfigFace {\n readonly api: PstackRolesApi;\n readonly optionalPlugins: OptionalPluginsFace[\"optionalPlugins\"];\n readonly rolesT: RoleSettingsPageProps[\"t\"];\n}\n\n/** Props of the bundle header action registered into `plugins.detail.actions`. */\nexport type PstackBundleConfigActionProps = PropsRuntime<\"plugins.detail.actions\"> &\n PropsLocale<typeof NS> &\n InjectFace<PstackBundleConfigFace>;\n\n/** Props of the pure Settings-style dialog view used by tests and the container. */\nexport interface PstackBundleConfigDialogViewProps {\n readonly active: PstackBundleConfigSection;\n readonly onSelect: (section: PstackBundleConfigSection) => void;\n readonly onClose: () => void;\n readonly api: PstackRolesApi;\n readonly optionalPlugins: OptionalPluginsFace[\"optionalPlugins\"];\n readonly rolesT: RoleSettingsPageProps[\"t\"];\n readonly pluginsT: PstackPluginsTranslate;\n}\n\n/** Header action that opens the configuration dialog for the dsh-pstack bundle only. */\nexport function PstackBundleConfigAction(\n props: PstackBundleConfigActionProps,\n): ReactElement | null {\n const [open, setOpen] = useState(false);\n if (props.subject.kind !== \"bundle\" || props.subject.pkg.name !== \"dsh-pstack\") return null;\n return (\n <>\n <PstackConfigureButton t={props.t} onClick={() => setOpen(true)} />\n {open ? (\n <PstackBundleConfigDialog\n api={props.api}\n optionalPlugins={props.optionalPlugins}\n rolesT={props.rolesT}\n pluginsT={props.t}\n onClose={() => setOpen(false)}\n />\n ) : null}\n </>\n );\n}\n\nfunction GearIcon(): ReactElement {\n return (\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n <path d=\"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33h.09a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82v.09a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z\" />\n </svg>\n );\n}\n\n/** Small outlined button that opens the dialog. */\nexport function PstackConfigureButton(props: {\n readonly t: PstackPluginsTranslate;\n readonly onClick: () => void;\n}): ReactElement {\n return (\n <button\n type=\"button\"\n data-pstack-configure-action\n style={actionButtonStyle()}\n onClick={props.onClick}\n >\n <GearIcon />\n <span>{props.t(\"configureAction\")}</span>\n </button>\n );\n}\n\n/** Portaled container: owns the active section and the Escape key. */\nexport function PstackBundleConfigDialog(\n props: Omit<PstackBundleConfigDialogViewProps, \"active\" | \"onSelect\">,\n): ReactElement {\n const [active, setActive] = useState<PstackBundleConfigSection>(\"plugins\");\n const { onClose } = props;\n useEffect(() => {\n const onKeyDown = (event: KeyboardEvent): void => {\n if (event.key === \"Escape\") onClose();\n };\n document.addEventListener(\"keydown\", onKeyDown);\n return () => document.removeEventListener(\"keydown\", onKeyDown);\n }, [onClose]);\n return createPortal(\n <PstackBundleConfigDialogView\n {...props}\n active={active}\n onSelect={(section) => setActive(section)}\n />,\n document.body,\n );\n}\n\nfunction CloseIcon(): ReactElement {\n return (\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <path\n d=\"M2 2l10 10M12 2L2 12\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\n/** Pure view of the Settings-style modal: mask, centered card, nav rail, and section body. */\nexport function PstackBundleConfigDialogView(\n props: PstackBundleConfigDialogViewProps,\n): ReactElement {\n const { active, onSelect, onClose, api, optionalPlugins, rolesT, pluginsT } = props;\n const titleId = useId();\n const sections: readonly { readonly id: PstackBundleConfigSection; readonly label: string }[] = [\n { id: \"plugins\", label: pluginsT(\"configurePluginsSection\") },\n { id: \"roles\", label: pluginsT(\"configureRolesSection\") },\n ];\n return (\n <div style={overlayStyle} role=\"presentation\" data-pstack-config-dialog>\n <div style={maskStyle} aria-hidden=\"true\" onClick={onClose} />\n <div role=\"dialog\" aria-modal=\"true\" aria-labelledby={titleId} style={panelStyle}>\n <div id={titleId} style={navTitleStyle}>\n {pluginsT(\"configureTitle\")}\n </div>\n <nav aria-label={pluginsT(\"configureSections\")} style={navStyle}>\n <div style={navListStyle}>\n {sections.map((section) => (\n <button\n key={section.id}\n type=\"button\"\n style={navCellStyle(section.id === active)}\n aria-current={section.id === active ? \"true\" : undefined}\n autoFocus={section.id === active}\n data-pstack-config-section-tab={section.id}\n onClick={() => onSelect(section.id)}\n >\n <span style={navLabelStyle}>{section.label}</span>\n </button>\n ))}\n </div>\n </nav>\n <div style={headerStyle}>\n <button\n type=\"button\"\n aria-label={pluginsT(\"configureClose\")}\n style={closeStyle}\n onClick={onClose}\n >\n <CloseIcon />\n </button>\n </div>\n <div style={optionsStyle} data-pstack-config-section={active}>\n {active === \"plugins\" ? (\n <OptionalPluginsSection optionalPlugins={optionalPlugins} t={pluginsT} />\n ) : (\n <RoleSettingsPage api={api} t={rolesT} />\n )}\n </div>\n </div>\n </div>\n );\n}\n","/** Product copy for the pstack recommended optional plugins section. */\n\nimport type { TranslateNS } from \"@deepseek-ai/dsh-client-ui-slots\";\n\nimport type { LocaleCatalog } from \"./i18n.ts\";\n\nexport const NS = \"pstackPlugins\";\n\n/** Source dictionary: its key set is the contract every locale must satisfy. */\nconst base = {\n configureAction: \"Configure\",\n configureTitle: \"Configure dsh-pstack\",\n configureSections: \"Configuration sections\",\n configurePluginsSection: \"Recommended plugins\",\n configureRolesSection: \"Role configuration\",\n configureClose: \"Close\",\n optionalPluginsTitle: \"Recommended plugins\",\n optionalPluginsSubtitle:\n \"Optional DSH plugins that complete pstack flows. Nothing is enabled automatically; turn on only what you need.\",\n groupSessions: \"Sessions and isolation\",\n groupVerification: \"Verification and evidence\",\n groupMultiAgent: \"Multi-agent\",\n recommendedTag: \"Recommended\",\n suggestedTag: \"GitHub PR suggestion\",\n conflictTag: \"Conflict\",\n optionalLoading: \"Loading optional plugin status…\",\n optionalLoadFailed: \"Could not read optional plugin status: {message}\",\n optionalRetry: \"Retry\",\n optionalRefresh: \"Refresh\",\n enableRecommended: \"Enable recommended plugins\",\n enablingRecommended: \"Enabling recommended plugins…\",\n recommendedSummary:\n \"{applied} applied, {restart} need a restart, {failed} failed, {skipped} skipped\",\n recommendedHint: \"Default recommendations: OPT-01, OPT-06.\",\n enablePlugin: \"Enable\",\n disablePlugin: \"Disable\",\n pluginWorking: \"Working…\",\n pluginStatusEnabled: \"enabled\",\n pluginStatusOff: \"off\",\n pluginStatusMissing: \"missing\",\n pluginStatusUnsupportedPlatform: \"unsupported-platform\",\n pluginStatusError: \"error\",\n resultApplied: \"Applied\",\n resultRestartRequired: \"Restart required\",\n resultFailed: \"Failed: {reason}\",\n resultOverridden: \"Overridden by a higher layer\",\n resultCancelled: \"Cancelled\",\n conflictWarning:\n \"Do not enable Agent Teams and pstack_subagent in one profile: Agent Teams disables subagent and subagent_fork and replaces the child controls.\",\n nonBundleGuidance:\n \"Not a bundle: configure it in the DSH documentation; this page cannot switch it.\",\n guidanceTitle: \"{count} recommended plugins are still off\",\n guidanceOpen: \"Review recommended plugins\",\n guidanceDismiss: \"Dismiss\",\n opt01Title: \"Worktree isolation\",\n opt01Detail:\n \"Creates local worktrees for /arena, /swarm, and /architect; the worktree tool changes the Session directory.\",\n opt02Title: \"GitHub PR workspace\",\n opt02Detail:\n \"PR panels, checks, reviews, ready state, and merge for /babysit, /shipping, and /autopilot-*; needs a logged-in gh.\",\n opt03Title: \"Browser verification\",\n opt03Detail:\n \"Browser navigation, input, screenshots, and ARIA snapshots; pick one provider and a supported model.\",\n opt04Title: \"Computer use\",\n opt04Detail:\n \"macOS desktop clicking, typing, screenshots, and permission pages in a PTC Session.\",\n opt05Title: \"Persistent terminal\",\n opt05Detail:\n \"Six global terminal tools keep a shell or REPL alive across calls for CLI and TUI verification.\",\n opt06Title: \"Session search\",\n opt06Detail: \"Five read-only tools search and trace earlier Sessions with the same cwd.\",\n opt07Title: \"MCP client\",\n opt07Detail: \"Mounts MCP servers as mcp__<server>__<tool> for /why and /teach evidence work.\",\n opt08Title: \"Agent Teams\",\n opt08Detail:\n \"Lead and teammate roles, a shared task board, and nine team tools; conflicts with pstack_subagent.\",\n opt09Title: \"Ralph loop\",\n opt09Detail: \"A foreground ralph loop starts a fresh child each round for /autonomous-run.\",\n} as const;\n\n/** Key union registered with the DSH locale namespace table. */\nexport type PstackPluginsLocaleKey = keyof typeof base;\n\n/** Translation function supplied by the pstackPlugins locale namespace. */\nexport type PstackPluginsTranslate = TranslateNS<typeof NS>;\n\n/** Complete dictionaries, one entry per supported locale. */\nexport const catalogs = {\n en: base,\n zh: {\n configureAction: \"配置\",\n configureTitle: \"配置 dsh-pstack\",\n configureSections: \"配置分区\",\n configurePluginsSection: \"推荐插件\",\n configureRolesSection: \"角色配置\",\n configureClose: \"关闭\",\n optionalPluginsTitle: \"推荐插件\",\n optionalPluginsSubtitle:\n \"补全 pstack 流程的可选 DSH 插件。页面不会自动启用任何插件,只按需开启。\",\n groupSessions: \"会话与隔离\",\n groupVerification: \"验证与证据\",\n groupMultiAgent: \"多代理\",\n recommendedTag: \"推荐\",\n suggestedTag: \"GitHub PR 用户建议\",\n conflictTag: \"冲突\",\n optionalLoading: \"正在读取可选插件状态…\",\n optionalLoadFailed: \"无法读取可选插件状态:{message}\",\n optionalRetry: \"重试\",\n optionalRefresh: \"刷新\",\n enableRecommended: \"一键启用推荐项\",\n enablingRecommended: \"正在启用推荐项…\",\n recommendedSummary:\n \"成功 {applied} 项,需重启 {restart} 项,失败 {failed} 项,跳过 {skipped} 项\",\n recommendedHint: \"默认推荐 OPT-01、OPT-06。\",\n enablePlugin: \"启用\",\n disablePlugin: \"关闭\",\n pluginWorking: \"处理中…\",\n pluginStatusEnabled: \"已启用\",\n pluginStatusOff: \"未启用\",\n pluginStatusMissing: \"缺失\",\n pluginStatusUnsupportedPlatform: \"平台不支持\",\n pluginStatusError: \"错误\",\n resultApplied: \"已生效\",\n resultRestartRequired: \"需要重启\",\n resultFailed: \"失败:{reason}\",\n resultOverridden: \"被更高层覆盖\",\n resultCancelled: \"已取消\",\n conflictWarning:\n \"不要在同一 profile 中同时启用 Agent Teams 与 pstack_subagent:Agent Teams 会禁用 subagent 和 subagent_fork,并替换子代理控制。\",\n nonBundleGuidance: \"非 bundle 项:请按 DSH 文档配置,本页不提供开关。\",\n guidanceTitle: \"还有 {count} 个推荐插件未开启\",\n guidanceOpen: \"查看推荐插件\",\n guidanceDismiss: \"忽略\",\n opt01Title: \"工作树隔离\",\n opt01Detail:\n \"为 /arena、/swarm 和 /architect 创建本地工作树;worktree 工具会切换 Session 目录。\",\n opt02Title: \"GitHub PR 工作区\",\n opt02Detail:\n \"提供 PR 面板、checks、review、mark ready 与 merge,服务 /babysit、/shipping 和 /autopilot-*;需要已登录的 gh。\",\n opt03Title: \"浏览器验证\",\n opt03Detail: \"提供浏览器导航、输入、截图和 ARIA 快照;需选择一个提供方和受支持的模型。\",\n opt04Title: \"桌面操作\",\n opt04Detail: \"在 PTC Session 中操作 macOS 应用,支持点击、输入、截图与权限页。\",\n opt05Title: \"常驻终端\",\n opt05Detail: \"六个全局终端工具让 shell 或 REPL 跨调用保持存活,服务 CLI 与 TUI 验证。\",\n opt06Title: \"会话搜索\",\n opt06Detail: \"五个只读工具按相同 cwd 搜索和追踪历史 Session。\",\n opt07Title: \"MCP 客户端\",\n opt07Detail:\n \"挂载 MCP server,工具以 mcp__<server>__<tool> 出现在 /why 和 /teach 的证据调查中。\",\n opt08Title: \"Agent Teams\",\n opt08Detail: \"Lead/teammate 角色、共享任务板和九个团队工具;与 pstack_subagent 冲突。\",\n opt09Title: \"Ralph 循环\",\n opt09Detail: \"前台 ralph 循环每轮启动新子代理,服务 /autonomous-run。\",\n },\n} satisfies LocaleCatalog<PstackPluginsLocaleKey>;\n","/**\n * Browser half of dsh-pstack: the bundle configuration dialog button and the\n * one-time recommended-plugin guidance on the Plugins → dsh-pstack bundle page.\n *\n * The browser bundle is loaded by `dsh-client-modules` as a classic script and\n * registers the configuration action through `plugins.detail.actions` and the\n * one-time guidance through `plugins.bundle.activation`. Its Remote\n * contribution is hand-written in `../remote.ts`; no Typert generation chain is\n * required at build time.\n */\n\nimport type { Context } from \"@deepseek-ai/cordis\";\nimport type {} from \"@deepseek-ai/dsh-api-gateway/client\";\nimport type {} from \"@deepseek-ai/dsh-client-locale/client\";\nimport type {} from \"@deepseek-ai/dsh-client-ui-plugin-manager/client\";\nimport type {} from \"@deepseek-ai/dsh-client-ui-renderer/client\";\nimport type {} from \"@deepseek-ai/dsh-client-ui-slots\";\nimport type { PstackRolesLocaleKey } from \"./locales.ts\";\nimport type { PstackPluginsLocaleKey } from \"./optional-plugins-locales.ts\";\n\nimport { pstackRolesRemote, type PstackRolesNamespace } from \"../remote.ts\";\nimport { OptionalPluginsActivation } from \"./OptionalPluginsPage.tsx\";\nimport { PstackBundleConfigAction } from \"./PstackBundleConfigDialog.tsx\";\nimport type { PstackRolesApi } from \"./RoleSettingsPage.tsx\";\nimport type { BundleChange, BundleSnapshot, OptionalPluginsApi } from \"./optional-plugins-state.ts\";\nimport { NS as ROLES_NS, catalogs as rolesCatalogs } from \"./locales.ts\";\nimport { NS as PLUGINS_NS, catalogs as pluginsCatalogs } from \"./optional-plugins-locales.ts\";\n\n/** The public `pluginManager` Remote methods this page reads, in the Gateway's result envelope. */\ninterface PluginManagerRemote {\n listBundles(): Promise<\n | { readonly ok: true; readonly value: readonly BundleSnapshot[] }\n | { readonly ok: false; readonly error: unknown }\n >;\n setBundleEnabled(\n name: string,\n enabled: boolean,\n ): Promise<\n | { readonly ok: true; readonly value: BundleChange }\n | { readonly ok: false; readonly error: unknown }\n >;\n}\n\ndeclare module \"@deepseek-ai/dsh-client-ui-slots\" {\n interface LocaleNamespaceMap {\n /** dsh-pstack role model configuration page copy. */\n pstackRoles: PstackRolesLocaleKey;\n /** dsh-pstack recommended optional plugins page copy. */\n pstackPlugins: PstackPluginsLocaleKey;\n }\n}\n\n/** Browser services this plugin needs before `apply` runs. */\nexport const inject = [\"remote\", \"slots\", \"locale\", \"remote.pluginManager\"];\n\n/** Mount the Remote contribution and register the bundle configuration action and activation guidance. */\nexport async function apply(ctx: Context): Promise<() => Promise<void>> {\n // `remote.<namespace>` only exists after this plugin mounts the contribution,\n // so it cannot live in the top-level `inject` list (that would deadlock: the\n // service is created by the very apply that waits for it). Mount first, then\n // let a child scope wait for the namespace service before touching it.\n const disposeRemote = await ctx.remote.$mount(pstackRolesRemote);\n\n // Spread into a fresh literal: DSH's typed register accepts the open locale map,\n // and the catalogs already pin one complete dictionary per supported locale.\n ctx.effect(() => ctx.locale.register(ROLES_NS, { ...rolesCatalogs }), \"pstack-roles.locale\");\n ctx.effect(\n () => ctx.locale.register(PLUGINS_NS, { ...pluginsCatalogs }),\n \"pstack-plugins.locale\",\n );\n\n const pluginManager = (ctx.remote as unknown as { readonly pluginManager: PluginManagerRemote })\n .pluginManager;\n const optionalPlugins: OptionalPluginsApi = {\n listBundles: async () => {\n const result = await pluginManager.listBundles();\n if (!result.ok) throw result.error;\n return result.value;\n },\n setBundleEnabled: async (name, enabled) => {\n const result = await pluginManager.setBundleEnabled(name, enabled);\n if (!result.ok) throw result.error;\n return result.value;\n },\n };\n\n ctx.inject([\"remote.pstackRoles\"], (scope: Context) => {\n const namespace = (scope.remote as unknown as PstackRolesNamespace).pstackRoles;\n const api: PstackRolesApi = {\n status: async () => {\n const result = await namespace.status();\n if (!result.ok) throw result.error;\n return result.value;\n },\n catalogue: async () => {\n const result = await namespace.catalogue();\n if (!result.ok) throw result.error;\n return result.value;\n },\n save: async (request) => {\n const result = await namespace.save(request);\n if (!result.ok) return { ok: false, reason: result.error.message };\n return result.value;\n },\n };\n\n scope.slots.inject(\"plugins.detail.actions\", () =>\n scope.slots.register(\n {\n name: \"plugins.detail.actions\",\n id: \"dsh-pstack\",\n locale: PLUGINS_NS,\n inject: () => ({ api, optionalPlugins, rolesT: ctx.locale.bind(ROLES_NS) }),\n },\n PstackBundleConfigAction,\n ),\n );\n\n scope.slots.inject(\"plugins.bundle.activation\", () =>\n scope.slots.register(\n {\n name: \"plugins.bundle.activation\",\n key: \"dsh-pstack\",\n locale: PLUGINS_NS,\n inject: () => ({ optionalPlugins }),\n },\n OptionalPluginsActivation,\n ),\n );\n });\n\n return disposeRemote;\n}\n"],"mappings":";;;;;;;;;;;EAkCA,MAAa,iBAAiB;;EAG9B,MAAa,gBAAgB;EAI7B,SAAS,UACP,YACA,OACA,QACoB;GACpB,OAAO;IACL,MAAM;IACN;IACA,eAAe,EAAE,MAAM;IACvB,GAAI,WAAW,KAAA,I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,YAAa,MAAM,OAA2C;IACpE,MAAM,MAAsB;KAC1B,QAAQ,YAAY;MAClB,MAAM,SAAS,MAAM,UAAU,OAAO;MACtC,IAAI,CAAC,OAAO,IAAI,MAAM,OAAO;MAC7B,OAAO,OAAO;KAChB;KACA,WAAW,YAAY;MACrB,MAAM,SAAS,MAAM,UAAU,UAAU;MACzC,IAAI,CAAC,OAAO,IAAI,MAAM,OAAO;MAC7B,OAAO,OAAO;KAChB;KACA,MAAM,OAAO,YAAY;MACvB,MAAM,SAAS,MAAM,UAAU,KAAK,OAAO;MAC3C,IAAI,CAAC,OAAO,IAAI,OAAO;OAAE,IAAI;OAAO,QAAQ,OAAO,MAAM;MAAQ;MACjE,OAAO,OAAO;KAChB;IACF;IAEA,MAAM,MAAM,OAAO,gCACjB,MAAM,MAAM,SACV;KACE,MAAM;KACN,IAAI;KACJ,QAAQD;KACR,eAAe;MAAE;MAAK;MAAiB,QAAQ,IAAI,OAAO,KAAKF,IAAQ;KAAE;IAC3E,GACA,wBACF,CACF;IAEA,MAAM,MAAM,OAAO,mCACjB,MAAM,MAAM,SACV;KACE,MAAM;KACN,KAAK;KACL,QAAQE;KACR,eAAe,EAAE,gBAAgB;IACnC,GACA,yBACF,CACF;GACF,CAAC;GAED,OAAO;EACT"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Agent, AgentOptions, AgentRegistry } from "@deepseek-ai/dsh-agent";
|
|
2
|
+
import { JobId, JobRegistry } from "@deepseek-ai/dsh-jobs";
|
|
3
|
+
import { LlmRuntime } from "@deepseek-ai/dsh-llm";
|
|
4
|
+
import { SessionId } from "@deepseek-ai/dsh-session";
|
|
5
|
+
import { SkillDefinition, SkillInvocationPolicy, SkillProvider, SkillProviderControl, SkillResourceBase } from "@deepseek-ai/dsh-skill";
|
|
6
|
+
import { SubagentCapabilities, SubagentRuntime } from "@deepseek-ai/dsh-subagent";
|
|
7
|
+
import "@deepseek-ai/dsh-system-prompt";
|
|
8
|
+
import { JsonSchemaNode, ToolDefinition, ToolRuntime } from "@deepseek-ai/dsh-tools";
|
|
9
|
+
import { WorkingDirectoryService } from "@deepseek-ai/dsh-working-directory";
|
|
10
|
+
/** The slice of `ctx.agents` used to reach a child this tool has just started. */
|
|
11
|
+
type AgentsHost = Pick<AgentRegistry, "get">;
|
|
12
|
+
/** The slice of `ctx.llm` used to resolve routes and advertised efforts. */
|
|
13
|
+
type LlmHost = Pick<LlmRuntime, "listProviders" | "listModels" | "resolveModelInfo" | "resolveCallConfig">;
|
|
14
|
+
/** The slice of `ctx.subagents` this plugin drives. */
|
|
15
|
+
type SubagentsHost = Pick<SubagentRuntime, "list" | "getProvider" | "resolveMaxDepth" | "startActivation">;
|
|
16
|
+
/** The slice of `ctx.tools` this plugin registers against. */
|
|
17
|
+
type ToolsHost = Pick<ToolRuntime, "register" | "get" | "schemas">;
|
|
18
|
+
/** The slice of `ctx.jobs` a background script run needs. */
|
|
19
|
+
type JobsHost = Pick<JobRegistry, "start" | "get">;
|
|
20
|
+
/** The slice of `ctx.workingDirectory` a run needs to find the session directory. */
|
|
21
|
+
type WorkingDirectoryHost = Pick<WorkingDirectoryService, "ensure">;
|
|
22
|
+
export { ToolsHost as _, JobsHost as a, SessionId as c, SkillProvider as d, SkillProviderControl as f, ToolDefinition as g, SubagentsHost as h, JobId as i, SkillDefinition as l, SubagentCapabilities as m, AgentOptions as n, JsonSchemaNode as o, SkillResourceBase as p, AgentsHost as r, LlmHost as s, Agent as t, SkillInvocationPolicy as u, WorkingDirectoryHost as v };
|