sparkdesign 0.4.4 → 0.4.6

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 (136) hide show
  1. package/README.md +74 -22
  2. package/cli/dist/commands/add.js +22 -12
  3. package/cli/dist/commands/diff.js +8 -4
  4. package/cli/dist/commands/init.js +84 -9
  5. package/cli/dist/commands/list.js +8 -4
  6. package/cli/dist/index.js +9 -6
  7. package/cli/dist/utils/config.js +16 -8
  8. package/cli/dist/utils/package-manager.js +75 -0
  9. package/cli/dist/utils/registry.js +8 -4
  10. package/cli/dist/utils/tokens.js +33 -25
  11. package/cli/dist/utils/transform.js +9 -5
  12. package/cli/dist/utils/tsconfig.js +182 -0
  13. package/cli/registry/AGENTS.md +18 -0
  14. package/cli/registry/__tests__/chat/thinking-indicator.test.tsx +2 -2
  15. package/cli/registry/chat/chat-input/chat-input-folder-selector.tsx +1 -1
  16. package/cli/registry/chat/chat-input/folder-permission-dialog.tsx +2 -2
  17. package/cli/registry/chat/image-generating.tsx +1 -1
  18. package/cli/registry/chat/response/context.tsx +1 -1
  19. package/cli/registry/chat/thinking-indicator.tsx +1 -1
  20. package/cli/registry/tokens/index.css +8 -5
  21. package/cli/registry/tokens/theme-base.css +235 -0
  22. package/{dist/tokens/themes/dark-qoder.css → cli/registry/tokens/themes/dark-mint.css} +1 -1
  23. package/cli/registry/tokens/themes/dark-parchment.css +104 -103
  24. package/{dist/tokens/themes/light-qoder.css → cli/registry/tokens/themes/light-mint.css} +1 -1
  25. package/cli/registry/tokens/themes/light-parchment.css +103 -102
  26. package/dist/registry/basic/alert-dialog.d.ts +7 -5
  27. package/dist/registry/basic/avatar.d.ts +7 -5
  28. package/dist/registry/basic/collapse.d.ts +7 -5
  29. package/dist/registry/basic/collapsible-card.d.ts +7 -6
  30. package/dist/registry/basic/collapsible.d.ts +7 -5
  31. package/dist/registry/basic/dropdown-menu.d.ts +7 -5
  32. package/dist/registry/basic/icons-inline.d.ts +7 -5
  33. package/dist/registry/basic/kbd.d.ts +7 -5
  34. package/dist/registry/basic/pagination.d.ts +7 -5
  35. package/dist/registry/basic/progress.d.ts +7 -5
  36. package/dist/registry/basic/radio-group.d.ts +7 -5
  37. package/dist/registry/basic/resizable.d.ts +7 -5
  38. package/dist/registry/basic/select.d.ts +7 -5
  39. package/dist/registry/basic/slider.d.ts +7 -5
  40. package/dist/registry/basic/sonner.d.ts +7 -5
  41. package/dist/registry/basic/switch.d.ts +7 -5
  42. package/dist/registry/basic/tabs.d.ts +7 -5
  43. package/dist/registry/basic/tag.d.ts +7 -5
  44. package/dist/registry/basic/theme-from-document.d.ts +7 -5
  45. package/dist/registry/basic/tooltip.d.ts +7 -5
  46. package/dist/registry/basic/typography.d.ts +7 -5
  47. package/dist/registry/chat/ask-user-part.d.ts +9 -3
  48. package/dist/registry/chat/browser-action-part.d.ts +9 -3
  49. package/dist/registry/chat/chat-input/compound.d.ts +7 -5
  50. package/dist/registry/chat/chat-input/context.d.ts +7 -5
  51. package/dist/registry/chat/chat-input/index.d.ts +7 -5
  52. package/dist/registry/chat/chat-input/types.d.ts +9 -3
  53. package/dist/registry/chat/chat-input/useAutoResizeTextarea.d.ts +9 -3
  54. package/dist/registry/chat/code-block-part.d.ts +9 -3
  55. package/dist/registry/chat/file-attachment.d.ts +7 -5
  56. package/dist/registry/chat/file-review-part.d.ts +9 -4
  57. package/dist/registry/chat/generated-images-grid.d.ts +9 -3
  58. package/dist/registry/chat/generation-status-bar.d.ts +8 -4
  59. package/dist/registry/chat/hint-banner.d.ts +9 -3
  60. package/dist/registry/chat/mermaid-part.d.ts +9 -3
  61. package/dist/registry/chat/plan-part.d.ts +9 -3
  62. package/dist/registry/chat/reasoning-step/index.d.ts +8 -6
  63. package/dist/registry/chat/reasoning-step/types.d.ts +9 -3
  64. package/dist/registry/chat/related-prompts.d.ts +9 -3
  65. package/dist/registry/chat/response/index.d.ts +8 -6
  66. package/dist/registry/chat/response/types.d.ts +9 -3
  67. package/dist/registry/chat/task-part.d.ts +9 -3
  68. package/dist/registry/chat/terminal-code-block-part.d.ts +9 -3
  69. package/dist/registry/chat/user-question/UserQuestionCard.d.ts +9 -3
  70. package/dist/registry/chat/user-question/UserQuestionFooter.d.ts +9 -3
  71. package/dist/registry/chat/user-question/UserQuestionHeader.d.ts +9 -3
  72. package/dist/registry/chat/user-question/types.d.ts +8 -5
  73. package/dist/registry/lib/file-icon-maps.d.ts +7 -7
  74. package/dist/registry/lib/utils.d.ts +8 -6
  75. package/dist/spark-design.cjs.js +6 -6
  76. package/dist/spark-design.es.js +10 -10
  77. package/dist/sparkdesign.css +2 -0
  78. package/dist/src/components/basic/AlertDialog/index.d.ts +7 -5
  79. package/dist/src/components/basic/Avatar/index.d.ts +9 -3
  80. package/dist/src/components/basic/Button/index.d.ts +9 -3
  81. package/dist/src/components/basic/Collapse/index.d.ts +7 -4
  82. package/dist/src/components/basic/Collapsible/index.d.ts +9 -4
  83. package/dist/src/components/basic/CollapsibleCard/index.d.ts +9 -3
  84. package/dist/src/components/basic/CollapsibleSection/index.d.ts +7 -7
  85. package/dist/src/components/basic/DropdownMenu/index.d.ts +7 -5
  86. package/dist/src/components/basic/EllipsisText/index.d.ts +7 -15
  87. package/dist/src/components/basic/IconButton/index.d.ts +9 -3
  88. package/dist/src/components/basic/Kbd/index.d.ts +9 -3
  89. package/dist/src/components/basic/OptionList/index.d.ts +9 -3
  90. package/dist/src/components/basic/Pagination/index.d.ts +9 -3
  91. package/dist/src/components/basic/Progress/index.d.ts +9 -3
  92. package/dist/src/components/basic/RadioGroup/index.d.ts +9 -3
  93. package/dist/src/components/basic/Resizable/index.d.ts +9 -3
  94. package/dist/src/components/basic/Scrollbar/index.d.ts +9 -3
  95. package/dist/src/components/basic/Select/index.d.ts +7 -4
  96. package/dist/src/components/basic/ShimmeringText/index.d.ts +9 -3
  97. package/dist/src/components/basic/Skeleton/index.d.ts +9 -3
  98. package/dist/src/components/basic/Slider/index.d.ts +9 -3
  99. package/dist/src/components/basic/Spinner/index.d.ts +9 -3
  100. package/dist/src/components/basic/Switch/index.d.ts +8 -5
  101. package/dist/src/components/basic/Table/index.d.ts +9 -3
  102. package/dist/src/components/basic/Tabs/index.d.ts +9 -3
  103. package/dist/src/components/basic/Tag/index.d.ts +7 -4
  104. package/dist/src/components/basic/Toggle/index.d.ts +9 -3
  105. package/dist/src/components/basic/Tooltip/index.d.ts +7 -4
  106. package/dist/src/components/basic/Typography/index.d.ts +9 -3
  107. package/dist/src/components/chat/GeneratedImagesGrid/index.d.ts +9 -3
  108. package/dist/src/components/chat/GenerationStatusBar/index.d.ts +9 -3
  109. package/dist/src/components/chat/Markdown/demo-content.d.ts +1 -1
  110. package/dist/src/components/chat/Markdown/index.d.ts +9 -3
  111. package/dist/src/components/chat/Response/StreamingMarkdownBlock.d.ts +9 -3
  112. package/dist/src/components/chat/Response/index.d.ts +8 -6
  113. package/dist/src/components/chat/UserMessage/index.d.ts +9 -3
  114. package/dist/src/components/index.d.ts +7 -9
  115. package/dist/src/icons/context.d.ts +7 -6
  116. package/dist/src/icons/types.d.ts +7 -5
  117. package/dist/src/lib/ThemeStyleContext.d.ts +9 -9
  118. package/dist/src/lib/file-icon.d.ts +7 -6
  119. package/dist/src/lib/i18n.d.ts +7 -6
  120. package/dist/src/lib/index.d.ts +9 -3
  121. package/dist/src/lib/utils.d.ts +7 -5
  122. package/dist/theme-base.css +7 -8
  123. package/dist/theme.css +2 -2
  124. package/dist/themes/{dark-qoder.css → dark-mint.css} +1 -1
  125. package/dist/themes/{light-qoder.css → light-mint.css} +1 -1
  126. package/dist/tokens/AGENTS.md +47 -0
  127. package/dist/tokens/index.css +10 -19
  128. package/dist/tokens/theme-base.css +7 -8
  129. package/dist/tokens/theme.css +2 -2
  130. package/dist/tokens/themes/dark-mint.css +133 -0
  131. package/dist/tokens/themes/light-mint.css +132 -0
  132. package/package.json +11 -5
  133. package/cli/registry/tokens/themes/dark-qoder.css +0 -132
  134. package/cli/registry/tokens/themes/light-qoder.css +0 -131
  135. package/dist/qoder-design.css +0 -2
  136. package/dist/tokens/CLAUDE.md +0 -305
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (TooltipProps)
3
- * [OUTPUT]: (JSX.Element) - 工具提示组件
4
- * [POS]: registry/basic/tooltip - 注册表模板,复制到用户项目后可自由修改
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/tooltip.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 用户可自由修改此文件
8
- * 2. 更新时使用 npx sparkdesign diff tooltip 查看差异
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import * as React from 'react';
11
13
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (Typography*Props)
3
- * [OUTPUT]: (JSX.Element) - 排版组件(H1–H4, P, Blockquote 等)
4
- * [POS]: registry/basic/typography - 注册表模板,复制到用户项目后可自由修改
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/typography.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 用户可自由修改此文件
8
- * 2. 更新时使用 npx sparkdesign diff typography 查看差异
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import * as React from 'react';
11
13
  export type TypographyH1Props = React.ComponentProps<'h1'>;
