@tuya-sat/microapp-kit 0.0.0-stage → 0.1.26-alpha.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.
Files changed (821) hide show
  1. package/AUDIT.md +43 -0
  2. package/CHANGELOG.md +53 -0
  3. package/MAINTAINING.md +178 -0
  4. package/README.md +53 -2
  5. package/START-HERE.md +44 -0
  6. package/bootstrap/build-install-page.mjs +46 -0
  7. package/bootstrap/install-node.ps1 +80 -0
  8. package/bootstrap/install-node.sh +94 -0
  9. package/bootstrap/install.md.in +29 -0
  10. package/bundle.json +852 -0
  11. package/cli.mjs +3 -0
  12. package/package.json +68 -4
  13. package/resources/contracts/project-permissions.json +596 -0
  14. package/resources/contracts/standard-api.catalog.json +5 -0
  15. package/resources/examples/group-display.mjs +23 -0
  16. package/resources/preview/README.md +104 -0
  17. package/resources/preview/agent-open.mjs +1221 -0
  18. package/resources/preview/application-icon.mjs +27 -0
  19. package/resources/preview/authorization-panel.js +243 -0
  20. package/resources/preview/authorization-routes.mjs +634 -0
  21. package/resources/preview/authorization.mjs +353 -0
  22. package/resources/preview/backend-entry.mjs +22 -0
  23. package/resources/preview/backend-process.mjs +26 -0
  24. package/resources/preview/bridge.js +50 -0
  25. package/resources/preview/control.mjs +48 -0
  26. package/resources/preview/device-fixtures.mjs +38 -0
  27. package/resources/preview/fixtures/context.json +10 -0
  28. package/resources/preview/fixtures/device-catalog.json +363 -0
  29. package/resources/preview/host-contract.mjs +104 -0
  30. package/resources/preview/host.js +841 -0
  31. package/resources/preview/local-dev-provider.mjs +27 -0
  32. package/resources/preview/menu-icons.json +82 -0
  33. package/resources/preview/mock-store.mjs +1147 -0
  34. package/resources/preview/run.mjs +131 -0
  35. package/resources/preview/server.mjs +476 -0
  36. package/resources/preview/theme-tokens.mjs +49 -0
  37. package/resources/preview/themes.json +1036 -0
  38. package/resources/resource-manifest.json +210 -0
  39. package/resources/scripts/backend-build-context.mjs +101 -0
  40. package/resources/scripts/backend-runtime.mjs +68 -0
  41. package/resources/scripts/build-backend-image.sh +23 -0
  42. package/resources/scripts/build-safety.mjs +18 -0
  43. package/resources/scripts/build.mjs +138 -0
  44. package/resources/scripts/command-invocation.mjs +10 -0
  45. package/resources/scripts/diagnostics.mjs +34 -0
  46. package/resources/scripts/init-project.mjs +62 -0
  47. package/resources/scripts/package-release.mjs +80 -0
  48. package/resources/scripts/prepare-locales.mjs +77 -0
  49. package/resources/scripts/project-identity.mjs +21 -0
  50. package/resources/scripts/registry-client.mjs +189 -0
  51. package/resources/scripts/resource-files.mjs +22 -0
  52. package/resources/scripts/scaffold.mjs +31 -0
  53. package/resources/scripts/test-backend-image.mjs +162 -0
  54. package/resources/scripts/update-preview-themes.mjs +26 -0
  55. package/resources/scripts/update-resource-manifest.mjs +9 -0
  56. package/resources/scripts/validate-resources.mjs +9 -0
  57. package/resources/template/_gitignore +5 -0
  58. package/resources/template/backend/.dockerignore +7 -0
  59. package/resources/template/backend/.node-version +1 -0
  60. package/resources/template/backend/Dockerfile +62 -0
  61. package/resources/template/backend/deploy/README.md +105 -0
  62. package/resources/template/backend/deploy/data/README.md +3 -0
  63. package/resources/template/backend/deploy/manifest.json +4 -0
  64. package/resources/template/backend/deploy/tasks/README.md +3 -0
  65. package/resources/template/backend/migrations/README.md +5 -0
  66. package/resources/template/backend/next-env.d.ts +6 -0
  67. package/resources/template/backend/next.config.ts +19 -0
  68. package/resources/template/backend/operations.json +4 -0
  69. package/resources/template/backend/package.json +35 -0
  70. package/resources/template/backend/pnpm-lock.yaml +775 -0
  71. package/resources/template/backend/preview-contract.json +4 -0
  72. package/resources/template/backend/public/.keep +0 -0
  73. package/resources/template/backend/scripts/check-runtime.mjs +12 -0
  74. package/resources/template/backend/scripts/dev-deploy-prepare.mjs +362 -0
  75. package/resources/template/backend/scripts/dev-diagnose-database.mjs +199 -0
  76. package/resources/template/backend/scripts/dev-start-backend.sh +30 -0
  77. package/resources/template/backend/src/app/[[...path]]/route.ts +11 -0
  78. package/resources/template/backend/src/app/api/[...path]/route.ts +11 -0
  79. package/resources/template/backend/src/app/api/health/route.ts +16 -0
  80. package/resources/template/backend/src/app/api/preview/context/route.ts +36 -0
  81. package/resources/template/backend/src/instrumentation.ts +10 -0
  82. package/resources/template/backend/src/lib/api-response.mjs +119 -0
  83. package/resources/template/backend/src/lib/business-logger.mjs +29 -0
  84. package/resources/template/backend/src/lib/database-errors.mjs +15 -0
  85. package/resources/template/backend/src/lib/dev-authorization.mjs +84 -0
  86. package/resources/template/backend/src/lib/dev-context.mjs +58 -0
  87. package/resources/template/backend/src/lib/gateway-ingress.mjs +79 -0
  88. package/resources/template/backend/src/lib/gateway-nonce-store.mjs +31 -0
  89. package/resources/template/backend/src/lib/gateway-verification.mjs +197 -0
  90. package/resources/template/backend/src/lib/request-observability.mjs +93 -0
  91. package/resources/template/backend/src/lib/standard-api.ts +28 -0
  92. package/resources/template/backend/src/microapp-identity.json +1 -0
  93. package/resources/template/backend/src/proxy.ts +40 -0
  94. package/resources/template/backend/tests/api-response.test.mjs +77 -0
  95. package/resources/template/backend/tests/database-diagnostics.test.mjs +198 -0
  96. package/resources/template/backend/tests/deployment-connection.test.mjs +100 -0
  97. package/resources/template/backend/tests/deployment-postgres.test.mjs +109 -0
  98. package/resources/template/backend/tests/deployment.test.mjs +196 -0
  99. package/resources/template/backend/tests/dev-authorization.test.mjs +88 -0
  100. package/resources/template/backend/tests/dev-context.test.mjs +35 -0
  101. package/resources/template/backend/tests/gateway-verification.test.mjs +287 -0
  102. package/resources/template/backend/tests/request-observability.test.mjs +125 -0
  103. package/resources/template/backend/tests/routes.test.mjs +253 -0
  104. package/resources/template/backend/tests/startup.test.mjs +147 -0
  105. package/resources/template/backend/tsconfig.json +34 -0
  106. package/resources/template/micro-app/.editorconfig +15 -0
  107. package/resources/template/micro-app/.eslintrc +15 -0
  108. package/resources/template/micro-app/.prettierignore +4 -0
  109. package/resources/template/micro-app/.prettierrc +6 -0
  110. package/resources/template/micro-app/_gitignore +6 -0
  111. package/resources/template/micro-app/_locales/en.json +5 -0
  112. package/resources/template/micro-app/_locales/zh-CN.json +5 -0
  113. package/resources/template/micro-app/antd.less.overwrite.js +4 -0
  114. package/resources/template/micro-app/babel.config.json +3 -0
  115. package/resources/template/micro-app/manifest.json +46 -0
  116. package/resources/template/micro-app/micro.config.js +4 -0
  117. package/resources/template/micro-app/mock/index.json +4 -0
  118. package/resources/template/micro-app/package.json +61 -0
  119. package/resources/template/micro-app/public/favicon.ico +0 -0
  120. package/resources/template/micro-app/public/index.ejs +13 -0
  121. package/resources/template/micro-app/src/App.less +0 -0
  122. package/resources/template/micro-app/src/App.tsx +99 -0
  123. package/resources/template/micro-app/src/api/api-request.mjs +85 -0
  124. package/resources/template/micro-app/src/api/custom-api-headers.mjs +55 -0
  125. package/resources/template/micro-app/src/api/custom-api.ts +10 -0
  126. package/resources/template/micro-app/src/api/errors.mjs +108 -0
  127. package/resources/template/micro-app/src/api/index.ts +34 -0
  128. package/resources/template/micro-app/src/api/presentation.mjs +33 -0
  129. package/resources/template/micro-app/src/api/req.ts +9 -0
  130. package/resources/template/micro-app/src/api/request-url.mjs +20 -0
  131. package/resources/template/micro-app/src/api/res.ts +9 -0
  132. package/resources/template/micro-app/src/api/submission-errors.mjs +84 -0
  133. package/resources/template/micro-app/src/components/CapsuleFilters/index.module.less +121 -0
  134. package/resources/template/micro-app/src/components/CapsuleFilters/index.tsx +100 -0
  135. package/resources/template/micro-app/src/components/MicroAppUI/DataTable.tsx +48 -0
  136. package/resources/template/micro-app/src/components/MicroAppUI/EllipsisText.tsx +25 -0
  137. package/resources/template/micro-app/src/components/MicroAppUI/Layouts.tsx +54 -0
  138. package/resources/template/micro-app/src/components/MicroAppUI/ModalForm.tsx +230 -0
  139. package/resources/template/micro-app/src/components/MicroAppUI/StatusBadge.tsx +19 -0
  140. package/resources/template/micro-app/src/components/MicroAppUI/index.module.less +99 -0
  141. package/resources/template/micro-app/src/components/MicroAppUI/index.ts +13 -0
  142. package/resources/template/micro-app/src/index.css +16 -0
  143. package/resources/template/micro-app/src/index.tsx +66 -0
  144. package/resources/template/micro-app/src/interfaces.ts +545 -0
  145. package/resources/template/micro-app/src/lang/en.ts +1 -0
  146. package/resources/template/micro-app/src/lang/index.ts +31 -0
  147. package/resources/template/micro-app/src/lang/zh.ts +1 -0
  148. package/resources/template/micro-app/src/language-codes.mjs +32 -0
  149. package/resources/template/micro-app/src/language-policy.ts +6 -0
  150. package/resources/template/micro-app/src/microapp-identity.json +1 -0
  151. package/resources/template/micro-app/src/pages/index.module.less +3 -0
  152. package/resources/template/micro-app/src/pages/index.tsx +6 -0
  153. package/resources/template/micro-app/src/public-path.js +4 -0
  154. package/resources/template/micro-app/src/utils/antdLang.ts +244 -0
  155. package/resources/template/micro-app/tests/template.test.cjs +15 -0
  156. package/resources/template/micro-app/tsconfig.extend.json +8 -0
  157. package/resources/template/micro-app/tsconfig.json +24 -0
  158. package/resources/template/micro-app/typings.d.ts +19 -0
  159. package/resources/template/micro-app/yarn.lock +7491 -0
  160. package/resources/tests/agent-open-catalog.test.mjs +43 -0
  161. package/resources/tests/agent-open-preview.test.mjs +878 -0
  162. package/resources/tests/api-request.test.mjs +121 -0
  163. package/resources/tests/api-response.test.mjs +2 -0
  164. package/resources/tests/application-icon-build.test.mjs +34 -0
  165. package/resources/tests/authorization-proxy.test.mjs +202 -0
  166. package/resources/tests/authorization.test.mjs +462 -0
  167. package/resources/tests/backend-context.test.mjs +33 -0
  168. package/resources/tests/backend-preview.test.mjs +67 -0
  169. package/resources/tests/backend-request-logging.test.mjs +2 -0
  170. package/resources/tests/backend-runtime.test.mjs +96 -0
  171. package/resources/tests/browser-authorization-smoke.mjs +111 -0
  172. package/resources/tests/browser-design-smoke.mjs +107 -0
  173. package/resources/tests/browser-language-compat-smoke.mjs +48 -0
  174. package/resources/tests/browser-preview-smoke.mjs +148 -0
  175. package/resources/tests/browser-standard-ui-smoke.mjs +331 -0
  176. package/resources/tests/build-safety.test.mjs +69 -0
  177. package/resources/tests/business-build.test.mjs +86 -0
  178. package/resources/tests/command-invocation.test.mjs +35 -0
  179. package/resources/tests/custom-api-headers.test.mjs +96 -0
  180. package/resources/tests/custom-route.test.mjs +63 -0
  181. package/resources/tests/custom-script-policy.test.mjs +34 -0
  182. package/resources/tests/database-errors.test.mjs +81 -0
  183. package/resources/tests/deployment-package.test.mjs +45 -0
  184. package/resources/tests/dockerfile-logging.test.mjs +31 -0
  185. package/resources/tests/fixtures/capsule-page.tsx +46 -0
  186. package/resources/tests/fixtures/standard-ui-page.tsx +222 -0
  187. package/resources/tests/group-display.test.mjs +28 -0
  188. package/resources/tests/host-contract.test.mjs +84 -0
  189. package/resources/tests/image-test.test.mjs +110 -0
  190. package/resources/tests/initialization.test.mjs +98 -0
  191. package/resources/tests/language-selection.test.mjs +188 -0
  192. package/resources/tests/locale-keys.test.mjs +88 -0
  193. package/resources/tests/preview-control.test.mjs +56 -0
  194. package/resources/tests/preview-icon.test.mjs +117 -0
  195. package/resources/tests/preview-state.test.mjs +183 -0
  196. package/resources/tests/preview-theme.test.mjs +17 -0
  197. package/resources/tests/real-preview-smoke.mjs +34 -0
  198. package/resources/tests/registry-client.test.mjs +272 -0
  199. package/resources/tests/request-errors.test.mjs +51 -0
  200. package/resources/tests/request-method-contract.test.mjs +65 -0
  201. package/resources/tests/resources.test.mjs +31 -0
  202. package/resources/tests/saas-presentation.test.mjs +41 -0
  203. package/resources/tests/sandbox-scripts.test.mjs +144 -0
  204. package/resources/tests/space-permission-guidance.test.mjs +78 -0
  205. package/resources/tests/standard-api-preview.test.mjs +55 -0
  206. package/resources/tests/submission-errors.test.mjs +118 -0
  207. package/resources/tests/version-description-package.test.mjs +60 -0
  208. package/resources/ui/component-sources.json +36 -0
  209. package/runtime/assemble.mjs +66 -0
  210. package/runtime/auth/hidden-input.mjs +45 -0
  211. package/runtime/auth/macos-credentials.js +41 -0
  212. package/runtime/auth/manager.mjs +145 -0
  213. package/runtime/auth/session.mjs +153 -0
  214. package/runtime/auth/state.mjs +107 -0
  215. package/runtime/auth/store.mjs +130 -0
  216. package/runtime/auth/windows-credentials.ps1 +73 -0
  217. package/runtime/auth/wizard.mjs +224 -0
  218. package/runtime/cli.mjs +474 -0
  219. package/runtime/dev-database.mjs +155 -0
  220. package/runtime/dev-provider.mjs +41 -0
  221. package/runtime/errors.mjs +205 -0
  222. package/runtime/install-receipt.mjs +68 -0
  223. package/runtime/installation.mjs +92 -0
  224. package/runtime/integrity.mjs +121 -0
  225. package/runtime/launcher.mjs +104 -0
  226. package/runtime/pack-npm.mjs +76 -0
  227. package/runtime/package-cache.mjs +52 -0
  228. package/runtime/package-identity.mjs +22 -0
  229. package/runtime/preview.mjs +157 -0
  230. package/runtime/project-identity.mjs +57 -0
  231. package/runtime/publication.mjs +372 -0
  232. package/runtime/release-content.mjs +159 -0
  233. package/runtime/release-index.mjs +91 -0
  234. package/runtime/setup.mjs +223 -0
  235. package/runtime/tests/agent-entry.test.mjs +79 -0
  236. package/runtime/tests/auth-wizard.test.mjs +241 -0
  237. package/runtime/tests/auth.test.mjs +367 -0
  238. package/runtime/tests/consistency-workflow.test.mjs +84 -0
  239. package/runtime/tests/dev-provider.test.mjs +27 -0
  240. package/runtime/tests/diagnostics.test.mjs +66 -0
  241. package/runtime/tests/helpers/tar-fixture.mjs +25 -0
  242. package/runtime/tests/install-page.test.mjs +83 -0
  243. package/runtime/tests/install.test.mjs +432 -0
  244. package/runtime/tests/node-bootstrap.test.mjs +104 -0
  245. package/runtime/tests/npm-distribution.test.mjs +130 -0
  246. package/runtime/tests/npm-release-check.test.mjs +48 -0
  247. package/runtime/tests/package-cache.test.mjs +108 -0
  248. package/runtime/tests/package-migration.test.mjs +208 -0
  249. package/runtime/tests/preview-hosts.test.mjs +66 -0
  250. package/runtime/tests/preview.test.mjs +304 -0
  251. package/runtime/tests/project-identity.test.mjs +67 -0
  252. package/runtime/tests/publication.test.mjs +436 -0
  253. package/runtime/tests/release-recovery.test.mjs +417 -0
  254. package/runtime/tests/repository-source.test.mjs +69 -0
  255. package/runtime/tests/skill-set-update.test.mjs +169 -0
  256. package/runtime/tests/standalone.test.mjs +46 -0
  257. package/runtime/tests/update-check.test.mjs +165 -0
  258. package/runtime/tests/update.test.mjs +292 -0
  259. package/runtime/tests/workspace.test.mjs +156 -0
  260. package/runtime/update-check.mjs +160 -0
  261. package/runtime/update-state.mjs +83 -0
  262. package/runtime/update.mjs +292 -0
  263. package/runtime/verify-npm-release.mjs +43 -0
  264. package/runtime/workspace-migration.mjs +109 -0
  265. package/runtime/workspace.mjs +101 -0
  266. package/schemas/toolchain.schema.json +13 -0
  267. package/setup.mjs +3 -0
  268. package/skills/micro-app-backend-development/SKILL.md +64 -0
  269. package/skills/micro-app-backend-development/references/backend-security-workflow.md +77 -0
  270. package/skills/micro-app-backend-development/references/business-build-helpers.md +11 -0
  271. package/skills/micro-app-backend-development/references/business-logging.md +56 -0
  272. package/skills/micro-app-backend-development/references/database-constraints.md +81 -0
  273. package/skills/micro-app-backend-development/references/database-write-errors.md +29 -0
  274. package/skills/micro-app-backend-development/references/deployment-bundle.md +65 -0
  275. package/skills/micro-app-backend-development/references/dev-preview-context.md +23 -0
  276. package/skills/micro-app-backend-development/references/gateway-verification.md +43 -0
  277. package/skills/micro-app-backend-development/references/implementation.md +49 -0
  278. package/skills/micro-app-backend-development/references/local-database-preview.md +100 -0
  279. package/skills/micro-app-backend-development/references/production-authorization-readiness.md +60 -0
  280. package/skills/micro-app-backend-development/references/project-data-permissions.md +43 -0
  281. package/skills/micro-app-backend-development/references/runtime-resources-and-deployment.md +76 -0
  282. package/skills/micro-app-backend-development/scripts/microapp-kit.mjs +117 -0
  283. package/skills/micro-app-backend-development/tests/behavior-scenarios.md +62 -0
  284. package/skills/micro-app-cloud-integration/SKILL.md +92 -0
  285. package/skills/micro-app-cloud-integration/references/api-catalog.json +1315 -0
  286. package/skills/micro-app-cloud-integration/references/api-catalog.md +59 -0
  287. package/skills/micro-app-cloud-integration/references/api-device-control.md +67 -0
  288. package/skills/micro-app-cloud-integration/references/api-device.md +179 -0
  289. package/skills/micro-app-cloud-integration/references/api-group-ota.md +145 -0
  290. package/skills/micro-app-cloud-integration/references/api-linkage.md +3 -0
  291. package/skills/micro-app-cloud-integration/references/api-models.md +584 -0
  292. package/skills/micro-app-cloud-integration/references/api-project.md +121 -0
  293. package/skills/micro-app-cloud-integration/references/api-space-home.md +244 -0
  294. package/skills/micro-app-cloud-integration/references/backend-authorization.md +95 -0
  295. package/skills/micro-app-cloud-integration/references/calling-conventions.md +118 -0
  296. package/skills/micro-app-cloud-integration/references/preview-agent-open.md +46 -0
  297. package/skills/micro-app-cloud-integration/references/server-to-server-integration.md +13 -0
  298. package/skills/micro-app-cloud-integration/scripts/microapp-kit.mjs +117 -0
  299. package/skills/micro-app-cloud-integration/tests/behavior-scenarios.md +20 -0
  300. package/skills/micro-app-design/SKILL.md +99 -0
  301. package/skills/micro-app-design/agents/openai.yaml +6 -0
  302. package/skills/micro-app-design/assets/tuya-design-system/assets/README.md +22 -0
  303. package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaCapsuleSearch.html +67 -0
  304. package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaCardGrid.html +71 -0
  305. package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaIcon.html +5 -0
  306. package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaPageTitle.html +29 -0
  307. package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaTopNavigation.html +55 -0
  308. package/skills/micro-app-design/assets/tuya-design-system/assets/components.schema.md +154 -0
  309. package/skills/micro-app-design/assets/tuya-design-system/assets/examples/dashboard.html +588 -0
  310. package/skills/micro-app-design/assets/tuya-design-system/assets/examples/dashboard.md +99 -0
  311. package/skills/micro-app-design/assets/tuya-design-system/assets/examples/table-page.html +477 -0
  312. package/skills/micro-app-design/assets/tuya-design-system/assets/examples/table-page.md +77 -0
  313. package/skills/micro-app-design/assets/tuya-design-system/assets/templates/base.html +878 -0
  314. package/skills/micro-app-design/assets/tuya-design-system/latest/accessibility/accessibility.md +39 -0
  315. package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/TuyaCapsuleSearch.html +67 -0
  316. package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/arrow-down.svg +3 -0
  317. package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/calendar.svg +5 -0
  318. package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/check.svg +3 -0
  319. package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/checkbox-check.svg +3 -0
  320. package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/clear.svg +4 -0
  321. package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/search.svg +4 -0
  322. package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/preview.html +3705 -0
  323. package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/spec.md +78 -0
  324. package/skills/micro-app-design/assets/tuya-design-system/latest/components/card-grid/examples/TuyaCardGrid.html +71 -0
  325. package/skills/micro-app-design/assets/tuya-design-system/latest/components/card-grid/examples/assets/placeholder.svg +4 -0
  326. package/skills/micro-app-design/assets/tuya-design-system/latest/components/card-grid/examples/preview.html +711 -0
  327. package/skills/micro-app-design/assets/tuya-design-system/latest/components/card-grid/spec.md +93 -0
  328. package/skills/micro-app-design/assets/tuya-design-system/latest/components/cascader/spec.md +75 -0
  329. package/skills/micro-app-design/assets/tuya-design-system/latest/components/checkbox/spec.md +72 -0
  330. package/skills/micro-app-design/assets/tuya-design-system/latest/components/date-picker/spec.md +81 -0
  331. package/skills/micro-app-design/assets/tuya-design-system/latest/components/dropdown/spec.md +99 -0
  332. package/skills/micro-app-design/assets/tuya-design-system/latest/components/icon/examples/TuyaIcon.html +5 -0
  333. package/skills/micro-app-design/assets/tuya-design-system/latest/components/icon/spec.md +55 -0
  334. package/skills/micro-app-design/assets/tuya-design-system/latest/components/input/spec.md +84 -0
  335. package/skills/micro-app-design/assets/tuya-design-system/latest/components/modal/spec.md +178 -0
  336. package/skills/micro-app-design/assets/tuya-design-system/latest/components/page-title/examples/TuyaPageTitle.html +29 -0
  337. package/skills/micro-app-design/assets/tuya-design-system/latest/components/page-title/spec.md +67 -0
  338. package/skills/micro-app-design/assets/tuya-design-system/latest/components/pagination/spec.md +94 -0
  339. package/skills/micro-app-design/assets/tuya-design-system/latest/components/radio/spec.md +80 -0
  340. package/skills/micro-app-design/assets/tuya-design-system/latest/components/search-input/spec.md +101 -0
  341. package/skills/micro-app-design/assets/tuya-design-system/latest/components/select/spec.md +96 -0
  342. package/skills/micro-app-design/assets/tuya-design-system/latest/components/slider/spec.md +66 -0
  343. package/skills/micro-app-design/assets/tuya-design-system/latest/components/switch/spec.md +86 -0
  344. package/skills/micro-app-design/assets/tuya-design-system/latest/components/table/spec.md +116 -0
  345. package/skills/micro-app-design/assets/tuya-design-system/latest/components/time-picker/spec.md +75 -0
  346. package/skills/micro-app-design/assets/tuya-design-system/latest/components/tooltip/spec.md +70 -0
  347. package/skills/micro-app-design/assets/tuya-design-system/latest/components/top-navigation/examples/TuyaTopNavigation.html +55 -0
  348. package/skills/micro-app-design/assets/tuya-design-system/latest/components/top-navigation/spec.md +60 -0
  349. package/skills/micro-app-design/assets/tuya-design-system/latest/components/tree/examples/icons/check.svg +3 -0
  350. package/skills/micro-app-design/assets/tuya-design-system/latest/components/tree/examples/preview.html +974 -0
  351. package/skills/micro-app-design/assets/tuya-design-system/latest/components/tree/spec.md +118 -0
  352. package/skills/micro-app-design/assets/tuya-design-system/latest/components/upload/spec.md +86 -0
  353. package/skills/micro-app-design/assets/tuya-design-system/latest/demo-index.md +43 -0
  354. package/skills/micro-app-design/assets/tuya-design-system/latest/design-system.md +116 -0
  355. package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/color.md +165 -0
  356. package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/elevation.md +21 -0
  357. package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/icon.md +78 -0
  358. package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/layout.md +103 -0
  359. package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/radius.md +22 -0
  360. package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/spacing.md +29 -0
  361. package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/typography.md +43 -0
  362. package/skills/micro-app-design/assets/tuya-design-system/latest/interaction/behavior.md +30 -0
  363. package/skills/micro-app-design/assets/tuya-design-system/latest/interaction/feedback.md +23 -0
  364. package/skills/micro-app-design/assets/tuya-design-system/latest/interaction/state.md +28 -0
  365. package/skills/micro-app-design/assets/tuya-design-system/latest/motion/motion.md +31 -0
  366. package/skills/micro-app-design/assets/tuya-design-system/latest/patterns/dashboard.md +34 -0
  367. package/skills/micro-app-design/assets/tuya-design-system/latest/patterns/data-page.md +30 -0
  368. package/skills/micro-app-design/assets/tuya-design-system/latest/patterns/form-page.md +36 -0
  369. package/skills/micro-app-design/assets/tuya-design-system/latest/patterns/monitoring.md +25 -0
  370. package/skills/micro-app-design/assets/tuya-design-system/latest/quality-checklist.md +71 -0
  371. package/skills/micro-app-design/assets/tuya-design-system/latest/registry.yaml +232 -0
  372. package/skills/micro-app-design/assets/tuya-design-system/latest/tokens.yaml +187 -0
  373. package/skills/micro-app-design/assets/tuya-design-system/resources/README.md +26 -0
  374. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states/README.md +13 -0
  375. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277/403.html +58 -0
  376. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277/404.html +58 -0
  377. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277/500.html +58 -0
  378. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277//344/272/213/344/273/266/345/274/202/345/270/270.html +58 -0
  379. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277//346/220/234/347/264/242/346/227/240/347/273/223/346/236/234.html +58 -0
  380. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277//346/232/202/346/227/240/344/275/215/347/275/256/344/277/241/346/201/257.html +58 -0
  381. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277//346/232/202/346/227/240/346/210/277/345/261/213.html +58 -0
  382. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277//346/232/202/346/227/240/346/225/260/346/215/256.html +58 -0
  383. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277//346/232/202/346/227/240/346/266/210/346/201/257.html +58 -0
  384. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277//346/232/202/346/227/240/347/275/221/347/273/234.html +58 -0
  385. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277//346/232/202/346/227/240/350/256/276/345/244/207.html +58 -0
  386. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277//346/232/202/346/227/240/351/241/271/347/233/256.html +58 -0
  387. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203.md +159 -0
  388. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210/403.html +31 -0
  389. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210/404.html +31 -0
  390. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210/500.html +31 -0
  391. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210/empty.css +106 -0
  392. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210/empty.js +49 -0
  393. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210/index.html +69 -0
  394. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//344/272/213/344/273/266/345/274/202/345/270/270.html +31 -0
  395. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//345/233/276/347/211/207/345/212/240/350/275/275/345/244/261/350/264/245.html +31 -0
  396. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//346/220/234/347/264/242/346/227/240/347/273/223/346/236/234.html +31 -0
  397. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//346/232/202/346/227/240/344/275/215/347/275/256/344/277/241/346/201/257.html +31 -0
  398. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//346/232/202/346/227/240/346/210/277/345/261/213.html +31 -0
  399. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//346/232/202/346/227/240/346/225/260/346/215/256.html +31 -0
  400. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//346/232/202/346/227/240/346/266/210/346/201/257.html +31 -0
  401. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//346/232/202/346/227/240/347/275/221/347/273/234.html +31 -0
  402. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//346/232/202/346/227/240/350/256/276/345/244/207.html +31 -0
  403. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//346/232/202/346/227/240/351/241/271/347/233/256.html +31 -0
  404. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/README.md +23 -0
  405. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/arrow-down.svg +3 -0
  406. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/calendar.svg +5 -0
  407. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/check.svg +3 -0
  408. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/clear.svg +4 -0
  409. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/search.svg +4 -0
  410. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/sources/arrow-down-ref.png +0 -0
  411. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/sources/check-ref.png +0 -0
  412. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/sources/clear-ref.png +0 -0
  413. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/sources/search-ref.png +0 -0
  414. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/Excel.svg +1 -0
  415. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/HD.svg +1 -0
  416. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/PM.svg +1 -0
  417. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/PPT.svg +1 -0
  418. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/README.md +14 -0
  419. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/VOC.svg +1 -0
  420. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/app/347/256/241/347/220/206.svg +1 -0
  421. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/catalog.md +377 -0
  422. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/folder-closed.svg +3 -0
  423. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/license/347/256/241/347/220/206.svg +1 -0
  424. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/nps/351/207/217/350/241/250 /346/224/266/350/227/217.svg" +1 -0
  425. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/sos-2.svg +1 -0
  426. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/sos.svg +1 -0
  427. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/word.svg +1 -0
  428. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/270/200/346/260/247/345/214/226/347/242/263-2.svg +1 -0
  429. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/270/200/346/260/247/345/214/226/347/242/263.svg +1 -0
  430. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/270/212/344/274/240.svg +1 -0
  431. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/214/346/260/247/345/214/226/347/242/263.svg +1 -0
  432. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/221.svg +1 -0
  433. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/221/347/253/257 /344/270/213/350/275/275.svg" +1 -0
  434. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/256/345/272/246 /345/244/252/351/230/263 /346/227/245/351/227/264.svg" +1 -0
  435. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/272/344/275/223/344/274/240/346/204/237/345/231/250.svg +1 -0
  436. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/272/345/203/217@2x.svg +1 -0
  437. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/272/345/221/230/345/244/207/344/273/275@2x.svg +1 -0
  438. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/272/346/260/221/345/270/201@2x.svg +1 -0
  439. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/272/350/204/270/350/257/206/345/210/253/346/210/220/345/212/237@2x.svg +1 -0
  440. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/272/350/241/214/351/227/250/347/246/201.svg +1 -0
  441. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/274/230/346/203/240/345/210/270@2x.svg +1 -0
  442. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/274/232/345/221/230@2x.svg +1 -0
  443. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/201/234/350/275/246@2x.svg +1 -0
  444. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/205/205/347/224/265/346/241/251@2x.svg +1 -0
  445. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/205/245/344/276/265/345/221/212/350/255/246@2x.svg +1 -0
  446. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/205/250/347/220/203 /345/234/260/347/220/203 @2x.svg" +1 -0
  447. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/206/260/347/256/261.svg +1 -0
  448. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/206/267/346/260/264.svg +1 -0
  449. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/210/267/346/274/206.svg +1 -0
  450. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/212/240/346/262/271/347/253/231@2x.svg +1 -0
  451. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/214/226/345/220/210/347/211/251.svg +1 -0
  452. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/214/226/345/255/246-2.svg +1 -0
  453. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/214/226/345/255/246.svg +1 -0
  454. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/215/240/346/257/224/345/233/276.svg +1 -0
  455. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/215/267/345/256/227.svg +1 -0
  456. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/215/267/345/260/272.svg +1 -0
  457. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/216/237/345/255/220 /347/211/251/347/220/206 /346/227/213/350/275/254.svg" +1 -0
  458. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/217/221/345/215/241@2x.svg +1 -0
  459. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/217/260/345/274/217/347/224/265/350/204/221 /346/230/276/347/244/272/345/231/250 /345/261/217/345/271/225.svg" +1 -0
  460. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/220/212/347/201/257.svg +1 -0
  461. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/220/271/351/243/216/346/234/272 /345/256/266/347/224/265 /347/224/265/345/231/250.svg" +1 -0
  462. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/221/212/350/255/246/344/270/255/345/277/203.svg +1 -0
  463. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/221/274/345/220/270/347/216/207.svg +1 -0
  464. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/225/206/345/272/227@2x.svg +1 -0
  465. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/226/234/346/254/242@2x.svg +1 -0
  466. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/233/276/347/211/207-/346/255/243/345/270/270.svg +1 -0
  467. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/234/250/347/272/277/346/234/215/345/212/241/345/217/260@2x.svg +1 -0
  468. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/234/260/345/233/276@2x.svg +1 -0
  469. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/234/260/351/223/201@2x.svg +1 -0
  470. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/237/272/345/233/240 DNA.svg" +1 -0
  471. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/237/272/345/233/240.svg +1 -0
  472. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/240/206/345/217/240/346/237/261/347/212/266.svg +1 -0
  473. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/243/260/345/205/211/346/212/245/350/255/246.svg +1 -0
  474. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/244/232/347/275/221/351/241/265 web /345/244/232/347/252/227/345/217/243.svg" +1 -0
  475. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/244/247/350/204/221.svg +1 -0
  476. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/256/236/346/227/266/346/246/202/350/247/210 /351/245/274/345/233/276.svg" +1 -0
  477. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/256/244/345/244/226/346/270/251/345/272/246.svg +1 -0
  478. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/257/271/346/216/245 /344/272/244/346/215/242.svg" +1 -0
  479. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/260/272/345/255/220.svg +1 -0
  480. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/260/272/345/257/270.svg +1 -0
  481. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/267/264/345/243/253@2x.svg +1 -0
  482. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/270/203/345/261/200.svg +1 -0
  483. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/270/203/351/230/262/346/217/220/351/206/222.svg +1 -0
  484. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/272/212 /347/235/241/347/234/240.svg" +1 -0
  485. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/272/212.svg +1 -0
  486. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/272/224/347/224/250/351/205/215/347/275/256.svg +1 -0
  487. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/274/200/345/205/263 /345/256/266/347/224/265 /347/224/265/345/231/250.svg" +1 -0
  488. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/274/200/345/217/221 /344/273/243/347/240/201 Bug@2x.svg" +1 -0
  489. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/274/200/345/217/221 /344/273/243/347/240/201 Code@2x.svg" +1 -0
  490. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/274/200/345/217/221 /344/273/243/347/240/201 js /344/273/243/347/240/201@2x.svg" +1 -0
  491. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/274/200/345/217/221 /344/273/243/347/240/201 /344/273/243/347/240/201@2x.svg" +1 -0
  492. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/274/200/345/217/221 /344/273/243/347/240/201 /347/275/221/351/241/265 /344/273/243/347/240/201@2x.svg" +1 -0
  493. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/274/200/351/227/250-2.svg +1 -0
  494. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/274/200/351/227/250.svg +1 -0
  495. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/275/225/345/203/217.svg +1 -0
  496. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/276/252/347/216/257.svg +1 -0
  497. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/276/256/346/263/242/347/202/211 /347/203/244/347/256/261 /345/256/266/347/224/265 /347/224/265/345/231/250.svg" +1 -0
  498. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/277/203/347/216/207 /345/277/203/347/224/265/345/233/276.svg" +1 -0
  499. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/277/203/347/216/207.svg +1 -0
  500. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/277/203/347/224/265/345/233/276 /346/201/222/346/265/201/346/263/204/351/234/262/344/270/212/345/221/212.svg" +1 -0
  501. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/277/203/350/267/263/346/243/200/346/265/213.svg +1 -0
  502. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/200/235/350/200/203 /350/201/224/346/203/263.svg" +1 -0
  503. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/200/245/346/225/221.svg +1 -0
  504. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/210/277/351/227/264@2x.png +0 -0
  505. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/211/213/346/234/272.svg +1 -0
  506. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/211/213/350/241/250.svg +1 -0
  507. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/211/223/345/215/260/346/234/272.svg +1 -0
  508. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/212/225/345/275/261/344/273/252 /345/256/266/347/224/265 /347/224/265/345/231/250.svg" +1 -0
  509. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/212/230/347/272/277/345/233/276.svg +1 -0
  510. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/212/230/347/272/277/351/235/242/347/247/257/345/233/276.svg +1 -0
  511. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/212/245/350/255/246.svg +1 -0
  512. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/213/205/346/236/266/350/275/246@2x.svg +1 -0
  513. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/213/215/347/205/247.svg +1 -0
  514. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/214/207/347/272/271@2x.svg +1 -0
  515. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/216/210/346/235/203.svg +1 -0
  516. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/221/204/345/203/217/345/244/264.svg +1 -0
  517. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/224/257/344/273/230@2x.svg +1 -0
  518. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/224/266/350/227/217/346/266/210/346/201/257.svg +1 -0
  519. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/221/346/212/244/350/275/246@2x.svg +1 -0
  520. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/243/347/202/271/345/233/276.svg +1 -0
  521. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/260/346/215/256 /345/210/206/346/236/220 /345/276/252/347/216/257.svg" +1 -0
  522. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/260/346/215/256 /351/245/274/345/233/276.svg" +1 -0
  523. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/260/346/215/256.svg +1 -0
  524. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/260/346/215/256/346/272/220.svg +1 -0
  525. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/264/344/275/223/346/246/202/345/206/265-2.svg +1 -0
  526. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/264/344/275/223/346/246/202/345/206/265.svg +1 -0
  527. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/344/273/266/345/244/271/346/211/223/345/274/200.svg +1 -0
  528. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/345/255/227.svg +1 -0
  529. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 amr.svg" +1 -0
  530. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 ara.svg" +1 -0
  531. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 bmp.svg" +1 -0
  532. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 csv.svg" +1 -0
  533. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 doc.svg" +1 -0
  534. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 gif.svg" +1 -0
  535. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 jpeg.svg" +1 -0
  536. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 jpg.svg" +1 -0
  537. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 json.svg" +1 -0
  538. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 md.svg" +1 -0
  539. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 mp3.svg" +1 -0
  540. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 mp4.svg" +1 -0
  541. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 pdf.svg" +1 -0
  542. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 png.svg" +1 -0
  543. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 ppt.svg" +1 -0
  544. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 psd.svg" +1 -0
  545. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 svg.svg" +1 -0
  546. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 txt.svg" +1 -0
  547. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 wav.svg" +1 -0
  548. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 xls.svg" +1 -0
  549. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 zip.svg" +1 -0
  550. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/255/347/272/277 /346/226/255/347/275/221/351/207/215/350/257/225 /350/204/211/345/206/262.svg" +1 -0
  551. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/271/346/241/210/347/256/241/347/220/206@2x.png +0 -0
  552. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/275/345/267/245/345/221/230/347/256/241/347/220/206@2x.svg +1 -0
  553. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/227/240/344/272/272/346/234/272.svg +1 -0
  554. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/227/245/346/234/237@2x-2.svg +1 -0
  555. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/227/245/346/234/237@2x.svg +1 -0
  556. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/231/272/350/203/275/346/210/277/351/227/264.svg +1 -0
  557. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/231/272/350/203/275/347/233/221/346/216/247.svg +1 -0
  558. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/231/272/350/203/275/351/227/250/347/246/201.svg +1 -0
  559. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/233/262/347/272/277/345/233/276.svg +1 -0
  560. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/234/211/345/256/263-/346/214/245/345/217/221/346/200/247/346/234/211/346/234/272/347/211/251.svg +1 -0
  561. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/234/215/345/212/241/345/231/250-2.svg +1 -0
  562. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/234/215/345/212/241/345/231/250-3.svg +1 -0
  563. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/234/215/345/212/241/345/231/250.svg +1 -0
  564. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/234/254/345/234/260/350/247/206/351/242/221.svg +1 -0
  565. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/234/272/345/231/250/344/272/272 /344/272/272/345/267/245/346/231/272/350/203/275 .svg" +1 -0
  566. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/237/261/347/212/266/345/233/276-2.svg +1 -0
  567. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/237/261/347/212/266/345/233/276.svg +1 -0
  568. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/240/207/346/270/205.svg +1 -0
  569. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/240/207/347/255/276 /346/240/207/350/256/260@2x.svg" +1 -0
  570. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/240/221/346/234/250 /347/216/257/345/242/203.svg" +1 -0
  571. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/240/221/346/234/250.svg +1 -0
  572. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/240/241/350/275/246@2x.svg +1 -0
  573. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/242/257/346/216/247.svg +1 -0
  574. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/250/241/346/235/277.svg +1 -0
  575. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/224/346/263/241/345/233/276.svg +1 -0
  576. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/344/276/265/344/274/240/346/204/237.svg +1 -0
  577. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/346/265/270.svg +1 -0
  578. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/346/265/270/345/221/212/350/255/246.svg +1 -0
  579. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/347/224/265/347/256/241/347/220/206-2.svg +1 -0
  580. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/347/224/265/347/256/241/347/220/206-3.svg +1 -0
  581. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/347/224/265/347/256/241/347/220/206.svg +1 -0
  582. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/347/224/265/347/256/241/347/220/206_/345/211/257/346/234/254.svg +1 -0
  583. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/350/255/246.svg +1 -0
  584. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/261/202/346/225/221.svg +1 -0
  585. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/261/241/346/237/223.svg +1 -0
  586. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/261/275/350/275/246 /350/277/220/350/276/223 @2x.svg" +1 -0
  587. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/262/231/345/217/221.svg +1 -0
  588. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/264/227/350/241/243/346/234/272 /345/256/266/347/224/265 /347/224/265/345/231/250.svg" +1 -0
  589. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/265/213/350/257/225 /347/247/222/350/241/250@2x.svg" +1 -0
  590. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/265/264/346/261/240 /346/265/264/347/274/270 .svg" +1 -0
  591. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/266/210/346/201/257@2x-2.svg +1 -0
  592. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/266/210/346/201/257@2x-3.svg +1 -0
  593. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/266/210/346/201/257@2x.svg +1 -0
  594. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/267/273/345/212/240/351/241/271/347/233/256-2.svg +1 -0
  595. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/267/273/345/212/240/351/241/271/347/233/256.svg +1 -0
  596. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/270/251/345/272/246-2.svg +1 -0
  597. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/270/251/345/272/246.svg +1 -0
  598. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/270/251/345/272/246/350/277/207/344/275/216.svg +1 -0
  599. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/270/251/345/272/246/350/277/207/351/253/230.svg +1 -0
  600. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/270/270/346/210/217/344/274/221/351/227/262/345/250/261/344/271/220.svg +1 -0
  601. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/271/277/345/272/246/350/277/207/344/275/216.svg +1 -0
  602. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/271/277/345/272/246/350/277/207/351/253/230.svg +1 -0
  603. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253.svg +1 -0
  604. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253/347/201/276.svg +1 -0
  605. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253/350/255/246.svg +1 -0
  606. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253/350/275/246@2x-2.svg +1 -0
  607. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253/350/275/246@2x.svg +1 -0
  608. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/255/347/201/253/345/231/250.svg +1 -0
  609. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/257.svg +1 -0
  610. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/203/237/351/233/276-2.svg +1 -0
  611. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/203/237/351/233/276.svg +1 -0
  612. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/203/237/351/233/276/345/221/212/350/255/246.svg +1 -0
  613. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/203/255/346/260/264.svg +1 -0
  614. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/203/255/346/260/264/345/243/266 /345/256/266/347/224/265 /347/224/265/345/231/250.svg" +1 -0
  615. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/205/247/345/272/246.svg +1 -0
  616. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/207/203/346/260/224.svg +1 -0
  617. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/207/203/346/260/224_/345/211/257/346/234/254.svg +1 -0
  618. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/212/266/346/200/201.svg +1 -0
  619. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/216/257/345/242/203 /346/240/221/345/217/266.svg" +1 -0
  620. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/216/257/345/242/203 /346/240/221/346/234/250.svg" +1 -0
  621. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/216/257/345/242/203.svg +1 -0
  622. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/216/257/345/242/203/347/233/221/346/265/213-2.svg +1 -0
  623. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/216/257/345/242/203/347/233/221/346/265/213.svg +1 -0
  624. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/216/257/345/275/242/345/233/276.svg +1 -0
  625. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/262/347/203/267/345/274/202/345/270/270.svg +1 -0
  626. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/262/351/206/233.svg +1 -0
  627. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265.svg +1 -0
  628. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/345/212/250/350/275/246@2x.svg +1 -0
  629. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/345/255/220/345/233/264/346/240/217 /346/241/206/351/200/211.svg" +1 -0
  630. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/346/272/220 /347/224/265/347/223/266.svg" +1 -0
  631. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/350/247/206 /347/233/264/346/222/255 .svg" +1 -0
  632. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/350/264/271.svg +1 -0
  633. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/351/222/273.svg +1 -0
  634. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/351/243/216/346/211/207.svg +1 -0
  635. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/351/245/255/351/224/205 /345/256/266/347/224/265 /347/224/265/345/231/250.svg" +1 -0
  636. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/273/346/235/277.svg +1 -0
  637. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/233/221/346/265/213.svg +1 -0
  638. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/233/270/346/234/272.svg +1 -0
  639. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/235/241/347/234/240.svg +1 -0
  640. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/244/276/345/214/272/346/231/272/350/203/275-2.svg +1 -0
  641. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/244/276/345/214/272/346/231/272/350/203/275.svg +1 -0
  642. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/246/273/347/272/277.svg +1 -0
  643. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/247/237/350/265/201/347/256/241/347/220/206.svg +1 -0
  644. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/247/257/345/210/206/350/277/220/350/220/245@2x.svg +1 -0
  645. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/251/272/346/260/224/345/207/200/345/214/226/345/231/250 /345/256/266/347/224/265 /347/224/265/345/231/250.svg" +1 -0
  646. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/251/272/350/260/203.svg +1 -0
  647. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/251/272/351/227/264@2x.png +0 -0
  648. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/252/227/345/270/230.svg +1 -0
  649. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/254/224/350/256/260/346/234/254/347/224/265/350/204/221-2.svg +1 -0
  650. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/254/224/350/256/260/346/234/254/347/224/265/350/204/221.svg +1 -0
  651. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/255/211/345/276/205 /345/200/222/350/256/260/346/227/266@2x.svg" +1 -0
  652. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/255/211/345/276/205@2x.svg +1 -0
  653. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/272/242/347/273/277/347/201/257@2x.svg +1 -0
  654. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/273/204/347/273/207/347/256/241/347/220/206@2x-2.png +0 -0
  655. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/273/204/347/273/207/347/256/241/347/220/206@2x.png +0 -0
  656. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/274/226/350/276/221@2x.png +0 -0
  657. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/275/221/351/241/265.svg +1 -0
  658. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/276/216/345/205/203@2x.svg +1 -0
  659. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/200/201/344/272/272 /350/200/201/345/271/264/344/272/272@2x.svg" +1 -0
  660. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/200/263/346/234/272-2.svg +1 -0
  661. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/200/263/346/234/272-3.svg +1 -0
  662. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/200/263/346/234/272.svg +1 -0
  663. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/203/275/345/212/233.svg +1 -0
  664. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/207/252/350/241/214/350/275/246@2x.svg +1 -0
  665. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/212/202/350/203/275.svg +1 -0
  666. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/212/257/347/211/207.svg +1 -0
  667. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/241/200/345/216/213/345/274/202/345/270/270.svg +1 -0
  668. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/241/200/346/260/247.svg +1 -0
  669. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/247/204/350/214/203.md +264 -0
  670. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/247/206/345/233/276/346/250/241/345/274/217.svg +1 -0
  671. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/247/206/351/242/221.svg +1 -0
  672. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/247/206/351/242/221AI.svg +1 -0
  673. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/247/206/351/242/221SD.svg +1 -0
  674. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/242/345/215/225.svg +1 -0
  675. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207-2.svg +1 -0
  676. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207-3.svg +1 -0
  677. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207-4.svg +1 -0
  678. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207-5.svg +1 -0
  679. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207.svg +1 -0
  680. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207/344/272/244/344/273/230-2.svg +1 -0
  681. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207/344/272/244/344/273/230.svg +1 -0
  682. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207/350/277/220/347/273/264.svg +1 -0
  683. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207/350/277/220/350/241/214/347/233/221/346/265/213.svg +1 -0
  684. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207/350/277/236/346/216/245.svg +1 -0
  685. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/347/275/256@2x.svg +1 -0
  686. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/347/275/256/350/260/203/350/257/225.svg +1 -0
  687. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/257/273/345/215/241/345/231/250 /344/277/241/345/217/267.svg" +1 -0
  688. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/264/246/345/217/267@2x.svg +1 -0
  689. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/264/247/350/275/246@2x.svg +1 -0
  690. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/264/255/347/211/251/350/275/246@2x-2.svg +1 -0
  691. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/264/255/347/211/251/350/275/246@2x.svg +1 -0
  692. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/265/204/344/272/247/344/270/255/345/277/203@2x.svg +1 -0
  693. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/267/257/351/232/234.svg +1 -0
  694. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/267/257/351/232/234lu zhang-2.svg" +1 -0
  695. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/267/257/351/232/234lu zhang.svg" +1 -0
  696. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/246/350/241/214@2x.svg +1 -0
  697. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/254/344/272/244/346/235/203/351/231/220.svg +1 -0
  698. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/256/346/244/205-2.svg +1 -0
  699. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/256/346/244/205.svg +1 -0
  700. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/256/346/270/241@2x.svg +1 -0
  701. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/277/350/275/246@2x-2.svg +1 -0
  702. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/277/350/275/246@2x.svg +1 -0
  703. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/277/220/350/220/245/347/256/241/347/220/206.svg +1 -0
  704. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/277/220/350/276/223/350/275/246@2x.svg +1 -0
  705. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/277/233/345/272/246/346/235/241.svg +1 -0
  706. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/200/232/346/226/255/345/231/250.svg +1 -0
  707. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/201/245/346/216/247.svg +1 -0
  708. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/223/201/351/224/271.svg +1 -0
  709. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/224/201.svg +1 -0
  710. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/224/256/347/233/230.svg +1 -0
  711. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/227/250/347/243/201/345/221/212/350/255/246.svg +1 -0
  712. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/227/250/351/224/201.svg +1 -0
  713. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/227/256/345/217/267@2x.svg +1 -0
  714. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/230/266/346/242/257@2x.svg +1 -0
  715. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/233/252/350/212/261 /344/270/213/351/233/252 .svg" +1 -0
  716. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/233/252/350/212/261 /345/210/266/345/206/267.svg" +1 -0
  717. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/233/267/350/276/276 /346/211/253/346/217/217 /345/217/221/347/216/260 .svg" +1 -0
  718. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/235/231/350/204/211/346/263/250/345/260/204.svg +1 -0
  719. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/237/263/345/223/215.svg +1 -0
  720. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/241/271/347/233/256.svg +1 -0
  721. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/243/236/346/234/272@2x-2.svg +1 -0
  722. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/243/236/346/234/272@2x.svg +1 -0
  723. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/251/254/346/241/266.svg +1 -0
  724. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/253/230/345/210/206/345/255/220.svg +1 -0
  725. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/253/230/346/270/205.svg +1 -0
  726. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/274/240/346/240/207.svg +1 -0
  727. package/skills/micro-app-design/assets/tuya-design-system/source.json +18 -0
  728. package/skills/micro-app-design/references/action-outcomes.md +7 -0
  729. package/skills/micro-app-design/references/adaptive-card-grid.md +25 -0
  730. package/skills/micro-app-design/references/capsule-fallback.md +36 -0
  731. package/skills/micro-app-design/references/component-boundaries.md +48 -0
  732. package/skills/micro-app-design/references/component-catalog.md +69 -0
  733. package/skills/micro-app-design/references/design-system.md +34 -0
  734. package/skills/micro-app-design/references/empty-and-error-states.md +27 -0
  735. package/skills/micro-app-design/references/icons.md +33 -0
  736. package/skills/micro-app-design/references/implementation-guidance.md +39 -0
  737. package/skills/micro-app-design/references/modal.md +27 -0
  738. package/skills/micro-app-design/references/page-patterns.md +55 -0
  739. package/skills/micro-app-design/references/quality-checklist.md +57 -0
  740. package/skills/micro-app-design/references/requirements-and-permission-states.md +19 -0
  741. package/skills/micro-app-design/references/source-and-scope.md +40 -0
  742. package/skills/micro-app-design/references/tokens.md +23 -0
  743. package/skills/micro-app-design/references/visual-acceptance.md +51 -0
  744. package/skills/micro-app-design/scripts/microapp-kit.mjs +117 -0
  745. package/skills/micro-app-design/scripts/visual-audit.mjs +197 -0
  746. package/skills/micro-app-design/tests/behavior-scenarios.md +154 -0
  747. package/skills/micro-app-design/tests/validate-design-skill.mjs +35 -0
  748. package/skills/micro-app-design/tests/validate-design-system.mjs +51 -0
  749. package/skills/micro-app-development/SKILL.md +132 -0
  750. package/skills/micro-app-development/agents/openai.yaml +6 -0
  751. package/skills/micro-app-development/references/agent-workflow.md +111 -0
  752. package/skills/micro-app-development/references/application-icons.md +50 -0
  753. package/skills/micro-app-development/references/data-change-safety.md +47 -0
  754. package/skills/micro-app-development/references/delivery-checklist.md +129 -0
  755. package/skills/micro-app-development/references/design-workflow.md +77 -0
  756. package/skills/micro-app-development/references/developer-credentials.md +97 -0
  757. package/skills/micro-app-development/references/development-guide.md +215 -0
  758. package/skills/micro-app-development/references/environment-progress.md +47 -0
  759. package/skills/micro-app-development/references/joint-acceptance.md +105 -0
  760. package/skills/micro-app-development/references/local-development.md +40 -0
  761. package/skills/micro-app-development/references/manifest-v1.2.md +129 -0
  762. package/skills/micro-app-development/references/npm-registry.md +50 -0
  763. package/skills/micro-app-development/references/platform-operations.md +48 -0
  764. package/skills/micro-app-development/references/project-workflow.md +36 -0
  765. package/skills/micro-app-development/references/publication-intent.md +34 -0
  766. package/skills/micro-app-development/references/publication-recovery.md +67 -0
  767. package/skills/micro-app-development/references/requirement-intake.md +122 -0
  768. package/skills/micro-app-development/references/runtime-requirements.md +23 -0
  769. package/skills/micro-app-development/references/space-permission-boundaries.md +46 -0
  770. package/skills/micro-app-development/references/tool-update.md +62 -0
  771. package/skills/micro-app-development/references/toolchain-access.md +35 -0
  772. package/skills/micro-app-development/references/user-journey.md +65 -0
  773. package/skills/micro-app-development/references/workspace-environments.md +39 -0
  774. package/skills/micro-app-development/scripts/application-icon.mjs +108 -0
  775. package/skills/micro-app-development/scripts/install-app-icon.mjs +48 -0
  776. package/skills/micro-app-development/scripts/install-menu-icon.mjs +27 -0
  777. package/skills/micro-app-development/scripts/language-policy.mjs +83 -0
  778. package/skills/micro-app-development/scripts/languages.json +372 -0
  779. package/skills/micro-app-development/scripts/locale-keys.mjs +26 -0
  780. package/skills/micro-app-development/scripts/microapp-kit.mjs +117 -0
  781. package/skills/micro-app-development/scripts/project-code.mjs +13 -0
  782. package/skills/micro-app-development/scripts/review-backend-logging.mjs +27 -0
  783. package/skills/micro-app-development/scripts/review-production-authorization.mjs +37 -0
  784. package/skills/micro-app-development/scripts/validate-micro-app-project.mjs +442 -0
  785. package/skills/micro-app-development/tests/application-icons.test.mjs +131 -0
  786. package/skills/micro-app-development/tests/backend-logging-review.test.mjs +24 -0
  787. package/skills/micro-app-development/tests/behavior-scenarios.md +177 -0
  788. package/skills/micro-app-development/tests/data-change-safety-scenarios.md +25 -0
  789. package/skills/micro-app-development/tests/design-workflow-scenarios.md +40 -0
  790. package/skills/micro-app-development/tests/fixtures/valid-v6/_locales/en.json +6 -0
  791. package/skills/micro-app-development/tests/fixtures/valid-v6/_locales/zh-CN.json +6 -0
  792. package/skills/micro-app-development/tests/fixtures/valid-v6/manifest.json +59 -0
  793. package/skills/micro-app-development/tests/fixtures/valid-v6/micro.config.js +5 -0
  794. package/skills/micro-app-development/tests/fixtures/valid-v6/mock/index.json +11 -0
  795. package/skills/micro-app-development/tests/fixtures/valid-v6/package.json +4 -0
  796. package/skills/micro-app-development/tests/fixtures/valid-v6/src/index.tsx +5 -0
  797. package/skills/micro-app-development/tests/fixtures/valid-v6/src/lang/en.ts +1 -0
  798. package/skills/micro-app-development/tests/fixtures/valid-v6/src/lang/zh.ts +1 -0
  799. package/skills/micro-app-development/tests/fixtures/valid-v6/src/public-path.js +3 -0
  800. package/skills/micro-app-development/tests/production-authorization-review.test.mjs +72 -0
  801. package/skills/micro-app-development/tests/six-skill-routing-scenarios.md +60 -0
  802. package/skills/micro-app-development/tests/user-journey-scenarios.md +19 -0
  803. package/skills/micro-app-development/tests/validate-micro-app-project.test.mjs +428 -0
  804. package/skills/micro-app-frontend-development/SKILL.md +86 -0
  805. package/skills/micro-app-frontend-development/agents/openai.yaml +6 -0
  806. package/skills/micro-app-frontend-development/references/api-and-permissions.md +86 -0
  807. package/skills/micro-app-frontend-development/references/custom-api-requests.md +52 -0
  808. package/skills/micro-app-frontend-development/references/debugging.md +36 -0
  809. package/skills/micro-app-frontend-development/references/i18n-and-theme.md +54 -0
  810. package/skills/micro-app-frontend-development/references/interaction-completion.md +61 -0
  811. package/skills/micro-app-frontend-development/references/micro-frontend-runtime.md +33 -0
  812. package/skills/micro-app-frontend-development/references/routing-and-context.md +96 -0
  813. package/skills/micro-app-frontend-development/references/saas-failure-and-display.md +45 -0
  814. package/skills/micro-app-frontend-development/references/standard-api-requests.md +30 -0
  815. package/skills/micro-app-frontend-development/references/submission-errors.md +51 -0
  816. package/skills/micro-app-frontend-development/scripts/microapp-kit.mjs +117 -0
  817. package/skills/micro-app-frontend-development/tests/behavior-scenarios.md +36 -0
  818. package/skills/micro-app-solution-design/SKILL.md +69 -0
  819. package/skills/micro-app-solution-design/agents/openai.yaml +6 -0
  820. package/skills/micro-app-solution-design/scripts/microapp-kit.mjs +117 -0
  821. package/skills/micro-app-solution-design/tests/behavior-scenarios.md +12 -0
