meowtail 0.1.0 → 0.2.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/AGENT-COMPONENTS.md +117 -0
  2. package/ASSISTANT.md +39 -19
  3. package/JSON.md +12 -5
  4. package/README.md +462 -349
  5. package/THIRD_PARTY_NOTICES.md +8 -0
  6. package/dist/src/chat/assistant-composer.js +3 -5
  7. package/dist/src/chat/assistant-content.d.ts +2 -0
  8. package/dist/src/chat/assistant-content.js +51 -3
  9. package/dist/src/chat/assistant-types.d.ts +39 -1
  10. package/dist/src/chat/assistant.d.ts +1 -1
  11. package/dist/src/chat/assistant.js +6 -3
  12. package/dist/src/chat/attachments.js +9 -5
  13. package/dist/src/chat/composer-panel.d.ts +17 -0
  14. package/dist/src/chat/composer-panel.js +12 -0
  15. package/dist/src/chat/composer.d.ts +2 -0
  16. package/dist/src/chat/composer.js +5 -2
  17. package/dist/src/chat/conversation.d.ts +4 -1
  18. package/dist/src/chat/conversation.js +7 -4
  19. package/dist/src/chat/index.d.ts +5 -2
  20. package/dist/src/chat/index.js +2 -0
  21. package/dist/src/chat/message-list.js +1 -1
  22. package/dist/src/chat/message.js +3 -3
  23. package/dist/src/chat/question.js +1 -1
  24. package/dist/src/chat/sources.js +1 -1
  25. package/dist/src/chat/task.d.ts +29 -0
  26. package/dist/src/chat/task.js +53 -0
  27. package/dist/src/chat/tool-call.d.ts +33 -8
  28. package/dist/src/chat/tool-call.js +70 -26
  29. package/dist/src/components/action-rail.d.ts +19 -0
  30. package/dist/src/components/action-rail.js +13 -0
  31. package/dist/src/components/add-button.js +1 -1
  32. package/dist/src/components/alert.d.ts +2 -0
  33. package/dist/src/components/alert.js +2 -1
  34. package/dist/src/components/app-bar.d.ts +17 -0
  35. package/dist/src/components/app-bar.js +10 -0
  36. package/dist/src/components/breadcrumb.js +1 -1
  37. package/dist/src/components/choice-select.js +1 -1
  38. package/dist/src/components/code-block.js +6 -6
  39. package/dist/src/components/credential-source.js +12 -12
  40. package/dist/src/components/diff-block.js +1 -1
  41. package/dist/src/components/grid.js +1 -0
  42. package/dist/src/components/hover-card.js +2 -2
  43. package/dist/src/components/image-lightbox.js +3 -3
  44. package/dist/src/components/image-preview.js +1 -1
  45. package/dist/src/components/index.d.ts +4 -0
  46. package/dist/src/components/index.js +4 -0
  47. package/dist/src/components/inline.js +1 -0
  48. package/dist/src/components/json-block.js +2 -2
  49. package/dist/src/components/json-tree.js +3 -3
  50. package/dist/src/components/layout-item.js +2 -1
  51. package/dist/src/components/layout-types.d.ts +1 -1
  52. package/dist/src/components/list-group.d.ts +1 -1
  53. package/dist/src/components/menu.js +5 -5
  54. package/dist/src/components/meta-row.d.ts +33 -0
  55. package/dist/src/components/meta-row.js +45 -0
  56. package/dist/src/components/output-block.d.ts +5 -3
  57. package/dist/src/components/output-block.js +35 -25
  58. package/dist/src/components/page-frame.d.ts +6 -2
  59. package/dist/src/components/page-frame.js +2 -2
  60. package/dist/src/components/path-picker.js +4 -4
  61. package/dist/src/components/process-group.d.ts +2 -2
  62. package/dist/src/components/rail-item.d.ts +2 -2
  63. package/dist/src/components/rail-section.d.ts +1 -1
  64. package/dist/src/components/read-block.js +2 -2
  65. package/dist/src/components/resource-card.d.ts +1 -1
  66. package/dist/src/components/resource-link.d.ts +1 -1
  67. package/dist/src/components/search-block.js +2 -3
  68. package/dist/src/components/stack.js +1 -0
  69. package/dist/src/components/status.d.ts +16 -0
  70. package/dist/src/components/status.js +8 -0
  71. package/dist/src/components/terminal-block.js +6 -6
  72. package/dist/src/components/web-block.js +3 -3
  73. package/dist/src/components/work-card.d.ts +2 -2
  74. package/dist/src/components/work-card.js +1 -1
  75. package/dist/src/icons/README.md +13 -2
  76. package/dist/src/icons/icon-frame.d.ts +11 -0
  77. package/dist/src/icons/icon-frame.js +4 -0
  78. package/dist/src/icons/icon-source.d.ts +17 -0
  79. package/dist/src/icons/icon-source.js +6 -0
  80. package/dist/src/icons/icon.d.ts +44 -37
  81. package/dist/src/icons/icon.js +55 -128
  82. package/dist/src/icons/index.d.ts +1 -0
  83. package/dist/src/icons/index.js +1 -0
  84. package/dist/src/icons/lucide.d.ts +1 -0
  85. package/dist/src/icons/lucide.js +4 -0
  86. package/dist/src/json/catalog.d.ts +88 -2
  87. package/dist/src/json/catalog.js +33 -1
  88. package/dist/src/registry/index.d.ts +54 -4
  89. package/dist/src/registry/index.js +16 -2
  90. package/dist/src/shared/execution-state.d.ts +7 -0
  91. package/dist/src/shared/execution-state.js +36 -0
  92. package/dist/src/theme/base.styles.js +15 -0
  93. package/dist/src/theme/chat/assistant.styles.js +21 -9
  94. package/dist/src/theme/chat/composer-panel.styles.d.ts +1 -0
  95. package/dist/src/theme/chat/composer-panel.styles.js +44 -0
  96. package/dist/src/theme/chat/composer.styles.js +39 -7
  97. package/dist/src/theme/chat/conversation.styles.js +15 -7
  98. package/dist/src/theme/chat/records.styles.js +79 -7
  99. package/dist/src/theme/chat/task.styles.d.ts +1 -0
  100. package/dist/src/theme/chat/task.styles.js +87 -0
  101. package/dist/src/theme/components/action-rail.styles.d.ts +1 -0
  102. package/dist/src/theme/components/action-rail.styles.js +47 -0
  103. package/dist/src/theme/components/alert.styles.js +42 -1
  104. package/dist/src/theme/components/app-bar.styles.d.ts +1 -0
  105. package/dist/src/theme/components/app-bar.styles.js +48 -0
  106. package/dist/src/theme/components/card.styles.js +9 -3
  107. package/dist/src/theme/components/code-block.styles.js +7 -0
  108. package/dist/src/theme/components/dialog.styles.js +7 -0
  109. package/dist/src/theme/components/field.styles.js +4 -0
  110. package/dist/src/theme/components/list-group.styles.js +10 -11
  111. package/dist/src/theme/components/meta-row.styles.d.ts +1 -0
  112. package/dist/src/theme/components/meta-row.styles.js +66 -0
  113. package/dist/src/theme/components/output-block.styles.js +17 -0
  114. package/dist/src/theme/components/page-frame.styles.js +7 -1
  115. package/dist/src/theme/components/page-header.styles.js +7 -0
  116. package/dist/src/theme/components/resource-card.styles.js +15 -3
  117. package/dist/src/theme/components/status.styles.d.ts +1 -0
  118. package/dist/src/theme/components/status.styles.js +25 -0
  119. package/dist/src/theme/components/tag.styles.js +3 -3
  120. package/dist/src/theme/components/toolbar.styles.js +7 -0
  121. package/dist/src/theme/index.d.ts +148 -0
  122. package/dist/src/theme/index.js +173 -159
  123. package/dist/src/theme/palette.d.ts +1 -1
  124. package/dist/src/theme/palette.js +1 -1
  125. package/dist/src/theme/shared/code-highlight.styles.js +1 -1
  126. package/dist/src/theme/shared/code-highlight.tokens.d.ts +6 -6
  127. package/dist/src/theme/shared/code-highlight.tokens.js +6 -6
  128. package/dist/src/theme/tokens.d.ts +7 -7
  129. package/dist/src/theme/tokens.js +14 -8
  130. package/package.json +17 -6
