meowtail 0.2.0-alpha.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 (97) hide show
  1. package/AGENT-COMPONENTS.md +65 -65
  2. package/ASSISTANT.md +35 -35
  3. package/JSON.md +11 -11
  4. package/README.md +397 -385
  5. package/THIRD_PARTY_NOTICES.md +8 -0
  6. package/dist/src/chat/attachments.js +9 -5
  7. package/dist/src/chat/composer-panel.d.ts +17 -0
  8. package/dist/src/chat/composer-panel.js +12 -0
  9. package/dist/src/chat/composer.d.ts +2 -0
  10. package/dist/src/chat/composer.js +5 -2
  11. package/dist/src/chat/conversation.js +2 -2
  12. package/dist/src/chat/index.d.ts +1 -0
  13. package/dist/src/chat/index.js +1 -0
  14. package/dist/src/chat/message-list.js +1 -1
  15. package/dist/src/chat/message.js +3 -3
  16. package/dist/src/chat/question.js +1 -1
  17. package/dist/src/chat/sources.js +1 -1
  18. package/dist/src/chat/tool-call.js +6 -6
  19. package/dist/src/components/action-rail.d.ts +19 -0
  20. package/dist/src/components/action-rail.js +13 -0
  21. package/dist/src/components/add-button.js +1 -1
  22. package/dist/src/components/alert.d.ts +2 -0
  23. package/dist/src/components/alert.js +2 -1
  24. package/dist/src/components/app-bar.d.ts +17 -0
  25. package/dist/src/components/app-bar.js +10 -0
  26. package/dist/src/components/breadcrumb.js +1 -1
  27. package/dist/src/components/choice-select.js +1 -1
  28. package/dist/src/components/code-block.js +6 -6
  29. package/dist/src/components/credential-source.js +12 -12
  30. package/dist/src/components/diff-block.js +1 -1
  31. package/dist/src/components/hover-card.js +2 -2
  32. package/dist/src/components/image-lightbox.js +3 -3
  33. package/dist/src/components/image-preview.js +1 -1
  34. package/dist/src/components/index.d.ts +3 -0
  35. package/dist/src/components/index.js +3 -0
  36. package/dist/src/components/json-block.js +2 -2
  37. package/dist/src/components/json-tree.js +3 -3
  38. package/dist/src/components/list-group.d.ts +1 -1
  39. package/dist/src/components/meta-row.d.ts +33 -0
  40. package/dist/src/components/meta-row.js +45 -0
  41. package/dist/src/components/output-block.js +7 -7
  42. package/dist/src/components/page-frame.d.ts +6 -2
  43. package/dist/src/components/page-frame.js +2 -2
  44. package/dist/src/components/path-picker.js +4 -4
  45. package/dist/src/components/process-group.d.ts +2 -2
  46. package/dist/src/components/rail-item.d.ts +2 -2
  47. package/dist/src/components/rail-section.d.ts +1 -1
  48. package/dist/src/components/read-block.js +2 -2
  49. package/dist/src/components/resource-card.d.ts +1 -1
  50. package/dist/src/components/resource-link.d.ts +1 -1
  51. package/dist/src/components/search-block.js +2 -3
  52. package/dist/src/components/terminal-block.js +6 -6
  53. package/dist/src/components/web-block.js +3 -3
  54. package/dist/src/components/work-card.d.ts +2 -2
  55. package/dist/src/components/work-card.js +1 -1
  56. package/dist/src/icons/README.md +13 -2
  57. package/dist/src/icons/icon-frame.d.ts +11 -0
  58. package/dist/src/icons/icon-frame.js +4 -0
  59. package/dist/src/icons/icon-source.d.ts +17 -0
  60. package/dist/src/icons/icon-source.js +6 -0
  61. package/dist/src/icons/icon.d.ts +44 -37
  62. package/dist/src/icons/icon.js +55 -128
  63. package/dist/src/icons/index.d.ts +1 -0
  64. package/dist/src/icons/index.js +1 -0
  65. package/dist/src/icons/lucide.d.ts +1 -0
  66. package/dist/src/icons/lucide.js +4 -0
  67. package/dist/src/registry/index.d.ts +38 -3
  68. package/dist/src/registry/index.js +11 -2
  69. package/dist/src/shared/execution-state.js +7 -7
  70. package/dist/src/theme/chat/composer-panel.styles.d.ts +1 -0
  71. package/dist/src/theme/chat/composer-panel.styles.js +44 -0
  72. package/dist/src/theme/chat/composer.styles.js +37 -6
  73. package/dist/src/theme/components/action-rail.styles.d.ts +1 -0
  74. package/dist/src/theme/components/action-rail.styles.js +47 -0
  75. package/dist/src/theme/components/alert.styles.js +42 -1
  76. package/dist/src/theme/components/app-bar.styles.d.ts +1 -0
  77. package/dist/src/theme/components/app-bar.styles.js +48 -0
  78. package/dist/src/theme/components/code-block.styles.js +7 -0
  79. package/dist/src/theme/components/dialog.styles.js +7 -0
  80. package/dist/src/theme/components/list-group.styles.js +1 -0
  81. package/dist/src/theme/components/meta-row.styles.d.ts +1 -0
  82. package/dist/src/theme/components/meta-row.styles.js +66 -0
  83. package/dist/src/theme/components/output-block.styles.js +9 -0
  84. package/dist/src/theme/components/page-frame.styles.js +7 -1
  85. package/dist/src/theme/components/page-header.styles.js +7 -0
  86. package/dist/src/theme/components/resource-card.styles.js +7 -0
  87. package/dist/src/theme/components/tag.styles.js +3 -3
  88. package/dist/src/theme/components/toolbar.styles.js +7 -0
  89. package/dist/src/theme/index.d.ts +15 -15
  90. package/dist/src/theme/index.js +8 -0
  91. package/dist/src/theme/palette.d.ts +1 -1
  92. package/dist/src/theme/palette.js +1 -1
  93. package/dist/src/theme/shared/code-highlight.tokens.d.ts +6 -6
  94. package/dist/src/theme/shared/code-highlight.tokens.js +6 -6
  95. package/dist/src/theme/tokens.d.ts +7 -7
  96. package/dist/src/theme/tokens.js +14 -8
  97. package/package.json +7 -2