@@ -0,0 +1,4 @@
1
+ {
2
+ "version": "v6-local-dev-v2",
3
+ "description": "DEV-only proxy authentication; no production identity or database."
4
+ }
File without changes
@@ -0,0 +1,12 @@
1
+ import { resolve } from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ // Keep local backend commands aligned with the production Node major.
4
+ export function requireBackendNode(version = process.versions.node) {
5
+ if (!/^24\.\d+\.\d+$/.test(version)) {
6
+ throw new Error('BACKEND_NODE_REQUIRED: Backend requires Node 24.x. Use the project runtime configure command to select a separate Node 24; preserve your global Node.');
7
+ }
8
+ }
9
+ if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
10
+ try { requireBackendNode(); }
11
+ catch (error) { console.error(error.message); process.exitCode = 1; }
12
+ }
@@ -0,0 +1,362 @@
1
+ // Editable DEV tool only. Production uses the platform-controlled runtime.
2
+ import { readFileSync, writeFileSync, readdirSync, lstatSync } from 'node:fs';
3
+ import { resolve, join } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ import { createHash } from 'node:crypto';
6
+
7
+ const digest = bytes => createHash('sha256').update(bytes).digest('hex');
8
+ const fail = code => { throw new Error(code); };
9
+ const roots = ['migrations', 'deploy/tasks', 'deploy/data'];
10
+ const connectionTimeoutMillis = 10000;
11
+
12
+ // User-visible diagnostics use fixed descriptions, never raw driver/task messages or SQL.
13
+ const failures = {
14
+ MISSING_MIGRATION_ENV: ['Database deployment configuration is missing', 'Check the platform-provided DATABASE_URL and DEPLOY_SCOPE.'],
15
+ INVALID_DEPLOY_SCOPE: ['The database deployment scope is invalid', 'Check the stable deployment scope provided by the platform.'],
16
+ INVALID_TENANT_SCHEMA: ['The connection has no valid tenant schema', 'Check the runtime account search_path. Do not fall back to public.'],
17
+ MIGRATION_HISTORY_MISSING: ['The tenant has business objects but no SQL deployment history', 'Verify and restore or rename the existing ledger through a controlled procedure. Do not replay from an empty ledger.'],
18
+ APPLIED_HISTORY_MISMATCH: ['The cumulative bundle does not match the applied history', 'Check the order and digests of released migrations. Do not rewrite applied history.'],
19
+ DEPLOY_BUSY: ['Another deployment holds the database migration lock', 'Wait for the active deployment to finish. Do not rerun migrations concurrently.'],
20
+ CHANGE_DIGEST_MISMATCH: ['A deployment file digest does not match the manifest', 'Check the fixed bundle and image for this release. Do not overwrite released history.'],
21
+ INVALID_MANIFEST: ['The deployment manifest is invalid', 'Check deploy/manifest.json, validate the bundle, and package it again.'],
22
+ INVALID_CHANGE_ORDER: ['The migration ID order is invalid', 'Keep the manifest in cumulative history order. Do not insert changes into released history.'],
23
+ INVALID_CHANGE: ['A migration entry is invalid', 'Check the migration type and declared inputs.'],
24
+ INVALID_CHANGE_FILE: ['The migration file does not match its ID', 'Check the manifest ID, type, and file path.'],
25
+ INVALID_INPUT: ['A migration input declaration is invalid', 'Declare only fixed input files under deploy/data.'],
26
+ UNDECLARED_INPUT: ['The deployment task requested an undeclared input', 'Declare the input file in the corresponding migration entry.'],
27
+ UNDECLARED_DEPLOY_FILE: ['The deployment bundle contains undeclared files', 'Check migrations, deploy/tasks, and deploy/data against the manifest.'],
28
+ UNSAFE_PATH: ['A deployment file path is unsafe', 'Remove symbolic links or out-of-scope paths, then validate and package again.'],
29
+ UNSAFE_MANIFEST: ['The deployment manifest path is unsafe', 'Remove symbolic links, then validate and package again.'],
30
+ INVALID_FILE: ['A deployment input is not a regular file', 'Check the file types in the deployment bundle.'],
31
+ NON_TRANSACTIONAL_SQL: ['The migration contains an unsupported transaction command', 'Use supported SQL that can run in a short transaction.'],
32
+ RESERVED_MIGRATION_TABLE: ['Business migrations cannot modify the SQL deployment history table', 'Remove direct reads and writes to the internal ledger.'],
33
+ INVALID_SQL: ['The deployment task submitted invalid SQL', 'Check the query calls in the deployment task.'],
34
+ CUSTOM_SCRIPTS_UNSUPPORTED: ['Custom deployment scripts are not supported', 'Use SQL migrations; do not rewrite already applied history.'],
35
+ INVALID_TASK: ['The deployment task has no up function', 'Export async function up and validate again.'],
36
+ INVALID_DEPLOY_COMMAND: ['The deployment command is invalid', 'Use check, seal, or apply.'],
37
+ };
38
+ const externalFailures = {
39
+ '42501': ['DATABASE_PERMISSION_DENIED', 'The database account has insufficient privileges', 'Check the tenant schema and table privileges required for this step. Do not grant writes to public.'],
40
+ '42601': ['SQL_SYNTAX_ERROR', 'The migration SQL has a syntax error', 'Check the SQL at the reported migration ID and character position.'],
41
+ '42P01': ['SQL_TABLE_NOT_FOUND', 'A table referenced by the migration does not exist', 'Check the current schema, cumulative migration order, and required tables.'],
42
+ '42703': ['SQL_COLUMN_NOT_FOUND', 'A column referenced by the migration does not exist', 'Check the migration order and target database structure.'],
43
+ '23505': ['SQL_UNIQUE_CONFLICT', 'The migration violates a unique constraint', 'Check the target data and change logic. Do not rerun blindly.'],
44
+ '23503': ['SQL_FOREIGN_KEY_CONFLICT', 'The migration violates a foreign key constraint', 'Check data dependencies and migration order.'],
45
+ '23502': ['SQL_NOT_NULL_CONFLICT', 'The migration violates a not-null constraint', 'Check default values, existing data, and write logic.'],
46
+ '25006': ['DATABASE_READ_ONLY', 'The target database is read-only', 'Check the resource read-only status and capacity limits.'],
47
+ '28P01': ['DATABASE_AUTHENTICATION_FAILED', 'Database account authentication failed', 'Check the platform-provided runtime account settings. Do not log secrets.'],
48
+ '28000': ['DATABASE_AUTHENTICATION_FAILED', 'Database connection authentication was rejected', 'Check the runtime account and database access policy.'],
49
+ '3D000': ['DATABASE_NOT_FOUND', 'The target database does not exist', 'Check the database resource configuration for this region.'],
50
+ '3F000': ['DATABASE_SCHEMA_NOT_FOUND', 'The target schema does not exist', 'Check the tenant resource and the account search_path.'],
51
+ '55P03': ['DATABASE_LOCK_TIMEOUT', 'The database lock wait timed out', 'Check concurrent operations and the lock holder before proceeding.'],
52
+ '57014': ['SQL_EXECUTION_CANCELLED', 'SQL execution timed out or was cancelled', 'Check the migration duration and database state.'],
53
+ '40P01': ['DATABASE_DEADLOCK', 'The database detected a deadlock', 'Check concurrent migrations and transaction order.'],
54
+ '40001': ['DATABASE_SERIALIZATION_FAILED', 'A database transaction serialization conflict occurred', 'Check deployment history before deciding whether to retry.'],
55
+ '53300': ['DATABASE_CONNECTION_LIMIT', 'The database connection limit has been reached', 'Check connection usage and resource limits.'],
56
+ ECONNREFUSED: ['DATABASE_CONNECTION_REFUSED', 'The database connection was refused', 'Check the database service, network policy, and port.'],
57
+ ETIMEDOUT: ['DATABASE_CONNECTION_TIMEOUT', 'The database connection timed out', 'Check regional network connectivity and database availability.'],
58
+ ENETUNREACH: ['DATABASE_NETWORK_UNREACHABLE', 'The database network is unreachable', 'Check routes, VPC settings, and network policies from the business Pod to the database.'],
59
+ EHOSTUNREACH: ['DATABASE_NETWORK_UNREACHABLE', 'The database host is unreachable', 'Check routes and network policies from the business Pod to the database host.'],
60
+ ENOTFOUND: ['DATABASE_DNS_FAILED', 'Database DNS resolution failed', 'Check the database address and DNS.'],
61
+ EAI_AGAIN: ['DATABASE_DNS_FAILED', 'Database DNS resolution is temporarily unavailable', 'Check DNS and the regional network.'],
62
+ ECONNRESET: ['DATABASE_CONNECTION_RESET', 'The database connection was reset', 'Check migration history and transaction results before deciding whether to retry.'],
63
+ ENOENT: ['DEPLOY_FILE_MISSING', 'A required deployment file is missing', 'Check the deployment bundle and startup scripts in the image.'],
64
+ EACCES: ['DEPLOY_FILE_ACCESS_DENIED', 'A deployment file cannot be accessed', 'Check file permissions and the runtime account in the image.'],
65
+ ERR_MODULE_NOT_FOUND: ['DEPLOY_DEPENDENCY_MISSING', 'A deployment runtime dependency is missing from the image', 'Check production dependencies in the migration stage and the image copy steps.'],
66
+ ERR_INVALID_URL: ['DATABASE_URL_INVALID', 'The database connection URL is invalid', 'Check the format of the platform-provided runtime connection.'],
67
+ };
68
+ // Bound traversal: drivers may wrap socket/TLS errors or return AggregateError with nested causes.
69
+ function errorChain(error) {
70
+ const pending = [error], result = [], seen = new Set();
71
+ while (pending.length && result.length < 8) {
72
+ const current = pending.shift();
73
+ if (!current || typeof current !== 'object' || seen.has(current)) continue;
74
+ seen.add(current); result.push(current);
75
+ if (current.cause) pending.push(current.cause);
76
+ if (Array.isArray(current.errors)) pending.push(...current.errors.slice(0, 8));
77
+ }
78
+ return result;
79
+ }
80
+ const tlsCodes = new Set([
81
+ 'CERT_HAS_EXPIRED', 'DEPTH_ZERO_SELF_SIGNED_CERT', 'SELF_SIGNED_CERT_IN_CHAIN',
82
+ 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', 'ERR_TLS_CERT_ALTNAME_INVALID',
83
+ 'UNABLE_TO_GET_ISSUER_CERT', 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY',
84
+ 'ERR_SSL_WRONG_VERSION_NUMBER', 'ERR_SSL_TLSV1_ALERT_PROTOCOL_VERSION',
85
+ ]);
86
+ function diagnostic(error, stage) {
87
+ const chain = errorChain(error);
88
+ const internal = typeof error?.message === 'string' && Object.hasOwn(failures, error.message) ? error.message : undefined;
89
+ const mapped = chain.find(item => typeof item.code === 'string' && Object.hasOwn(externalFailures, item.code));
90
+ const code = mapped?.code ?? (typeof error?.code === 'string' ? error.code : '');
91
+ const external = mapped ? externalFailures[code] : undefined;
92
+ let result = internal ? { code: internal, message: failures[internal][0], hint: failures[internal][1] }
93
+ : external ? { code: external[0], message: external[1], hint: external[2] }
94
+ : undefined;
95
+ if (!result && stage === 'DATABASE_CONNECT') {
96
+ const messages = chain.map(item => item.message);
97
+ if (messages.some(message => message === 'timeout expired' || message === 'Connection terminated due to connection timeout')) {
98
+ result = { code: 'DATABASE_CONNECTION_TIMEOUT', message: 'The database connection timed out', hint: 'Connection establishment exceeded 10 seconds. Check Pod DNS, network ports, and the SSL handshake.' };
99
+ } else if (chain.some(item => tlsCodes.has(item.code))) {
100
+ result = { code: 'DATABASE_TLS_FAILED', message: 'The database TLS handshake or certificate validation failed', hint: 'Check SSL settings, certificate validity, trust chain, and hostname. Do not disable certificate verification.' };
101
+ } else if (messages.includes('The server does not support SSL connections')) {
102
+ result = { code: 'DATABASE_SSL_NOT_SUPPORTED', message: 'The database does not support the requested SSL connection', hint: 'Check the target and server SSL support. Match connection settings to the database requirements.' };
103
+ } else if (messages.some(message => message === 'SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string'
104
+ || message === 'SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a non-empty string')) {
105
+ result = { code: 'DATABASE_AUTHENTICATION_CONFIGURATION_INVALID', message: 'The database authentication configuration is invalid', hint: 'Check the type and completeness of the platform-provided account settings. Do not log passwords.' };
106
+ } else if (messages.includes('Connection terminated unexpectedly')) {
107
+ result = { code: 'DATABASE_CONNECTION_RESET', message: 'The database connection was reset during establishment', hint: 'Check database access policies, network devices, and database service health.' };
108
+ } else {
109
+ result = { code: 'DATABASE_CONNECTION_FAILED', message: 'Database connection establishment failed', hint: 'Check DNS, network ports, SSL, and authentication. No migration SQL has run.' };
110
+ }
111
+ }
112
+ result ??= { code: 'DEPLOY_STEP_FAILED', message: 'The deployment step failed', hint: 'Check the script for the reported stage and migration ID. Raw errors are omitted to protect sensitive data.' };
113
+ if (/^(?:[0-9][0-9A-Z]|P0|XX|HV|F0)[0-9A-Z]{3}$/.test(code)) result.sqlState = code;
114
+ const position = mapped?.position ?? error?.position;
115
+ if (result.sqlState && /^[1-9][0-9]{0,8}$/.test(String(position ?? ''))) result.position = Number(position);
116
+ return result;
117
+ }
118
+
119
+ // Log effective pg settings only. Never serialize the client, URL, SSL object or environment.
120
+ function connectionSettings(client) {
121
+ const parameters = client.connectionParameters;
122
+ const text = value => typeof value === 'string' ? value.slice(0, 512) : null;
123
+ const ssl = parameters.ssl ? { enabled: true, rejectUnauthorized: parameters.ssl.rejectUnauthorized !== false }
124
+ : { enabled: false };
125
+ return {
126
+ host: text(parameters.host), port: parameters.port, database: text(parameters.database), user: text(parameters.user),
127
+ ssl, connectionTimeoutMillis,
128
+ };
129
+ }
130
+ function steps(report, change = () => undefined) {
131
+ const emit = (stage, status, extra = {}) => {
132
+ const id = change();
133
+ report({ event: 'SQL_DEPLOY', time: new Date().toISOString(), stage, status,
134
+ ...(typeof id === 'string' && /^[0-9]{4,}_[a-z0-9_]{1,100}$/.test(id) ? { id } : {}), ...extra });
135
+ };
136
+ return {
137
+ emit,
138
+ async run(stage, action) {
139
+ const started = Date.now(); emit(stage, 'STARTED');
140
+ try {
141
+ const result = await action();
142
+ emit(stage, 'SUCCEEDED', { durationMs: Date.now() - started });
143
+ return result;
144
+ } catch (error) {
145
+ emit(stage, 'FAILED', { ...diagnostic(error, stage), durationMs: Date.now() - started });
146
+ throw error;
147
+ }
148
+ },
149
+ };
150
+ }
151
+
152
+ // This is a reviewed project artifact, not a sandbox for untrusted JavaScript.
153
+ export function loadBundle(root, { seal = false } = {}) {
154
+ root = resolve(root);
155
+ const manifestPath = join(root, 'deploy/manifest.json');
156
+ if (lstatSync(join(root, 'deploy')).isSymbolicLink() || lstatSync(manifestPath).isSymbolicLink()) fail('UNSAFE_MANIFEST');
157
+ const manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
158
+ if (manifest.format !== 'v6-deploy-bundle-v1' || !Array.isArray(manifest.changes)) fail('INVALID_MANIFEST');
159
+ const used = new Set();
160
+ function read(path) {
161
+ if (typeof path !== 'string' || !/^(migrations|deploy\/(tasks|data))\/[A-Za-z0-9_./-]+$/.test(path) || path.split('/').some(p => p === '.' || p === '..' || !p)) fail('UNSAFE_PATH');
162
+ let current = root;
163
+ for (const part of path.split('/')) {
164
+ current = join(current, part);
165
+ if (lstatSync(current).isSymbolicLink()) fail('UNSAFE_PATH');
166
+ }
167
+ if (!lstatSync(current).isFile()) fail('INVALID_FILE');
168
+ used.add(path);
169
+ return readFileSync(current);
170
+ }
171
+ let previous = '';
172
+ const changes = manifest.changes.map(change => {
173
+ if (!/^[0-9]{4,}_[a-z0-9_]+$/.test(change.id) || change.id <= previous) fail('INVALID_CHANGE_ORDER');
174
+ previous = change.id;
175
+ if (change.type !== 'sql') fail('CUSTOM_SCRIPTS_UNSUPPORTED');
176
+ if (!Array.isArray(change.inputs) || change.inputs.length) fail('INVALID_CHANGE');
177
+ const prefix = 'migrations/';
178
+ const extension = '.sql';
179
+ if (change.file !== prefix + change.id + extension) fail('INVALID_CHANGE_FILE');
180
+ const bytes = read(change.file);
181
+ const inputs = {};
182
+ for (const path of change.inputs) {
183
+ if (!path.startsWith('deploy/data/') || Object.hasOwn(inputs, path)) fail('INVALID_INPUT');
184
+ inputs[path] = read(path);
185
+ }
186
+ const sha256 = digest(JSON.stringify([change.id, change.type, change.file, digest(bytes), Object.entries(inputs).map(([path, data]) => [path, digest(data)])]));
187
+ if (!seal && change.sha256 !== sha256) fail('CHANGE_DIGEST_MISMATCH');
188
+ if (change.type === 'sql') assertTransactionalSQL(bytes.toString('utf8'));
189
+ return { ...change, sha256, bytes, inputs };
190
+ });
191
+ // Catch a Coding-created migration/data file that was forgotten in the manifest.
192
+ function walk(directory) {
193
+ if (lstatSync(join(root, directory)).isSymbolicLink()) fail('UNSAFE_PATH');
194
+ for (const name of readdirSync(join(root, directory))) {
195
+ const path = directory + '/' + name, stat = lstatSync(join(root, path));
196
+ if (stat.isSymbolicLink()) fail('UNSAFE_PATH');
197
+ if (stat.isDirectory()) walk(path);
198
+ else if (!stat.isFile() || (!used.has(path) && name !== 'README.md')) fail('UNDECLARED_DEPLOY_FILE');
199
+ }
200
+ }
201
+ roots.forEach(walk);
202
+ if (seal) {
203
+ manifest.changes.forEach((change, index) => { change.sha256 = changes[index].sha256; });
204
+ writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\n');
205
+ }
206
+ return { root, changes };
207
+ }
208
+
209
+ export function assertTransactionalSQL(sql) {
210
+ // Ignore literal/comment contents when looking for transaction escape commands.
211
+ const plain = sql.replace(/--[^\n]*|\/\*[\s\S]*?\*\/|'(?:''|[^'])*'|"(?:""|[^"])*"|\$([A-Za-z_][A-Za-z0-9_]*|)\$[\s\S]*?\$\1\$/g, ' ');
212
+ if (/(^|;)\s*(begin|start\s+transaction|commit|end|rollback|abort|prepare\s+transaction|vacuum)\b/i.test(plain) || /\bconcurrently\b/i.test(plain)) fail('NON_TRANSACTIONAL_SQL');
213
+ if (/\b_sql_deploy_history\b/i.test(sql)) fail('RESERVED_MIGRATION_TABLE');
214
+ }
215
+
216
+ export async function applyBundle(bundle, client, scope, report = () => {}) {
217
+ let locked = false, active, failed = false;
218
+ const log = steps(report, () => active);
219
+ await log.run('SCOPE_VALIDATE', () => {
220
+ if (!/^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$/.test(scope ?? '')) fail('INVALID_DEPLOY_SCOPE');
221
+ });
222
+ try {
223
+ await log.run('LOCK_ACQUIRE', async () => {
224
+ const lock = await client.query('SELECT pg_try_advisory_lock(186792401, 1) AS locked');
225
+ if (!lock.rows[0].locked) fail('DEPLOY_BUSY');
226
+ locked = true;
227
+ });
228
+ const schema = await log.run('SCHEMA_RESOLVE', async () => {
229
+ const target = await client.query('SELECT current_schema() AS schema');
230
+ const schema = target.rows[0]?.schema;
231
+ if (typeof schema !== 'string' || !/^tenant_[a-z0-9_]{1,49}$/.test(schema)) fail('INVALID_TENANT_SCHEMA');
232
+ return schema;
233
+ });
234
+ const history = `"${schema}"."_sql_deploy_history"`;
235
+ const existing = await log.run('HISTORY_LOOKUP', () => client.query('SELECT to_regclass($1) AS history_table', [history]));
236
+ if (!existing.rows[0]?.history_table) {
237
+ await log.run('HISTORY_INITIALIZE', async () => {
238
+ // create_tenant provisions an admin-owned health_check before the first app release.
239
+ // Exempt only its exact platform shape; any business object or old ledger still blocks replay.
240
+ const contents = await client.query(`SELECT EXISTS (
241
+ SELECT 1 FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace
242
+ WHERE n.nspname = $1 AND c.relkind IN ('r', 'p', 'v', 'm', 'S', 'f')
243
+ AND NOT (
244
+ c.relkind = 'r' AND c.relname = 'health_check' AND NOT c.relispartition AND c.reloftype = 0
245
+ AND NOT c.relrowsecurity
246
+ AND (SELECT count(*) FROM pg_catalog.pg_attribute a
247
+ WHERE a.attrelid = c.oid AND a.attnum > 0 AND NOT a.attisdropped) = 2
248
+ AND EXISTS (SELECT 1 FROM pg_catalog.pg_attribute a
249
+ WHERE a.attrelid = c.oid AND a.attname = 'id' AND a.attnum > 0 AND NOT a.attisdropped
250
+ AND a.atttypid = 'pg_catalog.int4'::pg_catalog.regtype AND a.attnotnull)
251
+ AND EXISTS (SELECT 1 FROM pg_catalog.pg_attribute a
252
+ WHERE a.attrelid = c.oid AND a.attname = 'updated_at' AND a.attnum > 0 AND NOT a.attisdropped
253
+ AND a.atttypid = 'pg_catalog.timestamptz'::pg_catalog.regtype AND NOT a.attnotnull)
254
+ AND (SELECT count(*) FROM pg_catalog.pg_constraint p
255
+ WHERE p.conrelid = c.oid AND p.contype <> 'n') = 1
256
+ AND EXISTS (SELECT 1 FROM pg_catalog.pg_constraint p
257
+ WHERE p.conrelid = c.oid AND p.contype = 'p'
258
+ AND p.conkey = ARRAY[(SELECT a.attnum FROM pg_catalog.pg_attribute a
259
+ WHERE a.attrelid = c.oid AND a.attname = 'id'
260
+ AND a.attnum > 0 AND NOT a.attisdropped)])
261
+ AND (SELECT count(*) FROM pg_catalog.pg_index i WHERE i.indrelid = c.oid) = 1
262
+ AND NOT EXISTS (SELECT 1 FROM pg_catalog.pg_attrdef d WHERE d.adrelid = c.oid)
263
+ AND NOT EXISTS (SELECT 1 FROM pg_catalog.pg_trigger t WHERE t.tgrelid = c.oid AND NOT t.tgisinternal)
264
+ AND NOT EXISTS (SELECT 1 FROM pg_catalog.pg_inherits i WHERE i.inhrelid = c.oid OR i.inhparent = c.oid)
265
+ )
266
+ ) AS populated`, [schema]);
267
+ if (contents.rows[0]?.populated) fail('MIGRATION_HISTORY_MISSING');
268
+ await client.query(`CREATE TABLE IF NOT EXISTS ${history} (
269
+ scope text NOT NULL, id text NOT NULL, sha256 text NOT NULL,
270
+ applied_at timestamptz NOT NULL DEFAULT now(), PRIMARY KEY(scope, id))`);
271
+ });
272
+ }
273
+ const rows = await log.run('HISTORY_CHECK', async () => {
274
+ const { rows } = await client.query(`SELECT id, sha256 FROM ${history} WHERE scope = $1 ORDER BY id COLLATE "C"`, [scope]);
275
+ for (let i = 0; i < rows.length; i++) {
276
+ const change = bundle.changes[i];
277
+ if (!change || change.id !== rows[i].id || change.sha256 !== rows[i].sha256) fail('APPLIED_HISTORY_MISMATCH');
278
+ }
279
+ return rows;
280
+ });
281
+ log.emit('CHANGE_PLAN', 'SUCCEEDED', { total: bundle.changes.length, pending: bundle.changes.length - rows.length, skipped: rows.length });
282
+ for (const change of bundle.changes.slice(rows.length)) {
283
+ active = change.id;
284
+ log.emit('CHANGE', 'RUNNING');
285
+ await log.run('CHANGE_BEGIN', () => client.query('BEGIN'));
286
+ try {
287
+ await log.run('CHANGE_EXECUTE', async () => {
288
+ await client.query("SET LOCAL lock_timeout = '5s'");
289
+ await client.query("SET LOCAL statement_timeout = '60s'");
290
+ const query = async (sql, values) => {
291
+ if (typeof sql !== 'string') fail('INVALID_SQL');
292
+ assertTransactionalSQL(sql);
293
+ return client.query(sql, values);
294
+ };
295
+ if (change.type !== 'sql') fail('CUSTOM_SCRIPTS_UNSUPPORTED');
296
+ await query(change.bytes.toString('utf8'));
297
+ });
298
+ await log.run('HISTORY_RECORD', () => client.query(`INSERT INTO ${history}(scope, id, sha256) VALUES ($1, $2, $3)`, [scope, change.id, change.sha256]));
299
+ await log.run('CHANGE_COMMIT', () => client.query('COMMIT'));
300
+ } catch (error) {
301
+ try { await log.run('CHANGE_ROLLBACK', () => client.query('ROLLBACK')); }
302
+ catch { /* Cleanup failure has its own safe event; preserve the original failure. */ }
303
+ throw error;
304
+ }
305
+ log.emit('CHANGE', 'APPLIED');
306
+ active = undefined;
307
+ }
308
+ log.emit('MIGRATION_APPLY', 'SUCCESS', { applied: bundle.changes.length - rows.length, skipped: rows.length });
309
+ } catch (error) {
310
+ failed = true;
311
+ throw error;
312
+ } finally {
313
+ if (locked) {
314
+ try { await log.run('LOCK_RELEASE', () => client.query('SELECT pg_advisory_unlock(186792401, 1)')); }
315
+ catch (error) { if (!failed) throw error; }
316
+ }
317
+ }
318
+ }
319
+
320
+ export async function main(args = process.argv.slice(2)) {
321
+ const print = event => (event.status === 'FAILED' ? console.error : console.log)(JSON.stringify(event));
322
+ const log = steps(print);
323
+ const command = await log.run('COMMAND_VALIDATE', () => {
324
+ if (args.length !== 1 || !['check', 'seal', 'apply'].includes(args[0])) fail('INVALID_DEPLOY_COMMAND');
325
+ return args[0];
326
+ });
327
+ const bundle = await log.run('BUNDLE_VALIDATE', () => loadBundle(fileURLToPath(new URL('../', import.meta.url)), { seal: command === 'seal' }));
328
+ if (command !== 'apply') {
329
+ log.emit('BUNDLE_COMPLETE', 'VALID', { changes: bundle.changes.length });
330
+ return;
331
+ }
332
+ if (!bundle.changes.length && !process.env.MIGRATION_DATABASE_URL && !process.env.DEPLOY_SCOPE) {
333
+ log.emit('DATABASE_NOT_REQUIRED', 'SUCCESS', { applied: 0 });
334
+ return;
335
+ }
336
+ await log.run('ENV_VALIDATE', () => {
337
+ if (!process.env.MIGRATION_DATABASE_URL || !process.env.DEPLOY_SCOPE) fail('MISSING_MIGRATION_ENV');
338
+ });
339
+ const { Client } = await log.run('DRIVER_LOAD', () => import('pg'));
340
+ let client, failed = false;
341
+ try {
342
+ await log.run('DATABASE_CONNECT', async () => {
343
+ client = new Client({ connectionString: process.env.MIGRATION_DATABASE_URL, connectionTimeoutMillis });
344
+ log.emit('DATABASE_CONNECTION_CONFIG', 'READY', { connection: connectionSettings(client) });
345
+ await client.connect();
346
+ });
347
+ await applyBundle(bundle, client, process.env.DEPLOY_SCOPE, print);
348
+ } catch (error) {
349
+ failed = true;
350
+ throw error;
351
+ } finally {
352
+ if (client) {
353
+ try { await log.run('DATABASE_CLOSE', () => client.end()); }
354
+ catch (error) { if (!failed) throw error; }
355
+ }
356
+ }
357
+ log.emit('PREPARE_COMPLETE', 'SUCCESS');
358
+ }
359
+
360
+ if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
361
+ main().catch(() => { process.exitCode = 1; });
362
+ }
@@ -0,0 +1,199 @@
1
+ // Editable DEV tool only. Production uses the platform-controlled runtime.
2
+ import dns from 'node:dns/promises';
3
+ import net from 'node:net';
4
+ import tls from 'node:tls';
5
+ import { resolve } from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
7
+
8
+ const budgets = { DNS_LOOKUP: 2000, TCP_CONNECT: 3000, POSTGRES_PROTOCOL: 2000, TLS_HANDSHAKE: 3000 };
9
+ const error = code => Object.assign(new Error(code), { code });
10
+ const output = event => (event.status === 'FAILED' ? console.error : console.log)(JSON.stringify(event));
11
+ const messages = {
12
+ DATABASE_DNS_NOT_FOUND: ['The database host cannot be resolved', 'Check the connection host and DNS in the hosted Pod.'],
13
+ DATABASE_DNS_TEMPORARY_FAILURE: ['Database DNS resolution is temporarily unavailable', 'Check cluster DNS services and the resolution path.'],
14
+ DATABASE_DNS_TIMEOUT: ['Database DNS resolution timed out', 'Check cluster DNS forwarding, the domain name, and network policies.'],
15
+ DATABASE_CONNECTION_REFUSED: ['The database port refused the connection', 'Check the target port, database listener, and access policies.'],
16
+ DATABASE_NETWORK_UNREACHABLE: ['The database network is unreachable', 'Check routes, VPC settings, and network policies from the hosted Pod to the database.'],
17
+ DATABASE_TCP_TIMEOUT: ['The database TCP connection timed out', 'Check security groups, allowlists, routes, and NetworkPolicy.'],
18
+ DATABASE_POSTGRES_PROTOCOL_TIMEOUT: ['TCP connected but PostgreSQL negotiation did not respond', 'Check that the port serves PostgreSQL, proxy forwarding, and database load.'],
19
+ DATABASE_POSTGRES_PROTOCOL_INVALID: ['The target returned an unexpected PostgreSQL protocol response', 'Check the database address, port, and intermediate proxies.'],
20
+ DATABASE_TLS_NOT_SUPPORTED: ['SSL is required but the target does not support it', 'Check the target and server SSL requirements. Do not downgrade automatically.'],
21
+ DATABASE_TLS_FAILED: ['The database TLS handshake or certificate validation failed', 'Check SSL settings, the certificate trust chain, and the hostname.'],
22
+ DATABASE_TLS_TIMEOUT: ['The database TLS handshake timed out', 'Check TLS handshake handling in the database or proxy.'],
23
+ };
24
+ function category(failure, stage) {
25
+ if (Object.hasOwn(messages, failure?.code)) return failure.code;
26
+ if (failure?.code === 'ENOTFOUND') return 'DATABASE_DNS_NOT_FOUND';
27
+ if (failure?.code === 'EAI_AGAIN') return 'DATABASE_DNS_TEMPORARY_FAILURE';
28
+ if (failure?.code === 'ECONNREFUSED') return 'DATABASE_CONNECTION_REFUSED';
29
+ if (['ENETUNREACH', 'EHOSTUNREACH'].includes(failure?.code)) return 'DATABASE_NETWORK_UNREACHABLE';
30
+ return stage === 'TLS_HANDSHAKE' ? 'DATABASE_TLS_FAILED' : `DATABASE_${stage}_FAILED`;
31
+ }
32
+ async function limited(action, milliseconds, code) {
33
+ let timer;
34
+ try {
35
+ return await Promise.race([Promise.resolve().then(action), new Promise((_, reject) => {
36
+ timer = setTimeout(() => reject(error(code)), milliseconds);
37
+ })]);
38
+ } finally { clearTimeout(timer); }
39
+ }
40
+ function connected(address, port, milliseconds) {
41
+ const socket = net.createConnection({ host: address.address, port, family: address.family });
42
+ socket.on('error', () => {});
43
+ return new Promise((resolveSocket, reject) => {
44
+ const timer = setTimeout(() => finish(error('DATABASE_TCP_TIMEOUT')), milliseconds);
45
+ const done = () => finish();
46
+ const failed = failure => finish(failure);
47
+ const closed = () => finish(error('DATABASE_TCP_CONNECT_FAILED'));
48
+ function finish(failure) {
49
+ clearTimeout(timer); socket.off('connect', done); socket.off('error', failed); socket.off('close', closed);
50
+ if (failure) { socket.destroy(); reject(failure); } else resolveSocket(socket);
51
+ }
52
+ socket.once('connect', done); socket.once('error', failed); socket.once('close', closed);
53
+ });
54
+ }
55
+ function postgresResponse(socket) {
56
+ return new Promise((resolveResponse, reject) => {
57
+ const timer = setTimeout(() => finish(error('DATABASE_POSTGRES_PROTOCOL_TIMEOUT')), budgets.POSTGRES_PROTOCOL);
58
+ const data = bytes => {
59
+ if (bytes.length !== 1) finish(error('DATABASE_POSTGRES_PROTOCOL_INVALID'));
60
+ else if (bytes[0] === 83) finish(null, true); // S: PostgreSQL accepts TLS negotiation.
61
+ else if (bytes[0] === 78) finish(null, false); // N: PostgreSQL responds without TLS support.
62
+ else finish(error('DATABASE_POSTGRES_PROTOCOL_INVALID'));
63
+ };
64
+ const failed = failure => finish(failure);
65
+ const ended = () => finish(error('DATABASE_POSTGRES_PROTOCOL_INVALID'));
66
+ function finish(failure, supported) {
67
+ clearTimeout(timer); socket.off('data', data); socket.off('error', failed); socket.off('end', ended); socket.off('close', ended);
68
+ if (failure) reject(failure); else resolveResponse(supported);
69
+ }
70
+ socket.once('data', data); socket.once('error', failed); socket.once('end', ended); socket.once('close', ended);
71
+ // PostgreSQL SSLRequest only. Never send StartupMessage, password, authentication or SQL.
72
+ socket.write(Buffer.from([0, 0, 0, 8, 4, 210, 22, 47]));
73
+ });
74
+ }
75
+ function secure(socket, parameters, host) {
76
+ const options = typeof parameters.ssl === 'object' ? { ...parameters.ssl } : {};
77
+ // pg deliberately makes the client private key non-enumerable. Preserve it as pg does.
78
+ if (typeof parameters.ssl === 'object' && 'key' in parameters.ssl) options.key = parameters.ssl.key;
79
+ // Match pg: verify the original DNS hostname even when probing a resolved IP.
80
+ if (!net.isIP(host)) options.servername = host;
81
+ const secured = tls.connect({ ...options, socket });
82
+ secured.on('error', () => {});
83
+ return new Promise((resolveSecure, reject) => {
84
+ const timer = setTimeout(() => finish(error('DATABASE_TLS_TIMEOUT')), budgets.TLS_HANDSHAKE);
85
+ const ready = () => finish();
86
+ const failed = failure => finish(failure);
87
+ const ended = () => finish(error('DATABASE_TLS_FAILED'));
88
+ function finish(failure) {
89
+ clearTimeout(timer); secured.off('secureConnect', ready); secured.off('error', failed); secured.off('close', ended);
90
+ secured.destroy();
91
+ if (failure) reject(failure); else resolveSecure();
92
+ }
93
+ secured.once('secureConnect', ready); secured.once('error', failed); secured.once('close', ended);
94
+ });
95
+ }
96
+
97
+ export async function diagnoseDatabase(parameters, report = output) {
98
+ const started = Date.now();
99
+ const emit = (stage, status, fields = {}) => report({ event: 'DATABASE_DIAGNOSTIC', time: new Date().toISOString(), stage, status, ...fields });
100
+ const summary = passed => {
101
+ emit('SUMMARY', passed ? 'SUCCEEDED' : 'FAILED', { code: passed ? 'DATABASE_DIAGNOSTIC_PASSED' : 'DATABASE_DIAGNOSTIC_FAILED',
102
+ message: passed ? 'Network and protocol checks passed. Authentication and SQL execution have not been verified.' : 'Connection diagnostics found an issue. Check the preceding failed stage.',
103
+ durationMs: Date.now() - started });
104
+ return passed;
105
+ };
106
+ const host = typeof parameters?.host === 'string' ? parameters.host.replace(/^\[|\]$/g, '') : '';
107
+ if (!/^[A-Za-z0-9.:%_-]{1,253}$/.test(host) || !Number.isInteger(parameters?.port) || parameters.port < 1 || parameters.port > 65535) {
108
+ emit('CONFIG', 'FAILED', { code: 'DATABASE_DIAGNOSTIC_CONFIG_INVALID', message: 'The database diagnostic target is invalid' });
109
+ return summary(false);
110
+ }
111
+ const port = parameters.port;
112
+ let socket;
113
+ const stage = async (name, fields, action) => {
114
+ const begin = Date.now(); emit(name, 'STARTED', fields);
115
+ try {
116
+ const value = await action();
117
+ emit(name, 'SUCCEEDED', { ...fields, ...value.fields, durationMs: Date.now() - begin });
118
+ return value.result;
119
+ } catch (failure) {
120
+ const code = category(failure, name);
121
+ const [message, hint] = messages[code] ?? ['The connection diagnostic step did not complete', 'Review the stage, duration, and subsequent migration connection logs.'];
122
+ emit(name, 'FAILED', { ...fields, code, message, hint, durationMs: Date.now() - begin });
123
+ throw failure;
124
+ }
125
+ };
126
+ try {
127
+ const addresses = await stage('DNS_LOOKUP', { timeoutMillis: budgets.DNS_LOOKUP }, async () => {
128
+ const family = net.isIP(host);
129
+ const all = family ? [{ address: host, family }] : await limited(() => dns.lookup(host, { all: true, verbatim: true }), budgets.DNS_LOOKUP, 'DATABASE_DNS_TIMEOUT');
130
+ const selected = all.filter(item => (item.family === 4 || item.family === 6) && net.isIP(item.address) === item.family).slice(0, 4);
131
+ if (!selected.length) throw error('DATABASE_DNS_NOT_FOUND');
132
+ return { result: selected, fields: { addresses: selected, addressCount: selected.length } };
133
+ });
134
+ const tcpBegin = Date.now();
135
+ let chosen;
136
+ for (let index = 0; index < addresses.length; index++) {
137
+ const remaining = budgets.TCP_CONNECT - (Date.now() - tcpBegin);
138
+ if (remaining <= 0) break;
139
+ const address = addresses[index], timeoutMillis = Math.min(1000, remaining);
140
+ try {
141
+ socket = await stage('TCP_CONNECT', { ...address, addressIndex: index + 1, port, timeoutMillis }, async () => ({ result: await connected(address, port, timeoutMillis), fields: {} }));
142
+ chosen = address; break;
143
+ } catch { /* Probe each bounded DNS result; this does not retry authentication or migrations. */ }
144
+ }
145
+ if (!socket) return summary(false);
146
+ const sslSupported = await stage('POSTGRES_PROTOCOL', { ...chosen, port, timeoutMillis: budgets.POSTGRES_PROTOCOL }, async () => {
147
+ const supported = await postgresResponse(socket);
148
+ return { result: supported, fields: { sslSupported: supported } };
149
+ });
150
+ if (!parameters.ssl) {
151
+ emit('TLS_HANDSHAKE', 'SKIPPED', { code: 'DATABASE_TLS_DISABLED', sslEnabled: false, message: 'SSL is disabled for the runtime connection. No authentication data was sent.' });
152
+ } else {
153
+ await stage('TLS_HANDSHAKE', { ...chosen, port, timeoutMillis: budgets.TLS_HANDSHAKE, sslEnabled: true,
154
+ rejectUnauthorized: parameters.ssl.rejectUnauthorized !== false }, async () => {
155
+ if (!sslSupported) throw error('DATABASE_TLS_NOT_SUPPORTED');
156
+ await secure(socket, parameters, host);
157
+ return { fields: {} };
158
+ });
159
+ }
160
+ return summary(true);
161
+ } catch { return summary(false); }
162
+ finally { socket?.destroy(); }
163
+ }
164
+
165
+ export async function main() {
166
+ // The parent startup entry aliases the business connection before invoking this script.
167
+ const connectionString = process.env.MIGRATION_DATABASE_URL || process.env.DATABASE_URL;
168
+ if (!connectionString) {
169
+ output({ event: 'DATABASE_DIAGNOSTIC', time: new Date().toISOString(), stage: 'CONFIG', status: 'SKIPPED', code: 'DATABASE_NOT_CONFIGURED' });
170
+ return;
171
+ }
172
+ try {
173
+ const uri = new URL(connectionString);
174
+ if (!['postgres:', 'postgresql:'].includes(uri.protocol)) throw error('DATABASE_DIAGNOSTIC_CONFIG_INVALID');
175
+ const { Client } = await import('pg');
176
+ const client = new Client({ connectionString, connectionTimeoutMillis: 10000 });
177
+ const p = client.connectionParameters;
178
+ output({ event: 'SQL_DEPLOY', time: new Date().toISOString(), stage: 'DATABASE_CONNECTION_CONFIG', status: 'READY', connection: {
179
+ host: p.host, port: p.port, database: p.database, user: p.user,
180
+ ssl: p.ssl ? { enabled: true, rejectUnauthorized: p.ssl.rejectUnauthorized !== false } : { enabled: false }, connectionTimeoutMillis: 10000,
181
+ } });
182
+ await diagnoseDatabase(p);
183
+ } catch {
184
+ output({ event: 'DATABASE_DIAGNOSTIC', time: new Date().toISOString(), stage: 'CONFIG', status: 'FAILED', code: 'DATABASE_DIAGNOSTIC_CONFIG_INVALID', message: 'Diagnostic configuration or database driver loading failed. The startup flow will report the result.' });
185
+ }
186
+ }
187
+
188
+ if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
189
+ const watchdog = setTimeout(() => {
190
+ output({ event: 'DATABASE_DIAGNOSTIC', time: new Date().toISOString(), stage: 'SUMMARY', status: 'FAILED', code: 'DATABASE_DIAGNOSTIC_BUDGET_EXCEEDED', timeoutMillis: 10000 });
191
+ process.exit(0);
192
+ }, 10000);
193
+ main().finally(async () => {
194
+ await Promise.all([new Promise(done => process.stdout.write('', done)), new Promise(done => process.stderr.write('', done))]);
195
+ clearTimeout(watchdog);
196
+ // End even if an OS DNS lookup continues after its deadline. The diagnostic never gates migration.
197
+ process.exit(0);
198
+ });
199
+ }
@@ -0,0 +1,30 @@
1
+ #!/bin/sh
2
+ # Editable local DEV/reference-image entry; production uses the platform-controlled runtime.
3
+ set -eu
4
+
5
+ # Runtime-only entry: use the same injected connection as the business service.
6
+ # Do not inherit an alternate migration identity from the environment.
7
+ export MIGRATION_DATABASE_URL="${DATABASE_URL:-}"
8
+ SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
9
+ # Diagnostic is bounded and informational. Migration remains the authoritative startup gate.
10
+ if node "$SCRIPT_DIR/../migration/scripts/dev-diagnose-database.mjs"; then
11
+ :
12
+ else
13
+ printf '%s\n' '{"event":"BACKEND_STARTUP","stage":"DATABASE_DIAGNOSTIC","status":"FAILED","code":"DATABASE_DIAGNOSTIC_RUN_FAILED","message":"Automatic diagnostics did not complete. Continuing the startup flow."}' >&2
14
+ fi
15
+ printf '%s\n' '{"event":"BACKEND_STARTUP","stage":"MIGRATION_PREPARE","status":"STARTED"}'
16
+ if node "$SCRIPT_DIR/../migration/scripts/dev-deploy-prepare.mjs" apply; then
17
+ printf '%s\n' '{"event":"BACKEND_STARTUP","stage":"MIGRATION_PREPARE","status":"SUCCEEDED"}'
18
+ else
19
+ exit_code=$?
20
+ printf '{"event":"BACKEND_STARTUP","stage":"MIGRATION_PREPARE","status":"FAILED","code":"DEPLOY_PREPARE_FAILED","message":"Database deployment preparation failed. Check the preceding stage errors.","exitCode":%s}\n' "$exit_code" >&2
21
+ exit "$exit_code"
22
+ fi
23
+ if [ "$#" -eq 0 ]; then
24
+ printf '%s\n' '{"event":"BACKEND_STARTUP","stage":"SERVICE_START","status":"FAILED","code":"SERVICE_COMMAND_MISSING","message":"The image has no service startup command"}' >&2
25
+ exit 64
26
+ fi
27
+ printf '%s\n' '{"event":"BACKEND_STARTUP","stage":"SERVICE_START","status":"STARTING"}'
28
+
29
+ # Replace the shell so the service receives container signals and owns the exit code.
30
+ exec "$@"
@@ -0,0 +1,11 @@
1
+ // All paths are authenticated by proxy.ts before this fallback is dispatched.
2
+ import { apiNotFound } from '@/lib/api-response.mjs';
3
+ export {
4
+ apiNotFound as GET,
5
+ apiNotFound as POST,
6
+ apiNotFound as PUT,
7
+ apiNotFound as PATCH,
8
+ apiNotFound as DELETE,
9
+ apiNotFound as HEAD,
10
+ apiNotFound as OPTIONS,
11
+ };
@@ -0,0 +1,11 @@
1
+ // All paths are authenticated by proxy.ts before this fallback is dispatched.
2
+ import { apiNotFound } from '@/lib/api-response.mjs';
3
+ export {
4
+ apiNotFound as GET,
5
+ apiNotFound as POST,
6
+ apiNotFound as PUT,
7
+ apiNotFound as PATCH,
8
+ apiNotFound as DELETE,
9
+ apiNotFound as HEAD,
10
+ apiNotFound as OPTIONS,
11
+ };