create-windy 0.8.3 → 0.10.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.
Files changed (691) hide show
  1. package/dist/cli.js +2714 -1944
  2. package/package.json +2 -2
  3. package/template/.agents/skills/windy-business-module/SKILL.md +33 -1
  4. package/template/.windy-template.json +6 -2
  5. package/template/AGENTS.md +4 -0
  6. package/template/README.md +2 -0
  7. package/template/apps/agent-server/Dockerfile +92 -22
  8. package/template/apps/agent-server/README.md +47 -85
  9. package/template/apps/agent-server/documents/office.py +216 -0
  10. package/template/apps/agent-server/documents/query_report.py +136 -0
  11. package/template/apps/agent-server/documents/smoke.py +177 -0
  12. package/template/apps/agent-server/documents/test_boundaries.py +185 -0
  13. package/template/apps/agent-server/host-contracts.ts +56 -0
  14. package/template/apps/agent-server/install-native.ts +167 -0
  15. package/template/apps/agent-server/main.ts +179 -0
  16. package/template/apps/agent-server/native/EXTENSIONS.md +46 -0
  17. package/template/apps/agent-server/native/admission.ts +73 -0
  18. package/template/apps/agent-server/native/authorization.test.ts +176 -0
  19. package/template/apps/agent-server/native/authorization.ts +118 -0
  20. package/template/apps/agent-server/native/boundary-io.ts +93 -0
  21. package/template/apps/agent-server/native/boundary-product.ts +107 -0
  22. package/template/apps/agent-server/native/boundary-project.test.ts +247 -0
  23. package/template/apps/agent-server/native/boundary-project.ts +188 -0
  24. package/template/apps/agent-server/native/boundary.ts +188 -0
  25. package/template/apps/agent-server/native/compaction-policy.test.ts +175 -0
  26. package/template/apps/agent-server/native/config.ts +95 -0
  27. package/template/apps/agent-server/native/conversation-instructions.ts +9 -0
  28. package/template/apps/agent-server/native/extensions.test.ts +190 -0
  29. package/template/apps/agent-server/native/extensions.ts +31 -0
  30. package/template/apps/agent-server/native/host-profile.test.ts +91 -0
  31. package/template/apps/agent-server/native/host-profile.ts +33 -0
  32. package/template/apps/agent-server/native/host-test-fixture.ts +13 -0
  33. package/template/apps/agent-server/native/http.ts +129 -0
  34. package/template/apps/agent-server/native/lifecycle.test.ts +285 -0
  35. package/template/apps/agent-server/native/lifecycle.ts +136 -0
  36. package/template/apps/agent-server/native/manager.ts +292 -0
  37. package/template/apps/agent-server/native/native.test.ts +207 -0
  38. package/template/apps/agent-server/native/office-preview.test.ts +50 -0
  39. package/template/apps/agent-server/native/office-preview.ts +25 -0
  40. package/template/apps/agent-server/native/parallel-harness.ts +244 -0
  41. package/template/apps/agent-server/native/parallel-mcp-fixture.ts +97 -0
  42. package/template/apps/agent-server/native/parallel.test.ts +256 -0
  43. package/template/apps/agent-server/native/profile-composition.test.ts +147 -0
  44. package/template/apps/agent-server/native/profile.ts +307 -0
  45. package/template/apps/agent-server/native/request.ts +61 -0
  46. package/template/apps/agent-server/native/session-conflict.test.ts +235 -0
  47. package/template/apps/agent-server/native/session-conflict.ts +21 -0
  48. package/template/apps/agent-server/native/shared-skills.test.ts +128 -0
  49. package/template/apps/agent-server/native/shared-skills.ts +240 -0
  50. package/template/apps/agent-server/native/socket-lifecycle.test.ts +48 -0
  51. package/template/apps/agent-server/native/socket.ts +130 -0
  52. package/template/apps/agent-server/native/storage-lifecycle.test.ts +218 -0
  53. package/template/apps/agent-server/native/storage.ts +188 -0
  54. package/template/apps/agent-server/native/stream-authorization.test.ts +89 -0
  55. package/template/apps/agent-server/native/worker.ts +77 -0
  56. package/template/apps/agent-server/native-download.test.ts +119 -0
  57. package/template/apps/agent-server/native-download.ts +145 -0
  58. package/template/apps/agent-server/package.json +64 -0
  59. package/template/apps/agent-server/plugins/access.mjs +126 -0
  60. package/template/apps/agent-server/plugins/branding/README.md +9 -0
  61. package/template/apps/agent-server/plugins/branding/brand.css +85 -0
  62. package/template/apps/agent-server/plugins/branding/client.js +338 -0
  63. package/template/apps/agent-server/plugins/branding/index.mjs +35 -0
  64. package/template/apps/agent-server/plugins/branding/loading.d.mts +2 -0
  65. package/template/apps/agent-server/plugins/branding/loading.mjs +66 -0
  66. package/template/apps/agent-server/plugins/branding/loading.test.ts +89 -0
  67. package/template/apps/agent-server/plugins/branding/package.json +21 -0
  68. package/template/apps/agent-server/plugins/branding.test.ts +294 -0
  69. package/template/apps/agent-server/plugins/compaction.mjs +83 -0
  70. package/template/apps/agent-server/plugins/compaction.test.ts +91 -0
  71. package/template/apps/agent-server/plugins/confine-network.py +57 -0
  72. package/template/apps/agent-server/plugins/default-skills.test.ts +62 -0
  73. package/template/apps/agent-server/plugins/downloads/README.md +28 -0
  74. package/template/apps/agent-server/plugins/downloads/client.js +126 -0
  75. package/template/apps/agent-server/plugins/downloads/downloads.test.ts +222 -0
  76. package/template/apps/agent-server/plugins/downloads/index.d.mts +19 -0
  77. package/template/apps/agent-server/plugins/downloads/index.mjs +180 -0
  78. package/template/apps/agent-server/plugins/downloads/package.json +20 -0
  79. package/template/apps/agent-server/plugins/drop-overlay/README.md +24 -0
  80. package/template/apps/agent-server/plugins/drop-overlay/drop-overlay.test.ts +199 -0
  81. package/template/apps/agent-server/plugins/drop-overlay/index.d.mts +8 -0
  82. package/template/apps/agent-server/plugins/drop-overlay/index.mjs +12 -0
  83. package/template/apps/agent-server/plugins/drop-overlay/style.css +102 -0
  84. package/template/apps/agent-server/plugins/locale/client.js +61 -0
  85. package/template/apps/agent-server/plugins/locale/index.d.mts +9 -0
  86. package/template/apps/agent-server/plugins/locale/index.mjs +16 -0
  87. package/template/apps/agent-server/plugins/locale/locale.test.ts +217 -0
  88. package/template/apps/agent-server/plugins/locale/package.json +19 -0
  89. package/template/apps/agent-server/plugins/parallel.mjs +146 -0
  90. package/template/apps/agent-server/plugins/preset-registry.d.mts +2 -0
  91. package/template/apps/agent-server/plugins/preset-registry.mjs +41 -0
  92. package/template/apps/agent-server/plugins/preset-registry.test.ts +46 -0
  93. package/template/apps/agent-server/plugins/questions.d.mts +25 -0
  94. package/template/apps/agent-server/plugins/questions.mjs +142 -0
  95. package/template/apps/agent-server/plugins/questions.test.ts +105 -0
  96. package/template/apps/agent-server/plugins/settings/README.md +17 -0
  97. package/template/apps/agent-server/plugins/settings/client.js +102 -0
  98. package/template/apps/agent-server/plugins/settings/index.mjs +17 -0
  99. package/template/apps/agent-server/plugins/settings/package.json +19 -0
  100. package/template/apps/agent-server/plugins/settings/settings.test.ts +129 -0
  101. package/template/apps/agent-server/plugins/settings-controller.d.mts +4 -0
  102. package/template/apps/agent-server/plugins/settings-controller.mjs +31 -0
  103. package/template/apps/agent-server/plugins/settings-controller.test.ts +17 -0
  104. package/template/apps/agent-server/plugins/settings-dispatch.test.ts +34 -0
  105. package/template/apps/agent-server/plugins/shared-skills.d.mts +15 -0
  106. package/template/apps/agent-server/plugins/shared-skills.mjs +82 -0
  107. package/template/apps/agent-server/plugins/shared-skills.test.ts +51 -0
  108. package/template/apps/agent-server/plugins/skill-library/README.md +11 -0
  109. package/template/apps/agent-server/plugins/skill-library/archive.test.ts +43 -0
  110. package/template/apps/agent-server/plugins/skill-library/bundle.mjs +234 -0
  111. package/template/apps/agent-server/plugins/skill-library/client-chunks.test.ts +110 -0
  112. package/template/apps/agent-server/plugins/skill-library/client-form-mount.test.ts +139 -0
  113. package/template/apps/agent-server/plugins/skill-library/client-form.test.ts +261 -0
  114. package/template/apps/agent-server/plugins/skill-library/client-ui.test.ts +268 -0
  115. package/template/apps/agent-server/plugins/skill-library/client-use.test.ts +158 -0
  116. package/template/apps/agent-server/plugins/skill-library/client.editor.js +93 -0
  117. package/template/apps/agent-server/plugins/skill-library/client.form.js +316 -0
  118. package/template/apps/agent-server/plugins/skill-library/client.js +348 -0
  119. package/template/apps/agent-server/plugins/skill-library/client.request.js +52 -0
  120. package/template/apps/agent-server/plugins/skill-library/client.transfer.js +48 -0
  121. package/template/apps/agent-server/plugins/skill-library/client.use.js +46 -0
  122. package/template/apps/agent-server/plugins/skill-library/default-roots.test.ts +84 -0
  123. package/template/apps/agent-server/plugins/skill-library/draft.d.mts +17 -0
  124. package/template/apps/agent-server/plugins/skill-library/draft.mjs +152 -0
  125. package/template/apps/agent-server/plugins/skill-library/draft.test.ts +287 -0
  126. package/template/apps/agent-server/plugins/skill-library/index.d.mts +49 -0
  127. package/template/apps/agent-server/plugins/skill-library/index.mjs +226 -0
  128. package/template/apps/agent-server/plugins/skill-library/package.json +24 -0
  129. package/template/apps/agent-server/plugins/skill-library/presentation/README.md +27 -0
  130. package/template/apps/agent-server/plugins/skill-library/presentation/UPSTREAM.md +54 -0
  131. package/template/apps/agent-server/plugins/skill-library/presentation/boot.test.ts +150 -0
  132. package/template/apps/agent-server/plugins/skill-library/presentation/client.js +146 -0
  133. package/template/apps/agent-server/plugins/skill-library/presentation/client.test.ts +195 -0
  134. package/template/apps/agent-server/plugins/skill-library/presentation/index.d.mts +9 -0
  135. package/template/apps/agent-server/plugins/skill-library/presentation/index.mjs +30 -0
  136. package/template/apps/agent-server/plugins/skill-library/presentation/metadata.test.ts +82 -0
  137. package/template/apps/agent-server/plugins/skill-library/presentation/package.json +21 -0
  138. package/template/apps/agent-server/plugins/skill-library/presentation/react-boot.test.ts +162 -0
  139. package/template/apps/agent-server/plugins/skill-library/skills.test.ts +342 -0
  140. package/template/apps/agent-server/plugins/skill-library/storage.mjs +293 -0
  141. package/template/apps/agent-server/plugins/skill-library/style.css +229 -0
  142. package/template/apps/agent-server/plugins/skill-library/test-fixture.ts +77 -0
  143. package/template/apps/agent-server/plugins/skill-library/workflow.d.mts +18 -0
  144. package/template/apps/agent-server/plugins/skill-library/workflow.mjs +189 -0
  145. package/template/apps/agent-server/plugins/skill-library/workflow.test.ts +164 -0
  146. package/template/apps/agent-server/plugins/skills/README.md +5 -0
  147. package/template/apps/agent-server/plugins/skills/windy-data-summary/SKILL.md +14 -0
  148. package/template/apps/agent-server/plugins/skills/windy-extension-guide/SKILL.md +14 -0
  149. package/template/apps/agent-server/plugins/skills/windy-office/SKILL.md +14 -0
  150. package/template/apps/agent-server/plugins/skills/windy-skill-capture/SKILL.md +14 -0
  151. package/template/apps/agent-server/plugins/skills/windy-source-compare/SKILL.md +14 -0
  152. package/template/apps/agent-server/plugins/subprocess.mjs +40 -0
  153. package/template/apps/agent-server/plugins/theme/README.md +22 -0
  154. package/template/apps/agent-server/plugins/theme/client.js +18 -0
  155. package/template/apps/agent-server/plugins/theme/index.d.mts +9 -0
  156. package/template/apps/agent-server/plugins/theme/index.mjs +18 -0
  157. package/template/apps/agent-server/plugins/theme/package.json +19 -0
  158. package/template/apps/agent-server/plugins/theme/source-tokens.ts +81 -0
  159. package/template/apps/agent-server/plugins/theme/sync-tokens.ts +12 -0
  160. package/template/apps/agent-server/plugins/theme/theme.test.ts +193 -0
  161. package/template/apps/agent-server/plugins/theme/tokens.json +162 -0
  162. package/template/apps/agent-server/plugins/tool-catalog/README.md +82 -0
  163. package/template/apps/agent-server/plugins/tool-catalog/categories.mjs +111 -0
  164. package/template/apps/agent-server/plugins/tool-catalog/categories.test.ts +118 -0
  165. package/template/apps/agent-server/plugins/tool-catalog/client-cache.test.ts +264 -0
  166. package/template/apps/agent-server/plugins/tool-catalog/client.js +333 -0
  167. package/template/apps/agent-server/plugins/tool-catalog/client.test.ts +136 -0
  168. package/template/apps/agent-server/plugins/tool-catalog/discovery.d.mts +42 -0
  169. package/template/apps/agent-server/plugins/tool-catalog/discovery.mjs +245 -0
  170. package/template/apps/agent-server/plugins/tool-catalog/discovery.test.ts +291 -0
  171. package/template/apps/agent-server/plugins/tool-catalog/index.d.mts +5 -0
  172. package/template/apps/agent-server/plugins/tool-catalog/index.mjs +91 -0
  173. package/template/apps/agent-server/plugins/tool-catalog/package.json +23 -0
  174. package/template/apps/agent-server/plugins/tool-catalog/presentation.d.mts +21 -0
  175. package/template/apps/agent-server/plugins/tool-catalog/presentation.mjs +153 -0
  176. package/template/apps/agent-server/plugins/tool-catalog/presentation.test.ts +166 -0
  177. package/template/apps/agent-server/plugins/tool-catalog/routes.test.ts +209 -0
  178. package/template/apps/agent-server/plugins/tool-catalog/style.css +155 -0
  179. package/template/apps/agent-server/plugins/tool-catalog/use-tool.test.ts +160 -0
  180. package/template/apps/agent-server/plugins/tool-presentation/README.md +7 -0
  181. package/template/apps/agent-server/plugins/tool-presentation/build-client.ts +29 -0
  182. package/template/apps/agent-server/plugins/tool-presentation/client.js +312 -0
  183. package/template/apps/agent-server/plugins/tool-presentation/client.results.js +9 -0
  184. package/template/apps/agent-server/plugins/tool-presentation/client.test.ts +178 -0
  185. package/template/apps/agent-server/plugins/tool-presentation/index.mjs +10 -0
  186. package/template/apps/agent-server/plugins/tool-presentation/package.json +24 -0
  187. package/template/apps/agent-server/plugins/tool-presentation/result-discovery.mjs +43 -0
  188. package/template/apps/agent-server/plugins/tool-presentation/result-model.d.mts +51 -0
  189. package/template/apps/agent-server/plugins/tool-presentation/result-model.mjs +96 -0
  190. package/template/apps/agent-server/plugins/workspace/README.md +5 -0
  191. package/template/apps/agent-server/plugins/workspace/index.mjs +8 -0
  192. package/template/apps/agent-server/plugins/workspace/package.json +10 -0
  193. package/template/apps/agent-server/plugins/workspace/style.css +124 -0
  194. package/template/apps/agent-server/project/host.ts +13 -0
  195. package/template/apps/agent-server/runtime/artifacts.ts +115 -0
  196. package/template/apps/agent-server/runtime/audit.nodecheck.ts +60 -0
  197. package/template/apps/agent-server/runtime/capacity.ts +61 -0
  198. package/template/apps/agent-server/runtime/client-completion-budget.nodecheck.ts +92 -0
  199. package/template/apps/agent-server/runtime/compatibility.ts +39 -0
  200. package/template/apps/agent-server/runtime/completions.ts +320 -0
  201. package/template/apps/agent-server/runtime/config.ts +246 -0
  202. package/template/apps/agent-server/runtime/context-budget.ts +70 -0
  203. package/template/apps/agent-server/runtime/context-plugin.ts +306 -0
  204. package/template/apps/agent-server/runtime/context.nodecheck.ts +241 -0
  205. package/template/apps/agent-server/runtime/contracts.ts +201 -0
  206. package/template/apps/agent-server/runtime/dsh-engine.ts +198 -0
  207. package/template/apps/agent-server/runtime/evaluation-plugin.ts +115 -0
  208. package/template/apps/agent-server/runtime/evaluation.nodecheck.ts +194 -0
  209. package/template/apps/agent-server/runtime/events.ts +71 -0
  210. package/template/apps/agent-server/runtime/governance.ts +194 -0
  211. package/template/apps/agent-server/runtime/index.ts +339 -0
  212. package/template/apps/agent-server/runtime/internal-output.ts +37 -0
  213. package/template/apps/agent-server/runtime/isolation.nodecheck.ts +287 -0
  214. package/template/apps/agent-server/runtime/model-payload.ts +97 -0
  215. package/template/apps/agent-server/runtime/model-plugin.ts +308 -0
  216. package/template/apps/agent-server/runtime/model-route.ts +34 -0
  217. package/template/apps/agent-server/runtime/model-usage.ts +51 -0
  218. package/template/apps/agent-server/runtime/model-wire.ts +45 -0
  219. package/template/apps/agent-server/runtime/native-authorization.nodecheck.ts +126 -0
  220. package/template/apps/agent-server/runtime/native-completion.nodecheck.ts +81 -0
  221. package/template/apps/agent-server/runtime/output-validation.ts +66 -0
  222. package/template/apps/agent-server/runtime/production-capacity.nodecheck.ts +121 -0
  223. package/template/apps/agent-server/runtime/questions-workflow.nodecheck.ts +251 -0
  224. package/template/apps/agent-server/runtime/report-breakdown.ts +79 -0
  225. package/template/apps/agent-server/runtime/reporting.ts +219 -0
  226. package/template/apps/agent-server/runtime/run-completion.ts +39 -0
  227. package/template/apps/agent-server/runtime/run-request-digest.ts +18 -0
  228. package/template/apps/agent-server/runtime/runtime-test-fixtures.ts +264 -0
  229. package/template/apps/agent-server/runtime/runtime.nodecheck.ts +150 -0
  230. package/template/apps/agent-server/runtime/store-idempotency.nodecheck.ts +74 -0
  231. package/template/apps/agent-server/runtime/store.ts +324 -0
  232. package/template/apps/agent-server/runtime/structured-output-mode.nodecheck.ts +51 -0
  233. package/template/apps/agent-server/runtime/tool-name.ts +6 -0
  234. package/template/apps/agent-server/runtime/tool-plugin.ts +201 -0
  235. package/template/apps/agent-server/runtime/vision-readiness.ts +200 -0
  236. package/template/apps/agent-server/scripts/confinement-check.mjs +103 -0
  237. package/template/apps/agent-server/scripts/coordinator-check.mjs +344 -0
  238. package/template/apps/agent-server/scripts/documents-delivery-check.mjs +309 -0
  239. package/template/apps/agent-server/scripts/office-preview-check.mjs +92 -0
  240. package/template/apps/agent-server/scripts/test-confinement.ts +58 -0
  241. package/template/apps/agent-server/scripts/test-coordinator.ts +36 -0
  242. package/template/apps/agent-server/scripts/test-runtime.ts +46 -0
  243. package/template/apps/agent-server/tsconfig.json +21 -0
  244. package/template/apps/server/Dockerfile +5 -1
  245. package/template/apps/server/package.json +14 -10
  246. package/template/apps/server/scripts/check-dsh-platform-example.ts +251 -0
  247. package/template/apps/server/scripts/validate-module-composition-once.ts +2 -0
  248. package/template/apps/server/scripts/validate-module-composition.ts +8 -4
  249. package/template/apps/server/src/admin/routes.test.ts +29 -1
  250. package/template/apps/server/src/admin/routes.ts +20 -2
  251. package/template/apps/server/src/agent/client-session/completion.ts +1 -1
  252. package/template/apps/server/src/agent/client-session/manifest-admission.ts +1 -1
  253. package/template/apps/server/src/agent/client-session/request.ts +1 -1
  254. package/template/apps/server/src/agent/context-version-routes.ts +37 -13
  255. package/template/apps/server/src/agent/dsh-runtime-wire.test.ts +33 -0
  256. package/template/apps/server/src/agent/governance-runtime.ts +41 -0
  257. package/template/apps/server/src/agent/remote-runtime-response.ts +1 -1
  258. package/template/apps/server/src/agent/run-contracts.ts +1 -0
  259. package/template/apps/server/src/agent/run-definition-support.ts +9 -0
  260. package/template/apps/server/src/agent/run-facade.ts +1 -1
  261. package/template/apps/server/src/agent/run-input-verification.ts +1 -1
  262. package/template/apps/server/src/agent/run-routes.ts +1 -14
  263. package/template/apps/server/src/agent/run-start-preparation.ts +1 -1
  264. package/template/apps/server/src/agent/runtime-bootstrap-input.ts +2 -0
  265. package/template/apps/server/src/agent/runtime-bootstrap.ts +49 -157
  266. package/template/apps/server/src/agent/runtime-disabled-composition.ts +2 -1
  267. package/template/apps/server/src/agent/runtime-tool-composition.ts +2 -0
  268. package/template/apps/server/src/agent/session-invalidation/authorization-revocation.ts +54 -0
  269. package/template/apps/server/src/agent/session-runtime-composition.ts +1 -51
  270. package/template/apps/server/src/agent/unavailable-routes.ts +13 -2
  271. package/template/apps/server/src/agent/workflow-runtime-bootstrap.ts +9 -0
  272. package/template/apps/server/src/agent-skills/access.ts +88 -0
  273. package/template/apps/server/src/agent-skills/bootstrap.ts +49 -0
  274. package/template/apps/server/src/agent-skills/builtin-registration.ts +83 -0
  275. package/template/apps/server/src/agent-skills/builtins.ts +19 -0
  276. package/template/apps/server/src/agent-skills/bundle-zip.ts +163 -0
  277. package/template/apps/server/src/agent-skills/bundle.test.ts +79 -0
  278. package/template/apps/server/src/agent-skills/bundle.ts +133 -0
  279. package/template/apps/server/src/agent-skills/contracts.ts +46 -0
  280. package/template/apps/server/src/agent-skills/drizzle-repository.ts +125 -0
  281. package/template/apps/server/src/agent-skills/input.ts +29 -0
  282. package/template/apps/server/src/agent-skills/postgres.integration.test.ts +348 -0
  283. package/template/apps/server/src/agent-skills/read-routes.test.ts +116 -0
  284. package/template/apps/server/src/agent-skills/reader.ts +108 -0
  285. package/template/apps/server/src/agent-skills/repository.ts +105 -0
  286. package/template/apps/server/src/agent-skills/routes.ts +176 -0
  287. package/template/apps/server/src/agent-skills/service.test.ts +295 -0
  288. package/template/apps/server/src/agent-skills/service.ts +301 -0
  289. package/template/apps/server/src/agent-workflow/preset-registry.test.ts +137 -0
  290. package/template/apps/server/src/agent-workflow/preset-registry.ts +191 -0
  291. package/template/apps/server/src/agent-workflow/preset-routes.test.ts +94 -0
  292. package/template/apps/server/src/agent-workflow/preset-routes.ts +45 -0
  293. package/template/apps/server/src/agent-workflow/runtime-composition.ts +3 -0
  294. package/template/apps/server/src/agent-workflow/service.ts +17 -1
  295. package/template/apps/server/src/ai-artifact/media-resource-route.test.ts +134 -0
  296. package/template/apps/server/src/ai-artifact/routes.ts +1 -1
  297. package/template/apps/server/src/ai-artifact/runtime.ts +12 -0
  298. package/template/apps/server/src/ai-runtime-readiness/operation-port.test-support.ts +1 -1
  299. package/template/apps/server/src/ai-runtime-readiness/operation-port.ts +8 -0
  300. package/template/apps/server/src/ai-runtime-report/service.test.ts +10 -7
  301. package/template/apps/server/src/ai-runtime-report/service.ts +1 -1
  302. package/template/apps/server/src/ai-runtime-security/internal-token.ts +14 -0
  303. package/template/apps/server/src/app/agent-workflow-presets.ts +4 -0
  304. package/template/apps/server/src/app/antivirus-composition.test.ts +63 -0
  305. package/template/apps/server/src/app/antivirus-composition.ts +29 -0
  306. package/template/apps/server/src/app/dsh-skill-draft-audit.test.ts +195 -0
  307. package/template/apps/server/src/app/dsh-skill-draft-audit.ts +115 -0
  308. package/template/apps/server/src/app/dsh-workbench-audit.test.ts +71 -0
  309. package/template/apps/server/src/app/dsh-workbench-audit.ts +34 -0
  310. package/template/apps/server/src/app/dsh-workbench-handshake.test.ts +63 -0
  311. package/template/apps/server/src/app/dsh-workbench-handshake.ts +48 -0
  312. package/template/apps/server/src/app/dsh-workbench-http.test.ts +96 -0
  313. package/template/apps/server/src/app/dsh-workbench-lan-origin.test.ts +114 -0
  314. package/template/apps/server/src/app/dsh-workbench-launch.test.ts +70 -0
  315. package/template/apps/server/src/app/dsh-workbench-origin.test.ts +54 -0
  316. package/template/apps/server/src/app/dsh-workbench-proxy.ts +205 -0
  317. package/template/apps/server/src/app/dsh-workbench-session-conflict.test.ts +61 -0
  318. package/template/apps/server/src/app/dsh-workbench-session.ts +59 -0
  319. package/template/apps/server/src/app/dsh-workbench-socket-audit.test.ts +116 -0
  320. package/template/apps/server/src/app/dsh-workbench-socket.test.ts +246 -0
  321. package/template/apps/server/src/app/dsh-workbench-socket.ts +272 -0
  322. package/template/apps/server/src/app/dsh-workbench-test-support.ts +158 -0
  323. package/template/apps/server/src/app/dsh-workbench.test.ts +213 -0
  324. package/template/apps/server/src/app/dsh-workbench.ts +279 -0
  325. package/template/apps/server/src/app/workbench-public-origin.ts +16 -0
  326. package/template/apps/server/src/configuration/definition.ts +15 -11
  327. package/template/apps/server/src/data-governance/user-plaintext-routes.test.ts +3 -0
  328. package/template/apps/server/src/document/facade-support.ts +2 -2
  329. package/template/apps/server/src/document/facade.ts +2 -2
  330. package/template/apps/server/src/document/output-artifact-composition.ts +9 -5
  331. package/template/apps/server/src/document/output-artifact.test-support.ts +1 -1
  332. package/template/apps/server/src/embedding/facade.ts +1 -1
  333. package/template/apps/server/src/embedding/input.ts +1 -1
  334. package/template/apps/server/src/embedding/routes.ts +1 -1
  335. package/template/apps/server/src/http-app.ts +31 -0
  336. package/template/apps/server/src/index.ts +60 -60
  337. package/template/apps/server/src/license/routes.ts +4 -1
  338. package/template/apps/server/src/license/runtime-business-access.test.ts +261 -0
  339. package/template/apps/server/src/mcp/adapter.ts +1 -0
  340. package/template/apps/server/src/media-runtime/composition.ts +157 -0
  341. package/template/apps/server/src/media-runtime/media-only-composition.ts +44 -0
  342. package/template/apps/server/src/media-runtime/module-ai-port-factory.test.ts +69 -0
  343. package/template/apps/server/src/media-runtime/module-ai-port-factory.ts +72 -0
  344. package/template/apps/server/src/{agent → media-runtime}/runtime-readiness-sources.ts +14 -6
  345. package/template/apps/server/src/media-runtime/shared-composition.ts +104 -0
  346. package/template/apps/server/src/module-composition.test.ts +45 -0
  347. package/template/apps/server/src/module-composition.ts +57 -2
  348. package/template/apps/server/src/module-host/ai-operation-port.ts +97 -30
  349. package/template/apps/server/src/module-host/ai-operation-speech-normalize.test.ts +1 -1
  350. package/template/apps/server/src/module-host/http-runtime.ts +9 -3
  351. package/template/apps/server/src/module-host/static-route-authorization.test.ts +6 -3
  352. package/template/apps/server/src/module-host/storage-authorization-binding.test.ts +4 -0
  353. package/template/apps/server/src/module-runtime-validation.ts +2 -0
  354. package/template/apps/server/src/observability/bootstrap.ts +12 -0
  355. package/template/apps/server/src/observability/diagnostic-failure-recorder.ts +94 -0
  356. package/template/apps/server/src/observability/diagnostic-http-contract.test.ts +42 -0
  357. package/template/apps/server/src/observability/diagnostic-index.test.ts +89 -0
  358. package/template/apps/server/src/observability/diagnostic-index.ts +113 -0
  359. package/template/apps/server/src/observability/diagnostic-repository.ts +96 -0
  360. package/template/apps/server/src/platform-app-bootstrap.ts +42 -0
  361. package/template/apps/server/src/platform-http-runtime.ts +7 -1
  362. package/template/apps/server/src/runtime-development.test.ts +25 -0
  363. package/template/apps/server/src/runtime-development.ts +6 -44
  364. package/template/apps/server/src/runtime-feature.ts +5 -1
  365. package/template/apps/server/src/runtime.ts +3 -0
  366. package/template/apps/server/src/settings/drizzle-watermark-repository.ts +35 -4
  367. package/template/apps/server/src/settings/watermark-repository.ts +14 -0
  368. package/template/apps/server/src/settings/watermark-routes.test.ts +84 -2
  369. package/template/apps/server/src/settings/watermark-routes.ts +109 -0
  370. package/template/apps/server/src/settings/watermark-transfer.ts +79 -0
  371. package/template/apps/server/src/speech/facade-validation.ts +1 -1
  372. package/template/apps/server/src/speech/facade.ts +2 -2
  373. package/template/apps/server/src/startup-composition-validation.test.ts +32 -0
  374. package/template/apps/server/src/startup-finalization.ts +2 -0
  375. package/template/apps/server/src/startup-runtime.ts +77 -0
  376. package/template/apps/server/src/system/ai-runtime-build.ts +3 -0
  377. package/template/apps/server/src/system/ai-runtime-configuration.test.ts +36 -0
  378. package/template/apps/server/src/system/ai-runtime-configuration.ts +58 -0
  379. package/template/apps/server/src/system/diagnostic-routes.test.ts +123 -0
  380. package/template/apps/server/src/system/diagnostic-routes.ts +101 -0
  381. package/template/apps/server/src/system/environment-policy-reader.test.ts +74 -0
  382. package/template/apps/server/src/system/environment-policy-reader.ts +62 -0
  383. package/template/apps/server/src/system/feature-environment-assessment.test.ts +148 -0
  384. package/template/apps/server/src/system/feature-environment-assessment.ts +179 -0
  385. package/template/apps/server/src/system/host-diagnostics.test.ts +155 -0
  386. package/template/apps/server/src/system/host-diagnostics.ts +225 -0
  387. package/template/apps/server/src/system/menu-registry.test.ts +26 -0
  388. package/template/apps/server/src/system/menu-registry.ts +9 -7
  389. package/template/apps/server/src/system/operations.test.ts +5 -0
  390. package/template/apps/server/src/system/operations.ts +36 -12
  391. package/template/apps/server/src/system/role-authorization-postgres.integration.test.ts +181 -0
  392. package/template/apps/web/Dockerfile +15 -3
  393. package/template/apps/web/dev/dev-port.test.ts +6 -6
  394. package/template/apps/web/dev/dev-port.ts +1 -1
  395. package/template/apps/web/dev/start.ts +27 -11
  396. package/template/apps/web/dsh-workbench-location.ts +21 -0
  397. package/template/apps/web/dsh-workbench-proxy.test.ts +121 -0
  398. package/template/apps/web/dsh-workbench-proxy.ts +194 -0
  399. package/template/apps/web/index.html +1 -0
  400. package/template/apps/web/package.json +18 -16
  401. package/template/apps/web/runtime-server.test.ts +22 -1
  402. package/template/apps/web/runtime-server.ts +6 -0
  403. package/template/apps/web/server.ts +27 -6
  404. package/template/apps/web/src/App.vue +6 -3
  405. package/template/apps/web/src/assets/windy.svg +4 -0
  406. package/template/apps/web/src/components/auth/LoginForm.vue +2 -2
  407. package/template/apps/web/src/components/auth/PasswordChangeForm.vue +14 -3
  408. package/template/apps/web/src/components/common/FormDialog.vue +1 -1
  409. package/template/apps/web/src/components/license/LicenseFlow.webtest.ts +3 -0
  410. package/template/apps/web/src/components/license/LicenseMachineCodeQr.vue +99 -0
  411. package/template/apps/web/src/components/license/LicenseMachineCodeQr.webtest.ts +83 -0
  412. package/template/apps/web/src/components/license/LicensePairingCard.vue +1 -1
  413. package/template/apps/web/src/components/license/LicenseStatusCard.vue +14 -2
  414. package/template/apps/web/src/composables/useLoginFlow.ts +13 -1
  415. package/template/apps/web/src/composables/usePlatformSettings.ts +1 -1
  416. package/template/apps/web/src/composables/useWatermarkSettings.ts +1 -0
  417. package/template/apps/web/src/layout/AppSidebar.vue +5 -9
  418. package/template/apps/web/src/layout/AppSidebar.webtest.ts +4 -1
  419. package/template/apps/web/src/pages/auth/ChangePasswordPage.vue +67 -6
  420. package/template/apps/web/src/pages/auth/LoginPage.vue +3 -12
  421. package/template/apps/web/src/pages/configuration/components/ModuleConfigurationEditor.vue +30 -0
  422. package/template/apps/web/src/pages/configuration/components/ModuleConfigurationWorkbench.vue +25 -14
  423. package/template/apps/web/src/pages/configuration/components/TimeZoneSelect.vue +55 -0
  424. package/template/apps/web/src/pages/errors/PlatformErrorPage.vue +6 -0
  425. package/template/apps/web/src/pages/errors/PlatformErrorPage.webtest.ts +14 -1
  426. package/template/apps/web/src/pages/errors/error-page-extension.ts +1 -0
  427. package/template/apps/web/src/pages/profile/PersonalSettingsPage.vue +64 -11
  428. package/template/apps/web/src/pages/profile/PersonalSettingsPage.webtest.ts +21 -1
  429. package/template/apps/web/src/pages/settings/BrandingSettingsSection.vue +7 -18
  430. package/template/apps/web/src/pages/settings/BrandingSettingsSection.webtest.ts +9 -4
  431. package/template/apps/web/src/pages/settings/GlobalSettingsPage.vue +51 -6
  432. package/template/apps/web/src/pages/settings/GlobalSettingsPage.webtest.ts +19 -3
  433. package/template/apps/web/src/pages/settings/WatermarkSettingsSection.vue +1 -0
  434. package/template/apps/web/src/pages/settings/WatermarkYamlTransfer.vue +211 -0
  435. package/template/apps/web/src/pages/system/AgentNativePage.vue +44 -0
  436. package/template/apps/web/src/pages/system/AgentWorkflowPage.vue +20 -7
  437. package/template/apps/web/src/pages/system/DiagnosticLookupPage.vue +71 -0
  438. package/template/apps/web/src/pages/system/DiagnosticLookupPage.webtest.ts +102 -0
  439. package/template/apps/web/src/pages/system/SystemAgentSkillsPage.vue +88 -0
  440. package/template/apps/web/src/pages/system/SystemOperationsPage.vue +23 -0
  441. package/template/apps/web/src/pages/system/components/DiagnosticLogList.vue +120 -0
  442. package/template/apps/web/src/pages/system/components/DiagnosticRecordDetails.vue +52 -0
  443. package/template/apps/web/src/pages/system/components/OperationEnvironmentPanel.vue +237 -0
  444. package/template/apps/web/src/pages/system/components/OperationFeatureAssessmentPanel.vue +131 -0
  445. package/template/apps/web/src/pages/system/components/PagedSelectionList.vue +31 -24
  446. package/template/apps/web/src/pages/system/components/SystemResourceActions.vue +2 -1
  447. package/template/apps/web/src/pages/system/components/SystemResourceEditor.vue +11 -2
  448. package/template/apps/web/src/pages/system/components/SystemResourcePage.vue +1 -0
  449. package/template/apps/web/src/pages/system/components/SystemResourcePage.webtest.ts +6 -2
  450. package/template/apps/web/src/pages/system/components/agent-skills/AgentSkillDetailDialog.vue +166 -0
  451. package/template/apps/web/src/pages/system/components/agent-skills/AgentSkillGovernanceActionDialog.vue +51 -0
  452. package/template/apps/web/src/pages/system/components/agent-skills/AgentSkillImportDialog.vue +329 -0
  453. package/template/apps/web/src/pages/system/components/agent-skills/AgentSkillImportDialog.webtest.ts +96 -0
  454. package/template/apps/web/src/pages/system/components/agent-skills/AgentSkillsTable.vue +69 -0
  455. package/template/apps/web/src/pages/system/components/agent-workbench/SessionReplayTimeline.vue +18 -9
  456. package/template/apps/web/src/pages/system/components/agent-workbench/TestRunComposer.vue +66 -34
  457. package/template/apps/web/src/pages/system/components/agent-workbench/ToolCatalogPanel.vue +48 -33
  458. package/template/apps/web/src/pages/system/components/agent-workbench/ToolCatalogPanel.webtest.ts +9 -2
  459. package/template/apps/web/src/pages/system/components/agent-workbench/ToolRuleDetail.vue +23 -16
  460. package/template/apps/web/src/pages/system/components/agent-workflow/WorkflowPresetCatalog.vue +82 -0
  461. package/template/apps/web/src/pages/system/components/agent-workflow/WorkflowPresetCatalog.webtest.ts +57 -0
  462. package/template/apps/web/src/pages/system/components/dictionary-bulk/DictionaryBulkJobDetail.vue +10 -7
  463. package/template/apps/web/src/pages/system/components/user-account/RolePermissionSummary.vue +81 -57
  464. package/template/apps/web/src/pages/system/components/user-account/UserRoleSelector.vue +6 -4
  465. package/template/apps/web/src/pages/system/components/user-account/UserRoleSelector.webtest.ts +20 -4
  466. package/template/apps/web/src/pages/system/composables/useAgentSkillsGovernance.ts +105 -0
  467. package/template/apps/web/src/pages/system/composables/useAgentWorkflowPresets.ts +44 -0
  468. package/template/apps/web/src/pages/system/composables/useDiagnosticLookup.ts +64 -0
  469. package/template/apps/web/src/pages/system/resource-config.ts +9 -0
  470. package/template/apps/web/src/pages/work-orders/WorkOrderListPage.vue +1 -1
  471. package/template/apps/web/src/router/disabled-feature-loading.webtest.ts +78 -0
  472. package/template/apps/web/src/router/error-navigation.ts +3 -1
  473. package/template/apps/web/src/router/error-navigation.webtest.ts +14 -2
  474. package/template/apps/web/src/router/index.ts +11 -55
  475. package/template/apps/web/src/router/manifest-routes.ts +2 -3
  476. package/template/apps/web/src/router/platform-admin-pages.ts +38 -0
  477. package/template/apps/web/src/router/platform-admin-route-bindings.ts +12 -4
  478. package/template/apps/web/src/services/agent-skills-api.ts +55 -0
  479. package/template/apps/web/src/services/agent-workflow-api.ts +12 -0
  480. package/template/apps/web/src/services/diagnostics-api.ts +24 -0
  481. package/template/apps/web/src/services/http.ts +18 -0
  482. package/template/apps/web/src/services/http.webtest.ts +51 -0
  483. package/template/apps/web/src/services/operations-api.ts +4 -0
  484. package/template/apps/web/src/services/platform-settings-api.ts +35 -1
  485. package/template/apps/web/vite.config.ts +47 -2
  486. package/template/deploy/dsh/README.md +5 -0
  487. package/template/deploy/dsh/documents/README.md +9 -0
  488. package/template/deploy/dsh/documents/requirements.in +6 -0
  489. package/template/deploy/dsh/documents/requirements.lock +72 -0
  490. package/template/deploy/environment/windy.environment.example.yaml +53 -0
  491. package/template/docker-compose.yml +27 -11
  492. package/template/docs/adr/0004-embedded-dsh-runtime.md +9 -0
  493. package/template/docs/architecture/agent-admin-workbench-implementation.md +73 -0
  494. package/template/docs/architecture/agent-admin-workbench-plan.md +41 -0
  495. package/template/docs/architecture/agent-harness.md +2 -0
  496. package/template/docs/architecture/agent-runtime-compatibility.md +2 -0
  497. package/template/docs/architecture/agent-workflow.md +8 -0
  498. package/template/docs/architecture/durable-jobs.md +17 -0
  499. package/template/docs/architecture/embedded-dsh-integration.md +44 -0
  500. package/template/docs/development/dsh-plugins.md +55 -0
  501. package/template/docs/development/performance-engineering.md +24 -0
  502. package/template/docs/operations/admin-settings-yaml.md +29 -0
  503. package/template/docs/operations/dsh-agent-migration.md +98 -0
  504. package/template/docs/operations/environment-capabilities.md +185 -0
  505. package/template/docs/platform/agent-production-store.md +5 -78
  506. package/template/docs/platform/agent-runtime-observability.md +2 -0
  507. package/template/docs/platform/agent-runtime.md +2 -0
  508. package/template/docs/platform/agent-skills.md +25 -0
  509. package/template/docs/platform/module-configuration.md +18 -3
  510. package/template/docs/platform/platform-authentication.md +1 -1
  511. package/template/package.json +13 -10
  512. package/template/packages/config/package.json +2 -2
  513. package/template/packages/config/src/definition.ts +14 -4
  514. package/template/packages/config/src/environment-loader.ts +27 -3
  515. package/template/packages/config/src/platform-ai-runtime.test.ts +94 -0
  516. package/template/packages/config/src/platform.ts +5 -2
  517. package/template/packages/database/drizzle/0064_dsh_skills_diagnostics.sql +42 -0
  518. package/template/packages/database/drizzle/0065_durable_job_lease_snapshot_lookup.sql +1 -0
  519. package/template/packages/database/drizzle/0066_agent_source_sequence_bigint.sql +3 -0
  520. package/template/packages/database/drizzle/0067_media_runtime_access.sql +46 -0
  521. package/template/packages/database/drizzle/meta/0064_snapshot.json +15349 -0
  522. package/template/packages/database/drizzle/meta/0065_snapshot.json +15370 -0
  523. package/template/packages/database/drizzle/meta/0066_snapshot.json +15370 -0
  524. package/template/packages/database/drizzle/meta/0067_snapshot.json +15370 -0
  525. package/template/packages/database/drizzle/meta/_journal.json +28 -0
  526. package/template/packages/database/package.json +4 -4
  527. package/template/packages/database/src/schema/agent-session.ts +4 -3
  528. package/template/packages/database/src/schema/agent-skills.ts +65 -0
  529. package/template/packages/database/src/schema/diagnostics.ts +27 -0
  530. package/template/packages/database/src/schema/durable-jobs.ts +4 -0
  531. package/template/packages/database/src/schema/index.ts +10 -0
  532. package/template/packages/database/src/schema-durable-recovery.test.ts +21 -1
  533. package/template/packages/database/src/schema-source-sequence.test.ts +24 -0
  534. package/template/packages/example-work-order/package.json +2 -2
  535. package/template/packages/modules/package.json +1 -1
  536. package/template/packages/modules/src/admin-ui-boundary.test.ts +33 -0
  537. package/template/packages/modules/src/composition.ts +11 -28
  538. package/template/packages/modules/src/manifest.ts +2 -0
  539. package/template/packages/modules/src/menu-composition.ts +24 -0
  540. package/template/packages/modules/src/system-admin-routes.ts +26 -2
  541. package/template/packages/modules/src/system-admin-ui-catalog.ts +23 -11
  542. package/template/packages/modules/src/system-agent-admin-bindings.ts +2 -0
  543. package/template/packages/modules/src/system-agent-admin-menus.ts +20 -0
  544. package/template/packages/modules/src/system-agent-audit-actions.ts +3 -0
  545. package/template/packages/modules/src/system-agent-dsh.ts +119 -0
  546. package/template/packages/modules/src/system-ai-api-bindings.ts +0 -16
  547. package/template/packages/modules/src/system-api-control-plane.ts +9 -1
  548. package/template/packages/modules/src/system-api-permissions.ts +16 -0
  549. package/template/packages/modules/src/system-api-watermark.ts +21 -0
  550. package/template/packages/modules/src/system-audit-actions.ts +14 -1
  551. package/template/packages/modules/src/system-features.ts +25 -2
  552. package/template/packages/modules/src/system-media-api-bindings.ts +97 -0
  553. package/template/packages/modules/src/system-module-audit-selection.ts +27 -0
  554. package/template/packages/modules/src/system-module-catalog.test.ts +13 -6
  555. package/template/packages/modules/src/system-module-catalog.ts +12 -267
  556. package/template/packages/modules/src/system-module-definitions.ts +260 -0
  557. package/template/packages/modules/src/system-modules-access.test.ts +2 -0
  558. package/template/packages/modules/src/system-modules.test.ts +7 -1
  559. package/template/packages/modules/src/system-modules.ts +39 -16
  560. package/template/packages/modules/src/system-permissions.ts +22 -0
  561. package/template/packages/server-sdk/package.json +2 -2
  562. package/template/packages/shared/index.ts +15 -0
  563. package/template/packages/shared/package.json +1 -1
  564. package/template/packages/shared/src/agent-skills.ts +68 -0
  565. package/template/packages/shared/src/agent-workflow-presets.ts +26 -0
  566. package/template/packages/shared/src/diagnostics.ts +13 -0
  567. package/template/packages/shared/src/environment-assessment.ts +68 -0
  568. package/template/packages/shared/src/environment-policy.ts +205 -0
  569. package/template/packages/shared/src/license-console-capabilities.ts +7 -0
  570. package/template/packages/shared/src/license.ts +1 -0
  571. package/template/packages/shared/src/module-configuration.ts +2 -1
  572. package/template/packages/shared/src/rbac.ts +1 -0
  573. package/template/scripts/operations/collect-device-info.py +230 -0
  574. package/template/apps/agent-server/install-python-dependencies.sh +0 -92
  575. package/template/apps/agent-server/pyproject.toml +0 -51
  576. package/template/apps/agent-server/src/southwind_agent_server/__init__.py +0 -5
  577. package/template/apps/agent-server/src/southwind_agent_server/app.py +0 -344
  578. package/template/apps/agent-server/src/southwind_agent_server/approval_resolution.py +0 -30
  579. package/template/apps/agent-server/src/southwind_agent_server/artifact_input.py +0 -153
  580. package/template/apps/agent-server/src/southwind_agent_server/asgi.py +0 -8
  581. package/template/apps/agent-server/src/southwind_agent_server/attempt_context.py +0 -199
  582. package/template/apps/agent-server/src/southwind_agent_server/attempt_context_projection.py +0 -203
  583. package/template/apps/agent-server/src/southwind_agent_server/client_completion_contracts.py +0 -61
  584. package/template/apps/agent-server/src/southwind_agent_server/client_completion_governance.py +0 -82
  585. package/template/apps/agent-server/src/southwind_agent_server/client_completion_routes.py +0 -121
  586. package/template/apps/agent-server/src/southwind_agent_server/client_completion_runtime.py +0 -158
  587. package/template/apps/agent-server/src/southwind_agent_server/config.py +0 -267
  588. package/template/apps/agent-server/src/southwind_agent_server/context_message_digest.py +0 -24
  589. package/template/apps/agent-server/src/southwind_agent_server/context_version_contracts.py +0 -71
  590. package/template/apps/agent-server/src/southwind_agent_server/context_version_port.py +0 -307
  591. package/template/apps/agent-server/src/southwind_agent_server/contracts.py +0 -297
  592. package/template/apps/agent-server/src/southwind_agent_server/deterministic.py +0 -63
  593. package/template/apps/agent-server/src/southwind_agent_server/engine.py +0 -134
  594. package/template/apps/agent-server/src/southwind_agent_server/engine_capacity.py +0 -31
  595. package/template/apps/agent-server/src/southwind_agent_server/engine_identity.py +0 -2
  596. package/template/apps/agent-server/src/southwind_agent_server/fingerprint.py +0 -61
  597. package/template/apps/agent-server/src/southwind_agent_server/health_routes.py +0 -93
  598. package/template/apps/agent-server/src/southwind_agent_server/http_helpers.py +0 -62
  599. package/template/apps/agent-server/src/southwind_agent_server/lease.py +0 -15
  600. package/template/apps/agent-server/src/southwind_agent_server/multimodal.py +0 -76
  601. package/template/apps/agent-server/src/southwind_agent_server/openai_engine.py +0 -329
  602. package/template/apps/agent-server/src/southwind_agent_server/openai_engine_validation.py +0 -165
  603. package/template/apps/agent-server/src/southwind_agent_server/openai_provider.py +0 -345
  604. package/template/apps/agent-server/src/southwind_agent_server/postgres_report_insert.py +0 -37
  605. package/template/apps/agent-server/src/southwind_agent_server/postgres_report_queries.py +0 -235
  606. package/template/apps/agent-server/src/southwind_agent_server/postgres_report_replay.py +0 -44
  607. package/template/apps/agent-server/src/southwind_agent_server/postgres_report_status.py +0 -83
  608. package/template/apps/agent-server/src/southwind_agent_server/postgres_report_store.py +0 -336
  609. package/template/apps/agent-server/src/southwind_agent_server/postgres_report_summary.py +0 -304
  610. package/template/apps/agent-server/src/southwind_agent_server/postgres_store.py +0 -335
  611. package/template/apps/agent-server/src/southwind_agent_server/postgres_store_backend.py +0 -333
  612. package/template/apps/agent-server/src/southwind_agent_server/provider_audit.py +0 -144
  613. package/template/apps/agent-server/src/southwind_agent_server/provider_governance.py +0 -309
  614. package/template/apps/agent-server/src/southwind_agent_server/provider_output_guidance.py +0 -34
  615. package/template/apps/agent-server/src/southwind_agent_server/readiness_pin.py +0 -37
  616. package/template/apps/agent-server/src/southwind_agent_server/report_lifecycle.py +0 -218
  617. package/template/apps/agent-server/src/southwind_agent_server/report_metrics.py +0 -149
  618. package/template/apps/agent-server/src/southwind_agent_server/report_presenter.py +0 -300
  619. package/template/apps/agent-server/src/southwind_agent_server/report_routes.py +0 -132
  620. package/template/apps/agent-server/src/southwind_agent_server/report_store.py +0 -298
  621. package/template/apps/agent-server/src/southwind_agent_server/report_store_protocol.py +0 -75
  622. package/template/apps/agent-server/src/southwind_agent_server/report_types.py +0 -118
  623. package/template/apps/agent-server/src/southwind_agent_server/run_admission.py +0 -64
  624. package/template/apps/agent-server/src/southwind_agent_server/run_capacity.py +0 -59
  625. package/template/apps/agent-server/src/southwind_agent_server/runtime_budget.py +0 -74
  626. package/template/apps/agent-server/src/southwind_agent_server/runtime_compatibility.py +0 -89
  627. package/template/apps/agent-server/src/southwind_agent_server/runtime_factory.py +0 -105
  628. package/template/apps/agent-server/src/southwind_agent_server/runtime_logging.py +0 -57
  629. package/template/apps/agent-server/src/southwind_agent_server/service.py +0 -325
  630. package/template/apps/agent-server/src/southwind_agent_server/service_control.py +0 -64
  631. package/template/apps/agent-server/src/southwind_agent_server/service_errors.py +0 -4
  632. package/template/apps/agent-server/src/southwind_agent_server/service_execution.py +0 -34
  633. package/template/apps/agent-server/src/southwind_agent_server/service_tasks.py +0 -34
  634. package/template/apps/agent-server/src/southwind_agent_server/signal_events.py +0 -53
  635. package/template/apps/agent-server/src/southwind_agent_server/sqlite_catalog.py +0 -118
  636. package/template/apps/agent-server/src/southwind_agent_server/sqlite_errors.py +0 -2
  637. package/template/apps/agent-server/src/southwind_agent_server/sqlite_schema.py +0 -73
  638. package/template/apps/agent-server/src/southwind_agent_server/sqlite_serialization.py +0 -16
  639. package/template/apps/agent-server/src/southwind_agent_server/sqlite_store.py +0 -350
  640. package/template/apps/agent-server/src/southwind_agent_server/sse.py +0 -41
  641. package/template/apps/agent-server/src/southwind_agent_server/store.py +0 -255
  642. package/template/apps/agent-server/src/southwind_agent_server/store_cipher.py +0 -40
  643. package/template/apps/agent-server/src/southwind_agent_server/structured_logging.py +0 -145
  644. package/template/apps/agent-server/src/southwind_agent_server/telemetry.py +0 -93
  645. package/template/apps/agent-server/src/southwind_agent_server/tool_host.py +0 -152
  646. package/template/apps/agent-server/src/southwind_agent_server/trajectory.py +0 -137
  647. package/template/apps/agent-server/src/southwind_agent_server/unavailable_engine.py +0 -58
  648. package/template/apps/agent-server/src/southwind_agent_server/vision_probe.py +0 -87
  649. package/template/apps/agent-server/src/southwind_agent_server/vision_requirement.py +0 -28
  650. package/template/apps/agent-server/src/southwind_agent_server/vlm_readiness.py +0 -247
  651. package/template/apps/agent-server/tests/__init__.py +0 -1
  652. package/template/apps/agent-server/tests/openai_provider_test_support.py +0 -131
  653. package/template/apps/agent-server/tests/test_api.py +0 -305
  654. package/template/apps/agent-server/tests/test_artifact_input.py +0 -110
  655. package/template/apps/agent-server/tests/test_client_completion.py +0 -230
  656. package/template/apps/agent-server/tests/test_config.py +0 -106
  657. package/template/apps/agent-server/tests/test_fingerprint.py +0 -10
  658. package/template/apps/agent-server/tests/test_multimodal.py +0 -81
  659. package/template/apps/agent-server/tests/test_openai_provider.py +0 -320
  660. package/template/apps/agent-server/tests/test_postgres_report_status.py +0 -59
  661. package/template/apps/agent-server/tests/test_postgres_report_summary.py +0 -298
  662. package/template/apps/agent-server/tests/test_postgres_store.py +0 -135
  663. package/template/apps/agent-server/tests/test_provider_attempt_reporting.py +0 -140
  664. package/template/apps/agent-server/tests/test_provider_governance.py +0 -276
  665. package/template/apps/agent-server/tests/test_report_attempt_lifecycle.py +0 -126
  666. package/template/apps/agent-server/tests/test_report_resilience.py +0 -183
  667. package/template/apps/agent-server/tests/test_report_routes.py +0 -143
  668. package/template/apps/agent-server/tests/test_report_store.py +0 -347
  669. package/template/apps/agent-server/tests/test_report_summary_parity.py +0 -116
  670. package/template/apps/agent-server/tests/test_report_terminal_sync.py +0 -177
  671. package/template/apps/agent-server/tests/test_run_capacity.py +0 -112
  672. package/template/apps/agent-server/tests/test_run_operational_logging.py +0 -114
  673. package/template/apps/agent-server/tests/test_runtime_compatibility.py +0 -119
  674. package/template/apps/agent-server/tests/test_runtime_factory_readiness.py +0 -52
  675. package/template/apps/agent-server/tests/test_sqlite_store.py +0 -182
  676. package/template/apps/agent-server/tests/test_structured_logging.py +0 -142
  677. package/template/apps/agent-server/tests/test_telemetry.py +0 -25
  678. package/template/apps/agent-server/tests/test_tool_approval.py +0 -28
  679. package/template/apps/agent-server/tests/test_tool_structured_output.py +0 -347
  680. package/template/apps/agent-server/tests/test_trajectory.py +0 -91
  681. package/template/apps/agent-server/tests/test_vision_readiness_enforcement.py +0 -72
  682. package/template/apps/agent-server/tests/test_vlm_readiness.py +0 -106
  683. package/template/apps/agent-server/uv.lock +0 -831
  684. package/template/apps/server/src/agent/module-ai-port-factory.ts +0 -41
  685. /package/template/apps/server/src/{agent → ai-runtime-security}/execution-grants.ts +0 -0
  686. /package/template/apps/server/src/{agent → ai-runtime-security}/idempotency-key.test.ts +0 -0
  687. /package/template/apps/server/src/{agent → ai-runtime-security}/idempotency-key.ts +0 -0
  688. /package/template/apps/server/src/{agent → ai-runtime-security}/provider-input-governance.test.ts +0 -0
  689. /package/template/apps/server/src/{agent → ai-runtime-security}/provider-input-governance.ts +0 -0
  690. /package/template/apps/server/src/{agent → media-runtime}/required-environment.ts +0 -0
  691. /package/template/apps/server/src/{agent → media-runtime}/runtime-readiness-sources.test.ts +0 -0
