@tuya-sat/microapp-kit 0.0.0-stage → 0.1.26-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (819) hide show
  1. package/AUDIT.md +43 -0
  2. package/CHANGELOG.md +45 -0
  3. package/MAINTAINING.md +143 -0
  4. package/README.md +53 -2
  5. package/START-HERE.md +40 -0
  6. package/bootstrap/build-install-page.mjs +44 -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 +64 -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 +110 -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 +41 -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 +98 -0
  246. package/runtime/tests/package-cache.test.mjs +108 -0
  247. package/runtime/tests/package-migration.test.mjs +208 -0
  248. package/runtime/tests/preview-hosts.test.mjs +66 -0
  249. package/runtime/tests/preview.test.mjs +304 -0
  250. package/runtime/tests/project-identity.test.mjs +67 -0
  251. package/runtime/tests/publication.test.mjs +436 -0
  252. package/runtime/tests/release-recovery.test.mjs +417 -0
  253. package/runtime/tests/repository-source.test.mjs +38 -0
  254. package/runtime/tests/skill-set-update.test.mjs +169 -0
  255. package/runtime/tests/standalone.test.mjs +46 -0
  256. package/runtime/tests/update-check.test.mjs +165 -0
  257. package/runtime/tests/update.test.mjs +292 -0
  258. package/runtime/tests/workspace.test.mjs +156 -0
  259. package/runtime/update-check.mjs +160 -0
  260. package/runtime/update-state.mjs +83 -0
  261. package/runtime/update.mjs +292 -0
  262. package/runtime/workspace-migration.mjs +109 -0
  263. package/runtime/workspace.mjs +101 -0
  264. package/schemas/toolchain.schema.json +13 -0
  265. package/setup.mjs +3 -0
  266. package/skills/micro-app-backend-development/SKILL.md +64 -0
  267. package/skills/micro-app-backend-development/references/backend-security-workflow.md +77 -0
  268. package/skills/micro-app-backend-development/references/business-build-helpers.md +11 -0
  269. package/skills/micro-app-backend-development/references/business-logging.md +56 -0
  270. package/skills/micro-app-backend-development/references/database-constraints.md +81 -0
  271. package/skills/micro-app-backend-development/references/database-write-errors.md +29 -0
  272. package/skills/micro-app-backend-development/references/deployment-bundle.md +65 -0
  273. package/skills/micro-app-backend-development/references/dev-preview-context.md +23 -0
  274. package/skills/micro-app-backend-development/references/gateway-verification.md +43 -0
  275. package/skills/micro-app-backend-development/references/implementation.md +49 -0
  276. package/skills/micro-app-backend-development/references/local-database-preview.md +100 -0
  277. package/skills/micro-app-backend-development/references/production-authorization-readiness.md +60 -0
  278. package/skills/micro-app-backend-development/references/project-data-permissions.md +43 -0
  279. package/skills/micro-app-backend-development/references/runtime-resources-and-deployment.md +76 -0
  280. package/skills/micro-app-backend-development/scripts/microapp-kit.mjs +117 -0
  281. package/skills/micro-app-backend-development/tests/behavior-scenarios.md +62 -0
  282. package/skills/micro-app-cloud-integration/SKILL.md +92 -0
  283. package/skills/micro-app-cloud-integration/references/api-catalog.json +1315 -0
  284. package/skills/micro-app-cloud-integration/references/api-catalog.md +59 -0
  285. package/skills/micro-app-cloud-integration/references/api-device-control.md +67 -0
  286. package/skills/micro-app-cloud-integration/references/api-device.md +179 -0
  287. package/skills/micro-app-cloud-integration/references/api-group-ota.md +145 -0
  288. package/skills/micro-app-cloud-integration/references/api-linkage.md +3 -0
  289. package/skills/micro-app-cloud-integration/references/api-models.md +584 -0
  290. package/skills/micro-app-cloud-integration/references/api-project.md +121 -0
  291. package/skills/micro-app-cloud-integration/references/api-space-home.md +244 -0
  292. package/skills/micro-app-cloud-integration/references/backend-authorization.md +95 -0
  293. package/skills/micro-app-cloud-integration/references/calling-conventions.md +118 -0
  294. package/skills/micro-app-cloud-integration/references/preview-agent-open.md +46 -0
  295. package/skills/micro-app-cloud-integration/references/server-to-server-integration.md +13 -0
  296. package/skills/micro-app-cloud-integration/scripts/microapp-kit.mjs +117 -0
  297. package/skills/micro-app-cloud-integration/tests/behavior-scenarios.md +20 -0
  298. package/skills/micro-app-design/SKILL.md +99 -0
  299. package/skills/micro-app-design/agents/openai.yaml +6 -0
  300. package/skills/micro-app-design/assets/tuya-design-system/assets/README.md +22 -0
  301. package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaCapsuleSearch.html +67 -0
  302. package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaCardGrid.html +71 -0
  303. package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaIcon.html +5 -0
  304. package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaPageTitle.html +29 -0
  305. package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaTopNavigation.html +55 -0
  306. package/skills/micro-app-design/assets/tuya-design-system/assets/components.schema.md +154 -0
  307. package/skills/micro-app-design/assets/tuya-design-system/assets/examples/dashboard.html +588 -0
  308. package/skills/micro-app-design/assets/tuya-design-system/assets/examples/dashboard.md +99 -0
  309. package/skills/micro-app-design/assets/tuya-design-system/assets/examples/table-page.html +477 -0
  310. package/skills/micro-app-design/assets/tuya-design-system/assets/examples/table-page.md +77 -0
  311. package/skills/micro-app-design/assets/tuya-design-system/assets/templates/base.html +878 -0
  312. package/skills/micro-app-design/assets/tuya-design-system/latest/accessibility/accessibility.md +39 -0
  313. package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/TuyaCapsuleSearch.html +67 -0
  314. package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/arrow-down.svg +3 -0
  315. package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/calendar.svg +5 -0
  316. package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/check.svg +3 -0
  317. package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/checkbox-check.svg +3 -0
  318. package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/clear.svg +4 -0
  319. package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/search.svg +4 -0
  320. package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/preview.html +3705 -0
  321. package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/spec.md +78 -0
  322. package/skills/micro-app-design/assets/tuya-design-system/latest/components/card-grid/examples/TuyaCardGrid.html +71 -0
  323. package/skills/micro-app-design/assets/tuya-design-system/latest/components/card-grid/examples/assets/placeholder.svg +4 -0
  324. package/skills/micro-app-design/assets/tuya-design-system/latest/components/card-grid/examples/preview.html +711 -0
  325. package/skills/micro-app-design/assets/tuya-design-system/latest/components/card-grid/spec.md +93 -0
  326. package/skills/micro-app-design/assets/tuya-design-system/latest/components/cascader/spec.md +75 -0
  327. package/skills/micro-app-design/assets/tuya-design-system/latest/components/checkbox/spec.md +72 -0
  328. package/skills/micro-app-design/assets/tuya-design-system/latest/components/date-picker/spec.md +81 -0
  329. package/skills/micro-app-design/assets/tuya-design-system/latest/components/dropdown/spec.md +99 -0
  330. package/skills/micro-app-design/assets/tuya-design-system/latest/components/icon/examples/TuyaIcon.html +5 -0
  331. package/skills/micro-app-design/assets/tuya-design-system/latest/components/icon/spec.md +55 -0
  332. package/skills/micro-app-design/assets/tuya-design-system/latest/components/input/spec.md +84 -0
  333. package/skills/micro-app-design/assets/tuya-design-system/latest/components/modal/spec.md +178 -0
  334. package/skills/micro-app-design/assets/tuya-design-system/latest/components/page-title/examples/TuyaPageTitle.html +29 -0
  335. package/skills/micro-app-design/assets/tuya-design-system/latest/components/page-title/spec.md +67 -0
  336. package/skills/micro-app-design/assets/tuya-design-system/latest/components/pagination/spec.md +94 -0
  337. package/skills/micro-app-design/assets/tuya-design-system/latest/components/radio/spec.md +80 -0
  338. package/skills/micro-app-design/assets/tuya-design-system/latest/components/search-input/spec.md +101 -0
  339. package/skills/micro-app-design/assets/tuya-design-system/latest/components/select/spec.md +96 -0
  340. package/skills/micro-app-design/assets/tuya-design-system/latest/components/slider/spec.md +66 -0
  341. package/skills/micro-app-design/assets/tuya-design-system/latest/components/switch/spec.md +86 -0
  342. package/skills/micro-app-design/assets/tuya-design-system/latest/components/table/spec.md +116 -0
  343. package/skills/micro-app-design/assets/tuya-design-system/latest/components/time-picker/spec.md +75 -0
  344. package/skills/micro-app-design/assets/tuya-design-system/latest/components/tooltip/spec.md +70 -0
  345. package/skills/micro-app-design/assets/tuya-design-system/latest/components/top-navigation/examples/TuyaTopNavigation.html +55 -0
  346. package/skills/micro-app-design/assets/tuya-design-system/latest/components/top-navigation/spec.md +60 -0
  347. package/skills/micro-app-design/assets/tuya-design-system/latest/components/tree/examples/icons/check.svg +3 -0
  348. package/skills/micro-app-design/assets/tuya-design-system/latest/components/tree/examples/preview.html +974 -0
  349. package/skills/micro-app-design/assets/tuya-design-system/latest/components/tree/spec.md +118 -0
  350. package/skills/micro-app-design/assets/tuya-design-system/latest/components/upload/spec.md +86 -0
  351. package/skills/micro-app-design/assets/tuya-design-system/latest/demo-index.md +43 -0
  352. package/skills/micro-app-design/assets/tuya-design-system/latest/design-system.md +116 -0
  353. package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/color.md +165 -0
  354. package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/elevation.md +21 -0
  355. package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/icon.md +78 -0
  356. package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/layout.md +103 -0
  357. package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/radius.md +22 -0
  358. package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/spacing.md +29 -0
  359. package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/typography.md +43 -0
  360. package/skills/micro-app-design/assets/tuya-design-system/latest/interaction/behavior.md +30 -0
  361. package/skills/micro-app-design/assets/tuya-design-system/latest/interaction/feedback.md +23 -0
  362. package/skills/micro-app-design/assets/tuya-design-system/latest/interaction/state.md +28 -0
  363. package/skills/micro-app-design/assets/tuya-design-system/latest/motion/motion.md +31 -0
  364. package/skills/micro-app-design/assets/tuya-design-system/latest/patterns/dashboard.md +34 -0
  365. package/skills/micro-app-design/assets/tuya-design-system/latest/patterns/data-page.md +30 -0
  366. package/skills/micro-app-design/assets/tuya-design-system/latest/patterns/form-page.md +36 -0
  367. package/skills/micro-app-design/assets/tuya-design-system/latest/patterns/monitoring.md +25 -0
  368. package/skills/micro-app-design/assets/tuya-design-system/latest/quality-checklist.md +71 -0
  369. package/skills/micro-app-design/assets/tuya-design-system/latest/registry.yaml +232 -0
  370. package/skills/micro-app-design/assets/tuya-design-system/latest/tokens.yaml +187 -0
  371. package/skills/micro-app-design/assets/tuya-design-system/resources/README.md +26 -0
  372. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states/README.md +13 -0
  373. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277/403.html +58 -0
  374. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277/404.html +58 -0
  375. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277/500.html +58 -0
  376. 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
  377. 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
  378. 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
  379. 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
  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/346/225/260/346/215/256.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/266/210/346/201/257.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/347/275/221/347/273/234.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/350/256/276/345/244/207.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/351/241/271/347/233/256.html +58 -0
  385. package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203.md +159 -0
  386. 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
  387. 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
  388. 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
  389. 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
  390. 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
  391. 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
  392. 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
  393. 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
  394. 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
  395. 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
  396. 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
  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/346/225/260/346/215/256.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/266/210/346/201/257.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/347/275/221/347/273/234.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/350/256/276/345/244/207.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/351/241/271/347/233/256.html +31 -0
  402. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/README.md +23 -0
  403. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/arrow-down.svg +3 -0
  404. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/calendar.svg +5 -0
  405. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/check.svg +3 -0
  406. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/clear.svg +4 -0
  407. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/search.svg +4 -0
  408. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/sources/arrow-down-ref.png +0 -0
  409. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/sources/check-ref.png +0 -0
  410. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/sources/clear-ref.png +0 -0
  411. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/sources/search-ref.png +0 -0
  412. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/Excel.svg +1 -0
  413. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/HD.svg +1 -0
  414. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/PM.svg +1 -0
  415. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/PPT.svg +1 -0
  416. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/README.md +14 -0
  417. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/VOC.svg +1 -0
  418. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/app/347/256/241/347/220/206.svg +1 -0
  419. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/catalog.md +377 -0
  420. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/folder-closed.svg +3 -0
  421. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/license/347/256/241/347/220/206.svg +1 -0
  422. 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
  423. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/sos-2.svg +1 -0
  424. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/sos.svg +1 -0
  425. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/word.svg +1 -0
  426. 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
  427. 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
  428. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/270/212/344/274/240.svg +1 -0
  429. 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
  430. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/221.svg +1 -0
  431. 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
  432. 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
  433. 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
  434. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/272/345/203/217@2x.svg +1 -0
  435. 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
  436. 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
  437. 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
  438. 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
  439. 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
  440. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/274/232/345/221/230@2x.svg +1 -0
  441. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/201/234/350/275/246@2x.svg +1 -0
  442. 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
  443. 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
  444. 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
  445. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/206/260/347/256/261.svg +1 -0
  446. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/206/267/346/260/264.svg +1 -0
  447. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/210/267/346/274/206.svg +1 -0
  448. 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
  449. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/214/226/345/220/210/347/211/251.svg +1 -0
  450. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/214/226/345/255/246-2.svg +1 -0
  451. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/214/226/345/255/246.svg +1 -0
  452. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/215/240/346/257/224/345/233/276.svg +1 -0
  453. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/215/267/345/256/227.svg +1 -0
  454. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/215/267/345/260/272.svg +1 -0
  455. 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
  456. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/217/221/345/215/241@2x.svg +1 -0
  457. 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
  458. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/220/212/347/201/257.svg +1 -0
  459. 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
  460. 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
  461. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/221/274/345/220/270/347/216/207.svg +1 -0
  462. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/225/206/345/272/227@2x.svg +1 -0
  463. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/226/234/346/254/242@2x.svg +1 -0
  464. 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
  465. 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
  466. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/234/260/345/233/276@2x.svg +1 -0
  467. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/234/260/351/223/201@2x.svg +1 -0
  468. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/237/272/345/233/240 DNA.svg" +1 -0
  469. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/237/272/345/233/240.svg +1 -0
  470. 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
  471. 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
  472. 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
  473. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/244/247/350/204/221.svg +1 -0
  474. 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
  475. 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
  476. 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
  477. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/260/272/345/255/220.svg +1 -0
  478. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/260/272/345/257/270.svg +1 -0
  479. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/267/264/345/243/253@2x.svg +1 -0
  480. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/270/203/345/261/200.svg +1 -0
  481. 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
  482. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/272/212 /347/235/241/347/234/240.svg" +1 -0
  483. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/272/212.svg +1 -0
  484. 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
  485. 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
  486. 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
  487. 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
  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 js /344/273/243/347/240/201@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 /344/273/243/347/240/201@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 /347/275/221/351/241/265 /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/351/227/250-2.svg +1 -0
  492. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/274/200/351/227/250.svg +1 -0
  493. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/275/225/345/203/217.svg +1 -0
  494. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/276/252/347/216/257.svg +1 -0
  495. 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
  496. 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
  497. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/277/203/347/216/207.svg +1 -0
  498. 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
  499. 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
  500. 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
  501. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/200/245/346/225/221.svg +1 -0
  502. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/210/277/351/227/264@2x.png +0 -0
  503. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/211/213/346/234/272.svg +1 -0
  504. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/211/213/350/241/250.svg +1 -0
  505. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/211/223/345/215/260/346/234/272.svg +1 -0
  506. 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
  507. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/212/230/347/272/277/345/233/276.svg +1 -0
  508. 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
  509. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/212/245/350/255/246.svg +1 -0
  510. 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
  511. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/213/215/347/205/247.svg +1 -0
  512. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/214/207/347/272/271@2x.svg +1 -0
  513. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/216/210/346/235/203.svg +1 -0
  514. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/221/204/345/203/217/345/244/264.svg +1 -0
  515. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/224/257/344/273/230@2x.svg +1 -0
  516. 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
  517. 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
  518. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/243/347/202/271/345/233/276.svg +1 -0
  519. 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
  520. 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
  521. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/260/346/215/256.svg +1 -0
  522. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/260/346/215/256/346/272/220.svg +1 -0
  523. 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
  524. 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
  525. 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
  526. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/345/255/227.svg +1 -0
  527. 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
  528. 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
  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 bmp.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 csv.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 doc.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 gif.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 jpeg.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 jpg.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 json.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 md.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 mp3.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 mp4.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 pdf.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 png.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 ppt.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 psd.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 svg.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 txt.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 wav.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 xls.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 zip.svg" +1 -0
  548. 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
  549. 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
  550. 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
  551. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/227/240/344/272/272/346/234/272.svg +1 -0
  552. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/227/245/346/234/237@2x-2.svg +1 -0
  553. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/227/245/346/234/237@2x.svg +1 -0
  554. 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
  555. 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
  556. 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
  557. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/233/262/347/272/277/345/233/276.svg +1 -0
  558. 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
  559. 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
  560. 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
  561. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/234/215/345/212/241/345/231/250.svg +1 -0
  562. 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
  563. 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
  564. 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
  565. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/237/261/347/212/266/345/233/276.svg +1 -0
  566. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/240/207/346/270/205.svg +1 -0
  567. 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
  568. 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
  569. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/240/221/346/234/250.svg +1 -0
  570. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/240/241/350/275/246@2x.svg +1 -0
  571. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/242/257/346/216/247.svg +1 -0
  572. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/250/241/346/235/277.svg +1 -0
  573. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/224/346/263/241/345/233/276.svg +1 -0
  574. 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
  575. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/346/265/270.svg +1 -0
  576. 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
  577. 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
  578. 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
  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.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_/345/211/257/346/234/254.svg +1 -0
  581. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/350/255/246.svg +1 -0
  582. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/261/202/346/225/221.svg +1 -0
  583. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/261/241/346/237/223.svg +1 -0
  584. 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
  585. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/262/231/345/217/221.svg +1 -0
  586. 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
  587. 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
  588. 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
  589. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/266/210/346/201/257@2x-2.svg +1 -0
  590. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/266/210/346/201/257@2x-3.svg +1 -0
  591. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/266/210/346/201/257@2x.svg +1 -0
  592. 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
  593. 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
  594. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/270/251/345/272/246-2.svg +1 -0
  595. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/270/251/345/272/246.svg +1 -0
  596. 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
  597. 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
  598. 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
  599. 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
  600. 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
  601. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253.svg +1 -0
  602. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253/347/201/276.svg +1 -0
  603. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253/350/255/246.svg +1 -0
  604. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253/350/275/246@2x-2.svg +1 -0
  605. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253/350/275/246@2x.svg +1 -0
  606. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/255/347/201/253/345/231/250.svg +1 -0
  607. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/257.svg +1 -0
  608. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/203/237/351/233/276-2.svg +1 -0
  609. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/203/237/351/233/276.svg +1 -0
  610. 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
  611. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/203/255/346/260/264.svg +1 -0
  612. 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
  613. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/205/247/345/272/246.svg +1 -0
  614. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/207/203/346/260/224.svg +1 -0
  615. 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
  616. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/212/266/346/200/201.svg +1 -0
  617. 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
  618. 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
  619. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/216/257/345/242/203.svg +1 -0
  620. 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
  621. 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
  622. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/216/257/345/275/242/345/233/276.svg +1 -0
  623. 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
  624. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/262/351/206/233.svg +1 -0
  625. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265.svg +1 -0
  626. 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
  627. 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
  628. 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
  629. 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
  630. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/350/264/271.svg +1 -0
  631. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/351/222/273.svg +1 -0
  632. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/351/243/216/346/211/207.svg +1 -0
  633. 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
  634. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/273/346/235/277.svg +1 -0
  635. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/233/221/346/265/213.svg +1 -0
  636. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/233/270/346/234/272.svg +1 -0
  637. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/235/241/347/234/240.svg +1 -0
  638. 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
  639. 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
  640. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/246/273/347/272/277.svg +1 -0
  641. 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
  642. 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
  643. 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
  644. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/251/272/350/260/203.svg +1 -0
  645. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/251/272/351/227/264@2x.png +0 -0
  646. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/252/227/345/270/230.svg +1 -0
  647. 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
  648. 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
  649. 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
  650. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/255/211/345/276/205@2x.svg +1 -0
  651. 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
  652. 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
  653. 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
  654. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/274/226/350/276/221@2x.png +0 -0
  655. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/275/221/351/241/265.svg +1 -0
  656. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/276/216/345/205/203@2x.svg +1 -0
  657. 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
  658. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/200/263/346/234/272-2.svg +1 -0
  659. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/200/263/346/234/272-3.svg +1 -0
  660. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/200/263/346/234/272.svg +1 -0
  661. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/203/275/345/212/233.svg +1 -0
  662. 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
  663. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/212/202/350/203/275.svg +1 -0
  664. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/212/257/347/211/207.svg +1 -0
  665. 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
  666. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/241/200/346/260/247.svg +1 -0
  667. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/247/204/350/214/203.md +264 -0
  668. 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
  669. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/247/206/351/242/221.svg +1 -0
  670. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/247/206/351/242/221AI.svg +1 -0
  671. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/247/206/351/242/221SD.svg +1 -0
  672. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/242/345/215/225.svg +1 -0
  673. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207-2.svg +1 -0
  674. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207-3.svg +1 -0
  675. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207-4.svg +1 -0
  676. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207-5.svg +1 -0
  677. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207.svg +1 -0
  678. 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
  679. 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
  680. 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
  681. 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
  682. 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
  683. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/347/275/256@2x.svg +1 -0
  684. 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
  685. 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
  686. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/264/246/345/217/267@2x.svg +1 -0
  687. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/264/247/350/275/246@2x.svg +1 -0
  688. 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
  689. 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
  690. 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
  691. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/267/257/351/232/234.svg +1 -0
  692. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/267/257/351/232/234lu zhang-2.svg" +1 -0
  693. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/267/257/351/232/234lu zhang.svg" +1 -0
  694. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/246/350/241/214@2x.svg +1 -0
  695. 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
  696. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/256/346/244/205-2.svg +1 -0
  697. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/256/346/244/205.svg +1 -0
  698. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/256/346/270/241@2x.svg +1 -0
  699. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/277/350/275/246@2x-2.svg +1 -0
  700. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/277/350/275/246@2x.svg +1 -0
  701. 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
  702. 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
  703. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/277/233/345/272/246/346/235/241.svg +1 -0
  704. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/200/232/346/226/255/345/231/250.svg +1 -0
  705. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/201/245/346/216/247.svg +1 -0
  706. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/223/201/351/224/271.svg +1 -0
  707. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/224/201.svg +1 -0
  708. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/224/256/347/233/230.svg +1 -0
  709. 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
  710. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/227/250/351/224/201.svg +1 -0
  711. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/227/256/345/217/267@2x.svg +1 -0
  712. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/230/266/346/242/257@2x.svg +1 -0
  713. 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
  714. 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
  715. 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
  716. 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
  717. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/237/263/345/223/215.svg +1 -0
  718. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/241/271/347/233/256.svg +1 -0
  719. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/243/236/346/234/272@2x-2.svg +1 -0
  720. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/243/236/346/234/272@2x.svg +1 -0
  721. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/251/254/346/241/266.svg +1 -0
  722. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/253/230/345/210/206/345/255/220.svg +1 -0
  723. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/253/230/346/270/205.svg +1 -0
  724. package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/274/240/346/240/207.svg +1 -0
  725. package/skills/micro-app-design/assets/tuya-design-system/source.json +18 -0
  726. package/skills/micro-app-design/references/action-outcomes.md +7 -0
  727. package/skills/micro-app-design/references/adaptive-card-grid.md +25 -0
  728. package/skills/micro-app-design/references/capsule-fallback.md +36 -0
  729. package/skills/micro-app-design/references/component-boundaries.md +48 -0
  730. package/skills/micro-app-design/references/component-catalog.md +69 -0
  731. package/skills/micro-app-design/references/design-system.md +34 -0
  732. package/skills/micro-app-design/references/empty-and-error-states.md +27 -0
  733. package/skills/micro-app-design/references/icons.md +33 -0
  734. package/skills/micro-app-design/references/implementation-guidance.md +39 -0
  735. package/skills/micro-app-design/references/modal.md +27 -0
  736. package/skills/micro-app-design/references/page-patterns.md +55 -0
  737. package/skills/micro-app-design/references/quality-checklist.md +57 -0
  738. package/skills/micro-app-design/references/requirements-and-permission-states.md +19 -0
  739. package/skills/micro-app-design/references/source-and-scope.md +40 -0
  740. package/skills/micro-app-design/references/tokens.md +23 -0
  741. package/skills/micro-app-design/references/visual-acceptance.md +51 -0
  742. package/skills/micro-app-design/scripts/microapp-kit.mjs +117 -0
  743. package/skills/micro-app-design/scripts/visual-audit.mjs +197 -0
  744. package/skills/micro-app-design/tests/behavior-scenarios.md +154 -0
  745. package/skills/micro-app-design/tests/validate-design-skill.mjs +35 -0
  746. package/skills/micro-app-design/tests/validate-design-system.mjs +51 -0
  747. package/skills/micro-app-development/SKILL.md +132 -0
  748. package/skills/micro-app-development/agents/openai.yaml +6 -0
  749. package/skills/micro-app-development/references/agent-workflow.md +111 -0
  750. package/skills/micro-app-development/references/application-icons.md +50 -0
  751. package/skills/micro-app-development/references/data-change-safety.md +47 -0
  752. package/skills/micro-app-development/references/delivery-checklist.md +129 -0
  753. package/skills/micro-app-development/references/design-workflow.md +77 -0
  754. package/skills/micro-app-development/references/developer-credentials.md +97 -0
  755. package/skills/micro-app-development/references/development-guide.md +213 -0
  756. package/skills/micro-app-development/references/environment-progress.md +47 -0
  757. package/skills/micro-app-development/references/joint-acceptance.md +105 -0
  758. package/skills/micro-app-development/references/local-development.md +40 -0
  759. package/skills/micro-app-development/references/manifest-v1.2.md +129 -0
  760. package/skills/micro-app-development/references/npm-registry.md +48 -0
  761. package/skills/micro-app-development/references/platform-operations.md +48 -0
  762. package/skills/micro-app-development/references/project-workflow.md +36 -0
  763. package/skills/micro-app-development/references/publication-intent.md +34 -0
  764. package/skills/micro-app-development/references/publication-recovery.md +67 -0
  765. package/skills/micro-app-development/references/requirement-intake.md +122 -0
  766. package/skills/micro-app-development/references/runtime-requirements.md +23 -0
  767. package/skills/micro-app-development/references/space-permission-boundaries.md +46 -0
  768. package/skills/micro-app-development/references/tool-update.md +60 -0
  769. package/skills/micro-app-development/references/toolchain-access.md +33 -0
  770. package/skills/micro-app-development/references/user-journey.md +65 -0
  771. package/skills/micro-app-development/references/workspace-environments.md +39 -0
  772. package/skills/micro-app-development/scripts/application-icon.mjs +108 -0
  773. package/skills/micro-app-development/scripts/install-app-icon.mjs +48 -0
  774. package/skills/micro-app-development/scripts/install-menu-icon.mjs +27 -0
  775. package/skills/micro-app-development/scripts/language-policy.mjs +83 -0
  776. package/skills/micro-app-development/scripts/languages.json +372 -0
  777. package/skills/micro-app-development/scripts/locale-keys.mjs +26 -0
  778. package/skills/micro-app-development/scripts/microapp-kit.mjs +117 -0
  779. package/skills/micro-app-development/scripts/project-code.mjs +13 -0
  780. package/skills/micro-app-development/scripts/review-backend-logging.mjs +27 -0
  781. package/skills/micro-app-development/scripts/review-production-authorization.mjs +37 -0
  782. package/skills/micro-app-development/scripts/validate-micro-app-project.mjs +442 -0
  783. package/skills/micro-app-development/tests/application-icons.test.mjs +131 -0
  784. package/skills/micro-app-development/tests/backend-logging-review.test.mjs +24 -0
  785. package/skills/micro-app-development/tests/behavior-scenarios.md +177 -0
  786. package/skills/micro-app-development/tests/data-change-safety-scenarios.md +25 -0
  787. package/skills/micro-app-development/tests/design-workflow-scenarios.md +40 -0
  788. package/skills/micro-app-development/tests/fixtures/valid-v6/_locales/en.json +6 -0
  789. package/skills/micro-app-development/tests/fixtures/valid-v6/_locales/zh-CN.json +6 -0
  790. package/skills/micro-app-development/tests/fixtures/valid-v6/manifest.json +59 -0
  791. package/skills/micro-app-development/tests/fixtures/valid-v6/micro.config.js +5 -0
  792. package/skills/micro-app-development/tests/fixtures/valid-v6/mock/index.json +11 -0
  793. package/skills/micro-app-development/tests/fixtures/valid-v6/package.json +4 -0
  794. package/skills/micro-app-development/tests/fixtures/valid-v6/src/index.tsx +5 -0
  795. package/skills/micro-app-development/tests/fixtures/valid-v6/src/lang/en.ts +1 -0
  796. package/skills/micro-app-development/tests/fixtures/valid-v6/src/lang/zh.ts +1 -0
  797. package/skills/micro-app-development/tests/fixtures/valid-v6/src/public-path.js +3 -0
  798. package/skills/micro-app-development/tests/production-authorization-review.test.mjs +72 -0
  799. package/skills/micro-app-development/tests/six-skill-routing-scenarios.md +60 -0
  800. package/skills/micro-app-development/tests/user-journey-scenarios.md +19 -0
  801. package/skills/micro-app-development/tests/validate-micro-app-project.test.mjs +428 -0
  802. package/skills/micro-app-frontend-development/SKILL.md +86 -0
  803. package/skills/micro-app-frontend-development/agents/openai.yaml +6 -0
  804. package/skills/micro-app-frontend-development/references/api-and-permissions.md +86 -0
  805. package/skills/micro-app-frontend-development/references/custom-api-requests.md +52 -0
  806. package/skills/micro-app-frontend-development/references/debugging.md +36 -0
  807. package/skills/micro-app-frontend-development/references/i18n-and-theme.md +54 -0
  808. package/skills/micro-app-frontend-development/references/interaction-completion.md +61 -0
  809. package/skills/micro-app-frontend-development/references/micro-frontend-runtime.md +33 -0
  810. package/skills/micro-app-frontend-development/references/routing-and-context.md +96 -0
  811. package/skills/micro-app-frontend-development/references/saas-failure-and-display.md +45 -0
  812. package/skills/micro-app-frontend-development/references/standard-api-requests.md +30 -0
  813. package/skills/micro-app-frontend-development/references/submission-errors.md +51 -0
  814. package/skills/micro-app-frontend-development/scripts/microapp-kit.mjs +117 -0
  815. package/skills/micro-app-frontend-development/tests/behavior-scenarios.md +36 -0
  816. package/skills/micro-app-solution-design/SKILL.md +69 -0
  817. package/skills/micro-app-solution-design/agents/openai.yaml +6 -0
  818. package/skills/micro-app-solution-design/scripts/microapp-kit.mjs +117 -0
  819. package/skills/micro-app-solution-design/tests/behavior-scenarios.md +12 -0