@@ -1,7 +1,13 @@
1
1
  /**
2
- * [INPUT]: (AskUserPartProps) - title、question、skipText/runText;可选 headerIcon,未指定则用内联 SVG
3
- * [OUTPUT]: (JSX.Element)
4
- * [POS]: registry/chat - AI 向用户询问确认的卡片组件
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/ask-user-part.tsx — Spark Design source; keep aligned with the main library.
6
+ *
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
5
11
  */
6
12
  import type { ReactNode } from 'react';
7
13
  export interface AskUserPartProps {
@@ -1,7 +1,13 @@
1
1
  /**
2
- * [INPUT]: (BrowserActionPartProps) - description、content、status;可选 normalIcon/failedIcon/skippedIcon,未指定则用内联 SVG
3
- * [OUTPUT]: (JSX.Element)
4
- * [POS]: registry/chat - AI Agent 浏览器操作卡片组件
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/browser-action-part.tsx — Spark Design source; keep aligned with the main library.
6
+ *
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
5
11
  */
6
12
  import { type ReactNode } from 'react';
7
13
  export type BrowserActionStatus = 'normal' | 'failed' | 'skipped';
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: 各复合组件的 props,或从 Context 消费
3
- * [OUTPUT]: ChatInput.Above / Box / Attachments / Input / Actions / ActionsLeft / ActionsRight / ExpandButton / FolderButton / MoreButton / SendButton / DefaultLayout
4
- * [POS]: registry/chat/chat-input - 四层结构复合组件,见 docs/ChatInput四层结构设计.md
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/chat-input/compound.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 所有子组件必须在 ChatInput.Root 内使用
8
- * 2. 布局与层级与设计文档一一对应
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import React from 'react';
11
13
  import type { ReactNode } from 'react';
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (ChatInputContextValue) - Root 注入
3
- * [OUTPUT]: Context + Provider + Hook
4
- * [POS]: registry/chat/chat-input - 复合组件共享状态
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/chat-input/context.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 仅被 Root 与复合子组件使用
8
- * 2. 新增/删除状态时同步更新 ChatInputContextValue Root 中的初值
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import React from 'react';
11
13
  import type { ReactNode } from 'react';
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (ChatInputProps) 复合用法 ChatInputRoot + Above/Box/…(主 API)
3
- * [OUTPUT]: (JSX.Element)
4
- * [POS]: registry/chat/chat-input - 依赖 send-button, generation-status-bar, icon-button, 子组件
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/chat-input/index.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. API 为复合组件(Root/Above/Box/Input/Actions/SendButton 等);ChatInput 仅为默认组合的便捷导出。
8
- * 2. 文件逻辑变更时同步更新 Header、types.ts;见 docs/ChatInput四层结构设计.md
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import React from 'react';
11
13
  import { ChatInputRootProvider } from './context';
@@ -1,7 +1,13 @@
1
1
  /**
2
- * [INPUT]:
3
- * [OUTPUT]: 类型导出
4
- * [POS]: registry/chat/chat-input - ChatInput 类型定义
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/chat-input/types.ts — Spark Design source; keep aligned with the main library.
6
+ *
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
5
11
  */
6
12
  import type { TextareaHTMLAttributes, ReactNode } from 'react';
7
13
  export type InputPropsWithWebkitDirectory = React.InputHTMLAttributes<HTMLInputElement> & {
@@ -1,7 +1,13 @@
1
1
  /**
2
- * [INPUT]: (textareaRef, value, maxRows)
3
- * [OUTPUT]: void
4
- * [POS]: registry/chat/chat-input
2
+ * [WHO]: Output: void; Inputs: (textareaRef, value, maxRows)
3
+ * [FROM]: react
4
+ * [TO]: CLI `add` copy target; canonical implementation in `src/components`
5
+ * [HERE]: registry/chat/chat-input
6
+ *
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when behavior changes
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when needed
10
+ * 3. Follow repository conventions for tokens and exports
5
11
  */
6
12
  import { type RefObject } from 'react';
7
13
  export declare function useAutoResizeTextarea(textareaRef: RefObject<HTMLTextAreaElement | null>, value: string, maxRows: number): void;
@@ -1,7 +1,13 @@
1
1
  /**
2
- * [INPUT]: (CodeBlockPartProps) - language、code、filename、diffType、isGenerating;可选 headerIcon/getFileIcon
3
- * [OUTPUT]: (JSX.Element)
4
- * [POS]: registry/chat - QodeChatPanel 移植,全 token 化;使用 Prism 语法高亮(设计令牌主题)
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/code-block-part.tsx — Spark Design source; keep aligned with the main library.
6
+ *
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
5
11
  */
6
12
  import { type ReactNode } from 'react';
7
13
  export type CodeBlockDiffType = 'add' | 'remove';
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (FileAttachmentProps) - filename、onRemove、icon / getFileIcon
3
- * [OUTPUT]: (JSX.Element) - 带左图标(文件类型)的可关闭 Tag 样式附件
4
- * [POS]: registry/chat - 唯一来源,主库再导出并注入 getFileIcon
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/file-attachment.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * - 仅依赖 registry ui(tag、icons-inline);不依赖 useIcons
8
- * - 可选 getFileIcon(filename, className) icon;不传则用 FileLine
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import type { HTMLAttributes, ReactNode } from 'react';
11
13
  export interface FileAttachmentProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
@@ -1,8 +1,13 @@
1
1
  /**
2
- * [INPUT]: (FileReviewPartProps) - files、defaultExpanded;可选 headerIcon/acceptIcon/rejectIcon/getFileIcon
3
- * [OUTPUT]: (JSX.Element)
4
- * [POS]: registry/chat - QodeChatPanel 移植,全 token 化;默认用 Seti 字体图标(需加载 qoder-seti.woff),hover 显示对号/错号
5
- * Seti 映射与逻辑与 QodeChatPanel FileReviewPart.jsx 内联保持一致,避免模块解析差异导致图形与后缀对不上。
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/file-review-part.tsx Spark Design source; keep aligned with the main library.
6
+ *
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
6
11
  */
7
12
  import { type ReactNode } from 'react';
8
13
  export interface FileReviewFile {
@@ -1,7 +1,13 @@
1
1
  /**
2
- * [INPUT]: (GeneratedImagesGridProps) - 多图网格
3
- * [OUTPUT]: (JSX.Element) - 会话流中多张生成图片的横排排列容器
4
- * [POS]: registry/chat - 唯一来源,无图标依赖
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/generated-images-grid.tsx — Spark Design source; keep aligned with the main library.
6
+ *
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
5
11
  */
6
12
  import type { ReactNode } from 'react';
7
13
  export interface GeneratedImagesGridProps {
@@ -1,9 +1,13 @@
1
1
  /**
2
- * [INPUT]: (GenerationStatusBarProps)
3
- * [OUTPUT]: (JSX.Element) - 生成状态条
4
- * [POS]: registry/chat - 唯一来源,无图标依赖
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/generation-status-bar.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
- * [PROTOCOL]: 样式使用 design token(h-9、text-sm、px-3、rounded-t-xl),随 data-style 变化,与 ChatInputAbove 一致。
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
7
11
  */
8
12
  import type { ReactNode } from 'react';
9
13
  export interface GenerationStatusBarProps {
@@ -1,7 +1,13 @@
1
1
  /**
2
- * [INPUT]: (HintBannerProps) - 提示横幅
3
- * [OUTPUT]: (JSX.Element)
4
- * [POS]: registry/chat - 唯一来源,主库再导出并注入图标
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/hint-banner.tsx — Spark Design source; keep aligned with the main library.
6
+ *
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
5
11
  */
6
12
  import type { ReactNode } from 'react';
7
13
  export interface HintBannerProps {
@@ -1,7 +1,13 @@
1
1
  /**
2
- * [INPUT]: (MermaidPartProps) - content (Mermaid 源码);可选 headerIcon,未指定则用内联 SVG
3
- * [OUTPUT]: (JSX.Element)
4
- * [POS]: registry/chat - QodeChatPanel 移植,全 token 化;mermaid 动态 import,未安装时降级提示
2
+ * [WHO]: Output: (JSX.Element); Inputs: (MermaidPartProps) - content (Mermaid source); optional headerIcon; falls back to inline SVG when omitted
3
+ * [FROM]: react; rel:../basic/collapsible-card; rel:../basic/button; rel:../basic/icons-inline; rel:../basic/scrollbar; rel:../lib/use-mermaid-render
4
+ * [TO]: CLI `add` copy target; canonical implementation in `src/components`
5
+ * [HERE]: registry/chat - Ported from QodeChatPanel; tokenized; dynamic mermaid import with fallback when the dependency is missing
6
+ *
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when behavior changes
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when needed
10
+ * 3. Follow repository conventions for tokens and exports
5
11
  */
6
12
  import { type ReactNode } from 'react';
7
13
  export interface MermaidPartProps {
@@ -1,7 +1,13 @@
1
1
  /**
2
- * [INPUT]: (PlanPartProps) - title、description、content、View/Build/Built;可选 headerIcon/downloadIcon/builtIcon,未指定则用内联 SVG
3
- * [OUTPUT]: (JSX.Element)
4
- * [POS]: registry/chat - QodeChatPanel 移植,全 token
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/plan-part.tsx — Spark Design source; keep aligned with the main library.
6
+ *
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
5
11
  */
6
12
  import type { ReactNode } from 'react';
7
13
  export interface PlanPartProps {
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: ReasoningStepProps
3
- * [OUTPUT]: ReasoningStep compound component
4
- * [POS]: registry/chat/reasoning-step - ReasoningStep 复合组件主入口
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/reasoning-step/index.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
- * 设计模式:shadcn 风格复合组件
7
- * - ReasoningStep = 便捷导出(Root + DefaultLayout)
8
- * - ReasoningStep.Root/Header/Details/DetailRow = 复合子组件
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import { useReasoningStepContext } from './context';
11
13
  import type { ReasoningStepProps, ReasoningStepCompound, ReasoningStepDetail, ReasoningStepStatus } from './types';
@@ -1,7 +1,13 @@
1
1
  /**
2
- * [INPUT]: N/A
3
- * [OUTPUT]: Type definitions for ReasoningStep compound component
4
- * [POS]: registry/chat/reasoning-step - ReasoningStep 组件类型定义
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/reasoning-step/types.ts — Spark Design source; keep aligned with the main library.
6
+ *
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
5
11
  */
6
12
  import type { ReactNode } from 'react';
7
13
  export type ReasoningStepDetail = {
@@ -1,7 +1,13 @@
1
1
  /**
2
- * [INPUT]: (RelatedPromptsProps) - 推荐 prompt 列表
3
- * [OUTPUT]: (JSX.Element) - 输入框上方的相关推荐 prompt 列表
4
- * [POS]: registry/chat - 唯一来源,主库可注入 defaultIcon
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/related-prompts.tsx — Spark Design source; keep aligned with the main library.
6
+ *
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
5
11
  */
6
12
  import type { ReactNode } from 'react';
7
13
  export interface RelatedPromptItem {
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: ResponseProps
3
- * [OUTPUT]: Response compound component
4
- * [POS]: registry/chat/response - Response 复合组件主入口
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/response/index.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
- * 设计模式:shadcn 风格复合组件
7
- * - Response = 便捷导出(Root + DefaultLayout)
8
- * - Response.Root/Thinking/Steps/Step/Content/ImageGenerating = 复合子组件
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import type { HTMLAttributes } from 'react';
11
13
  import { useResponseContext, DEMO_ROUNDS, DEMO_FINAL_MD } from './context';
@@ -1,7 +1,13 @@
1
1
  /**
2
- * [INPUT]: N/A
3
- * [OUTPUT]: Type definitions for Response compound component
4
- * [POS]: registry/chat/response - Response 组件类型定义
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/response/types.ts — Spark Design source; keep aligned with the main library.
6
+ *
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
5
11
  */
6
12
  import type { HTMLAttributes, ReactNode } from 'react';
7
13
  import type { ReasoningStepDetail } from '../reasoning-step';
@@ -1,7 +1,13 @@
1
1
  /**
2
- * [INPUT]: (TaskPartProps) - tasks、title、currentTaskId;可选 headerIcon/circleIcon/completedIcon/skippedIcon/loaderIcon,未指定则用内联 SVG
3
- * [OUTPUT]: (JSX.Element)
4
- * [POS]: registry/chat - QodeChatPanel 移植,全 token
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/task-part.tsx — Spark Design source; keep aligned with the main library.
6
+ *
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
5
11
  */
6
12
  import type { ReactNode } from 'react';
7
13
  export type TaskStatus = 'completed' | 'uncompleted' | 'skipped' | 'cancelled';
@@ -1,7 +1,13 @@
1
1
  /**
2
- * [INPUT]: (TerminalCodeBlockPartProps) - command、output、autoRanCommand;可选 headerIcon/externalLinkIcon,未指定则用内联 SVG
3
- * [OUTPUT]: (JSX.Element)
4
- * [POS]: registry/chat - QodeChatPanel 移植,全 token 化;不依赖 prism,纯样式
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/terminal-code-block-part.tsx — Spark Design source; keep aligned with the main library.
6
+ *
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
5
11
  */
6
12
  import type { ReactNode } from 'react';
7
13
  export interface TerminalCodeBlockPartProps {
@@ -1,7 +1,13 @@
1
1
  /**
2
- * [INPUT]: 单题数据、answers/customInputs、handlers、labels、当前题/焦点/禁用状态
3
- * [OUTPUT]: (JSX.Element) - 单题区块(题干 + OptionList + 自定义输入)
4
- * [POS]: registry/chat/user-question
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/user-question/UserQuestionCard.tsx — Spark Design source; keep aligned with the main library.
6
+ *
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
5
11
  */
6
12
  import type { Dispatch, MutableRefObject, SetStateAction } from 'react';
7
13
  import type { UserQuestionItem, UserQuestionLabels } from './types';
@@ -1,7 +1,13 @@
1
1
  /**
2
- * [INPUT]: labels、推荐/跳过/继续 handlers、disabled、sparklingIcon
3
- * [OUTPUT]: (JSX.Element) - 底部操作区
4
- * [POS]: registry/chat/user-question
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/user-question/UserQuestionFooter.tsx — Spark Design source; keep aligned with the main library.
6
+ *
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
5
11
  */
6
12
  import type { ReactNode } from 'react';
7
13
  import type { UserQuestionLabels } from './types';
@@ -1,7 +1,13 @@
1
1
  /**
2
- * [INPUT]: 当前题、题数、labels、图标、上一/下一、disabled
3
- * [OUTPUT]: (JSX.Element) - 顶部标题与题号切换
4
- * [POS]: registry/chat/user-question
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/chat/user-question/UserQuestionHeader.tsx — Spark Design source; keep aligned with the main library.
6
+ *
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
5
11
  */
6
12
  import type { ReactNode } from 'react';
7
13
  import type { UserQuestionItem } from './types';
@@ -1,10 +1,13 @@
1
1
  /**
2
- * [INPUT]: 无(类型定义模块)
3
- * [OUTPUT]: 导出 UserQuestion 相关类型与常量
4
- * [POS]: registry/chat/user-question - 唯一类型来源
2
+ * [WHO]: Output: exports UserQuestion types and constants; Inputs: none (type-only module)
3
+ * [FROM]: react
4
+ * [TO]: CLI `add` copy target; canonical implementation in `src/components`
5
+ * [HERE]: registry/chat/user-question - single source for types
5
6
  *
6
- * [PROTOCOL]:
7
- * 1. 类型/常量变更时同步更新 index re-export
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
8
11
  */
9
12
  import type { ReactNode } from 'react';
10
13
  /** 单个问题的选项 */
@@ -1,13 +1,13 @@
1
1
  /**
2
- * [INPUT]: (无) - 文件图标映射配置
3
- * [OUTPUT]: FILE_TYPE_MAP, SETI_CHAR_MAP, SETI_COLOR_MAP, getSetiIconType, getSetiIcon, getSetiIconColor, getFileIconColorClass
4
- * [POS]: registry/lib - QodeChatPanel utils/fileIconMaps 一致,供 FileReviewPart、ReasoningStep 等使用
5
- *
6
- * SETI_CHAR_MAP 与 QodeChatPanel 一致(qoder-seti.woff 使用 E054=js、E059=json 等)。
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/lib/file-icon-maps.ts — Spark Design source; keep aligned with the main library.
7
6
  *
8
7
  * [PROTOCOL]:
9
- * 1. 新增文件类型须同时更新 SETI_CHAR_MAP、SETI_COLOR_MAP、FILE_TYPE_MAP
10
- * 2. 使用 Seti 时需加载 qoder-seti.woff @font-face font-family: 'Seti'(与 QodeChatPanel 同源字体)
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
11
11
  */
12
12
  export declare const SETI_CHAR_MAP: Record<string, string>;
13
13
  export declare const SETI_COLOR_MAP: Record<string, string>;
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (ClassValue[])
3
- * [OUTPUT]: (string) - 合并后的 class 名
4
- * [POS]: registry/lib/utils - 注册表工具函数,复制到用户项目后可自由修改
2
+ * [WHO]: Output: (string) - merged class names; Inputs: (ClassValue[])
3
+ * [FROM]: clsx; tailwind-merge
4
+ * [TO]: CLI `add` copy target; canonical implementation in `src/components`
5
+ * [HERE]: registry/lib/utils - registry helpers; safe to edit after CLI copy
5
6
  *
6
- * [PROTOCOL]:
7
- * 1. 用户可自由修改此文件
8
- * 2. 更新时使用 npx sparkdesign diff utils 查看差异
7
+ * [PROTOCOL]:
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import { type ClassValue } from 'clsx';
11
13
  export declare function cn(...inputs: ClassValue[]): string;