@@ -0,0 +1,167 @@
1
+ import { downloadNativePackage } from "./native-download";
2
+ import { createHash } from "node:crypto";
3
+ import {
4
+ mkdtemp,
5
+ mkdir,
6
+ readFile,
7
+ rename,
8
+ rm,
9
+ writeFile,
10
+ } from "node:fs/promises";
11
+ import { join, dirname } from "node:path";
12
+ import { tmpdir } from "node:os";
13
+
14
+ interface NativePackage {
15
+ name: string;
16
+ version: string;
17
+ integrity: string;
18
+ archive: string;
19
+ }
20
+ type Lock = { packages: Record<string, [string, string, unknown, string]> };
21
+
22
+ /** Fixed Debian prerequisites, including the official Linux Office WASM engine. */
23
+ export function nativePackages(
24
+ lock: Lock,
25
+ architecture: string,
26
+ ): NativePackage[] {
27
+ if (!["arm64", "x64"].includes(architecture))
28
+ throw new Error("Unsupported H1 native architecture");
29
+ const names = [
30
+ `node-addon-require-builtin-linux-${architecture}-gnu`,
31
+ `@deepseek-ai/node-addon-system-linux-${architecture}`,
32
+ `@koromix/koffi-linux-${architecture}`,
33
+ `@vscode/ripgrep-linux-${architecture}`,
34
+ `@img/sharp-linux-${architecture}`,
35
+ `@img/sharp-libvips-linux-${architecture}`,
36
+ "@deepseek-ai/libreoffice-kit-wasm",
37
+ ];
38
+ return names.map((name) => {
39
+ const item = lock.packages[name];
40
+ const version = item?.[0].slice(name.length + 1);
41
+ if (
42
+ !item ||
43
+ !item[0].startsWith(name + "@") ||
44
+ !/^[0-9A-Za-z.+-]+$/.test(version ?? "") ||
45
+ !/^sha512-[A-Za-z0-9+/]+=*$/.test(item[3])
46
+ )
47
+ throw new Error(
48
+ "Native dependency must be fixed by the existing runtime lock",
49
+ );
50
+ return {
51
+ name,
52
+ version,
53
+ integrity: item[3],
54
+ archive: name.replaceAll("/", "-") + ".tgz",
55
+ };
56
+ });
57
+ }
58
+
59
+ async function tar(args: string[]) {
60
+ const child = Bun.spawn(["tar", ...args], { stdout: "pipe", stderr: "pipe" });
61
+ const [output, , code] = await Promise.all([
62
+ new Response(child.stdout).text(),
63
+ new Response(child.stderr).text(),
64
+ child.exited,
65
+ ]);
66
+ if (code !== 0) throw new Error("Invalid native package archive");
67
+ return output;
68
+ }
69
+
70
+ export async function installNativePackage(
71
+ pkg: NativePackage,
72
+ root: string,
73
+ bytes: Uint8Array,
74
+ ) {
75
+ if (
76
+ bytes.length > 64 * 1024 * 1024 ||
77
+ "sha512-" + createHash("sha512").update(bytes).digest("base64") !==
78
+ pkg.integrity
79
+ )
80
+ throw new Error("Native package integrity mismatch");
81
+ const temporary = await mkdtemp(join(tmpdir(), "dsh-native-"));
82
+ try {
83
+ const archive = join(temporary, "package.tgz");
84
+ await writeFile(archive, bytes);
85
+ const paths = (await tar(["-tzf", archive])).trim().split("\n");
86
+ if (
87
+ !paths.length ||
88
+ paths.length > 10000 ||
89
+ paths.some(
90
+ (path) =>
91
+ !path.startsWith("package/") ||
92
+ path.includes("\\") ||
93
+ path.split("/").some((part) => part === ".." || part === "."),
94
+ )
95
+ )
96
+ throw new Error("Native package archive path denied");
97
+ const details = (await tar(["--numeric-owner", "-tvzf", archive]))
98
+ .trim()
99
+ .split("\n");
100
+ let total = 0;
101
+ for (const line of details) {
102
+ if (!["-", "d"].includes(line[0]))
103
+ throw new Error("Native package links or special files denied");
104
+ const columns = line.trim().split(/\s+/);
105
+ const size = Number(columns[1].includes("/") ? columns[2] : columns[4]);
106
+ if (!Number.isSafeInteger(size) || size < 0)
107
+ throw new Error("Invalid native package entry size");
108
+ total += size;
109
+ }
110
+ if (total > 256 * 1024 * 1024)
111
+ throw new Error("Native package expansion budget exceeded");
112
+ const unpacked = join(temporary, "unpacked");
113
+ await mkdir(unpacked);
114
+ await tar([
115
+ "-xzf",
116
+ archive,
117
+ "--no-same-owner",
118
+ "--no-same-permissions",
119
+ "--strip-components=1",
120
+ "-C",
121
+ unpacked,
122
+ ]);
123
+ const metadata = JSON.parse(
124
+ await readFile(join(unpacked, "package.json"), "utf8"),
125
+ );
126
+ if (metadata.name !== pkg.name || metadata.version !== pkg.version)
127
+ throw new Error("Native package identity mismatch");
128
+ const destination = join(root, "node_modules", pkg.name);
129
+ await mkdir(dirname(destination), { recursive: true });
130
+ await rename(unpacked, destination);
131
+ } finally {
132
+ await rm(temporary, { recursive: true, force: true });
133
+ }
134
+ }
135
+
136
+ export async function installNative(
137
+ root: string,
138
+ architecture: string,
139
+ archiveDirectory?: string,
140
+ ) {
141
+ const lock = Bun.JSONC.parse(
142
+ await readFile(join(root, "bun.lock"), "utf8"),
143
+ ) as Lock;
144
+ for (const pkg of nativePackages(lock, architecture)) {
145
+ let bytes: Uint8Array;
146
+ if (archiveDirectory)
147
+ bytes = new Uint8Array(
148
+ await readFile(join(archiveDirectory, pkg.archive)),
149
+ );
150
+ else
151
+ bytes = await downloadNativePackage(pkg, {
152
+ cacheDirectory: process.env.DSH_NATIVE_CACHE_DIR,
153
+ registry: process.env.DSH_NATIVE_REGISTRY,
154
+ });
155
+ await installNativePackage(pkg, root, bytes);
156
+ console.info(
157
+ `Installed pinned native prerequisite: ${pkg.name}@${pkg.version}`,
158
+ );
159
+ }
160
+ }
161
+
162
+ if (import.meta.main)
163
+ await installNative(
164
+ process.cwd(),
165
+ process.arch,
166
+ process.env.DSH_NATIVE_ARCHIVE_DIR,
167
+ );
@@ -0,0 +1,179 @@
1
+ import { timingSafeEqual } from "node:crypto";
2
+ import {
3
+ createServer,
4
+ type IncomingMessage,
5
+ type ServerResponse,
6
+ } from "node:http";
7
+ import { once } from "node:events";
8
+ import { Readable } from "node:stream";
9
+ import { resolve } from "node:path";
10
+ import { fileURLToPath } from "node:url";
11
+ import { createCanonicalHandler } from "./runtime/index.js";
12
+ import { configFromEnvironment } from "./runtime/config.js";
13
+ import { nativeModelSlots } from "./native/config.js";
14
+ import { authorizeWorkbench, createBoundary } from "./native/boundary.js";
15
+ import { WorkbenchManager } from "./native/manager.js";
16
+ import { workbenchHandshake, workbenchHttp } from "./native/http.js";
17
+ import { attachWorkbenchSockets } from "./native/socket.js";
18
+ import { projectHost } from "./project/host.js";
19
+
20
+ export function internalAuthentication(token: string) {
21
+ if (token !== token.trim() || token.length < 32 || /[\r\n]/.test(token))
22
+ throw new Error(
23
+ "AGENT_SERVER_INTERNAL_TOKEN must be a strong internal credential",
24
+ );
25
+ const expected = Buffer.from(`Bearer ${token}`);
26
+ return (headers: Headers) => {
27
+ const actual = Buffer.from(headers.get("authorization") ?? "");
28
+ return (
29
+ actual.length === expected.length && timingSafeEqual(actual, expected)
30
+ );
31
+ };
32
+ }
33
+
34
+ export async function startAgentServer(
35
+ port = Number(process.env.PORT || 8080),
36
+ ) {
37
+ process.umask(0o077);
38
+ const authenticated = internalAuthentication(
39
+ process.env.AGENT_SERVER_INTERNAL_TOKEN ?? "",
40
+ );
41
+ const config = configFromEnvironment();
42
+ const canonical = createCanonicalHandler({ config });
43
+ const manager = new WorkbenchManager({
44
+ gateOrigin: `http://127.0.0.1:${port}`,
45
+ authorize: authorizeWorkbench,
46
+ });
47
+ const boundary = createBoundary({
48
+ manager,
49
+ projectRoutes: projectHost.boundaryRoutes,
50
+ completion: canonical.handleNativeCompletion,
51
+ });
52
+ const handle = async (request: Request): Promise<Response> => {
53
+ const path = new URL(request.url).pathname;
54
+ if (path.startsWith("/internal/boundary/")) return boundary(request);
55
+ if (path.startsWith("/internal/workbench")) {
56
+ if (!authenticated(request.headers))
57
+ return Response.json({ error: "UNAUTHENTICATED" }, { status: 401 });
58
+ if (path === "/internal/workbench-ready") {
59
+ const code =
60
+ !config.baseUrl || !config.model
61
+ ? "MODEL_ROUTE_UNAVAILABLE"
62
+ : process.platform !== "linux" || process.getuid?.() !== 0
63
+ ? "WORKBENCH_ISOLATION_UNAVAILABLE"
64
+ : nativeModelSlots() < 1
65
+ ? "WORKBENCH_CAPACITY_RESERVED"
66
+ : undefined;
67
+ return Response.json(
68
+ code ? { ready: false, code } : { ready: true, engine: "dsh" },
69
+ { status: code ? 503 : 200 },
70
+ );
71
+ }
72
+ if (
73
+ path !== "/internal/workbench-handshake" &&
74
+ !path.startsWith("/internal/workbench/")
75
+ )
76
+ return new Response(null, { status: 404 });
77
+ try {
78
+ if (path === "/internal/workbench-handshake")
79
+ return await workbenchHandshake(request, manager);
80
+ return await workbenchHttp(request, manager);
81
+ } catch {
82
+ return Response.json(
83
+ { error: "WORKBENCH_UNAVAILABLE" },
84
+ { status: 503 },
85
+ );
86
+ }
87
+ }
88
+ return (await canonical(request)) ?? new Response(null, { status: 404 });
89
+ };
90
+ const server = createServer(
91
+ (incoming, outgoing) => void transport(incoming, outgoing, handle),
92
+ );
93
+ const detachSockets = attachWorkbenchSockets(server, manager, authenticated);
94
+ await new Promise<void>((accept, reject) => {
95
+ server.once("error", reject);
96
+ server.listen(port, "0.0.0.0", accept);
97
+ });
98
+ const close = async () => {
99
+ detachSockets();
100
+ await manager.close();
101
+ await canonical.close();
102
+ server.closeAllConnections();
103
+ await new Promise<void>((accept) => server.close(() => accept()));
104
+ };
105
+ return { server, close, manager };
106
+ }
107
+
108
+ async function transport(
109
+ incoming: IncomingMessage,
110
+ outgoing: ServerResponse,
111
+ handle: (request: Request) => Promise<Response>,
112
+ ) {
113
+ const controller = new AbortController();
114
+ incoming.once("aborted", () => controller.abort());
115
+ outgoing.once("close", () => {
116
+ if (!outgoing.writableEnded) controller.abort();
117
+ });
118
+ try {
119
+ const headers = new Headers();
120
+ for (const [key, value] of Object.entries(incoming.headers)) {
121
+ if (typeof value === "string") headers.set(key, value);
122
+ else if (Array.isArray(value))
123
+ for (const item of value) headers.append(key, item);
124
+ }
125
+ const init: RequestInit & { duplex?: string } = {
126
+ method: incoming.method,
127
+ headers,
128
+ signal: controller.signal,
129
+ };
130
+ if (!["GET", "HEAD"].includes(incoming.method ?? "GET")) {
131
+ init.body = Readable.toWeb(
132
+ incoming,
133
+ ) as unknown as ReadableStream<Uint8Array>;
134
+ init.duplex = "half";
135
+ }
136
+ const response = await handle(
137
+ new Request(`http://agent.internal${incoming.url ?? "/"}`, init),
138
+ );
139
+ const responseHeaders: Record<string, string> = {};
140
+ response.headers.forEach((value, key) => {
141
+ responseHeaders[key] = value;
142
+ });
143
+ outgoing.writeHead(response.status, responseHeaders);
144
+ if (response.body) {
145
+ const reader = response.body.getReader();
146
+ try {
147
+ while (!controller.signal.aborted) {
148
+ const { value, done } = await reader.read();
149
+ if (done) break;
150
+ if (!outgoing.write(value))
151
+ await once(outgoing, "drain", { signal: controller.signal });
152
+ }
153
+ } finally {
154
+ await reader.cancel().catch(() => {});
155
+ }
156
+ }
157
+ outgoing.end();
158
+ } catch {
159
+ if (!outgoing.headersSent)
160
+ outgoing.writeHead(502, { "content-type": "application/json" });
161
+ outgoing.end(JSON.stringify({ error: "AGENT_RUNTIME_FAILED" }));
162
+ }
163
+ }
164
+
165
+ if (
166
+ process.argv[1] &&
167
+ resolve(process.argv[1]) === fileURLToPath(import.meta.url)
168
+ ) {
169
+ startAgentServer()
170
+ .then(({ close }) => {
171
+ const shutdown = () => void close().finally(() => process.exit(0));
172
+ process.once("SIGTERM", shutdown);
173
+ process.once("SIGINT", shutdown);
174
+ })
175
+ .catch(() => {
176
+ console.error("Agent Server startup failed");
177
+ process.exitCode = 1;
178
+ });
179
+ }
@@ -0,0 +1,46 @@
1
+ # 当前用户的 DSH 扩展
2
+
3
+ 上游 DSH 使用 `~0.2.2-rc.1`,镜像按 Bun 锁文件安装。
4
+
5
+ ## 插件入口与持久化
6
+
7
+ - 原生侧栏「插件」→「添加插件」:安装声明 `dsh.bundle.patch` 的 npm 包、Git 地址、压缩包 URL 或可读取的本地目录。安装、取消、日志、卸载确认、依赖构建脚本批准沿用官方 UI。
8
+ - 插件自己的配置页在「插件」内;「设置」→「内置插件」提供全局运行清单。应用托管的共享模型地址、身份等配置仍由最后一层 deployment patch 固定,更改这些字段会被上游拒绝,不应绕开覆盖。
9
+ - 上游 `plugin-manager`、`config-editor`、`settings`、`hmr` 和 `client-hmr` 原样组合。安装和启停由 HMR 实时应用,真正需要重启的情况由上游显示原因。
10
+ - 插件安装写入每个用户 `DSH_HOME/profiles/web` 的 `package.json`、`pnpm-lock.yaml`、`node_modules`、`cordis.patch.yml` 等文件。worker 使用官方 `initProfile()` 仅补缺失文件,重启不清空个人清单、锁或两层个人 patch。
11
+ - 安装器是镜像内按 Bun 锁文件安装的官方 npm 包 `pnpm`(声明范围 `^11.28.11`)(MIT),由 Node 调用,不使用 curl 安装器。上游依赖 pnpm 的 `view/add/remove`、脚本批准和文件恢复语义;项目 monorepo 仍以 Bun 管理。Docker 补齐 Git 与 CA,便于上游 Git spec 安装。
12
+ - `tool-plugin-manager` 保持禁用;技能文本不能静默安装插件代码。安装代码由用户在原生管理界面执行。
13
+
14
+ 开发阶段 `AGENT_DSH_USER_EXTENSIONS=1` 默认开启。设置为 `0` 并重启现有 Agent Server 会关闭扩展安装、配置及清单管理入口,同时关闭个人 Skills 默认根发现。此开关不会删除已安装文件,也不会停止已经保存为启用的可信插件;要撤销已有插件代码,应先在原生 UI 卸载或停用,再重启当前用户 worker / Agent Server。它不是恶意代码安全开关。
15
+
16
+ ## Skills 的实际操作
17
+
18
+ 上游原生尚无完整 Skills 安装页;项目通过公开侧栏/main slots 提供「技能」面板:
19
+
20
+ 1. 选择当前用户的真实工作区,查看默认技能(只读)或新建、编辑个人技能。
21
+ 2. 导入 `SKILL.md` 时先在编辑器确认正文;离线 ZIP 导入保留 scripts、references、assets,
22
+ 导入不执行脚本。压缩包 4 MiB、展开 16 MiB、128 项、单文件 4 MiB、正文 128 KiB。
23
+ 3. 同名导入拒绝覆盖;编辑使用原正文 SHA256 防止旧编辑器覆盖。个人文件保存在
24
+ `.dsh/skills/<name>/SKILL.md`,官方提供方热发现,输入 `/name` 调用。
25
+ 4. 删除个人技能需再次确认;默认技能只读。导出单个技能 ZIP 后由用户自行交给其他用户主动导入,
26
+ 不共享其他用户目录、会话或整个工作区。分享前自行复核通用正文和附件,去除案件数据及凭据。
27
+ 5. 显式调用 `/windy-skill-capture` 可以把已验证的通用方法沉淀为个人技能,不能自动把案件事实
28
+ 复制到跨会话记忆。默认业务方法清单见 [Skills](../plugins/skills/README.md)。
29
+
30
+ 文件权限、压缩展开与路径校验、社区开源评估及公开接口升级检查见
31
+ [技能管理插件](../plugins/skill-library/README.md)。
32
+
33
+ 随附 `/windy-extension-guide` 提供中文步骤,只允许用户显式调用。封闭的默认 subprocess 没有网络,因此不要承诺 Agent 可以自行 `git clone` 任意互联网技能仓库;先下载可信文件再上传,或用用户明确安装的可信插件提供该能力。
34
+
35
+ ## 信任与边界
36
+
37
+ 第三方插件在当前用户独立 UID 的 DSH Host 中运行,是用户授权的可信代码。它能访问当前用户的 HOME、会话和工作区,也可能自行执行网络与代码操作;不能声称它仍被默认 subprocess adapter 或工作区 Landlock 约束。其他用户 UID、root 协调器文件权限、容量 Gate 与业务 MCP 当前身份检查仍保留;真正的 Provider / 产品内部凭据不进入 worker 环境。不要在个人插件中填入共享 Provider 真凭据。
38
+
39
+ 个人依赖、安装缓存与文件计入现有用户 HOME 软配额。超限会终止该用户 worker,安装的大型插件可能需要明确调整额度;本轮没有基于显卡型号提高容量或修改生产环境。
40
+
41
+ ## 验证及升级检查
42
+
43
+ `bun test apps/agent-server/native/extensions.test.ts apps/agent-server/plugins/locale/locale.test.ts`:真实官方 pnpm 安装本地无依赖合成 bundle,验证清单选择、锁文件和个人 patch 在再次初始化后原样保留,再卸载;真实官方文件系统提供方先观察空目录,再检测新 Skills 的 watcher 失效事件,读取、编辑、删除并确认另一用户目录未被发现。该测试不等于任意第三方包验收。另已用最终 ARM 镜像与内置浏览器验证原生安装/启停/重启保留/卸载,
44
+ 及个人 Skill 热发现和实际 slash 指令正文传入合成 Provider;详见项目验收记录。
45
+
46
+ 升级 DSH 时重新核对官方 `plugin-manager`、`config-editor`、`settings`、`ui-plugin-manager`、`skill-filesystem` 的公开契约,尤其是 profile patch 优先级、HMR、脚本批准、版本兼容检查和重启行为;升级 pnpm 需同时更新 Bun lock 并验证安装/卸载语义。
@@ -0,0 +1,73 @@
1
+ /** Bounded FIFO: queued native work owns no model slot and aborts without retries. */
2
+ export class AdmissionQueue {
3
+ private active = 0;
4
+ private waiting: Array<{ grant(): void; signal: AbortSignal }> = [];
5
+ constructor(
6
+ readonly maximum: number,
7
+ private readonly pendingLimit = 16,
8
+ private readonly timeoutMs = 90000,
9
+ private readonly available = () => true,
10
+ private readonly reserve = (): (() => void) => () => {},
11
+ ) {}
12
+ acquire(signal: AbortSignal): Promise<() => void> {
13
+ signal.throwIfAborted();
14
+ if (this.maximum < 1)
15
+ return Promise.reject(new Error("NATIVE_CAPACITY_DISABLED"));
16
+ if (!this.waiting.length && this.active < this.maximum && this.available())
17
+ return Promise.resolve(this.take());
18
+ if (this.waiting.length >= this.pendingLimit)
19
+ return Promise.reject(new Error("NATIVE_QUEUE_FULL"));
20
+ return new Promise((accept, reject) => {
21
+ const remove = () => {
22
+ clearTimeout(timer);
23
+ signal.removeEventListener("abort", abort);
24
+ const position = this.waiting.indexOf(entry);
25
+ if (position >= 0) this.waiting.splice(position, 1);
26
+ };
27
+ const abort = () => {
28
+ remove();
29
+ reject(signal.reason);
30
+ this.drain();
31
+ };
32
+ const entry = {
33
+ signal,
34
+ grant: () => {
35
+ remove();
36
+ accept(this.take());
37
+ },
38
+ };
39
+ const timer = setTimeout(() => {
40
+ remove();
41
+ reject(new Error("NATIVE_QUEUE_TIMEOUT"));
42
+ this.drain();
43
+ }, this.timeoutMs);
44
+ timer.unref?.();
45
+ this.waiting.push(entry);
46
+ signal.addEventListener("abort", abort, { once: true });
47
+ if (signal.aborted) abort();
48
+ });
49
+ }
50
+ drain() {
51
+ while (
52
+ this.waiting.length &&
53
+ this.active < this.maximum &&
54
+ this.available()
55
+ )
56
+ this.waiting[0]!.grant();
57
+ }
58
+ private take() {
59
+ const releaseReservation = this.reserve();
60
+ this.active++;
61
+ let released = false;
62
+ return () => {
63
+ if (released) return;
64
+ released = true;
65
+ this.active--;
66
+ releaseReservation();
67
+ this.drain();
68
+ };
69
+ }
70
+ snapshot() {
71
+ return { active: this.active, queued: this.waiting.length };
72
+ }
73
+ }
@@ -0,0 +1,176 @@
1
+ import { describe, expect, test } from "bun:test";
2
+ import {
3
+ authorizationUnavailableResponse,
4
+ authorizeWorkbench,
5
+ isWorkbenchAuthorizationUnavailable,
6
+ WorkbenchAuthorizationUnavailable,
7
+ type WorkbenchAuthorizationOptions,
8
+ } from "./authorization.js";
9
+
10
+ const authority = {
11
+ actorId: "synthetic-user",
12
+ session: "synthetic-session",
13
+ publicOrigin: "http://synthetic.invalid",
14
+ };
15
+ const signal = () => new AbortController().signal;
16
+ const options = (
17
+ fetcher: NonNullable<WorkbenchAuthorizationOptions["fetcher"]>,
18
+ ): WorkbenchAuthorizationOptions => ({
19
+ fetcher,
20
+ productOrigin: "http://synthetic-product.invalid",
21
+ });
22
+ const actorResponse = (id = authority.actorId, type = "user") =>
23
+ Response.json({ actor: { id, type } });
24
+
25
+ async function unavailable(
26
+ input: WorkbenchAuthorizationOptions,
27
+ expectedReason: WorkbenchAuthorizationUnavailable["reason"],
28
+ ) {
29
+ let failure: unknown;
30
+ try {
31
+ await authorizeWorkbench(authority, signal(), input);
32
+ } catch (error) {
33
+ failure = error;
34
+ }
35
+ expect(isWorkbenchAuthorizationUnavailable(failure)).toBe(true);
36
+ expect((failure as WorkbenchAuthorizationUnavailable).reason).toBe(
37
+ expectedReason,
38
+ );
39
+ expect(String(failure)).not.toContain(authority.session);
40
+ }
41
+
42
+ describe("workbench authorization distinguishes denial from unavailable", () => {
43
+ test("fresh matching admission allows; trusted actor mismatch denies", async () => {
44
+ expect(
45
+ await authorizeWorkbench(
46
+ authority,
47
+ signal(),
48
+ options(async () => actorResponse()),
49
+ ),
50
+ ).toBe(true);
51
+ for (const response of [
52
+ actorResponse("other-user"),
53
+ actorResponse(authority.actorId, "service"),
54
+ ])
55
+ expect(
56
+ await authorizeWorkbench(
57
+ authority,
58
+ signal(),
59
+ options(async () => response),
60
+ ),
61
+ ).toBe(false);
62
+ });
63
+
64
+ test("only 401 and 403 are confirmed HTTP denial", async () => {
65
+ for (const status of [401, 403])
66
+ expect(
67
+ await authorizeWorkbench(
68
+ authority,
69
+ signal(),
70
+ options(async () => new Response("synthetic", { status })),
71
+ ),
72
+ ).toBe(false);
73
+ for (const status of [201, 204, 302, 400, 404, 408, 429, 500, 503])
74
+ await unavailable(
75
+ options(async () => new Response(null, { status })),
76
+ "upstream_status",
77
+ );
78
+ });
79
+
80
+ test("malformed JSON and incomplete actor are unavailable", async () => {
81
+ await unavailable(
82
+ options(async () => new Response("not-json")),
83
+ "invalid_response",
84
+ );
85
+ for (const body of [
86
+ null,
87
+ {},
88
+ { actor: null },
89
+ { actor: {} },
90
+ { actor: { id: 1, type: "user" } },
91
+ { actor: { id: "synthetic-user" } },
92
+ ])
93
+ await unavailable(
94
+ options(async () => Response.json(body)),
95
+ "invalid_response",
96
+ );
97
+ });
98
+
99
+ test("network failures do not become denial and do not retain raw error", async () => {
100
+ await unavailable(
101
+ options(async () => {
102
+ throw new Error(`synthetic private ${authority.session}`);
103
+ }),
104
+ "network",
105
+ );
106
+ });
107
+
108
+ test("real fetch timeout is unavailable", async () => {
109
+ const server = Bun.serve({
110
+ port: 0,
111
+ async fetch() {
112
+ await Bun.sleep(100);
113
+ return actorResponse();
114
+ },
115
+ });
116
+ try {
117
+ await unavailable(
118
+ { productOrigin: server.url.origin, timeoutMs: 10 },
119
+ "timeout",
120
+ );
121
+ } finally {
122
+ await server.stop(true);
123
+ }
124
+ });
125
+
126
+ test("caller cancellation is unavailable and never grants permission", async () => {
127
+ const controller = new AbortController();
128
+ controller.abort();
129
+ await expect(
130
+ authorizeWorkbench(
131
+ authority,
132
+ controller.signal,
133
+ options(async (_url, init) => {
134
+ init.signal!.throwIfAborted();
135
+ return actorResponse();
136
+ }),
137
+ ),
138
+ ).rejects.toMatchObject({
139
+ code: "WORKBENCH_AUTHORIZATION_UNAVAILABLE",
140
+ reason: "aborted",
141
+ });
142
+ });
143
+
144
+ test("each admission is fetched and denial cannot reuse a previous success", async () => {
145
+ let calls = 0;
146
+ const input = options(async (url, init) => {
147
+ expect(url).toBe(
148
+ "http://synthetic-product.invalid/api/agent/workbench/admission",
149
+ );
150
+ expect(new Headers(init.headers).get("authorization")).toBe(
151
+ `Bearer ${authority.session}`,
152
+ );
153
+ expect(init.redirect).toBe("error");
154
+ calls++;
155
+ return calls === 1
156
+ ? actorResponse()
157
+ : new Response(null, { status: 401 });
158
+ });
159
+ expect(await authorizeWorkbench(authority, signal(), input)).toBe(true);
160
+ expect(await authorizeWorkbench(authority, signal(), input)).toBe(false);
161
+ expect(calls).toBe(2);
162
+ });
163
+
164
+ test("unavailable response is retryable 503 with no cached login result", async () => {
165
+ const response = authorizationUnavailableResponse();
166
+ expect(response.status).toBe(503);
167
+ expect(response.headers.get("retry-after")).toBe("2");
168
+ expect(response.headers.get("cache-control")).toBe("no-store");
169
+ expect(await response.json()).toEqual({
170
+ error: "WORKBENCH_AUTHORIZATION_UNAVAILABLE",
171
+ });
172
+ expect(isWorkbenchAuthorizationUnavailable(new Error("ordinary"))).toBe(
173
+ false,
174
+ );
175
+ });
176
+ });