@@ -0,0 +1,45 @@
1
+ import { defineOptions } from "meowcss";
2
+ import { defineStyleProps } from "meowcss/meowjsx";
3
+ import { defineComponent, h } from "meowjsx";
4
+ export const metaRowOptions = defineOptions("meta-row", {
5
+ align: ["start", "center"],
6
+ progressTone: ["neutral", "accent"],
7
+ });
8
+ export const metaRowContract = {
9
+ name: "meta-row",
10
+ parts: ["root", "item", "icon", "label", "separator", "progress"],
11
+ styleProps: defineStyleProps(metaRowOptions, {
12
+ defaults: { align: "start", progressTone: "neutral" },
13
+ }),
14
+ };
15
+ /**
16
+ * A page-level fact row. Items keep separators, wrap instead of clipping, and
17
+ * carry facts as text; the optional progress segment is one more fact.
18
+ */
19
+ export const MetaRow = defineComponent(metaRowContract, ({ items, progress, progressLabel = "Progress", children: hostChildren, className, ...props }, context) => {
20
+ void hostChildren;
21
+ const value = progress === undefined || !Number.isFinite(progress)
22
+ ? undefined
23
+ : Math.max(0, Math.min(100, Math.round(progress)));
24
+ const parts = [];
25
+ items.forEach((item, index) => {
26
+ if (index > 0)
27
+ parts.push(context.part("separator", "span", { "aria-hidden": "true" }, "·"));
28
+ parts.push(context.part("item", "span", null, item.icon !== undefined && item.icon !== null
29
+ ? context.part("icon", "span", null, item.icon)
30
+ : null, context.part("label", "span", null, item.label)));
31
+ });
32
+ if (value !== undefined) {
33
+ if (items.length > 0)
34
+ parts.push(context.part("separator", "span", { "aria-hidden": "true" }, "·"));
35
+ parts.push(context.part("progress", "span", {
36
+ role: "progressbar",
37
+ "aria-label": progressLabel,
38
+ "aria-valuemin": 0,
39
+ "aria-valuemax": 100,
40
+ "aria-valuenow": value,
41
+ style: { "--meta-progress": `${value}%` },
42
+ }, h("span", { "aria-hidden": "true" }, `${value}%`)));
43
+ }
44
+ return context.part("root", "div", { ...props, className }, parts);
45
+ });
@@ -1,13 +1,15 @@
1
- import { type Child, type Props } from "meowjsx";
1
+ import { type Child, type Props, type MaybeSignal } from "meowjsx";
2
2
  export declare const outputBlockContract: {
3
3
  readonly name: "output-block";
4
4
  readonly parts: readonly ["root", "header", "title", "actions", "body", "line", "fold", "toggle", "feedback"];
5
5
  };
