P1 knowledge 端到端前端(纯前端,零后端改动——bind-precheck 已返回全部可信 source): - 发起(MarketAssetDetailPage):bind-precheck 就绪→createHandoff 创建一次性 token→跳 /handoff/land/knowledge (token 走 URL query,落地页随即 replaceState 清除,防刷新重复消费)。 - 落地(KnowledgeHandoffLanding):3 步兑现闭环——来源侧 bind-precheck 拿后端可信 source(authorizationSummaryId/ Snapshot/sourceVersion/sourceStatus,不信客户端自造)→目标侧 kbBindPrecheck(后端核验+核销 token,换 precheckId、 token 用完即弃)→createKnowledgeBinding(读 work revision 防乐观锁,落 binding)→clearSession 返回来源。 - owner 分发(HandoffLandingPage):按 targetOwner=knowledge 渲染落地组件,agent/content 留 P2/P3。 - 兑现 hooks(useKnowledgeHandoff)+ 类型收口(MarketBindPrecheckResult.sourceVersion、CreateHandoffInput .authorizationSummaryId 对齐后端 Long,均 openapi 手写类型此前漏标的 drift)。 - mock handlers(market bind-precheck/handoffs/status + knowledge bindings/prechecks),支撑 dev 模式跑通闭环。 验证:tsc/eslint 绿;vitest 89→93(+KnowledgeHandoffLanding 4:就绪渲染/完整闭环/后端核验拒绝负路/会话失效)。 红线真生效(拒伪造/过期 token + 核销 + DB)待真后端 e2e(handoff-knowledge.spec)端到端覆盖。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Oxc
- @vitejs/plugin-react-swc uses SWC
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])