@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,107 @@
1
+ import { existsSync, lstatSync, mkdirSync, readFileSync, writeFileSync, renameSync, rmSync, realpathSync } from 'node:fs';
2
+ import { join, sep } from 'node:path';
3
+ import { homedir } from 'node:os';
4
+ import { createHash, randomUUID } from 'node:crypto';
5
+ import { realPathOnly } from '../integrity.mjs';
6
+
7
+ export const ID = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
8
+ export function fail(code) { throw Object.assign(new Error(code), { code }); }
9
+ export function hash(value) { return createHash('sha256').update(value).digest('hex'); }
10
+ export function projectPath(project) { return realpathSync(realPathOnly(project)); }
11
+ export function authRoot({ stateRoot, environment = process.env } = {}) {
12
+ return realPathOnly(stateRoot || join(environment.TUYA_MICROAPP_HOME || join(homedir(), '.tuya-microapp'), 'state/auth'));
13
+ }
14
+ export function privatePath(path) {
15
+ path = realPathOnly(path);
16
+ let stat;
17
+ try { stat = lstatSync(path); } catch (error) { if (error.code !== 'ENOENT') throw error; }
18
+ if (stat) {
19
+ if (stat.isSymbolicLink() || (!stat.isFile() && !stat.isDirectory())) fail('AUTH_STATE_INVALID');
20
+ if (process.platform !== 'win32' && (stat.uid !== process.getuid() || (stat.mode & 0o077))) fail('AUTH_STATE_PERMISSIONS');
21
+ }
22
+ return path;
23
+ }
24
+ export function ensureDirectory(path) {
25
+ path = realPathOnly(path);
26
+ if (!existsSync(path)) mkdirSync(path, { recursive: true, mode: 0o700 });
27
+ privatePath(path);
28
+ return path;
29
+ }
30
+ export function readState(path) {
31
+ privatePath(path);
32
+ if (!existsSync(path)) return undefined;
33
+ try { return JSON.parse(readFileSync(path, 'utf8')); }
34
+ catch { fail('AUTH_STATE_INVALID'); }
35
+ }
36
+ export function writeState(path, data) {
37
+ privatePath(path);
38
+ const temporary = path + '.' + randomUUID();
39
+ try {
40
+ writeFileSync(temporary, JSON.stringify(data, null, 2) + '\n', { flag: 'wx', mode: 0o600 });
41
+ renameSync(temporary, path);
42
+ } finally { rmSync(temporary, { force: true }); }
43
+ }
44
+ export function layout(project, options = {}) {
45
+ const canonical = projectPath(project), root = authRoot(options);
46
+ if (root === canonical || root.startsWith(canonical + sep)) fail('AUTH_STATE_INSIDE_PROJECT');
47
+ return { project: canonical, root, binding: join(root, 'bindings', hash(canonical) + '.json') };
48
+ }
49
+ export function initialize(root) {
50
+ ensureDirectory(root);
51
+ for (const name of ['profiles', 'bindings', 'pending', 'sessions', 'leases']) ensureDirectory(join(root, name));
52
+ }
53
+ export function profilePath(root, id) {
54
+ if (!ID.test(id || '')) fail('AUTH_PROFILE_INVALID');
55
+ return join(root, 'profiles', id + '.json');
56
+ }
57
+ function lockOwner(path) {
58
+ privatePath(path);
59
+ const owner = readState(join(path, 'owner.json'));
60
+ // Old/unknown ownerless locks require investigation, never blind deletion.
61
+ if (!owner || !ID.test(owner.token || '') || !Number.isInteger(owner.pid) || owner.pid < 1) fail('AUTH_BUSY');
62
+ return owner;
63
+ }
64
+ function ownerAlive(owner) {
65
+ try { process.kill(owner.pid, 0); return true; }
66
+ catch (error) { return error.code !== 'ESRCH'; }
67
+ }
68
+ function retireLock(path) {
69
+ // Remove the public name atomically. A crash during cleanup cannot leave an ownerless public lock.
70
+ const retired = path + '.retired-' + randomUUID();
71
+ renameSync(path, retired);
72
+ rmSync(retired, { recursive: true, force: true });
73
+ }
74
+ function acquireLock(path, depth = 0) {
75
+ if (depth > 8) fail('AUTH_BUSY');
76
+ const token = randomUUID();
77
+ const temporary = path + '.' + token;
78
+ mkdirSync(temporary, { mode: 0o700 });
79
+ try {
80
+ writeState(join(temporary, 'owner.json'), { pid: process.pid, token });
81
+ if (!existsSync(path)) {
82
+ try {
83
+ // Publish a populated directory atomically; competing populated locks cannot be replaced.
84
+ renameSync(temporary, path);
85
+ return () => {
86
+ if (existsSync(path) && lockOwner(path).token === token) retireLock(path);
87
+ };
88
+ } catch (error) {
89
+ if (!['EEXIST', 'ENOTEMPTY', 'EPERM', 'EACCES'].includes(error.code)) throw error;
90
+ }
91
+ }
92
+ if (!existsSync(path)) fail('AUTH_BUSY');
93
+ if (ownerAlive(lockOwner(path))) fail('AUTH_BUSY');
94
+ // Serialize reclaimers so a second stale observer cannot delete a newly acquired lock.
95
+ const releaseRecovery = acquireLock(path + '.recovery', depth + 1);
96
+ try {
97
+ if (existsSync(path)) {
98
+ if (ownerAlive(lockOwner(path))) fail('AUTH_BUSY');
99
+ retireLock(path);
100
+ }
101
+ } finally { releaseRecovery(); }
102
+ } finally { rmSync(temporary, { recursive: true, force: true }); }
103
+ return acquireLock(path, depth + 1);
104
+ }
105
+ export function lock(root, key) {
106
+ return acquireLock(join(root, 'leases', hash(key) + '.lock'));
107
+ }
@@ -0,0 +1,130 @@
1
+ import { spawn } from 'node:child_process';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { homedir } from 'node:os';
4
+ import { join } from 'node:path';
5
+ import { childEnvironment } from '../../resources/scripts/build-safety.mjs';
6
+ import { ID, fail } from './state.mjs';
7
+
8
+ export const PROVIDERS = { darwin: 'macos-keychain', win32: 'windows-credential-manager', linux: 'linux-secret-service' };
9
+ const fields = ['app-key', 'secret-key'];
10
+ export function targets(id) {
11
+ if (!ID.test(id || '')) fail('AUTH_PROFILE_INVALID');
12
+ return Object.fromEntries(fields.map(field => [field, `com.tuya.microapp.developer/${id}/${field}`]));
13
+ }
14
+ // Both streams stay in private pipes. Never include output, arguments or OS errors in failures.
15
+ export function runStore(command, args, { environment = process.env, input, timeout = 20_000 } = {}) {
16
+ return new Promise(resolve => {
17
+ // Secret Service must reach the user's session bus and unlock UI. These
18
+ // settings belong only to the OS helper, never project build subprocesses.
19
+ const helperEnvironment = childEnvironment(environment);
20
+ for (const key of ['DBUS_SESSION_BUS_ADDRESS', 'XDG_RUNTIME_DIR', 'DISPLAY', 'WAYLAND_DISPLAY', 'XAUTHORITY']) {
21
+ if (typeof environment[key] === 'string') helperEnvironment[key] = environment[key];
22
+ }
23
+ const child = spawn(command, args, { env: helperEnvironment, stdio: ['pipe', 'pipe', 'pipe'], windowsHide: true });
24
+ let bytes = 0, output = '', errorText = '', done = false;
25
+ const finish = result => { if (!done) { done = true; clearTimeout(timer); resolve(result); } };
26
+ const timer = setTimeout(() => { child.kill(); finish({ code: -1, timedOut: true }); }, timeout);
27
+ child.stdout.setEncoding('utf8');
28
+ child.stdout.on('data', data => {
29
+ bytes += Buffer.byteLength(data);
30
+ if (bytes > 16_384) { child.kill(); finish({ code: -1 }); }
31
+ else output += data;
32
+ });
33
+ child.stderr.setEncoding('utf8');
34
+ child.stderr.on('data', data => { errorText = (errorText + data).slice(-4096); });
35
+ child.stdin.on('error', () => {});
36
+ child.on('error', () => finish({ code: -1 }));
37
+ child.on('close', code => finish({ code, output, errorText }));
38
+ child.stdin.end(input);
39
+ });
40
+ }
41
+ export function systemStore({ platform = process.platform, environment = process.env, run = runStore } = {}) {
42
+ const provider = PROVIDERS[platform];
43
+ const systemRoot = environment.SystemRoot || environment.SYSTEMROOT;
44
+ const powershell = systemRoot
45
+ ? `${systemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe` : 'powershell.exe';
46
+ const script = fileURLToPath(new URL('./windows-credentials.ps1', import.meta.url));
47
+ async function available() {
48
+ if (!provider) return false;
49
+ const result = platform === 'darwin'
50
+ ? await run('/usr/bin/security', ['help'], { environment })
51
+ : platform === 'win32'
52
+ ? await run(powershell, ['-NoProfile', '-NonInteractive', '-Command', 'exit 0'], { environment })
53
+ : await run('secret-tool', ['--help'], { environment });
54
+ return result.code === 0;
55
+ }
56
+ async function field(id, name, remove = false) {
57
+ const target = targets(id)[name];
58
+ let result;
59
+ if (platform === 'darwin') {
60
+ const helper = fileURLToPath(new URL('./macos-credentials.js', import.meta.url));
61
+ result = remove
62
+ ? await run('/usr/bin/security', ['delete-generic-password', '-s', target, '-a', 'tuya-microapp', join(homedir(), 'Library/Keychains/login.keychain-db')], { environment })
63
+ : await run('/usr/bin/osascript', ['-l', 'JavaScript', helper, 'read', target], { environment });
64
+ } else if (platform === 'win32') {
65
+ result = await run(powershell, ['-NoProfile', '-NonInteractive', '-File', script, remove ? 'delete' : 'read', target], { environment });
66
+ } else if (platform === 'linux') {
67
+ result = await run('secret-tool', [remove ? 'clear' : 'lookup', 'application', 'tuya-microapp', 'profile', id, 'field', name], { environment });
68
+ } else fail('AUTH_STORE_UNAVAILABLE');
69
+ if (result.code !== 0) {
70
+ if ((platform === 'darwin' && [3, 44].includes(result.code)) || (platform === 'win32' && result.code === 3)
71
+ || (platform === 'linux' && result.code === 1 && !result.errorText?.trim())) fail('AUTH_ENTRY_MISSING');
72
+ if (result.timedOut || (platform === 'darwin' && [4, 36, 128].includes(result.code))
73
+ || (platform === 'win32' && result.code === 4)
74
+ || (platform === 'linux' && /locked|denied|cancelled|dismissed/i.test(result.errorText || ''))) fail('AUTH_STORE_LOCKED');
75
+ fail('AUTH_STORE_UNAVAILABLE');
76
+ }
77
+ if (remove) return;
78
+ const value = platform === 'win32' ? result.output : result.output?.replace(/\r?\n$/, '');
79
+ if (typeof value !== 'string' || !value.trim() || /[\r\n\0]/.test(value)) fail('AUTH_CREDENTIALS_INCOMPLETE');
80
+ return value;
81
+ }
82
+ return {
83
+ provider: provider || 'unsupported', available,
84
+ async write(id, credentials) {
85
+ const values = { 'app-key': credentials.developerCode, 'secret-key': credentials.secret };
86
+ for (const name of fields) {
87
+ const value = values[name];
88
+ if (typeof value !== 'string' || !value.trim() || /[\r\n\0]/.test(value)
89
+ || Buffer.byteLength(value) > 4096 || Buffer.byteLength(value, 'utf16le') > 2560) fail('AUTH_CREDENTIALS_INCOMPLETE');
90
+ }
91
+ for (const name of fields) {
92
+ const target = targets(id)[name];
93
+ let result;
94
+ if (platform === 'darwin') {
95
+ const helper = fileURLToPath(new URL('./macos-credentials.js', import.meta.url));
96
+ result = await run('/usr/bin/osascript', ['-l', 'JavaScript', helper, 'write', target],
97
+ { environment, input: JSON.stringify(values[name]) });
98
+ } else if (platform === 'win32') {
99
+ result = await run(powershell, ['-NoProfile', '-NonInteractive', '-File', script, 'write', target],
100
+ { environment, input: JSON.stringify(values[name]) });
101
+ } else if (platform === 'linux') {
102
+ result = await run('secret-tool', ['store', '--label', 'Tuya microapp developer',
103
+ 'application', 'tuya-microapp', 'profile', id, 'field', name],
104
+ { environment, input: values[name] });
105
+ } else fail('AUTH_STORE_UNAVAILABLE');
106
+ if (result.code !== 0) {
107
+ if (result.timedOut || result.code === 4
108
+ || /locked|denied|cancelled|dismissed/i.test(result.errorText || '')) fail('AUTH_STORE_LOCKED');
109
+ fail('AUTH_STORE_WRITE_FAILED');
110
+ }
111
+ }
112
+ },
113
+ async read(id) { return { developerCode: await field(id, fields[0]), secret: await field(id, fields[1]) }; },
114
+ async remove(id) {
115
+ for (const name of fields) {
116
+ try { await field(id, name, true); } catch (error) { if (error.code !== 'AUTH_ENTRY_MISSING') throw error; }
117
+ }
118
+ },
119
+ instructions(id) {
120
+ const entries = fields.map(name => ({ field: name === 'app-key' ? 'App Key' : 'Secret Key', target: targets(id)[name], account: 'tuya-microapp' }));
121
+ return { provider: provider || 'unsupported', entries, steps: platform === 'darwin'
122
+ ? ['Open Keychain Access and select the login keychain.', 'Create two generic password items using the exact supplied targets and account tuya-microapp. Enter each field value in its password box yourself.']
123
+ : platform === 'win32'
124
+ ? ['Open Credential Manager, Windows Credentials, Add a generic credential.', 'Create two entries using the supplied targets, username tuya-microapp, and enter each field value in its password box yourself.']
125
+ : ['Use secret-tool store in your own interactive terminal for each field; it prompts without echo. Never put values in command arguments.'],
126
+ ...(platform === 'linux' ? { userCommands: fields.map(name => ({ executable: 'secret-tool', args: ['store', '--label', targets(id)[name], 'application', 'tuya-microapp', 'profile', id, 'field', name] })) } : {}),
127
+ };
128
+ },
129
+ };
130
+ }
@@ -0,0 +1,73 @@
1
+ param([ValidateSet('read','delete','write')][string]$Operation, [string]$Target)
2
+ $ErrorActionPreference = 'Stop'
3
+ if ($Target -notmatch '^com\.tuya\.microapp\.developer/[0-9a-fA-F-]{36}/(app-key|secret-key)$') { exit 5 }
4
+ try {
5
+ Add-Type -TypeDefinition @'
6
+ using System;
7
+ using System.Runtime.InteropServices;
8
+ public static class MicroappCredentialApi {
9
+ [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
10
+ public struct Credential {
11
+ public UInt32 Flags; public UInt32 Type; public IntPtr TargetName; public IntPtr Comment;
12
+ public System.Runtime.InteropServices.ComTypes.FILETIME LastWritten;
13
+ public UInt32 CredentialBlobSize; public IntPtr CredentialBlob; public UInt32 Persist;
14
+ public UInt32 AttributeCount; public IntPtr Attributes; public IntPtr TargetAlias; public IntPtr UserName;
15
+ }
16
+ [DllImport("advapi32.dll", EntryPoint="CredReadW", CharSet=CharSet.Unicode, SetLastError=true)]
17
+ public static extern bool Read(string target, UInt32 type, UInt32 flags, out IntPtr credential);
18
+ [DllImport("advapi32.dll", EntryPoint="CredDeleteW", CharSet=CharSet.Unicode, SetLastError=true)]
19
+ public static extern bool Delete(string target, UInt32 type, UInt32 flags);
20
+ [DllImport("advapi32.dll", EntryPoint="CredWriteW", CharSet=CharSet.Unicode, SetLastError=true)]
21
+ public static extern bool Write(ref Credential credential, UInt32 flags);
22
+ [DllImport("advapi32.dll")] public static extern void CredFree(IntPtr buffer);
23
+ }
24
+ '@
25
+ if ($Operation -eq 'write') {
26
+ [Console]::InputEncoding = New-Object System.Text.UTF8Encoding($false)
27
+ $value = [Console]::In.ReadToEnd() | ConvertFrom-Json
28
+ if ($value -isnot [string] -or [string]::IsNullOrWhiteSpace($value) -or $value -match "[\r\n\x00]") { exit 5 }
29
+ $bytes = [Text.Encoding]::Unicode.GetBytes($value)
30
+ if ($bytes.Length -gt 2560) { exit 5 }
31
+ $credential = New-Object MicroappCredentialApi+Credential
32
+ try {
33
+ $credential.Type = 1
34
+ $credential.TargetName = [Runtime.InteropServices.Marshal]::StringToCoTaskMemUni($Target)
35
+ $credential.UserName = [Runtime.InteropServices.Marshal]::StringToCoTaskMemUni('tuya-microapp')
36
+ $credential.Persist = 2
37
+ $credential.CredentialBlobSize = $bytes.Length
38
+ $credential.CredentialBlob = [Runtime.InteropServices.Marshal]::AllocCoTaskMem($bytes.Length)
39
+ [Runtime.InteropServices.Marshal]::Copy($bytes, 0, $credential.CredentialBlob, $bytes.Length)
40
+ if (-not [MicroappCredentialApi]::Write([ref]$credential, 0)) { exit 4 }
41
+ } finally {
42
+ if ($credential.CredentialBlob -ne [IntPtr]::Zero) {
43
+ for ($i = 0; $i -lt $bytes.Length; $i++) { [Runtime.InteropServices.Marshal]::WriteByte($credential.CredentialBlob, $i, 0) }
44
+ [Runtime.InteropServices.Marshal]::FreeCoTaskMem($credential.CredentialBlob)
45
+ }
46
+ if ($credential.TargetName -ne [IntPtr]::Zero) { [Runtime.InteropServices.Marshal]::FreeCoTaskMem($credential.TargetName) }
47
+ if ($credential.UserName -ne [IntPtr]::Zero) { [Runtime.InteropServices.Marshal]::FreeCoTaskMem($credential.UserName) }
48
+ [Array]::Clear($bytes, 0, $bytes.Length)
49
+ }
50
+ exit 0
51
+ }
52
+ if ($Operation -eq 'delete') {
53
+ if (-not [MicroappCredentialApi]::Delete($Target, 1, 0)) {
54
+ if ([Runtime.InteropServices.Marshal]::GetLastWin32Error() -eq 1168) { exit 3 }
55
+ exit 4
56
+ }
57
+ exit 0
58
+ }
59
+ $pointer = [IntPtr]::Zero
60
+ if (-not [MicroappCredentialApi]::Read($Target, 1, 0, [ref]$pointer)) {
61
+ if ([Runtime.InteropServices.Marshal]::GetLastWin32Error() -eq 1168) { exit 3 }
62
+ exit 4
63
+ }
64
+ try {
65
+ $credential = [Runtime.InteropServices.Marshal]::PtrToStructure($pointer, [type][MicroappCredentialApi+Credential])
66
+ if ($credential.CredentialBlobSize -gt 8192 -or $credential.CredentialBlobSize % 2 -ne 0) { exit 5 }
67
+ $bytes = New-Object byte[] $credential.CredentialBlobSize
68
+ [Runtime.InteropServices.Marshal]::Copy($credential.CredentialBlob, $bytes, 0, $bytes.Length)
69
+ [Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false)
70
+ [Console]::Write([Text.Encoding]::Unicode.GetString($bytes))
71
+ [Array]::Clear($bytes, 0, $bytes.Length)
72
+ } finally { [MicroappCredentialApi]::CredFree($pointer) }
73
+ } catch { exit 5 }
@@ -0,0 +1,224 @@
1
+ import { resolveWorkspaceTarget, targetEnvironment, assertTarget } from '../workspace.mjs';
2
+ import { readdirSync, rmSync } from 'node:fs';
3
+ import { join } from 'node:path';
4
+ import { randomUUID } from 'node:crypto';
5
+ import { fileURLToPath } from 'node:url';
6
+ import { hiddenInput } from './hidden-input.mjs';
7
+ import { endpointFor } from './manager.mjs';
8
+ import { layout, initialize, profilePath, readState, writeState, hash, fail, lock } from './state.mjs';
9
+ import { safeCliError } from '../errors.mjs';
10
+
11
+ const pendingPath = context => join(context.root, 'pending', hash(context.project) + '.json');
12
+ const workerPath = context => join(context.root, 'leases', hash('credential-input:' + context.project) + '.json');
13
+ function labelFor(value) {
14
+ const label = value ?? 'Developer account';
15
+ if (typeof label !== 'string' || !label.trim() || label.length > 64 || /[\x00-\x1f\x7f]/.test(label)) fail('AUTH_LABEL_INVALID');
16
+ return label.trim();
17
+ }
18
+ function profile(context, id) {
19
+ const value = readState(profilePath(context.root, id));
20
+ if (value?.format !== 'microapp-auth-profile-v1' || value.id !== id
21
+ || !/^[a-f0-9]{64}$/.test(value.accountFingerprint || '')) fail('AUTH_PROFILE_MISSING');
22
+ endpointFor({ SDF_ENDPOINT: value.endpoint });
23
+ return value;
24
+ }
25
+ function pending(context, id) {
26
+ const value = readState(pendingPath(context));
27
+ if (!value || value.profileRef !== id || value.format !== 'microapp-auth-pending-v1') fail('AUTH_SETUP_CHANGED');
28
+ profilePath(context.root, id);
29
+ endpointFor({ SDF_ENDPOINT: value.endpoint });
30
+ return value;
31
+ }
32
+ export function assertNoCredentialWorker(context) {
33
+ const worker = readState(workerPath(context));
34
+ if (!worker) return;
35
+ if (!Number.isInteger(worker.pid) || worker.pid < 1) fail('AUTH_STATE_INVALID');
36
+ try { process.kill(worker.pid, 0); }
37
+ catch (error) {
38
+ if (error.code === 'ESRCH') { rmSync(workerPath(context)); return; }
39
+ fail('AUTH_BUSY');
40
+ }
41
+ fail('AUTH_BUSY');
42
+ }
43
+ function publicProfile(value) {
44
+ return { profileRef: value.id, label: value.label || 'Developer account', endpoint: value.endpoint,
45
+ provider: value.provider, checkedAt: value.checkedAt, serverVerification: 'unknown' };
46
+ }
47
+ export function configureWizard(context, { environment, store, label, current }) {
48
+ assertNoCredentialWorker(context);
49
+ let existing = readState(pendingPath(context));
50
+ if (existing && existing.profileRef === current?.profileRef) {
51
+ // Recover a commit that completed before pending-file cleanup.
52
+ profile(context, current.profileRef);
53
+ rmSync(pendingPath(context));
54
+ existing = undefined;
55
+ }
56
+ const selected = current ? profile(context, current.profileRef) : undefined;
57
+ const endpoint = selected?.endpoint || endpointFor(environment);
58
+ if ((environment.SDF_ENDPOINT !== undefined || environment.SDF_API_ORIGIN !== undefined)
59
+ && endpointFor(environment) !== endpoint) fail('AUTH_ENDPOINT_CONFLICT');
60
+ // Repeated configure reuses a pending attempt. A configured account rotates to a fresh profile.
61
+ const id = existing?.profileRef || randomUUID();
62
+ profilePath(context.root, id);
63
+ if (existing && (existing.endpoint !== endpoint || existing.provider !== store.provider)) fail('AUTH_ENDPOINT_CONFLICT');
64
+ const value = { format: 'microapp-auth-pending-v1', profileRef: id, provider: store.provider,
65
+ endpoint, label: labelFor(label ?? existing?.label ?? selected?.label),
66
+ previousProfileRef: current?.profileRef || null, status: existing?.status || 'awaiting_input' };
67
+ writeState(pendingPath(context), value);
68
+ const userCommand = { executable: process.execPath, args: [fileURLToPath(new URL('../../cli.mjs', import.meta.url)),
69
+ 'auth', 'setup', '--project', context.project, '--profile', id, '--state-root', context.root, '--workspace-root', context.workspaceRoot] };
70
+ const words = [userCommand.executable, ...userCommand.args];
71
+ userCommand.shell = process.platform === 'win32' ? 'powershell' : 'sh';
72
+ userCommand.command = process.platform === 'win32'
73
+ ? '& ' + words.map(word => "'" + word.replaceAll("'", "''") + "'").join(' ')
74
+ : words.map(word => "'" + word.replaceAll("'", "'\"'\"'") + "'").join(' ');
75
+ return { operation: 'auth.configure', status: 'needs-user-action', authState: 'setup_required',
76
+ profileRef: id, label: value.label, endpoint, provider: store.provider,
77
+ userCommand,
78
+ manualFallback: store.instructions(id),
79
+ priority: ['system', 'session'],
80
+ nextActions: ['Give the user only the correctly shell-quoted userCommand to run in their own terminal. It hides input and saves to the OS store. Do not run an input-recording terminal or ask for keys in chat.',
81
+ 'Wait with auth wait --profile <returned profileRef>, or poll auth status. Continue the original publication only after this profile is configured; local readback is not server verification.'],
82
+ };
83
+ }
84
+ async function readVerified(store, value) {
85
+ if (value.provider !== store.provider) fail('AUTH_STORE_UNAVAILABLE');
86
+ const credentials = await store.read(value.id);
87
+ if (typeof credentials.developerCode !== 'string' || !credentials.developerCode.trim()
88
+ || typeof credentials.secret !== 'string' || !credentials.secret.trim()) fail('AUTH_CREDENTIALS_INCOMPLETE');
89
+ if (hash(value.endpoint + '\0' + credentials.developerCode) !== value.accountFingerprint) fail('AUTH_ACCOUNT_CHANGED');
90
+ return credentials;
91
+ }
92
+ export async function wizardOperation(action, options) {
93
+ let { project, stateRoot, environment = process.env, store, profileRef, input = hiddenInput,
94
+ output = process.stderr, timeoutSeconds = 30, workspaceRoot } = options;
95
+ const target = resolveWorkspaceTarget({ project, stateRoot, workspaceRoot, environment });
96
+ environment = targetEnvironment(environment, target);
97
+ const context = { ...layout(project, { stateRoot, environment }), workspaceRoot: target.workspaceRoot };
98
+ initialize(context.root);
99
+ const binding = () => readState(context.binding);
100
+ if (action === 'profiles') {
101
+ const current = binding();
102
+ const endpoint = current ? profile(context, current.profileRef).endpoint : endpointFor(environment);
103
+ assertTarget(target, { endpoint });
104
+ if ((environment.SDF_ENDPOINT !== undefined || environment.SDF_API_ORIGIN !== undefined)
105
+ && endpointFor(environment) !== endpoint) fail('AUTH_ENDPOINT_CONFLICT');
106
+ const pendingIds = new Set(readdirSync(join(context.root, 'pending')).filter(name => name.endsWith('.json'))
107
+ .map(name => readState(join(context.root, 'pending', name))?.profileRef));
108
+ const profiles = readdirSync(join(context.root, 'profiles')).filter(name => name.endsWith('.json'))
109
+ .map(name => profile(context, name.slice(0, -5)))
110
+ .filter(value => value.endpoint === endpoint && value.provider === store.provider && !pendingIds.has(value.id))
111
+ .map(value => ({ ...publicProfile(value), selected: current?.profileRef === value.id }));
112
+ return { operation: 'auth.profiles', status: 'complete', endpoint, profiles,
113
+ credentialPurpose: 'Tuya Smart Space application development credentials',
114
+ nextActions: [
115
+ 'Reuse the current project binding unless the user requests a change; finish any pending setup first. Do not ask again merely because other profiles exist.',
116
+ 'For a new binding, explain that these credentials register and upload micro apps to Tuya Smart Space. Ask the user to confirm a recognizable account label before auth use.',
117
+ 'Labels may repeat. checkedAt is only a local read check, not server authentication or proof of ownership. Never recommend a profile by date or infer its owner from the label.',
118
+ 'If the user cannot identify a profile, offer auth configure with a recognizable organization/account-purpose label. Retain old profiles; never merge by label or change the identity of an existing publication.',
119
+ 'Display only returned metadata. Do not invent account ownership, App Key suffixes or associated projects, and never read secrets to build a chooser.',
120
+ ] };
121
+
122
+ }
123
+ if (action === 'wait') {
124
+ profilePath(context.root, profileRef);
125
+ const seconds = Number(timeoutSeconds);
126
+ if (!Number.isInteger(seconds) || seconds < 0 || seconds > 60) fail('AUTH_WAIT_INVALID');
127
+ const deadline = Date.now() + seconds * 1000;
128
+ do {
129
+ const current = binding();
130
+ if (current?.profileRef === profileRef) {
131
+ const value = profile(context, profileRef);
132
+ assertTarget(target, value);
133
+ await readVerified(store, value);
134
+ return { operation: 'auth.wait', status: 'complete', authState: 'configured', ...publicProfile(value) };
135
+ }
136
+ const value = pending(context, profileRef);
137
+ assertTarget(target, value);
138
+ if (value.status === 'failed') return { operation: 'auth.wait', status: 'needs-user-action',
139
+ authState: 'setup_required', profileRef, ...safeCliError({ code: value.errorCode }) };
140
+ if (Date.now() >= deadline) break;
141
+ await new Promise(resolve => setTimeout(resolve, Math.min(500, deadline - Date.now())));
142
+ } while (true);
143
+ return { operation: 'auth.wait', status: 'needs-user-action', authState: 'awaiting_input', profileRef,
144
+ nextActions: ['The user has not finished configuring this profile. Keep the same command and wait again; do not publish with the previous binding.'] };
145
+ }
146
+ if (action === 'use') {
147
+ const unlock = lock(context.root, 'binding:' + context.project);
148
+ try {
149
+ assertNoCredentialWorker(context);
150
+ profilePath(context.root, profileRef);
151
+ const releaseProfile = lock(context.root, 'profile:' + profileRef);
152
+ try {
153
+ if (readdirSync(join(context.root, 'pending')).filter(name => name.endsWith('.json'))
154
+ .some(name => readState(join(context.root, 'pending', name))?.profileRef === profileRef)) fail('AUTH_SETUP_CHANGED');
155
+ const value = profile(context, profileRef), current = binding();
156
+ const endpoint = current ? profile(context, current.profileRef).endpoint : endpointFor(environment);
157
+ assertTarget(target, { endpoint });
158
+ if (value.endpoint !== endpoint || ((environment.SDF_ENDPOINT !== undefined || environment.SDF_API_ORIGIN !== undefined)
159
+ && endpointFor(environment) !== endpoint)) fail('AUTH_ENDPOINT_CONFLICT');
160
+ await readVerified(store, value);
161
+ writeState(context.binding, { format: 'microapp-auth-binding-v1', profileRef });
162
+ rmSync(pendingPath(context), { force: true });
163
+ return { operation: 'auth.use', status: 'complete', authState: 'configured', ...publicProfile(value) };
164
+ } finally { releaseProfile(); }
165
+ } finally { unlock(); }
166
+ }
167
+ if (action !== 'setup') fail('INVALID_OPERATION');
168
+ // No secret can be supplied via CLI options or stdin pipes; only the private interactive prompt.
169
+ if (input === hiddenInput && (!process.stdin.isTTY || !output.isTTY)) fail('AUTH_USER_TERMINAL_REQUIRED');
170
+ const token = randomUUID();
171
+ let settings;
172
+ let unlock = lock(context.root, 'binding:' + context.project);
173
+ try {
174
+ assertNoCredentialWorker(context);
175
+ settings = pending(context, profileRef);
176
+ if (settings.provider !== store.provider) fail('AUTH_STORE_UNAVAILABLE');
177
+ if ((environment.SDF_ENDPOINT !== undefined || environment.SDF_API_ORIGIN !== undefined)
178
+ && endpointFor(environment) !== settings.endpoint) fail('AUTH_ENDPOINT_CONFLICT');
179
+ if (profileRef === binding()?.profileRef) fail('AUTH_SETUP_CHANGED');
180
+ writeState(workerPath(context), { pid: process.pid, token });
181
+ writeState(pendingPath(context), { ...settings, status: 'entering' });
182
+ } finally { unlock(); }
183
+ let credentials;
184
+ let wrote = false;
185
+ try {
186
+ if (!await store.available()) fail('AUTH_STORE_UNAVAILABLE');
187
+ output.write(`Configure Tuya Smart Space application development credentials\nTarget service: ${settings.endpoint}\nCredential store: ${settings.provider}\nAccount label: ${settings.label || 'Developer account'}\n`);
188
+ credentials = { developerCode: await input('App Key'), secret: await input('Secret Key') };
189
+ // A crashed/failed attempt may have partial entries. Only this unbound staging profile is replaced.
190
+ await store.remove(profileRef);
191
+ wrote = true;
192
+ await store.write(profileRef, credentials);
193
+ const readback = await store.read(profileRef);
194
+ if (readback.developerCode !== credentials.developerCode || readback.secret !== credentials.secret) fail('AUTH_WRITE_VERIFICATION_FAILED');
195
+ unlock = lock(context.root, 'binding:' + context.project);
196
+ try {
197
+ const latest = pending(context, profileRef);
198
+ if (latest.previousProfileRef !== (binding()?.profileRef || null)) fail('AUTH_SETUP_CHANGED');
199
+ const value = { format: 'microapp-auth-profile-v1', id: profileRef, provider: store.provider,
200
+ endpoint: settings.endpoint, label: settings.label, checkedAt: new Date().toISOString(),
201
+ accountFingerprint: hash(settings.endpoint + '\0' + credentials.developerCode) };
202
+ writeState(profilePath(context.root, profileRef), value);
203
+ writeState(context.binding, { format: 'microapp-auth-binding-v1', profileRef });
204
+ // Once binding is committed this profile must never be removed by failure cleanup.
205
+ wrote = false;
206
+ rmSync(pendingPath(context), { force: true });
207
+ output.write('Credentials saved; readback check passed. Platform authentication has not been verified.\nReturn to the Agent to continue the original publication task.\n');
208
+ return { operation: 'auth.setup', status: 'complete', authState: 'configured', ...publicProfile(value) };
209
+ } finally { unlock(); }
210
+ } catch (error) {
211
+ if (wrote && binding()?.profileRef !== profileRef) {
212
+ try { await store.remove(profileRef); } catch { /* Retain staging metadata for a safe retry. */ }
213
+ }
214
+ unlock = lock(context.root, 'binding:' + context.project);
215
+ try {
216
+ const latest = readState(pendingPath(context));
217
+ if (latest?.profileRef === profileRef) writeState(pendingPath(context), { ...latest, status: 'failed', errorCode: safeCliError(error).errorCode });
218
+ } finally { unlock(); }
219
+ throw error;
220
+ } finally {
221
+ credentials = undefined;
222
+ if (readState(workerPath(context))?.token === token) rmSync(workerPath(context), { force: true });
223
+ }
224
+ }