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.
- package/AGENT-COMPONENTS.md +65 -65
- package/ASSISTANT.md +35 -35
- package/JSON.md +11 -11
- package/README.md +397 -385
- package/THIRD_PARTY_NOTICES.md +8 -0
- package/dist/src/chat/attachments.js +9 -5
- package/dist/src/chat/composer-panel.d.ts +17 -0
- package/dist/src/chat/composer-panel.js +12 -0
- package/dist/src/chat/composer.d.ts +2 -0
- package/dist/src/chat/composer.js +5 -2
- package/dist/src/chat/conversation.js +2 -2
- package/dist/src/chat/index.d.ts +1 -0
- package/dist/src/chat/index.js +1 -0
- package/dist/src/chat/message-list.js +1 -1
- package/dist/src/chat/message.js +3 -3
- package/dist/src/chat/question.js +1 -1
- package/dist/src/chat/sources.js +1 -1
- package/dist/src/chat/tool-call.js +6 -6
- package/dist/src/components/action-rail.d.ts +19 -0
- package/dist/src/components/action-rail.js +13 -0
- package/dist/src/components/add-button.js +1 -1
- package/dist/src/components/alert.d.ts +2 -0
- package/dist/src/components/alert.js +2 -1
- package/dist/src/components/app-bar.d.ts +17 -0
- package/dist/src/components/app-bar.js +10 -0
- package/dist/src/components/breadcrumb.js +1 -1
- package/dist/src/components/choice-select.js +1 -1
- package/dist/src/components/code-block.js +6 -6
- package/dist/src/components/credential-source.js +12 -12
- package/dist/src/components/diff-block.js +1 -1
- package/dist/src/components/hover-card.js +2 -2
- package/dist/src/components/image-lightbox.js +3 -3
- package/dist/src/components/image-preview.js +1 -1
- package/dist/src/components/index.d.ts +3 -0
- package/dist/src/components/index.js +3 -0
- package/dist/src/components/json-block.js +2 -2
- package/dist/src/components/json-tree.js +3 -3
- package/dist/src/components/list-group.d.ts +1 -1
- package/dist/src/components/meta-row.d.ts +33 -0
- package/dist/src/components/meta-row.js +45 -0
- package/dist/src/components/output-block.js +7 -7
- package/dist/src/components/page-frame.d.ts +6 -2
- package/dist/src/components/page-frame.js +2 -2
- package/dist/src/components/path-picker.js +4 -4
- package/dist/src/components/process-group.d.ts +2 -2
- package/dist/src/components/rail-item.d.ts +2 -2
- package/dist/src/components/rail-section.d.ts +1 -1
- package/dist/src/components/read-block.js +2 -2
- package/dist/src/components/resource-card.d.ts +1 -1
- package/dist/src/components/resource-link.d.ts +1 -1
- package/dist/src/components/search-block.js +2 -3
- package/dist/src/components/terminal-block.js +6 -6
- package/dist/src/components/web-block.js +3 -3
- package/dist/src/components/work-card.d.ts +2 -2
- package/dist/src/components/work-card.js +1 -1
- package/dist/src/icons/README.md +13 -2
- package/dist/src/icons/icon-frame.d.ts +11 -0
- package/dist/src/icons/icon-frame.js +4 -0
- package/dist/src/icons/icon-source.d.ts +17 -0
- package/dist/src/icons/icon-source.js +6 -0
- package/dist/src/icons/icon.d.ts +44 -37
- package/dist/src/icons/icon.js +55 -128
- package/dist/src/icons/index.d.ts +1 -0
- package/dist/src/icons/index.js +1 -0
- package/dist/src/icons/lucide.d.ts +1 -0
- package/dist/src/icons/lucide.js +4 -0
- package/dist/src/registry/index.d.ts +38 -3
- package/dist/src/registry/index.js +11 -2
- package/dist/src/shared/execution-state.js +7 -7
- package/dist/src/theme/chat/composer-panel.styles.d.ts +1 -0
- package/dist/src/theme/chat/composer-panel.styles.js +44 -0
- package/dist/src/theme/chat/composer.styles.js +37 -6
- package/dist/src/theme/components/action-rail.styles.d.ts +1 -0
- package/dist/src/theme/components/action-rail.styles.js +47 -0
- package/dist/src/theme/components/alert.styles.js +42 -1
- package/dist/src/theme/components/app-bar.styles.d.ts +1 -0
- package/dist/src/theme/components/app-bar.styles.js +48 -0
- package/dist/src/theme/components/code-block.styles.js +7 -0
- package/dist/src/theme/components/dialog.styles.js +7 -0
- package/dist/src/theme/components/list-group.styles.js +1 -0
- package/dist/src/theme/components/meta-row.styles.d.ts +1 -0
- package/dist/src/theme/components/meta-row.styles.js +66 -0
- package/dist/src/theme/components/output-block.styles.js +9 -0
- package/dist/src/theme/components/page-frame.styles.js +7 -1
- package/dist/src/theme/components/page-header.styles.js +7 -0
- package/dist/src/theme/components/resource-card.styles.js +7 -0
- package/dist/src/theme/components/tag.styles.js +3 -3
- package/dist/src/theme/components/toolbar.styles.js +7 -0
- package/dist/src/theme/index.d.ts +15 -15
- package/dist/src/theme/index.js +8 -0
- package/dist/src/theme/palette.d.ts +1 -1
- package/dist/src/theme/palette.js +1 -1
- package/dist/src/theme/shared/code-highlight.tokens.d.ts +6 -6
- package/dist/src/theme/shared/code-highlight.tokens.js +6 -6
- package/dist/src/theme/tokens.d.ts +7 -7
- package/dist/src/theme/tokens.js +14 -8
- package/package.json +7 -2
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ThemedProps } from "meowcss/meowjsx";
|
|
2
|
+
import { type Child, type Props } from "meowjsx";
|
|
3
|
+
export declare const metaRowOptions: import("meowcss").Options<{
|
|
4
|
+
readonly align: readonly ["start", "center"];
|
|
5
|
+
readonly progressTone: readonly ["neutral", "accent"];
|
|
6
|
+
}>;
|
|
7
|
+
export declare const metaRowContract: {
|
|
8
|
+
readonly name: "meta-row";
|
|
9
|
+
readonly parts: readonly ["root", "item", "icon", "label", "separator", "progress"];
|
|
10
|
+
readonly styleProps: import("meowcss/meowjsx").StylePropsBinding<import("meowcss").Options<{
|
|
11
|
+
readonly align: readonly ["start", "center"];
|
|
12
|
+
readonly progressTone: readonly ["neutral", "accent"];
|
|
13
|
+
}>>;
|
|
14
|
+
};
|
|
15
|
+
export interface MetaItem {
|
|
16
|
+
/** Decorative glyph that helps identify the fact. */
|
|
17
|
+
icon?: Child;
|
|
18
|
+
/** Short, scannable fact text. */
|
|
19
|
+
label: Child;
|
|
20
|
+
}
|
|
21
|
+
export interface MetaRowProps extends Props, ThemedProps<typeof metaRowOptions> {
|
|
22
|
+
items: readonly MetaItem[];
|
|
23
|
+
/** Finite values clamp to 0–100; non-finite values omit the progress segment. */
|
|
24
|
+
progress?: number;
|
|
25
|
+
/** Accessible name for the progress segment. */
|
|
26
|
+
progressLabel?: string;
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A page-level fact row. Items keep separators, wrap instead of clipping, and
|
|
31
|
+
* carry facts as text; the optional progress segment is one more fact.
|
|
32
|
+
*/
|
|
33
|
+
export declare const MetaRow: import("meowjsx").Component<MetaRowProps, "meta-row", "icon" | "item" | "label" | "progress" | "root" | "separator">;
|
|
@@ -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
|
+
});
|
|
@@ -11,7 +11,7 @@ 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, wrap = false, emptyText = "
|
|
14
|
+
export const OutputBlock = defineComponent(outputBlockContract, ({ title, rows, copyText, maxLines, wrap = false, emptyText = "No content", onCopy, ...props }, context) => {
|
|
15
15
|
const derived = (read) => {
|
|
16
16
|
const value = context.signal(read());
|
|
17
17
|
context.effect(() => {
|
|
@@ -32,11 +32,11 @@ export const OutputBlock = defineComponent(outputBlockContract, ({ title, rows,
|
|
|
32
32
|
try {
|
|
33
33
|
await (onCopy ?? copyTextToClipboard)(unwrap(copyText));
|
|
34
34
|
if (!disposed)
|
|
35
|
-
feedback.value = "
|
|
35
|
+
feedback.value = "Copied";
|
|
36
36
|
}
|
|
37
37
|
catch {
|
|
38
38
|
if (!disposed)
|
|
39
|
-
feedback.value = "
|
|
39
|
+
feedback.value = "Copy failed; select the text manually.";
|
|
40
40
|
}
|
|
41
41
|
finally {
|
|
42
42
|
if (!disposed)
|
|
@@ -48,9 +48,9 @@ export const OutputBlock = defineComponent(outputBlockContract, ({ title, rows,
|
|
|
48
48
|
return context.part("root", "section", { ...props, "data-output-wrap": wrap ? "true" : undefined }, [
|
|
49
49
|
context.part("header", "div", {}, [
|
|
50
50
|
context.part("title", "div", {}, title),
|
|
51
|
-
context.part("actions", "button", { type: "button", disabled: busy, onClick: copy }, "
|
|
51
|
+
context.part("actions", "button", { type: "button", disabled: busy, onClick: copy }, "Copy"),
|
|
52
52
|
]),
|
|
53
|
-
context.part("body", "div", { tabIndex: 0, "aria-label": "
|
|
53
|
+
context.part("body", "div", { tabIndex: 0, "aria-label": "Output content" }, [
|
|
54
54
|
derived(() => {
|
|
55
55
|
const values = unwrap(rows);
|
|
56
56
|
return values.length === 0
|
|
@@ -59,8 +59,8 @@ export const OutputBlock = defineComponent(outputBlockContract, ({ title, rows,
|
|
|
59
59
|
}),
|
|
60
60
|
context.part("fold", "details", { hidden: derived(() => window.value.hidden === 0) }, [
|
|
61
61
|
context.part("toggle", "summary", {}, [
|
|
62
|
-
h("span", { "data-fold-closed": true }, derived(() =>
|
|
63
|
-
h("span", { "data-fold-open": true }, "
|
|
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
64
|
]),
|
|
65
65
|
derived(() => {
|
|
66
66
|
const values = unwrap(rows);
|
|
@@ -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 "
|
|
7
|
+
/** The group's name and size, for example "Process · 3 steps". */
|
|
8
8
|
title: Child;
|
|
9
|
-
/** Outcome in words, for example "
|
|
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 "
|
|
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 = "
|
|
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 ? ` ·
|
|
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 ·
|
|
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
|
-
"
|
|
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:
|
|
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
|
});
|
|
@@ -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
|
-
?
|
|
65
|
+
? `Signal ${signal}`
|
|
66
66
|
: exitCode === 0
|
|
67
|
-
? "
|
|
67
|
+
? "Completed"
|
|
68
68
|
: typeof exitCode === "number"
|
|
69
|
-
?
|
|
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 ? "
|
|
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", {}, "
|
|
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 "
|
|
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 = "
|
|
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 }))));
|
package/dist/src/icons/README.md
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
# Functional icons
|
|
2
2
|
|
|
3
|
-
`Icon` renders
|
|
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
|
-
|
|
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
|
+
}
|
package/dist/src/icons/icon.d.ts
CHANGED
|
@@ -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: () =>
|
|
4
|
-
menu: () =>
|
|
5
|
-
settings:
|
|
6
|
-
"arrow-up": () =>
|
|
7
|
-
"list-checks": () =>
|
|
8
|
-
"message-square": () =>
|
|
9
|
-
map: () =>
|
|
10
|
-
"user-round": () =>
|
|
11
|
-
"notebook-tabs": () =>
|
|
12
|
-
"refresh-cw": () =>
|
|
13
|
-
paperclip: () =>
|
|
14
|
-
"arrow-down": () =>
|
|
15
|
-
"arrow-left": () =>
|
|
16
|
-
"arrow-right": () =>
|
|
17
|
-
"arrow-up-right": () =>
|
|
18
|
-
"file-text": () =>
|
|
19
|
-
file: () =>
|
|
20
|
-
folder: () =>
|
|
21
|
-
"folder-open": () =>
|
|
22
|
-
copy: () =>
|
|
23
|
-
x: () =>
|
|
24
|
-
"chevron-down": () =>
|
|
25
|
-
"chevron-left": () =>
|
|
26
|
-
"chevron-right": () =>
|
|
27
|
-
"chevron-up": () =>
|
|
28
|
-
search: () =>
|
|
29
|
-
plus: () =>
|
|
30
|
-
minus: () =>
|
|
31
|
-
"panel-left": () =>
|
|
32
|
-
list: () =>
|
|
33
|
-
network: () =>
|
|
34
|
-
"external-link": () =>
|
|
35
|
-
brain: () =>
|
|
36
|
-
eye: () =>
|
|
37
|
-
wrench: () =>
|
|
38
|
-
"loader-circle": () =>
|
|
39
|
-
square: () =>
|
|
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[];
|