@@ -0,0 +1,417 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { mkdtempSync, mkdirSync, writeFileSync, readFileSync, rmSync, utimesSync, realpathSync } from 'node:fs';
4
+ import { join } from 'node:path';
5
+ import { tmpdir } from 'node:os';
6
+ import { createHash } from 'node:crypto';
7
+ import { spawnSync } from 'node:child_process';
8
+ import { gzipSync, gunzipSync } from 'node:zlib';
9
+ import { publishRelease, planRelease } from '../publication.mjs';
10
+ import { publicationHistory, publicationContext } from '../release-index.mjs';
11
+ import { archiveContent, releaseContent } from '../release-content.mjs';
12
+ import { tarFixture } from './helpers/tar-fixture.mjs';
13
+ import { prepareSession, runSession } from '../auth/session.mjs';
14
+
15
+ const hash = value => createHash('sha256').update(value).digest('hex');
16
+ function workspace(t) {
17
+ const root = realpathSync(mkdtempSync(join(tmpdir(), 'microapp-recovery-')));
18
+ t.after(() => rmSync(root, { recursive: true, force: true }));
19
+ const project = join(root, 'project');
20
+ mkdirSync(project);
21
+ return { root, project, stateRoot: join(root, 'state'),
22
+ environment: { SDF_APP_KEY: 'recovery-fixture-key', SDF_SECRET_KEY: 'recovery-fixture-secret' } };
23
+ }
24
+ function prepare(f, name, { frontend = 'front', backend = 'back', stamp = 1, database = false, description = 'Device app', versionDescription = 'Initial release', versionDescriptionEn = 'Initial release' } = {}) {
25
+ const output = join(f.root, name);
26
+ mkdirSync(join(output, 'artifacts'), { recursive: true });
27
+ mkdirSync(join(output, 'build/frontend/package'), { recursive: true });
28
+ const app = { appName: 'recovery-demo-123-customer', description, versionDescription };
29
+ writeFileSync(join(output, 'build/frontend/package/manifest.json'), JSON.stringify(app));
30
+ const front = tarFixture({ 'package/manifest.json': JSON.stringify(app), 'package/dist/index.html': frontend, 'package/_locales/mf/en.json': JSON.stringify({ versionDescription: versionDescriptionEn }) }, { stamp });
31
+ const back = tarFixture({ 'server.mjs': backend }, { stamp });
32
+ writeFileSync(join(output, 'artifacts/source.tgz'), front);
33
+ writeFileSync(join(output, 'artifacts/backend-context.tgz'), back);
34
+ writeFileSync(join(output, 'artifacts/release-artifacts.json'), JSON.stringify({
35
+ format: 'v6-release-artifacts-v2', build: { microAppCode: 'recovery-demo-123-customer', microAppCodeSource: 'publication', backendRequired: true, databaseRequired: database,
36
+ sourceDigest: hash('build-input-' + stamp), ...(database ? { digests: { 'backend-context/deploy/manifest.json': hash('schema') } } : {}) },
37
+ static: { file: 'source.tgz', sha256: hash(front) }, backend: { file: 'backend-context.tgz', sha256: hash(back) },
38
+ }));
39
+ return output;
40
+ }
41
+ function publishingService() {
42
+ const fronts = [], builds = [];
43
+ const state = { registrations: 0, uploads: 0, loseFrontend: false, unavailable: false, expired: false };
44
+ const ok = result => ({ ok: true, status: 200, json: async () => ({ success: true, result }) });
45
+ const error = code => ({ ok: true, status: 200, json: async () => ({ success: false, code }) });
46
+ const fetchImpl = async (url, request) => {
47
+ if (state.unavailable) throw new Error('private-server-detail');
48
+ if (url.pathname.endsWith('registry-smarthome')) {
49
+ if (request.method === 'POST') {
50
+ state.registrations++;
51
+ const number = fronts.length + 1;
52
+ const task = { taskId: 'front-' + number, releaseId: 'release-' + number, requestId: request.body.get('requestId'),
53
+ microAppCode: request.body.get('code'), microAppVersion: '0.0.0-' + number,
54
+ backendRequired: request.body.get('backendRequired') === 'true', databaseRequired: request.body.get('databaseRequired') === 'true', status: 'SUCCESS' };
55
+ fronts.push(task);
56
+ if (state.loseFrontend) { state.loseFrontend = false; throw new Error('private-server-detail'); }
57
+ return ok(task);
58
+ }
59
+ const task = fronts.find(task => task.taskId === url.searchParams.get('taskId') || task.requestId === url.searchParams.get('requestId'));
60
+ return task ? ok(task) : error('SMARTHOME_TASK_NOT_FOUND');
61
+ }
62
+ if (url.pathname.endsWith('backend-build')) {
63
+ if (request.method === 'POST') {
64
+ state.uploads++;
65
+ let task = builds.find(task => task.requestId === request.body.get('requestId'));
66
+ if (!task) {
67
+ task = { buildTaskId: 'build-' + (builds.length + 1), requestId: request.body.get('requestId'),
68
+ releaseId: request.body.get('releaseId'), microAppCode: request.body.get('microAppCode'), status: 'QUEUED' };
69
+ builds.push(task);
70
+ }
71
+ if (state.expired) { task.status = 'FAILED'; task.errorCode = 'UPLOAD_NOT_COMPLETED'; return ok(task); }
72
+ task.status = 'QUEUED';
73
+ return ok(task);
74
+ }
75
+ const task = builds.find(task => task.buildTaskId === url.searchParams.get('buildTaskId') || task.requestId === url.searchParams.get('requestId'));
76
+ return task ? ok(task) : error('1002');
77
+ }
78
+ throw new Error('unexpected endpoint');
79
+ };
80
+ return { state, fronts, builds, fetchImpl };
81
+ }
82
+
83
+ function complete(task) {
84
+ Object.assign(task, { status: 'COMPLETE', backendRegistered: true,
85
+ imageTag: 'v-20261020093000123-0123456789abcdef', imageDigest: 'sha256:' + 'a'.repeat(64) });
86
+ }
87
+
88
+ test('repackaged identical content resumes the original version and uses the original archive bytes', async t => {
89
+ const f = workspace(t), p = publishingService();
90
+ const original = prepare(f, 'original');
91
+ // Stop after frontend registration, before a backend upload exists.
92
+ p.state.loseFrontend = true;
93
+ await assert.rejects(publishRelease('publish', { ...f, output: original, fetchImpl: p.fetchImpl }));
94
+ const next = prepare(f, 'repacked', { stamp: 9 });
95
+ assert.notEqual(hash(readFileSync(join(original, 'artifacts/source.tgz'))), hash(readFileSync(join(next, 'artifacts/source.tgz'))));
96
+ const oldBack = readFileSync(join(original, 'artifacts/backend-context.tgz'));
97
+ const result = await publishRelease('publish', { ...f, output: next, fetchImpl: async (url, request) => {
98
+ if (request.method === 'POST' && url.pathname.endsWith('backend-build')) {
99
+ assert.deepEqual(Buffer.from(await request.body.get('file').arrayBuffer()), oldBack);
100
+ }
101
+ return p.fetchImpl(url, request);
102
+ } });
103
+ assert.equal(result.decision, 'resume-existing');
104
+ assert.equal(result.publicationOutput, original);
105
+ assert.equal(result.microAppVersion, '0.0.0-1');
106
+ assert.equal(p.state.registrations, 1);
107
+ assert.equal(p.state.uploads, 1);
108
+ assert.equal(publicationHistory(f).publications.length, 1);
109
+ });
110
+
111
+ test('queued and completed releases are rechecked and reused across new prepared directories', async t => {
112
+ const f = workspace(t), p = publishingService(), output = prepare(f, 'one');
113
+ await publishRelease('publish', { ...f, output, fetchImpl: p.fetchImpl });
114
+ const next = prepare(f, 'two', { stamp: 3 });
115
+ assert.equal((await publishRelease('publish', { ...f, output: next, fetchImpl: p.fetchImpl })).stage, 'QUEUED');
116
+ complete(p.builds[0]);
117
+ assert.equal((await publishRelease('publish', { ...f, output: next, fetchImpl: p.fetchImpl })).decision, 'reuse-complete');
118
+ assert.equal(p.state.registrations, 1);
119
+ assert.equal(p.state.uploads, 1);
120
+ p.state.unavailable = true;
121
+ await assert.rejects(publishRelease('publish', { ...f, output: next, fetchImpl: p.fetchImpl }), { code: 'REGISTRY_REQUEST_FAILED' });
122
+ assert.equal(p.state.registrations, 1, 'cached completion is not a substitute for platform authority');
123
+ });
124
+
125
+ for (const change of [{ frontend: 'changed' }, { backend: 'changed' }, { database: true }, { description: 'Updated app purpose' }, { versionDescription: 'Fix device labels' }, { versionDescriptionEn: 'Translated release-note change only' }]) {
126
+ test('changed frontend/backend/declaration creates a new platform service version without replacing the pending release: ' + JSON.stringify(change), async t => {
127
+ const f = workspace(t), p = publishingService(), output = prepare(f, 'old');
128
+ await publishRelease('publish', { ...f, output, fetchImpl: p.fetchImpl });
129
+ const next = prepare(f, 'new', change);
130
+ const result = await publishRelease('publish', { ...f, output: next, fetchImpl: p.fetchImpl });
131
+ assert.equal(result.decision, 'new-content');
132
+ assert.equal(result.microAppVersion, '0.0.0-2');
133
+ assert.equal(result.previousPublications[0].microAppVersion, '0.0.0-1');
134
+ assert.equal(publicationHistory(f).publications.length, 2);
135
+ assert.equal(p.builds[0].status, 'QUEUED');
136
+ });
137
+ }
138
+
139
+ test('terminal failures stop by default; explicit new-attempt rechecks platform service and allocates fresh requests', async t => {
140
+ const f = workspace(t), p = publishingService(), output = prepare(f, 'old');
141
+ await publishRelease('publish', { ...f, output, fetchImpl: p.fetchImpl });
142
+ const next = prepare(f, 'new');
143
+ await assert.rejects(publishRelease('publish', { ...f, output: next, fetchImpl: p.fetchImpl, newAttempt: true }), { code: 'PUBLICATION_RETRY_NOT_ALLOWED' });
144
+ p.builds[0].status = 'FAILED';
145
+ assert.equal((await publishRelease('publish', { ...f, output: next, fetchImpl: p.fetchImpl })).status, 'failed');
146
+ assert.equal(p.state.registrations, 1);
147
+ const result = await publishRelease('publish', { ...f, output: next, fetchImpl: p.fetchImpl, newAttempt: true });
148
+ assert.equal(result.decision, 'retry-terminal');
149
+ assert.equal(result.microAppVersion, '0.0.0-2');
150
+ const history = publicationHistory(f).publications;
151
+ assert.equal(history[1].retryOf, history[0].publicationId);
152
+ });
153
+
154
+ test('exhausted creation attempts fail and explicit push creates a new version without reviving the old build', async t => {
155
+ const f = workspace(t), p = publishingService(), output = prepare(f, 'old');
156
+ await publishRelease('publish', { ...f, output, fetchImpl: p.fetchImpl });
157
+ p.builds[0].status = 'FAILED';
158
+ p.builds[0].errorCode = 'INFRA_SUBMISSION_RETRIES_EXHAUSTED';
159
+ const next = prepare(f, 'retry');
160
+ const failed = await publishRelease('publish', { ...f, output: next, fetchImpl: p.fetchImpl });
161
+ assert.equal(failed.status, 'failed');
162
+ assert.equal(failed.reasonCode, 'INFRA_SUBMISSION_RETRIES_EXHAUSTED');
163
+ assert.match(failed.message, /new publication attempt/);
164
+ assert.match(failed.nextActions[0], /--new-attempt/);
165
+ assert.equal(p.state.registrations, 1);
166
+ const retried = await publishRelease('publish', { ...f, output: next, fetchImpl: p.fetchImpl, newAttempt: true });
167
+ assert.equal(retried.decision, 'retry-terminal');
168
+ assert.equal(retried.microAppVersion, '0.0.0-2');
169
+ assert.notEqual(p.builds[0].requestId, p.builds[1].requestId);
170
+ assert.notEqual(p.builds[0].releaseId, p.builds[1].releaseId);
171
+ assert.equal(p.builds[0].status, 'FAILED');
172
+ assert.equal(p.builds[1].status, 'QUEUED');
173
+ assert.equal(publicationHistory(f).publications.length, 2);
174
+ });
175
+
176
+ test('expired backend upload resumes original task and cannot create another version', async t => {
177
+ const f = workspace(t), p = publishingService(), output = prepare(f, 'old');
178
+ p.state.expired = true;
179
+ const pending = await publishRelease('publish', { ...f, output, fetchImpl: p.fetchImpl });
180
+ assert.equal(pending.status, 'running');
181
+ assert.equal(pending.resumable, true);
182
+ const originalRequest = p.builds[0].requestId;
183
+ await assert.rejects(publishRelease('publish', { ...f, output, fetchImpl: p.fetchImpl, newAttempt: true }),
184
+ { code: 'PUBLICATION_RETRY_NOT_ALLOWED' });
185
+ p.state.expired = false;
186
+ const result = await publishRelease('resume', { ...f, output: prepare(f, 'retry'), fetchImpl: p.fetchImpl });
187
+ assert.equal(result.decision, 'resume-existing');
188
+ assert.equal(result.microAppVersion, '0.0.0-1');
189
+ assert.equal(result.buildTaskId, pending.buildTaskId);
190
+ assert.equal(p.builds[0].requestId, originalRequest);
191
+ assert.equal(p.state.registrations, 1);
192
+ assert.equal(p.builds.length, 1);
193
+ });
194
+
195
+ test('lost backend upload response recovers its original task without retransferring or new registration', async t => {
196
+ const f = workspace(t), p = publishingService(), output = prepare(f, 'original');
197
+ let loseResponse = true;
198
+ const fetchImpl = async (url, request) => {
199
+ const response = await p.fetchImpl(url, request);
200
+ if (loseResponse && request.method === 'POST' && url.pathname.endsWith('backend-build')) {
201
+ loseResponse = false;
202
+ throw new Error('response lost after cloud READY and queue commit');
203
+ }
204
+ return response;
205
+ };
206
+ await assert.rejects(publishRelease('publish', { ...f, output, fetchImpl }), { code: 'REGISTRY_REQUEST_FAILED' });
207
+ const requestId = p.builds[0].requestId;
208
+ const result = await publishRelease('resume', { ...f, output: prepare(f, 'same-content'), fetchImpl });
209
+ assert.equal(result.stage, 'QUEUED');
210
+ assert.equal(result.buildTaskId, p.builds[0].buildTaskId);
211
+ assert.equal(result.microAppVersion, '0.0.0-1');
212
+ assert.equal(p.state.registrations, 1);
213
+ assert.equal(p.state.uploads, 1);
214
+ assert.equal(p.builds[0].requestId, requestId);
215
+ });
216
+
217
+ test('missing old artifacts block duplicate versions and readonly plans/history need no credentials', async t => {
218
+ const f = workspace(t), p = publishingService(), output = prepare(f, 'old');
219
+ await publishRelease('publish', { ...f, output, fetchImpl: p.fetchImpl });
220
+ const next = prepare(f, 'new');
221
+ const plan = await planRelease({ ...f, output: next, environment: {} });
222
+ assert.equal(plan.decision, 'check-existing');
223
+ assert.equal(plan.accountVerificationRequired, true);
224
+ assert.equal(p.state.registrations, 1);
225
+ rmSync(output, { recursive: true });
226
+ await assert.rejects(publishRelease('publish', { ...f, output: next, fetchImpl: p.fetchImpl }), { code: 'PUBLICATION_INPUT_MISSING' });
227
+ assert.equal(p.state.registrations, 1);
228
+ assert.doesNotMatch(JSON.stringify(publicationHistory(f)), /recovery-fixture-key|recovery-fixture-secret/);
229
+ });
230
+
231
+ test('lost per-output state is rebuilt from durable project intent using the original requests', async t => {
232
+ const f = workspace(t), p = publishingService(), output = prepare(f, 'old');
233
+ p.state.loseFrontend = true;
234
+ await assert.rejects(publishRelease('publish', { ...f, output, fetchImpl: p.fetchImpl }));
235
+ const id = publicationHistory(f).publications[0].publicationId;
236
+ rmSync(join(output, 'publication.json'));
237
+ assert.equal((await publishRelease('status', { ...f, output: prepare(f, 'new'), fetchImpl: p.fetchImpl })).stage, 'BACKEND_NOT_SUBMITTED');
238
+ const restored = JSON.parse(readFileSync(join(output, 'publication.json')));
239
+ assert.equal(restored.frontendRequestId, id);
240
+ assert.equal(p.state.registrations, 1);
241
+ assert.equal(p.state.uploads, 0);
242
+ });
243
+
244
+ test('recoverable cloud failure and cancellation in progress cannot be bypassed with a new attempt', async t => {
245
+ const f = workspace(t), p = publishingService(), output = prepare(f, 'old');
246
+ await publishRelease('publish', { ...f, output, fetchImpl: p.fetchImpl });
247
+ const next = prepare(f, 'new');
248
+ p.fronts[0].status = 'FAILED';
249
+ p.fronts[0].errorCode = 'SMARTHOME_PACKAGE_UPLOAD_FAILED';
250
+ await assert.rejects(publishRelease('publish', { ...f, output: next, fetchImpl: p.fetchImpl, newAttempt: true }), { code: 'PUBLICATION_RETRY_NOT_ALLOWED' });
251
+ p.fronts[0].status = 'SUCCESS';
252
+ p.builds[0].status = 'CANCEL_REQUESTED';
253
+ assert.equal((await publishRelease('resume', { ...f, output, fetchImpl: p.fetchImpl })).status, 'running');
254
+ await assert.rejects(publishRelease('publish', { ...f, output: next, fetchImpl: p.fetchImpl, newAttempt: true }), { code: 'PUBLICATION_RETRY_NOT_ALLOWED' });
255
+ assert.equal(p.state.registrations, 1);
256
+ });
257
+
258
+ test('publication scope prevents another account or endpoint from adopting local requests', async t => {
259
+ const f = workspace(t), p = publishingService(), output = prepare(f, 'old');
260
+ await publishRelease('publish', { ...f, output, fetchImpl: p.fetchImpl });
261
+ const environment = { ...f.environment, SDF_APP_KEY: 'other-fixture-key' };
262
+ await assert.rejects(publishRelease('resume', { ...f, output, environment, fetchImpl: p.fetchImpl }), /STATE_MISMATCH/);
263
+ const result = await publishRelease('publish', { ...f, output: prepare(f, 'new'), environment, fetchImpl: p.fetchImpl });
264
+ assert.equal(result.reused, false);
265
+ assert.equal(p.state.registrations, 2);
266
+ });
267
+
268
+ test('project lease prevents direct and session publishers from allocating simultaneous requests', async t => {
269
+ const f = workspace(t), p = publishingService(), output = prepare(f, 'old');
270
+ let entered, unblock;
271
+ const started = new Promise(resolve => { entered = resolve; });
272
+ const wait = new Promise(resolve => { unblock = resolve; });
273
+ const first = publishRelease('publish', { ...f, output, fetchImpl: async (...args) => { entered(); await wait; return p.fetchImpl(...args); } });
274
+ await started;
275
+ await assert.rejects(publishRelease('publish', { ...f, output: prepare(f, 'new'), fetchImpl: p.fetchImpl }), { code: 'PUBLICATION_BUSY' });
276
+ unblock();
277
+ await first;
278
+ assert.equal(p.state.registrations, 1);
279
+ });
280
+
281
+ test('dead project leases recover original requests while modified original metadata is refused', async t => {
282
+ const f = workspace(t), p = publishingService(), output = prepare(f, 'old');
283
+ await publishRelease('publish', { ...f, output, fetchImpl: p.fetchImpl });
284
+ const context = publicationContext(f.project, f);
285
+ const lock = context.file.replace(/\.json$/, '.lock');
286
+ mkdirSync(lock, { mode: 0o700 });
287
+ writeFileSync(join(lock, 'owner.json'), JSON.stringify({ pid: 2147483647 }), { mode: 0o600 });
288
+ assert.equal((await publishRelease('resume', { ...f, output, fetchImpl: p.fetchImpl })).stage, 'QUEUED');
289
+ const file = join(output, 'artifacts/release-artifacts.json');
290
+ const manifest = JSON.parse(readFileSync(file));
291
+ manifest.build.sourceDigest = hash('modified metadata');
292
+ writeFileSync(file, JSON.stringify(manifest));
293
+ await assert.rejects(publishRelease('resume', { ...f, output, fetchImpl: p.fetchImpl }), /STATE_MISMATCH/);
294
+ assert.equal(p.state.registrations, 1);
295
+ assert.equal(p.state.uploads, 1);
296
+ });
297
+
298
+ test('temporary credential session shares the direct publisher index and selects the original snapshot', async t => {
299
+ const f = workspace(t), p = publishingService(), output = prepare(f, 'direct');
300
+ await publishRelease('publish', { ...f, output, fetchImpl: p.fetchImpl });
301
+ complete(p.builds[0]);
302
+ const next = prepare(f, 'session', { stamp: 3 }), bundleSha256 = 'a'.repeat(64);
303
+ const session = prepareSession({ ...f, output: next, bundleSha256 });
304
+ const result = await runSession({ ...f, sessionId: session.sessionId, bundleSha256,
305
+ prompt: async field => field === 'App Key' ? f.environment.SDF_APP_KEY : f.environment.SDF_SECRET_KEY,
306
+ publish: (action, options) => publishRelease(action, { ...options, fetchImpl: p.fetchImpl }),
307
+ });
308
+ assert.equal(result.status, 'complete', JSON.stringify(result));
309
+ assert.equal(result.decision, 'reuse-complete');
310
+ assert.equal(result.publicationOutput, output);
311
+ assert.equal(p.state.registrations, 1);
312
+ });
313
+
314
+ test('archive identity ignores packing order/timestamps but includes executable mode and rejects unsafe data', async t => {
315
+ const f = workspace(t), paths = [join(f.root, 'a.tgz'), join(f.root, 'b.tgz'), join(f.root, 'c.tgz')];
316
+ writeFileSync(paths[0], tarFixture({ 'a.txt': 'one', 'b.txt': 'two' }));
317
+ writeFileSync(paths[1], tarFixture({ 'b.txt': 'two', 'a.txt': 'one' }, { stamp: 999 }));
318
+ writeFileSync(paths[2], tarFixture({ 'a.txt': 'one', 'b.txt': 'two' }, { executable: true }));
319
+ assert.equal(await archiveContent(paths[0]), await archiveContent(paths[1]));
320
+ assert.notEqual(await archiveContent(paths[0]), await archiveContent(paths[2]));
321
+ writeFileSync(paths[2], tarFixture({ '../outside': 'bad' }));
322
+ await assert.rejects(archiveContent(paths[2]), { code: 'RELEASE_CONTENT_INVALID' });
323
+ writeFileSync(paths[2], gzipSync(Buffer.from('not-a-tar')));
324
+ await assert.rejects(archiveContent(paths[2]), { code: 'RELEASE_CONTENT_INVALID' });
325
+ });
326
+
327
+ test('backend expansion is capped at 100 MiB while frontend content keeps its existing limit', async t => {
328
+ const f = workspace(t);
329
+ const frontend = join(f.root, 'frontend.tgz'), backend = join(f.root, 'backend.tgz');
330
+ writeFileSync(frontend, tarFixture({ 'index.html': 'frontend' }));
331
+ const raw = Buffer.alloc(100 * 1024 * 1024 + 512);
332
+ gunzipSync(tarFixture({ 'server.mjs': '' })).copy(raw);
333
+ writeFileSync(backend, gzipSync(raw));
334
+ const prepared = { frontendFile: frontend, backendFile: backend, code: 'demo-ab12',
335
+ manifest: { build: { backendRequired: true, databaseRequired: false } } };
336
+ await assert.rejects(releaseContent(prepared), { code: 'RELEASE_CONTENT_INVALID' });
337
+ assert.match(await archiveContent(backend), /^[a-f0-9]{64}$/);
338
+ });
339
+
340
+ test('real tar/PAX archives retain content identity after touching files and repacking long names', async t => {
341
+ const f = workspace(t), source = join(f.root, 'tree');
342
+ mkdirSync(source);
343
+ const file = join(source, 'long-'.repeat(30) + '.txt');
344
+ writeFileSync(file, 'actual archive bytes');
345
+ const first = join(f.root, 'first.tgz'), second = join(f.root, 'second.tgz');
346
+ for (const [target, stamp] of [[first, 1700000000], [second, 1700000090]]) {
347
+ utimesSync(file, stamp, stamp);
348
+ const child = spawnSync('tar', ['-czf', target, '-C', source, '.'], { env: { PATH: process.env.PATH, COPYFILE_DISABLE: '1' } });
349
+ assert.equal(child.status, 0, child.stderr?.toString());
350
+ }
351
+ assert.equal(await archiveContent(first), await archiveContent(second));
352
+ });
353
+
354
+ test('explicit logs recheck original task and never write or create a publication', async t => {
355
+ const { publicationLogs } = await import('../publication.mjs');
356
+ const f = workspace(t), p = publishingService(), output = prepare(f, 'logs');
357
+ await publishRelease('publish', { ...f, output, fetchImpl: p.fetchImpl });
358
+ const previous = readFileSync(join(output, 'publication.json'), 'utf8');
359
+ p.builds[0].status = 'FAILED';
360
+ p.builds[0].errorCode = 'INFRA_FAILED';
361
+ const requests = [];
362
+ const fetchImpl = async (url, request) => {
363
+ requests.push(request.method + ' ' + url.pathname);
364
+ if (url.pathname.endsWith('/logs')) {
365
+ assert.equal(url.searchParams.get('buildTaskId'), 'build-1');
366
+ assert.equal(url.searchParams.get('tailLines'), '200');
367
+ assert.equal(url.searchParams.get('sinceSeconds'), '600');
368
+ return { ok: true, status: 200, json: async () => ({ success: true, result: {
369
+ text: 'Type error: missing value', available: true, truncated: true, privateField: 'not-for-output' } }) };
370
+ }
371
+ return p.fetchImpl(url, request);
372
+ };
373
+ const logs = await publicationLogs({ ...f, output, fetchImpl, tailLines: 200, sinceSeconds: 600 });
374
+ assert.equal(logs.text, 'Type error: missing value');
375
+ assert.equal(logs.buildTaskId, 'build-1');
376
+ assert.equal(logs.stage, 'FAILED');
377
+ assert.equal(logs.truncated, true);
378
+ assert.equal(logs.privateField, undefined);
379
+ assert.ok(requests.every(request => request.startsWith('GET ')));
380
+ assert.equal(readFileSync(join(output, 'publication.json'), 'utf8'), previous);
381
+ assert.equal(p.state.uploads, 1);
382
+ assert.equal(publicationHistory(f).publications.length, 1);
383
+ await assert.rejects(publicationLogs({ ...f, output, fetchImpl, tailLines: 2001 }), { code: 'BUILD_LOGS_QUERY_INVALID' });
384
+ p.builds[0].microAppCode = 'another-app';
385
+ const before = requests.length;
386
+ await assert.rejects(publicationLogs({ ...f, output, fetchImpl }), { code: 'STATE_MISMATCH' });
387
+ assert.equal(requests.length, before + 1, 'do not fetch logs on an inconsistent status response');
388
+ });
389
+
390
+ test('build failure includes bounded diagnostics while unavailable logs preserve the original failure', async t => {
391
+ const f = workspace(t), p = publishingService(), output = prepare(f, 'failed-logs');
392
+ await publishRelease('publish', { ...f, output, fetchImpl: p.fetchImpl });
393
+ Object.assign(p.builds[0], { status: 'FAILED', errorCode: 'INFRA_FAILED' });
394
+ let queries = 0, unavailable = false;
395
+ const fetchImpl = async (url, request) => {
396
+ if (!url.pathname.endsWith('/logs')) return p.fetchImpl(url, request);
397
+ queries++;
398
+ assert.equal(request.method, 'GET');
399
+ if (unavailable) return { ok: false, status: 403, json: async () => ({ secret: 'remote-details' }) };
400
+ return { ok: true, status: 200, json: async () => ({ success: true,
401
+ result: { text: 'Compile failed', available: true, truncated: false } }) };
402
+ };
403
+ const result = await publishRelease('status', { ...f, output, fetchImpl });
404
+ assert.equal(result.status, 'failed');
405
+ assert.equal(result.reasonCode, 'INFRA_FAILED');
406
+ assert.equal(result.buildLogs.text, 'Compile failed');
407
+ assert.equal(queries, 1);
408
+ unavailable = true;
409
+ const again = await publishRelease('resume', { ...f, output, fetchImpl });
410
+ assert.equal(again.status, 'failed');
411
+ assert.equal(again.stage, 'FAILED');
412
+ assert.equal(again.reasonCode, 'INFRA_FAILED');
413
+ assert.equal(again.buildLogs.errorCode, 'BUILD_LOGS_UNAVAILABLE');
414
+ assert.doesNotMatch(JSON.stringify(again), /remote-details/);
415
+ assert.equal(p.state.registrations, 1);
416
+ assert.equal(p.state.uploads, 1);
417
+ });
@@ -0,0 +1,38 @@
1
+ import test from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { mkdtempSync, mkdirSync, writeFileSync, rmSync, readFileSync } from 'node:fs';
4
+ import { tmpdir } from 'node:os';
5
+ import { join } from 'node:path';
6
+ import { buildBundle, refreshBundle } from '../assemble.mjs';
7
+ import { verifyBundle } from '../integrity.mjs';
8
+
9
+ test('repository metadata changes do not alter bundle identity or enter the manifest', t => {
10
+ const root = mkdtempSync(join(tmpdir(), 'kit-repository-'));
11
+ t.after(() => rmSync(root, { recursive: true, force: true }));
12
+ const bundle = buildBundle(join(root, 'bundle'));
13
+ const before = verifyBundle(bundle).bundleSha256;
14
+ mkdirSync(join(bundle, '.git'));
15
+ writeFileSync(join(bundle, '.git/config'), '[core]\nrepositoryformatversion = 0\n');
16
+ for (const name of ['.gitignore', '.gitattributes', 'AGENTS.md']) {
17
+ writeFileSync(join(bundle, name), 'repository-only\n');
18
+ }
19
+ assert.equal(verifyBundle(bundle).bundleSha256, before);
20
+ writeFileSync(join(bundle, '.git/HEAD'), 'ref: refs/heads/master\n');
21
+ assert.equal(refreshBundle(bundle).bundleSha256, before);
22
+ const files = JSON.parse(readFileSync(join(bundle, 'bundle.json'))).files;
23
+ assert.equal(Object.keys(files).some(file => file.startsWith('.git') || file === 'AGENTS.md'), false);
24
+ });
25
+
26
+ test('repository exclusions do not hide product additions, tampering or nested metadata', t => {
27
+ const root = mkdtempSync(join(tmpdir(), 'kit-repository-boundary-'));
28
+ t.after(() => rmSync(root, { recursive: true, force: true }));
29
+ const bundle = buildBundle(join(root, 'bundle'));
30
+ for (const name of ['unexpected.mjs', 'runtime/.gitignore', 'resources/template/backend/AGENTS.md']) {
31
+ writeFileSync(join(bundle, name), 'unexpected');
32
+ assert.throws(() => verifyBundle(bundle), /BUNDLE_INTEGRITY_MISMATCH/);
33
+ rmSync(join(bundle, name));
34
+ }
35
+ const template = join(bundle, 'resources/template/_gitignore');
36
+ writeFileSync(template, 'tampered');
37
+ assert.throws(() => verifyBundle(bundle), /BUNDLE_INTEGRITY_MISMATCH/);
38
+ });
@@ -0,0 +1,169 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { cpSync, existsSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync, mkdirSync, writeFileSync } from 'node:fs';
4
+ import { join } from 'node:path';
5
+ import { tmpdir } from 'node:os';
6
+ import { spawnSync } from 'node:child_process';
7
+ import { buildBundle, refreshBundle } from '../assemble.mjs';
8
+ import { setup, AGENTS } from '../setup.mjs';
9
+ import { update } from '../update.mjs';
10
+ import { tree } from '../integrity.mjs';
11
+
12
+ const six = [
13
+ 'micro-app-backend-development',
14
+ 'micro-app-cloud-integration',
15
+ 'micro-app-design',
16
+ 'micro-app-development',
17
+ 'micro-app-frontend-development',
18
+ 'micro-app-solution-design',
19
+ ];
20
+ const four = six.filter(name => !['micro-app-frontend-development', 'micro-app-solution-design'].includes(name));
21
+ const json = path => JSON.parse(readFileSync(path, 'utf8'));
22
+
23
+ async function fixture(t, agent = 'codex') {
24
+ const root = realpathSync(mkdtempSync(join(tmpdir(), 'kit-six-skills-')));
25
+ t.after(() => rmSync(root, { recursive: true, force: true }));
26
+ const f = { root, home: join(root, 'home'), project: join(root, 'project'), env: {} };
27
+ f.kitHome = join(f.home, '.tuya-microapp');
28
+ f.target = buildBundle(join(root, 'target'));
29
+ f.old = join(root, 'old');
30
+ cpSync(f.target, f.old, { recursive: true });
31
+ for (const name of ['micro-app-frontend-development', 'micro-app-solution-design']) {
32
+ rmSync(join(f.old, 'skills', name), { recursive: true, force: true });
33
+ }
34
+ const manifest = json(join(f.old, 'bundle.json'));
35
+ manifest.version = '0.1.5';
36
+ delete manifest.cacheLayout;
37
+ writeFileSync(join(f.old, 'bundle.json'), JSON.stringify(manifest));
38
+ refreshBundle(f.old);
39
+ await setup({ ...f, bundleRoot: f.old, agent });
40
+ f.host = AGENTS[agent];
41
+ f.metadata = join(f.project, '.tuya-microapp');
42
+ f.options = { ...f, bundleRoot: f.target };
43
+ return f;
44
+ }
45
+
46
+ function installed(f) {
47
+ return readdirSync(join(f.project, f.host, 'skills')).sort();
48
+ }
49
+
50
+ for (const agent of Object.keys(AGENTS)) {
51
+ test(`six skills install for ${agent}; both new launchers run from the cache`, async t => {
52
+ const f = await fixture(t, agent);
53
+ assert.deepEqual(installed(f), four);
54
+ await update(f.options);
55
+ assert.deepEqual(installed(f), six);
56
+ const receipt = json(join(f.metadata, 'installation.json'));
57
+ assert.deepEqual(Object.keys(receipt.hosts[0].skillHashes).sort(), six);
58
+ for (const name of ['micro-app-frontend-development', 'micro-app-solution-design']) {
59
+ const child = spawnSync(process.execPath, [join(f.project, f.host, 'skills', name, 'scripts/microapp-kit.mjs'), 'doctor', '--project', f.project], {
60
+ env: { ...process.env, TUYA_MICROAPP_HOME: f.kitHome }, encoding: 'utf8', timeout: 30_000,
61
+ });
62
+ assert.equal(child.status, 0, child.stderr + child.stdout);
63
+ assert.equal(JSON.parse(child.stdout).operation, 'doctor');
64
+ }
65
+ });
66
+ }
67
+
68
+ test('four-to-six update and rollback retain business files and restore the exact old receipt', async t => {
69
+ const f = await fixture(t);
70
+ const receipt = json(join(f.metadata, 'installation.json'));
71
+ writeFileSync(join(f.project, 'business.txt'), 'retained');
72
+ assert.equal((await update({ ...f.options, check: true })).updateState, 'ready');
73
+ assert.deepEqual(installed(f), four);
74
+ assert.equal((await update(f.options)).updateState, 'updated');
75
+ assert.deepEqual(installed(f), six);
76
+ assert.equal((await update({ ...f.options, rollback: true, to: '0.1.5' })).updateState, 'rolled-back');
77
+ assert.deepEqual(installed(f), four);
78
+ assert.deepEqual(json(join(f.metadata, 'installation.json')), receipt);
79
+ assert.equal(readFileSync(join(f.project, 'business.txt'), 'utf8'), 'retained');
80
+ });
81
+
82
+ for (const phase of ['installed:.agents/micro-app-frontend-development', 'installed:.agents/micro-app-solution-design', 'committed']) {
83
+ test(`interrupted skill-set expansion at ${phase} restores four skills`, async t => {
84
+ const f = await fixture(t);
85
+ const program = `import { update } from ${JSON.stringify(new URL('../update.mjs', import.meta.url).href)};
86
+ await update({ ...JSON.parse(process.argv[1]), checkpoint: stage => { if (stage === process.argv[2]) process.exit(77); } });`;
87
+ const child = spawnSync(process.execPath, ['--input-type=module', '-e', program, JSON.stringify(f.options), phase], { encoding: 'utf8', timeout: 30_000 });
88
+ assert.equal(child.status, 77, child.stderr + child.stdout);
89
+ assert.equal((await update({ ...f.options, recover: true })).updateState, 'recovered');
90
+ assert.deepEqual(installed(f), four);
91
+ assert.equal(existsSync(join(f.metadata, 'update.json')), false);
92
+ assert.equal((await update(f.options)).updateState, 'updated');
93
+ });
94
+ }
95
+
96
+ test('new same-name user skills are not adopted or overwritten during expansion', async t => {
97
+ const f = await fixture(t);
98
+ const directory = join(f.project, f.host, 'skills/micro-app-frontend-development');
99
+ mkdirSync(directory);
100
+ writeFileSync(join(directory, 'SKILL.md'), 'user-owned');
101
+ await assert.rejects(update(f.options), { code: 'UPDATE_SKILL_CONFLICT' });
102
+ assert.equal(readFileSync(join(directory, 'SKILL.md'), 'utf8'), 'user-owned');
103
+ assert.equal(json(join(f.metadata, 'toolchain.json')).version, '0.1.5');
104
+ });
105
+
106
+ test('rollback interruption restores six skills including those absent from the rollback package', async t => {
107
+ const f = await fixture(t);
108
+ await update(f.options);
109
+ const receipt = json(join(f.metadata, 'installation.json'));
110
+ const program = `import { update } from ${JSON.stringify(new URL('../update.mjs', import.meta.url).href)};
111
+ await update({ ...JSON.parse(process.argv[1]), rollback: true, to: '0.1.5', checkpoint: stage => {
112
+ if (stage === 'removed:.agents/micro-app-frontend-development') process.exit(77);
113
+ } });`;
114
+ const child = spawnSync(process.execPath, ['--input-type=module', '-e', program, JSON.stringify(f.options)], { encoding: 'utf8', timeout: 30_000 });
115
+ assert.equal(child.status, 77, child.stderr + child.stdout);
116
+ assert.equal((await update({ ...f.options, recover: true })).updateState, 'recovered');
117
+ assert.deepEqual(installed(f), six);
118
+ assert.deepEqual(json(join(f.metadata, 'installation.json')), receipt);
119
+ });
120
+
121
+ test('recovery never removes a newly added skill edited after an expansion crash', async t => {
122
+ const f = await fixture(t);
123
+ const program = `import { update } from ${JSON.stringify(new URL('../update.mjs', import.meta.url).href)};
124
+ await update({ ...JSON.parse(process.argv[1]), checkpoint: stage => {
125
+ if (stage === 'installed:.agents/micro-app-frontend-development') process.exit(77);
126
+ } });`;
127
+ const child = spawnSync(process.execPath, ['--input-type=module', '-e', program, JSON.stringify(f.options)], { encoding: 'utf8', timeout: 30_000 });
128
+ assert.equal(child.status, 77, child.stderr + child.stdout);
129
+ const edited = join(f.project, f.host, 'skills/micro-app-frontend-development/SKILL.md');
130
+ writeFileSync(edited, 'post-crash-edit');
131
+ await assert.rejects(update({ ...f.options, recover: true }), { code: 'UPDATE_RECOVERY_CONFLICT' });
132
+ assert.equal(readFileSync(edited, 'utf8'), 'post-crash-edit');
133
+ assert.equal(existsSync(join(f.metadata, 'update.json')), true);
134
+ });
135
+
136
+ test('incomplete target skill inventory cannot uninstall existing capabilities', async t => {
137
+ const f = await fixture(t);
138
+ const before = tree(f.project);
139
+ rmSync(join(f.target, 'skills/micro-app-backend-development'), { recursive: true });
140
+ const manifest = json(join(f.target, 'bundle.json'));
141
+ manifest.skills = six.filter(name => name !== 'micro-app-backend-development');
142
+ manifest.files = tree(f.target, { exclude: ['bundle.json', 'evals'] });
143
+ writeFileSync(join(f.target, 'bundle.json'), JSON.stringify(manifest));
144
+ await assert.rejects(update(f.options), /INVALID_BUNDLE/);
145
+ assert.deepEqual(tree(f.project), before);
146
+ });
147
+
148
+ test('declared skill inventory must match the actual delivered set before update', async t => {
149
+ const f = await fixture(t);
150
+ const before = tree(f.project);
151
+ const manifest = json(join(f.target, 'bundle.json'));
152
+ manifest.skills = four;
153
+ writeFileSync(join(f.target, 'bundle.json'), JSON.stringify(manifest));
154
+ await assert.rejects(update({ ...f.options, check: true }), /INVALID_BUNDLE/);
155
+ assert.deepEqual(tree(f.project), before);
156
+ });
157
+
158
+ test('extra undeclared skill directories are rejected before changing the installation', async t => {
159
+ const f = await fixture(t);
160
+ const before = tree(f.project);
161
+ const extra = join(f.target, 'skills/unmanaged-extra');
162
+ mkdirSync(extra);
163
+ writeFileSync(join(extra, 'tool.mjs'), 'export const value = 1;');
164
+ const manifest = json(join(f.target, 'bundle.json'));
165
+ manifest.files = tree(f.target, { exclude: ['bundle.json', 'evals'] });
166
+ writeFileSync(join(f.target, 'bundle.json'), JSON.stringify(manifest));
167
+ await assert.rejects(update(f.options), /INVALID_BUNDLE/);
168
+ assert.deepEqual(tree(f.project), before);
169
+ });