6
6
  export interface OutputBlockProps extends Props {
7
7
  title: Child;
8
- rows: readonly Child[];
9
- copyText: string;
8
+ rows: MaybeSignal<readonly Child[]>;
9
+ copyText: MaybeSignal<string>;
10
10
  maxLines?: number;
11
+ /** Wrap prose-like tool output; code and terminal output keep their existing horizontal scroll. */
12
+ wrap?: boolean;
11
13
  emptyText?: string;
12
14
  onCopy?: (text: string) => Promise<void>;
13
15
  }
@@ -1,4 +1,4 @@
1
- import { defineComponent, h } from "meowjsx";
1
+ import { defineComponent, h, unwrap, } from "meowjsx";
2
2
  import { copyTextToClipboard } from "../clipboard.js";
3
3
  export const outputBlockContract = {
4
4
  name: "output-block",
@@ -11,7 +11,14 @@ export function outputWindow(length, maxLines = 16) {
11
11
  const tail = Math.floor(limit / 2);
12
12
  return { head, tail, hidden: Math.max(0, length - limit) };
13
13
  }
14
- export const OutputBlock = defineComponent(outputBlockContract, ({ title, rows, copyText, maxLines, emptyText = "没有内容", onCopy, ...props }, context) => {
14
+ export const OutputBlock = defineComponent(outputBlockContract, ({ title, rows, copyText, maxLines, wrap = false, emptyText = "No content", onCopy, ...props }, context) => {
15
+ const derived = (read) => {
16
+ const value = context.signal(read());
17
+ context.effect(() => {
18
+ value.value = read();
19
+ });
20
+ return value;
21
+ };
15
22
  const feedback = context.signal("");
16
23
  const busy = context.signal(false);
17
24
  let disposed = false;
@@ -23,44 +30,47 @@ export const OutputBlock = defineComponent(outputBlockContract, ({ title, rows,
23
30
  return;
24
31
  busy.value = true;
25
32
  try {
26
- await (onCopy ?? copyTextToClipboard)(copyText);
33
+ await (onCopy ?? copyTextToClipboard)(unwrap(copyText));
27
34
  if (!disposed)
28
- feedback.value = "已复制";
35
+ feedback.value = "Copied";
29
36
  }
30
37
  catch {
31
38
  if (!disposed)
32
- feedback.value = "复制失败,请手动选择文本。";
39
+ feedback.value = "Copy failed; select the text manually.";
33
40
  }
34
41
  finally {
35
42
  if (!disposed)
36
43
  busy.value = false;
37
44
  }
38
45
  };
39
- const { head, tail, hidden } = outputWindow(rows.length, maxLines);
46
+ const window = derived(() => outputWindow(unwrap(rows).length, maxLines));
40
47
  const renderRows = (items) => items.map((row) => context.part("line", "div", {}, row));
41
- return context.part("root", "section", props, [
48
+ return context.part("root", "section", { ...props, "data-output-wrap": wrap ? "true" : undefined }, [
42
49
  context.part("header", "div", {}, [
43
50
  context.part("title", "div", {}, title),
44
- context.part("actions", "button", { type: "button", disabled: busy, onClick: copy }, "复制"),
51
+ context.part("actions", "button", { type: "button", disabled: busy, onClick: copy }, "Copy"),
45
52
  ]),
46
- context.part("body", "div", { tabIndex: 0, "aria-label": "输出内容" }, rows.length === 0
47
- ? emptyText
48
- : [
49
- renderRows(hidden ? rows.slice(0, head) : rows),
50
- hidden
51
- ? context.part("fold", "details", {}, [
52
- context.part("toggle", "summary", {}, [
53
- h("span", { "data-fold-closed": true },
54
- "\u5C55\u5F00\u4E2D\u95F4 ",
55
- hidden,
56
- " \u884C"),
57
- h("span", { "data-fold-open": true }, "\u6536\u8D77\u4E2D\u95F4\u884C"),
58
- ]),
59
- renderRows(rows.slice(head, rows.length - tail)),
60
- ])
61
- : null,
62
- hidden ? renderRows(rows.slice(rows.length - tail)) : null,
53
+ context.part("body", "div", { tabIndex: 0, "aria-label": "Output content" }, [
54
+ derived(() => {
55
+ const values = unwrap(rows);
56
+ return values.length === 0
57
+ ? emptyText
58
+ : renderRows(window.value.hidden ? values.slice(0, window.value.head) : values);
59
+ }),
60
+ context.part("fold", "details", { hidden: derived(() => window.value.hidden === 0) }, [
61
+ context.part("toggle", "summary", {}, [
62
+ h("span", { "data-fold-closed": true }, derived(() => `Show the ${window.value.hidden} hidden middle lines`)),
63
+ h("span", { "data-fold-open": true }, "Hide the middle lines"),
64
+ ]),
65
+ derived(() => {
66
+ const values = unwrap(rows);
67
+ return window.value.hidden
68
+ ? renderRows(values.slice(window.value.head, values.length - window.value.tail))
69
+ : null;
70
+ }),
63
71
  ]),
72
+ derived(() => window.value.hidden ? renderRows(unwrap(rows).slice(-window.value.tail)) : null),
73
+ ]),
64
74
  context.part("feedback", "span", { role: "status", "aria-live": "polite" }, feedback),
65
75
  ]);
66
76
  });
@@ -6,7 +6,7 @@ export declare const pageFrameOptions: import("meowcss").Options<{
6
6
  }>;
7
7
  export declare const pageFrameContract: {
8
8
  readonly name: "page-frame";
9
- readonly parts: readonly ["root", "toolbar", "header", "body"];
9
+ readonly parts: readonly ["root", "toolbar", "header", "notice", "body", "footer"];
10
10
  readonly styleProps: import("meowcss/meowjsx").StylePropsBinding<import("meowcss").Options<{
11
11
  readonly variant: readonly ["page", "workspace"];
12
12
  readonly scrollOwner: readonly ["content", "layout"];
@@ -15,7 +15,11 @@ export declare const pageFrameContract: {
15
15
  export interface PageFrameProps extends Props, ThemedProps<typeof pageFrameOptions> {
16
16
  header?: Child;
17
17
  toolbar?: Child;
18
+ /** A full-width status or alert row between the header and the body. */
19
+ notice?: Child;
20
+ /** A persistent region after the body, typically a composer or action bar. */
21
+ footer?: Child;
18
22
  className?: string;
19
23
  }
20
24
  /** The parent owns page chrome; its body receives only the remaining space. */
21
- export declare const PageFrame: import("meowjsx").Component<PageFrameProps, "page-frame", "body" | "header" | "root" | "toolbar">;
25
+ export declare const PageFrame: import("meowjsx").Component<PageFrameProps, "page-frame", "body" | "footer" | "header" | "notice" | "root" | "toolbar">;
@@ -7,10 +7,10 @@ export const pageFrameOptions = defineOptions("page-frame", {
7
7
  });
8
8
  export const pageFrameContract = {
9
9
  name: "page-frame",
10
- parts: ["root", "toolbar", "header", "body"],
10
+ parts: ["root", "toolbar", "header", "notice", "body", "footer"],
11
11
  styleProps: defineStyleProps(pageFrameOptions, {
12
12
  defaults: { variant: "page", scrollOwner: "content" },
13
13
  }),
14
14
  };
15
15
  /** The parent owns page chrome; its body receives only the remaining space. */
16
- export const PageFrame = defineComponent(pageFrameContract, ({ header, toolbar, children, className, ...props }, context) => context.part("root", "section", { ...props, className }, toolbar ? context.part("toolbar", "div", null, toolbar) : null, header ? context.part("header", "div", null, header) : null, context.part("body", "div", null, children)));
16
+ export const PageFrame = defineComponent(pageFrameContract, ({ header, toolbar, notice, footer, children, className, ...props }, context) => context.part("root", "section", { ...props, className }, toolbar ? context.part("toolbar", "div", null, toolbar) : null, header ? context.part("header", "div", null, header) : null, notice ? context.part("notice", "div", null, notice) : null, context.part("body", "div", null, children), footer ? context.part("footer", "div", null, footer) : null));
@@ -2,10 +2,10 @@ import { batch, defineComponent, h, unwrap, } from "meowjsx";
2
2
  import { Button } from "./button.js";
3
3
  import { Input } from "./input.js";
4
4
  const messages = {
5
- file: "浏览文件…",
6
- directory: "浏览目录…",
7
- pending: "正在选择…",
8
- failed: "未能打开选择器,请重试或手动输入路径。",
5
+ file: "Browse files…",
6
+ directory: "Browse directories…",
7
+ pending: "Choosing…",
8
+ failed: "Could not open the picker; try again or enter a path manually.",
9
9
  };
10
10
  export const pathPickerContract = {
11
11
  name: "path-picker",
@@ -4,9 +4,9 @@ export declare const processGroupContract: {
4
4
  readonly parts: readonly ["root", "summary", "chevron", "title", "status", "trailing", "body"];
5
5
  };
6
6
  export interface ProcessGroupProps extends Props {
7
- /** The group's name and size, for example "过程 · 3 步". */
7
+ /** The group's name and size, for example "Process · 3 steps". */
8
8
  title: Child;
9
- /** Outcome in words, for example "已完成 · 4.2s". */
9
+ /** Outcome in words, for example "Completed · 4.2s". */
10
10
  status?: Child;
11
11
  /** Right-aligned summary of the steps, usually one StatusDot per step. */
12
12
  trailing?: Child;
@@ -13,9 +13,9 @@ export interface RailItemProps extends Props {
13
13
  * attribute on the item, so a host can set or clear it at runtime without re-rendering.
14
14
  */
15
15
  dot?: "warning" | "accent";
16
- /** Text or count at the end, visible while the rail is expanded: a count, "处理中". */
16
+ /** Text or count at the end, visible while the rail is expanded: a count, "In progress". */
17
17
  meta?: Child;
18
- /** "accent" marks activity happening now, such as "处理中"; otherwise the meta is a quiet fact. */
18
+ /** "accent" marks activity happening now, such as "In progress"; otherwise the meta is a quiet fact. */
19
19
  metaTone?: "accent";
20
20
  /** A route renders an anchor; an action renders a button. */
21
21
  href?: string;
@@ -4,7 +4,7 @@ export declare const railSectionContract: {
4
4
  readonly parts: readonly ["root", "heading", "items", "shortcut"];
5
5
  };
6
6
  export interface RailSectionProps extends Props {
7
- /** Eyebrow shown while the rail is expanded, for example "扩展". */
7
+ /** Eyebrow shown while the rail is expanded, for example "Expanded". */
8
8
  label: string;
9
9
  /** While collapsed, the whole section is this one icon, pointing at `href`. */
10
10
  icon: Child;
@@ -19,7 +19,7 @@ export function readHighlightLines(spans) {
19
19
  return rows;
20
20
  }
21
21
  /** Displays a supplied file window; never opens the named path. */
22
- export const ReadBlock = defineComponent(readBlockContract, ({ label = "文件内容", lines, totalLines, lang, maxLines, onCopy, ...props }, context) => {
22
+ export const ReadBlock = defineComponent(readBlockContract, ({ label = "File content", lines, totalLines, lang, maxLines, onCopy, ...props }, context) => {
23
23
  const raw = lines.map((line) => line.text).join("\n");
24
24
  const content = lines.map((line) => context.signal(line.text || "\u200b"));
25
25
  let disposed = false;
@@ -76,7 +76,7 @@ export const ReadBlock = defineComponent(readBlockContract, ({ label = "文件
76
76
  },
77
77
  }, h(OutputBlock, { title: h("span", null,
78
78
  label,
79
- totalLines !== undefined ? ` · 显示 ${lines.length} / ${totalLines} 行` : ""), maxLines: maxLines, onCopy: onCopy, copyText: raw, rows: lines.map((line, index) => (h("div", { "data-read-highlight": line.highlighted ? "true" : undefined },
79
+ totalLines !== undefined ? ` · Showing ${lines.length} / ${totalLines} lines` : ""), maxLines: maxLines, onCopy: onCopy, copyText: raw, rows: lines.map((line, index) => (h("div", { "data-read-highlight": line.highlighted ? "true" : undefined },
80
80
  context.part("number", "span", { "aria-hidden": "true" }, String(line.number)),
81
81
  context.part("text", "span", {}, content[index])))) }));
82
82
  });
@@ -5,7 +5,7 @@ export declare const resourceCardContract: {
5
5
  };
6
6
  export interface ResourceCardProps extends Props {
7
7
  title: Child;
8
- /** What kind of thing it is, for example "Channel · 消息卡片". */
8
+ /** What kind of thing it is, for example "Channel · Message card". */
9
9
  subtitle?: Child;
10
10
  icon?: Child;
11
11
  /** The state in words with its dot. */
@@ -5,7 +5,7 @@ export declare const resourceLinkContract: {
5
5
  };
6
6
  export interface ResourceLinkProps extends Props {
7
7
  title: Child;
8
- /** Where it lives and which version, for example "docs/records · 修订 1". */
8
+ /** Where it lives and which version, for example "docs/records · Revision 1". */
9
9
  detail?: Child;
10
10
  icon?: Child;
11
11
  /** Replaces the arrow, for a state the reader should see before opening. */
@@ -29,12 +29,11 @@ export const SearchBlock = defineComponent(searchBlockContract, (props, context)
29
29
  ...(hidden ? file.matches.slice(0, head) : file.matches).map(renderMatch),
30
30
  hidden ? (h("details", null,
31
31
  h("summary", null,
32
- "\u4E2D\u95F4 ",
33
32
  hidden,
34
- " \u6761\u5339\u914D"),
33
+ " matches in the middle"),
35
34
  file.matches.slice(head, file.matches.length - tail).map(renderMatch))) : null,
36
35
  ...(hidden ? file.matches.slice(file.matches.length - tail) : []).map(renderMatch),
37
36
  ]);
38
37
  });
39
- return context.part("root", "div", rest, h(OutputBlock, { title: `搜索 · 显示 ${shown} / ${total}${truncated ? " · 结果已截断" : ""}`, rows: rows, copyText: searchBlockText(props), maxLines: maxLines, onCopy: onCopy, emptyText: "\u6CA1\u6709\u7ED3\u679C" }));
38
+ return context.part("root", "div", rest, h(OutputBlock, { title: `Search · showing ${shown} / ${total}${truncated ? " · results truncated" : ""}`, rows: rows, copyText: searchBlockText(props), maxLines: maxLines, onCopy: onCopy, emptyText: "No results" }));
40
39
  });
@@ -18,5 +18,6 @@ export const Stack = defineComponent(stackContract, ({ as = "div", align = "stre
18
18
  alignItems: align,
19
19
  justifyContent: justifyStyle(justify),
20
20
  minWidth: 0,
21
+ minHeight: 0,
21
22
  }),
22
23
  }, children));
@@ -0,0 +1,16 @@
1
+ import { type Child, type Props } from "meowjsx";
2
+ import { type StatusDotProps } from "./status-dot.js";
3
+ export declare const statusContract: {
4
+ readonly name: "status";
5
+ readonly parts: readonly ["root", "label"];
6
+ };
7
+ export interface StatusProps extends Props {
8
+ state?: StatusDotProps["state"];
9
+ /** Supply visible, non-empty content, including when the Child is dynamic. */
10
+ label: Exclude<Child, null | undefined | boolean>;
11
+ size?: never;
12
+ halo?: never;
13
+ className?: string;
14
+ }
15
+ /** A state in words with a decorative dot. Use as slot content; composed markers remain owned by WorkCard and Timeline. */
16
+ export declare const Status: import("meowjsx").Component<StatusProps, "status", "label" | "root">;
@@ -0,0 +1,8 @@
1
+ import { defineComponent, h } from "meowjsx";
2
+ import { StatusDot } from "./status-dot.js";
3
+ export const statusContract = {
4
+ name: "status",
5
+ parts: ["root", "label"],
6
+ };
7
+ /** A state in words with a decorative dot. Use as slot content; composed markers remain owned by WorkCard and Timeline. */
8
+ export const Status = defineComponent(statusContract, ({ state, label, className, children: _children, ...props }, context) => context.part("root", "span", { ...props, className }, h(StatusDot, { state: state }), context.part("label", "span", null, label)));
@@ -60,14 +60,14 @@ export function terminalSpans(text) {
60
60
  }
61
61
  export const TerminalBlock = defineComponent(terminalBlockContract, ({ command, cwd, output = "", running = false, exitCode, signal, maxLines, copyText, onCopy, ...props }, context) => {
62
62
  const status = running
63
- ? "运行中"
63
+ ? "Running"
64
64
  : signal
65
- ? `信号 ${signal}`
65
+ ? `Signal ${signal}`
66
66
  : exitCode === 0
67
- ? "已完成"
67
+ ? "Completed"
68
68
  : typeof exitCode === "number"
69
- ? `退出码 ${exitCode}`
70
- : "退出状态未知";
69
+ ? `Exit code ${exitCode}`
70
+ : "Unknown exit status";
71
71
  const failed = !running && (Boolean(signal) || (typeof exitCode === "number" && exitCode !== 0));
72
72
  const state = running ? "ongoing" : failed ? "error" : exitCode === 0 ? "done" : "warning";
73
73
  const rows = output ? terminalSpans(output) : [];
@@ -94,7 +94,7 @@ export const TerminalBlock = defineComponent(terminalBlockContract, ({ command,
94
94
  ? context.part("status", "span", {
95
95
  "data-terminal-error": failed ? "true" : undefined,
96
96
  }, h(Pill, { style: "color:inherit" }, status))
97
- : null), copyText: copyText ?? output, maxLines: maxLines, onCopy: onCopy, emptyText: running ? "等待输出" : "没有输出", rows: rows.length
97
+ : null), copyText: copyText ?? output, maxLines: maxLines, onCopy: onCopy, emptyText: running ? "Waiting for output" : "No output", rows: rows.length
98
98
  ? rows.map((row) => row.map((span) => context.part("span", "span", {
99
99
  "data-ansi-color": span.color,
100
100
  "data-ansi-bold": span.bold ? "true" : undefined,
@@ -23,18 +23,18 @@ export const WebBlock = defineComponent(webBlockContract, (props, context) => {
23
23
  return context.part("root", "section", { ...rest, "data-web-kind": kind }, kind === "fetch"
24
24
  ? [
25
25
  link(props.url),
26
- context.part("meta", "div", {}, `HTTP ${props.statusCode}${truncated ? " · 内容已截断" : ""}`),
26
+ context.part("meta", "div", {}, `HTTP ${props.statusCode}${truncated ? " · Content truncated" : ""}`),
27
27
  ]
28
28
  : [
29
29
  props.answer ? context.part("answer", "div", {}, props.answer) : null,
30
30
  !props.answer && props.sources.length === 0
31
- ? context.part("meta", "div", {}, "没有结果")
31
+ ? context.part("meta", "div", {}, "No results")
32
32
  : null,
33
33
  context.part("sources", "ol", {}, props.sources.map((source, index) => context.part("source", "li", { value: index + 1 }, [
34
34
  link(source.url, source.title),
35
35
  source.snippet ? context.part("snippet", "div", {}, source.snippet) : null,
36
36
  source.publishedAt ? context.part("meta", "div", {}, source.publishedAt) : null,
37
37
  ]))),
38
- truncated ? context.part("meta", "div", {}, "来源列表已截断") : null,
38
+ truncated ? context.part("meta", "div", {}, "Source list truncated") : null,
39
39
  ]);
40
40
  });
@@ -8,9 +8,9 @@ export interface WorkCardProps extends Props {
8
8
  title: Child;
9
9
  /** What the dot says; the words in `status` stay the source of truth. */
10
10
  state?: MaybeSignal<StatusDotState>;
11
- /** Current status in words, for example "正在推进:校对记录格式". */
11
+ /** Current status in words, for example "In progress: reviewing the record format". */
12
12
  status?: Child;
13
- /** A quiet extra fact after the status, for example "已关联 1 项成果". */
13
+ /** A quiet extra fact after the status, for example "1 outcome linked". */
14
14
  detail?: Child;
15
15
  icon?: Child;
16
16
  /** Label of the open affordance; the whole card is the control. */
@@ -6,6 +6,6 @@ export const workCardContract = {
6
6
  parts: ["root", "icon", "copy", "title", "status", "statusText", "detail", "action"],
7
7
  };
8
8
  /** A work reference inside a conversation: one control that opens the work's details. */
9
- export const WorkCard = defineComponent(workCardContract, ({ title, state = "unknown", status, detail, icon, action = "详情", className, children, ...props }, context) => context.part("root", "button", { type: "button", ...props, className }, context.part("icon", "span", { "aria-hidden": "true" }, icon ?? h(Icon, { name: "file-text" })), context.part("copy", "span", null, context.part("title", "strong", null, title), status !== undefined || detail !== undefined
9
+ export const WorkCard = defineComponent(workCardContract, ({ title, state = "unknown", status, detail, icon, action = "Details", className, children, ...props }, context) => context.part("root", "button", { type: "button", ...props, className }, context.part("icon", "span", { "aria-hidden": "true" }, icon ?? h(Icon, { name: "file-text" })), context.part("copy", "span", null, context.part("title", "strong", null, title), status !== undefined || detail !== undefined
10
10
  ? context.part("status", "span", null, h(StatusDot, { state: state, size: 6 }), context.part("statusText", "span", { "data-work-card-status": true }, status), detail ? context.part("detail", "span", null, detail) : null)
11
11
  : null, children), context.part("action", "span", null, action, h(Icon, { name: "chevron-right", size: 14 }))));
@@ -1,9 +1,20 @@
1
1
  # Functional icons
2
2
 
3
- `Icon` renders a local subset of [Lucide](https://github.com/lucide-icons/lucide/tree/main/icons) using native MeowJSX. SVG paths were retrieved from the official repository on 2026-09-21, with no runtime dependency. The upstream [license](https://github.com/lucide-icons/lucide/blob/main/LICENSE) is preserved in `LUCIDE-LICENSE` (ISC and inherited Feather MIT).
3
+ `Icon` renders meowtail's finite semantic icon set through native MeowJSX. The SVG geometry is imported from the pinned `lucide` dependency; no paths are copied into this package, except the optical override documented below. Upstream is ISC with inherited Feather MIT icons: the license is preserved in `LUCIDE-LICENSE` and summarized in `THIRD_PARTY_NOTICES.md`.
4
4
 
5
5
  Use `<Icon name="copy" size={16} />` beside a text label. An icon-only button needs an accessible label on the button. For a standalone meaningful image, provide `label`; otherwise the SVG is decorative. All functional icons use a 24-unit viewBox, currentColor and round joins. SVG presentation attributes provide an 18px size and 2-unit stroke when unthemed; the active theme can override sizing and optical stroke weight through CSS templates using `uiTokens.iconSize` and `uiTokens.iconStroke`. There is no inline style locking these values. Keep brand artwork separate (`MeowlandMark`, `GithubIcon`, `DoodleCat`).
6
6
 
7
+ `IconName` and `iconNames` are the finite semantic inventory used by this library and its JSON contracts. For application icons outside that set, `IconSource` renders caller-supplied structural `IconNode` data through the same frame, size, and accessibility rules:
8
+
9
+ ```tsx
10
+ import { IconSource } from "meowtail/icons";
11
+ import { Bell } from "meowtail/icons/lucide";
12
+
13
+ <IconSource source={Bell} size={16} label="Notifications" />;
14
+ ```
15
+
16
+ `source` is trusted developer input, never untrusted JSON or user-generated markup, and is expected to follow the same 24-unit stroked-outline contract. The pinned Lucide pass-through at `meowtail/icons/lucide` provides the full Lucide surface; its icon names and API belong to Lucide and move only when this package's pinned dependency moves. Bundlers tree-shake unused icons; a native no-bundler import loads the upstream entry as a whole.
17
+
7
18
  `ChatAttachments` uses the shared `file` shape to identify files; `ChatToolCall` uses `chevron-right` for disclosure and `arrow-up-right` for a non-collapsible operation. They remain decorative beside descriptive text. The theme controls geometry and disclosure rotation; these components do not substitute font glyphs for icons.
8
19
 
9
- Add only needed official SVG shapes to `icon.tsx`; `IconName` and `iconNames` stay in sync automatically. The UI Workshop renders that inventory. Existing named icon components remain public convenience entry points for other applications.
20
+ Import a node from `lucide` in `icon.tsx` and add one key to `shapes` when the library needs a new semantic icon; `IconName` and `iconNames` stay in sync automatically. Keep the dependency version, `LUCIDE-LICENSE`, and `THIRD_PARTY_NOTICES.md` in step with that change. `settings` keeps a local optical override because the upstream gear reads larger and rounder at the standard theme's 16px icon size. The UI Workshop renders the semantic inventory. Existing named icon components remain public convenience entry points for other applications.
@@ -0,0 +1,11 @@
1
+ import { type Child } from "meowjsx";
2
+ /** Shared SVG frame for functional icons; the theme owns its optical stroke. */
3
+ export interface IconFrameProps {
4
+ size?: number;
5
+ className?: string;
6
+ /** Omit for decorative icons. Icon-only controls should label the control itself. */
7
+ label?: string;
8
+ dataIcon?: string;
9
+ children?: Child;
10
+ }
11
+ export declare function IconFrame({ size, className, label, dataIcon, children, }: IconFrameProps): Child;
@@ -0,0 +1,4 @@
1
+ import { h } from "meowjsx";
2
+ export function IconFrame({ size = 18, className, label, dataIcon, children, }) {
3
+ return (h("svg", { className: ["meow-icon", className].filter(Boolean).join(" "), "data-icon": dataIcon, width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": label ? undefined : "true", role: label ? "img" : undefined, "aria-label": label, focusable: "false" }, children));
4
+ }
@@ -0,0 +1,17 @@
1
+ import { type Child } from "meowjsx";
2
+ /**
3
+ * Trusted structural icon data: ordered [tag, attributes] SVG pairs.
4
+ * The shape matches Lucide icon nodes and other plain SVG node data; never pass
5
+ * untrusted JSON or user-generated markup through this entry point.
6
+ */
7
+ export type IconNode = ReadonlyArray<readonly [tag: string, attrs: Readonly<Record<string, string | number | undefined>>]>;
8
+ export interface IconSourceProps {
9
+ /** Icon node data supplied by the caller from its own trusted icon source. */
10
+ source: IconNode;
11
+ size?: number;
12
+ className?: string;
13
+ /** Omit for decorative icons. Icon-only controls should label the control itself. */
14
+ label?: string;
15
+ }
16
+ /** Render caller-supplied icon data through the shared functional-icon frame. */
17
+ export declare function IconSource({ source, size, className, label }: IconSourceProps): Child;
@@ -0,0 +1,6 @@
1
+ import { h } from "meowjsx";
2
+ import { IconFrame } from "./icon-frame.js";
3
+ /** Render caller-supplied icon data through the shared functional-icon frame. */
4
+ export function IconSource({ source, size, className, label }) {
5
+ return (h(IconFrame, { size: size, className: className, label: label }, source.map(([tag, attrs]) => h(tag, attrs))));
6
+ }
@@ -1,42 +1,49 @@
1
1
  import { type Child } from "meowjsx";
2
+ declare const settings: () => import("meowjsx").VNode;
2
3
  declare const shapes: {
3
- terminal: () => import("meowjsx").VNode;
4
- menu: () => import("meowjsx").VNode;
5
- settings: () => import("meowjsx").VNode;
6
- "arrow-up": () => import("meowjsx").VNode;
7
- "list-checks": () => import("meowjsx").VNode;
8
- "message-square": () => import("meowjsx").VNode;
9
- map: () => import("meowjsx").VNode;
10
- "user-round": () => import("meowjsx").VNode;
11
- "notebook-tabs": () => import("meowjsx").VNode;
12
- "refresh-cw": () => import("meowjsx").VNode;
13
- paperclip: () => import("meowjsx").VNode;
14
- "arrow-down": () => import("meowjsx").VNode;
15
- "arrow-left": () => import("meowjsx").VNode;
16
- "arrow-right": () => import("meowjsx").VNode;
17
- "arrow-up-right": () => import("meowjsx").VNode;
18
- "file-text": () => import("meowjsx").VNode;
19
- file: () => import("meowjsx").VNode;
20
- folder: () => import("meowjsx").VNode;
21
- "folder-open": () => import("meowjsx").VNode;
22
- copy: () => import("meowjsx").VNode;
23
- x: () => import("meowjsx").VNode;
24
- "chevron-down": () => import("meowjsx").VNode;
25
- "chevron-left": () => import("meowjsx").VNode;
26
- "chevron-right": () => import("meowjsx").VNode;
27
- "chevron-up": () => import("meowjsx").VNode;
28
- search: () => import("meowjsx").VNode;
29
- plus: () => import("meowjsx").VNode;
30
- minus: () => import("meowjsx").VNode;
31
- "panel-left": () => import("meowjsx").VNode;
32
- list: () => import("meowjsx").VNode;
33
- network: () => import("meowjsx").VNode;
34
- "external-link": () => import("meowjsx").VNode;
35
- brain: () => import("meowjsx").VNode;
36
- eye: () => import("meowjsx").VNode;
37
- wrench: () => import("meowjsx").VNode;
38
- "loader-circle": () => import("meowjsx").VNode;
39
- square: () => import("meowjsx").VNode;
4
+ terminal: () => Child;
5
+ menu: () => Child;
6
+ settings: typeof settings;
7
+ "arrow-up": () => Child;
8
+ "list-checks": () => Child;
9
+ "message-square": () => Child;
10
+ map: () => Child;
11
+ "user-round": () => Child;
12
+ "notebook-tabs": () => Child;
13
+ "refresh-cw": () => Child;
14
+ paperclip: () => Child;
15
+ "arrow-down": () => Child;
16
+ "arrow-left": () => Child;
17
+ "arrow-right": () => Child;
18
+ "arrow-up-right": () => Child;
19
+ "file-text": () => Child;
20
+ file: () => Child;
21
+ folder: () => Child;
22
+ "folder-open": () => Child;
23
+ copy: () => Child;
24
+ x: () => Child;
25
+ "chevron-down": () => Child;
26
+ "chevron-left": () => Child;
27
+ "chevron-right": () => Child;
28
+ "chevron-up": () => Child;
29
+ search: () => Child;
30
+ plus: () => Child;
31
+ minus: () => Child;
32
+ "panel-left": () => Child;
33
+ list: () => Child;
34
+ network: () => Child;
35
+ "external-link": () => Child;
36
+ brain: () => Child;
37
+ eye: () => Child;
38
+ wrench: () => Child;
39
+ "loader-circle": () => Child;
40
+ square: () => Child;
41
+ mic: () => Child;
42
+ "shield-check": () => Child;
43
+ gauge: () => Child;
44
+ timer: () => Child;
45
+ database: () => Child;
46
+ history: () => Child;
40
47
  };
41
48
  export type IconName = keyof typeof shapes;
42
49
  export declare const iconNames: IconName[];