@tuya-sat/microapp-kit 0.0.0-stage → 0.1.26-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUDIT.md +43 -0
- package/CHANGELOG.md +53 -0
- package/MAINTAINING.md +178 -0
- package/README.md +53 -2
- package/START-HERE.md +44 -0
- package/bootstrap/build-install-page.mjs +46 -0
- package/bootstrap/install-node.ps1 +80 -0
- package/bootstrap/install-node.sh +94 -0
- package/bootstrap/install.md.in +29 -0
- package/bundle.json +852 -0
- package/cli.mjs +3 -0
- package/package.json +68 -4
- package/resources/contracts/project-permissions.json +596 -0
- package/resources/contracts/standard-api.catalog.json +5 -0
- package/resources/examples/group-display.mjs +23 -0
- package/resources/preview/README.md +104 -0
- package/resources/preview/agent-open.mjs +1221 -0
- package/resources/preview/application-icon.mjs +27 -0
- package/resources/preview/authorization-panel.js +243 -0
- package/resources/preview/authorization-routes.mjs +634 -0
- package/resources/preview/authorization.mjs +353 -0
- package/resources/preview/backend-entry.mjs +22 -0
- package/resources/preview/backend-process.mjs +26 -0
- package/resources/preview/bridge.js +50 -0
- package/resources/preview/control.mjs +48 -0
- package/resources/preview/device-fixtures.mjs +38 -0
- package/resources/preview/fixtures/context.json +10 -0
- package/resources/preview/fixtures/device-catalog.json +363 -0
- package/resources/preview/host-contract.mjs +104 -0
- package/resources/preview/host.js +841 -0
- package/resources/preview/local-dev-provider.mjs +27 -0
- package/resources/preview/menu-icons.json +82 -0
- package/resources/preview/mock-store.mjs +1147 -0
- package/resources/preview/run.mjs +131 -0
- package/resources/preview/server.mjs +476 -0
- package/resources/preview/theme-tokens.mjs +49 -0
- package/resources/preview/themes.json +1036 -0
- package/resources/resource-manifest.json +210 -0
- package/resources/scripts/backend-build-context.mjs +101 -0
- package/resources/scripts/backend-runtime.mjs +68 -0
- package/resources/scripts/build-backend-image.sh +23 -0
- package/resources/scripts/build-safety.mjs +18 -0
- package/resources/scripts/build.mjs +138 -0
- package/resources/scripts/command-invocation.mjs +10 -0
- package/resources/scripts/diagnostics.mjs +34 -0
- package/resources/scripts/init-project.mjs +62 -0
- package/resources/scripts/package-release.mjs +80 -0
- package/resources/scripts/prepare-locales.mjs +77 -0
- package/resources/scripts/project-identity.mjs +21 -0
- package/resources/scripts/registry-client.mjs +189 -0
- package/resources/scripts/resource-files.mjs +22 -0
- package/resources/scripts/scaffold.mjs +31 -0
- package/resources/scripts/test-backend-image.mjs +162 -0
- package/resources/scripts/update-preview-themes.mjs +26 -0
- package/resources/scripts/update-resource-manifest.mjs +9 -0
- package/resources/scripts/validate-resources.mjs +9 -0
- package/resources/template/_gitignore +5 -0
- package/resources/template/backend/.dockerignore +7 -0
- package/resources/template/backend/.node-version +1 -0
- package/resources/template/backend/Dockerfile +62 -0
- package/resources/template/backend/deploy/README.md +105 -0
- package/resources/template/backend/deploy/data/README.md +3 -0
- package/resources/template/backend/deploy/manifest.json +4 -0
- package/resources/template/backend/deploy/tasks/README.md +3 -0
- package/resources/template/backend/migrations/README.md +5 -0
- package/resources/template/backend/next-env.d.ts +6 -0
- package/resources/template/backend/next.config.ts +19 -0
- package/resources/template/backend/operations.json +4 -0
- package/resources/template/backend/package.json +35 -0
- package/resources/template/backend/pnpm-lock.yaml +775 -0
- package/resources/template/backend/preview-contract.json +4 -0
- package/resources/template/backend/public/.keep +0 -0
- package/resources/template/backend/scripts/check-runtime.mjs +12 -0
- package/resources/template/backend/scripts/dev-deploy-prepare.mjs +362 -0
- package/resources/template/backend/scripts/dev-diagnose-database.mjs +199 -0
- package/resources/template/backend/scripts/dev-start-backend.sh +30 -0
- package/resources/template/backend/src/app/[[...path]]/route.ts +11 -0
- package/resources/template/backend/src/app/api/[...path]/route.ts +11 -0
- package/resources/template/backend/src/app/api/health/route.ts +16 -0
- package/resources/template/backend/src/app/api/preview/context/route.ts +36 -0
- package/resources/template/backend/src/instrumentation.ts +10 -0
- package/resources/template/backend/src/lib/api-response.mjs +119 -0
- package/resources/template/backend/src/lib/business-logger.mjs +29 -0
- package/resources/template/backend/src/lib/database-errors.mjs +15 -0
- package/resources/template/backend/src/lib/dev-authorization.mjs +84 -0
- package/resources/template/backend/src/lib/dev-context.mjs +58 -0
- package/resources/template/backend/src/lib/gateway-ingress.mjs +79 -0
- package/resources/template/backend/src/lib/gateway-nonce-store.mjs +31 -0
- package/resources/template/backend/src/lib/gateway-verification.mjs +197 -0
- package/resources/template/backend/src/lib/request-observability.mjs +93 -0
- package/resources/template/backend/src/lib/standard-api.ts +28 -0
- package/resources/template/backend/src/microapp-identity.json +1 -0
- package/resources/template/backend/src/proxy.ts +40 -0
- package/resources/template/backend/tests/api-response.test.mjs +77 -0
- package/resources/template/backend/tests/database-diagnostics.test.mjs +198 -0
- package/resources/template/backend/tests/deployment-connection.test.mjs +100 -0
- package/resources/template/backend/tests/deployment-postgres.test.mjs +109 -0
- package/resources/template/backend/tests/deployment.test.mjs +196 -0
- package/resources/template/backend/tests/dev-authorization.test.mjs +88 -0
- package/resources/template/backend/tests/dev-context.test.mjs +35 -0
- package/resources/template/backend/tests/gateway-verification.test.mjs +287 -0
- package/resources/template/backend/tests/request-observability.test.mjs +125 -0
- package/resources/template/backend/tests/routes.test.mjs +253 -0
- package/resources/template/backend/tests/startup.test.mjs +147 -0
- package/resources/template/backend/tsconfig.json +34 -0
- package/resources/template/micro-app/.editorconfig +15 -0
- package/resources/template/micro-app/.eslintrc +15 -0
- package/resources/template/micro-app/.prettierignore +4 -0
- package/resources/template/micro-app/.prettierrc +6 -0
- package/resources/template/micro-app/_gitignore +6 -0
- package/resources/template/micro-app/_locales/en.json +5 -0
- package/resources/template/micro-app/_locales/zh-CN.json +5 -0
- package/resources/template/micro-app/antd.less.overwrite.js +4 -0
- package/resources/template/micro-app/babel.config.json +3 -0
- package/resources/template/micro-app/manifest.json +46 -0
- package/resources/template/micro-app/micro.config.js +4 -0
- package/resources/template/micro-app/mock/index.json +4 -0
- package/resources/template/micro-app/package.json +61 -0
- package/resources/template/micro-app/public/favicon.ico +0 -0
- package/resources/template/micro-app/public/index.ejs +13 -0
- package/resources/template/micro-app/src/App.less +0 -0
- package/resources/template/micro-app/src/App.tsx +99 -0
- package/resources/template/micro-app/src/api/api-request.mjs +85 -0
- package/resources/template/micro-app/src/api/custom-api-headers.mjs +55 -0
- package/resources/template/micro-app/src/api/custom-api.ts +10 -0
- package/resources/template/micro-app/src/api/errors.mjs +108 -0
- package/resources/template/micro-app/src/api/index.ts +34 -0
- package/resources/template/micro-app/src/api/presentation.mjs +33 -0
- package/resources/template/micro-app/src/api/req.ts +9 -0
- package/resources/template/micro-app/src/api/request-url.mjs +20 -0
- package/resources/template/micro-app/src/api/res.ts +9 -0
- package/resources/template/micro-app/src/api/submission-errors.mjs +84 -0
- package/resources/template/micro-app/src/components/CapsuleFilters/index.module.less +121 -0
- package/resources/template/micro-app/src/components/CapsuleFilters/index.tsx +100 -0
- package/resources/template/micro-app/src/components/MicroAppUI/DataTable.tsx +48 -0
- package/resources/template/micro-app/src/components/MicroAppUI/EllipsisText.tsx +25 -0
- package/resources/template/micro-app/src/components/MicroAppUI/Layouts.tsx +54 -0
- package/resources/template/micro-app/src/components/MicroAppUI/ModalForm.tsx +230 -0
- package/resources/template/micro-app/src/components/MicroAppUI/StatusBadge.tsx +19 -0
- package/resources/template/micro-app/src/components/MicroAppUI/index.module.less +99 -0
- package/resources/template/micro-app/src/components/MicroAppUI/index.ts +13 -0
- package/resources/template/micro-app/src/index.css +16 -0
- package/resources/template/micro-app/src/index.tsx +66 -0
- package/resources/template/micro-app/src/interfaces.ts +545 -0
- package/resources/template/micro-app/src/lang/en.ts +1 -0
- package/resources/template/micro-app/src/lang/index.ts +31 -0
- package/resources/template/micro-app/src/lang/zh.ts +1 -0
- package/resources/template/micro-app/src/language-codes.mjs +32 -0
- package/resources/template/micro-app/src/language-policy.ts +6 -0
- package/resources/template/micro-app/src/microapp-identity.json +1 -0
- package/resources/template/micro-app/src/pages/index.module.less +3 -0
- package/resources/template/micro-app/src/pages/index.tsx +6 -0
- package/resources/template/micro-app/src/public-path.js +4 -0
- package/resources/template/micro-app/src/utils/antdLang.ts +244 -0
- package/resources/template/micro-app/tests/template.test.cjs +15 -0
- package/resources/template/micro-app/tsconfig.extend.json +8 -0
- package/resources/template/micro-app/tsconfig.json +24 -0
- package/resources/template/micro-app/typings.d.ts +19 -0
- package/resources/template/micro-app/yarn.lock +7491 -0
- package/resources/tests/agent-open-catalog.test.mjs +43 -0
- package/resources/tests/agent-open-preview.test.mjs +878 -0
- package/resources/tests/api-request.test.mjs +121 -0
- package/resources/tests/api-response.test.mjs +2 -0
- package/resources/tests/application-icon-build.test.mjs +34 -0
- package/resources/tests/authorization-proxy.test.mjs +202 -0
- package/resources/tests/authorization.test.mjs +462 -0
- package/resources/tests/backend-context.test.mjs +33 -0
- package/resources/tests/backend-preview.test.mjs +67 -0
- package/resources/tests/backend-request-logging.test.mjs +2 -0
- package/resources/tests/backend-runtime.test.mjs +96 -0
- package/resources/tests/browser-authorization-smoke.mjs +111 -0
- package/resources/tests/browser-design-smoke.mjs +107 -0
- package/resources/tests/browser-language-compat-smoke.mjs +48 -0
- package/resources/tests/browser-preview-smoke.mjs +148 -0
- package/resources/tests/browser-standard-ui-smoke.mjs +331 -0
- package/resources/tests/build-safety.test.mjs +69 -0
- package/resources/tests/business-build.test.mjs +86 -0
- package/resources/tests/command-invocation.test.mjs +35 -0
- package/resources/tests/custom-api-headers.test.mjs +96 -0
- package/resources/tests/custom-route.test.mjs +63 -0
- package/resources/tests/custom-script-policy.test.mjs +34 -0
- package/resources/tests/database-errors.test.mjs +81 -0
- package/resources/tests/deployment-package.test.mjs +45 -0
- package/resources/tests/dockerfile-logging.test.mjs +31 -0
- package/resources/tests/fixtures/capsule-page.tsx +46 -0
- package/resources/tests/fixtures/standard-ui-page.tsx +222 -0
- package/resources/tests/group-display.test.mjs +28 -0
- package/resources/tests/host-contract.test.mjs +84 -0
- package/resources/tests/image-test.test.mjs +110 -0
- package/resources/tests/initialization.test.mjs +98 -0
- package/resources/tests/language-selection.test.mjs +188 -0
- package/resources/tests/locale-keys.test.mjs +88 -0
- package/resources/tests/preview-control.test.mjs +56 -0
- package/resources/tests/preview-icon.test.mjs +117 -0
- package/resources/tests/preview-state.test.mjs +183 -0
- package/resources/tests/preview-theme.test.mjs +17 -0
- package/resources/tests/real-preview-smoke.mjs +34 -0
- package/resources/tests/registry-client.test.mjs +272 -0
- package/resources/tests/request-errors.test.mjs +51 -0
- package/resources/tests/request-method-contract.test.mjs +65 -0
- package/resources/tests/resources.test.mjs +31 -0
- package/resources/tests/saas-presentation.test.mjs +41 -0
- package/resources/tests/sandbox-scripts.test.mjs +144 -0
- package/resources/tests/space-permission-guidance.test.mjs +78 -0
- package/resources/tests/standard-api-preview.test.mjs +55 -0
- package/resources/tests/submission-errors.test.mjs +118 -0
- package/resources/tests/version-description-package.test.mjs +60 -0
- package/resources/ui/component-sources.json +36 -0
- package/runtime/assemble.mjs +66 -0
- package/runtime/auth/hidden-input.mjs +45 -0
- package/runtime/auth/macos-credentials.js +41 -0
- package/runtime/auth/manager.mjs +145 -0
- package/runtime/auth/session.mjs +153 -0
- package/runtime/auth/state.mjs +107 -0
- package/runtime/auth/store.mjs +130 -0
- package/runtime/auth/windows-credentials.ps1 +73 -0
- package/runtime/auth/wizard.mjs +224 -0
- package/runtime/cli.mjs +474 -0
- package/runtime/dev-database.mjs +155 -0
- package/runtime/dev-provider.mjs +41 -0
- package/runtime/errors.mjs +205 -0
- package/runtime/install-receipt.mjs +68 -0
- package/runtime/installation.mjs +92 -0
- package/runtime/integrity.mjs +121 -0
- package/runtime/launcher.mjs +104 -0
- package/runtime/pack-npm.mjs +76 -0
- package/runtime/package-cache.mjs +52 -0
- package/runtime/package-identity.mjs +22 -0
- package/runtime/preview.mjs +157 -0
- package/runtime/project-identity.mjs +57 -0
- package/runtime/publication.mjs +372 -0
- package/runtime/release-content.mjs +159 -0
- package/runtime/release-index.mjs +91 -0
- package/runtime/setup.mjs +223 -0
- package/runtime/tests/agent-entry.test.mjs +79 -0
- package/runtime/tests/auth-wizard.test.mjs +241 -0
- package/runtime/tests/auth.test.mjs +367 -0
- package/runtime/tests/consistency-workflow.test.mjs +84 -0
- package/runtime/tests/dev-provider.test.mjs +27 -0
- package/runtime/tests/diagnostics.test.mjs +66 -0
- package/runtime/tests/helpers/tar-fixture.mjs +25 -0
- package/runtime/tests/install-page.test.mjs +83 -0
- package/runtime/tests/install.test.mjs +432 -0
- package/runtime/tests/node-bootstrap.test.mjs +104 -0
- package/runtime/tests/npm-distribution.test.mjs +130 -0
- package/runtime/tests/npm-release-check.test.mjs +48 -0
- package/runtime/tests/package-cache.test.mjs +108 -0
- package/runtime/tests/package-migration.test.mjs +208 -0
- package/runtime/tests/preview-hosts.test.mjs +66 -0
- package/runtime/tests/preview.test.mjs +304 -0
- package/runtime/tests/project-identity.test.mjs +67 -0
- package/runtime/tests/publication.test.mjs +436 -0
- package/runtime/tests/release-recovery.test.mjs +417 -0
- package/runtime/tests/repository-source.test.mjs +69 -0
- package/runtime/tests/skill-set-update.test.mjs +169 -0
- package/runtime/tests/standalone.test.mjs +46 -0
- package/runtime/tests/update-check.test.mjs +165 -0
- package/runtime/tests/update.test.mjs +292 -0
- package/runtime/tests/workspace.test.mjs +156 -0
- package/runtime/update-check.mjs +160 -0
- package/runtime/update-state.mjs +83 -0
- package/runtime/update.mjs +292 -0
- package/runtime/verify-npm-release.mjs +43 -0
- package/runtime/workspace-migration.mjs +109 -0
- package/runtime/workspace.mjs +101 -0
- package/schemas/toolchain.schema.json +13 -0
- package/setup.mjs +3 -0
- package/skills/micro-app-backend-development/SKILL.md +64 -0
- package/skills/micro-app-backend-development/references/backend-security-workflow.md +77 -0
- package/skills/micro-app-backend-development/references/business-build-helpers.md +11 -0
- package/skills/micro-app-backend-development/references/business-logging.md +56 -0
- package/skills/micro-app-backend-development/references/database-constraints.md +81 -0
- package/skills/micro-app-backend-development/references/database-write-errors.md +29 -0
- package/skills/micro-app-backend-development/references/deployment-bundle.md +65 -0
- package/skills/micro-app-backend-development/references/dev-preview-context.md +23 -0
- package/skills/micro-app-backend-development/references/gateway-verification.md +43 -0
- package/skills/micro-app-backend-development/references/implementation.md +49 -0
- package/skills/micro-app-backend-development/references/local-database-preview.md +100 -0
- package/skills/micro-app-backend-development/references/production-authorization-readiness.md +60 -0
- package/skills/micro-app-backend-development/references/project-data-permissions.md +43 -0
- package/skills/micro-app-backend-development/references/runtime-resources-and-deployment.md +76 -0
- package/skills/micro-app-backend-development/scripts/microapp-kit.mjs +117 -0
- package/skills/micro-app-backend-development/tests/behavior-scenarios.md +62 -0
- package/skills/micro-app-cloud-integration/SKILL.md +92 -0
- package/skills/micro-app-cloud-integration/references/api-catalog.json +1315 -0
- package/skills/micro-app-cloud-integration/references/api-catalog.md +59 -0
- package/skills/micro-app-cloud-integration/references/api-device-control.md +67 -0
- package/skills/micro-app-cloud-integration/references/api-device.md +179 -0
- package/skills/micro-app-cloud-integration/references/api-group-ota.md +145 -0
- package/skills/micro-app-cloud-integration/references/api-linkage.md +3 -0
- package/skills/micro-app-cloud-integration/references/api-models.md +584 -0
- package/skills/micro-app-cloud-integration/references/api-project.md +121 -0
- package/skills/micro-app-cloud-integration/references/api-space-home.md +244 -0
- package/skills/micro-app-cloud-integration/references/backend-authorization.md +95 -0
- package/skills/micro-app-cloud-integration/references/calling-conventions.md +118 -0
- package/skills/micro-app-cloud-integration/references/preview-agent-open.md +46 -0
- package/skills/micro-app-cloud-integration/references/server-to-server-integration.md +13 -0
- package/skills/micro-app-cloud-integration/scripts/microapp-kit.mjs +117 -0
- package/skills/micro-app-cloud-integration/tests/behavior-scenarios.md +20 -0
- package/skills/micro-app-design/SKILL.md +99 -0
- package/skills/micro-app-design/agents/openai.yaml +6 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/README.md +22 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaCapsuleSearch.html +67 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaCardGrid.html +71 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaIcon.html +5 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaPageTitle.html +29 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaTopNavigation.html +55 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/components.schema.md +154 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/examples/dashboard.html +588 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/examples/dashboard.md +99 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/examples/table-page.html +477 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/examples/table-page.md +77 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/templates/base.html +878 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/accessibility/accessibility.md +39 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/TuyaCapsuleSearch.html +67 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/arrow-down.svg +3 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/calendar.svg +5 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/check.svg +3 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/checkbox-check.svg +3 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/clear.svg +4 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/search.svg +4 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/preview.html +3705 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/spec.md +78 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/card-grid/examples/TuyaCardGrid.html +71 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/card-grid/examples/assets/placeholder.svg +4 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/card-grid/examples/preview.html +711 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/card-grid/spec.md +93 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/cascader/spec.md +75 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/checkbox/spec.md +72 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/date-picker/spec.md +81 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/dropdown/spec.md +99 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/icon/examples/TuyaIcon.html +5 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/icon/spec.md +55 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/input/spec.md +84 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/modal/spec.md +178 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/page-title/examples/TuyaPageTitle.html +29 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/page-title/spec.md +67 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/pagination/spec.md +94 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/radio/spec.md +80 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/search-input/spec.md +101 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/select/spec.md +96 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/slider/spec.md +66 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/switch/spec.md +86 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/table/spec.md +116 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/time-picker/spec.md +75 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/tooltip/spec.md +70 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/top-navigation/examples/TuyaTopNavigation.html +55 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/top-navigation/spec.md +60 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/tree/examples/icons/check.svg +3 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/tree/examples/preview.html +974 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/tree/spec.md +118 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/upload/spec.md +86 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/demo-index.md +43 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/design-system.md +116 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/color.md +165 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/elevation.md +21 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/icon.md +78 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/layout.md +103 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/radius.md +22 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/spacing.md +29 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/typography.md +43 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/interaction/behavior.md +30 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/interaction/feedback.md +23 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/interaction/state.md +28 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/motion/motion.md +31 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/patterns/dashboard.md +34 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/patterns/data-page.md +30 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/patterns/form-page.md +36 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/patterns/monitoring.md +25 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/quality-checklist.md +71 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/registry.yaml +232 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/tokens.yaml +187 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/README.md +26 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states/README.md +13 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277/403.html +58 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277/404.html +58 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277/500.html +58 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203.md +159 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/README.md +23 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/arrow-down.svg +3 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/calendar.svg +5 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/check.svg +3 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/clear.svg +4 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/search.svg +4 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/sources/arrow-down-ref.png +0 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/sources/check-ref.png +0 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/sources/clear-ref.png +0 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/sources/search-ref.png +0 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/Excel.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/HD.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/PM.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/PPT.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/README.md +14 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/VOC.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/app/347/256/241/347/220/206.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/catalog.md +377 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/folder-closed.svg +3 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/license/347/256/241/347/220/206.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/sos-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/sos.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/word.svg +1 -0
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/270/212/344/274/240.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/221.svg +1 -0
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/272/345/203/217@2x.svg +1 -0
- 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
- 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
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/274/232/345/221/230@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/201/234/350/275/246@2x.svg +1 -0
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/206/260/347/256/261.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/206/267/346/260/264.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/210/267/346/274/206.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/214/226/345/220/210/347/211/251.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/214/226/345/255/246-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/214/226/345/255/246.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/215/240/346/257/224/345/233/276.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/215/267/345/256/227.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/215/267/345/260/272.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/217/221/345/215/241@2x.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/220/212/347/201/257.svg +1 -0
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/221/274/345/220/270/347/216/207.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/225/206/345/272/227@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/226/234/346/254/242@2x.svg +1 -0
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/234/260/345/233/276@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/234/260/351/223/201@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/237/272/345/233/240 DNA.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/237/272/345/233/240.svg +1 -0
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/244/247/350/204/221.svg +1 -0
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/260/272/345/255/220.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/260/272/345/257/270.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/267/264/345/243/253@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/270/203/345/261/200.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/272/212 /347/235/241/347/234/240.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/272/212.svg +1 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/274/200/351/227/250-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/274/200/351/227/250.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/275/225/345/203/217.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/276/252/347/216/257.svg +1 -0
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/277/203/347/216/207.svg +1 -0
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/200/245/346/225/221.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/210/277/351/227/264@2x.png +0 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/211/213/346/234/272.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/211/213/350/241/250.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/211/223/345/215/260/346/234/272.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/212/230/347/272/277/345/233/276.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/212/245/350/255/246.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/213/215/347/205/247.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/214/207/347/272/271@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/216/210/346/235/203.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/221/204/345/203/217/345/244/264.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/224/257/344/273/230@2x.svg +1 -0
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/243/347/202/271/345/233/276.svg +1 -0
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/260/346/215/256.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/260/346/215/256/346/272/220.svg +1 -0
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/345/255/227.svg +1 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/227/240/344/272/272/346/234/272.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/227/245/346/234/237@2x-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/227/245/346/234/237@2x.svg +1 -0
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/233/262/347/272/277/345/233/276.svg +1 -0
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/234/215/345/212/241/345/231/250.svg +1 -0
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/237/261/347/212/266/345/233/276.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/240/207/346/270/205.svg +1 -0
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/240/221/346/234/250.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/240/241/350/275/246@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/242/257/346/216/247.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/250/241/346/235/277.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/224/346/263/241/345/233/276.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/346/265/270.svg +1 -0
- 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
- 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
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/350/255/246.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/261/202/346/225/221.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/261/241/346/237/223.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/262/231/345/217/221.svg +1 -0
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/266/210/346/201/257@2x-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/266/210/346/201/257@2x-3.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/266/210/346/201/257@2x.svg +1 -0
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/270/251/345/272/246-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/270/251/345/272/246.svg +1 -0
- 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
- 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
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253/347/201/276.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253/350/255/246.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253/350/275/246@2x-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253/350/275/246@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/255/347/201/253/345/231/250.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/257.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/203/237/351/233/276-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/203/237/351/233/276.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/203/255/346/260/264.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/205/247/345/272/246.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/207/203/346/260/224.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/212/266/346/200/201.svg +1 -0
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/216/257/345/242/203.svg +1 -0
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/216/257/345/275/242/345/233/276.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/262/351/206/233.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265.svg +1 -0
- 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
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/350/264/271.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/351/222/273.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/351/243/216/346/211/207.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/273/346/235/277.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/233/221/346/265/213.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/233/270/346/234/272.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/235/241/347/234/240.svg +1 -0
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/246/273/347/272/277.svg +1 -0
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/251/272/350/260/203.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/251/272/351/227/264@2x.png +0 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/252/227/345/270/230.svg +1 -0
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/255/211/345/276/205@2x.svg +1 -0
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/274/226/350/276/221@2x.png +0 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/275/221/351/241/265.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/276/216/345/205/203@2x.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/200/263/346/234/272-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/200/263/346/234/272-3.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/200/263/346/234/272.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/203/275/345/212/233.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/212/202/350/203/275.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/212/257/347/211/207.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/241/200/346/260/247.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/247/204/350/214/203.md +264 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/247/206/351/242/221.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/247/206/351/242/221AI.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/247/206/351/242/221SD.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/242/345/215/225.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207-3.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207-4.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207-5.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207.svg +1 -0
- 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
- 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
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/347/275/256@2x.svg +1 -0
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/264/246/345/217/267@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/264/247/350/275/246@2x.svg +1 -0
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/267/257/351/232/234.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/267/257/351/232/234lu zhang-2.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/267/257/351/232/234lu zhang.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/246/350/241/214@2x.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/256/346/244/205-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/256/346/244/205.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/256/346/270/241@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/277/350/275/246@2x-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/277/350/275/246@2x.svg +1 -0
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/277/233/345/272/246/346/235/241.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/200/232/346/226/255/345/231/250.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/201/245/346/216/247.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/223/201/351/224/271.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/224/201.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/224/256/347/233/230.svg +1 -0
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/227/250/351/224/201.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/227/256/345/217/267@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/230/266/346/242/257@2x.svg +1 -0
- 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
- 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
- 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
- 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
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/237/263/345/223/215.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/241/271/347/233/256.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/243/236/346/234/272@2x-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/243/236/346/234/272@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/251/254/346/241/266.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/253/230/345/210/206/345/255/220.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/253/230/346/270/205.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/274/240/346/240/207.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/source.json +18 -0
- package/skills/micro-app-design/references/action-outcomes.md +7 -0
- package/skills/micro-app-design/references/adaptive-card-grid.md +25 -0
- package/skills/micro-app-design/references/capsule-fallback.md +36 -0
- package/skills/micro-app-design/references/component-boundaries.md +48 -0
- package/skills/micro-app-design/references/component-catalog.md +69 -0
- package/skills/micro-app-design/references/design-system.md +34 -0
- package/skills/micro-app-design/references/empty-and-error-states.md +27 -0
- package/skills/micro-app-design/references/icons.md +33 -0
- package/skills/micro-app-design/references/implementation-guidance.md +39 -0
- package/skills/micro-app-design/references/modal.md +27 -0
- package/skills/micro-app-design/references/page-patterns.md +55 -0
- package/skills/micro-app-design/references/quality-checklist.md +57 -0
- package/skills/micro-app-design/references/requirements-and-permission-states.md +19 -0
- package/skills/micro-app-design/references/source-and-scope.md +40 -0
- package/skills/micro-app-design/references/tokens.md +23 -0
- package/skills/micro-app-design/references/visual-acceptance.md +51 -0
- package/skills/micro-app-design/scripts/microapp-kit.mjs +117 -0
- package/skills/micro-app-design/scripts/visual-audit.mjs +197 -0
- package/skills/micro-app-design/tests/behavior-scenarios.md +154 -0
- package/skills/micro-app-design/tests/validate-design-skill.mjs +35 -0
- package/skills/micro-app-design/tests/validate-design-system.mjs +51 -0
- package/skills/micro-app-development/SKILL.md +132 -0
- package/skills/micro-app-development/agents/openai.yaml +6 -0
- package/skills/micro-app-development/references/agent-workflow.md +111 -0
- package/skills/micro-app-development/references/application-icons.md +50 -0
- package/skills/micro-app-development/references/data-change-safety.md +47 -0
- package/skills/micro-app-development/references/delivery-checklist.md +129 -0
- package/skills/micro-app-development/references/design-workflow.md +77 -0
- package/skills/micro-app-development/references/developer-credentials.md +97 -0
- package/skills/micro-app-development/references/development-guide.md +215 -0
- package/skills/micro-app-development/references/environment-progress.md +47 -0
- package/skills/micro-app-development/references/joint-acceptance.md +105 -0
- package/skills/micro-app-development/references/local-development.md +40 -0
- package/skills/micro-app-development/references/manifest-v1.2.md +129 -0
- package/skills/micro-app-development/references/npm-registry.md +50 -0
- package/skills/micro-app-development/references/platform-operations.md +48 -0
- package/skills/micro-app-development/references/project-workflow.md +36 -0
- package/skills/micro-app-development/references/publication-intent.md +34 -0
- package/skills/micro-app-development/references/publication-recovery.md +67 -0
- package/skills/micro-app-development/references/requirement-intake.md +122 -0
- package/skills/micro-app-development/references/runtime-requirements.md +23 -0
- package/skills/micro-app-development/references/space-permission-boundaries.md +46 -0
- package/skills/micro-app-development/references/tool-update.md +62 -0
- package/skills/micro-app-development/references/toolchain-access.md +35 -0
- package/skills/micro-app-development/references/user-journey.md +65 -0
- package/skills/micro-app-development/references/workspace-environments.md +39 -0
- package/skills/micro-app-development/scripts/application-icon.mjs +108 -0
- package/skills/micro-app-development/scripts/install-app-icon.mjs +48 -0
- package/skills/micro-app-development/scripts/install-menu-icon.mjs +27 -0
- package/skills/micro-app-development/scripts/language-policy.mjs +83 -0
- package/skills/micro-app-development/scripts/languages.json +372 -0
- package/skills/micro-app-development/scripts/locale-keys.mjs +26 -0
- package/skills/micro-app-development/scripts/microapp-kit.mjs +117 -0
- package/skills/micro-app-development/scripts/project-code.mjs +13 -0
- package/skills/micro-app-development/scripts/review-backend-logging.mjs +27 -0
- package/skills/micro-app-development/scripts/review-production-authorization.mjs +37 -0
- package/skills/micro-app-development/scripts/validate-micro-app-project.mjs +442 -0
- package/skills/micro-app-development/tests/application-icons.test.mjs +131 -0
- package/skills/micro-app-development/tests/backend-logging-review.test.mjs +24 -0
- package/skills/micro-app-development/tests/behavior-scenarios.md +177 -0
- package/skills/micro-app-development/tests/data-change-safety-scenarios.md +25 -0
- package/skills/micro-app-development/tests/design-workflow-scenarios.md +40 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/_locales/en.json +6 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/_locales/zh-CN.json +6 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/manifest.json +59 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/micro.config.js +5 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/mock/index.json +11 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/package.json +4 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/src/index.tsx +5 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/src/lang/en.ts +1 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/src/lang/zh.ts +1 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/src/public-path.js +3 -0
- package/skills/micro-app-development/tests/production-authorization-review.test.mjs +72 -0
- package/skills/micro-app-development/tests/six-skill-routing-scenarios.md +60 -0
- package/skills/micro-app-development/tests/user-journey-scenarios.md +19 -0
- package/skills/micro-app-development/tests/validate-micro-app-project.test.mjs +428 -0
- package/skills/micro-app-frontend-development/SKILL.md +86 -0
- package/skills/micro-app-frontend-development/agents/openai.yaml +6 -0
- package/skills/micro-app-frontend-development/references/api-and-permissions.md +86 -0
- package/skills/micro-app-frontend-development/references/custom-api-requests.md +52 -0
- package/skills/micro-app-frontend-development/references/debugging.md +36 -0
- package/skills/micro-app-frontend-development/references/i18n-and-theme.md +54 -0
- package/skills/micro-app-frontend-development/references/interaction-completion.md +61 -0
- package/skills/micro-app-frontend-development/references/micro-frontend-runtime.md +33 -0
- package/skills/micro-app-frontend-development/references/routing-and-context.md +96 -0
- package/skills/micro-app-frontend-development/references/saas-failure-and-display.md +45 -0
- package/skills/micro-app-frontend-development/references/standard-api-requests.md +30 -0
- package/skills/micro-app-frontend-development/references/submission-errors.md +51 -0
- package/skills/micro-app-frontend-development/scripts/microapp-kit.mjs +117 -0
- package/skills/micro-app-frontend-development/tests/behavior-scenarios.md +36 -0
- package/skills/micro-app-solution-design/SKILL.md +69 -0
- package/skills/micro-app-solution-design/agents/openai.yaml +6 -0
- package/skills/micro-app-solution-design/scripts/microapp-kit.mjs +117 -0
- package/skills/micro-app-solution-design/tests/behavior-scenarios.md +12 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import { resolveWorkspaceTarget, assertTarget } from './workspace.mjs';
|
|
2
|
+
import { existsSync, readFileSync, writeFileSync, renameSync, lstatSync } from 'node:fs';
|
|
3
|
+
import { join, resolve } from 'node:path';
|
|
4
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
5
|
+
import { realPathOnly } from './integrity.mjs';
|
|
6
|
+
import { createRegistryClient, sourceUploadErrors } from '../resources/scripts/registry-client.mjs';
|
|
7
|
+
import { resolveDeveloperCredentials } from './auth/manager.mjs';
|
|
8
|
+
import { projectCode } from '../resources/scripts/project-identity.mjs';
|
|
9
|
+
import { releaseContent } from './release-content.mjs';
|
|
10
|
+
import { publicationContext, publicationScope, publicationLease, readIndex, saveIndex, localEntry, readPublicationFile } from './release-index.mjs';
|
|
11
|
+
|
|
12
|
+
const CODE = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
|
|
13
|
+
const ID = /^[A-Za-z0-9_-]{1,64}$/;
|
|
14
|
+
const REASONS = new Map([
|
|
15
|
+
...Object.entries(sourceUploadErrors),
|
|
16
|
+
['MICRO_APP_VERSION_LIMIT_EXCEEDED', 'The registered version limit has been reached. Delete an unused version, then resume this original publication.'],
|
|
17
|
+
['MICRO_APP_UPLOAD_MISMATCH', 'The uploaded bytes differ from the fixed size or checksum. Inspect the original task before preparing corrected source.'],
|
|
18
|
+
['MICRO_APP_SOURCE_ARCHIVE_INVALID', 'Repackage the backend as a non-empty tar.gz using release prepare.'],
|
|
19
|
+
['MICRO_APP_SOURCE_ARCHIVE_UNSAFE', 'Remove unsafe paths, links and special files, then prepare corrected source.'],
|
|
20
|
+
['MICRO_APP_SOURCE_ARCHIVE_FORBIDDEN', 'Remove credential files and excluded directories before preparing corrected source.'],
|
|
21
|
+
['MICRO_APP_SOURCE_ARCHIVE_LIMIT', 'Reduce expanded source size or file count before preparing corrected source.'],
|
|
22
|
+
['UPLOAD_NOT_COMPLETED', 'Resume the same prepared publication to renew the backend upload; keep its original request and archive.'],
|
|
23
|
+
['AUTHORIZATION_REVOKED', 'Application authorization is no longer valid. Check ownership and application lifecycle.'],
|
|
24
|
+
['INFRA_FAILED', 'The build pipeline failed. Inspect the original build logs.'],
|
|
25
|
+
['INFRA_SUBMISSION_RETRIES_EXHAUSTED', 'No workflow receipt is available after 3 build creation attempts. This publication has failed. Start a new publication attempt to push again; remote builds from the original attempt may still exist.'],
|
|
26
|
+
['BUILD_CANCEL_RECEIPT_TIMEOUT', 'Deletion waited 120 seconds without a build receipt. The local build has failed so deletion can continue. Remote build cancellation remains unconfirmed; do not resubmit this application.'],
|
|
27
|
+
]);
|
|
28
|
+
export function publicationReason(reason) {
|
|
29
|
+
return REASONS.has(reason) ? { reasonCode: reason, message: REASONS.get(reason) } : {};
|
|
30
|
+
}
|
|
31
|
+
function failure(code) { return Object.assign(new Error(code), { code }); }
|
|
32
|
+
function json(path) {
|
|
33
|
+
path = realPathOnly(path);
|
|
34
|
+
if (lstatSync(path).isSymbolicLink() || !lstatSync(path).isFile()) throw failure('INVALID_RELEASE_ARTIFACTS');
|
|
35
|
+
return JSON.parse(readFileSync(path, 'utf8'));
|
|
36
|
+
}
|
|
37
|
+
function archive(path, expected, limit, limitCode) {
|
|
38
|
+
path = realPathOnly(path);
|
|
39
|
+
const stat = lstatSync(path);
|
|
40
|
+
if (stat.isFile() && !stat.isSymbolicLink() && stat.size > limit) throw failure(limitCode);
|
|
41
|
+
if (!stat.isFile() || stat.isSymbolicLink() || stat.size <= 0
|
|
42
|
+
|| !/^[a-f0-9]{64}$/.test(expected || '')
|
|
43
|
+
|| createHash('sha256').update(readFileSync(path)).digest('hex') !== expected) {
|
|
44
|
+
throw failure('RELEASE_ARTIFACT_MISMATCH');
|
|
45
|
+
}
|
|
46
|
+
return stat.size;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function safeTask(task, backend) {
|
|
50
|
+
const taskId = task && (backend ? task.buildTaskId : task.taskId);
|
|
51
|
+
if (typeof taskId !== 'string' || !ID.test(taskId)) throw failure('REGISTRY_INVALID_RESPONSE');
|
|
52
|
+
const allowed = backend
|
|
53
|
+
? ['UPLOADING', 'QUEUED', 'SUBMITTING', 'BUILDING', 'VERIFYING', 'REGISTERING', 'COMPLETE', 'CANCEL_REQUESTED', 'CANCELLED', 'UNKNOWN', 'FAILED']
|
|
54
|
+
: ['ACCEPTED', 'VALIDATING', 'UPLOADING_PACKAGE', 'UPLOADING_CDN', 'VERIFYING_RESOURCE', 'REGISTERING', 'SUCCESS', 'FAILED', 'EXPIRED'];
|
|
55
|
+
if (!allowed.includes(task.status)) throw failure('REGISTRY_INVALID_RESPONSE');
|
|
56
|
+
return task;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function frontendResumable(task) {
|
|
60
|
+
if (task.status === 'FAILED') return [
|
|
61
|
+
'SMARTHOME_PACKAGE_UPLOAD_FAILED', 'SMARTHOME_CDN_UPLOAD_FAILED',
|
|
62
|
+
'SMARTHOME_ENTRY_NOT_FOUND', 'SMARTHOME_ASSET_NOT_FOUND', 'SMARTHOME_REGISTRY_FAILED',
|
|
63
|
+
'MICRO_APP_VERSION_LIMIT_EXCEEDED',
|
|
64
|
+
].includes(task.errorCode);
|
|
65
|
+
return ['ACCEPTED', 'VALIDATING', 'UPLOADING_PACKAGE', 'UPLOADING_CDN',
|
|
66
|
+
'VERIFYING_RESOURCE', 'REGISTERING'].includes(task.status);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function backendResumable(task) {
|
|
70
|
+
return task.status === 'UPLOADING'
|
|
71
|
+
|| (task.status === 'FAILED' && task.errorCode === 'UPLOAD_NOT_COMPLETED');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function inspectPreparedRelease({ output, retainedCode }) {
|
|
75
|
+
if (!output) throw failure('OUTPUT_REQUIRED');
|
|
76
|
+
output = realPathOnly(output);
|
|
77
|
+
if (lstatSync(output).isSymbolicLink()) throw failure('INVALID_RELEASE_ARTIFACTS');
|
|
78
|
+
const artifactDir = realPathOnly(existsSync(join(output, 'artifacts/release-artifacts.json')) ? join(output, 'artifacts') : output);
|
|
79
|
+
const manifest = json(join(artifactDir, 'release-artifacts.json'));
|
|
80
|
+
const frontendFile = join(artifactDir, 'source.tgz'), backendFile = join(artifactDir, 'backend-context.tgz');
|
|
81
|
+
if ((manifest.build?.databaseRequired && !manifest.build?.backendRequired)
|
|
82
|
+
|| !['v6-release-artifacts-v1', 'v6-release-artifacts-v2'].includes(manifest.format)
|
|
83
|
+
|| typeof manifest.build?.backendRequired !== 'boolean'
|
|
84
|
+
|| typeof manifest.build.databaseRequired !== 'boolean' || manifest.static?.file !== 'source.tgz'
|
|
85
|
+
|| (manifest.build.backendRequired && manifest.backend?.file !== 'backend-context.tgz')) throw failure('INVALID_RELEASE_ARTIFACTS');
|
|
86
|
+
archive(frontendFile, manifest.static.sha256, 50 * 1024 * 1024, 'FRONTEND_UPLOAD_TOO_LARGE');
|
|
87
|
+
if (manifest.build.backendRequired) archive(backendFile, manifest.backend.sha256, 20 * 1024 * 1024, 'BACKEND_UPLOAD_TOO_LARGE');
|
|
88
|
+
const snapshotRoot = artifactDir === output ? resolve(output, '../build') : join(output, 'build');
|
|
89
|
+
const app = json(join(snapshotRoot, 'frontend/package/manifest.json'));
|
|
90
|
+
const legacy = manifest.format === 'v6-release-artifacts-v1';
|
|
91
|
+
if (legacy && !retainedCode) throw failure('PROJECT_CODE_REQUIRED');
|
|
92
|
+
const code = projectCode(legacy
|
|
93
|
+
? { microAppCode: retainedCode, microAppCodeSource: 'publication' }
|
|
94
|
+
: manifest.build);
|
|
95
|
+
if (typeof code !== 'string' || code.length > 128 || !CODE.test(code)) throw failure('INVALID_RELEASE_ARTIFACTS');
|
|
96
|
+
const schema = manifest.build.databaseRequired ? manifest.build.digests?.['backend-context/deploy/manifest.json'] : undefined;
|
|
97
|
+
if (manifest.build.databaseRequired && !/^[a-f0-9]{64}$/.test(schema || '')) throw failure('INVALID_RELEASE_ARTIFACTS');
|
|
98
|
+
return { output, manifest, frontendFile, backendFile, code, schema,
|
|
99
|
+
fingerprint: createHash('sha256').update(JSON.stringify([manifest, app])).digest('hex') };
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function publicationIdentity(prepared, project, credentials) {
|
|
103
|
+
const { manifest, code, schema } = prepared;
|
|
104
|
+
return createHash('sha256').update(JSON.stringify([
|
|
105
|
+
credentials.baseUrl, credentials.developerCode, realPathOnly(project), code, manifest.static.sha256,
|
|
106
|
+
manifest.backend?.sha256 || '', manifest.build.backendRequired, manifest.build.databaseRequired, schema || '',
|
|
107
|
+
])).digest('hex');
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Published 0.1.2 snapshots have no code field. A matching retained index supplies
|
|
111
|
+
// their original identity; never infer it from appName or rewrite old artifacts.
|
|
112
|
+
export function inspectProjectRelease(options) {
|
|
113
|
+
try {
|
|
114
|
+
return inspectPreparedRelease({ output: options.output });
|
|
115
|
+
} catch (error) {
|
|
116
|
+
if (error.code !== 'PROJECT_CODE_REQUIRED') throw error;
|
|
117
|
+
const context = publicationContext(options.project, options);
|
|
118
|
+
const output = realPathOnly(options.output);
|
|
119
|
+
const entries = readIndex(context).entries.filter(entry => entry.output === output);
|
|
120
|
+
if (!entries.length || new Set(entries.map(entry => entry.code)).size !== 1) throw error;
|
|
121
|
+
const prepared = inspectPreparedRelease({ output, retainedCode: entries[0].code });
|
|
122
|
+
if (entries.some(entry => entry.artifactFingerprint !== prepared.fingerprint)) {
|
|
123
|
+
throw failure('STATE_MISMATCH');
|
|
124
|
+
}
|
|
125
|
+
return prepared;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export async function planRelease(options) {
|
|
130
|
+
const prepared = inspectProjectRelease(options);
|
|
131
|
+
const content = await releaseContent(prepared);
|
|
132
|
+
const context = publicationContext(options.project, options);
|
|
133
|
+
const entries = readIndex(context).entries.filter(entry => entry.code === prepared.code);
|
|
134
|
+
return { operation: 'release.plan', status: 'complete', content,
|
|
135
|
+
decision: entries.some(entry => entry.contentFingerprint === content.fingerprint) ? 'check-existing' : 'new-content',
|
|
136
|
+
authoritative: false, accountVerificationRequired: true,
|
|
137
|
+
publications: entries.map(localEntry),
|
|
138
|
+
nextActions: ['Publish with the current credentials. The tool verifies the account scope, queries the original task and reuses matching content before creating requests.'],
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
async function fetchBuildLogs(client, buildTaskId, options = {}) {
|
|
143
|
+
try {
|
|
144
|
+
return { status: 'complete', ...await client.buildLogs(buildTaskId, options) };
|
|
145
|
+
} catch (error) {
|
|
146
|
+
return { status: 'unavailable', available: false, text: '', truncated: false,
|
|
147
|
+
errorCode: 'BUILD_LOGS_UNAVAILABLE',
|
|
148
|
+
nextActions: ['Query release logs again for this original task. Log retrieval does not retry or change the build.'] };
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export async function publicationLogs(options = {}) {
|
|
153
|
+
const { project, output, stateRoot, environment = process.env, fetchImpl = fetch,
|
|
154
|
+
credentialSource = 'auto', credentialStore, workspaceRoot, tailLines = 500, sinceSeconds } = options;
|
|
155
|
+
if (!Number.isInteger(tailLines) || tailLines < 1 || tailLines > 2000
|
|
156
|
+
|| (sinceSeconds !== undefined && (!Number.isInteger(sinceSeconds) || sinceSeconds < 1 || sinceSeconds > 86400))) {
|
|
157
|
+
throw failure('BUILD_LOGS_QUERY_INVALID');
|
|
158
|
+
}
|
|
159
|
+
const prepared = inspectProjectRelease(options);
|
|
160
|
+
const target = resolveWorkspaceTarget({ project, stateRoot, workspaceRoot, environment });
|
|
161
|
+
assertTarget(target, readPublicationFile(prepared.output));
|
|
162
|
+
const credentials = await resolveDeveloperCredentials({ project, environment, stateRoot,
|
|
163
|
+
source: credentialSource, workspaceRoot, ...(credentialStore ? { store: credentialStore } : {}) });
|
|
164
|
+
const state = readPublicationFile(prepared.output);
|
|
165
|
+
if (!state || state.format !== 'microapp-publication-v1'
|
|
166
|
+
|| state.identity !== publicationIdentity(prepared, project, credentials)) throw failure('STATE_MISMATCH');
|
|
167
|
+
if (!state.buildTaskId) return { operation: 'release.logs', status: 'complete', available: false,
|
|
168
|
+
text: '', truncated: false, stage: 'BACKEND_NOT_SUBMITTED' };
|
|
169
|
+
const client = createRegistryClient({ ...credentials, fetchImpl });
|
|
170
|
+
const task = safeTask(await client.buildStatus(state.buildTaskId), true);
|
|
171
|
+
if (task.buildTaskId !== state.buildTaskId || task.microAppCode !== prepared.code
|
|
172
|
+
|| task.releaseId !== state.releaseId) throw failure('STATE_MISMATCH');
|
|
173
|
+
return { operation: 'release.logs', buildTaskId: state.buildTaskId, microAppVersion: state.version,
|
|
174
|
+
stage: task.status, ...await fetchBuildLogs(client, state.buildTaskId, { tailLines, sinceSeconds }) };
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export async function publishRelease(action, options = {}) {
|
|
178
|
+
if (!['publish', 'status', 'resume'].includes(action)) throw failure('INVALID_OPERATION');
|
|
179
|
+
const { project, environment = process.env, stateRoot, credentialSource = 'auto', credentialStore,
|
|
180
|
+
fetchImpl = fetch, newAttempt = false, workspaceRoot } = options;
|
|
181
|
+
if (newAttempt && action !== 'publish') throw failure('PUBLICATION_RETRY_NOT_ALLOWED');
|
|
182
|
+
const requested = inspectProjectRelease(options);
|
|
183
|
+
const target = resolveWorkspaceTarget({ project, stateRoot, workspaceRoot, environment });
|
|
184
|
+
assertTarget(target, readPublicationFile(requested.output));
|
|
185
|
+
const credentials = await resolveDeveloperCredentials({ project, environment, stateRoot,
|
|
186
|
+
source: credentialSource, workspaceRoot, ...(credentialStore ? { store: credentialStore } : {}) });
|
|
187
|
+
const own = readPublicationFile(requested.output);
|
|
188
|
+
if (own && (own.format !== 'microapp-publication-v1' || !ID.test(own.frontendRequestId || '')
|
|
189
|
+
|| !ID.test(own.backendRequestId || '') || own.identity !== publicationIdentity(requested, project, credentials))) {
|
|
190
|
+
throw failure('STATE_MISMATCH');
|
|
191
|
+
}
|
|
192
|
+
const content = await releaseContent(requested);
|
|
193
|
+
const context = publicationContext(project, options);
|
|
194
|
+
const unlock = publicationLease(context);
|
|
195
|
+
try {
|
|
196
|
+
const index = readIndex(context);
|
|
197
|
+
const scope = publicationScope(context, credentials, requested.code);
|
|
198
|
+
const scoped = index.entries.filter(entry => entry.scope === scope);
|
|
199
|
+
let entry = own ? scoped.find(item => item.id === own.frontendRequestId)
|
|
200
|
+
: scoped.findLast(item => item.contentFingerprint === content.fingerprint);
|
|
201
|
+
if (own && entry && entry.output !== requested.output) throw failure('STATE_MISMATCH');
|
|
202
|
+
if (entry && entry.contentFingerprint !== content.fingerprint) throw failure('STATE_MISMATCH');
|
|
203
|
+
if (entry?.output === requested.output && entry.artifactFingerprint !== requested.fingerprint) throw failure('STATE_MISMATCH');
|
|
204
|
+
const previousPublications = scoped.filter(item => item !== entry && item.result?.status !== 'complete').map(localEntry);
|
|
205
|
+
let selected = requested;
|
|
206
|
+
async function original(record) {
|
|
207
|
+
if (record.output === requested.output) return requested;
|
|
208
|
+
if (!existsSync(record.output)) throw failure('PUBLICATION_INPUT_MISSING');
|
|
209
|
+
let prepared;
|
|
210
|
+
try { prepared = inspectPreparedRelease({ output: record.output, retainedCode: record.code }); }
|
|
211
|
+
catch (error) {
|
|
212
|
+
if (error.code === 'ENOENT') throw failure('PUBLICATION_INPUT_MISSING');
|
|
213
|
+
throw error;
|
|
214
|
+
}
|
|
215
|
+
if (prepared.fingerprint !== record.artifactFingerprint
|
|
216
|
+
|| publicationIdentity(prepared, project, credentials) !== record.identity
|
|
217
|
+
|| (await releaseContent(prepared)).fingerprint !== record.contentFingerprint) throw failure('STATE_MISMATCH');
|
|
218
|
+
return prepared;
|
|
219
|
+
}
|
|
220
|
+
async function invoke(record, prepared, operation) {
|
|
221
|
+
try {
|
|
222
|
+
const result = await publishFixedRelease(operation, {
|
|
223
|
+
project, prepared, credentials, fetchImpl,
|
|
224
|
+
requestIds: { frontendRequestId: record.id, backendRequestId: record.backendRequestId },
|
|
225
|
+
});
|
|
226
|
+
record.result = Object.fromEntries(['status', 'stage', 'releaseId', 'buildTaskId', 'microAppVersion', 'reasonCode']
|
|
227
|
+
.filter(key => result[key] !== undefined).map(key => [key, result[key]]));
|
|
228
|
+
record.updatedAt = new Date().toISOString();
|
|
229
|
+
saveIndex(context, index);
|
|
230
|
+
return result;
|
|
231
|
+
} catch (error) {
|
|
232
|
+
record.result = { ...record.result, status: 'unknown', stage: 'ACTION_REQUIRED' };
|
|
233
|
+
record.updatedAt = new Date().toISOString();
|
|
234
|
+
saveIndex(context, index);
|
|
235
|
+
throw error;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
let retryOf;
|
|
239
|
+
if (newAttempt) {
|
|
240
|
+
if (own || !entry) throw failure('PUBLICATION_RETRY_NOT_ALLOWED');
|
|
241
|
+
const probe = await invoke(entry, await original(entry), 'status');
|
|
242
|
+
if (probe.resumable || probe.status !== 'failed') {
|
|
243
|
+
throw failure('PUBLICATION_RETRY_NOT_ALLOWED');
|
|
244
|
+
}
|
|
245
|
+
retryOf = entry.id;
|
|
246
|
+
previousPublications.push(localEntry(entry));
|
|
247
|
+
entry = undefined;
|
|
248
|
+
}
|
|
249
|
+
const reused = Boolean(entry);
|
|
250
|
+
if (entry) selected = await original(entry);
|
|
251
|
+
else {
|
|
252
|
+
if (action === 'status' && !own) throw failure('PUBLICATION_NOT_STARTED');
|
|
253
|
+
entry = { id: own?.frontendRequestId || randomUUID(), backendRequestId: own?.backendRequestId || randomUUID(),
|
|
254
|
+
scope, endpoint: credentials.baseUrl, environment: credentials.workspaceTarget.environment, code: requested.code, output: requested.output, contentFingerprint: content.fingerprint,
|
|
255
|
+
artifactFingerprint: requested.fingerprint, identity: publicationIdentity(requested, project, credentials),
|
|
256
|
+
createdAt: new Date().toISOString(), ...(retryOf ? { retryOf } : {}) };
|
|
257
|
+
index.entries.push(entry);
|
|
258
|
+
// Durable request intent precedes every possible platform service write, including the
|
|
259
|
+
// first publication.json write and an ambiguous registration response.
|
|
260
|
+
saveIndex(context, index);
|
|
261
|
+
}
|
|
262
|
+
const operation = action === 'publish' && reused ? 'resume' : action;
|
|
263
|
+
const result = await invoke(entry, selected, operation);
|
|
264
|
+
return { ...result, operation: 'release.' + action, content,
|
|
265
|
+
decision: reused ? result.status === 'complete' ? 'reuse-complete' : 'resume-existing'
|
|
266
|
+
: retryOf ? 'retry-terminal' : scoped.length ? 'new-content' : 'new',
|
|
267
|
+
reused, publicationOutput: selected.output, requestedOutput: requested.output,
|
|
268
|
+
...(previousPublications.length ? { previousPublications } : {}),
|
|
269
|
+
};
|
|
270
|
+
} finally { unlock(); }
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
async function publishFixedRelease(action, { project, prepared, credentials, fetchImpl, requestIds }) {
|
|
274
|
+
const output = prepared.output;
|
|
275
|
+
const { manifest, frontendFile, backendFile, code, schema } = prepared;
|
|
276
|
+
const identity = publicationIdentity(prepared, project, credentials);
|
|
277
|
+
const stateFile = join(output, 'publication.json');
|
|
278
|
+
if (!existsSync(stateFile)) {
|
|
279
|
+
try {
|
|
280
|
+
writeFileSync(stateFile, JSON.stringify({ format: 'microapp-publication-v1', identity,
|
|
281
|
+
endpoint: credentials.baseUrl, environment: credentials.workspaceTarget.environment,
|
|
282
|
+
frontendRequestId: requestIds.frontendRequestId, backendRequestId: requestIds.backendRequestId }) + '\n', { flag: 'wx', mode: 0o600 });
|
|
283
|
+
} catch (error) { if (error.code !== 'EEXIST') throw error; }
|
|
284
|
+
}
|
|
285
|
+
let state = json(stateFile);
|
|
286
|
+
if (state.format !== 'microapp-publication-v1' || state.identity !== identity
|
|
287
|
+
|| state.frontendRequestId !== requestIds.frontendRequestId
|
|
288
|
+
|| state.backendRequestId !== requestIds.backendRequestId) throw failure('STATE_MISMATCH');
|
|
289
|
+
function save(fields) {
|
|
290
|
+
const latest = json(stateFile);
|
|
291
|
+
if (latest.identity !== identity) throw failure('STATE_MISMATCH');
|
|
292
|
+
for (const [key, value] of Object.entries(fields)) {
|
|
293
|
+
if (latest[key] !== undefined && latest[key] !== value) throw failure('STATE_MISMATCH');
|
|
294
|
+
}
|
|
295
|
+
state = { ...latest, ...fields };
|
|
296
|
+
const temp = stateFile + '.' + randomUUID();
|
|
297
|
+
writeFileSync(temp, JSON.stringify(state, null, 2) + '\n', { flag: 'wx', mode: 0o600 });
|
|
298
|
+
renameSync(temp, stateFile);
|
|
299
|
+
}
|
|
300
|
+
const client = createRegistryClient({ ...credentials, fetchImpl });
|
|
301
|
+
let frontend = state.frontendTaskId ? await client.query(state.frontendTaskId) : await client.findFrontend(state.frontendRequestId);
|
|
302
|
+
if (!frontend && action !== 'status') frontend = await client.frontend({
|
|
303
|
+
file: frontendFile, source: 'agent', code, sha256: manifest.static.sha256, requestId: state.frontendRequestId,
|
|
304
|
+
backendRequired: manifest.build.backendRequired, databaseRequired: manifest.build.databaseRequired,
|
|
305
|
+
});
|
|
306
|
+
if (!frontend) return result('unknown', 'FRONTEND_NOT_FOUND');
|
|
307
|
+
if (frontend) safeTask(frontend, false);
|
|
308
|
+
if (action === 'resume' && frontend && frontendResumable(frontend)) {
|
|
309
|
+
frontend = await client.frontend({
|
|
310
|
+
file: frontendFile, source: 'agent', code, sha256: manifest.static.sha256, requestId: state.frontendRequestId,
|
|
311
|
+
backendRequired: manifest.build.backendRequired, databaseRequired: manifest.build.databaseRequired,
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
safeTask(frontend, false);
|
|
315
|
+
if (frontend.microAppCode && frontend.microAppCode !== code) throw failure('STATE_MISMATCH');
|
|
316
|
+
save({ frontendTaskId: frontend.taskId });
|
|
317
|
+
if (['FAILED', 'EXPIRED'].includes(frontend.status)) return {
|
|
318
|
+
...result('failed', 'FRONTEND_FAILED', frontend.errorCode),
|
|
319
|
+
resumable: frontendResumable(frontend),
|
|
320
|
+
...(frontendResumable(frontend) ? { nextActions: ['Resume the same prepared publication with its original request and archive; do not create a new version.'] } : {}),
|
|
321
|
+
};
|
|
322
|
+
if (frontend.status !== 'SUCCESS') return result('running', 'FRONTEND');
|
|
323
|
+
if (typeof frontend.releaseId !== 'string' || !ID.test(frontend.releaseId)
|
|
324
|
+
|| typeof frontend.microAppVersion !== 'string' || frontend.microAppVersion.length > 64
|
|
325
|
+
|| !/^[0-9]+\.[0-9]+\.[0-9]+-[0-9]+$/.test(frontend.microAppVersion)) throw failure('REGISTRY_INVALID_RESPONSE');
|
|
326
|
+
if (frontend.backendRequired !== manifest.build.backendRequired || frontend.databaseRequired !== manifest.build.databaseRequired) throw failure('STATE_MISMATCH');
|
|
327
|
+
save({ releaseId: frontend.releaseId, version: frontend.microAppVersion });
|
|
328
|
+
if (!manifest.build.backendRequired) return result('complete', 'ARTIFACTS_READY');
|
|
329
|
+
const fields = { requestId: state.backendRequestId, microAppCode: code, releaseId: state.releaseId };
|
|
330
|
+
let build = state.buildTaskId ? await client.buildStatus(state.buildTaskId) : await client.findBuild(fields);
|
|
331
|
+
if (build) {
|
|
332
|
+
safeTask(build, true);
|
|
333
|
+
if (build.microAppCode !== code || build.releaseId !== state.releaseId) throw failure('STATE_MISMATCH');
|
|
334
|
+
}
|
|
335
|
+
if (!build || (backendResumable(build) && action !== 'status')) {
|
|
336
|
+
if (action === 'status') return result('running', 'BACKEND_NOT_SUBMITTED');
|
|
337
|
+
build = await client.source({ ...fields, file: backendFile, sha256: manifest.backend.sha256, schemaVersion: schema });
|
|
338
|
+
}
|
|
339
|
+
safeTask(build, true);
|
|
340
|
+
if (build.microAppCode !== code || build.releaseId !== state.releaseId) throw failure('STATE_MISMATCH');
|
|
341
|
+
save({ buildTaskId: build.buildTaskId });
|
|
342
|
+
if (backendResumable(build)) return { ...result('running', 'UPLOADING', build.errorCode), resumable: true,
|
|
343
|
+
nextActions: ['Resume this prepared publication with its original backend request and archive; do not create a new version.'] };
|
|
344
|
+
if (['FAILED', 'CANCELLED'].includes(build.status)) return {
|
|
345
|
+
...result('failed', build.status, build.errorCode),
|
|
346
|
+
buildLogs: await fetchBuildLogs(client, build.buildTaskId),
|
|
347
|
+
};
|
|
348
|
+
if (build.status === 'COMPLETE') {
|
|
349
|
+
// Digest is informational; it does not gate completion or prove registry verification.
|
|
350
|
+
if (build.backendRegistered !== true
|
|
351
|
+
|| !/^v-[0-9]{17}-(?:[a-f0-9]{8}|[a-f0-9]{16})$/.test(build.imageTag || '')) throw failure('REGISTRY_INVALID_RESPONSE');
|
|
352
|
+
return { ...result('complete', 'ARTIFACTS_READY'), imageTag: build.imageTag, imageDigest: build.imageDigest };
|
|
353
|
+
}
|
|
354
|
+
return result('running', build.status, build.errorCode);
|
|
355
|
+
|
|
356
|
+
function result(status, stage, reason) {
|
|
357
|
+
return { operation: 'release.' + action, status, stage, microAppCode: code,
|
|
358
|
+
...(state.releaseId ? { releaseId: state.releaseId, microAppVersion: state.version } : {}),
|
|
359
|
+
...(state.buildTaskId ? { buildTaskId: state.buildTaskId } : {}),
|
|
360
|
+
...publicationReason(reason),
|
|
361
|
+
artifactsReady: status === 'complete', productionReady: false, deploymentStatus: 'NOT_SUBMITTED',
|
|
362
|
+
nextActions: status === 'complete' ? [
|
|
363
|
+
'Give one concise handoff with the registered code and fixed version, covering all three steps without requiring per-step replies: deploy in the target region (frontend-only applications too) and check READY/active for the frontend and required backend; bind the selected tag to that version in that region; mount the application and tag in the target SaaS and check access, business behavior and permissions with administrator and ordinary-member identities. Choose documentation links in the language explicitly requested by the user, otherwise match the conversation language: keep /en/ for English and use the corresponding /cn/ path for Chinese, preserving the document path and ID. Detailed deployment/tag steps: https://developer.tuya.com/en/docs/iot/micro-app-management?id=Kg3xws64uwxln (sections 4.3 and 8.3); SaaS mounting: https://developer.tuya.com/en/docs/iot/ai_develop?id=Kg3g0wx1ug208 (step 4). Reuse known choices without inventing missing targets. Artifact readiness is not production readiness; preserve data-risk and production-authorization checks and distinguish reported from verified results.',
|
|
364
|
+
]
|
|
365
|
+
: status === 'failed' ? reason === 'BUILD_CANCEL_RECEIPT_TIMEOUT'
|
|
366
|
+
? ['Continue tracking the original deletion task. Do not start another publication for this application while deletion is in progress.']
|
|
367
|
+
: reason === 'INFRA_SUBMISSION_RETRIES_EXHAUSTED'
|
|
368
|
+
? ['Prepare the project into a fresh release output directory, then run release publish with --new-attempt. Keep the original publication history; the server assigns a new version and build task.']
|
|
369
|
+
: ['Inspect the original task. Correct rejected source before preparing a new release; never overwrite or replace the original task.']
|
|
370
|
+
: ['Query release status and resume the same prepared publication directory; do not create a new request.'] };
|
|
371
|
+
}
|
|
372
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { createReadStream } from 'node:fs';
|
|
2
|
+
import { createGunzip } from 'node:zlib';
|
|
3
|
+
import { createHash } from 'node:crypto';
|
|
4
|
+
|
|
5
|
+
const MAX_EXPANDED = 512 * 1024 * 1024;
|
|
6
|
+
const MAX_ENTRIES = 100_000;
|
|
7
|
+
const fail = () => { throw Object.assign(new Error('RELEASE_CONTENT_INVALID'), { code: 'RELEASE_CONTENT_INVALID' }); };
|
|
8
|
+
const hash = value => createHash('sha256').update(value).digest('hex');
|
|
9
|
+
const decoder = new TextDecoder('utf-8', { fatal: true });
|
|
10
|
+
const PAX_KEYS = new Set(['path', 'size', 'mtime', 'atime', 'ctime', 'uid', 'gid', 'uname', 'gname',
|
|
11
|
+
'comment', 'charset', 'LIBARCHIVE.creationtime', 'SCHILY.dev', 'SCHILY.ino', 'SCHILY.nlink']);
|
|
12
|
+
|
|
13
|
+
function text(bytes) {
|
|
14
|
+
return decoder.decode(bytes.subarray(0, bytes.indexOf(0) < 0 ? bytes.length : bytes.indexOf(0)));
|
|
15
|
+
}
|
|
16
|
+
function number(bytes) {
|
|
17
|
+
const value = text(bytes).trim();
|
|
18
|
+
if (!/^[0-7]*$/.test(value)) fail();
|
|
19
|
+
const result = Number.parseInt(value || '0', 8);
|
|
20
|
+
if (!Number.isSafeInteger(result) || result < 0 || result > MAX_EXPANDED) fail();
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
function pathName(value) {
|
|
24
|
+
if (value.startsWith('/') || /^[A-Za-z]:/.test(value)) fail();
|
|
25
|
+
const path = value.replace(/^(?:\.\/)+/, '').replace(/\/$/, '');
|
|
26
|
+
if (!path || path === '.') return '';
|
|
27
|
+
if (Buffer.byteLength(path) > 4096 || /^[A-Za-z]:/.test(path) || path.startsWith('/')
|
|
28
|
+
|| /[\\\x00-\x1f\x7f]/.test(path) || path.split('/').some(part => !part || part === '.' || part === '..')) fail();
|
|
29
|
+
return path;
|
|
30
|
+
}
|
|
31
|
+
function pax(bytes) {
|
|
32
|
+
const result = {};
|
|
33
|
+
let offset = 0;
|
|
34
|
+
while (offset < bytes.length) {
|
|
35
|
+
const space = bytes.indexOf(32, offset);
|
|
36
|
+
if (space < 0) fail();
|
|
37
|
+
const lengthText = bytes.subarray(offset, space).toString('ascii');
|
|
38
|
+
if (!/^[1-9][0-9]*$/.test(lengthText)) fail();
|
|
39
|
+
const length = Number(lengthText), end = offset + length;
|
|
40
|
+
if (!Number.isSafeInteger(end) || end > bytes.length || end <= space + 1 || bytes[end - 1] !== 10) fail();
|
|
41
|
+
const record = bytes.subarray(space + 1, end - 1);
|
|
42
|
+
const equal = record.indexOf(61);
|
|
43
|
+
if (equal <= 0) fail();
|
|
44
|
+
const key = decoder.decode(record.subarray(0, equal));
|
|
45
|
+
// macOS automatically attaches this non-executable provenance attribute,
|
|
46
|
+
// including opaque binary SCHILY values. It is packaging metadata only.
|
|
47
|
+
if (!['LIBARCHIVE.xattr.com.apple.provenance', 'SCHILY.xattr.com.apple.provenance'].includes(key)) {
|
|
48
|
+
if (!PAX_KEYS.has(key)) fail();
|
|
49
|
+
result[key] = decoder.decode(record.subarray(equal + 1));
|
|
50
|
+
}
|
|
51
|
+
offset = end;
|
|
52
|
+
}
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Read the archive itself: do not trust a self-reported tree digest to identify
|
|
57
|
+
// uploaded bytes. No extraction, shell execution or unbounded expansion occurs.
|
|
58
|
+
export async function archiveContent(file, maxExpanded = MAX_EXPANDED) {
|
|
59
|
+
const files = new Map();
|
|
60
|
+
let pending = Buffer.alloc(0), entry, padding = 0, expanded = 0, count = 0;
|
|
61
|
+
let extended = {}, longName, zeroBlocks = 0;
|
|
62
|
+
const input = createReadStream(file), unzip = createGunzip();
|
|
63
|
+
input.on('error', error => unzip.destroy(error));
|
|
64
|
+
input.pipe(unzip);
|
|
65
|
+
function finishEntry() {
|
|
66
|
+
if (entry.type === 'x' || entry.type === 'g') {
|
|
67
|
+
const attributes = pax(Buffer.concat(entry.parts));
|
|
68
|
+
if (entry.type === 'g') {
|
|
69
|
+
if ('path' in attributes || 'size' in attributes || 'linkpath' in attributes) fail();
|
|
70
|
+
} else extended = attributes;
|
|
71
|
+
} else if (entry.type === 'L') {
|
|
72
|
+
longName = text(Buffer.concat(entry.parts));
|
|
73
|
+
} else {
|
|
74
|
+
const path = pathName(entry.name);
|
|
75
|
+
if (path) {
|
|
76
|
+
if (files.has(path)) fail();
|
|
77
|
+
files.set(path, entry.type === '5' ? ['directory', path] : ['file', path, entry.executable, entry.digest.digest('hex')]);
|
|
78
|
+
} else if (entry.type !== '5') fail();
|
|
79
|
+
extended = {};
|
|
80
|
+
longName = undefined;
|
|
81
|
+
}
|
|
82
|
+
padding = (512 - (entry.size % 512)) % 512;
|
|
83
|
+
entry = undefined;
|
|
84
|
+
}
|
|
85
|
+
try {
|
|
86
|
+
for await (const chunk of unzip) {
|
|
87
|
+
expanded += chunk.length;
|
|
88
|
+
if (expanded > maxExpanded) fail();
|
|
89
|
+
pending = Buffer.concat([pending, chunk]);
|
|
90
|
+
for (;;) {
|
|
91
|
+
if (entry) {
|
|
92
|
+
const take = Math.min(entry.remaining, pending.length);
|
|
93
|
+
if (take) {
|
|
94
|
+
const bytes = pending.subarray(0, take);
|
|
95
|
+
if (entry.parts) entry.parts.push(Buffer.from(bytes));
|
|
96
|
+
else if (entry.digest) entry.digest.update(bytes);
|
|
97
|
+
entry.remaining -= take;
|
|
98
|
+
pending = pending.subarray(take);
|
|
99
|
+
}
|
|
100
|
+
if (entry.remaining) break;
|
|
101
|
+
finishEntry();
|
|
102
|
+
}
|
|
103
|
+
if (padding) {
|
|
104
|
+
const take = Math.min(padding, pending.length);
|
|
105
|
+
padding -= take;
|
|
106
|
+
pending = pending.subarray(take);
|
|
107
|
+
if (padding) break;
|
|
108
|
+
}
|
|
109
|
+
if (pending.length < 512) break;
|
|
110
|
+
const header = pending.subarray(0, 512);
|
|
111
|
+
pending = pending.subarray(512);
|
|
112
|
+
if (header.every(byte => byte === 0)) { zeroBlocks++; continue; }
|
|
113
|
+
if (zeroBlocks) fail();
|
|
114
|
+
if (++count > MAX_ENTRIES) fail();
|
|
115
|
+
const checksum = number(header.subarray(148, 156));
|
|
116
|
+
let sum = 0;
|
|
117
|
+
for (let i = 0; i < 512; i++) sum += i >= 148 && i < 156 ? 32 : header[i];
|
|
118
|
+
if (checksum !== sum) fail();
|
|
119
|
+
const type = String.fromCharCode(header[156] || 48);
|
|
120
|
+
if (!['0', '5', 'x', 'g', 'L'].includes(type)) fail();
|
|
121
|
+
let size = number(header.subarray(124, 136));
|
|
122
|
+
const metadata = ['x', 'g', 'L'].includes(type);
|
|
123
|
+
if (metadata && size > 65_536) fail();
|
|
124
|
+
if (!metadata && extended.size !== undefined) {
|
|
125
|
+
if (!/^[0-9]+$/.test(extended.size)) fail();
|
|
126
|
+
size = Number(extended.size);
|
|
127
|
+
if (!Number.isSafeInteger(size) || size > MAX_EXPANDED) fail();
|
|
128
|
+
}
|
|
129
|
+
if (size > maxExpanded || (type === '5' && size !== 0)) fail();
|
|
130
|
+
const prefix = header.subarray(257, 263).equals(Buffer.from('ustar\0')) ? text(header.subarray(345, 500)) : '';
|
|
131
|
+
const name = text(header.subarray(0, 100));
|
|
132
|
+
entry = { type, size, remaining: size,
|
|
133
|
+
name: metadata ? name : extended.path ?? longName ?? (prefix ? prefix + '/' + name : name),
|
|
134
|
+
executable: Boolean(number(header.subarray(100, 108)) & 0o111),
|
|
135
|
+
...(metadata ? { parts: [] } : type === '0' ? { digest: createHash('sha256') } : {}),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (entry || padding || zeroBlocks < 2 || pending.some(byte => byte !== 0) || !files.size || longName || Object.keys(extended).length) fail();
|
|
140
|
+
const entries = [...files.values()].sort((a, b) => a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0);
|
|
141
|
+
return hash(JSON.stringify(entries));
|
|
142
|
+
} catch {
|
|
143
|
+
fail();
|
|
144
|
+
} finally {
|
|
145
|
+
input.destroy();
|
|
146
|
+
unzip.destroy();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export async function releaseContent(prepared) {
|
|
151
|
+
const frontend = await archiveContent(prepared.frontendFile);
|
|
152
|
+
const backend = prepared.manifest.build.backendRequired
|
|
153
|
+
? await archiveContent(prepared.backendFile, 100 * 1024 * 1024) : undefined;
|
|
154
|
+
const fingerprint = hash(JSON.stringify([
|
|
155
|
+
'microapp-content-v1', prepared.code, frontend, backend || '',
|
|
156
|
+
prepared.manifest.build.backendRequired, prepared.manifest.build.databaseRequired, prepared.schema || '',
|
|
157
|
+
]));
|
|
158
|
+
return { fingerprint, frontend, ...(backend ? { backend } : {}) };
|
|
159
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { homedir } from 'node:os';
|
|
4
|
+
import { layout, ensureDirectory, privatePath, readState, writeState, hash, fail } from './auth/state.mjs';
|
|
5
|
+
|
|
6
|
+
const DIGEST = /^[a-f0-9]{64}$/;
|
|
7
|
+
const ID = /^[A-Za-z0-9_-]{1,64}$/;
|
|
8
|
+
export function publicationContext(project, { stateRoot, environment = process.env } = {}) {
|
|
9
|
+
const base = stateRoot || join(environment.TUYA_MICROAPP_HOME || join(homedir(), '.tuya-microapp'), 'state');
|
|
10
|
+
const context = layout(project, { stateRoot: join(base, 'publications'), environment });
|
|
11
|
+
return { ...context, file: join(context.root, hash(context.project) + '.json') };
|
|
12
|
+
}
|
|
13
|
+
export function readIndex(context) {
|
|
14
|
+
const index = readState(context.file) || { format: 'microapp-publications-v1', project: context.project, entries: [] };
|
|
15
|
+
if (index.format !== 'microapp-publications-v1' || index.project !== context.project
|
|
16
|
+
|| !Array.isArray(index.entries) || index.entries.length > 10_000) fail('PUBLICATION_INDEX_INVALID');
|
|
17
|
+
const ids = new Set();
|
|
18
|
+
for (const entry of index.entries) {
|
|
19
|
+
if (!ID.test(entry.id || '') || ids.has(entry.id) || !ID.test(entry.backendRequestId || '')
|
|
20
|
+
|| !DIGEST.test(entry.scope || '') || !DIGEST.test(entry.contentFingerprint || '')
|
|
21
|
+
|| !DIGEST.test(entry.artifactFingerprint || '') || !DIGEST.test(entry.identity || '')
|
|
22
|
+
|| typeof entry.output !== 'string' || typeof entry.code !== 'string') fail('PUBLICATION_INDEX_INVALID');
|
|
23
|
+
ids.add(entry.id);
|
|
24
|
+
}
|
|
25
|
+
return index;
|
|
26
|
+
}
|
|
27
|
+
export function saveIndex(context, index) {
|
|
28
|
+
writeState(context.file, index);
|
|
29
|
+
}
|
|
30
|
+
export function publicationScope(context, credentials, code) {
|
|
31
|
+
return hash(JSON.stringify([context.project, credentials.baseUrl, credentials.developerCode, code]));
|
|
32
|
+
}
|
|
33
|
+
export function localEntry(entry) {
|
|
34
|
+
const result = entry.result || {};
|
|
35
|
+
return {
|
|
36
|
+
publicationId: entry.id,
|
|
37
|
+
code: entry.code,
|
|
38
|
+
output: entry.output,
|
|
39
|
+
contentFingerprint: entry.contentFingerprint,
|
|
40
|
+
accountScope: entry.scope,
|
|
41
|
+
createdAt: entry.createdAt,
|
|
42
|
+
updatedAt: entry.updatedAt,
|
|
43
|
+
status: ['running', 'complete', 'failed', 'unknown'].includes(result.status) ? result.status : 'unknown',
|
|
44
|
+
stage: /^[A-Z][A-Z0-9_]{0,63}$/.test(result.stage || '') ? result.stage : 'UNKNOWN',
|
|
45
|
+
...(ID.test(result.releaseId || '') ? { releaseId: result.releaseId } : {}),
|
|
46
|
+
...(ID.test(result.buildTaskId || '') ? { buildTaskId: result.buildTaskId } : {}),
|
|
47
|
+
...(/^[0-9]+\.[0-9]+\.[0-9]+-[0-9]+$/.test(result.microAppVersion || '') ? { microAppVersion: result.microAppVersion } : {}),
|
|
48
|
+
...(entry.retryOf ? { retryOf: entry.retryOf } : {}),
|
|
49
|
+
authoritative: false,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export function publicationHistory(options) {
|
|
53
|
+
const context = publicationContext(options.project, options);
|
|
54
|
+
return { operation: 'release.history', status: 'complete', authoritative: false,
|
|
55
|
+
publications: readIndex(context).entries.map(localEntry) };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// This lease covers selection, durable intent and each complete platform service interaction,
|
|
59
|
+
// including direct CLI calls and temporary credential workers.
|
|
60
|
+
export function publicationLease(context) {
|
|
61
|
+
ensureDirectory(context.root);
|
|
62
|
+
const directory = join(context.root, hash(context.project) + '.lock');
|
|
63
|
+
const record = join(directory, 'owner.json');
|
|
64
|
+
privatePath(directory);
|
|
65
|
+
if (existsSync(directory)) {
|
|
66
|
+
const previous = readState(record);
|
|
67
|
+
if (!previous || !Number.isInteger(previous.pid) || previous.pid <= 0) fail('PUBLICATION_BUSY');
|
|
68
|
+
try {
|
|
69
|
+
process.kill(previous.pid, 0);
|
|
70
|
+
fail('PUBLICATION_BUSY');
|
|
71
|
+
} catch (error) {
|
|
72
|
+
if (error.code !== 'ESRCH') throw error;
|
|
73
|
+
}
|
|
74
|
+
rmSync(directory, { recursive: true });
|
|
75
|
+
}
|
|
76
|
+
try { mkdirSync(directory, { mode: 0o700 }); }
|
|
77
|
+
catch { fail('PUBLICATION_BUSY'); }
|
|
78
|
+
try { writeFileSync(record, JSON.stringify({ pid: process.pid }), { flag: 'wx', mode: 0o600 }); }
|
|
79
|
+
catch { rmSync(directory, { recursive: true, force: true }); fail('PUBLICATION_BUSY'); }
|
|
80
|
+
return () => rmSync(directory, { recursive: true, force: true });
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function readPublicationFile(output) {
|
|
84
|
+
const path = join(output, 'publication.json');
|
|
85
|
+
if (!existsSync(path)) return undefined;
|
|
86
|
+
// The output is already checked by inspectPreparedRelease. Metadata still must
|
|
87
|
+
// be a real, private file before it can nominate an original request.
|
|
88
|
+
privatePath(path);
|
|
89
|
+
try { return JSON.parse(readFileSync(path, 'utf8')); }
|
|
90
|
+
catch { fail('PUBLICATION_INDEX_INVALID'); }
|
|
91
|
+
}
|