@tbox.cn/app-template-agent 1.0.0-alpha.16 → 1.0.0-alpha.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/._.gitignore +0 -0
  2. package/._.nvmrc +0 -0
  3. package/._AGENTS.md +0 -0
  4. package/._ENV.md +0 -0
  5. package/._LEGAL.md +0 -0
  6. package/._LICENSE +0 -0
  7. package/._README.md +0 -0
  8. package/._eslint.config.mjs +0 -0
  9. package/._package.json +0 -0
  10. package/._pnpm-lock.template.yaml +0 -0
  11. package/._pnpm-workspace.template.yaml +0 -0
  12. package/._tsconfig.base.json +0 -0
  13. package/.gitignore +2 -0
  14. package/.tbox/._app.json +0 -0
  15. package/.tbox/._default-modules.json +0 -0
  16. package/.tbox/._miniapp-containers.json +0 -0
  17. package/.tbox/app.json +1 -1
  18. package/.tbox/cache/._apps-client-strict.tsbuildinfo +0 -0
  19. package/.tbox/cache/._apps-client.tsbuildinfo +0 -0
  20. package/.tbox/cache/._apps-server-strict.tsbuildinfo +0 -0
  21. package/.tbox/cache/._apps-server.tsbuildinfo +0 -0
  22. package/.tbox/cache/._packages-agent-ui-kit-strict.tsbuildinfo +0 -0
  23. package/.tbox/cache/._packages-agent-ui-kit.tsbuildinfo +0 -0
  24. package/.tbox/cache/._packages-shared-strict.tsbuildinfo +0 -0
  25. package/.tbox/cache/._packages-shared.tsbuildinfo +0 -0
  26. package/.tbox/cache/apps-client-strict.tsbuildinfo +1 -0
  27. package/.tbox/cache/apps-client.tsbuildinfo +1 -0
  28. package/.tbox/cache/apps-server-strict.tsbuildinfo +1 -0
  29. package/.tbox/cache/apps-server.tsbuildinfo +1 -0
  30. package/.tbox/cache/packages-agent-ui-kit-strict.tsbuildinfo +1 -0
  31. package/.tbox/cache/packages-agent-ui-kit.tsbuildinfo +1 -0
  32. package/.tbox/cache/packages-shared-strict.tsbuildinfo +1 -0
  33. package/.tbox/cache/packages-shared.tsbuildinfo +1 -0
  34. package/.tbox/default-modules.json +1 -1
  35. package/.tbox/factory/._chat.json +0 -0
  36. package/.tbox/miniapp-containers.json +1 -1
  37. package/AGENTS.md +4 -0
  38. package/apps/._AGENTS.md +0 -0
  39. package/apps/client/._index.html +0 -0
  40. package/apps/client/._package.json +0 -0
  41. package/apps/client/._tsconfig.json +0 -0
  42. package/apps/client/._vite.config.ts +0 -0
  43. package/apps/client/scripts/._acceptance-changes.test.mjs +0 -0
  44. package/apps/client/scripts/._check-evidence.mjs +0 -0
  45. package/apps/client/scripts/._color-scan.mjs +0 -0
  46. package/apps/client/scripts/._color-scan.test.mjs +0 -0
  47. package/apps/client/scripts/._evidence-gate.mjs +0 -0
  48. package/apps/client/scripts/._evidence-gate.test.mjs +0 -0
  49. package/apps/client/scripts/._experience-checks.mjs +0 -0
  50. package/apps/client/scripts/._geometry-kernel.test.mjs +0 -0
  51. package/apps/client/scripts/._home-preset-wiring.test.ts +0 -0
  52. package/apps/client/scripts/._home-preset-wiring.ts +0 -0
  53. package/apps/client/scripts/._in-process-checks.mjs +0 -0
  54. package/apps/client/scripts/._probe-checks.mjs +0 -0
  55. package/apps/client/scripts/._render-card.mjs +0 -0
  56. package/apps/client/scripts/._sample-entries.test.mjs +0 -0
  57. package/apps/client/scripts/._static-checks.test.mjs +0 -0
  58. package/apps/client/scripts/._storyboard.test.mjs +0 -0
  59. package/apps/client/scripts/._surface-css.mjs +0 -0
  60. package/apps/client/scripts/._theme-kernel.mjs +0 -0
  61. package/apps/client/scripts/._theme-kernel.test.mjs +0 -0
  62. package/apps/client/scripts/acceptance-changes.test.mjs +16 -3
  63. package/apps/client/scripts/check-evidence.mjs +69 -7
  64. package/apps/client/scripts/evidence-gate.mjs +9 -6
  65. package/apps/client/scripts/experience-checks.mjs +139 -0
  66. package/apps/client/scripts/geometry-kernel.test.mjs +3 -1
  67. package/apps/client/scripts/home-preset-wiring.test.ts +61 -0
  68. package/apps/client/scripts/home-preset-wiring.ts +41 -0
  69. package/apps/client/scripts/in-process-checks.mjs +100 -1
  70. package/apps/client/scripts/lib/._card-registry.mjs +0 -0
  71. package/apps/client/scripts/lib/._card-registry.test.mjs +0 -0
  72. package/apps/client/scripts/lib/._evidence-inputs.mjs +0 -0
  73. package/apps/client/scripts/lib/._evidence-inputs.test.mjs +0 -0
  74. package/apps/client/scripts/lib/._static-render.mjs +0 -0
  75. package/apps/client/scripts/lib/._static-render.test.mjs +0 -0
  76. package/apps/client/scripts/probe-checks.mjs +1 -0
  77. package/apps/client/scripts/static-checks.test.mjs +219 -0
  78. package/apps/client/src/._app.config.ts +0 -0
  79. package/apps/client/src/._vite-env.d.ts +0 -0
  80. package/apps/client/src/cards/._AGENTS.md +0 -0
  81. package/apps/client/src/cards/._home-preset.test.ts +0 -0
  82. package/apps/client/src/cards/._home-preset.ts +0 -0
  83. package/apps/client/src/cards/._registry.ts +0 -0
  84. package/apps/client/src/cards/home-preset.test.ts +40 -0
  85. package/apps/client/src/cards/home-preset.ts +19 -0
  86. package/apps/client/src/cards/registry.ts +10 -3
  87. package/apps/client/src/pages/._page.tsx +0 -0
  88. package/apps/client/src/pages/index/._index.tsx +0 -0
  89. package/apps/client/src/pages/index/index.tsx +1 -1
  90. package/apps/client/src/store/._chat.ts +0 -0
  91. package/apps/client/src/styles/._brand.css +0 -0
  92. package/apps/client/src/styles/._tailwind.css +0 -0
  93. package/apps/client/src/styles/tailwind.css +3 -1
  94. package/apps/client/src/test/._setup.ts +0 -0
  95. package/apps/client/tsconfig.json +1 -0
  96. package/apps/client/vite.config.ts +15 -5
  97. package/apps/server/._package.json +0 -0
  98. package/apps/server/._tsconfig.json +0 -0
  99. package/apps/server/._tsup.config.ts +0 -0
  100. package/apps/server/._vitest.config.ts +0 -0
  101. package/apps/server/scripts/._probe.mjs +0 -0
  102. package/apps/server/scripts/._scenario-lib.mjs +0 -0
  103. package/apps/server/scripts/._scenario.mjs +0 -0
  104. package/apps/server/scripts/scenario-lib.mjs +12 -1
  105. package/apps/server/src/._app.ts +0 -0
  106. package/apps/server/src/._dev.ts +0 -0
  107. package/apps/server/src/._index.ts +0 -0
  108. package/apps/server/src/._intent-routes.ts +0 -0
  109. package/apps/server/src/._pre-tools.ts +0 -0
  110. package/apps/server/src/actions/._AGENTS.md +0 -0
  111. package/apps/server/src/cards/._AGENTS.md +0 -0
  112. package/apps/server/src/cli/._collect-registry.ts +0 -0
  113. package/apps/server/src/cli/._plugin-doctor.ts +0 -0
  114. package/apps/server/src/cli/._plugin-inspect.ts +0 -0
  115. package/apps/server/src/config/._integration.ts +0 -0
  116. package/apps/server/src/tools/._AGENTS.md +0 -0
  117. package/apps/server/tests/._agent-prompt.test.ts +0 -0
  118. package/apps/server/tests/._cards-registry.test.ts +0 -0
  119. package/apps/server/tests/._deployment-loader.test.ts +0 -0
  120. package/apps/server/tests/._intent-dispatcher.test.ts +0 -0
  121. package/apps/server/tests/._tool-runtime.test.ts +0 -0
  122. package/apps/server/tests/helpers/._register.ts +0 -0
  123. package/config/._AGENTS.md +0 -0
  124. package/config/._README.md +0 -0
  125. package/config/._agent.jsonc +0 -0
  126. package/config/._chat.json +0 -0
  127. package/config/._integrations.json +0 -0
  128. package/config/._llm_provider.json +0 -0
  129. package/config/._plugins.json +0 -0
  130. package/config/agent.jsonc +10 -0
  131. package/docs/agent/._agent-prompt.md +0 -0
  132. package/docs/agent/._card-action.md +0 -0
  133. package/docs/agent/._card.md +0 -0
  134. package/docs/agent/._conversation.md +0 -0
  135. package/docs/agent/._errors.md +0 -0
  136. package/docs/agent/._kit.md +0 -0
  137. package/docs/agent/._shell.md +0 -0
  138. package/docs/agent/._state.md +0 -0
  139. package/docs/agent/._style.md +0 -0
  140. package/docs/agent/._tool-emits-card.md +0 -0
  141. package/docs/agent/._tool.md +0 -0
  142. package/docs/agent/._verify.md +0 -0
  143. package/docs/agent/card-action.md +5 -1
  144. package/docs/agent/card.md +7 -1
  145. package/docs/agent/errors.md +7 -1
  146. package/docs/agent/kit.md +7 -6
  147. package/docs/agent/shell.md +3 -1
  148. package/docs/agent/style.md +37 -0
  149. package/docs/agent/verify.md +5 -2
  150. package/modules/provider-custom/._AGENTS.md +0 -0
  151. package/modules/provider-custom/._INTEGRATION.md +0 -0
  152. package/modules/provider-custom/._LICENSE +0 -0
  153. package/modules/provider-custom/._README.md +0 -0
  154. package/modules/provider-custom/._package.json +0 -0
  155. package/modules/provider-custom/._tbox.module.json +0 -0
  156. package/modules/provider-custom/._tsconfig.json +0 -0
  157. package/modules/provider-custom/._tsup.config.ts +0 -0
  158. package/modules/provider-custom/src/._index.ts +0 -0
  159. package/modules/provider-custom/src/server/._example-adapter.ts +0 -0
  160. package/modules/provider-custom/src/server/._index.ts +0 -0
  161. package/modules/provider-custom/tests/._provider-custom.test.ts +0 -0
  162. package/package.json +5 -4
  163. package/packages/agent-ui-kit/._AGENTS.md +0 -0
  164. package/packages/agent-ui-kit/._LICENSE +0 -0
  165. package/packages/agent-ui-kit/._README.md +0 -0
  166. package/packages/agent-ui-kit/._catalog.json +0 -0
  167. package/packages/agent-ui-kit/._package.json +0 -0
  168. package/packages/agent-ui-kit/._tsconfig.json +0 -0
  169. package/packages/agent-ui-kit/._vitest.config.ts +0 -0
  170. package/packages/agent-ui-kit/assets/._keyboard-circle.svg +0 -0
  171. package/packages/agent-ui-kit/assets/._more-circle.svg +0 -0
  172. package/packages/agent-ui-kit/assets/._new-chat.svg +0 -0
  173. package/packages/agent-ui-kit/assets/._quick-command-star.svg +0 -0
  174. package/packages/agent-ui-kit/assets/._send-gradient.svg +0 -0
  175. package/packages/agent-ui-kit/assets/._stop@2x.png +0 -0
  176. package/packages/agent-ui-kit/assets/._voice-circle.svg +0 -0
  177. package/packages/agent-ui-kit/catalog.json +134 -5
  178. package/packages/agent-ui-kit/package.json +1 -1
  179. package/packages/agent-ui-kit/src/._ChatPage.tsx +0 -0
  180. package/packages/agent-ui-kit/src/._chat-config.test.ts +0 -0
  181. package/packages/agent-ui-kit/src/._chat-config.ts +0 -0
  182. package/packages/agent-ui-kit/src/._contract.test.tsx +0 -0
  183. package/packages/agent-ui-kit/src/._icons.ts +0 -0
  184. package/packages/agent-ui-kit/src/._index.ts +0 -0
  185. package/packages/agent-ui-kit/src/._preview-provider.tsx +0 -0
  186. package/packages/agent-ui-kit/src/._shell.contract.json +0 -0
  187. package/packages/agent-ui-kit/src/._shell.test.ts +0 -0
  188. package/packages/agent-ui-kit/src/._shell.ts +0 -0
  189. package/packages/agent-ui-kit/src/._store-context.tsx +0 -0
  190. package/packages/agent-ui-kit/src/._surface.test.tsx +0 -0
  191. package/packages/agent-ui-kit/src/._surface.tsx +0 -0
  192. package/packages/agent-ui-kit/src/._types.ts +0 -0
  193. package/packages/agent-ui-kit/src/._vite-env.d.ts +0 -0
  194. package/packages/agent-ui-kit/src/ChatPage.tsx +204 -27
  195. package/packages/agent-ui-kit/src/card/._action-list-pending.test.tsx +0 -0
  196. package/packages/agent-ui-kit/src/card/._confirm-fields.test.tsx +0 -0
  197. package/packages/agent-ui-kit/src/card/._define-card.test.ts +0 -0
  198. package/packages/agent-ui-kit/src/card/._define-card.ts +0 -0
  199. package/packages/agent-ui-kit/src/card/._primitives.test.tsx +0 -0
  200. package/packages/agent-ui-kit/src/card/._primitives.tsx +0 -0
  201. package/packages/agent-ui-kit/src/card/._use-card-actions.ts +0 -0
  202. package/packages/agent-ui-kit/src/card/._view-card-inline.test.tsx +0 -0
  203. package/packages/agent-ui-kit/src/card/._view-card.test.tsx +0 -0
  204. package/packages/agent-ui-kit/src/card/._view-card.tsx +0 -0
  205. package/packages/agent-ui-kit/src/card/confirm-fields.test.tsx +106 -0
  206. package/packages/agent-ui-kit/src/card/primitives.tsx +270 -59
  207. package/packages/agent-ui-kit/src/card/use-card-actions.ts +5 -1
  208. package/packages/agent-ui-kit/src/card/view-card.tsx +113 -22
  209. package/packages/agent-ui-kit/src/chat-config.ts +2 -0
  210. package/packages/agent-ui-kit/src/components/._CardRenderer.tsx +0 -0
  211. package/packages/agent-ui-kit/src/components/._HistoryList.tsx +0 -0
  212. package/packages/agent-ui-kit/src/components/ActionBar/._DebugButton.test.tsx +0 -0
  213. package/packages/agent-ui-kit/src/components/ActionBar/._DebugButton.tsx +0 -0
  214. package/packages/agent-ui-kit/src/components/ActionBar/._index.test.tsx +0 -0
  215. package/packages/agent-ui-kit/src/components/ActionBar/._index.tsx +0 -0
  216. package/packages/agent-ui-kit/src/components/ActionBar/DebugButton.tsx +12 -4
  217. package/packages/agent-ui-kit/src/components/ActionBar/index.tsx +61 -27
  218. package/packages/agent-ui-kit/src/components/BottomSheet/._index.test.tsx +0 -0
  219. package/packages/agent-ui-kit/src/components/BottomSheet/._index.tsx +0 -0
  220. package/packages/agent-ui-kit/src/components/BottomSheet/index.tsx +26 -2
  221. package/packages/agent-ui-kit/src/components/ChatInput/._index.test.tsx +0 -0
  222. package/packages/agent-ui-kit/src/components/ChatInput/._index.tsx +0 -0
  223. package/packages/agent-ui-kit/src/components/ChatInput/._use-auto-rows.test.tsx +0 -0
  224. package/packages/agent-ui-kit/src/components/ChatInput/._use-auto-rows.ts +0 -0
  225. package/packages/agent-ui-kit/src/components/ChatInput/voice/._VoicePressField.tsx +0 -0
  226. package/packages/agent-ui-kit/src/components/ChatInput/voice/._VoiceRecordingOverlay.tsx +0 -0
  227. package/packages/agent-ui-kit/src/components/ChatInput/voice/._machine.ts +0 -0
  228. package/packages/agent-ui-kit/src/components/ChatInput/voice/._useVoicePress.ts +0 -0
  229. package/packages/agent-ui-kit/src/components/HistoryEntry/._index.tsx +0 -0
  230. package/packages/agent-ui-kit/src/components/MediaList/._index.tsx +0 -0
  231. package/packages/agent-ui-kit/src/components/MessageBubble/._index.test.tsx +0 -0
  232. package/packages/agent-ui-kit/src/components/MessageBubble/._index.tsx +0 -0
  233. package/packages/agent-ui-kit/src/components/PullDownIndicator/._index.tsx +0 -0
  234. package/packages/agent-ui-kit/src/components/QuickCommands/._index.test.tsx +0 -0
  235. package/packages/agent-ui-kit/src/components/QuickCommands/._index.tsx +0 -0
  236. package/packages/agent-ui-kit/src/components/QuickCommands/index.tsx +60 -14
  237. package/packages/agent-ui-kit/src/components/ReasoningBlock/._index.tsx +0 -0
  238. package/packages/agent-ui-kit/src/components/ScrollToBottomButton/._index.tsx +0 -0
  239. package/packages/agent-ui-kit/src/components/ToolCallBlock/._detail.test.ts +0 -0
  240. package/packages/agent-ui-kit/src/components/ToolCallBlock/._detail.ts +0 -0
  241. package/packages/agent-ui-kit/src/components/ToolCallBlock/._index.test.tsx +0 -0
  242. package/packages/agent-ui-kit/src/components/ToolCallBlock/._index.tsx +0 -0
  243. package/packages/agent-ui-kit/src/components/ToolCallBlock/._titles.ts +0 -0
  244. package/packages/agent-ui-kit/src/components/ToolCallBlock/detail.test.ts +2 -0
  245. package/packages/agent-ui-kit/src/components/ToolCallBlock/detail.ts +9 -2
  246. package/packages/agent-ui-kit/src/contract.test.tsx +176 -0
  247. package/packages/agent-ui-kit/src/hooks/._use-drag-gesture.test.ts +0 -0
  248. package/packages/agent-ui-kit/src/hooks/._use-drag-gesture.ts +0 -0
  249. package/packages/agent-ui-kit/src/hooks/._use-pull-down-history.ts +0 -0
  250. package/packages/agent-ui-kit/src/hooks/._use-pull-down-wheel-native.test.ts +0 -0
  251. package/packages/agent-ui-kit/src/hooks/._use-stick-to-bottom.test.tsx +0 -0
  252. package/packages/agent-ui-kit/src/hooks/._use-stick-to-bottom.ts +0 -0
  253. package/packages/agent-ui-kit/src/hooks/._useMediaUpload.ts +0 -0
  254. package/packages/agent-ui-kit/src/hooks/._useTTSAutoPlay.ts +0 -0
  255. package/packages/agent-ui-kit/src/hooks/use-stick-to-bottom.test.tsx +101 -0
  256. package/packages/agent-ui-kit/src/hooks/use-stick-to-bottom.ts +35 -7
  257. package/packages/agent-ui-kit/src/index.ts +2 -0
  258. package/packages/agent-ui-kit/src/overlay/._Overlay.tsx +0 -0
  259. package/packages/agent-ui-kit/src/overlay/._focus.ts +0 -0
  260. package/packages/agent-ui-kit/src/overlay/._index.ts +0 -0
  261. package/packages/agent-ui-kit/src/overlay/._inert.ts +0 -0
  262. package/packages/agent-ui-kit/src/overlay/._layers.ts +0 -0
  263. package/packages/agent-ui-kit/src/overlay/._overlay.ssr.test.tsx +0 -0
  264. package/packages/agent-ui-kit/src/overlay/._overlay.test.tsx +0 -0
  265. package/packages/agent-ui-kit/src/overlay/._presence.ts +0 -0
  266. package/packages/agent-ui-kit/src/overlay/._scroll-lock.ts +0 -0
  267. package/packages/agent-ui-kit/src/overlay/._stack.ts +0 -0
  268. package/packages/agent-ui-kit/src/overlay/._use-overlay.ts +0 -0
  269. package/packages/agent-ui-kit/src/overlay/Overlay.tsx +20 -2
  270. package/packages/agent-ui-kit/src/preview-provider.tsx +8 -0
  271. package/packages/agent-ui-kit/src/shell.contract.json +1 -1
  272. package/packages/agent-ui-kit/src/shell.test.ts +105 -2
  273. package/packages/agent-ui-kit/src/test/._setup.ts +0 -0
  274. package/packages/agent-ui-kit/src/theme/._base.css +0 -0
  275. package/packages/agent-ui-kit/src/theme/._contract.json +0 -0
  276. package/packages/agent-ui-kit/src/theme/._motion.css +0 -0
  277. package/packages/agent-ui-kit/src/theme/._theme-contract.test.ts +0 -0
  278. package/packages/agent-ui-kit/src/theme/._theme.ts +0 -0
  279. package/packages/agent-ui-kit/src/theme/._tokens.css +0 -0
  280. package/packages/agent-ui-kit/src/theme/base.css +42 -2
  281. package/packages/agent-ui-kit/src/utils/._copyText.ts +0 -0
  282. package/packages/agent-ui-kit/src/utils/._haptics.test.ts +0 -0
  283. package/packages/agent-ui-kit/src/utils/._haptics.ts +0 -0
  284. package/packages/agent-ui-kit/src/utils/._image-preview-host.tsx +0 -0
  285. package/packages/agent-ui-kit/src/utils/._imagePreview.test.ts +0 -0
  286. package/packages/agent-ui-kit/src/utils/._imagePreview.ts +0 -0
  287. package/packages/agent-ui-kit/src/utils/._pull-down-machine.test.ts +0 -0
  288. package/packages/agent-ui-kit/src/utils/._pull-down-machine.ts +0 -0
  289. package/packages/agent-ui-kit/src/utils/._session-error.ts +0 -0
  290. package/packages/agent-ui-kit/src/utils/._toast.test.ts +0 -0
  291. package/packages/agent-ui-kit/src/utils/._toast.ts +0 -0
  292. package/packages/agent-ui-kit/src/utils/._tool-call-display.test.ts +0 -0
  293. package/packages/agent-ui-kit/src/utils/._tool-call-display.ts +0 -0
  294. package/packages/contracts-mall/._package.json +0 -0
  295. package/packages/contracts-mall/._tsconfig.json +0 -0
  296. package/packages/contracts-mall/src/._index.ts +0 -0
  297. package/packages/contracts-mall/src/._runtime.ts +0 -0
  298. package/packages/contracts-mall/src/server/._index.ts +0 -0
  299. package/packages/shared/._AGENTS.md +0 -0
  300. package/packages/shared/._package.json +0 -0
  301. package/packages/shared/._tsconfig.json +0 -0
  302. package/packages/shared/src/._index.ts +0 -0
  303. package/pnpm-lock.template.yaml +245 -241
  304. package/pnpm-workspace.template.yaml +11 -11
  305. package/profiles/._mall.json +0 -0
  306. package/profiles/mall/._TEMPLATE.md +0 -0
  307. package/profiles/mall/._chat.overrides.json +0 -0
  308. package/profiles/mall/config/._agent.jsonc +0 -0
  309. package/profiles/mall/config/._chat.json +0 -0
  310. package/profiles/mall/config/._knowledge.json +0 -0
  311. package/scenarios/._README.md +0 -0
  312. package/scripts/._assert-pack.mjs +0 -0
  313. package/scripts/._build.sh +0 -0
  314. package/scripts/._check-css-target.mjs +0 -0
  315. package/scripts/._check-fast.mjs +0 -0
  316. package/scripts/._check-workspace.mjs +0 -0
  317. package/scripts/._checks.json +0 -0
  318. package/scripts/._deliver.mjs +0 -0
  319. package/scripts/._dev-alipay.mjs +0 -0
  320. package/scripts/._dev.sh +0 -0
  321. package/scripts/._generate.mjs +0 -0
  322. package/scripts/._interaction-probe.mjs +0 -0
  323. package/scripts/._prepare.sh +0 -0
  324. package/scripts/._shell-probe.mjs +0 -0
  325. package/scripts/._smoke.mjs +0 -0
  326. package/scripts/._start.sh +0 -0
  327. package/scripts/._stop.sh +0 -0
  328. package/scripts/._storyboard.mjs +0 -0
  329. package/scripts/._verify-generated.mjs +0 -0
  330. package/scripts/check-fast.mjs +11 -2
  331. package/scripts/checks.json +80 -2
  332. package/scripts/deliver.mjs +85 -7
  333. package/scripts/interaction-probe.mjs +222 -0
  334. package/scripts/lib/._chrome-pipe.mjs +0 -0
  335. package/scripts/lib/._geometry-kernel.mjs +0 -0
  336. package/scripts/lib/geometry-kernel.mjs +8 -1
  337. package/scripts/shell-probe.mjs +8 -3
  338. package/scripts/storyboard.mjs +5 -0
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,10 @@
1
+ {
2
+ // 业务提示词(必填):逐行拼接,追加在平台规则之后;不替代平台规则。
3
+ // 领域中立:这里写「怎么答」的通用准则,具体业务(门店/优惠/订单…)由需求侧决定。
4
+ // 字段真源:pnpm exec tbox-app schema config/agent.jsonc
5
+ "instructions": [
6
+ "先给结论,再给必要细节;信息不足就先追问最关键的一项,不要编造未查到的事实。",
7
+ "涉及实时数据(清单、状态、金额、可用性)时,先调工具拿真实数据再作答,不复述工具原始 JSON;卡片由工具出参交给平台渲染。"
8
+ ]
9
+ // 装配长期记忆时可再加 "memoryInstructions": ["…"](同样逐行拼接)。
10
+ }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -76,7 +76,11 @@ export const action = defineAction({
76
76
  - `id` 全局唯一;`cardType` 决定它挂在哪张卡上(数组表示同一操作出现在多张卡上),出卡时平台按被点卡签发令牌;
77
77
  - `inputSchema` 校验卡片传入的 `input`;无参动作写 `z.object({})`;
78
78
  - `execute(input, ctx)` 的 `ctx` 是 `{ userId, cardId?, cardType? }`——`userId` 来自授权令牌绑定的会话身份,**不要信客户端传上来的 userId**;`cardType` 是被点击那张卡的类型;
79
- - 返回值三选一:`updateResult(card, data)` 原地更新被点的卡、`cardResult(card, data)` 出一张结果卡、`actionResult.notice(text)` 只给一条提示。`update` 与 `card` 互斥;
79
+ - 返回值三选一:`updateResult(card, data, { notice })` 原地更新被点的卡、`cardResult(card, data, { placement, replaceKey, notice })` 出一张结果卡、`actionResult.notice(text)` 只给一条提示。`update` 与 `card` 互斥;
80
+ - **结果卡落点**:`placement` 三选一——`timeline`(缺省,插在对话流末尾并滚入视口)/ `sheet`(半屏抽屉,详情与完整券包用)/ `top`(只给业务旁路欢迎卡)。不写就按卡的 `defaultPlacement`,再缺省 `timeline`。
81
+ - **重复触发必须给 `replaceKey`**(字母/数字/冒号/下划线/中划线,≤128):同键原位替换,连点不会叠出一排一样的卡。没写时 `action.placement-check` 会提醒。
82
+ - **改动了别处的状态**(券包/订单/会员)→ 带上 `invalidateCardTypes: ['parking-order']`:同会话里旧卡顶部出现「相关状态已更新」,不会两张卡互相打架。
83
+ - `text` / `notice` 是伴随轻提示:**有卡也会发**,不会因为出卡就吞掉提示。
80
84
  - `data` 与出卡同口径:视图卡(`defineViewCard`)收**领域数据**,平台内部转成视图 JSON;三件套卡收该卡 schema 的值。传视图 JSON 仍然可用,但不要手写 `card.view(...)`;
81
85
  - 写操作用 `singleUse: true` 防重复提交;幂等判断放在副作用之前;
82
86
  - 动作结果只回给客户端(`tbox:card-update` / `tbox:notice` / 结束回执 `tbox:action-settled`),**不进模型上下文**——需要模型知道的事实,让它在下一轮用工具查。
@@ -34,7 +34,13 @@ export const card = defineViewCard<ParkingOrder>({
34
34
  });
35
35
  ```
36
36
 
37
- - 积木:`hero` / `facts` / `bill` / `notice` / `tags` / `steps` / `list` / `ticket` / `timeline` / `empty`;动作规格与 `ActionList` 同形(label / send / invoke / confirm / style)。
37
+ - 积木:`hero` / `facts` / `bill` / `notice` / `tags` / `steps` / `list` / `stats` / `tickets` / `ticket` / `timeline` / `empty`;动作规格与 `ActionList` 同形(label / send / invoke / confirm / style)。
38
+ - `hero` 的 `title` 可选:积分/余额这类主视觉只写 `value` + `unit` 就够,**不要**为了凑标题跟卡标题重复(`card.copy-redundant` 会点名)。
39
+ - `stats`(2–4 格):一行并列数值,替代「facts 竖排四行」——`items: [{ label: '积分', value: '1,280' }]`。
40
+ - `tickets`(≤3 张):券包/票夹形态,每项 `{ amount, title, condition?, status?, action? }`;完整券包走抽屉(见下)。
41
+ - `list` 条目多了三样:`badge`(标题左短标记)、`status`(状态胶囊)、`actions`(≤3 个按钮,单行等分)。
42
+ - **明细卡默认进抽屉**:卡声明写 `defaultPlacement: 'sheet'`,动作不写 `placement` 时自动进半屏抽屉,
43
+ 且不再受「流内一屏 506px」高度告警约束;抽屉内关闭后原位留「查看详情」胶囊,不会消失。
38
44
  - `hero` 的 `tone`:`primary`(缺省)/ `warm` / `jade` / `inverse`。**要深色主视觉(金额、路线、会员等级)用 `inverse`**——它用 `--tbox-primary-dark` 底 + `--tbox-primary-light` 字,对比度由门禁 `shell.contrast` 兜底;不要为了深色底去写 `bg-[#173F33]` 这类字面量(`style.color-repeat` 会点名)。
39
45
  - 预算写进 schema:积木 ≤4、提示 ≤1、属性 ≤5、列表 ≤3、账单行 ≤8、步骤 ≤5、时间线 ≤6、标签 ≤6、卡级动作 ≤2;作者期 `defineViewCard` 直接报错,生产侧 `cardOfView` 先截断再校验,不整张卡丢弃。
40
46
  - 样例由 `sampleState` 与 `samples` 派生,不用手写大段 `sampleData`。
@@ -41,7 +41,7 @@
41
41
  | `css.sentinel`(错误) | 证据 CSS 为空、缺模块源码或模块类未生成 | 确认 `vite.config.ts` 的 `tboxModuleSourcesPlugin` 在 `tailwindcss()` 之前;证据与 dev/build 共用 app-build 的 `collectModuleSourceDirs`([style](style.md)) |
42
42
  | `card.states`(错误) | 卡片历史态渲染失败或为空 | 用 isHistory 只禁用动作,不隐藏内容([card](card.md)) |
43
43
  | `shell.hit-target`(错误) | 可交互元素命中区小于 44px | 用 kit 按钮与 min-h-11;视觉尺寸可小,命中区要足([shell](shell.md)) |
44
- | `shell.quick-visible`(错误) | 空态快捷问题没有全部可见(横向溢出或贴底) | 空态用两列 grid,对话态才用单行([shell](shell.md)) |
44
+ | `shell.quick-visible`(错误) | 空态快捷问题没有全部可见(横向溢出或贴底) | 无 home 槽的纯对话欢迎态用两列 grid,有 home 槽的首页与对话态共用输入框上方单行([shell](shell.md)) |
45
45
  | `flow.persist`(建议) | 状态没有跨进程重启验证 | 用 createUserState({ persist: "file" }) 并加重启探针([state](state.md)) |
46
46
  | `shell.contrast`(错误) | 令牌对比度低于阈值(文字看不清) | 调 brand.css 的令牌值;color-mix 派生的由浏览器车道补验([style](style.md)) |
47
47
  | `shell.blank`(建议) | 首页内容块之间空白过大(看起来没做完) | 空态成组居中、补服务入口;只算块间空白,不算首尾对称留白;聊天流首屏记 not-run([shell](shell.md)) |
@@ -63,4 +63,10 @@
63
63
  | `shell.no-fixed-chrome`(错误) | 滚动区之上有常驻元素(页头、固定标题栏) | 删掉固定区;品牌/身份写 welcome.title,页面标题写 page.title([shell](shell.md)) |
64
64
  | `shell.input-rows`(错误) | 空输入框不是单行(或不是 chat.json 要求的行数),或外框命中区不足 | 输入框高度交给 kit 的 useAutoRows;不要给 textarea 写死 min-height([shell](shell.md)) |
65
65
  | `shell.follow-latest`(错误) | 流式内容增长时不跟底,或用户上滑后仍被拉回底部 | 滚动位置交给 kit 的 useStickToBottom;不要自己写「离底 <N 就跟随」([shell](shell.md)) |
66
+ | `style.class-conflict`(错误) | 同一个 className 里写了互斥类(如 border-0 与 border、hidden 与 flex) | 删掉其中一个:边框/底色/显隐只留一个来源(变体类或基础类)([style](style.md)) |
67
+ | `card.raw-button`(建议) | 自定义卡片里的 <button> 缺 type="button" 或未写最小热区 | 补 type="button" 与 min-h-11(或直接用 kit 的 CardButton)([card](card.md)) |
68
+ | `card.button-ua-style`(错误) | 卡片按钮仍是浏览器默认外观(outset 边框) | 用 kit 的 CardButton/ActionList;自定义按钮写 `border-0 bg-transparent`(作用域重置已兜底)([style](style.md)) |
69
+ | `card.copy-redundant`(建议) | 卡片标题在 eyebrow/header/hero 之间重复,或用户可见文案含内部实现词 | 标题只在一处写;把「状态实时同步/轮询」这类实现词换成用户关心的事实([card](card.md)) |
70
+ | `card.action-semantics`(建议) | 按钮文案是纯终态词(已领取 / 已过期),点了不会有反应 | 终态不再给按钮(用 status 徽标);仍可操作的写动作短语(已领券 · 查看)([card-action](card-action.md)) |
71
+ | `action.placement-check`(建议) | cardResult 既没写 replaceKey 也没声明 placement: 'sheet' | 明细卡在卡声明写 defaultPlacement: 'sheet';反复触发的卡写 replaceKey(同键原位替换)([card-action](card-action.md)) |
66
72
  <!-- check-docs:errors end -->
package/docs/agent/kit.md CHANGED
@@ -12,7 +12,7 @@
12
12
  import { Card, CardHeader, KeyValueList, StatusTag } from '@tbox.cn/app-agent-ui-kit';
13
13
  ```
14
14
 
15
- ## 基元(20)
15
+ ## 基元(21)
16
16
 
17
17
  | 基元 | 用途 | props |
18
18
  |---|---|---|
@@ -23,18 +23,19 @@ import { Card, CardHeader, KeyValueList, StatusTag } from '@tbox.cn/app-agent-ui
23
23
  | `StatusTag` | 状态标签。 * | `children: ReactNode` `tone?: Tone` |
24
24
  | `Notice` | 提示条:说明、限制、下一步指引。 * | `children: ReactNode` `tone?: Tone` `icon?: ReactNode` |
25
25
  | `ActionRow` | 按钮行:主次两级,禁用整行。 * | `primary?: ReactNode` `secondary?: ReactNode` `disabled?: boolean` |
26
- | `CardButton` | — | `children: ReactNode` `onClick?: () => void` `variant?: 'primary' \| 'secondary' \| 'link'` `disabled?: boolean` `busy?: boolean` |
27
- | `ConfirmSheet` | 确认弹层:写操作前的一次确认(走 kit 统一弹层内核:传送、滚动锁、Escape、焦点循环与恢复)。 | `open: boolean` `title: ReactNode` `description?: ReactNode` `confirmText?: string` `cancelText?: string` `onConfirm: () => void` `onCancel: () => void` |
28
- | `Ticket` | 票券形:券、凭证、卡包条目。 | `amount: ReactNode` `condition?: ReactNode` `meta?: ReactNode` `status?: ReactNode` `tone?: 'primary' \| 'muted'` |
26
+ | `CardButton` | — | `children: ReactNode` `onClick?: () => void` `variant?: CardButtonVariant` `size?: 'md' \| 'sm'` `disabled?: boolean` `busy?: boolean` `loading?: boolean` `className?: string` |
27
+ | `ConfirmSheet` | 确认弹层:写操作前的一次确认(走 kit 统一弹层内核:传送、滚动锁、Escape、焦点循环与恢复)。 | `open: boolean` `title: ReactNode` `description?: ReactNode` `confirmText?: string` `cancelText?: string` `tone?: 'primary' \| 'danger'` `highlights?: string[]` `onConfirm: () => void` `onCancel: () => void` |
28
+ | `Ticket` | 票券形:券、凭证、卡包条目。 | `amount: ReactNode` `title?: ReactNode` `action?: ReactNode` `condition?: ReactNode` `meta?: ReactNode` `status?: ReactNode` `tone?: 'primary' \| 'muted'` |
29
29
  | `Steps` | 步骤/路线:取车路线、办理进度。 | `steps: StepItem[]` |
30
30
  | `MediaRow` | 图文条目:门店、商品、活动。 | `title: ReactNode` `meta?: ReactNode` `tags?: ReactNode` `action?: ReactNode` `thumb?: ReactNode` |
31
- | `Hero` | 品牌色块:主数值 + 说明,用于会员、积分、钱包类卡片的头部。 | `eyebrow?: ReactNode` `title: ReactNode` `value?: ReactNode` `unit?: ReactNode` `footnote?: ReactNode` `icon?: ReactNode` `tone?: 'primary' \| 'warm' \| 'jade' \| 'inverse' \| 'neutral'` |
31
+ | `Hero` | 品牌色块:主数值 + 说明,用于会员、积分、钱包类卡片的头部。 | `eyebrow?: ReactNode` `title?: ReactNode` `value?: ReactNode` `unit?: ReactNode` `footnote?: ReactNode` `icon?: ReactNode` `tone?: 'primary' \| 'warm' \| 'jade' \| 'inverse' \| 'neutral'` |
32
32
  | `StatGrid` | 并列数值格(两到三格):积分/余额、车位/时长。 | `items: StatItem[]` |
33
- | `EntityRow` | 实体行(MediaRow 的超集):商户、活动、券包条目,支持价格与展开说明。 | `title: ReactNode` `meta?: ReactNode` `tags?: ReactNode` `price?: ReactNode` `action?: ReactNode` `thumb?: ReactNode` `description?: ReactNode` |
33
+ | `EntityRow` | 实体行(MediaRow 的超集):商户、活动、券包条目,支持价格与展开说明。 | `title: ReactNode` `badge?: ReactNode` `status?: ReactNode` `meta?: ReactNode` `tags?: ReactNode` `price?: ReactNode` `action?: ReactNode` `actions?: ReactNode` `thumb?: ReactNode` `description?: ReactNode` |
34
34
  | `CheckRow` | 勾选行:用券、同意条款、选择车位。 | `label: ReactNode` `description?: ReactNode` `checked: boolean` `onChange?: (checked: boolean) => void` `disabled?: boolean` `trailing?: ReactNode` |
35
35
  | `Timeline` | 明细时间线:积分收支、停车计费。 * | `items: TimelineItem[]` |
36
36
  | `EmptyState` | 空态:没券、没订单、没记录时给一句解释与一个下一步。 * | `title: ReactNode` `description?: ReactNode` `action?: ReactNode` |
37
37
  | `TagList` | 标签组:口味、距离、适用条件。 * | `tags: ReactNode[]` `tone?: Tone` |
38
+ | `CardActionButton` | 单动作按钮(`ActionList` 的单个版本):三件套自定义卡片想复用「单飞 / 确认弹层 / 历史禁用」 | `api: CardActions` `action: CardActionSpec` `variant?: CardButtonVariant` `size?: 'md' \| 'sm'` `className?: string` |
38
39
  | `ActionList` | — | `actions: CardActionSpec[]` `api: CardActions` |
39
40
 
40
41
  ## 图标
@@ -23,6 +23,8 @@ export default function Index() {
23
23
  壳没有页头,也不渲染任何常驻标题区。智能体身份由两处配置承载:
24
24
 
25
25
  - `welcome.title` / `welcome.subtitle`:空会话欢迎区的标题与副标题;
26
+ - `welcome.surface`:欢迎区表面(`default` 缺省 / `brand` 品牌深色渐变 / `subtle` 弱化描边)。
27
+ `brand` 只组合既有主题变量并在上面叠 18% 深色罩保证小字对比度——换品牌色不用改它;
26
28
  - `page.title`:页面标题(浏览器标签页与分享卡片)。
27
29
 
28
30
  欢迎区只在空会话且没有 `home` 槽时出现。
@@ -41,7 +43,7 @@ export default function Index() {
41
43
  | 位置 | 改法 |
42
44
  |---|---|
43
45
  | 空会话欢迎区 | `config/chat.json` 的 `welcome.title` / `welcome.subtitle` |
44
- | 快捷问题 | `config/chat.json` 的 `quickCommands`(见 [agent-prompt](agent-prompt.md)) |
46
+ | 快捷问题 | `config/chat.json` 的 `quickCommands`(无 `home` 槽的空会话在正文用两列网格;有 `home` 槽的首页与对话态共用输入框上方单行,见 [agent-prompt](agent-prompt.md)) |
45
47
  | 出错重试 | `config/chat.json` 的 `retryOnError`(缺省 true):错误气泡上给「重试」,重发上一条用户消息 |
46
48
  | 输入框行数 | `config/chat.json` 的 `input.minRows`(空输入框行数,缺省 1)/ `input.maxRows`(自动长高上限,缺省 4)。只有用户明确要求时才改 `minRows`——改了会记入「偏离出厂」 |
47
49
  | 出厂能力开关 | 语音输入/播报、图片/视频上传缺省开启;`chat.json` 不写这些键。只有用户明确要求时才写 `false`——门禁会把它记为「偏离出厂」并要求写明依据 |
@@ -51,6 +51,43 @@ const TONE = { ok: 'bg-success-soft text-success', warn: 'bg-warning-soft text-w
51
51
  - 禁用:默认调色板(`bg-red-500` 不生成)、透明度修饰符(`bg-primary/50` 依赖 `color-mix`,旧内核回落为不透明)、`!` 重要性(只在覆写无层的旧规则时用,写在变体尾部如 `rounded-none!`)。
52
52
  - 未知类不会报错、只是不生效;上面这几类禁用项由 `check:fast` 的证据包直接判错(`palette-color` / `color-opacity-modifier` / `font-size-off-scale` / `element-asset-declaration`)。
53
53
 
54
+ ## 出厂色板(三套,全部过 WCAG AA)
55
+
56
+ 不想自己调色时,从下面三套里挑一套整段贴进 `brand.css` 的 `@tbox:tokens-begin/end` 标记区。
57
+ 三套的八对常用前景/背景组合都 ≥ 4.5:1(大字号标题另算,只需 3:1),可以直接用,不必再跑 `theme check`。
58
+
59
+ | 风格 | 主色 | 深色 | 浅色 | 适合 |
60
+ |---|---|---|---|---|
61
+ | 暖砂松绿(默认推荐) | `#2f7d5d` | `#1f5a42` | `#eaf4ef` | 生活服务、商圈、社区 |
62
+ | 现代海蓝 | `#1b62d6` | `#134a9f` | `#eaf1fd` | 工具型、缴费、政务 |
63
+ | 温暖琥珀 | `#a15a12` | `#7a430b` | `#fdf1e2` | 餐饮、零售、促销 |
64
+
65
+ 配套文字与中性色(三套通用,差异只在品牌彩部):
66
+
67
+ ```css
68
+ html[data-theme='tbox'] {
69
+ /* 暖砂松绿 */
70
+ --tbox-primary: #2f7d5d;
71
+ --tbox-primary-dark: #1f5a42;
72
+ --tbox-primary-light: #eaf4ef;
73
+ --tbox-accent: #3f8f6c;
74
+ --tbox-accent-light: #eaf4ef;
75
+ --tbox-text-primary: #12181f;
76
+ --tbox-text-secondary: #4f5a68;
77
+ --tbox-text-muted: #6d7787;
78
+ --tbox-bg-page: #f8faf9;
79
+ --tbox-bg-card: #ffffff;
80
+ --tbox-bg-subtle: #f2f6f4;
81
+ --tbox-border: #e0e7e3;
82
+ --tbox-border-strong: #cfd9d3;
83
+ }
84
+ ```
85
+
86
+ - 换品牌只改这 13 个键,不要改 `--tbox-fs-*` / `--tbox-radius-*` / 阴影:那几组是版式合同,改了就与基元对不上。
87
+ - 深色主视觉(`hero.tone: 'inverse'`、`welcome.surface: 'brand'`)用 `primary-dark` 打底 + `primary-light` 写字;
88
+ 浅色字压在中间调品牌色上达不到 4.5:1,平台已在欢迎区叠 18% 深色罩兜底,自定义时不要把它去掉。
89
+ - 需要第四套以外的品牌色:`theme derive --seed <hex>` 从种子派生,再 `theme check` 复核。
90
+
54
91
  ## 品牌与主题变量
55
92
 
56
93
  品牌入口只有一个:`apps/client/src/styles/brand.css`,在 `html[data-theme='tbox']` 段里覆写平台变量:
@@ -18,7 +18,7 @@
18
18
 
19
19
  1. `pnpm generate`——生成 registry 与入口;三件套不成对、`cardType` 不一致在这里报错(视图卡声明了 `view`,免成对)。
20
20
  2. `eslint --fix`——先修复,避免改文件与类型检查竞争。
21
- 3. 并行:四个包 `tsc --noEmit`(开发期放宽未用变量,`pnpm verify` 仍严格)、`verify-generated` 结构检查、证据包。
21
+ 3. 并行:四个包 `tsc --noEmit`(开发期放宽未用变量、增量缓存写 `.tbox/cache/`;`pnpm deliver` 会再跑一次严格 tsc)、`verify-generated` 结构检查、证据包。
22
22
  4. **证据包**(`apps/client/scripts/check-evidence.mjs`,一个进程):品牌变量编译 → 卡片样例 / 出卡类型 / 出卡提示 / `invoke` 与动作对齐 / 字号 / 颜色语法 → 每张卡 × 每个样例经真实 React 组件渲染 → `scenarios/*.json` 全部执行 → 验收项覆盖与裁决。
23
23
 
24
24
  成功输出一行 JSON,自带证据:
@@ -87,7 +87,10 @@
87
87
  摘要里的 `coverage` 给每个维度一个状态(结构 / 逻辑 / 渲染 / 视觉 / 模型路由),`handoff` 是当前策略
88
88
  验不了的清单。档位缺省 `visual`(静态 + 布局车道);应用把档位降到 `static` 必须写 `policyReason`(用户原话),否则门禁按 `visual` 执行并告警。平台可用 `TBOX_POLICY` 注入档位。
89
89
 
90
- 交付用 `pnpm deliver`,只运行一次:它跑 `check:fast`,输出裁决、未运行项、偏离出厂与验收变更,并生成 `DELIVERY.md`;摘要固定给一行「视觉证据:.tbox/evidence/storyboard.png(N 帧,几何问题 k 个)」。`pnpm storyboard` 仅供人工查看;`pnpm verify` 只在发布前由人/CI 跑。
90
+ 交付用 `pnpm deliver`,只运行一次:它跑一次严格 tsc + `check:fast`(`--policy quick` 且门禁结果未过期时直接复用),输出裁决、未运行项、偏离出厂与验收变更,并生成 `DELIVERY.md`;摘要固定给一行「视觉证据:.tbox/evidence/storyboard.png(N 帧,几何问题 k 个)」。`pnpm storyboard` 仅供人工查看;`pnpm verify` 只在发布前由人/CI 跑。
91
+
92
+ `pnpm probe:interaction`:真 Chrome 里量弹层命中(`elementFromPoint`),含 `prefers-reduced-motion` 两页;
93
+ 面板没有定位上下文这类「遮罩盖住按钮」的缺陷只有它能抓(happy-dom 单测看不见)。改过 `Overlay`/`ConfirmSheet`/`BottomSheet` 后跑一次;`stage` 会强制跑。
91
94
 
92
95
  `pnpm storyboard`:把壳与每张卡的样例在 390 / 320 两个宽度排成一页长图并同时量几何(溢出、截断、点击区、字号)。源文件没变时命中缓存(<2s);没有 Chrome 记 not-run;帧数超预算时截断并注明。看图即可判断「界面到底长什么样」,不需要起 dev server;它仅供人工查看,交付时不要再单独运行。
93
96
  已经 `deliverable` 之后再跑,`delivery.changedSinceDelivered` 给出交付后改动的文件数;裁决保持 `deliverable`,只记录不降级。
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/app-template-agent",
3
- "version": "1.0.0-alpha.16",
3
+ "version": "1.0.0-alpha.17",
4
4
  "description": "tbox AI Agent 全栈模板(多包 pnpm workspace):apps/client + apps/server。唯一模板(W4 单一模板统一化:缺省带 AI 支付体验的 chat 形态;mall 能力经 profiles/mall 加装),能力经 CLI module add 模块扩展(shopping-guide/member 等)。",
5
5
  "engines": {
6
6
  "node": ">=24.0.0 <25.0.0",
@@ -49,9 +49,9 @@
49
49
  "typescript-eslint": "8.67.0",
50
50
  "eslint-plugin-react-hooks": "5.2.0",
51
51
  "vite": "6.4.3",
52
- "@tbox.cn/app-sdk-server": "1.0.0-alpha.16",
53
- "@tbox.cn/app-build": "1.0.0-alpha.16",
54
- "@tbox.cn/app-cli": "1.0.0-alpha.16"
52
+ "@tbox.cn/app-sdk-server": "1.0.0-alpha.17",
53
+ "@tbox.cn/app-build": "1.0.0-alpha.17",
54
+ "@tbox.cn/app-cli": "1.0.0-alpha.17"
55
55
  },
56
56
  "license": "MIT",
57
57
  "publishConfig": {
@@ -83,6 +83,7 @@
83
83
  "check:fast": "node scripts/check-fast.mjs",
84
84
  "deliver": "node scripts/deliver.mjs",
85
85
  "probe:shell": "node scripts/shell-probe.mjs",
86
+ "probe:interaction": "node scripts/interaction-probe.mjs",
86
87
  "check:css": "node scripts/check-css-target.mjs",
87
88
  "scenario": "pnpm --filter ./apps/server exec node --import tsx scripts/scenario.mjs",
88
89
  "card:render": "pnpm --filter ./apps/client exec node scripts/render-card.mjs",
Binary file
Binary file
Binary file
@@ -193,7 +193,7 @@
193
193
  },
194
194
  {
195
195
  "name": "CardButton",
196
- "propsType": "{\n children: ReactNode;\n onClick?: () => void;\n variant?: 'primary' | 'secondary' | 'link';\n disabled?: boolean;\n /** 动作进行中:只影响可访问性语义,视觉由调用方给 spinner */\n busy?: boolean;\n}",
196
+ "propsType": "{\n children: ReactNode;\n onClick?: () => void;\n variant?: CardButtonVariant;\n /** `sm` 只压视觉(字号/内距),命中区仍 ≥44px */\n size?: 'md' | 'sm';\n disabled?: boolean;\n /** 动作进行中:只影响可访问性语义,视觉由调用方给 spinner */\n busy?: boolean;\n /** 由按钮自己渲染 spinner(自定义卡不必再手写 loading 标记) */\n loading?: boolean;\n /** 追加类名(布局用;颜色/尺寸仍走变体与 size,避免再次出现类冲突) */\n className?: string;\n}",
197
197
  "props": [
198
198
  {
199
199
  "name": "children",
@@ -207,9 +207,15 @@
207
207
  },
208
208
  {
209
209
  "name": "variant",
210
- "type": "'primary' | 'secondary' | 'link'",
210
+ "type": "CardButtonVariant",
211
211
  "optional": true
212
212
  },
213
+ {
214
+ "name": "size",
215
+ "type": "'md' | 'sm'",
216
+ "optional": true,
217
+ "doc": "`sm` 只压视觉(字号/内距),命中区仍 ≥44px"
218
+ },
213
219
  {
214
220
  "name": "disabled",
215
221
  "type": "boolean",
@@ -220,6 +226,18 @@
220
226
  "type": "boolean",
221
227
  "optional": true,
222
228
  "doc": "动作进行中:只影响可访问性语义,视觉由调用方给 spinner"
229
+ },
230
+ {
231
+ "name": "loading",
232
+ "type": "boolean",
233
+ "optional": true,
234
+ "doc": "由按钮自己渲染 spinner(自定义卡不必再手写 loading 标记)"
235
+ },
236
+ {
237
+ "name": "className",
238
+ "type": "string",
239
+ "optional": true,
240
+ "doc": "追加类名(布局用;颜色/尺寸仍走变体与 size,避免再次出现类冲突)"
223
241
  }
224
242
  ]
225
243
  },
@@ -253,6 +271,18 @@
253
271
  "type": "string",
254
272
  "optional": true
255
273
  },
274
+ {
275
+ "name": "tone",
276
+ "type": "'primary' | 'danger'",
277
+ "optional": true,
278
+ "doc": "主按钮语气:`danger` 用于取消报名/解绑等不可逆操作"
279
+ },
280
+ {
281
+ "name": "highlights",
282
+ "type": "string[]",
283
+ "optional": true,
284
+ "doc": "确认要点(如「+100 积分」「满100减20券」):渲染为紧凑标签行,扫一眼即知收益"
285
+ },
256
286
  {
257
287
  "name": "onConfirm",
258
288
  "type": "() => void",
@@ -276,6 +306,18 @@
276
306
  "optional": false,
277
307
  "doc": "主金额或主标题"
278
308
  },
309
+ {
310
+ "name": "title",
311
+ "type": "ReactNode",
312
+ "optional": true,
313
+ "doc": "券名(券组场景必填,单票券可省)"
314
+ },
315
+ {
316
+ "name": "action",
317
+ "type": "ReactNode",
318
+ "optional": true,
319
+ "doc": "右侧/底部动作(券组里的「领取」按钮)"
320
+ },
279
321
  {
280
322
  "name": "condition",
281
323
  "type": "ReactNode",
@@ -377,7 +419,8 @@
377
419
  {
378
420
  "name": "title",
379
421
  "type": "ReactNode",
380
- "optional": false
422
+ "optional": true,
423
+ "doc": "主标题(可选:纯数值型主视觉只需要 eyebrow + value)"
381
424
  },
382
425
  {
383
426
  "name": "value",
@@ -453,6 +496,18 @@
453
496
  "type": "ReactNode",
454
497
  "optional": false
455
498
  },
499
+ {
500
+ "name": "badge",
501
+ "type": "ReactNode",
502
+ "optional": true,
503
+ "doc": "标题前的短标记(分类字、评分)"
504
+ },
505
+ {
506
+ "name": "status",
507
+ "type": "ReactNode",
508
+ "optional": true,
509
+ "doc": "标题右侧状态胶囊(可领取 / 已领取 / 售罄)"
510
+ },
456
511
  {
457
512
  "name": "meta",
458
513
  "type": "ReactNode",
@@ -476,6 +531,12 @@
476
531
  "optional": true,
477
532
  "doc": "右侧操作(按钮)"
478
533
  },
534
+ {
535
+ "name": "actions",
536
+ "type": "ReactNode",
537
+ "optional": true,
538
+ "doc": "底部操作行(多个条目级动作并排)"
539
+ },
479
540
  {
480
541
  "name": "thumb",
481
542
  "type": "ReactNode",
@@ -610,6 +671,74 @@
610
671
  }
611
672
  ]
612
673
  },
674
+ {
675
+ "name": "CardActionButton",
676
+ "summary": "单动作按钮(`ActionList` 的单个版本):三件套自定义卡片想复用「单飞 / 确认弹层 / 历史禁用」",
677
+ "propsType": "{\n api: CardActions;\n action: CardActionSpec;\n /** 缺省按 action.style(primary → 实心) */\n variant?: CardButtonVariant;\n size?: 'md' | 'sm';\n className?: string;\n}",
678
+ "props": [
679
+ {
680
+ "name": "api",
681
+ "type": "CardActions",
682
+ "optional": false
683
+ },
684
+ {
685
+ "name": "action",
686
+ "type": "CardActionSpec",
687
+ "optional": false
688
+ },
689
+ {
690
+ "name": "variant",
691
+ "type": "CardButtonVariant",
692
+ "optional": true,
693
+ "doc": "缺省按 action.style(primary → 实心)"
694
+ },
695
+ {
696
+ "name": "size",
697
+ "type": "'md' | 'sm'",
698
+ "optional": true
699
+ },
700
+ {
701
+ "name": "className",
702
+ "type": "string",
703
+ "optional": true
704
+ }
705
+ ],
706
+ "itemTypes": [
707
+ {
708
+ "name": "CardActionSpec",
709
+ "members": [
710
+ {
711
+ "name": "label",
712
+ "type": "string",
713
+ "optional": false
714
+ },
715
+ {
716
+ "name": "send",
717
+ "type": "string | { text: string; displayText?: string }",
718
+ "optional": true,
719
+ "doc": "走模型:一句话(或气泡文案与透传文案分开)"
720
+ },
721
+ {
722
+ "name": "invoke",
723
+ "type": "{ id: string; input?: Record<string, unknown> }",
724
+ "optional": true,
725
+ "doc": "走确定性动作:id + 入参"
726
+ },
727
+ {
728
+ "name": "confirm",
729
+ "type": "{\n title: string;\n description?: ReactNode;\n confirmText?: string;\n cancelText?: string;\n tone?: 'primary' | 'danger';\n highlights?: string[];\n }",
730
+ "optional": true,
731
+ "doc": "点击前确认(tone/highlights 与 ConfirmSheet 同义:危险操作语气、权益摘要)"
732
+ },
733
+ {
734
+ "name": "style",
735
+ "type": "'primary' | 'secondary'",
736
+ "optional": true
737
+ }
738
+ ]
739
+ }
740
+ ]
741
+ },
613
742
  {
614
743
  "name": "ActionList",
615
744
  "propsType": "{ actions: CardActionSpec[]; api: CardActions }",
@@ -648,9 +777,9 @@
648
777
  },
649
778
  {
650
779
  "name": "confirm",
651
- "type": "{ title: string; description?: ReactNode; confirmText?: string; cancelText?: string }",
780
+ "type": "{\n title: string;\n description?: ReactNode;\n confirmText?: string;\n cancelText?: string;\n tone?: 'primary' | 'danger';\n highlights?: string[];\n }",
652
781
  "optional": true,
653
- "doc": "点击前确认"
782
+ "doc": "点击前确认(tone/highlights 与 ConfirmSheet 同义:危险操作语气、权益摘要)"
654
783
  },
655
784
  {
656
785
  "name": "style",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/app-agent-ui-kit",
3
- "version": "1.0.0-alpha.16",
3
+ "version": "1.0.0-alpha.17",
4
4
  "type": "module",
5
5
  "description": "Agent 对话壳 UI 组件包(源码发布,单一模板统一化 W2-1):ChatPage/壳组件族/主题 tokens。",
6
6
  "exports": {