@@ -25,3 +25,11 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
25
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
26
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
27
  SOFTWARE.
28
+
29
+ # Lucide
30
+
31
+ Functional icon geometry in `Icon` and the `meowtail/icons/lucide` pass-through
32
+ is provided by Lucide (https://lucide.dev), version 1.59.0, under the ISC
33
+ license; icons derived from the Feather project are under the MIT license. The
34
+ full license text, including the Feather attribution list, ships in
35
+ `dist/src/icons/LUCIDE-LICENSE` and in the installed `lucide` package.
@@ -18,7 +18,7 @@ export const chatAttachmentsContract = {
18
18
  "remove",
19
19
  ],
20
20
  };
21
- export const ChatAttachments = defineComponent(chatAttachmentsContract, ({ items, label = "消息附件", className, ...props }, context) => context.part("root", "div", {
21
+ export const ChatAttachments = defineComponent(chatAttachmentsContract, ({ items, label = "Message attachments", className, ...props }, context) => context.part("root", "div", {
22
22
  ...props,
23
23
  className,
24
24
  role: "group",
@@ -28,7 +28,7 @@ export const ChatAttachments = defineComponent(chatAttachmentsContract, ({ items
28
28
  ? context.part("remove", "button", {
29
29
  type: "button",
30
30
  onClick: item.onRemove,
31
- "aria-label": `移除 ${item.name}`,
31
+ "aria-label": `Remove ${item.name}`,
32
32
  }, h(Icon, { name: "x" }))
33
33
  : null;
34
34
  return item.mediaType.startsWith("image/")
@@ -36,13 +36,13 @@ export const ChatAttachments = defineComponent(chatAttachmentsContract, ({ items
36
36
  ? {
37
37
  type: "button",
38
38
  onClick: item.onPreview,
39
- "aria-label": `预览 ${item.name}`,
39
+ "aria-label": `Preview ${item.name}`,
40
40
  }
41
41
  : {
42
42
  href: item.url,
43
43
  target: "_blank",
44
44
  rel: "noreferrer",
45
- "aria-label": `打开图片 ${item.name}`,
45
+ "aria-label": `Open image ${item.name}`,
46
46
  }, context.part("preview", "span", null, h(ImagePreview, { src: item.url, alt: item.name }))), remove)
47
47
  : context.part("entry", "div", { key: item.id, "data-kind": "file" }, context.part("file", "a", {
48
48
  key: item.id,
@@ -64,7 +64,11 @@ export const ChatAttachments = defineComponent(chatAttachmentsContract, ({ items
64
64
  .filter(Boolean)
65
65
  .join(" "))
66
66
  : null)), item.onPreview
67
- ? context.part("previewButton", "button", { type: "button", onClick: item.onPreview, "aria-label": `预览 ${item.name}` }, "预览")
67
+ ? context.part("previewButton", "button", {
68
+ type: "button",
69
+ onClick: item.onPreview,
70
+ "aria-label": `Preview ${item.name}`,
71
+ }, "Preview")
68
72
  : null, remove);
69
73
  })));
70
74
  function formatBytes(value) {
@@ -0,0 +1,17 @@
1
+ import { type Child } from "meowjsx";
2
+ import { type ChatComposerProps } from "./composer.js";
3
+ export declare const composerPanelContract: {
4
+ readonly name: "composer-panel";
5
+ readonly parts: readonly ["root", "surface", "meta"];
6
+ };
7
+ export interface ComposerPanelProps extends Omit<ChatComposerProps, "surface" | "className"> {
8
+ /** Page-level facts below the writing surface, usually a MetaRow. */
9
+ meta?: Child;
10
+ className?: string;
11
+ }
12
+ /**
13
+ * Composer chrome: one surface around a bare ChatComposer, plus an optional
14
+ * page-level meta row below it. Behavior, draft and submission stay in
15
+ * ChatComposer; this component only owns the surrounding composition.
16
+ */
17
+ export declare const ComposerPanel: import("meowjsx").Component<ComposerPanelProps, "composer-panel", "meta" | "root" | "surface">;
@@ -0,0 +1,12 @@
1
+ import { defineComponent, h } from "meowjsx";
2
+ import { ChatComposer } from "./composer.js";
3
+ export const composerPanelContract = {
4
+ name: "composer-panel",
5
+ parts: ["root", "surface", "meta"],
6
+ };
7
+ /**
8
+ * Composer chrome: one surface around a bare ChatComposer, plus an optional
9
+ * page-level meta row below it. Behavior, draft and submission stay in
10
+ * ChatComposer; this component only owns the surrounding composition.
11
+ */
12
+ export const ComposerPanel = defineComponent(composerPanelContract, ({ meta, className, ...props }, context) => context.part("root", "div", { className, "data-pattern": "composer-panel" }, context.part("surface", "div", null, h(ChatComposer, { ...props, surface: "none" })), meta !== undefined && meta !== null ? context.part("meta", "div", null, meta) : null));
@@ -2,12 +2,14 @@ import { type ThemedProps } from "meowcss/meowjsx";
2
2
  import { type Child, type MaybeSignal, type Props } from "meowjsx";
3
3
  export declare const chatComposerOptions: import("meowcss").Options<{
4
4
  readonly layout: readonly ["stacked", "inline", "hero"];
5
+ readonly surface: readonly ["default", "none"];
5
6
  }>;
6
7
  export declare const chatComposerContract: {
7
8
  readonly name: "chat-composer";
8
9
  readonly parts: readonly ["root", "attachments", "field", "input", "hint", "actions", "trailing", "submit"];
9
10
  readonly styleProps: import("meowcss/meowjsx").StylePropsBinding<import("meowcss").Options<{
10
11
  readonly layout: readonly ["stacked", "inline", "hero"];
12
+ readonly surface: readonly ["default", "none"];
11
13
  }>>;
12
14
  };
13
15
  export type ChatComposerSubmit = (event: SubmitEvent) => void;
@@ -4,13 +4,16 @@ import { defineComponent, h } from "meowjsx";
4
4
  import { Icon } from "../icons/icon.js";
5
5
  export const chatComposerOptions = defineOptions("chat-composer", {
6
6
  layout: ["stacked", "inline", "hero"],
7
+ surface: ["default", "none"],
7
8
  });
8
9
  export const chatComposerContract = {
9
10
  name: "chat-composer",
10
11
  parts: ["root", "attachments", "field", "input", "hint", "actions", "trailing", "submit"],
11
- styleProps: defineStyleProps(chatComposerOptions, { defaults: { layout: "stacked" } }),
12
+ styleProps: defineStyleProps(chatComposerOptions, {
13
+ defaults: { layout: "stacked", surface: "default" },
14
+ }),
12
15
  };
13
- export const ChatComposer = defineComponent(chatComposerContract, ({ value = "", placeholder = "写下消息…", inputLabel = "消息", attachments, trailing, hint, hintId, submitLabel = "发送", submitContent, disabled = false, submitDisabled = false, onSubmit, onInput, children, className, ...props }, context) => context.part("root", "form", {
16
+ export const ChatComposer = defineComponent(chatComposerContract, ({ value = "", placeholder = "Write a message…", inputLabel = "Message", attachments, trailing, hint, hintId, submitLabel = "Send", submitContent, disabled = false, submitDisabled = false, onSubmit, onInput, children, className, ...props }, context) => context.part("root", "form", {
14
17
  ...props,
15
18
  className,
16
19
  onSubmit,
@@ -8,11 +8,11 @@ export const chatConversationContract = {
8
8
  * Place it beside the host viewport in a height-constrained column; the host
9
9
  * owns visibility, returning to the end and restoring viewport focus.
10
10
  */
11
- export const ChatConversationLatest = defineComponent(chatConversationContract, ({ children, ...props }, context) => context.part("latest", "button", { type: "button", ...props }, children ?? "回到最新消息"));
11
+ export const ChatConversationLatest = defineComponent(chatConversationContract, ({ children, ...props }, context) => context.part("latest", "button", { type: "button", ...props }, children ?? "Back to latest message"));
12
12
  /** Optional scroll owner for append-only transcripts. Give the root a constrained height.
13
13
  * Do not combine with an application-owned scroll controller. Children can use ChatMessageList.
14
14
  */
15
- export const ChatConversation = defineComponent(chatConversationContract, ({ children, ariaLabel = "对话阅读区", latestLabel = "回到最新消息", className, ...props }, context) => {
15
+ export const ChatConversation = defineComponent(chatConversationContract, ({ children, ariaLabel = "Conversation reading area", latestLabel = "Back to latest message", className, ...props }, context) => {
16
16
  const hidden = context.signal(true);
17
17
  let jump;
18
18
  const mount = (root) => {
@@ -1,5 +1,6 @@
1
1
  export { ChatAttachments, type ChatAttachmentItem, type ChatAttachmentsProps, chatAttachmentsContract, } from "./attachments.js";
2
2
  export { ChatComposer, type ChatComposerProps, type ChatComposerInput, type ChatComposerSubmit, chatComposerContract, chatComposerOptions, } from "./composer.js";
3
+ export { ComposerPanel, type ComposerPanelProps, composerPanelContract } from "./composer-panel.js";
3
4
  export { ChatFrame, type ChatFrameProps, chatFrameContract } from "./frame.js";
4
5
  export { AssistantView, assistantViewContract, assistantCopy, type AssistantViewProps, type AssistantDraft, type AssistantAttachment, type AssistantMessage, type AssistantMessagePart, type AssistantToolPart, type AssistantTaskPart, type AssistantProcessStep, type AssistantActivity, type AssistantWork, type AssistantQuestion, type AssistantChoice, type AssistantLabels, } from "./assistant.js";
5
6
  export { ChatHeader, type ChatHeaderProps, chatHeaderContract } from "./header.js";
@@ -1,5 +1,6 @@
1
1
  export { ChatAttachments, chatAttachmentsContract, } from "./attachments.js";
2
2
  export { ChatComposer, chatComposerContract, chatComposerOptions, } from "./composer.js";
3
+ export { ComposerPanel, composerPanelContract } from "./composer-panel.js";
3
4
  export { ChatFrame, chatFrameContract } from "./frame.js";
4
5
  export { AssistantView, assistantViewContract, assistantCopy, } from "./assistant.js";
5
6
  export { ChatHeader, chatHeaderContract } from "./header.js";
@@ -3,7 +3,7 @@ export const chatMessageListContract = {
3
3
  name: "chat-message-list",
4
4
  parts: ["root", "content", "item", "date"],
5
5
  };
6
- export const ChatMessageList = defineComponent(chatMessageListContract, ({ children, className, ariaLabel = "消息记录", ...props }, context) => context.part("root", "div", {
6
+ export const ChatMessageList = defineComponent(chatMessageListContract, ({ children, className, ariaLabel = "Message log", ...props }, context) => context.part("root", "div", {
7
7
  ...props,
8
8
  className,
9
9
  role: "log",
@@ -29,8 +29,8 @@ export const ChatMessage = defineComponent(chatMessageContract, ({ children, rol
29
29
  ? context.part("header", "div", null, header)
30
30
  : context.part("meta", "div", null, context.part("author", "strong", null, author), timestamp ? context.part("time", "time", { datetime: dateTime }, timestamp) : null, status !== "complete"
31
31
  ? context.part("status", "span", null, status === "streaming"
32
- ? "生成中"
32
+ ? "Generating"
33
33
  : status === "pending"
34
- ? "等待中"
35
- : "未完成")
34
+ ? "Waiting"
35
+ : "Incomplete")
36
36
  : null), context.part("content", "div", null, surface === "none" ? children : h(ChatBubble, null, children)), footer !== undefined ? context.part("footer", "div", null, footer) : null, actions ? context.part("actions", "div", null, actions) : null)))));
@@ -4,4 +4,4 @@ export const chatQuestionContract = {
4
4
  parts: ["root", "eyebrow", "title", "description", "content", "feedback", "actions"],
5
5
  };
6
6
  /** Presentation only: submission, cancellation and question lifetime belong to the host. */
7
- export const ChatQuestion = defineComponent(chatQuestionContract, ({ label = "需要你回答", question, questionId, description, feedback, actions, children, ...props }, context) => context.part("root", "section", { ...props, "aria-labelledby": questionId ?? props["aria-labelledby"] }, context.part("eyebrow", "div", null, label), question ? context.part("title", "p", { id: questionId }, question) : null, description ? context.part("description", "p", null, description) : null, context.part("content", "div", null, children), feedback ? context.part("feedback", "div", { role: "status" }, feedback) : null, actions ? context.part("actions", "div", null, actions) : null));
7
+ export const ChatQuestion = defineComponent(chatQuestionContract, ({ label = "Needs your answer", question, questionId, description, feedback, actions, children, ...props }, context) => context.part("root", "section", { ...props, "aria-labelledby": questionId ?? props["aria-labelledby"] }, context.part("eyebrow", "div", null, label), question ? context.part("title", "p", { id: questionId }, question) : null, description ? context.part("description", "p", null, description) : null, context.part("content", "div", null, children), feedback ? context.part("feedback", "div", { role: "status" }, feedback) : null, actions ? context.part("actions", "div", null, actions) : null));
@@ -4,7 +4,7 @@ export const chatSourcesContract = {
4
4
  name: "chat-sources",
5
5
  parts: ["root", "summary", "icon", "list", "item", "link", "description"],
6
6
  };
7
- export const ChatSources = defineComponent(chatSourcesContract, ({ items, label = "来源", ...props }, context) => {
7
+ export const ChatSources = defineComponent(chatSourcesContract, ({ items, label = "Sources", ...props }, context) => {
8
8
  const links = items.filter(({ url }) => {
9
9
  try {
10
10
  return ["http:", "https:"].includes(new URL(url).protocol);
@@ -30,12 +30,12 @@ export const ChatToolCall = defineComponent(chatToolCallContract, ({ children, l
30
30
  return value;
31
31
  };
32
32
  const copy = {
33
- input: "输入",
34
- output: "输出",
35
- emptyInput: "没有输入内容",
36
- emptyOutput: "输出为空",
37
- retry: "重试",
38
- cancel: "取消",
33
+ input: "Input",
34
+ output: "Output",
35
+ emptyInput: "No input content",
36
+ emptyOutput: "Empty output",
37
+ retry: "Retry",
38
+ cancel: "Cancel",
39
39
  ...labels,
40
40
  };
41
41
  const status = derived(() => unwrap(statusLabel) ?? executionStateLabel(unwrap(state)));
@@ -0,0 +1,19 @@
1
+ import { type Child, type Props } from "meowjsx";
2
+ export declare const actionRailContract: {
3
+ readonly name: "action-rail";
4
+ readonly parts: readonly ["root", "leading", "trailing", "submit"];
5
+ };
6
+ export interface ActionRailProps extends Props {
7
+ /** Actions anchored to the start of the row. */
8
+ leading?: Child;
9
+ /** Selection or secondary actions that stay together before the submit action. */
10
+ trailing?: Child;
11
+ /** The final action; flexible leading and trailing actions wrap to keep it visible. */
12
+ submit?: Child;
13
+ className?: string;
14
+ }
15
+ /**
16
+ * An action row with wrapping groups. The rail owns order, start/end anchoring, the gap between
17
+ * groups and the rule that the submit action stays visible; callers pass actions.
18
+ */
19
+ export declare const ActionRail: import("meowjsx").Component<ActionRailProps, "action-rail", "leading" | "root" | "submit" | "trailing">;
@@ -0,0 +1,13 @@
1
+ import { defineComponent } from "meowjsx";
2
+ export const actionRailContract = {
3
+ name: "action-rail",
4
+ parts: ["root", "leading", "trailing", "submit"],
5
+ };
6
+ /**
7
+ * An action row with wrapping groups. The rail owns order, start/end anchoring, the gap between
8
+ * groups and the rule that the submit action stays visible; callers pass actions.
9
+ */
10
+ export const ActionRail = defineComponent(actionRailContract, ({ leading, trailing, submit, children, className, ...props }, context) => {
11
+ void children;
12
+ return context.part("root", "div", { ...props, className }, context.part("leading", "div", null, leading), context.part("trailing", "div", null, trailing), context.part("submit", "div", null, submit));
13
+ });
@@ -4,5 +4,5 @@ import { PlusIcon } from "../icons/plus.js";
4
4
  export function AddButton(props) {
5
5
  return (h(Button, { ...props },
6
6
  h(PlusIcon, null),
7
- props.children ?? "添加"));
7
+ props.children ?? "Add"));
8
8
  }
@@ -2,12 +2,14 @@ import { type Child, type Props } from "meowjsx";
2
2
  import { type ThemedProps } from "meowcss/meowjsx";
3
3
  export declare const alertOptions: import("meowcss").Options<{
4
4
  readonly tone: readonly ["info", "success", "warning", "danger"];
5
+ readonly layout: readonly ["block", "bar"];
5
6
  }>;
6
7
  export declare const alertContract: {
7
8
  readonly name: "alert";
8
9
  readonly parts: readonly ["root", "title", "body", "actions"];
9
10
  readonly styleProps: import("meowcss/meowjsx").StylePropsBinding<import("meowcss").Options<{
10
11
  readonly tone: readonly ["info", "success", "warning", "danger"];
12
+ readonly layout: readonly ["block", "bar"];
11
13
  }>>;
12
14
  };
13
15
  export interface AlertProps extends Props, ThemedProps<typeof alertOptions> {
@@ -3,12 +3,13 @@ import { defineOptions } from "meowcss";
3
3
  import { defineStyleProps } from "meowcss/meowjsx";
4
4
  export const alertOptions = defineOptions("alert", {
5
5
  tone: ["info", "success", "warning", "danger"],
6
+ layout: ["block", "bar"],
6
7
  });
7
8
  export const alertContract = {
8
9
  name: "alert",
9
10
  parts: ["root", "title", "body", "actions"],
10
11
  styleProps: defineStyleProps(alertOptions, {
11
- defaults: { tone: "info" },
12
+ defaults: { tone: "info", layout: "block" },
12
13
  parts: ["root", "title"],
13
14
  }),
14
15
  };
@@ -0,0 +1,17 @@
1
+ import { type Child, type Props } from "meowjsx";
2
+ export declare const appBarContract: {
3
+ readonly name: "app-bar";
4
+ readonly parts: readonly ["root", "identity", "title", "status", "actions"];
5
+ };
6
+ export interface AppBarProps extends Props {
7
+ title: Child;
8
+ /** A short status line under the title, typically ChatStatus. */
9
+ status?: Child;
10
+ actions?: Child;
11
+ className?: string;
12
+ }
13
+ /**
14
+ * Compact application chrome: one title, one optional status line, and the
15
+ * actions that belong to the whole screen. The page body keeps its own scroll.
16
+ */
17
+ export declare const AppBar: import("meowjsx").Component<AppBarProps, "app-bar", "actions" | "identity" | "root" | "status" | "title">;
@@ -0,0 +1,10 @@
1
+ import { defineComponent } from "meowjsx";
2
+ export const appBarContract = {
3
+ name: "app-bar",
4
+ parts: ["root", "identity", "title", "status", "actions"],
5
+ };
6
+ /**
7
+ * Compact application chrome: one title, one optional status line, and the
8
+ * actions that belong to the whole screen. The page body keeps its own scroll.
9
+ */
10
+ export const AppBar = defineComponent(appBarContract, ({ title, status, actions, className, ...props }, context) => context.part("root", "header", { ...props, className }, context.part("identity", "div", null, context.part("title", "h1", null, title), status !== undefined && status !== null ? context.part("status", "div", null, status) : null), actions ? context.part("actions", "div", null, actions) : null));
@@ -3,7 +3,7 @@ export const breadcrumbContract = {
3
3
  name: "breadcrumb",
4
4
  parts: ["root", "list", "item", "link", "current", "separator"],
5
5
  };
6
- export const Breadcrumb = defineComponent(breadcrumbContract, ({ items, label = "当前位置", className, ...props }, context) => context.part("root", "nav", { ...props, className, "aria-label": label }, context.part("list", "ol", null, items.map((item, index) => context.part("item", "li", null, index ? context.part("separator", "span", { "aria-hidden": "true" }, "/") : null, index === items.length - 1
6
+ export const Breadcrumb = defineComponent(breadcrumbContract, ({ items, label = "Current location", className, ...props }, context) => context.part("root", "nav", { ...props, className, "aria-label": label }, context.part("list", "ol", null, items.map((item, index) => context.part("item", "li", null, index ? context.part("separator", "span", { "aria-hidden": "true" }, "/") : null, index === items.length - 1
7
7
  ? context.part("current", "span", { "aria-current": "page" }, item.label)
8
8
  : item.href
9
9
  ? context.part("link", "a", { href: item.href }, item.label)
@@ -20,7 +20,7 @@ export const choiceSelectContract = {
20
20
  };
21
21
  let nextChoiceId = 0;
22
22
  /** Single-choice listbox. Form participation remains native; data fetching belongs to callers. */
23
- export const ChoiceSelect = defineComponent(choiceSelectContract, ({ options, value, defaultValue = "", onValueChange, name, id = `choice-${++nextChoiceId}`, disabled = false, required = false, placeholder = "请选择", searchable = false, searchPlaceholder = "搜索选项", emptyMessage = "没有匹配的选项", className, placement = "bottom", align = "start", matchTriggerWidth = true, ...props }, context) => {
23
+ export const ChoiceSelect = defineComponent(choiceSelectContract, ({ options, value, defaultValue = "", onValueChange, name, id = `choice-${++nextChoiceId}`, disabled = false, required = false, placeholder = "Select an option", searchable = false, searchPlaceholder = "Search options", emptyMessage = "No matching options", className, placement = "bottom", align = "start", matchTriggerWidth = true, ...props }, context) => {
24
24
  const selected = context.signal(value === undefined ? defaultValue : unwrap(value));
25
25
  const open = context.signal(false);
26
26
  const caption = context.signal(placeholder);
@@ -27,11 +27,11 @@ export const CodeBlock = defineComponent(codeBlockContract, ({ code, language, d
27
27
  else
28
28
  await copyTextToClipboard(code);
29
29
  if (!disposed)
30
- feedback.value = "已复制";
30
+ feedback.value = "Copied";
31
31
  }
32
32
  catch {
33
33
  if (!disposed)
34
- feedback.value = "复制失败,请选择代码后手动复制。";
34
+ feedback.value = "Copy failed; select the code and copy it manually.";
35
35
  }
36
36
  finally {
37
37
  if (!disposed)
@@ -40,15 +40,15 @@ export const CodeBlock = defineComponent(codeBlockContract, ({ code, language, d
40
40
  };
41
41
  return context.part("root", "figure", props, [
42
42
  context.part("header", "figcaption", {}, [
43
- context.part("language", "span", {}, language?.trim() || "代码"),
43
+ context.part("language", "span", {}, language?.trim() || "Code"),
44
44
  context.part("actions", "div", {}, [
45
45
  h(Button, { variant: "quiet", size: "small", "aria-pressed": wrap, onClick: () => {
46
46
  wrap.value = wrap.value === "true" ? "false" : "true";
47
- } }, "\u81EA\u52A8\u6362\u884C"),
48
- h(Button, { variant: "quiet", size: "small", disabled: copying, onClick: copy }, "\u590D\u5236\u4EE3\u7801"),
47
+ } }, "Soft wrap"),
48
+ h(Button, { variant: "quiet", size: "small", disabled: copying, onClick: copy }, "Copy code"),
49
49
  ]),
50
50
  ]),
51
- context.part("content", "pre", { tabIndex: 0, "aria-label": "代码内容", "data-wrap": wrap }, context.part("code", "code", {
51
+ context.part("content", "pre", { tabIndex: 0, "aria-label": "Code content", "data-wrap": wrap }, context.part("code", "code", {
52
52
  ref: () => {
53
53
  let active = true;
54
54
  void highlightCode(code, language).then((spans) => {
@@ -8,27 +8,27 @@ import { Stack } from "./stack.js";
8
8
  export function CredentialSource(props) {
9
9
  const { id, disabled } = props;
10
10
  return (h(Stack, { gap: "compact" },
11
- h(Field, { label: "API Key \u6765\u6E90", htmlFor: `${id}-source` },
11
+ h(Field, { label: "API Key source", htmlFor: `${id}-source` },
12
12
  h(Select, { id: `${id}-source`, value: props.source, disabled: disabled, onChange: (event) => props.onSourceChange(event.target.value) },
13
- h("option", { value: "stored" }, "\u8F93\u5165 API Key"),
14
- h("option", { value: "environment" }, "\u4F7F\u7528\u73AF\u5883\u53D8\u91CF"))),
13
+ h("option", { value: "stored" }, "Enter an API key"),
14
+ h("option", { value: "environment" }, "Use an environment variable"))),
15
15
  props.source === "environment" ? (h(Stack, { gap: "compact" },
16
- h(Field, { label: "\u73AF\u5883\u53D8\u91CF\u540D", htmlFor: `${id}-environment`, description: "\u53EA\u4FDD\u5B58\u53D8\u91CF\u540D\u5F15\u7528\uFF0C\u4E0D\u590D\u5236 Key\u3002\u8BFB\u53D6\u670D\u52A1\u8FD0\u884C\u73AF\u5883\uFF0C\u4E0E\u6D4F\u89C8\u5668\u6240\u5728\u673A\u5668\u65E0\u5173\u3002" },
17
- h(Input, { id: `${id}-environment`, value: props.environmentName, disabled: disabled, autoComplete: "off", list: `${id}-variables`, placeholder: "\u4F8B\u5982 KIMI_API_KEY", onInput: (event) => props.onEnvironmentChange(event.target.value) })),
16
+ h(Field, { label: "Environment variable name", htmlFor: `${id}-environment`, description: "Stores only the variable name reference; never copies the key. Reads the service runtime environment, independent of the browser machine." },
17
+ h(Input, { id: `${id}-environment`, value: props.environmentName, disabled: disabled, autoComplete: "off", list: `${id}-variables`, placeholder: "For example, KIMI_API_KEY", onInput: (event) => props.onEnvironmentChange(event.target.value) })),
18
18
  h("datalist", { id: `${id}-variables` }, props.variables?.map((variable) => (h("option", { value: variable.name })))),
19
- h(Button, { type: "button", variant: "outline", style: { alignSelf: "start" }, disabled: disabled, onClick: props.onCheck }, "\u68C0\u67E5\u73AF\u5883\u53D8\u91CF"),
19
+ h(Button, { type: "button", variant: "outline", style: { alignSelf: "start" }, disabled: disabled, onClick: props.onCheck }, "Check environment variable"),
20
20
  props.variables?.map((variable) => (h("span", null,
21
21
  variable.name,
22
22
  " \u00B7",
23
23
  " ",
24
24
  variable.available === null
25
- ? "在 WorkCell 运行环境中读取"
25
+ ? "Read from the WorkCell runtime environment"
26
26
  : variable.available
27
- ? "可用"
28
- : "未设置"))))) : props.keepStored && props.hasStored ? (h(Stack, { gap: "compact" },
29
- h("span", null, "\u5DF2\u4FDD\u5B58 API Key"),
30
- h(Button, { type: "button", variant: "outline", style: { alignSelf: "start" }, disabled: disabled, onClick: props.onReplace }, "\u66FF\u6362 API Key"))) : (h(Field, { label: "API Key", htmlFor: `${id}-key`, description: "\u4FDD\u5B58\u5230\u51ED\u636E\u5E93\uFF0C\u4FDD\u5B58\u540E\u4E0D\u56DE\u663E\u3002" },
27
+ ? "Available"
28
+ : "Not set"))))) : props.keepStored && props.hasStored ? (h(Stack, { gap: "compact" },
29
+ h("span", null, "Saved API Key"),
30
+ h(Button, { type: "button", variant: "outline", style: { alignSelf: "start" }, disabled: disabled, onClick: props.onReplace }, "Replace API Key"))) : (h(Field, { label: "API Key", htmlFor: `${id}-key`, description: "Saved to the credential store; never shown again after saving." },
31
31
  h(Input, { id: `${id}-key`, type: "password", value: props.apiKey, disabled: disabled, autoComplete: "new-password", onInput: (event) => props.onKeyChange(event.target.value) }),
32
- props.hasStored && props.onKeep ? (h(Button, { type: "button", variant: "outline", disabled: disabled, onClick: props.onKeep }, "\u4FDD\u7559\u5DF2\u4FDD\u5B58\u7684 API Key")) : null)),
32
+ props.hasStored && props.onKeep ? (h(Button, { type: "button", variant: "outline", disabled: disabled, onClick: props.onKeep }, "Keep the saved API Key")) : null)),
33
33
  props.status ? h("span", { role: "status" }, props.status) : null));
34
34
  }
@@ -14,7 +14,7 @@ export function diffBlockText(files) {
14
14
  export const DiffBlock = defineComponent(diffBlockContract, ({ files, maxLines, onCopy, ...props }, context) => {
15
15
  const added = files.reduce((sum, file) => sum + file.lines.filter((line) => line.kind === "added").length, 0);
16
16
  const removed = files.reduce((sum, file) => sum + file.lines.filter((line) => line.kind === "removed").length, 0);
17
- return context.part("root", "div", props, h(OutputBlock, { title: `变更 · +${added} −${removed}`, maxLines: maxLines, onCopy: onCopy, copyText: diffBlockText(files), rows: files.flatMap((file) => [
17
+ return context.part("root", "div", props, h(OutputBlock, { title: `Changes · +${added} −${removed}`, maxLines: maxLines, onCopy: onCopy, copyText: diffBlockText(files), rows: files.flatMap((file) => [
18
18
  context.part("path", "div", {}, file.path),
19
19
  ...file.lines.map((line) => context.part("line", "div", { "data-diff-kind": line.kind }, [
20
20
  marker[line.kind],
@@ -6,7 +6,7 @@ export const hoverCardContract = {
6
6
  parts: ["root", "content", "feedback"],
7
7
  };
8
8
  /** Selectable preview. Popover owns positioning, Escape, outside dismissal and focus. */
9
- export const HoverCard = defineComponent(hoverCardContract, ({ id, trigger, content, openDelay = 500, disabled = false, className, variant = "compact", widthAnchor, copyText, copyLabel = "复制", copiedLabel = "已复制", onCopy, }, context) => {
9
+ export const HoverCard = defineComponent(hoverCardContract, ({ id, trigger, content, openDelay = 500, disabled = false, className, variant = "compact", widthAnchor, copyText, copyLabel = "Copy", copiedLabel = "Copied", onCopy, }, context) => {
10
10
  const open = context.signal(false);
11
11
  let timer;
12
12
  let hovered = false;
@@ -53,7 +53,7 @@ export const HoverCard = defineComponent(hoverCardContract, ({ id, trigger, cont
53
53
  }
54
54
  catch {
55
55
  if (alive && open.value && session === copySession)
56
- feedback.value = "复制失败,请选择文本后重试。";
56
+ feedback.value = "Copy failed; select the text and try again.";
57
57
  }
58
58
  finally {
59
59
  copying = false;
@@ -5,7 +5,7 @@ export const imageLightboxContract = {
5
5
  parts: ["root", "trigger", "dialog", "image", "caption", "close"],
6
6
  };
7
7
  /** Native modal top layer keeps the preview independent of transformed ancestors. */
8
- export const ImageLightbox = defineComponent(imageLightboxContract, ({ src, alt, caption, trigger = "预览图片", onClose, ...props }, context) => {
8
+ export const ImageLightbox = defineComponent(imageLightboxContract, ({ src, alt, caption, trigger = "Preview image", onClose, ...props }, context) => {
9
9
  let dialog;
10
10
  let opener;
11
11
  return context.part("root", "div", props, [
@@ -20,7 +20,7 @@ export const ImageLightbox = defineComponent(imageLightboxContract, ({ src, alt,
20
20
  onClick: () => dialog?.showModal(),
21
21
  }, trigger),
22
22
  context.part("dialog", "dialog", {
23
- "aria-label": alt || "图片预览",
23
+ "aria-label": alt || "Image preview",
24
24
  ref: (node) => {
25
25
  dialog = node;
26
26
  return () => {
@@ -41,7 +41,7 @@ export const ImageLightbox = defineComponent(imageLightboxContract, ({ src, alt,
41
41
  context.part("close", "button", {
42
42
  type: "button",
43
43
  autoFocus: true,
44
- "aria-label": "关闭图片预览",
44
+ "aria-label": "Close image preview",
45
45
  onClick: () => dialog?.close(),
46
46
  }, "×"),
47
47
  context.part("image", "div", null, h(ImagePreview, { src: src, alt: alt })),
@@ -5,7 +5,7 @@ export const imagePreviewContract = {
5
5
  parts: ["root", "image", "status"],
6
6
  };
7
7
  /** Passive media display; navigation, preview activation and URL authorization belong to the host. */
8
- export const ImagePreview = defineComponent(imagePreviewContract, ({ src, alt, loading = "lazy", loadingLabel = "正在加载图片", failedLabel = "图片加载失败", onLoad, onError, ...props }, context) => {
8
+ export const ImagePreview = defineComponent(imagePreviewContract, ({ src, alt, loading = "lazy", loadingLabel = "Loading image", failedLabel = "Failed to load image", onLoad, onError, ...props }, context) => {
9
9
  const state = context.signal("loading");
10
10
  return context.part("root", "span", { ...props, "data-image-state": state }, [
11
11
  context.part("image", "img", {
@@ -17,6 +17,8 @@ export { Field, type FieldProps, fieldContract } from "./field.js";
17
17
  export { CredentialSource, type CredentialSourceProps } from "./credential-source.js";
18
18
  export { IconButton, type IconButtonProps, iconButtonContract, iconButtonOptions, } from "./icon-button.js";
19
19
  export { Toolbar, type ToolbarProps, toolbarContract } from "./toolbar.js";
20
+ export { ActionRail, type ActionRailProps, actionRailContract } from "./action-rail.js";
21
+ export { MetaRow, type MetaItem, type MetaRowProps, metaRowContract, metaRowOptions, } from "./meta-row.js";
20
22
  export { Input, type InputProps, inputContract } from "./input.js";
21
23
  export { Checkbox, type CheckboxProps, checkboxContract } from "./checkbox.js";
22
24
  export { Switch, type SwitchProps, switchContract } from "./switch.js";
@@ -31,6 +33,7 @@ export { Separator, type SeparatorProps, separatorContract } from "./separator.j
31
33
  export { Textarea, type TextareaProps, textareaContract } from "./textarea.js";
32
34
  export { Stack, type StackProps, stackContract } from "./stack.js";
33
35
  export { PageFrame, type PageFrameProps, pageFrameContract, pageFrameOptions } from "./page-frame.js";
36
+ export { AppBar, type AppBarProps, appBarContract } from "./app-bar.js";
34
37
  export { mountRegionLayout, regionLayoutContract, type RegionRoots, type RegionLayoutSurface, type RegionLayoutOptions, } from "./region-layout.js";
35
38
  export { validateRegionLayout, type RegionDescription, type RegionLayoutDescription, } from "./region-layout-types.js";
36
39
  export { LayoutItem, type LayoutItemProps, layoutItemContract } from "./layout-item.js";
@@ -17,6 +17,8 @@ export { Field, fieldContract } from "./field.js";
17
17
  export { CredentialSource } from "./credential-source.js";
18
18
  export { IconButton, iconButtonContract, iconButtonOptions, } from "./icon-button.js";
19
19
  export { Toolbar, toolbarContract } from "./toolbar.js";
20
+ export { ActionRail, actionRailContract } from "./action-rail.js";
21
+ export { MetaRow, metaRowContract, metaRowOptions, } from "./meta-row.js";
20
22
  export { Input, inputContract } from "./input.js";
21
23
  export { Checkbox, checkboxContract } from "./checkbox.js";
22
24
  export { Switch, switchContract } from "./switch.js";
@@ -31,6 +33,7 @@ export { Separator, separatorContract } from "./separator.js";
31
33
  export { Textarea, textareaContract } from "./textarea.js";
32
34
  export { Stack, stackContract } from "./stack.js";
33
35
  export { PageFrame, pageFrameContract, pageFrameOptions } from "./page-frame.js";
36
+ export { AppBar, appBarContract } from "./app-bar.js";
34
37
  export { mountRegionLayout, regionLayoutContract, } from "./region-layout.js";
35
38
  export { validateRegionLayout, } from "./region-layout-types.js";
36
39
  export { LayoutItem, layoutItemContract } from "./layout-item.js";
@@ -19,7 +19,7 @@ export const JsonBlock = defineComponent(jsonBlockContract, ({ text, payload, la
19
19
  JSON.parse(text);
20
20
  }
21
21
  catch {
22
- error = "JSON 格式无效,显示原文。";
22
+ error = "Invalid JSON; showing the original text.";
23
23
  }
24
24
  }
25
25
  else {
@@ -28,7 +28,7 @@ export const JsonBlock = defineComponent(jsonBlockContract, ({ text, payload, la
28
28
  }
29
29
  catch {
30
30
  content = String(payload);
31
- error = "无法序列化为 JSON,显示值的文本表示。";
31
+ error = "Cannot serialize to JSON; showing the value's text representation.";
32
32
  }
33
33
  }
34
34
  body.value = [
@@ -37,11 +37,11 @@ export const JsonTree = defineComponent(jsonTreeContract, ({ data, label = "JSON
37
37
  try {
38
38
  await (onCopy ?? copyTextToClipboard)(JSON.stringify(data, null, 2));
39
39
  if (alive)
40
- feedback.value = "已复制";
40
+ feedback.value = "Copied";
41
41
  }
42
42
  catch {
43
43
  if (alive)
44
- feedback.value = "复制失败";
44
+ feedback.value = "Copy failed";
45
45
  }
46
46
  };
47
47
  const copyButton = context.part("copy", "button", {
@@ -50,7 +50,7 @@ export const JsonTree = defineComponent(jsonTreeContract, ({ data, label = "JSON
50
50
  event.stopPropagation();
51
51
  void copy();
52
52
  },
53
- "aria-label": `复制 ${label}`,
53
+ "aria-label": `Copy ${label}`,
54
54
  }, h(Icon, { name: "copy", size: 12 }));
55
55
  const summary = container
56
56
  ? `${Array.isArray(data) ? "Array" : "Object"}(${Object.keys(data).length})`
@@ -14,7 +14,7 @@ export declare const listRowContract: {
14
14
  };
15
15
  export interface ListRowProps extends Props {
16
16
  title: Child;
17
- /** Tags beside the title, such as "CLI" or "默认". */
17
+ /** Tags beside the title, such as "CLI" or "Default". */
18
18
  tags?: Child;
19
19
  description?: Child;
20
20
  /** A state in words with its dot; the row's only status. */