@tbox.cn/app-template-agent 1.0.0-alpha.1 → 1.0.0-alpha.10
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/._.gitignore +0 -0
- package/._.nvmrc +0 -0
- package/._AGENTS.md +0 -0
- package/._ENV.md +0 -0
- package/._LEGAL.md +0 -0
- package/._LICENSE +0 -0
- package/._README.md +0 -0
- package/._eslint.config.mjs +0 -0
- package/._package.json +0 -0
- package/._pnpm-lock.template.yaml +0 -0
- package/._pnpm-workspace.template.yaml +0 -0
- package/._tsconfig.base.json +0 -0
- package/.gitignore +14 -2
- package/.tbox/._app.json +0 -0
- package/.tbox/._default-modules.json +0 -0
- package/.tbox/._miniapp-containers.json +0 -0
- package/.tbox/app.json +1 -1
- package/.tbox/default-modules.json +1 -1
- package/.tbox/factory/._chat.json +0 -0
- package/.tbox/factory/chat.json +9 -0
- package/.tbox/miniapp-containers.json +1 -1
- package/AGENTS.md +62 -13
- package/ENV.md +4 -4
- package/README.md +22 -20
- package/apps/._AGENTS.md +0 -0
- package/apps/AGENTS.md +0 -4
- package/apps/client/._index.html +0 -0
- package/apps/client/._package.json +0 -0
- package/apps/client/._tsconfig.json +0 -0
- package/apps/client/._vite.config.ts +0 -0
- package/apps/client/index.html +1 -20
- package/apps/client/package.json +4 -3
- package/apps/client/scripts/._acceptance-changes.test.mjs +0 -0
- package/apps/client/scripts/._check-evidence.mjs +0 -0
- package/apps/client/scripts/._color-scan.mjs +0 -0
- package/apps/client/scripts/._color-scan.test.mjs +0 -0
- package/apps/client/scripts/._evidence-gate.mjs +0 -0
- package/apps/client/scripts/._evidence-gate.test.mjs +0 -0
- package/apps/client/scripts/._experience-checks.mjs +0 -0
- package/apps/client/scripts/._geometry-kernel.test.mjs +0 -0
- package/apps/client/scripts/._in-process-checks.mjs +0 -0
- package/apps/client/scripts/._probe-checks.mjs +0 -0
- package/apps/client/scripts/._render-card.mjs +0 -0
- package/apps/client/scripts/._sample-entries.test.mjs +0 -0
- package/apps/client/scripts/._storyboard.test.mjs +0 -0
- package/apps/client/scripts/._surface-css.mjs +0 -0
- package/apps/client/scripts/._theme-kernel.mjs +0 -0
- package/apps/client/scripts/._theme-kernel.test.mjs +0 -0
- package/apps/client/scripts/acceptance-changes.test.mjs +97 -0
- package/apps/client/scripts/check-evidence.mjs +1402 -0
- package/apps/client/scripts/color-scan.mjs +66 -0
- package/apps/client/scripts/color-scan.test.mjs +25 -0
- package/apps/client/scripts/evidence-gate.mjs +337 -0
- package/apps/client/scripts/evidence-gate.test.mjs +135 -0
- package/apps/client/scripts/experience-checks.mjs +163 -0
- package/apps/client/scripts/geometry-kernel.test.mjs +92 -0
- package/apps/client/scripts/in-process-checks.mjs +51 -0
- package/apps/client/scripts/lib/._card-registry.mjs +0 -0
- package/apps/client/scripts/lib/._card-registry.test.mjs +0 -0
- package/apps/client/scripts/lib/._evidence-inputs.mjs +0 -0
- package/apps/client/scripts/lib/._evidence-inputs.test.mjs +0 -0
- package/apps/client/scripts/lib/._static-render.mjs +0 -0
- package/apps/client/scripts/lib/._static-render.test.mjs +0 -0
- package/apps/client/scripts/lib/card-registry.mjs +81 -0
- package/apps/client/scripts/lib/card-registry.test.mjs +59 -0
- package/apps/client/scripts/lib/evidence-inputs.mjs +91 -0
- package/apps/client/scripts/lib/evidence-inputs.test.mjs +27 -0
- package/apps/client/scripts/lib/static-render.mjs +35 -0
- package/apps/client/scripts/lib/static-render.test.mjs +21 -0
- package/apps/client/scripts/probe-checks.mjs +85 -0
- package/apps/client/scripts/render-card.mjs +710 -0
- package/apps/client/scripts/sample-entries.test.mjs +31 -0
- package/apps/client/scripts/storyboard.test.mjs +149 -0
- package/apps/client/scripts/surface-css.mjs +55 -0
- package/apps/client/scripts/theme-kernel.mjs +236 -0
- package/apps/client/scripts/theme-kernel.test.mjs +136 -0
- package/apps/client/src/._app.config.ts +0 -0
- package/apps/client/src/._vite-env.d.ts +0 -0
- package/apps/client/src/app.config.ts +43 -0
- package/apps/client/src/cards/._AGENTS.md +0 -0
- package/apps/client/src/cards/._registry.ts +0 -0
- package/apps/client/src/cards/AGENTS.md +11 -0
- package/apps/client/src/pages/._page.tsx +0 -0
- package/apps/client/src/pages/index/._index.tsx +0 -0
- package/apps/client/src/pages/index/index.tsx +1 -1
- package/apps/client/src/pages/page.tsx +2 -2
- package/apps/client/src/store/._chat.ts +0 -0
- package/apps/client/src/store/chat.ts +7 -3
- package/apps/client/src/styles/._brand.css +0 -0
- package/apps/client/src/styles/._tailwind.css +0 -0
- package/apps/client/src/styles/brand.css +50 -0
- package/apps/client/src/styles/tailwind.css +326 -0
- package/apps/client/src/test/._setup.ts +0 -0
- package/apps/client/src/vite-env.d.ts +0 -2
- package/apps/client/vite.config.ts +8 -23
- package/apps/server/._package.json +0 -0
- package/apps/server/._tsconfig.json +0 -0
- package/apps/server/._tsup.config.ts +0 -0
- package/apps/server/._vitest.config.ts +0 -0
- package/apps/server/scripts/._probe.mjs +0 -0
- package/apps/server/scripts/._scenario-lib.mjs +0 -0
- package/apps/server/scripts/._scenario.mjs +0 -0
- package/apps/server/scripts/probe.mjs +387 -0
- package/apps/server/scripts/scenario-lib.mjs +295 -0
- package/apps/server/scripts/scenario.mjs +67 -0
- package/apps/server/src/._app.ts +0 -0
- package/apps/server/src/._dev.ts +0 -0
- package/apps/server/src/._index.ts +0 -0
- package/apps/server/src/._intent-routes.ts +0 -0
- package/apps/server/src/._pre-tools.ts +0 -0
- package/apps/server/src/app.ts +10 -3
- package/apps/server/src/cards/._AGENTS.md +0 -0
- package/apps/server/src/cards/AGENTS.md +19 -0
- package/apps/server/src/cli/._collect-registry.ts +0 -0
- package/apps/server/src/cli/._plugin-doctor.ts +0 -0
- package/apps/server/src/cli/._plugin-inspect.ts +0 -0
- package/apps/server/src/config/._integration.ts +0 -0
- package/apps/server/src/dev.ts +2 -2
- package/apps/server/src/index.ts +2 -2
- package/apps/server/src/pre-tools.ts +7 -16
- package/apps/server/src/tools/._AGENTS.md +0 -0
- package/apps/server/src/tools/AGENTS.md +23 -0
- package/apps/server/tests/._agent-prompt.test.ts +0 -0
- package/apps/server/tests/._cards-registry.test.ts +0 -0
- package/apps/server/tests/._deployment-loader.test.ts +0 -0
- package/apps/server/tests/._intent-dispatcher.test.ts +0 -0
- package/apps/server/tests/._tool-runtime.test.ts +0 -0
- package/apps/server/tests/helpers/._register.ts +0 -0
- package/apps/server/tests/tool-runtime.test.ts +0 -27
- package/config/._AGENTS.md +0 -0
- package/config/._README.md +0 -0
- package/config/._chat.json +0 -0
- package/config/._integrations.json +0 -0
- package/config/._llm_provider.json +0 -0
- package/config/._plugins.json +0 -0
- package/config/AGENTS.md +14 -0
- package/config/README.md +4 -4
- package/config/chat.json +25 -7
- package/config/integrations.json +1 -1
- package/docs/agent/._agent-prompt.md +0 -0
- package/docs/agent/._card-action.md +0 -0
- package/docs/agent/._card.md +0 -0
- package/docs/agent/._conversation.md +0 -0
- package/docs/agent/._kit.md +0 -0
- package/docs/agent/._shell.md +0 -0
- package/docs/agent/._state.md +0 -0
- package/docs/agent/._style.md +0 -0
- package/docs/agent/._tool-emits-card.md +0 -0
- package/docs/agent/._tool.md +0 -0
- package/docs/agent/._verify.md +0 -0
- package/docs/agent/agent-prompt.md +38 -0
- package/docs/agent/card-action.md +101 -0
- package/docs/agent/card.md +159 -0
- package/docs/agent/conversation.md +52 -0
- package/docs/agent/kit.md +80 -0
- package/docs/agent/shell.md +77 -0
- package/docs/agent/state.md +85 -0
- package/docs/agent/style.md +107 -0
- package/docs/agent/tool-emits-card.md +62 -0
- package/docs/agent/tool.md +71 -0
- package/docs/agent/verify.md +188 -0
- package/eslint.config.mjs +18 -0
- package/modules/provider-custom/._AGENTS.md +0 -0
- package/modules/provider-custom/._INTEGRATION.md +0 -0
- package/modules/provider-custom/._LICENSE +0 -0
- package/modules/provider-custom/._README.md +0 -0
- package/modules/provider-custom/._package.json +0 -0
- package/modules/provider-custom/._tbox.module.json +0 -0
- package/modules/provider-custom/._tsconfig.json +0 -0
- package/modules/provider-custom/._tsup.config.ts +0 -0
- package/modules/provider-custom/AGENTS.md +5 -5
- package/modules/provider-custom/INTEGRATION.md +2 -2
- package/modules/provider-custom/src/._index.ts +0 -0
- package/modules/provider-custom/src/server/._example-adapter.ts +0 -0
- package/modules/provider-custom/src/server/._index.ts +0 -0
- package/modules/provider-custom/src/server/example-adapter.ts +2 -2
- package/modules/provider-custom/src/server/index.ts +1 -1
- package/modules/provider-custom/tests/._provider-custom.test.ts +0 -0
- package/package.json +31 -5
- package/packages/agent-ui-kit/._AGENTS.md +0 -0
- package/packages/agent-ui-kit/._LICENSE +0 -0
- package/packages/agent-ui-kit/._README.md +0 -0
- package/packages/agent-ui-kit/._catalog.json +0 -0
- package/packages/agent-ui-kit/._package.json +0 -0
- package/packages/agent-ui-kit/._tsconfig.json +0 -0
- package/packages/agent-ui-kit/._vitest.config.ts +0 -0
- package/packages/agent-ui-kit/AGENTS.md +8 -0
- package/packages/agent-ui-kit/README.md +59 -6
- package/packages/agent-ui-kit/assets/._keyboard-circle.svg +0 -0
- package/packages/agent-ui-kit/assets/._more-circle.svg +0 -0
- package/packages/agent-ui-kit/assets/._new-chat.svg +0 -0
- package/packages/agent-ui-kit/assets/._quick-command-star.svg +0 -0
- package/packages/agent-ui-kit/assets/._send-gradient.svg +0 -0
- package/packages/agent-ui-kit/assets/._stop@2x.png +0 -0
- package/packages/agent-ui-kit/assets/._voice-circle.svg +0 -0
- package/packages/agent-ui-kit/catalog.json +855 -0
- package/packages/agent-ui-kit/package.json +24 -9
- package/packages/agent-ui-kit/src/._ChatPage.tsx +0 -0
- package/packages/agent-ui-kit/src/._chat-config.test.ts +0 -0
- package/packages/agent-ui-kit/src/._chat-config.ts +0 -0
- package/packages/agent-ui-kit/src/._icons.ts +0 -0
- package/packages/agent-ui-kit/src/._index.ts +0 -0
- package/packages/agent-ui-kit/src/._preview-provider.tsx +0 -0
- package/packages/agent-ui-kit/src/._shell.contract.json +0 -0
- package/packages/agent-ui-kit/src/._shell.test.ts +0 -0
- package/packages/agent-ui-kit/src/._shell.ts +0 -0
- package/packages/agent-ui-kit/src/._store-context.tsx +0 -0
- package/packages/agent-ui-kit/src/._surface.test.tsx +0 -0
- package/packages/agent-ui-kit/src/._surface.tsx +0 -0
- package/packages/agent-ui-kit/src/._types.ts +0 -0
- package/packages/agent-ui-kit/src/._vite-env.d.ts +0 -0
- package/packages/agent-ui-kit/src/ChatPage.tsx +115 -20
- package/packages/agent-ui-kit/src/card/._action-list-pending.test.tsx +0 -0
- package/packages/agent-ui-kit/src/card/._define-card.test.ts +0 -0
- package/packages/agent-ui-kit/src/card/._define-card.ts +0 -0
- package/packages/agent-ui-kit/src/card/._primitives.test.tsx +0 -0
- package/packages/agent-ui-kit/src/card/._primitives.tsx +0 -0
- package/packages/agent-ui-kit/src/card/._use-card-actions.ts +0 -0
- package/packages/agent-ui-kit/src/card/._view-card-inline.test.tsx +0 -0
- package/packages/agent-ui-kit/src/card/._view-card.test.tsx +0 -0
- package/packages/agent-ui-kit/src/card/._view-card.tsx +0 -0
- package/packages/agent-ui-kit/src/card/action-list-pending.test.tsx +91 -0
- package/packages/agent-ui-kit/src/card/define-card.test.ts +25 -0
- package/packages/agent-ui-kit/src/card/define-card.ts +47 -0
- package/packages/agent-ui-kit/src/card/primitives.test.tsx +157 -0
- package/packages/agent-ui-kit/src/card/primitives.tsx +717 -0
- package/packages/agent-ui-kit/src/card/use-card-actions.ts +86 -0
- package/packages/agent-ui-kit/src/card/view-card-inline.test.tsx +42 -0
- package/packages/agent-ui-kit/src/card/view-card.test.tsx +79 -0
- package/packages/agent-ui-kit/src/card/view-card.tsx +250 -0
- package/packages/agent-ui-kit/src/chat-config.test.ts +35 -71
- package/packages/agent-ui-kit/src/chat-config.ts +29 -7
- package/packages/agent-ui-kit/src/components/._CardRenderer.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ActionBar/._DebugButton.test.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ActionBar/._DebugButton.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ActionBar/._index.test.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ActionBar/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ActionBar/DebugButton.test.tsx +3 -0
- package/packages/agent-ui-kit/src/components/ActionBar/DebugButton.tsx +5 -10
- package/packages/agent-ui-kit/src/components/ActionBar/index.tsx +13 -14
- package/packages/agent-ui-kit/src/components/BottomSheet/._index.test.tsx +0 -0
- package/packages/agent-ui-kit/src/components/BottomSheet/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/BottomSheet/index.test.tsx +97 -0
- package/packages/agent-ui-kit/src/components/BottomSheet/index.tsx +49 -0
- package/packages/agent-ui-kit/src/components/ChatHeader/._index.test.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ChatHeader/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ChatHeader/index.tsx +19 -17
- package/packages/agent-ui-kit/src/components/ChatInput/._index.test.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ChatInput/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ChatInput/index.test.tsx +2 -2
- package/packages/agent-ui-kit/src/components/ChatInput/index.tsx +44 -33
- package/packages/agent-ui-kit/src/components/ChatInput/voice/._VoicePressField.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ChatInput/voice/._VoiceRecordingOverlay.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ChatInput/voice/._machine.ts +0 -0
- package/packages/agent-ui-kit/src/components/ChatInput/voice/._useVoicePress.ts +0 -0
- package/packages/agent-ui-kit/src/components/ChatInput/voice/VoicePressField.tsx +12 -3
- package/packages/agent-ui-kit/src/components/ChatInput/voice/VoiceRecordingOverlay.tsx +9 -9
- package/packages/agent-ui-kit/src/components/ChatInput/voice/useVoicePress.ts +1 -1
- package/packages/agent-ui-kit/src/components/HistoryEntry/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/HistoryEntry/index.tsx +4 -4
- package/packages/agent-ui-kit/src/components/MediaList/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/MediaList/index.tsx +42 -28
- package/packages/agent-ui-kit/src/components/MessageBubble/._index.test.tsx +0 -0
- package/packages/agent-ui-kit/src/components/MessageBubble/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/MessageBubble/index.tsx +59 -28
- package/packages/agent-ui-kit/src/components/PullDownIndicator/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/PullDownIndicator/index.tsx +3 -4
- package/packages/agent-ui-kit/src/components/QuickCommands/._index.test.tsx +0 -0
- package/packages/agent-ui-kit/src/components/QuickCommands/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/QuickCommands/index.test.tsx +3 -1
- package/packages/agent-ui-kit/src/components/QuickCommands/index.tsx +33 -10
- package/packages/agent-ui-kit/src/components/ReasoningBlock/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ReasoningBlock/index.tsx +14 -9
- package/packages/agent-ui-kit/src/components/ScrollToBottomButton/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ScrollToBottomButton/index.tsx +7 -5
- package/packages/agent-ui-kit/src/components/ToolCallBlock/._detail.test.ts +0 -0
- package/packages/agent-ui-kit/src/components/ToolCallBlock/._detail.ts +0 -0
- package/packages/agent-ui-kit/src/components/ToolCallBlock/._index.test.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ToolCallBlock/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ToolCallBlock/._titles.ts +0 -0
- package/packages/agent-ui-kit/src/components/ToolCallBlock/index.tsx +58 -38
- package/packages/agent-ui-kit/src/hooks/._use-drag-gesture.test.ts +0 -0
- package/packages/agent-ui-kit/src/hooks/._use-drag-gesture.ts +0 -0
- package/packages/agent-ui-kit/src/hooks/._use-pull-down-history.ts +0 -0
- package/packages/agent-ui-kit/src/hooks/._use-pull-down-wheel-native.test.ts +0 -0
- package/packages/agent-ui-kit/src/hooks/._useMediaUpload.ts +0 -0
- package/packages/agent-ui-kit/src/hooks/._useTTSAutoPlay.ts +0 -0
- package/packages/agent-ui-kit/src/icons.ts +39 -0
- package/packages/agent-ui-kit/src/index.ts +76 -2
- package/packages/agent-ui-kit/src/overlay/._Overlay.tsx +0 -0
- package/packages/agent-ui-kit/src/overlay/._focus.ts +0 -0
- package/packages/agent-ui-kit/src/overlay/._index.ts +0 -0
- package/packages/agent-ui-kit/src/overlay/._inert.ts +0 -0
- package/packages/agent-ui-kit/src/overlay/._layers.ts +0 -0
- package/packages/agent-ui-kit/src/overlay/._overlay.ssr.test.tsx +0 -0
- package/packages/agent-ui-kit/src/overlay/._overlay.test.tsx +0 -0
- package/packages/agent-ui-kit/src/overlay/._presence.ts +0 -0
- package/packages/agent-ui-kit/src/overlay/._scroll-lock.ts +0 -0
- package/packages/agent-ui-kit/src/overlay/._stack.ts +0 -0
- package/packages/agent-ui-kit/src/overlay/._use-overlay.ts +0 -0
- package/packages/agent-ui-kit/src/overlay/Overlay.tsx +154 -0
- package/packages/agent-ui-kit/src/overlay/focus.ts +53 -0
- package/packages/agent-ui-kit/src/overlay/index.ts +16 -0
- package/packages/agent-ui-kit/src/overlay/inert.ts +27 -0
- package/packages/agent-ui-kit/src/overlay/layers.ts +21 -0
- package/packages/agent-ui-kit/src/overlay/overlay.ssr.test.tsx +27 -0
- package/packages/agent-ui-kit/src/overlay/overlay.test.tsx +209 -0
- package/packages/agent-ui-kit/src/overlay/presence.ts +86 -0
- package/packages/agent-ui-kit/src/overlay/scroll-lock.ts +62 -0
- package/packages/agent-ui-kit/src/overlay/stack.ts +111 -0
- package/packages/agent-ui-kit/src/overlay/use-overlay.ts +80 -0
- package/packages/agent-ui-kit/src/preview-provider.tsx +47 -0
- package/packages/agent-ui-kit/src/shell.contract.json +75 -0
- package/packages/agent-ui-kit/src/shell.test.ts +72 -0
- package/packages/agent-ui-kit/src/shell.ts +60 -0
- package/packages/agent-ui-kit/src/surface.test.tsx +35 -0
- package/packages/agent-ui-kit/src/surface.tsx +44 -0
- package/packages/agent-ui-kit/src/test/._setup.ts +0 -0
- package/packages/agent-ui-kit/src/theme/._base.css +0 -0
- package/packages/agent-ui-kit/src/theme/._contract.json +0 -0
- package/packages/agent-ui-kit/src/theme/._motion.css +0 -0
- package/packages/agent-ui-kit/src/theme/._theme-contract.test.ts +0 -0
- package/packages/agent-ui-kit/src/theme/._theme.ts +0 -0
- package/packages/agent-ui-kit/src/theme/._tokens.css +0 -0
- package/packages/agent-ui-kit/src/theme/base.css +167 -0
- package/packages/agent-ui-kit/src/theme/contract.json +123 -2
- package/packages/agent-ui-kit/src/theme/theme-contract.test.ts +19 -3
- package/packages/agent-ui-kit/src/theme/{tokens.less → tokens.css} +19 -20
- package/packages/agent-ui-kit/src/utils/._copyText.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._haptics.test.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._haptics.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._image-preview-host.tsx +0 -0
- package/packages/agent-ui-kit/src/utils/._imagePreview.test.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._imagePreview.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._pull-down-machine.test.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._pull-down-machine.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._session-error.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._toast.test.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._toast.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._tool-call-display.test.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._tool-call-display.ts +0 -0
- package/packages/agent-ui-kit/src/utils/image-preview-host.tsx +95 -0
- package/packages/agent-ui-kit/src/utils/imagePreview.test.ts +32 -0
- package/packages/agent-ui-kit/src/utils/imagePreview.ts +14 -5
- package/packages/agent-ui-kit/src/utils/toast.test.ts +64 -0
- package/packages/agent-ui-kit/src/utils/toast.ts +100 -7
- package/packages/contracts-mall/._package.json +0 -0
- package/packages/contracts-mall/._tsconfig.json +0 -0
- package/packages/contracts-mall/src/._index.ts +0 -0
- package/packages/contracts-mall/src/._runtime.ts +0 -0
- package/packages/contracts-mall/src/server/._index.ts +0 -0
- package/packages/shared/._AGENTS.md +0 -0
- package/packages/shared/._package.json +0 -0
- package/packages/shared/._tsconfig.json +0 -0
- package/packages/shared/AGENTS.md +4 -2
- package/packages/shared/package.json +7 -0
- package/packages/shared/src/._index.ts +0 -0
- package/pnpm-lock.template.yaml +714 -797
- package/pnpm-workspace.template.yaml +18 -12
- package/profiles/._mall.json +0 -0
- package/profiles/mall/._TEMPLATE.md +0 -0
- package/profiles/mall/._chat.overrides.json +0 -0
- package/profiles/mall/chat.overrides.json +12 -0
- package/profiles/mall/config/._agent.jsonc +0 -0
- package/profiles/mall/config/._chat.json +0 -0
- package/profiles/mall/config/._knowledge.json +0 -0
- package/profiles/mall/config/chat.json +14 -6
- package/profiles/mall.json +2 -2
- package/scenarios/._README.md +0 -0
- package/scenarios/README.md +7 -0
- package/scripts/._assert-pack.mjs +0 -0
- package/scripts/._build.sh +0 -0
- package/scripts/._check-css-target.mjs +0 -0
- package/scripts/._check-fast.mjs +0 -0
- package/scripts/._check-workspace.mjs +0 -0
- package/scripts/._checks.json +0 -0
- package/scripts/._deliver.mjs +0 -0
- package/scripts/._dev-alipay.mjs +0 -0
- package/scripts/._dev.sh +0 -0
- package/scripts/._generate.mjs +0 -0
- package/scripts/._prepare.sh +0 -0
- package/scripts/._shell-probe.mjs +0 -0
- package/scripts/._smoke.mjs +0 -0
- package/scripts/._start.sh +0 -0
- package/scripts/._stop.sh +0 -0
- package/scripts/._storyboard.mjs +0 -0
- package/scripts/._verify-generated.mjs +0 -0
- package/scripts/assert-pack.mjs +48 -0
- package/scripts/check-css-target.mjs +54 -0
- package/scripts/check-fast.mjs +119 -0
- package/scripts/check-workspace.mjs +68 -19
- package/scripts/checks.json +627 -0
- package/scripts/deliver.mjs +183 -0
- package/scripts/dev-alipay.mjs +1 -1
- package/scripts/lib/._chrome-pipe.mjs +0 -0
- package/scripts/lib/._geometry-kernel.mjs +0 -0
- package/scripts/lib/chrome-pipe.mjs +95 -0
- package/scripts/lib/geometry-kernel.mjs +137 -0
- package/scripts/shell-probe.mjs +280 -0
- package/scripts/storyboard.mjs +350 -0
- package/tsconfig.base.json +1 -0
- package/apps/client/.tbox-gen/app-kind.ts +0 -1
- package/apps/client/.tbox-gen/documents/_tbox/card-preview.html +0 -38
- package/apps/client/.tbox-gen/documents/index.html +0 -39
- package/apps/client/.tbox-gen/entries/card-preview.tsx +0 -18
- package/apps/client/.tbox-gen/entries/index.tsx +0 -18
- package/apps/client/.tbox-gen/manifest.json +0 -17
- package/apps/client/.tbox-gen/registry.client.ts +0 -6
- package/apps/client/.tbox-gen/registry.server.ts +0 -15
- package/apps/client/STYLE_GUIDE.md +0 -81
- package/apps/client/VISUAL_RESTORE.md +0 -90
- package/apps/client/src/platform/AgentChatApp.tsx +0 -6
- package/apps/client/src/platform/AppShell.tsx +0 -42
- package/apps/client/src/platform/agent-runtime.ts +0 -16
- package/apps/client/src/platform/bootstrap.ts +0 -55
- package/apps/client/src/platform/card-preview-page.tsx +0 -10
- package/apps/client/src/platform/mount-page.tsx +0 -20
- package/apps/client/src/platform/state/createPersistedStore.ts +0 -19
- package/apps/server/src/tools/clock.tool.ts +0 -24
- package/apps/server/src/tools/translate.tool.ts +0 -47
- package/packages/agent-ui-kit/src/ChatPage.less +0 -62
- package/packages/agent-ui-kit/src/components/ActionBar/index.less +0 -123
- package/packages/agent-ui-kit/src/components/ChatHeader/index.less +0 -148
- package/packages/agent-ui-kit/src/components/ChatInput/index.less +0 -394
- package/packages/agent-ui-kit/src/components/HistoryEntry/index.less +0 -49
- package/packages/agent-ui-kit/src/components/MediaList/index.less +0 -241
- package/packages/agent-ui-kit/src/components/MessageBubble/index.less +0 -325
- package/packages/agent-ui-kit/src/components/PullDownIndicator/index.less +0 -32
- package/packages/agent-ui-kit/src/components/QuickCommands/index.less +0 -63
- package/packages/agent-ui-kit/src/components/ReasoningBlock/index.less +0 -90
- package/packages/agent-ui-kit/src/components/ScrollToBottomButton/index.less +0 -32
- package/packages/agent-ui-kit/src/components/ToolCallBlock/index.less +0 -312
- package/packages/agent-ui-kit/src/theme/global.less +0 -99
- package/profiles/mall/config/llm_provider.json +0 -5
- package/profiles/mall/config/plugins.json +0 -3
- /package/packages/agent-ui-kit/src/theme/{motion.less → motion.css} +0 -0
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="zh-CN">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<!-- 移动端视口;缩放锁定,配合 postcss-pxtorem 的 750→rem 换算 -->
|
|
6
|
-
<meta
|
|
7
|
-
name="viewport"
|
|
8
|
-
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
|
|
9
|
-
/>
|
|
10
|
-
<meta name="theme-color" content="#fbfcfe" />
|
|
11
|
-
<!-- rem 弹性根字号(对齐原模板 hd.ts:threshold 450 / designWidth 750)。
|
|
12
|
-
在 CSS 前同步执行,避免首屏字号闪动。
|
|
13
|
-
- 移动端(clientWidth<=450):动态 (100/750)*clientWidth;
|
|
14
|
-
- PC(clientWidth>450):固定 50px(页面不随窗口缩放,内容 800px 居中、渐变底铺满)。 -->
|
|
15
|
-
<script>
|
|
16
|
-
(function () {
|
|
17
|
-
var THRESHOLD = 450,
|
|
18
|
-
DESIGN = 750;
|
|
19
|
-
function setRootFontSize() {
|
|
20
|
-
var w = document.documentElement.clientWidth;
|
|
21
|
-
document.documentElement.style.fontSize =
|
|
22
|
-
(w > THRESHOLD ? 50 : (100 / DESIGN) * w) + 'px';
|
|
23
|
-
}
|
|
24
|
-
setRootFontSize();
|
|
25
|
-
window.addEventListener('resize', setRootFontSize);
|
|
26
|
-
window.addEventListener('orientationchange', setRootFontSize);
|
|
27
|
-
})();
|
|
28
|
-
</script>
|
|
29
|
-
<!-- 出厂标题 = 此处静态值(theme-tbox brand.js 出厂不覆写标题);租户主题经其 brand.js 运行时覆写 document.title -->
|
|
30
|
-
<title>卡片预览</title>
|
|
31
|
-
<!-- 平台微调(inspector) runtime:由 server 提供 GET /__vs_inspector__.js;dev 下经 Vite 代理到 server。-->
|
|
32
|
-
|
|
33
|
-
</head>
|
|
34
|
-
<body>
|
|
35
|
-
<div id="root"></div>
|
|
36
|
-
<script type="module" src="/.tbox-gen/entries/card-preview.tsx"></script>
|
|
37
|
-
</body>
|
|
38
|
-
</html>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="zh-CN">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<!-- 移动端视口;缩放锁定,配合 postcss-pxtorem 的 750→rem 换算 -->
|
|
6
|
-
<meta
|
|
7
|
-
name="viewport"
|
|
8
|
-
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
|
|
9
|
-
/>
|
|
10
|
-
<meta name="theme-color" content="#fbfcfe" />
|
|
11
|
-
<!-- rem 弹性根字号(对齐原模板 hd.ts:threshold 450 / designWidth 750)。
|
|
12
|
-
在 CSS 前同步执行,避免首屏字号闪动。
|
|
13
|
-
- 移动端(clientWidth<=450):动态 (100/750)*clientWidth;
|
|
14
|
-
- PC(clientWidth>450):固定 50px(页面不随窗口缩放,内容 800px 居中、渐变底铺满)。 -->
|
|
15
|
-
<script>
|
|
16
|
-
(function () {
|
|
17
|
-
var THRESHOLD = 450,
|
|
18
|
-
DESIGN = 750;
|
|
19
|
-
function setRootFontSize() {
|
|
20
|
-
var w = document.documentElement.clientWidth;
|
|
21
|
-
document.documentElement.style.fontSize =
|
|
22
|
-
(w > THRESHOLD ? 50 : (100 / DESIGN) * w) + 'px';
|
|
23
|
-
}
|
|
24
|
-
setRootFontSize();
|
|
25
|
-
window.addEventListener('resize', setRootFontSize);
|
|
26
|
-
window.addEventListener('orientationchange', setRootFontSize);
|
|
27
|
-
})();
|
|
28
|
-
</script>
|
|
29
|
-
<!-- 出厂标题 = 此处静态值(theme-tbox brand.js 出厂不覆写标题);租户主题经其 brand.js 运行时覆写 document.title -->
|
|
30
|
-
<title>AI 助手</title>
|
|
31
|
-
<!-- 平台微调(inspector) runtime:由 server 提供 GET /__vs_inspector__.js;dev 下经 Vite 代理到 server。-->
|
|
32
|
-
|
|
33
|
-
<meta name="description" content="tbox AI Agent 应用" />
|
|
34
|
-
</head>
|
|
35
|
-
<body>
|
|
36
|
-
<div id="root"></div>
|
|
37
|
-
<script type="module" src="/.tbox-gen/entries/index.tsx"></script>
|
|
38
|
-
</body>
|
|
39
|
-
</html>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// @generated by @tbox.cn/app-build; do not edit.
|
|
2
|
-
import { registerClientModules, registerClientCards } from '@tbox.cn/app-sdk-client';
|
|
3
|
-
import { modules, cards } from '../registry.client.ts';
|
|
4
|
-
import { mountPage } from '../../src/platform/mount-page.tsx';
|
|
5
|
-
|
|
6
|
-
registerClientCards(cards);
|
|
7
|
-
|
|
8
|
-
async function start() {
|
|
9
|
-
try {
|
|
10
|
-
await registerClientModules(modules);
|
|
11
|
-
const { default: Page } = await import('../../src/platform/card-preview-page.tsx');
|
|
12
|
-
mountPage(Page, { shell: false });
|
|
13
|
-
} catch (error) {
|
|
14
|
-
console.error('[app-build] page bootstrap failed', error);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
void start();
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// @generated by @tbox.cn/app-build; do not edit.
|
|
2
|
-
import { registerClientModules, registerClientCards } from '@tbox.cn/app-sdk-client';
|
|
3
|
-
import { modules, cards } from '../registry.client.ts';
|
|
4
|
-
import { mountPage } from '../../src/platform/mount-page.tsx';
|
|
5
|
-
|
|
6
|
-
registerClientCards(cards);
|
|
7
|
-
|
|
8
|
-
async function start() {
|
|
9
|
-
try {
|
|
10
|
-
await registerClientModules(modules);
|
|
11
|
-
const { default: Page } = await import('../../src/pages/page.tsx');
|
|
12
|
-
mountPage(Page);
|
|
13
|
-
} catch (error) {
|
|
14
|
-
console.error('[app-build] page bootstrap failed', error);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
void start();
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": 1,
|
|
3
|
-
"pages": [
|
|
4
|
-
{
|
|
5
|
-
"path": "/",
|
|
6
|
-
"entry": "/.tbox-gen/entries/index.tsx",
|
|
7
|
-
"document": "index.html",
|
|
8
|
-
"title": "AI 助手"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"path": "/_tbox/card-preview",
|
|
12
|
-
"entry": "/.tbox-gen/entries/card-preview.tsx",
|
|
13
|
-
"document": "_tbox/card-preview.html",
|
|
14
|
-
"title": "卡片预览"
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// @generated by @tbox.cn/app-build; do not edit.
|
|
2
|
-
import { tool as tool0 } from '../../server/src/tools/clock.tool.ts';
|
|
3
|
-
import { tool as tool1 } from '../../server/src/tools/translate.tool.ts';
|
|
4
|
-
import { serverModule as module0 } from '../../../modules/provider-custom/src/server/index.ts';
|
|
5
|
-
|
|
6
|
-
export const functions = {
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const tools = [tool0, tool1];
|
|
10
|
-
export const skills = [];
|
|
11
|
-
export const cards = {
|
|
12
|
-
};
|
|
13
|
-
export const modules = [module0];
|
|
14
|
-
|
|
15
|
-
export const registry = { functions, tools, skills, cards, modules };
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
# STYLE_GUIDE.md — `client/`
|
|
2
|
-
|
|
3
|
-
纯 web(Vite + React + Less)的 CSS 约定。只列对本项目仍适用的几条;本项目是 web-view H5、不是原生小程序,**没有小程序 CSS 限制**。
|
|
4
|
-
|
|
5
|
-
## 1. 大写 `PX` 跳过 px→rem 转换
|
|
6
|
-
|
|
7
|
-
`postcss-pxtorem` 把 `px` 自动转 `rem`(写设计稿 px 即可)。当某个值需要**固定屏幕像素、不随 rem 缩放**时(典型:PC 端内容区限宽),用**大写 `PX`** —— 转换器大小写敏感,`PX` 不会被转。
|
|
8
|
-
|
|
9
|
-
```less
|
|
10
|
-
.box {
|
|
11
|
-
max-width: 800PX; /* 固定 800px,不转 rem */
|
|
12
|
-
padding: 24px; /* 24px → 0.24rem,随屏缩放 */
|
|
13
|
-
}
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
内容区最大宽度统一用 token,别到处写 `800PX`:
|
|
17
|
-
|
|
18
|
-
```less
|
|
19
|
-
max-width: var(--tbox-content-max-width); /* = 800PX */
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
> `1px` 边框默认不转(`minPixelValue`)。本项目无 stylelint,无需 `unit-case` 注释。
|
|
23
|
-
|
|
24
|
-
## 2. flex 里图标 / 图片别被压扁或溢出
|
|
25
|
-
|
|
26
|
-
flex 容器里,固定尺寸的图标 / 图片若不约束,会在同行文本触发 `text-overflow: ellipsis` 时被压缩变形,或撑开布局。
|
|
27
|
-
|
|
28
|
-
**规则:固定尺寸的 flex 子项加 `flex-shrink: 0` + 显式宽高。**
|
|
29
|
-
|
|
30
|
-
```less
|
|
31
|
-
/* 标题行:右侧箭头图标别被长标题挤压 */
|
|
32
|
-
.title-row {
|
|
33
|
-
display: flex;
|
|
34
|
-
align-items: center;
|
|
35
|
-
justify-content: space-between;
|
|
36
|
-
|
|
37
|
-
.icon { flex-shrink: 0; } /* Phosphor / img 都加 */
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/* 列表项左侧图标:固定尺寸 + 不收缩 + 裁切 */
|
|
41
|
-
.item-icon {
|
|
42
|
-
width: 72px;
|
|
43
|
-
height: 72px;
|
|
44
|
-
flex-shrink: 0;
|
|
45
|
-
overflow: hidden;
|
|
46
|
-
|
|
47
|
-
img { width: 72px; height: 72px; object-fit: contain; }
|
|
48
|
-
}
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## 3. 隐藏滚动条(移动端观感)
|
|
52
|
-
|
|
53
|
-
应用为移动端设计,滚动容器在 PC / web-view 里会冒出滚动条,与设计不符。
|
|
54
|
-
|
|
55
|
-
**规则:可滚动容器隐藏滚动条。**
|
|
56
|
-
|
|
57
|
-
```less
|
|
58
|
-
.scroll-container {
|
|
59
|
-
-ms-overflow-style: none; /* IE/Edge */
|
|
60
|
-
scrollbar-width: none; /* Firefox */
|
|
61
|
-
|
|
62
|
-
&::-webkit-scrollbar { /* Chrome/Safari/WebKit */
|
|
63
|
-
display: none;
|
|
64
|
-
width: 0;
|
|
65
|
-
height: 0;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## 4. 颜色用 `rgba()` 传统语法(web-view 兼容)
|
|
71
|
-
|
|
72
|
-
CSS Color 4 的空格分隔 `rgb(r g b / a)` 语法在**部分旧机型的支付宝 web-view(旧 WebKit)**可能不支持,导致**整条属性失效**(不是降级,是消失)。新写代码优先用 `rgba()`:
|
|
73
|
-
|
|
74
|
-
```less
|
|
75
|
-
/* ✅ 安全 */
|
|
76
|
-
box-shadow: 0 3px 8px rgba(1, 112, 254, 0.04);
|
|
77
|
-
color: rgba(31, 59, 99, 0.85);
|
|
78
|
-
|
|
79
|
-
/* ⚠️ 旧 web-view 风险:整条可能失效 */
|
|
80
|
-
box-shadow: 0 3px 8px rgb(1 112 254 / 3.92%);
|
|
81
|
-
```
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
# VISUAL_RESTORE.md — 视觉还原 / 图片驱动开发
|
|
2
|
-
|
|
3
|
-
用户给一张设计图 / 截图 / 原型图,要你照着改本模版时读这份。先解析、出设计指南、用户确认,再写代码——**禁止跳过解析直接开发**。
|
|
4
|
-
|
|
5
|
-
## 流程
|
|
6
|
-
|
|
7
|
-
1. **解析图片** → 按下方「设计指南输出模板」产出完整文档(颜色给 `#xxxxxx`、文案给完整原文、尺寸给具体 px)。
|
|
8
|
-
2. **用户确认** → 等确认或调整。
|
|
9
|
-
3. **按指南开发** → 遵守下方「还原硬规则」+ `../../AGENTS.md`(模板根:web-view 样式约定/组件策略/工程边界)。
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## 还原硬规则(确定性,必须遵守 —— 这些有明确对错、最值钱)
|
|
14
|
-
|
|
15
|
-
1. **模块顺序 / 位置 1:1**:解析先产出"自上而下的模块清单 + 每块位置(左/右/居中)和层级",落地严格按清单顺序和位置写 DOM。**禁止重排模块、改上下顺序、把"左立绘右文字"改成"上下排列"。**
|
|
16
|
-
2. **文案 1:1 完整**:可见文字逐字照搬,**不截断 / 不省略 / 不用"示例 / xx / xxxx"占位**;卡片的 `sampleData` 和 dataSchema 的 `.default(...)` 都填**真实文案**(default 尤其不能是占位词,它是兜底展示值)。长文案换行容纳,别截短。
|
|
17
|
-
3. **截断不补全(红线)**:截图边缘被裁、半露、折叠态的区块是**不完整信息**。**唯一允许**保留完整可见的折叠态(只渲染「标题 + 箭头」,到此为止);**严禁**补全 / 展开 / 推测内容,**严禁**拿其它元素(尤其快捷指令 chip)填充充数。口诀:**看不全,就不做。**
|
|
18
|
-
4. **网格用 CSS Grid**:固定列数一律 `grid-template-columns: repeat(N, 1fr)` + `gap`(grid 自动处理间距、任意列数不溢出);**不要用 `flex + width: 25%`**(忘减 gap 会换行成 N-1 列、还会横向溢出)。
|
|
19
|
-
5. **热区 ≠ 视觉高度**:设计规范里"可点击热区 ≥ 44px"指**点击范围**,不是视觉高度。热区不足用**透明 padding** 扩,**不要用 `min-height` 把 tab / 小标签撑高**(content-box 下还会叠加 padding,撑出 64px)。
|
|
20
|
-
6. **高度与留白贴合**:模块间距、整体高度照设计稿,**不无脑拉长、不挤扁**。
|
|
21
|
-
7. **不溢出**:放可变长文本的 flex 子项加 `min-width: 0`,文本用 `overflow-wrap` / `-webkit-line-clamp` 换行或省略——别让长文本撑爆、把按钮 / 步进器挤出。
|
|
22
|
-
8. **富文本分色**:部分高亮 / 分色的文字(如满赠文案里某几个字是橙色)拆成独立 `<span>` 分别上色,别整段一个颜色。
|
|
23
|
-
|
|
24
|
-
## 平台固定组件:不碰、不另画、不挪位
|
|
25
|
-
|
|
26
|
-
对话基础设施是平台封装好的——**识别到就跳过,只还原它们之间的业务内容区**:
|
|
27
|
-
- `ChatInput`(输入框/上传/语音)、`MessageBubble`(气泡/Markdown/思考)、`ActionBar`(朗读/复制/赞踩/调试)、`ChatHeader`、`ScrollToBottomButton` / `PullDownIndicator` / `HistoryEntry`(顶部历史入口胶囊)、`CardRenderer`。
|
|
28
|
-
- **快捷指令 = `QuickCommands`**:不管设计稿里它在哪个位置、标题叫什么(千问/推荐/常见问题),**都只配 `client/config/chat.json` 的 `quickCommands`,绝不在页面里再画一份**(否则和底部重复成两排);`label` 只写纯文字、图案走 `icon` 字段(别把 ✦/emoji 写进 label)。
|
|
29
|
-
- 详见 `../../AGENTS.md`(模板根:「双运行时与插件」与工程边界)。
|
|
30
|
-
|
|
31
|
-
## 技术路线判断(判错全盘皆错)
|
|
32
|
-
|
|
33
|
-
- **整屏 App 页**(带状态栏 / 导航 / 输入框的一整屏,如智能体首页)→ 改 `client/src/pages/index`,**复用现成模块**(欢迎/轮播/宫格/提问建议)改数据,**禁止做成卡片**。
|
|
34
|
-
- **对话气泡里的一块结构化内容**(点单/确认/推荐)→ 走**卡片(C 方案)**:server `cards/<type>/meta.ts` 数据契约 + client `cards/<type>/index.tsx` React 渲染。见 `../../AGENTS.md`「模块开发」(卡片双端形态与铁律)。
|
|
35
|
-
|
|
36
|
-
## 素材
|
|
37
|
-
|
|
38
|
-
- **图标**:`@phosphor-icons/react`——**线性用默认、设计稿是实心图标就 `weight="fill"`**(别再退回 `<img>`);具名导出,名字按语义猜、拼错会编译报错。`size` 偏大就取小(16–24、宫格/导航 28)。只有**品牌/插画/定制图标**(图库字体都给不了的)才用 `<img>` 素材槽位。
|
|
39
|
-
- **图片**:除 icon 外(含品牌 / 立绘 / logo 等,不区分)一律**先取一张 Unsplash 真图**(有 key 走 API、无 key 拼 `images.unsplash.com/photo-<id>?w=800&q=80`;精确词不行就用泛词、示意到位即可)、**必须 `curl` 验证 `200 + image/ + 体积` 通过才用**,验不过换 id/换词、多次不行才降级成渐变块。**别用孤零零小 emoji 充当主视觉**。
|
|
40
|
-
|
|
41
|
-
## 卡片还原(C 方案的落地路线)
|
|
42
|
-
|
|
43
|
-
判断为卡片后(见上「技术路线判断」),按这条链走,各步细节指向真源、不在此复述:
|
|
44
|
-
|
|
45
|
-
1. **拆解** → 按下面「图片解析」「设计指南输出模板」出设计指南。含 tab / 步进 / 表单 / 派生值的交互卡,额外列 **source / derived / emit**:source→`useState`、derived→渲染时由 state 算、emit→`sendUiAction(cardId, …)` 的 payload 读当前 state(交互卡纪律见 `../../AGENTS.md`「模块开发」)。
|
|
46
|
-
2. **落地** → 按 `../../AGENTS.md`「模块开发」:server `meta.ts`(dataSchema 字段全 `.default` / `.optional`)+ 两端 `registry` 注册 + 触发 tool 接 `TOOL_CARD_MAP`;client `index.tsx`(`data` 用 `import type` 从 meta 推导)。
|
|
47
|
-
3. **数据** → 还原出的文案 **1:1 落进 `sampleData` 和 dataSchema `.default`**(真实文案,default 不能是占位词——它是兜底展示值)。
|
|
48
|
-
4. **样式** → 字号按 2x 梯度;圆角 / 阴影 / 默认白底走 `.tbox-card` 卡框(已裁圆角)、**内边距和宽度自己写**;整卡换底色 / 出血图就在卡片 root 设 `background` / 铺满图(会裁进圆角、不出白边),**别再套一层带圆角容器**;宽度占满整列。详见 `../../AGENTS.md`「模块开发」(卡片双端形态与铁律)。
|
|
49
|
-
5. **图片** → 除 icon 外先取 Unsplash 直链(有 key 走 API、无 key 拼 `images.unsplash.com/photo-<id>`)+ `curl` 验证 `200 + image/ + 体积` 通过才用,`<img>` 加 `onError` 占位(见上「素材」)。
|
|
50
|
-
|
|
51
|
-
**收尾自检**:模块 / 文案 1:1?折叠区没补全?字号已 ×2(没照抄 1x 截图)?容器没重画?图片都校验过 + 带 `onError`?`sampleData` / `.default` 是真实文案?server `build` 与 client `typecheck` / `build` 通过?
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## 图片解析基础要求(出设计指南前)
|
|
56
|
-
|
|
57
|
-
- **深度拆解**:不要只描述整体外观,**逐层拆解内部结构**——子元素组成、排列(水平/垂直/网格)、对齐、嵌套。如一张卡:左图标+右文字还是上图下文?文字有无主标题+副标题层级?有无右侧箭头/标签?
|
|
58
|
-
- **尺寸精度**:所有尺寸给**具体 px**(以屏宽 375 或设计稿标注宽为基准按比例反推),禁止"较大/适中/紧凑"。必标:整体宽高、内边距(上右下左)、子元素间距 gap、圆角、图标/头像尺寸、行高。判断不准的给估计值并标"(估计值)"。
|
|
59
|
-
- ⚠️ **量出来的是屏上(1x)px**;写进卡片 `.less` 时是 **2x 源码 px(CSS px 会折半渲染),一律 ×2**;字号别自定、直接用 `src/styles/tokens.less` 的字号梯度注释(2x 真源)。图标 `size`(屏幕 px)与热区 44 不折半、不 ×2。
|
|
60
|
-
- **完整文案提取**:所有可见文字逐字抄录(标题/副标题/按钮/placeholder/提示/标签/声明),不可"类似 xxx"。
|
|
61
|
-
|
|
62
|
-
## 设计指南输出模板(每节必填,占位符替换成真实值)
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
1. 品牌定位:应用名称 / 类型 / 设计风格(3-4 关键词) / 目标用户 / 核心价值(3-5 项)
|
|
66
|
-
2. 配色方案:
|
|
67
|
-
- 主色 Primary / PrimaryDark / PrimaryLight: #xxxxxx
|
|
68
|
-
- 辅助:成功 / 警告 / 错误: #xxxxxx
|
|
69
|
-
- 中性:标题文本 / 正文 / 辅助 / 边框 / 背景 / 纯白: #xxxxxx
|
|
70
|
-
- 渐变:完整 linear-gradient(...) 值
|
|
71
|
-
3. 字体规范:H1/H2/H3/正文/辅助/小字 各 xxpx + 字重
|
|
72
|
-
4. 间距与圆角:左右安全边距 / 顶部底部 / 区块间距 / 同级间距 / 组件内 padding(上右下左) / 行高 / 各处圆角 各 xxpx
|
|
73
|
-
5. 业务内容区组件:对每个组件按"外观(尺寸/底色/边框/圆角/阴影/外距) → 内部结构(子元素排列/对齐/间距/各自尺寸色字号) → 状态(默认/按下/禁用)"三层描述。
|
|
74
|
-
(卡片**最外层容器**的圆角/阴影/默认白底由 `.tbox-card` 卡框提供并裁圆角,**内边距自己写**;整卡换底色就在卡片 root 设 `background`(会裁进圆角、不出白边)、别再套一层带圆角容器;平台固定组件——气泡/输入框/操作栏/导航/快捷指令——只标注"复用平台组件",不解析其内部、不重造。)
|
|
75
|
-
6. 页面结构:ASCII 线框图 + 各模块自上而下顺序与位置。
|
|
76
|
-
7. 交互规范:发送 / 快捷问题点击行为 / 滚动行为 / 其它可见交互。
|
|
77
|
-
8. Agent 人设:角色定义 / 核心能力 / 能力边界 / 回复风格 / 特殊规则(写进 system instructions)。
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
> 所有 `xxpx` / `#xxxxxx` 必须替换为从图中提取的实际值;某区域不可见就显式写"图中未体现,建议 xxx"并给合理默认。
|
|
81
|
-
|
|
82
|
-
---
|
|
83
|
-
|
|
84
|
-
## 还原边界(避免过度抠像素)
|
|
85
|
-
|
|
86
|
-
- 字体度量、leading 留白不强行消除;颜色精度差 1-2 hex 视为 OK。
|
|
87
|
-
- 完成后简要说明哪些细节做了让步、原因。
|
|
88
|
-
|
|
89
|
-
## 一句话
|
|
90
|
-
**先解析出完整设计指南 → 用户确认 → 严格按"模块 1:1 / 文案 1:1 / 看不全不做 / Grid / 热区非视觉高 / 平台组件不碰 / 整屏走 pages、内容块走卡片"开发。** Web 端 CSS 细节(大写 PX / 滚动条 / rgba)见 `client/STYLE_GUIDE.md`。
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 应用外壳(平台运行时供给层):session 引导 + 平台适配器(TTS 等)。
|
|
3
|
-
* 从 AgentChatApp 抽出的共享外壳——MPA 生成 entry(mount-page)与根 entry
|
|
4
|
-
* (AgentChatApp → BusinessApp)共用,保证任何页面的平台能力面一致。
|
|
5
|
-
*/
|
|
6
|
-
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
7
|
-
import { AdapterProvider, createPlatformAdapters, type AdapterContextValue } from '@tbox.cn/app-agent-sdk-client';
|
|
8
|
-
import type { TboxSessionData } from '@tbox.cn/app-contracts';
|
|
9
|
-
import { authClient, platformApi } from './agent-runtime';
|
|
10
|
-
import { createLogger } from '@tbox.cn/app-agent-sdk-client';
|
|
11
|
-
|
|
12
|
-
const appLogger = createLogger('AppShell');
|
|
13
|
-
|
|
14
|
-
export function AppShell({ children }: { children: React.ReactNode }) {
|
|
15
|
-
const [session, setSession] = useState<TboxSessionData | null>(null);
|
|
16
|
-
// TTS 不依赖 session,恒可用且保持同一实例(播放状态不因会话刷新丢失)
|
|
17
|
-
const tts = useMemo(() => createPlatformAdapters().tts, []);
|
|
18
|
-
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
authClient
|
|
21
|
-
.ensureAuth()
|
|
22
|
-
// 会话 β 收口:身份恒取 token(服务端 401/403),userId 不再上行
|
|
23
|
-
.then(() => platformApi.getTboxSession())
|
|
24
|
-
.then(setSession)
|
|
25
|
-
.catch((err: unknown) => appLogger.error('tbox session init failed:', err));
|
|
26
|
-
}, []);
|
|
27
|
-
|
|
28
|
-
const refreshSession = useCallback(async (): Promise<AdapterContextValue> => {
|
|
29
|
-
platformApi.clearTboxSession();
|
|
30
|
-
await authClient.refreshAuth();
|
|
31
|
-
const data = await platformApi.getTboxSession(true);
|
|
32
|
-
setSession(data);
|
|
33
|
-
return { tts, ...createPlatformAdapters(data, { tts }), refreshSession };
|
|
34
|
-
}, [tts]);
|
|
35
|
-
|
|
36
|
-
const adapters = useMemo<AdapterContextValue>(() => {
|
|
37
|
-
if (!session) return { tts, refreshSession };
|
|
38
|
-
return { tts, ...createPlatformAdapters(session, { tts }), refreshSession };
|
|
39
|
-
}, [session, tts, refreshSession]);
|
|
40
|
-
|
|
41
|
-
return <AdapterProvider value={adapters}>{children}</AdapterProvider>;
|
|
42
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 平台运行时装配(client 平台轴,已下沉 @tbox.cn/app-agent-sdk-client)。
|
|
3
|
-
* 模板唯一的 SDK 单例持有点:authClient(鉴权)+ platformApi(能力凭证/会话/历史)。
|
|
4
|
-
* 环境值(VITE_API_URL)由 main.tsx 经 configureRuntime 注入(H1)。
|
|
5
|
-
*/
|
|
6
|
-
import { createAuthClient, createPlatformApi } from '@tbox.cn/app-agent-sdk-client';
|
|
7
|
-
// 读源归位 TIER1():mall-scope-url 契约助手(search-only 语义;壳 URL 改写层契约见包注释)
|
|
8
|
-
import { readMallIdFromUrl } from '@app/contracts-mall';
|
|
9
|
-
|
|
10
|
-
export const authClient = createAuthClient({
|
|
11
|
-
// SPEZ-017:token 缓存域键——URL mallId 变更即失效旧 token 重登(跨 mall 防串域)。
|
|
12
|
-
// 读源与 chat.ts configureHelloContext 逐字符同源(mall-scope-url.ts 唯一真源,search-only)
|
|
13
|
-
scopeKey: () => readMallIdFromUrl() ?? '',
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export const platformApi = createPlatformApi();
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 客户端启动层(单一职责:一次进程级初始化,幂等)。
|
|
3
|
-
* 消费方 = 根 entry(main.tsx)与全部生成 entry(.tbox-gen/<id>.ts 经 mount-page)——
|
|
4
|
-
* 两侧共享同一实现,保证任何文档入口的启动语义一致(主题/运行时/错误兜底/chat 配置快照)。
|
|
5
|
-
* 约束:只做同步可完成的初始化;@config 别名根除相对深度耦合(vite.config + tsconfig 同步接线)。
|
|
6
|
-
*/
|
|
7
|
-
import { configureRuntime, createLogger, installGlobalErrorReporting } from '@tbox.cn/app-agent-sdk-client';
|
|
8
|
-
import { configureChatConfigDefaults } from '@app/agent-ui-kit';
|
|
9
|
-
import '@app/agent-ui-kit/theme/global.less';
|
|
10
|
-
// 品牌主题(出厂接线——theme-tbox 平台品牌资产包:素材/标题经本包承载,模块零品牌资产)。
|
|
11
|
-
// 换主题 = 替换三行(index.css + brand.js + applyTheme;叠加会致旧主题残留死重);
|
|
12
|
-
// 部署者轨迹见 cookbook·build-app-image「主题接线」。CLI 自由区,module sync 永不触碰。
|
|
13
|
-
import '@tbox.cn/app-theme-tbox/index.css';
|
|
14
|
-
import '@tbox.cn/app-theme-tbox/brand.js';
|
|
15
|
-
import { applyTheme } from '@app/agent-ui-kit/theme';
|
|
16
|
-
import chatConfigJson from '@config/chat.json';
|
|
17
|
-
|
|
18
|
-
const bootLogger = createLogger('BOOT');
|
|
19
|
-
|
|
20
|
-
let bootstrapped = false;
|
|
21
|
-
|
|
22
|
-
export function bootstrap(): void {
|
|
23
|
-
if (bootstrapped) return;
|
|
24
|
-
bootstrapped = true;
|
|
25
|
-
|
|
26
|
-
applyTheme('tbox');
|
|
27
|
-
|
|
28
|
-
// 壳→H5 接入契约观测:落页即打印 URL 参数(search + hash 双读源,全量加载仅一次)。
|
|
29
|
-
// 壳侧若把参数移进 hash,mall-scope-url 的 search-only 读源会静默失效——这里第一时间暴露。
|
|
30
|
-
// code/token 类值部分脱敏(前缀 + 长度,对齐 provider log-redact 惯例)。
|
|
31
|
-
const SENSITIVE_PARAM = /^(code|token|auth_code|visitortoken|session)$/i;
|
|
32
|
-
const collectParams = (source: string): Record<string, string> => {
|
|
33
|
-
const out: Record<string, string> = {};
|
|
34
|
-
new URLSearchParams(source).forEach((value, key) => {
|
|
35
|
-
out[key] = SENSITIVE_PARAM.test(key) ? `${value.slice(0, 6)}…(len=${value.length})` : value;
|
|
36
|
-
});
|
|
37
|
-
return out;
|
|
38
|
-
};
|
|
39
|
-
const hashQuery = window.location.hash.includes('?')
|
|
40
|
-
? window.location.hash.slice(window.location.hash.indexOf('?') + 1)
|
|
41
|
-
: '';
|
|
42
|
-
bootLogger.info(
|
|
43
|
-
`url params: ${JSON.stringify({ search: collectParams(window.location.search), hash: collectParams(hashQuery) })}`,
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
// H1:环境值注入点(SDK 零 Vite 依赖)——VITE_API_URL 空串 = 同源相对路径
|
|
47
|
-
configureRuntime({ apiBaseUrl: import.meta.env.VITE_API_URL as string | undefined });
|
|
48
|
-
|
|
49
|
-
// 全局错误兜底:未捕获异常/rejection → 统一日志行(本地落地;上报扩展点见 SDK client logger)
|
|
50
|
-
installGlobalErrorReporting();
|
|
51
|
-
|
|
52
|
-
// chat.json 构建期快照 → kit 静态配置 store(render 前注入,首帧即快照值;
|
|
53
|
-
// HELLO_ACK settings 达后经 ChatPage 内水合覆盖)
|
|
54
|
-
configureChatConfigDefaults(chatConfigJson as Record<string, unknown>);
|
|
55
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 卡片预览平台页:生成 entry 已注册模块/卡片,这里只读取同一 ClientContext。
|
|
3
|
-
*/
|
|
4
|
-
import { CardPreviewPage } from '@tbox.cn/app-agent-sdk-client/client/card-preview';
|
|
5
|
-
import { getRegisteredClientCards } from '@tbox.cn/app-agent-sdk-client';
|
|
6
|
-
import { authClient } from '@/platform/agent-runtime';
|
|
7
|
-
|
|
8
|
-
export default function CardPreviewRoute() {
|
|
9
|
-
return <CardPreviewPage registry={getRegisteredClientCards()} authClient={authClient} />;
|
|
10
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 生成 entry 的页面挂载点(与生产 documents 同一入口)。
|
|
3
|
-
* bootstrap(幂等)+ AppShell(平台能力面)+ 页面组件;卡片预览传 shell:false。
|
|
4
|
-
*/
|
|
5
|
-
import { StrictMode, type ComponentType } from 'react';
|
|
6
|
-
import { createRoot } from 'react-dom/client';
|
|
7
|
-
import { bootstrap } from './bootstrap';
|
|
8
|
-
import { AppShell } from './AppShell';
|
|
9
|
-
|
|
10
|
-
export function mountPage(Page: ComponentType, options: { shell?: boolean } = {}): void {
|
|
11
|
-
bootstrap();
|
|
12
|
-
const el = document.getElementById('root');
|
|
13
|
-
if (!el) return;
|
|
14
|
-
const content = options.shell === false ? <Page /> : (
|
|
15
|
-
<AppShell>
|
|
16
|
-
<Page />
|
|
17
|
-
</AppShell>
|
|
18
|
-
);
|
|
19
|
-
createRoot(el).render(<StrictMode>{content}</StrictMode>);
|
|
20
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { create, type StateCreator } from 'zustand';
|
|
2
|
-
import { createJSONStorage, persist, type PersistOptions } from 'zustand/middleware';
|
|
3
|
-
|
|
4
|
-
interface PersistedStoreOptions<T> extends Omit<PersistOptions<T>, 'name' | 'storage'> {
|
|
5
|
-
name: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/** 创建使用 localStorage 的业务 store,并统一保留 Zustand 的版本迁移能力。 */
|
|
9
|
-
export function createPersistedStore<T>(
|
|
10
|
-
stateCreator: StateCreator<T, [], []>,
|
|
11
|
-
options: PersistedStoreOptions<T>,
|
|
12
|
-
) {
|
|
13
|
-
return create<T>()(
|
|
14
|
-
persist(stateCreator, {
|
|
15
|
-
...options,
|
|
16
|
-
storage: createJSONStorage(() => localStorage),
|
|
17
|
-
}),
|
|
18
|
-
);
|
|
19
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// 铁律:不直接 import @mastra/core,经 @tbox.cn/app-agent-sdk-server 的 createTool 入口(单例铁律)
|
|
2
|
-
import { createTool } from '@tbox.cn/app-agent-sdk-server';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 当前时间工具 — 前置工具(pre-tool)演示:零参工具,参数无需模型抽取,
|
|
7
|
-
* 词表命中即可工程化预执行(见 apps/server/src/pre-tools.ts)。
|
|
8
|
-
*/
|
|
9
|
-
export const tool = createTool({
|
|
10
|
-
id: 'getCurrentTime',
|
|
11
|
-
description: '查询当前日期和时间',
|
|
12
|
-
inputSchema: z.object({}),
|
|
13
|
-
outputSchema: z.object({
|
|
14
|
-
iso: z.string(),
|
|
15
|
-
zh: z.string(),
|
|
16
|
-
}),
|
|
17
|
-
execute: async () => {
|
|
18
|
-
const now = new Date();
|
|
19
|
-
return {
|
|
20
|
-
iso: now.toISOString(),
|
|
21
|
-
zh: now.toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' }),
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
});
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// 铁律:不直接 import @mastra/core,经 @tbox.cn/app-agent-sdk-server 的 createTool 入口(单例铁律)
|
|
2
|
-
import { createTool } from '@tbox.cn/app-agent-sdk-server';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 翻译工具 — 中英文互译
|
|
7
|
-
* 由原 translator Skill 改造而来,现在作为 Tool 注册,LLM 自主调用
|
|
8
|
-
*/
|
|
9
|
-
export const tool = createTool({
|
|
10
|
-
id: 'translate',
|
|
11
|
-
description:
|
|
12
|
-
'中英文互译工具。当用户需要翻译文本时调用此工具。自动检测源语言并翻译为目标语言:中文→英文,英文→中文。',
|
|
13
|
-
inputSchema: z.object({
|
|
14
|
-
text: z.string().describe('要翻译的文本'),
|
|
15
|
-
// 参数规范:仅 string 形态(LLM 生成字符串最可靠);非法值工具内回落自动检测
|
|
16
|
-
targetLang: z
|
|
17
|
-
.string()
|
|
18
|
-
.optional()
|
|
19
|
-
.describe('目标语言(zh 或 en),不传则自动检测:中文输入翻译为英文,英文输入翻译为中文'),
|
|
20
|
-
}),
|
|
21
|
-
outputSchema: z.object({
|
|
22
|
-
original: z.string(),
|
|
23
|
-
translated: z.string(),
|
|
24
|
-
sourceLang: z.string(),
|
|
25
|
-
targetLang: z.string(),
|
|
26
|
-
}),
|
|
27
|
-
execute: async ({ text, targetLang }) => {
|
|
28
|
-
// 简单语言检测:包含中文字符则认为是中文;非法 targetLang 回落自动检测
|
|
29
|
-
const isChinese = /[\u4e00-\u9fff]/.test(text);
|
|
30
|
-
const detectedTarget =
|
|
31
|
-
targetLang === 'zh' || targetLang === 'en'
|
|
32
|
-
? targetLang
|
|
33
|
-
: isChinese
|
|
34
|
-
? 'en'
|
|
35
|
-
: 'zh';
|
|
36
|
-
const sourceLang = isChinese ? 'zh' : 'en';
|
|
37
|
-
|
|
38
|
-
// 注意:这里返回指令让 LLM 来做实际翻译
|
|
39
|
-
// 实际生产环境可以调用翻译 API 或发起子 LLM 调用
|
|
40
|
-
return {
|
|
41
|
-
original: text,
|
|
42
|
-
translated: `[请将以下${sourceLang === 'zh' ? '中文' : '英文'}翻译为${detectedTarget === 'zh' ? '中文' : '英文'}]: ${text}`,
|
|
43
|
-
sourceLang,
|
|
44
|
-
targetLang: detectedTarget,
|
|
45
|
-
};
|
|
46
|
-
},
|
|
47
|
-
});
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
.chat-page {
|
|
2
|
-
position: relative;
|
|
3
|
-
display: flex;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
width: 100%;
|
|
6
|
-
height: 100vh;
|
|
7
|
-
height: 100dvh;
|
|
8
|
-
min-height: 0;
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
background: var(--tbox-bg-page);
|
|
11
|
-
|
|
12
|
-
&__bg {
|
|
13
|
-
position: absolute;
|
|
14
|
-
inset: 0;
|
|
15
|
-
z-index: 0;
|
|
16
|
-
background: var(--tbox-bg-page);
|
|
17
|
-
pointer-events: none;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&__body-wrapper {
|
|
21
|
-
position: relative;
|
|
22
|
-
z-index: 1;
|
|
23
|
-
display: flex;
|
|
24
|
-
flex: 1;
|
|
25
|
-
flex-direction: column;
|
|
26
|
-
min-height: 0;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&__body {
|
|
30
|
-
flex: 1;
|
|
31
|
-
width: 100%;
|
|
32
|
-
max-width: var(--tbox-content-max-width);
|
|
33
|
-
min-height: 0;
|
|
34
|
-
margin: 0 auto;
|
|
35
|
-
padding: calc(12PX + env(safe-area-inset-top, 0PX)) 0 24PX;
|
|
36
|
-
overflow-y: auto;
|
|
37
|
-
overflow-x: hidden;
|
|
38
|
-
overflow-anchor: none;
|
|
39
|
-
overscroll-behavior: contain;
|
|
40
|
-
scrollbar-width: none;
|
|
41
|
-
-webkit-overflow-scrolling: touch;
|
|
42
|
-
|
|
43
|
-
&::-webkit-scrollbar {
|
|
44
|
-
display: none;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&__orphan-card {
|
|
49
|
-
margin-right: var(--tbox-page-gutter);
|
|
50
|
-
margin-left: var(--tbox-page-gutter);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/* 顶部历史入口在场时欢迎区不再叠加自身顶部留白:胶囊到标题区留 4PX(= 欢迎区自带上边距)。 */
|
|
54
|
-
.history-entry ~ .mall-home {
|
|
55
|
-
padding-top: 0;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/* 对话开始后首页仍保留,消息接在联单主卡下方。 */
|
|
59
|
-
&--conversation &__body {
|
|
60
|
-
padding-top: calc(12PX + env(safe-area-inset-top, 0PX));
|
|
61
|
-
}
|
|
62
|
-
}
|