create-windy 0.8.3 → 0.9.1
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/dist/cli.js +838 -560
- package/package.json +1 -1
- package/template/.windy-template.json +2 -2
- package/template/apps/agent-server/Dockerfile +92 -22
- package/template/apps/agent-server/README.md +47 -85
- package/template/apps/agent-server/documents/office.py +216 -0
- package/template/apps/agent-server/documents/query_report.py +136 -0
- package/template/apps/agent-server/documents/smoke.py +177 -0
- package/template/apps/agent-server/documents/test_boundaries.py +185 -0
- package/template/apps/agent-server/host-contracts.ts +56 -0
- package/template/apps/agent-server/install-native.ts +167 -0
- package/template/apps/agent-server/main.ts +179 -0
- package/template/apps/agent-server/native/EXTENSIONS.md +46 -0
- package/template/apps/agent-server/native/admission.ts +73 -0
- package/template/apps/agent-server/native/authorization.test.ts +176 -0
- package/template/apps/agent-server/native/authorization.ts +118 -0
- package/template/apps/agent-server/native/boundary-io.ts +93 -0
- package/template/apps/agent-server/native/boundary-product.ts +107 -0
- package/template/apps/agent-server/native/boundary-project.test.ts +247 -0
- package/template/apps/agent-server/native/boundary-project.ts +188 -0
- package/template/apps/agent-server/native/boundary.ts +188 -0
- package/template/apps/agent-server/native/compaction-policy.test.ts +175 -0
- package/template/apps/agent-server/native/config.ts +95 -0
- package/template/apps/agent-server/native/conversation-instructions.ts +9 -0
- package/template/apps/agent-server/native/extensions.test.ts +190 -0
- package/template/apps/agent-server/native/extensions.ts +31 -0
- package/template/apps/agent-server/native/host-profile.test.ts +91 -0
- package/template/apps/agent-server/native/host-profile.ts +33 -0
- package/template/apps/agent-server/native/host-test-fixture.ts +13 -0
- package/template/apps/agent-server/native/http.ts +129 -0
- package/template/apps/agent-server/native/lifecycle.test.ts +285 -0
- package/template/apps/agent-server/native/lifecycle.ts +136 -0
- package/template/apps/agent-server/native/manager.ts +292 -0
- package/template/apps/agent-server/native/native.test.ts +207 -0
- package/template/apps/agent-server/native/office-preview.test.ts +50 -0
- package/template/apps/agent-server/native/office-preview.ts +25 -0
- package/template/apps/agent-server/native/parallel-harness.ts +242 -0
- package/template/apps/agent-server/native/parallel-mcp-fixture.ts +97 -0
- package/template/apps/agent-server/native/parallel.test.ts +256 -0
- package/template/apps/agent-server/native/profile-composition.test.ts +147 -0
- package/template/apps/agent-server/native/profile.ts +307 -0
- package/template/apps/agent-server/native/request.ts +61 -0
- package/template/apps/agent-server/native/session-conflict.test.ts +235 -0
- package/template/apps/agent-server/native/session-conflict.ts +21 -0
- package/template/apps/agent-server/native/shared-skills.test.ts +128 -0
- package/template/apps/agent-server/native/shared-skills.ts +240 -0
- package/template/apps/agent-server/native/socket-lifecycle.test.ts +48 -0
- package/template/apps/agent-server/native/socket.ts +130 -0
- package/template/apps/agent-server/native/storage-lifecycle.test.ts +217 -0
- package/template/apps/agent-server/native/storage.ts +188 -0
- package/template/apps/agent-server/native/stream-authorization.test.ts +89 -0
- package/template/apps/agent-server/native/worker.ts +77 -0
- package/template/apps/agent-server/native-download.test.ts +119 -0
- package/template/apps/agent-server/native-download.ts +145 -0
- package/template/apps/agent-server/package.json +63 -0
- package/template/apps/agent-server/plugins/access.mjs +126 -0
- package/template/apps/agent-server/plugins/branding/README.md +9 -0
- package/template/apps/agent-server/plugins/branding/brand.css +85 -0
- package/template/apps/agent-server/plugins/branding/client.js +338 -0
- package/template/apps/agent-server/plugins/branding/index.mjs +35 -0
- package/template/apps/agent-server/plugins/branding/loading.d.mts +2 -0
- package/template/apps/agent-server/plugins/branding/loading.mjs +66 -0
- package/template/apps/agent-server/plugins/branding/loading.test.ts +89 -0
- package/template/apps/agent-server/plugins/branding/package.json +21 -0
- package/template/apps/agent-server/plugins/branding.test.ts +294 -0
- package/template/apps/agent-server/plugins/compaction.mjs +83 -0
- package/template/apps/agent-server/plugins/compaction.test.ts +91 -0
- package/template/apps/agent-server/plugins/confine-network.py +57 -0
- package/template/apps/agent-server/plugins/default-skills.test.ts +62 -0
- package/template/apps/agent-server/plugins/downloads/README.md +28 -0
- package/template/apps/agent-server/plugins/downloads/client.js +126 -0
- package/template/apps/agent-server/plugins/downloads/downloads.test.ts +222 -0
- package/template/apps/agent-server/plugins/downloads/index.d.mts +19 -0
- package/template/apps/agent-server/plugins/downloads/index.mjs +180 -0
- package/template/apps/agent-server/plugins/downloads/package.json +20 -0
- package/template/apps/agent-server/plugins/drop-overlay/README.md +24 -0
- package/template/apps/agent-server/plugins/drop-overlay/drop-overlay.test.ts +199 -0
- package/template/apps/agent-server/plugins/drop-overlay/index.d.mts +8 -0
- package/template/apps/agent-server/plugins/drop-overlay/index.mjs +12 -0
- package/template/apps/agent-server/plugins/drop-overlay/style.css +102 -0
- package/template/apps/agent-server/plugins/locale/client.js +61 -0
- package/template/apps/agent-server/plugins/locale/index.d.mts +9 -0
- package/template/apps/agent-server/plugins/locale/index.mjs +16 -0
- package/template/apps/agent-server/plugins/locale/locale.test.ts +217 -0
- package/template/apps/agent-server/plugins/locale/package.json +19 -0
- package/template/apps/agent-server/plugins/parallel.mjs +146 -0
- package/template/apps/agent-server/plugins/preset-registry.d.mts +2 -0
- package/template/apps/agent-server/plugins/preset-registry.mjs +41 -0
- package/template/apps/agent-server/plugins/preset-registry.test.ts +46 -0
- package/template/apps/agent-server/plugins/questions.d.mts +25 -0
- package/template/apps/agent-server/plugins/questions.mjs +142 -0
- package/template/apps/agent-server/plugins/questions.test.ts +105 -0
- package/template/apps/agent-server/plugins/settings/README.md +17 -0
- package/template/apps/agent-server/plugins/settings/client.js +102 -0
- package/template/apps/agent-server/plugins/settings/index.mjs +17 -0
- package/template/apps/agent-server/plugins/settings/package.json +19 -0
- package/template/apps/agent-server/plugins/settings/settings.test.ts +129 -0
- package/template/apps/agent-server/plugins/settings-controller.d.mts +4 -0
- package/template/apps/agent-server/plugins/settings-controller.mjs +31 -0
- package/template/apps/agent-server/plugins/settings-controller.test.ts +17 -0
- package/template/apps/agent-server/plugins/settings-dispatch.test.ts +34 -0
- package/template/apps/agent-server/plugins/shared-skills.d.mts +15 -0
- package/template/apps/agent-server/plugins/shared-skills.mjs +82 -0
- package/template/apps/agent-server/plugins/shared-skills.test.ts +51 -0
- package/template/apps/agent-server/plugins/skill-library/README.md +11 -0
- package/template/apps/agent-server/plugins/skill-library/archive.test.ts +43 -0
- package/template/apps/agent-server/plugins/skill-library/bundle.mjs +234 -0
- package/template/apps/agent-server/plugins/skill-library/client-chunks.test.ts +107 -0
- package/template/apps/agent-server/plugins/skill-library/client-form-mount.test.ts +139 -0
- package/template/apps/agent-server/plugins/skill-library/client-form.test.ts +261 -0
- package/template/apps/agent-server/plugins/skill-library/client-ui.test.ts +268 -0
- package/template/apps/agent-server/plugins/skill-library/client-use.test.ts +158 -0
- package/template/apps/agent-server/plugins/skill-library/client.editor.js +93 -0
- package/template/apps/agent-server/plugins/skill-library/client.form.js +316 -0
- package/template/apps/agent-server/plugins/skill-library/client.js +348 -0
- package/template/apps/agent-server/plugins/skill-library/client.request.js +52 -0
- package/template/apps/agent-server/plugins/skill-library/client.transfer.js +48 -0
- package/template/apps/agent-server/plugins/skill-library/client.use.js +46 -0
- package/template/apps/agent-server/plugins/skill-library/default-roots.test.ts +84 -0
- package/template/apps/agent-server/plugins/skill-library/draft.d.mts +17 -0
- package/template/apps/agent-server/plugins/skill-library/draft.mjs +152 -0
- package/template/apps/agent-server/plugins/skill-library/draft.test.ts +287 -0
- package/template/apps/agent-server/plugins/skill-library/index.d.mts +49 -0
- package/template/apps/agent-server/plugins/skill-library/index.mjs +226 -0
- package/template/apps/agent-server/plugins/skill-library/package.json +24 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/README.md +27 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/UPSTREAM.md +54 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/boot.test.ts +150 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/client.js +146 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/client.test.ts +195 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/index.d.mts +9 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/index.mjs +30 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/metadata.test.ts +82 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/package.json +21 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/react-boot.test.ts +162 -0
- package/template/apps/agent-server/plugins/skill-library/skills.test.ts +342 -0
- package/template/apps/agent-server/plugins/skill-library/storage.mjs +293 -0
- package/template/apps/agent-server/plugins/skill-library/style.css +229 -0
- package/template/apps/agent-server/plugins/skill-library/test-fixture.ts +77 -0
- package/template/apps/agent-server/plugins/skill-library/workflow.d.mts +18 -0
- package/template/apps/agent-server/plugins/skill-library/workflow.mjs +189 -0
- package/template/apps/agent-server/plugins/skill-library/workflow.test.ts +164 -0
- package/template/apps/agent-server/plugins/skills/README.md +5 -0
- package/template/apps/agent-server/plugins/skills/windy-data-summary/SKILL.md +14 -0
- package/template/apps/agent-server/plugins/skills/windy-extension-guide/SKILL.md +14 -0
- package/template/apps/agent-server/plugins/skills/windy-office/SKILL.md +14 -0
- package/template/apps/agent-server/plugins/skills/windy-skill-capture/SKILL.md +14 -0
- package/template/apps/agent-server/plugins/skills/windy-source-compare/SKILL.md +14 -0
- package/template/apps/agent-server/plugins/subprocess.mjs +40 -0
- package/template/apps/agent-server/plugins/theme/README.md +18 -0
- package/template/apps/agent-server/plugins/theme/client.js +18 -0
- package/template/apps/agent-server/plugins/theme/index.d.mts +9 -0
- package/template/apps/agent-server/plugins/theme/index.mjs +18 -0
- package/template/apps/agent-server/plugins/theme/package.json +19 -0
- package/template/apps/agent-server/plugins/theme/source-tokens.ts +82 -0
- package/template/apps/agent-server/plugins/theme/sync-tokens.ts +12 -0
- package/template/apps/agent-server/plugins/theme/theme.test.ts +193 -0
- package/template/apps/agent-server/plugins/theme/tokens.json +166 -0
- package/template/apps/agent-server/plugins/tool-catalog/README.md +79 -0
- package/template/apps/agent-server/plugins/tool-catalog/categories.mjs +111 -0
- package/template/apps/agent-server/plugins/tool-catalog/categories.test.ts +118 -0
- package/template/apps/agent-server/plugins/tool-catalog/client-cache.test.ts +264 -0
- package/template/apps/agent-server/plugins/tool-catalog/client.js +333 -0
- package/template/apps/agent-server/plugins/tool-catalog/client.test.ts +136 -0
- package/template/apps/agent-server/plugins/tool-catalog/discovery.d.mts +42 -0
- package/template/apps/agent-server/plugins/tool-catalog/discovery.mjs +242 -0
- package/template/apps/agent-server/plugins/tool-catalog/discovery.test.ts +229 -0
- package/template/apps/agent-server/plugins/tool-catalog/index.d.mts +5 -0
- package/template/apps/agent-server/plugins/tool-catalog/index.mjs +91 -0
- package/template/apps/agent-server/plugins/tool-catalog/package.json +23 -0
- package/template/apps/agent-server/plugins/tool-catalog/presentation.d.mts +21 -0
- package/template/apps/agent-server/plugins/tool-catalog/presentation.mjs +153 -0
- package/template/apps/agent-server/plugins/tool-catalog/presentation.test.ts +166 -0
- package/template/apps/agent-server/plugins/tool-catalog/routes.test.ts +209 -0
- package/template/apps/agent-server/plugins/tool-catalog/style.css +155 -0
- package/template/apps/agent-server/plugins/tool-catalog/use-tool.test.ts +160 -0
- package/template/apps/agent-server/plugins/tool-presentation/README.md +7 -0
- package/template/apps/agent-server/plugins/tool-presentation/build-client.ts +29 -0
- package/template/apps/agent-server/plugins/tool-presentation/client.js +312 -0
- package/template/apps/agent-server/plugins/tool-presentation/client.results.js +9 -0
- package/template/apps/agent-server/plugins/tool-presentation/client.test.ts +178 -0
- package/template/apps/agent-server/plugins/tool-presentation/index.mjs +10 -0
- package/template/apps/agent-server/plugins/tool-presentation/package.json +24 -0
- package/template/apps/agent-server/plugins/tool-presentation/result-discovery.mjs +43 -0
- package/template/apps/agent-server/plugins/tool-presentation/result-model.d.mts +51 -0
- package/template/apps/agent-server/plugins/tool-presentation/result-model.mjs +96 -0
- package/template/apps/agent-server/plugins/workspace/README.md +5 -0
- package/template/apps/agent-server/plugins/workspace/index.mjs +8 -0
- package/template/apps/agent-server/plugins/workspace/package.json +10 -0
- package/template/apps/agent-server/plugins/workspace/style.css +124 -0
- package/template/apps/agent-server/project/host.ts +13 -0
- package/template/apps/agent-server/runtime/artifacts.ts +115 -0
- package/template/apps/agent-server/runtime/audit.nodecheck.ts +60 -0
- package/template/apps/agent-server/runtime/capacity.ts +61 -0
- package/template/apps/agent-server/runtime/client-completion-budget.nodecheck.ts +92 -0
- package/template/apps/agent-server/runtime/compatibility.ts +33 -0
- package/template/apps/agent-server/runtime/completions.ts +320 -0
- package/template/apps/agent-server/runtime/config.ts +246 -0
- package/template/apps/agent-server/runtime/context-budget.ts +70 -0
- package/template/apps/agent-server/runtime/context-plugin.ts +306 -0
- package/template/apps/agent-server/runtime/context.nodecheck.ts +241 -0
- package/template/apps/agent-server/runtime/contracts.ts +201 -0
- package/template/apps/agent-server/runtime/dsh-engine.ts +196 -0
- package/template/apps/agent-server/runtime/evaluation-plugin.ts +115 -0
- package/template/apps/agent-server/runtime/evaluation.nodecheck.ts +194 -0
- package/template/apps/agent-server/runtime/events.ts +71 -0
- package/template/apps/agent-server/runtime/governance.ts +194 -0
- package/template/apps/agent-server/runtime/index.ts +339 -0
- package/template/apps/agent-server/runtime/internal-output.ts +37 -0
- package/template/apps/agent-server/runtime/isolation.nodecheck.ts +287 -0
- package/template/apps/agent-server/runtime/model-payload.ts +97 -0
- package/template/apps/agent-server/runtime/model-plugin.ts +308 -0
- package/template/apps/agent-server/runtime/model-route.ts +34 -0
- package/template/apps/agent-server/runtime/model-usage.ts +51 -0
- package/template/apps/agent-server/runtime/model-wire.ts +45 -0
- package/template/apps/agent-server/runtime/native-authorization.nodecheck.ts +126 -0
- package/template/apps/agent-server/runtime/native-completion.nodecheck.ts +81 -0
- package/template/apps/agent-server/runtime/output-validation.ts +66 -0
- package/template/apps/agent-server/runtime/production-capacity.nodecheck.ts +121 -0
- package/template/apps/agent-server/runtime/questions-workflow.nodecheck.ts +249 -0
- package/template/apps/agent-server/runtime/report-breakdown.ts +79 -0
- package/template/apps/agent-server/runtime/reporting.ts +219 -0
- package/template/apps/agent-server/runtime/run-completion.ts +39 -0
- package/template/apps/agent-server/runtime/run-request-digest.ts +18 -0
- package/template/apps/agent-server/runtime/runtime-test-fixtures.ts +264 -0
- package/template/apps/agent-server/runtime/runtime.nodecheck.ts +150 -0
- package/template/apps/agent-server/runtime/store-idempotency.nodecheck.ts +74 -0
- package/template/apps/agent-server/runtime/store.ts +324 -0
- package/template/apps/agent-server/runtime/structured-output-mode.nodecheck.ts +51 -0
- package/template/apps/agent-server/runtime/tool-name.ts +6 -0
- package/template/apps/agent-server/runtime/tool-plugin.ts +201 -0
- package/template/apps/agent-server/runtime/vision-readiness.ts +200 -0
- package/template/apps/agent-server/scripts/confinement-check.mjs +103 -0
- package/template/apps/agent-server/scripts/coordinator-check.mjs +344 -0
- package/template/apps/agent-server/scripts/documents-delivery-check.mjs +309 -0
- package/template/apps/agent-server/scripts/office-preview-check.mjs +92 -0
- package/template/apps/agent-server/scripts/test-confinement.ts +58 -0
- package/template/apps/agent-server/scripts/test-coordinator.ts +36 -0
- package/template/apps/agent-server/scripts/test-runtime.ts +46 -0
- package/template/apps/agent-server/tsconfig.json +21 -0
- package/template/apps/server/Dockerfile +3 -0
- package/template/apps/server/package.json +5 -1
- package/template/apps/server/scripts/check-dsh-platform-example.ts +251 -0
- package/template/apps/server/src/agent/dsh-runtime-wire.test.ts +33 -0
- package/template/apps/server/src/agent/governance-runtime.ts +41 -0
- package/template/apps/server/src/agent/remote-runtime-response.ts +1 -1
- package/template/apps/server/src/agent/run-contracts.ts +1 -0
- package/template/apps/server/src/agent/run-definition-support.ts +9 -0
- package/template/apps/server/src/agent/runtime-tool-composition.ts +2 -0
- package/template/apps/server/src/agent/workflow-runtime-bootstrap.ts +9 -0
- package/template/apps/server/src/agent-skills/access.ts +88 -0
- package/template/apps/server/src/agent-skills/bootstrap.ts +49 -0
- package/template/apps/server/src/agent-skills/builtin-registration.ts +83 -0
- package/template/apps/server/src/agent-skills/builtins.ts +19 -0
- package/template/apps/server/src/agent-skills/bundle-zip.ts +163 -0
- package/template/apps/server/src/agent-skills/bundle.test.ts +79 -0
- package/template/apps/server/src/agent-skills/bundle.ts +133 -0
- package/template/apps/server/src/agent-skills/contracts.ts +46 -0
- package/template/apps/server/src/agent-skills/drizzle-repository.ts +125 -0
- package/template/apps/server/src/agent-skills/input.ts +29 -0
- package/template/apps/server/src/agent-skills/postgres.integration.test.ts +348 -0
- package/template/apps/server/src/agent-skills/read-routes.test.ts +116 -0
- package/template/apps/server/src/agent-skills/reader.ts +108 -0
- package/template/apps/server/src/agent-skills/repository.ts +105 -0
- package/template/apps/server/src/agent-skills/routes.ts +176 -0
- package/template/apps/server/src/agent-skills/service.test.ts +295 -0
- package/template/apps/server/src/agent-skills/service.ts +301 -0
- package/template/apps/server/src/agent-workflow/preset-registry.test.ts +137 -0
- package/template/apps/server/src/agent-workflow/preset-registry.ts +191 -0
- package/template/apps/server/src/agent-workflow/preset-routes.test.ts +94 -0
- package/template/apps/server/src/agent-workflow/preset-routes.ts +45 -0
- package/template/apps/server/src/ai-runtime-report/service.test.ts +10 -7
- package/template/apps/server/src/ai-runtime-report/service.ts +1 -1
- package/template/apps/server/src/app/agent-workflow-presets.ts +4 -0
- package/template/apps/server/src/app/dsh-skill-draft-audit.test.ts +195 -0
- package/template/apps/server/src/app/dsh-skill-draft-audit.ts +115 -0
- package/template/apps/server/src/app/dsh-workbench-audit.test.ts +71 -0
- package/template/apps/server/src/app/dsh-workbench-audit.ts +34 -0
- package/template/apps/server/src/app/dsh-workbench-handshake.test.ts +63 -0
- package/template/apps/server/src/app/dsh-workbench-handshake.ts +48 -0
- package/template/apps/server/src/app/dsh-workbench-http.test.ts +96 -0
- package/template/apps/server/src/app/dsh-workbench-lan-origin.test.ts +114 -0
- package/template/apps/server/src/app/dsh-workbench-launch.test.ts +70 -0
- package/template/apps/server/src/app/dsh-workbench-origin.test.ts +54 -0
- package/template/apps/server/src/app/dsh-workbench-proxy.ts +205 -0
- package/template/apps/server/src/app/dsh-workbench-session-conflict.test.ts +61 -0
- package/template/apps/server/src/app/dsh-workbench-session.ts +59 -0
- package/template/apps/server/src/app/dsh-workbench-socket-audit.test.ts +115 -0
- package/template/apps/server/src/app/dsh-workbench-socket.test.ts +246 -0
- package/template/apps/server/src/app/dsh-workbench-socket.ts +272 -0
- package/template/apps/server/src/app/dsh-workbench-test-support.ts +158 -0
- package/template/apps/server/src/app/dsh-workbench.test.ts +213 -0
- package/template/apps/server/src/app/dsh-workbench.ts +279 -0
- package/template/apps/server/src/app/workbench-public-origin.ts +16 -0
- package/template/apps/server/src/data-governance/user-plaintext-routes.test.ts +3 -0
- package/template/apps/server/src/http-app.ts +31 -0
- package/template/apps/server/src/mcp/adapter.ts +1 -0
- package/template/apps/server/src/module-composition.test.ts +23 -0
- package/template/apps/server/src/module-composition.ts +9 -2
- package/template/apps/server/src/observability/bootstrap.ts +12 -0
- package/template/apps/server/src/observability/diagnostic-failure-recorder.ts +94 -0
- package/template/apps/server/src/observability/diagnostic-http-contract.test.ts +42 -0
- package/template/apps/server/src/observability/diagnostic-index.test.ts +89 -0
- package/template/apps/server/src/observability/diagnostic-index.ts +88 -0
- package/template/apps/server/src/observability/diagnostic-repository.ts +67 -0
- package/template/apps/server/src/platform-app-bootstrap.ts +42 -0
- package/template/apps/server/src/platform-http-runtime.ts +6 -0
- package/template/apps/server/src/runtime-development.test.ts +25 -0
- package/template/apps/server/src/runtime-development.ts +6 -44
- package/template/apps/server/src/system/diagnostic-routes.test.ts +78 -0
- package/template/apps/server/src/system/diagnostic-routes.ts +66 -0
- package/template/apps/web/Dockerfile +9 -1
- package/template/apps/web/dev/start.ts +21 -10
- package/template/apps/web/dsh-workbench-location.ts +21 -0
- package/template/apps/web/dsh-workbench-proxy.test.ts +121 -0
- package/template/apps/web/dsh-workbench-proxy.ts +194 -0
- package/template/apps/web/package.json +3 -1
- package/template/apps/web/server.ts +27 -6
- package/template/apps/web/src/composables/useLoginFlow.ts +13 -1
- package/template/apps/web/src/pages/errors/PlatformErrorPage.vue +6 -0
- package/template/apps/web/src/pages/errors/PlatformErrorPage.webtest.ts +14 -1
- package/template/apps/web/src/pages/errors/error-page-extension.ts +1 -0
- package/template/apps/web/src/pages/system/AgentNativePage.vue +44 -0
- package/template/apps/web/src/pages/system/AgentWorkflowPage.vue +20 -7
- package/template/apps/web/src/pages/system/DiagnosticLookupPage.vue +56 -0
- package/template/apps/web/src/pages/system/DiagnosticLookupPage.webtest.ts +99 -0
- package/template/apps/web/src/pages/system/SystemAgentSkillsPage.vue +88 -0
- package/template/apps/web/src/pages/system/components/DiagnosticRecordDetails.vue +52 -0
- package/template/apps/web/src/pages/system/components/agent-skills/AgentSkillDetailDialog.vue +166 -0
- package/template/apps/web/src/pages/system/components/agent-skills/AgentSkillGovernanceActionDialog.vue +51 -0
- package/template/apps/web/src/pages/system/components/agent-skills/AgentSkillImportDialog.vue +320 -0
- package/template/apps/web/src/pages/system/components/agent-skills/AgentSkillImportDialog.webtest.ts +96 -0
- package/template/apps/web/src/pages/system/components/agent-skills/AgentSkillsTable.vue +69 -0
- package/template/apps/web/src/pages/system/components/agent-workflow/WorkflowPresetCatalog.vue +82 -0
- package/template/apps/web/src/pages/system/components/agent-workflow/WorkflowPresetCatalog.webtest.ts +57 -0
- package/template/apps/web/src/pages/system/composables/useAgentSkillsGovernance.ts +105 -0
- package/template/apps/web/src/pages/system/composables/useAgentWorkflowPresets.ts +44 -0
- package/template/apps/web/src/pages/system/composables/useDiagnosticLookup.ts +64 -0
- package/template/apps/web/src/router/error-navigation.ts +3 -1
- package/template/apps/web/src/router/error-navigation.webtest.ts +14 -2
- package/template/apps/web/src/router/index.ts +8 -49
- package/template/apps/web/src/router/platform-admin-pages.ts +79 -0
- package/template/apps/web/src/router/platform-admin-route-bindings.ts +8 -0
- package/template/apps/web/src/services/agent-skills-api.ts +55 -0
- package/template/apps/web/src/services/agent-workflow-api.ts +12 -0
- package/template/apps/web/src/services/diagnostics-api.ts +12 -0
- package/template/apps/web/src/services/http.ts +18 -0
- package/template/apps/web/src/services/http.webtest.ts +51 -0
- package/template/apps/web/vite.config.ts +39 -0
- package/template/deploy/dsh/README.md +5 -0
- package/template/deploy/dsh/documents/README.md +9 -0
- package/template/deploy/dsh/documents/requirements.in +6 -0
- package/template/deploy/dsh/documents/requirements.lock +72 -0
- package/template/docker-compose.yml +24 -10
- package/template/docs/adr/0004-embedded-dsh-runtime.md +9 -0
- package/template/docs/architecture/agent-admin-workbench-implementation.md +73 -0
- package/template/docs/architecture/agent-admin-workbench-plan.md +41 -0
- package/template/docs/architecture/agent-harness.md +2 -0
- package/template/docs/architecture/agent-runtime-compatibility.md +2 -0
- package/template/docs/architecture/embedded-dsh-integration.md +44 -0
- package/template/docs/development/dsh-plugins.md +55 -0
- package/template/docs/operations/dsh-agent-migration.md +98 -0
- package/template/docs/platform/agent-production-store.md +5 -78
- package/template/docs/platform/agent-runtime-observability.md +2 -0
- package/template/docs/platform/agent-runtime.md +2 -0
- package/template/docs/platform/agent-skills.md +25 -0
- package/template/package.json +4 -3
- package/template/packages/database/drizzle/0064_dsh_skills_diagnostics.sql +42 -0
- package/template/packages/database/drizzle/meta/0064_snapshot.json +15349 -0
- package/template/packages/database/drizzle/meta/_journal.json +7 -0
- package/template/packages/database/package.json +2 -2
- package/template/packages/database/src/schema/agent-skills.ts +65 -0
- package/template/packages/database/src/schema/diagnostics.ts +27 -0
- package/template/packages/database/src/schema/index.ts +8 -0
- package/template/packages/modules/package.json +1 -1
- package/template/packages/modules/src/system-admin-routes.ts +24 -0
- package/template/packages/modules/src/system-admin-ui-catalog.ts +17 -10
- package/template/packages/modules/src/system-agent-admin-bindings.ts +2 -0
- package/template/packages/modules/src/system-agent-admin-menus.ts +20 -0
- package/template/packages/modules/src/system-agent-audit-actions.ts +3 -0
- package/template/packages/modules/src/system-agent-dsh.ts +119 -0
- package/template/packages/modules/src/system-api-permissions.ts +9 -0
- package/template/packages/modules/src/system-audit-actions.ts +11 -0
- package/template/packages/modules/src/system-features.ts +5 -0
- package/template/packages/modules/src/system-module-audit-selection.ts +25 -0
- package/template/packages/modules/src/system-module-catalog.ts +12 -32
- package/template/packages/modules/src/system-modules.ts +14 -3
- package/template/packages/modules/src/system-permissions.ts +10 -0
- package/template/packages/server-sdk/package.json +2 -2
- package/template/packages/shared/index.ts +12 -0
- package/template/packages/shared/package.json +1 -1
- package/template/packages/shared/src/agent-skills.ts +68 -0
- package/template/packages/shared/src/agent-workflow-presets.ts +26 -0
- package/template/packages/shared/src/diagnostics.ts +13 -0
- package/template/packages/shared/src/rbac.ts +1 -0
- package/template/apps/agent-server/install-python-dependencies.sh +0 -92
- package/template/apps/agent-server/pyproject.toml +0 -51
- package/template/apps/agent-server/src/southwind_agent_server/__init__.py +0 -5
- package/template/apps/agent-server/src/southwind_agent_server/app.py +0 -344
- package/template/apps/agent-server/src/southwind_agent_server/approval_resolution.py +0 -30
- package/template/apps/agent-server/src/southwind_agent_server/artifact_input.py +0 -153
- package/template/apps/agent-server/src/southwind_agent_server/asgi.py +0 -8
- package/template/apps/agent-server/src/southwind_agent_server/attempt_context.py +0 -199
- package/template/apps/agent-server/src/southwind_agent_server/attempt_context_projection.py +0 -203
- package/template/apps/agent-server/src/southwind_agent_server/client_completion_contracts.py +0 -61
- package/template/apps/agent-server/src/southwind_agent_server/client_completion_governance.py +0 -82
- package/template/apps/agent-server/src/southwind_agent_server/client_completion_routes.py +0 -121
- package/template/apps/agent-server/src/southwind_agent_server/client_completion_runtime.py +0 -158
- package/template/apps/agent-server/src/southwind_agent_server/config.py +0 -267
- package/template/apps/agent-server/src/southwind_agent_server/context_message_digest.py +0 -24
- package/template/apps/agent-server/src/southwind_agent_server/context_version_contracts.py +0 -71
- package/template/apps/agent-server/src/southwind_agent_server/context_version_port.py +0 -307
- package/template/apps/agent-server/src/southwind_agent_server/contracts.py +0 -297
- package/template/apps/agent-server/src/southwind_agent_server/deterministic.py +0 -63
- package/template/apps/agent-server/src/southwind_agent_server/engine.py +0 -134
- package/template/apps/agent-server/src/southwind_agent_server/engine_capacity.py +0 -31
- package/template/apps/agent-server/src/southwind_agent_server/engine_identity.py +0 -2
- package/template/apps/agent-server/src/southwind_agent_server/fingerprint.py +0 -61
- package/template/apps/agent-server/src/southwind_agent_server/health_routes.py +0 -93
- package/template/apps/agent-server/src/southwind_agent_server/http_helpers.py +0 -62
- package/template/apps/agent-server/src/southwind_agent_server/lease.py +0 -15
- package/template/apps/agent-server/src/southwind_agent_server/multimodal.py +0 -76
- package/template/apps/agent-server/src/southwind_agent_server/openai_engine.py +0 -329
- package/template/apps/agent-server/src/southwind_agent_server/openai_engine_validation.py +0 -165
- package/template/apps/agent-server/src/southwind_agent_server/openai_provider.py +0 -345
- package/template/apps/agent-server/src/southwind_agent_server/postgres_report_insert.py +0 -37
- package/template/apps/agent-server/src/southwind_agent_server/postgres_report_queries.py +0 -235
- package/template/apps/agent-server/src/southwind_agent_server/postgres_report_replay.py +0 -44
- package/template/apps/agent-server/src/southwind_agent_server/postgres_report_status.py +0 -83
- package/template/apps/agent-server/src/southwind_agent_server/postgres_report_store.py +0 -336
- package/template/apps/agent-server/src/southwind_agent_server/postgres_report_summary.py +0 -304
- package/template/apps/agent-server/src/southwind_agent_server/postgres_store.py +0 -335
- package/template/apps/agent-server/src/southwind_agent_server/postgres_store_backend.py +0 -333
- package/template/apps/agent-server/src/southwind_agent_server/provider_audit.py +0 -144
- package/template/apps/agent-server/src/southwind_agent_server/provider_governance.py +0 -309
- package/template/apps/agent-server/src/southwind_agent_server/provider_output_guidance.py +0 -34
- package/template/apps/agent-server/src/southwind_agent_server/readiness_pin.py +0 -37
- package/template/apps/agent-server/src/southwind_agent_server/report_lifecycle.py +0 -218
- package/template/apps/agent-server/src/southwind_agent_server/report_metrics.py +0 -149
- package/template/apps/agent-server/src/southwind_agent_server/report_presenter.py +0 -300
- package/template/apps/agent-server/src/southwind_agent_server/report_routes.py +0 -132
- package/template/apps/agent-server/src/southwind_agent_server/report_store.py +0 -298
- package/template/apps/agent-server/src/southwind_agent_server/report_store_protocol.py +0 -75
- package/template/apps/agent-server/src/southwind_agent_server/report_types.py +0 -118
- package/template/apps/agent-server/src/southwind_agent_server/run_admission.py +0 -64
- package/template/apps/agent-server/src/southwind_agent_server/run_capacity.py +0 -59
- package/template/apps/agent-server/src/southwind_agent_server/runtime_budget.py +0 -74
- package/template/apps/agent-server/src/southwind_agent_server/runtime_compatibility.py +0 -89
- package/template/apps/agent-server/src/southwind_agent_server/runtime_factory.py +0 -105
- package/template/apps/agent-server/src/southwind_agent_server/runtime_logging.py +0 -57
- package/template/apps/agent-server/src/southwind_agent_server/service.py +0 -325
- package/template/apps/agent-server/src/southwind_agent_server/service_control.py +0 -64
- package/template/apps/agent-server/src/southwind_agent_server/service_errors.py +0 -4
- package/template/apps/agent-server/src/southwind_agent_server/service_execution.py +0 -34
- package/template/apps/agent-server/src/southwind_agent_server/service_tasks.py +0 -34
- package/template/apps/agent-server/src/southwind_agent_server/signal_events.py +0 -53
- package/template/apps/agent-server/src/southwind_agent_server/sqlite_catalog.py +0 -118
- package/template/apps/agent-server/src/southwind_agent_server/sqlite_errors.py +0 -2
- package/template/apps/agent-server/src/southwind_agent_server/sqlite_schema.py +0 -73
- package/template/apps/agent-server/src/southwind_agent_server/sqlite_serialization.py +0 -16
- package/template/apps/agent-server/src/southwind_agent_server/sqlite_store.py +0 -350
- package/template/apps/agent-server/src/southwind_agent_server/sse.py +0 -41
- package/template/apps/agent-server/src/southwind_agent_server/store.py +0 -255
- package/template/apps/agent-server/src/southwind_agent_server/store_cipher.py +0 -40
- package/template/apps/agent-server/src/southwind_agent_server/structured_logging.py +0 -145
- package/template/apps/agent-server/src/southwind_agent_server/telemetry.py +0 -93
- package/template/apps/agent-server/src/southwind_agent_server/tool_host.py +0 -152
- package/template/apps/agent-server/src/southwind_agent_server/trajectory.py +0 -137
- package/template/apps/agent-server/src/southwind_agent_server/unavailable_engine.py +0 -58
- package/template/apps/agent-server/src/southwind_agent_server/vision_probe.py +0 -87
- package/template/apps/agent-server/src/southwind_agent_server/vision_requirement.py +0 -28
- package/template/apps/agent-server/src/southwind_agent_server/vlm_readiness.py +0 -247
- package/template/apps/agent-server/tests/__init__.py +0 -1
- package/template/apps/agent-server/tests/openai_provider_test_support.py +0 -131
- package/template/apps/agent-server/tests/test_api.py +0 -305
- package/template/apps/agent-server/tests/test_artifact_input.py +0 -110
- package/template/apps/agent-server/tests/test_client_completion.py +0 -230
- package/template/apps/agent-server/tests/test_config.py +0 -106
- package/template/apps/agent-server/tests/test_fingerprint.py +0 -10
- package/template/apps/agent-server/tests/test_multimodal.py +0 -81
- package/template/apps/agent-server/tests/test_openai_provider.py +0 -320
- package/template/apps/agent-server/tests/test_postgres_report_status.py +0 -59
- package/template/apps/agent-server/tests/test_postgres_report_summary.py +0 -298
- package/template/apps/agent-server/tests/test_postgres_store.py +0 -135
- package/template/apps/agent-server/tests/test_provider_attempt_reporting.py +0 -140
- package/template/apps/agent-server/tests/test_provider_governance.py +0 -276
- package/template/apps/agent-server/tests/test_report_attempt_lifecycle.py +0 -126
- package/template/apps/agent-server/tests/test_report_resilience.py +0 -183
- package/template/apps/agent-server/tests/test_report_routes.py +0 -143
- package/template/apps/agent-server/tests/test_report_store.py +0 -347
- package/template/apps/agent-server/tests/test_report_summary_parity.py +0 -116
- package/template/apps/agent-server/tests/test_report_terminal_sync.py +0 -177
- package/template/apps/agent-server/tests/test_run_capacity.py +0 -112
- package/template/apps/agent-server/tests/test_run_operational_logging.py +0 -114
- package/template/apps/agent-server/tests/test_runtime_compatibility.py +0 -119
- package/template/apps/agent-server/tests/test_runtime_factory_readiness.py +0 -52
- package/template/apps/agent-server/tests/test_sqlite_store.py +0 -182
- package/template/apps/agent-server/tests/test_structured_logging.py +0 -142
- package/template/apps/agent-server/tests/test_telemetry.py +0 -25
- package/template/apps/agent-server/tests/test_tool_approval.py +0 -28
- package/template/apps/agent-server/tests/test_tool_structured_output.py +0 -347
- package/template/apps/agent-server/tests/test_trajectory.py +0 -91
- package/template/apps/agent-server/tests/test_vision_readiness_enforcement.py +0 -72
- package/template/apps/agent-server/tests/test_vlm_readiness.py +0 -106
- package/template/apps/agent-server/uv.lock +0 -831
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface SkillConfig {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
defaultSkillDir: string;
|
|
4
|
+
extraDefaultSkillDirs?: readonly string[];
|
|
5
|
+
draftModel?: string;
|
|
6
|
+
draftMaxTokens?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface SkillContext {
|
|
9
|
+
tools: Pick<import("@deepseek-ai/dsh-tools").ToolRuntime, "register">;
|
|
10
|
+
userQuestions: Pick<
|
|
11
|
+
import("@deepseek-ai/dsh-user-questions").UserQuestionService,
|
|
12
|
+
"ask"
|
|
13
|
+
>;
|
|
14
|
+
workingDirectory: Pick<
|
|
15
|
+
import("@deepseek-ai/dsh-working-directory").WorkingDirectoryService,
|
|
16
|
+
"get"
|
|
17
|
+
>;
|
|
18
|
+
llm?: Pick<import("@deepseek-ai/dsh-llm").LlmRuntime, "prepareCall">;
|
|
19
|
+
connection: {
|
|
20
|
+
requestRejection(
|
|
21
|
+
request: Request | import("node:http").IncomingMessage,
|
|
22
|
+
): number | undefined;
|
|
23
|
+
};
|
|
24
|
+
workspaceRegistry: {
|
|
25
|
+
get(id: string): { path: string } | undefined;
|
|
26
|
+
list(): { id: string; path: string }[];
|
|
27
|
+
};
|
|
28
|
+
sandboxPolicy: { workspaceRoot: string };
|
|
29
|
+
on(event: string, callback: (table: unknown[]) => void): void;
|
|
30
|
+
effect(callback: () => unknown, label?: string): void;
|
|
31
|
+
webServer: {
|
|
32
|
+
register(route: {
|
|
33
|
+
kind: "exact";
|
|
34
|
+
path: string;
|
|
35
|
+
handler(
|
|
36
|
+
request: import("node:http").IncomingMessage,
|
|
37
|
+
response: import("node:http").ServerResponse,
|
|
38
|
+
): Promise<void>;
|
|
39
|
+
}): () => void;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export const name: string;
|
|
43
|
+
export const inject: string[];
|
|
44
|
+
export function apply(ctx: SkillContext, config: SkillConfig): void;
|
|
45
|
+
export function skillResponse(
|
|
46
|
+
ctx: SkillContext,
|
|
47
|
+
config: SkillConfig,
|
|
48
|
+
request: Request,
|
|
49
|
+
): Promise<Response>;
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { generateSkillDraft } from "./draft.mjs";
|
|
3
|
+
import { registerWorkflowTool } from "./workflow.mjs";
|
|
4
|
+
import {
|
|
5
|
+
LIMITS,
|
|
6
|
+
fail,
|
|
7
|
+
decodeBundle,
|
|
8
|
+
markdownBundle,
|
|
9
|
+
encodeBundle,
|
|
10
|
+
skillName,
|
|
11
|
+
} from "./bundle.mjs";
|
|
12
|
+
import {
|
|
13
|
+
skillRoots,
|
|
14
|
+
listSkills,
|
|
15
|
+
readSkill,
|
|
16
|
+
installSkill,
|
|
17
|
+
updateSkill,
|
|
18
|
+
deleteSkill,
|
|
19
|
+
} from "./storage.mjs";
|
|
20
|
+
|
|
21
|
+
export const name = "windy-skill-library";
|
|
22
|
+
export const inject = [
|
|
23
|
+
"webServer",
|
|
24
|
+
"connection",
|
|
25
|
+
"workspaceRegistry",
|
|
26
|
+
"sandboxPolicy",
|
|
27
|
+
"llm",
|
|
28
|
+
"tools",
|
|
29
|
+
"userQuestions",
|
|
30
|
+
"workingDirectory",
|
|
31
|
+
];
|
|
32
|
+
const styles = readFileSync(new URL("./style.css", import.meta.url), "utf8");
|
|
33
|
+
export async function skillResponse(ctx, config, request) {
|
|
34
|
+
if (request.method !== "POST") return error(405, "请使用技能面板操作。");
|
|
35
|
+
const denied = ctx.connection.requestRejection(request);
|
|
36
|
+
if (denied) return error(denied, "身份已失效,请重新登录。");
|
|
37
|
+
if (!config.enabled) return error(403, "当前部署未开放个人技能管理。");
|
|
38
|
+
try {
|
|
39
|
+
const body = await request.json();
|
|
40
|
+
if (
|
|
41
|
+
!body ||
|
|
42
|
+
typeof body !== "object" ||
|
|
43
|
+
Array.isArray(body) ||
|
|
44
|
+
Object.keys(body).some(
|
|
45
|
+
(key) =>
|
|
46
|
+
![
|
|
47
|
+
"action",
|
|
48
|
+
"workspaceId",
|
|
49
|
+
"name",
|
|
50
|
+
"source",
|
|
51
|
+
"raw",
|
|
52
|
+
"version",
|
|
53
|
+
"archive",
|
|
54
|
+
"confirmed",
|
|
55
|
+
"workflow",
|
|
56
|
+
].includes(key),
|
|
57
|
+
)
|
|
58
|
+
)
|
|
59
|
+
fail("请求参数无效。");
|
|
60
|
+
if (body.action === "draft") {
|
|
61
|
+
const draft = await generateSkillDraft(ctx, config, body, request.signal);
|
|
62
|
+
request.signal.throwIfAborted();
|
|
63
|
+
return Response.json(
|
|
64
|
+
{ draft },
|
|
65
|
+
{
|
|
66
|
+
headers: {
|
|
67
|
+
"cache-control": "no-store",
|
|
68
|
+
"x-windy-skill-draft-complete": "1",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
return await skillRoots(ctx, config, body.workspaceId, async (roots) => {
|
|
74
|
+
request.signal.throwIfAborted();
|
|
75
|
+
if (body.action === "list")
|
|
76
|
+
return json({ items: await listSkills(roots) });
|
|
77
|
+
if (body.action === "import") {
|
|
78
|
+
if (
|
|
79
|
+
typeof body.archive !== "string" ||
|
|
80
|
+
body.archive.length > Math.ceil(LIMITS.archive / 3) * 4 ||
|
|
81
|
+
!/^[A-Za-z0-9+/]*={0,2}$/.test(body.archive)
|
|
82
|
+
)
|
|
83
|
+
fail("技能包无效或过大。", 413);
|
|
84
|
+
await installSkill(
|
|
85
|
+
roots,
|
|
86
|
+
decodeBundle(Buffer.from(body.archive, "base64")),
|
|
87
|
+
);
|
|
88
|
+
return json({ ok: true });
|
|
89
|
+
}
|
|
90
|
+
if (body.action === "create") {
|
|
91
|
+
await installSkill(roots, markdownBundle(body.raw));
|
|
92
|
+
return json({ ok: true });
|
|
93
|
+
}
|
|
94
|
+
const name = skillName(body.name),
|
|
95
|
+
root = roots[body.source];
|
|
96
|
+
if (!root || !["personal", "defaults"].includes(body.source))
|
|
97
|
+
fail("技能来源无效。");
|
|
98
|
+
if (body.action === "read") {
|
|
99
|
+
const item = await readSkill(root, name);
|
|
100
|
+
return json(item);
|
|
101
|
+
}
|
|
102
|
+
if (body.action === "export") {
|
|
103
|
+
const item = await readSkill(root, name, true),
|
|
104
|
+
bytes = encodeBundle(name, item.files);
|
|
105
|
+
if (bytes.length > LIMITS.archive)
|
|
106
|
+
fail("导出包超过 4 MiB,请精简技能附件。", 413);
|
|
107
|
+
const filename =
|
|
108
|
+
(item.displayName || name)
|
|
109
|
+
.replace(/[<>:"/\\|?*]/g, "-")
|
|
110
|
+
.replace(/[. ]+$/, "")
|
|
111
|
+
.trim() || name;
|
|
112
|
+
return new Response(bytes, {
|
|
113
|
+
headers: {
|
|
114
|
+
"content-type": "application/zip",
|
|
115
|
+
"content-disposition": `attachment; filename="${name}.zip"; filename*=UTF-8''${encodeURIComponent(filename + ".zip").replace(/['()*]/g, (char) => "%" + char.charCodeAt(0).toString(16).toUpperCase())}`,
|
|
116
|
+
"cache-control": "no-store",
|
|
117
|
+
"x-content-type-options": "nosniff",
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (body.source !== "personal")
|
|
122
|
+
fail("默认技能只读,请导出后更名导入个人副本。", 403);
|
|
123
|
+
if (body.action === "save")
|
|
124
|
+
await updateSkill(root, name, body.raw, body.version);
|
|
125
|
+
else if (body.action === "delete" && body.confirmed === true)
|
|
126
|
+
await deleteSkill(root, name, body.version);
|
|
127
|
+
else fail("操作无效。");
|
|
128
|
+
return json({ ok: true });
|
|
129
|
+
});
|
|
130
|
+
} catch (reason) {
|
|
131
|
+
return error(
|
|
132
|
+
reason.status ?? (reason.code === "ENOENT" ? 404 : 400),
|
|
133
|
+
reason.status ? reason.message : "技能操作失败,请刷新并检查文件格式。",
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function json(value) {
|
|
138
|
+
return Response.json(value, { headers: { "cache-control": "no-store" } });
|
|
139
|
+
}
|
|
140
|
+
function error(status, message) {
|
|
141
|
+
return Response.json(
|
|
142
|
+
{ error: message },
|
|
143
|
+
{ status, headers: { "cache-control": "no-store" } },
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
export function apply(ctx, config) {
|
|
147
|
+
if (!config.enabled) return;
|
|
148
|
+
registerWorkflowTool(ctx, config);
|
|
149
|
+
const lifetime = new AbortController();
|
|
150
|
+
ctx.effect(() => () => lifetime.abort());
|
|
151
|
+
ctx.on("webserver/index-inject", (table) => {
|
|
152
|
+
table.push({ kind: "style", text: styles });
|
|
153
|
+
});
|
|
154
|
+
let tail = Promise.resolve();
|
|
155
|
+
ctx.effect(
|
|
156
|
+
() =>
|
|
157
|
+
ctx.webServer.register({
|
|
158
|
+
kind: "exact",
|
|
159
|
+
path: "/windy/skills",
|
|
160
|
+
async handler(incoming, outgoing) {
|
|
161
|
+
const denied = ctx.connection.requestRejection(incoming);
|
|
162
|
+
if (denied || incoming.method !== "POST") {
|
|
163
|
+
outgoing.writeHead(denied ?? 405);
|
|
164
|
+
outgoing.end();
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const controller = new AbortController(),
|
|
168
|
+
cancel = () => {
|
|
169
|
+
if (!outgoing.writableEnded) controller.abort();
|
|
170
|
+
};
|
|
171
|
+
outgoing.once("close", cancel);
|
|
172
|
+
try {
|
|
173
|
+
const chunks = [];
|
|
174
|
+
let size = 0;
|
|
175
|
+
for await (const chunk of incoming) {
|
|
176
|
+
if ((size += chunk.length) > 6 * 1024 * 1024) {
|
|
177
|
+
outgoing.writeHead(413);
|
|
178
|
+
outgoing.end();
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
chunks.push(chunk);
|
|
182
|
+
}
|
|
183
|
+
const headers = new Headers();
|
|
184
|
+
for (const [key, value] of Object.entries(incoming.headers))
|
|
185
|
+
if (typeof value === "string") headers.set(key, value);
|
|
186
|
+
const request = new Request(
|
|
187
|
+
new URL(incoming.url, "http://dsh.internal"),
|
|
188
|
+
{
|
|
189
|
+
method: "POST",
|
|
190
|
+
headers,
|
|
191
|
+
body: Buffer.concat(chunks),
|
|
192
|
+
signal: AbortSignal.any([controller.signal, lifetime.signal]),
|
|
193
|
+
},
|
|
194
|
+
);
|
|
195
|
+
let draft = false;
|
|
196
|
+
try {
|
|
197
|
+
draft =
|
|
198
|
+
JSON.parse(Buffer.concat(chunks).toString("utf8"))?.action ===
|
|
199
|
+
"draft";
|
|
200
|
+
} catch {
|
|
201
|
+
/* The response validator handles malformed JSON. */
|
|
202
|
+
}
|
|
203
|
+
const resultPromise = draft
|
|
204
|
+
? skillResponse(ctx, config, request)
|
|
205
|
+
: tail.then(() => skillResponse(ctx, config, request));
|
|
206
|
+
if (!draft)
|
|
207
|
+
tail = resultPromise.then(
|
|
208
|
+
() => undefined,
|
|
209
|
+
() => undefined,
|
|
210
|
+
);
|
|
211
|
+
const result = await resultPromise;
|
|
212
|
+
if (!outgoing.destroyed) {
|
|
213
|
+
outgoing.writeHead(
|
|
214
|
+
result.status,
|
|
215
|
+
Object.fromEntries(result.headers),
|
|
216
|
+
);
|
|
217
|
+
outgoing.end(Buffer.from(await result.arrayBuffer()));
|
|
218
|
+
}
|
|
219
|
+
} finally {
|
|
220
|
+
outgoing.off("close", cancel);
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
}),
|
|
224
|
+
"windy.skill-library",
|
|
225
|
+
);
|
|
226
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@southwind-ai/dsh-skill-library",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./index.mjs",
|
|
8
|
+
"./client": "./client.js",
|
|
9
|
+
"./package.json": "./package.json"
|
|
10
|
+
},
|
|
11
|
+
"dsh": {
|
|
12
|
+
"client": {
|
|
13
|
+
"platform": "web",
|
|
14
|
+
"inject": [
|
|
15
|
+
"@deepseek-ai/dsh-client-ui-layout",
|
|
16
|
+
"@deepseek-ai/dsh-client-ui-sidebar",
|
|
17
|
+
"@deepseek-ai/dsh-client-ui-workspace",
|
|
18
|
+
"@deepseek-ai/dsh-client-ui-primitives",
|
|
19
|
+
"@deepseek-ai/dsh-api-session-controller",
|
|
20
|
+
"@deepseek-ai/dsh-client-ui-conversation"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# 技能中文展示
|
|
2
|
+
|
|
3
|
+
展示名称来自随附技能的 frontmatter `metadata.displayName`,说明来自简短中文
|
|
4
|
+
`description`。管理页、输入 `/` 后的技能列表、技能引用与历史技能调用摘要显示中文。
|
|
5
|
+
原始 kebab-case `name` 继续用于加载、保存、导出、引用预览和模型调用。
|
|
6
|
+
|
|
7
|
+
插件仅使用公开 slots 包装官方组件:`tool.call.toolview/skill`、
|
|
8
|
+
`conversation.user.text.node/skill`、`conversation.input.overlay/slash-menu`。
|
|
9
|
+
菜单 SnapshotStore 的展示副本不改变原 source、候选序号、原控制器或持久内容;测试使用
|
|
10
|
+
真实官方 InputTriggerController 验证选中中文行后仍取得原始英文 ID。
|
|
11
|
+
|
|
12
|
+
RC.2 的官方候选目录仍未贯通中文显示字段,不能将本次中文展示宣称为支持 `/文档`
|
|
13
|
+
等中文关键词检索。当前可输入 `/` 选择中文行,也可按原 ID 调用。公开接口不提供读取或
|
|
14
|
+
替换已有 source;不使用私有 roster、不复制输入控制器、不修改已安装依赖。详细源码
|
|
15
|
+
证据、接口限制和最小上游补丁建议见 [UPSTREAM.md](UPSTREAM.md)。
|
|
16
|
+
|
|
17
|
+
只读展示插件可独立于个人扩展管理开关加载;不会注册技能管理路由、创建个人技能目录或
|
|
18
|
+
开放安装能力。个人管理入口与操作仍由原技能管理插件和原身份/路径校验负责。
|
|
19
|
+
|
|
20
|
+
技能管理仅在侧栏「技能」提供入口。本展示插件不再注册 `settings.section`,也不需要读取
|
|
21
|
+
管理开关的启动标志;管理开关继续由 Host profile 决定是否装配独立管理插件。
|
|
22
|
+
|
|
23
|
+
展示包装同时等待 slot 声明与原始条目注册,使用公开 `slots.entries/subscribe` 跟踪原条目;
|
|
24
|
+
上游条目晚到或替换时更新包装,忽略本插件自己的优先级条目,避免时序漏装或自引用。
|
|
25
|
+
真实 Cordis + SlotRegistry 回归覆盖原条目先到、晚到与插件卸载;另用同版本官方 Web
|
|
26
|
+
构建随附的真实 React/react-dom 在 happy-dom 挂载菜单,检查快照稳定性和原候选 ID。
|
|
27
|
+
这些检查不等于完整浏览器会话启动或用户页面视觉验收。
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# 中文技能检索:alpha.3 上游缺口与最小回馈
|
|
2
|
+
|
|
3
|
+
当前实现完成中文展示与原 ID 选择,但不能声称 `/文档` 已能按显示名查到「文档处理」。
|
|
4
|
+
输入 `/` 打开目录后选择中文行仍使用原 ID;按原 `/windy-case-overview` 调用仍兼容。
|
|
5
|
+
|
|
6
|
+
## 已核实的接口限制
|
|
7
|
+
|
|
8
|
+
依据安装的 `0.2.1-rc.2` 官方源码与公开声明:
|
|
9
|
+
|
|
10
|
+
1. `@deepseek-ai/dsh-skill` 的 `SkillCandidate` 和 `SkillDefinition` 支持 frontmatter
|
|
11
|
+
`metadata`,但 `SkillSummary` 无 `displayName`,`toSummary()` 明确只投影原字段,
|
|
12
|
+
`list()` 因而丢失 `metadata.displayName`。
|
|
13
|
+
2. `@deepseek-ai/dsh-api-session-controller` 的 `SkillEntry` 只提供
|
|
14
|
+
`name/path/description/whenToUse/modelInvocable`;`SessionSkillCatalog.list()` 再次明确
|
|
15
|
+
按这些字段构造 RPC 响应。仅在项目技能里增加 metadata 无法把 label 传到官方候选源。
|
|
16
|
+
3. `@deepseek-ai/dsh-client-ui-skill` 的候选源先执行
|
|
17
|
+
`rankByName(skills, query)`,再构造候选,没有提供中文 `label`。官方 primitives 的
|
|
18
|
+
`rankByName` 已支持同时匹配 `name` 与 `label`,缺的是 label 的贯通。
|
|
19
|
+
4. `InputTriggerServiceContract` 公开的只有 `registerSource(src)` 和
|
|
20
|
+
`sessionOf(actx)`,没有查找/替换已有 source 的方法。同一 trigger/name 重复注册会
|
|
21
|
+
抛错。Controller 的 roster 是私有依赖;访问 `live.sources` 或修改已有 service 方法
|
|
22
|
+
不属于公开扩展点。
|
|
23
|
+
|
|
24
|
+
不能通过显示 SnapshotStore 包装增加真正的检索候选;也不能让菜单虚构候选或隐藏原控制器
|
|
25
|
+
仍会选中的条目。这会导致键盘和指针选择不一致,或把 `/中文名` 错当执行 ID。
|
|
26
|
+
|
|
27
|
+
## 最小上游补丁
|
|
28
|
+
|
|
29
|
+
保持所有原 ID、权限和调用协议,在上游完成以下窄改动并发布:
|
|
30
|
+
|
|
31
|
+
- `dsh-skill`:在 `SkillSummary` 增加可选只读 `displayName`。在 `toSummary()` 中从
|
|
32
|
+
candidate 的 `metadata.displayName` 提取经过类型、单行和长度校验的值,缺失则不填。
|
|
33
|
+
- `dsh-api-session-controller`:在 `SkillEntry` 增加可选 `displayName`,在
|
|
34
|
+
`SessionSkillCatalog.list()` 投影该字段;同步生成的 typert Remote 类型/契约。
|
|
35
|
+
- `dsh-client-ui-skill`:候选构造顺序改成以下逻辑,`onPick`、lexicon、reference codec
|
|
36
|
+
和模型序列化均保持原 ID:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
const named = skills.map((skill) => ({
|
|
40
|
+
...skill,
|
|
41
|
+
...(skill.displayName ? { label: skill.displayName } : {}),
|
|
42
|
+
}));
|
|
43
|
+
return rankByName(named, query).map((skill) => ({
|
|
44
|
+
name: skill.name,
|
|
45
|
+
...(skill.label ? { label: skill.label } : {}),
|
|
46
|
+
description: skill.description,
|
|
47
|
+
}));
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
至少补充「中文 query 命中中文 label」「英文 ID 仍命中」「选择中文行仍提交英文 ID」
|
|
51
|
+
「缺失/非法 displayName 保持兼容」「user-only/subagent/取消/冷会话行为不变」测试。
|
|
52
|
+
|
|
53
|
+
项目现有展示包装可保留,也可在升级后收缩;升级前不修改 `node_modules`、不访问私有
|
|
54
|
+
roster、不复制输入控制器。本文描述的是待回馈方案,尚未向上游提交或证明中文 query 可用。
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { expect, test } from "bun:test";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import { runInNewContext } from "node:vm";
|
|
5
|
+
import * as Cordis from "@deepseek-ai/cordis";
|
|
6
|
+
import * as Slots from "@deepseek-ai/dsh-client-ui-slots";
|
|
7
|
+
const require = createRequire(import.meta.url);
|
|
8
|
+
type Plugin = { inject?: string[]; apply(ctx: unknown): void };
|
|
9
|
+
function load(
|
|
10
|
+
path: string,
|
|
11
|
+
dependencies: Record<string, unknown>,
|
|
12
|
+
globals: Record<string, unknown> = {},
|
|
13
|
+
) {
|
|
14
|
+
let result: unknown;
|
|
15
|
+
runInNewContext(readFileSync(path, "utf8"), {
|
|
16
|
+
console,
|
|
17
|
+
setTimeout,
|
|
18
|
+
clearTimeout,
|
|
19
|
+
queueMicrotask,
|
|
20
|
+
AbortController,
|
|
21
|
+
URL,
|
|
22
|
+
document: { baseURI: "http://localhost/agent/" },
|
|
23
|
+
fetch: async () => ({ ok: false }),
|
|
24
|
+
window: {
|
|
25
|
+
...globals,
|
|
26
|
+
addEventListener() {},
|
|
27
|
+
removeEventListener() {},
|
|
28
|
+
__ModuleLoader__: {
|
|
29
|
+
load(module: { factory(require: (name: string) => unknown): unknown }) {
|
|
30
|
+
result = module.factory((name) => dependencies[name] || {});
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
const React = {
|
|
38
|
+
Component: class {},
|
|
39
|
+
createContext: () => ({}),
|
|
40
|
+
memo: (value: unknown) => value,
|
|
41
|
+
forwardRef: (value: unknown) => value,
|
|
42
|
+
createElement: (type: unknown, props: object) => ({ type, props }),
|
|
43
|
+
};
|
|
44
|
+
type Entry = {
|
|
45
|
+
component: unknown;
|
|
46
|
+
options: { key?: string; id?: string; priority?: number };
|
|
47
|
+
};
|
|
48
|
+
type Registry = {
|
|
49
|
+
register(options: object, component: unknown): () => void;
|
|
50
|
+
entriesOfSlot(name: string): Entry[];
|
|
51
|
+
};
|
|
52
|
+
for (const late of [false, true])
|
|
53
|
+
test(`official SlotRegistry applies presentation plugins with ${late ? "late" : "existing"} upstream entries`, async () => {
|
|
54
|
+
const renderer = load(
|
|
55
|
+
require.resolve("@deepseek-ai/dsh-client-ui-renderer/client"),
|
|
56
|
+
{
|
|
57
|
+
react: React,
|
|
58
|
+
"@deepseek-ai/cordis": Cordis,
|
|
59
|
+
"@deepseek-ai/dsh-client-ui-slots": Slots,
|
|
60
|
+
},
|
|
61
|
+
) as { SlotRegistry: new (ctx: Cordis.Context) => unknown };
|
|
62
|
+
const ctx = new Cordis.Context();
|
|
63
|
+
const registryFiber = ctx.plugin(
|
|
64
|
+
renderer.SlotRegistry as never,
|
|
65
|
+
{} as never,
|
|
66
|
+
);
|
|
67
|
+
await registryFiber.await();
|
|
68
|
+
const registry = ctx.get("slots") as Registry;
|
|
69
|
+
registry.register(
|
|
70
|
+
{
|
|
71
|
+
name: "root",
|
|
72
|
+
children: {
|
|
73
|
+
"tool.call.toolview": { kind: "keyed", scope: "session" },
|
|
74
|
+
"conversation.chat.node": { kind: "keyed", scope: "session" },
|
|
75
|
+
"conversation.user.text.node": { kind: "keyed", scope: "session" },
|
|
76
|
+
"conversation.input.overlay": { kind: "list", scope: "session" },
|
|
77
|
+
"settings.section": { kind: "list", scope: "root" },
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
() => null,
|
|
81
|
+
);
|
|
82
|
+
const registerOriginals = () => {
|
|
83
|
+
for (const [name, key] of [
|
|
84
|
+
["tool.call.toolview", "skill"],
|
|
85
|
+
["conversation.chat.node", "context"],
|
|
86
|
+
["conversation.user.text.node", "skill"],
|
|
87
|
+
["conversation.input.overlay", "slash-menu"],
|
|
88
|
+
]) {
|
|
89
|
+
registry.register(
|
|
90
|
+
{
|
|
91
|
+
name,
|
|
92
|
+
...(name === "conversation.input.overlay" ? { id: key } : { key }),
|
|
93
|
+
locale: "skill",
|
|
94
|
+
},
|
|
95
|
+
() => null,
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
if (!late) registerOriginals();
|
|
100
|
+
ctx.provide("layout", { selectPanel() {} } as never);
|
|
101
|
+
const skill = load(
|
|
102
|
+
new URL("./client.js", import.meta.url).pathname,
|
|
103
|
+
{ react: React },
|
|
104
|
+
{ __WINDY_SKILL_MANAGEMENT_ENABLED__: true, __WINDY_SKILL_DISPLAY__: {} },
|
|
105
|
+
) as Plugin;
|
|
106
|
+
const tool = load(
|
|
107
|
+
new URL("../../tool-presentation/client.js", import.meta.url).pathname,
|
|
108
|
+
{ react: React },
|
|
109
|
+
{
|
|
110
|
+
__WINDY_TOOL_DISPLAY__: [
|
|
111
|
+
{ name: "mcp__windy__query", displayName: "查询" },
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
) as Plugin;
|
|
115
|
+
const plugins = [
|
|
116
|
+
ctx.plugin(skill as never, {} as never),
|
|
117
|
+
ctx.plugin(tool as never, {} as never),
|
|
118
|
+
];
|
|
119
|
+
try {
|
|
120
|
+
for (const plugin of plugins) await plugin.await();
|
|
121
|
+
if (late) registerOriginals();
|
|
122
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
123
|
+
for (const [slot, key] of [
|
|
124
|
+
["tool.call.toolview", "skill"],
|
|
125
|
+
["conversation.chat.node", "context"],
|
|
126
|
+
["conversation.user.text.node", "skill"],
|
|
127
|
+
["conversation.input.overlay", "slash-menu"],
|
|
128
|
+
]) {
|
|
129
|
+
expect(
|
|
130
|
+
registry
|
|
131
|
+
.entriesOfSlot(slot!)
|
|
132
|
+
.find((entry) => (entry.options.key || entry.options.id) === key)
|
|
133
|
+
?.options.priority,
|
|
134
|
+
).toBe(-100);
|
|
135
|
+
}
|
|
136
|
+
expect(
|
|
137
|
+
registry
|
|
138
|
+
.entriesOfSlot("settings.section")
|
|
139
|
+
.some((entry) => entry.options.id === "windy-skills"),
|
|
140
|
+
).toBe(false);
|
|
141
|
+
expect(
|
|
142
|
+
registry
|
|
143
|
+
.entriesOfSlot("tool.call.toolview")
|
|
144
|
+
.some((entry) => entry.options.key === "mcp__windy__query"),
|
|
145
|
+
).toBe(true);
|
|
146
|
+
} finally {
|
|
147
|
+
for (const plugin of plugins.reverse()) await plugin.dispose();
|
|
148
|
+
await registryFiber.dispose();
|
|
149
|
+
}
|
|
150
|
+
});
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({
|
|
2
|
+
id: "@southwind-ai/dsh-skill-presentation",
|
|
3
|
+
factory(require) {
|
|
4
|
+
const React = require("react"),
|
|
5
|
+
h = React.createElement;
|
|
6
|
+
const { ReferenceChip } = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
7
|
+
const display = window.__WINDY_SKILL_DISPLAY__ || {};
|
|
8
|
+
const known = (name) => Object.hasOwn(display, name);
|
|
9
|
+
const title = (name) =>
|
|
10
|
+
known(name) ? display[name].displayName : "个人技能";
|
|
11
|
+
function translatedCall(block) {
|
|
12
|
+
const call = block.call || block;
|
|
13
|
+
try {
|
|
14
|
+
const args = JSON.parse(call.argsRaw);
|
|
15
|
+
if (typeof args.name !== "string" || !known(args.name)) return block;
|
|
16
|
+
const copy = {
|
|
17
|
+
...call,
|
|
18
|
+
argsRaw: JSON.stringify({ ...args, name: title(args.name) }),
|
|
19
|
+
};
|
|
20
|
+
return block.call
|
|
21
|
+
? { ...block, call: copy }
|
|
22
|
+
: { ...block, argsRaw: copy.argsRaw };
|
|
23
|
+
} catch {
|
|
24
|
+
return block;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function afterEntry(ctx, slot, key, install) {
|
|
28
|
+
ctx.slots.inject(slot, () => {
|
|
29
|
+
let original, dispose;
|
|
30
|
+
const reconcile = () => {
|
|
31
|
+
const next = ctx.slots
|
|
32
|
+
.entries(slot)
|
|
33
|
+
.find(
|
|
34
|
+
(entry) =>
|
|
35
|
+
(entry.options.key || entry.options.id) === key &&
|
|
36
|
+
entry.options.priority !== -100,
|
|
37
|
+
);
|
|
38
|
+
if (next === original) return;
|
|
39
|
+
dispose?.();
|
|
40
|
+
original = next;
|
|
41
|
+
dispose = next ? install(next) : undefined;
|
|
42
|
+
};
|
|
43
|
+
const off = ctx.slots.subscribe(slot, reconcile);
|
|
44
|
+
reconcile();
|
|
45
|
+
return () => {
|
|
46
|
+
off();
|
|
47
|
+
dispose?.();
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function apply(ctx) {
|
|
52
|
+
afterEntry(ctx, "tool.call.toolview", "skill", (original) => {
|
|
53
|
+
return ctx.slots.register(
|
|
54
|
+
{
|
|
55
|
+
name: "tool.call.toolview",
|
|
56
|
+
key: "skill",
|
|
57
|
+
priority: -100,
|
|
58
|
+
locale: original.locale,
|
|
59
|
+
},
|
|
60
|
+
(props) =>
|
|
61
|
+
h(original.component, {
|
|
62
|
+
...props,
|
|
63
|
+
block: translatedCall(props.block),
|
|
64
|
+
}),
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
afterEntry(ctx, "conversation.user.text.node", "skill", (original) => {
|
|
68
|
+
function SkillReference(props) {
|
|
69
|
+
const name = props.node.data.name;
|
|
70
|
+
if (!known(name)) return h(original.component, props);
|
|
71
|
+
return h(ReferenceChip, {
|
|
72
|
+
appearance: "skill",
|
|
73
|
+
label: title(name),
|
|
74
|
+
title: title(name),
|
|
75
|
+
...(props.interactive
|
|
76
|
+
? { onActivate: () => props.openSkill(name) }
|
|
77
|
+
: {}),
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return ctx.slots.register(
|
|
81
|
+
{
|
|
82
|
+
name: "conversation.user.text.node",
|
|
83
|
+
key: "skill",
|
|
84
|
+
priority: -100,
|
|
85
|
+
inject: original.inject,
|
|
86
|
+
},
|
|
87
|
+
SkillReference,
|
|
88
|
+
);
|
|
89
|
+
});
|
|
90
|
+
afterEntry(
|
|
91
|
+
ctx,
|
|
92
|
+
"conversation.input.overlay",
|
|
93
|
+
"slash-menu",
|
|
94
|
+
(original) => {
|
|
95
|
+
function SkillMenu(props) {
|
|
96
|
+
const menu = React.useMemo(() => {
|
|
97
|
+
let previous, translated;
|
|
98
|
+
return {
|
|
99
|
+
...props.menu,
|
|
100
|
+
getSnapshot() {
|
|
101
|
+
const snapshot = props.menu.getSnapshot();
|
|
102
|
+
if (snapshot === previous) return translated;
|
|
103
|
+
previous = snapshot;
|
|
104
|
+
translated = {
|
|
105
|
+
...snapshot,
|
|
106
|
+
groups: snapshot.groups.map((group) =>
|
|
107
|
+
group.source !== "skill"
|
|
108
|
+
? group
|
|
109
|
+
: {
|
|
110
|
+
...group,
|
|
111
|
+
items: group.items.map((item) =>
|
|
112
|
+
known(item.name)
|
|
113
|
+
? {
|
|
114
|
+
...item,
|
|
115
|
+
name: title(item.name),
|
|
116
|
+
label: title(item.name),
|
|
117
|
+
description: display[item.name].summary,
|
|
118
|
+
}
|
|
119
|
+
: item,
|
|
120
|
+
),
|
|
121
|
+
},
|
|
122
|
+
),
|
|
123
|
+
};
|
|
124
|
+
return translated;
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
}, [props.menu]);
|
|
128
|
+
return h(original.component, { ...props, menu });
|
|
129
|
+
}
|
|
130
|
+
return ctx.slots.register(
|
|
131
|
+
{
|
|
132
|
+
name: "conversation.input.overlay",
|
|
133
|
+
id: "slash-menu",
|
|
134
|
+
priority: -100,
|
|
135
|
+
order: 0,
|
|
136
|
+
locale: original.locale,
|
|
137
|
+
inject: original.inject,
|
|
138
|
+
},
|
|
139
|
+
SkillMenu,
|
|
140
|
+
);
|
|
141
|
+
},
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
return { inject: ["slots"], apply };
|
|
145
|
+
},
|
|
146
|
+
});
|