meowtail 0.1.0 → 0.2.0-alpha.0
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 +117 -0
- package/ASSISTANT.md +21 -1
- package/JSON.md +8 -1
- package/README.md +109 -8
- package/dist/src/chat/assistant-composer.js +3 -5
- package/dist/src/chat/assistant-content.d.ts +2 -0
- package/dist/src/chat/assistant-content.js +51 -3
- package/dist/src/chat/assistant-types.d.ts +39 -1
- package/dist/src/chat/assistant.d.ts +1 -1
- package/dist/src/chat/assistant.js +6 -3
- package/dist/src/chat/conversation.d.ts +4 -1
- package/dist/src/chat/conversation.js +5 -2
- package/dist/src/chat/index.d.ts +4 -2
- package/dist/src/chat/index.js +1 -0
- package/dist/src/chat/task.d.ts +29 -0
- package/dist/src/chat/task.js +53 -0
- package/dist/src/chat/tool-call.d.ts +33 -8
- package/dist/src/chat/tool-call.js +70 -26
- package/dist/src/components/grid.js +1 -0
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/index.js +1 -0
- package/dist/src/components/inline.js +1 -0
- package/dist/src/components/layout-item.js +2 -1
- package/dist/src/components/layout-types.d.ts +1 -1
- package/dist/src/components/menu.js +5 -5
- package/dist/src/components/output-block.d.ts +5 -3
- package/dist/src/components/output-block.js +32 -22
- package/dist/src/components/stack.js +1 -0
- package/dist/src/components/status.d.ts +16 -0
- package/dist/src/components/status.js +8 -0
- package/dist/src/json/catalog.d.ts +88 -2
- package/dist/src/json/catalog.js +33 -1
- package/dist/src/registry/index.d.ts +17 -2
- package/dist/src/registry/index.js +6 -1
- package/dist/src/shared/execution-state.d.ts +7 -0
- package/dist/src/shared/execution-state.js +36 -0
- package/dist/src/theme/base.styles.js +15 -0
- package/dist/src/theme/chat/assistant.styles.js +21 -9
- package/dist/src/theme/chat/composer.styles.js +2 -1
- package/dist/src/theme/chat/conversation.styles.js +15 -7
- package/dist/src/theme/chat/records.styles.js +79 -7
- package/dist/src/theme/chat/task.styles.d.ts +1 -0
- package/dist/src/theme/chat/task.styles.js +87 -0
- package/dist/src/theme/components/card.styles.js +9 -3
- package/dist/src/theme/components/field.styles.js +4 -0
- package/dist/src/theme/components/list-group.styles.js +9 -11
- package/dist/src/theme/components/output-block.styles.js +8 -0
- package/dist/src/theme/components/resource-card.styles.js +8 -3
- package/dist/src/theme/components/status.styles.d.ts +1 -0
- package/dist/src/theme/components/status.styles.js +25 -0
- package/dist/src/theme/index.d.ts +148 -0
- package/dist/src/theme/index.js +165 -159
- package/dist/src/theme/shared/code-highlight.styles.js +1 -1
- package/package.json +12 -6
package/dist/src/json/catalog.js
CHANGED
|
@@ -20,6 +20,8 @@ const step = s.object({
|
|
|
20
20
|
tone: optional(tone),
|
|
21
21
|
});
|
|
22
22
|
const steps = s.array(step);
|
|
23
|
+
const executionState = s.enum("queued", "running", "waiting", "success", "error", "cancelled", "unknown", "complete");
|
|
24
|
+
const taskProgress = s.object({ value: s.number(), max: s.number(), label: s.string() });
|
|
23
25
|
const part = s.union(s.object({ id: s.string(), kind: s.enum("text"), text: s.string() }), s.object({
|
|
24
26
|
id: s.string(),
|
|
25
27
|
kind: s.enum("code"),
|
|
@@ -32,7 +34,34 @@ const part = s.union(s.object({ id: s.string(), kind: s.enum("text"), text: s.st
|
|
|
32
34
|
statusText: optional(s.string()),
|
|
33
35
|
steps,
|
|
34
36
|
defaultOpen: optional(s.boolean()),
|
|
35
|
-
}), s.object({ id: s.string(), kind: s.enum("attachments"), items: s.array(attachment) })
|
|
37
|
+
}), s.object({ id: s.string(), kind: s.enum("attachments"), items: s.array(attachment) }), s.object({
|
|
38
|
+
id: s.string(),
|
|
39
|
+
kind: s.enum("tool"),
|
|
40
|
+
label: s.string(),
|
|
41
|
+
summary: optional(s.string()),
|
|
42
|
+
state: optional(executionState),
|
|
43
|
+
statusLabel: optional(s.string()),
|
|
44
|
+
input: optional(s.string()),
|
|
45
|
+
output: optional(s.string()),
|
|
46
|
+
outputSummary: optional(s.string()),
|
|
47
|
+
maxLines: optional(s.number()),
|
|
48
|
+
defaultOpen: optional(s.boolean()),
|
|
49
|
+
canRetry: optional(s.boolean()),
|
|
50
|
+
canCancel: optional(s.boolean()),
|
|
51
|
+
retryDisabled: optional(s.boolean()),
|
|
52
|
+
cancelDisabled: optional(s.boolean()),
|
|
53
|
+
}), s.object({
|
|
54
|
+
id: s.string(),
|
|
55
|
+
kind: s.enum("task"),
|
|
56
|
+
title: s.string(),
|
|
57
|
+
state: executionState,
|
|
58
|
+
statusLabel: optional(s.string()),
|
|
59
|
+
description: optional(s.string()),
|
|
60
|
+
executionText: optional(s.string()),
|
|
61
|
+
replyText: optional(s.string()),
|
|
62
|
+
progress: optional(taskProgress),
|
|
63
|
+
steps: optional(steps),
|
|
64
|
+
}));
|
|
36
65
|
const message = s.object({
|
|
37
66
|
id: s.string(),
|
|
38
67
|
role: s.enum("user", "assistant", "system", "tool"),
|
|
@@ -85,6 +114,8 @@ export const assistantJsonSchemas = Object.freeze({
|
|
|
85
114
|
work,
|
|
86
115
|
question,
|
|
87
116
|
choice,
|
|
117
|
+
executionState,
|
|
118
|
+
taskProgress,
|
|
88
119
|
});
|
|
89
120
|
const value = (schema) => ({ kind: "value", schema });
|
|
90
121
|
const binding = (schema) => ({
|
|
@@ -121,6 +152,7 @@ const assistant = defineJsonComponent(AssistantView, {
|
|
|
121
152
|
onReasoningChange: action(s.string()),
|
|
122
153
|
onAnswer: action(s.string(), s.string()),
|
|
123
154
|
onDismissQuestion: action(s.string()),
|
|
155
|
+
onToolAction: action(s.string(), s.string(), s.enum("retry", "cancel")),
|
|
124
156
|
onRefreshWork: action(s.string()),
|
|
125
157
|
onLoadOlder: action(),
|
|
126
158
|
loadingOlder: binding(s.boolean()),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { chatTaskContract } from "../chat/task.js";
|
|
1
2
|
import { type Runtime, type RuntimePlugin } from "meowjsx";
|
|
2
3
|
import { pageFrameContract } from "../components/page-frame.js";
|
|
3
4
|
import { regionLayoutContract } from "../components/region-layout.js";
|
|
@@ -6,7 +7,7 @@ import { segmentedControlContract, textShimmerContract, riskConfirmationContract
|
|
|
6
7
|
import { menuContract, toastContract } from "../components/index.js";
|
|
7
8
|
import { outputBlockContract } from "../components/output-block.js";
|
|
8
9
|
import { terminalBlockContract, readBlockContract, diffBlockContract, searchBlockContract } from "../components/index.js";
|
|
9
|
-
import { codeBlockContract, itemContract, fieldGroupContract, tabsContract, breadcrumbContract, alertContract, skeletonBoundaryContract, spinnerContract, descriptionListContract, descriptionItemContract, tooltipContract, buttonContract, dialogHeaderContract, dialogPanelContract, emptyStateContract, fieldContract, iconButtonContract, toolbarContract, checkboxContract, switchContract, choiceSelectContract, choiceGroupContract, popoverContract, searchInputContract, pathPickerContract, disclosureContract, navItemContract, statusDotContract, tagContract, processGroupContract, processStepContract, workCardContract, iconRailContract, railItemContract, railSectionContract, detailSectionContract, timelineContract, timelineItemContract, resourceLinkContract, pageHeaderContract, windowTitleBarContract, listGroupContract, listRowContract, resourceCardContract, drawerContract } from "../components/index.js";
|
|
10
|
+
import { codeBlockContract, itemContract, fieldGroupContract, tabsContract, breadcrumbContract, alertContract, skeletonBoundaryContract, spinnerContract, descriptionListContract, descriptionItemContract, tooltipContract, buttonContract, dialogHeaderContract, dialogPanelContract, emptyStateContract, fieldContract, iconButtonContract, toolbarContract, checkboxContract, switchContract, choiceSelectContract, choiceGroupContract, popoverContract, searchInputContract, pathPickerContract, disclosureContract, navItemContract, statusDotContract, statusContract, tagContract, processGroupContract, processStepContract, workCardContract, iconRailContract, railItemContract, railSectionContract, detailSectionContract, timelineContract, timelineItemContract, resourceLinkContract, pageHeaderContract, windowTitleBarContract, listGroupContract, listRowContract, resourceCardContract, drawerContract } from "../components/index.js";
|
|
10
11
|
import { assistantViewContract, chatBubbleContract, chatConversationContract, chatAttachmentsContract, chatProcessContract, chatQuestionContract, chatSourcesContract, chatComposerContract, chatHeaderContract, chatMessageContract, chatMessageListContract, chatStatusContract, chatToolCallContract } from "../chat/index.js";
|
|
11
12
|
import { assistantStepsContract } from "../chat/assistant-content.js";
|
|
12
13
|
import { assistantMarkdownContract } from "../chat/assistant-markdown.js";
|
|
@@ -95,7 +96,9 @@ export declare const MeowUIComponent: {
|
|
|
95
96
|
readonly ChatMessageActions: "chat-message-actions";
|
|
96
97
|
readonly ChatComposer: "chat-composer";
|
|
97
98
|
readonly ChatToolCall: "chat-tool-call";
|
|
99
|
+
readonly ChatTask: "chat-task";
|
|
98
100
|
readonly StatusDot: "status-dot";
|
|
101
|
+
readonly Status: "status";
|
|
99
102
|
readonly Tag: "tag";
|
|
100
103
|
readonly ProcessGroup: "process-group";
|
|
101
104
|
readonly ProcessStep: "process-step";
|
|
@@ -441,13 +444,19 @@ export declare const meowUIComponents: readonly [{
|
|
|
441
444
|
}>>;
|
|
442
445
|
}, {
|
|
443
446
|
readonly name: "chat-tool-call";
|
|
444
|
-
readonly parts: readonly ["root", "header", "icon", "label", "summary", "status", "chevron", "detail", "body"];
|
|
447
|
+
readonly parts: readonly ["root", "header", "icon", "label", "summary", "status", "chevron", "detail", "body", "input", "output", "outputSummary", "actions"];
|
|
448
|
+
}, {
|
|
449
|
+
readonly name: "chat-task";
|
|
450
|
+
readonly parts: readonly ["root", "header", "title", "status", "description", "execution", "reply", "progress", "progressLabel", "progressBar", "body", "footer"];
|
|
445
451
|
}, {
|
|
446
452
|
readonly name: "status-dot";
|
|
447
453
|
readonly parts: readonly ["root"];
|
|
448
454
|
readonly styleProps: import("meowcss/meowjsx").StylePropsBinding<import("meowcss").Options<{
|
|
449
455
|
readonly state: readonly ["processing", "success", "returned", "warning", "danger", "unknown", "idle"];
|
|
450
456
|
}>>;
|
|
457
|
+
}, {
|
|
458
|
+
readonly name: "status";
|
|
459
|
+
readonly parts: readonly ["root", "label"];
|
|
451
460
|
}, {
|
|
452
461
|
readonly name: "tag";
|
|
453
462
|
readonly parts: readonly ["root"];
|
|
@@ -767,9 +776,15 @@ declare module "meowjsx" {
|
|
|
767
776
|
"chat-tool-call": {
|
|
768
777
|
parts: (typeof chatToolCallContract.parts)[number];
|
|
769
778
|
};
|
|
779
|
+
"chat-task": {
|
|
780
|
+
parts: (typeof chatTaskContract.parts)[number];
|
|
781
|
+
};
|
|
770
782
|
"status-dot": {
|
|
771
783
|
parts: (typeof statusDotContract.parts)[number];
|
|
772
784
|
};
|
|
785
|
+
status: {
|
|
786
|
+
parts: (typeof statusContract.parts)[number];
|
|
787
|
+
};
|
|
773
788
|
tag: {
|
|
774
789
|
parts: (typeof tagContract.parts)[number];
|
|
775
790
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { chatTaskContract } from "../chat/task.js";
|
|
1
2
|
import { defaultRuntime } from "meowjsx";
|
|
2
3
|
import { pillContract } from "../components/pill.js";
|
|
3
4
|
import { pageFrameContract } from "../components/page-frame.js";
|
|
@@ -8,7 +9,7 @@ import { segmentedControlContract, textShimmerContract, riskConfirmationContract
|
|
|
8
9
|
import { menuContract, toastContract } from "../components/index.js";
|
|
9
10
|
import { outputBlockContract } from "../components/output-block.js";
|
|
10
11
|
import { terminalBlockContract, readBlockContract, diffBlockContract, searchBlockContract, } from "../components/index.js";
|
|
11
|
-
import { codeBlockContract, itemContract, fieldGroupContract, tabsContract, breadcrumbContract, alertContract, skeletonContract, skeletonBoundaryContract, spinnerContract, stackContract, layoutItemContract, descriptionListContract, descriptionItemContract, inlineContract, gridContract, containerContract, cardHeaderContract, cardTitleContract, cardDescriptionContract, cardContentContract, cardFooterContract, cardActionContract, aspectRatioContract, tooltipContract, badgeContract, buttonContract, cardContract, dialogActionsContract, dialogContract, dialogHeaderContract, dialogPanelContract, emptyStateContract, fieldContract, iconButtonContract, toolbarContract, inputContract, checkboxContract, switchContract, selectContract, choiceSelectContract, choiceGroupContract, popoverContract, searchInputContract, pathPickerContract, disclosureContract, navItemContract, separatorContract, textareaContract, statusDotContract, tagContract, processGroupContract, processStepContract, workCardContract, iconRailContract, railItemContract, railSectionContract, detailSectionContract, timelineContract, timelineItemContract, resourceLinkContract, pageHeaderContract, windowTitleBarContract, listGroupContract, listRowContract, resourceCardContract, drawerContract, } from "../components/index.js";
|
|
12
|
+
import { codeBlockContract, itemContract, fieldGroupContract, tabsContract, breadcrumbContract, alertContract, skeletonContract, skeletonBoundaryContract, spinnerContract, stackContract, layoutItemContract, descriptionListContract, descriptionItemContract, inlineContract, gridContract, containerContract, cardHeaderContract, cardTitleContract, cardDescriptionContract, cardContentContract, cardFooterContract, cardActionContract, aspectRatioContract, tooltipContract, badgeContract, buttonContract, cardContract, dialogActionsContract, dialogContract, dialogHeaderContract, dialogPanelContract, emptyStateContract, fieldContract, iconButtonContract, toolbarContract, inputContract, checkboxContract, switchContract, selectContract, choiceSelectContract, choiceGroupContract, popoverContract, searchInputContract, pathPickerContract, disclosureContract, navItemContract, separatorContract, textareaContract, statusDotContract, statusContract, tagContract, processGroupContract, processStepContract, workCardContract, iconRailContract, railItemContract, railSectionContract, detailSectionContract, timelineContract, timelineItemContract, resourceLinkContract, pageHeaderContract, windowTitleBarContract, listGroupContract, listRowContract, resourceCardContract, drawerContract, } from "../components/index.js";
|
|
12
13
|
import { assistantViewContract, chatBubbleContract, chatConversationContract, chatAttachmentsContract, chatProcessContract, chatQuestionContract, chatSourcesContract, chatComposerContract, chatFrameContract, chatHeaderContract, chatMessageActionsContract, chatMessageContract, chatMessageListContract, chatStatusContract, chatToolCallContract, } from "../chat/index.js";
|
|
13
14
|
import { assistantStepsContract } from "../chat/assistant-content.js";
|
|
14
15
|
import { assistantMarkdownContract } from "../chat/assistant-markdown.js";
|
|
@@ -97,7 +98,9 @@ export const MeowUIComponent = {
|
|
|
97
98
|
ChatMessageActions: chatMessageActionsContract.name,
|
|
98
99
|
ChatComposer: chatComposerContract.name,
|
|
99
100
|
ChatToolCall: chatToolCallContract.name,
|
|
101
|
+
ChatTask: chatTaskContract.name,
|
|
100
102
|
StatusDot: statusDotContract.name,
|
|
103
|
+
Status: statusContract.name,
|
|
101
104
|
Tag: tagContract.name,
|
|
102
105
|
ProcessGroup: processGroupContract.name,
|
|
103
106
|
ProcessStep: processStepContract.name,
|
|
@@ -208,7 +211,9 @@ export const meowUIComponents = [
|
|
|
208
211
|
chatMessageActionsContract,
|
|
209
212
|
chatComposerContract,
|
|
210
213
|
chatToolCallContract,
|
|
214
|
+
chatTaskContract,
|
|
211
215
|
statusDotContract,
|
|
216
|
+
statusContract,
|
|
212
217
|
tagContract,
|
|
213
218
|
processGroupContract,
|
|
214
219
|
processStepContract,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { StatusDotState } from "../components/status-dot.js";
|
|
2
|
+
/** Display facts supplied by the host. Completion never implies that a public reply was sent. */
|
|
3
|
+
export type ChatExecutionState = "queued" | "running" | "waiting" | "success" | "error" | "cancelled" | "unknown"
|
|
4
|
+
/** Compatibility spelling for a successful tool execution. */
|
|
5
|
+
| "complete";
|
|
6
|
+
export declare function executionStateLabel(state: ChatExecutionState): string;
|
|
7
|
+
export declare function executionStateTone(state: ChatExecutionState): StatusDotState;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export function executionStateLabel(state) {
|
|
2
|
+
switch (state) {
|
|
3
|
+
case "queued":
|
|
4
|
+
return "排队中";
|
|
5
|
+
case "running":
|
|
6
|
+
return "运行中";
|
|
7
|
+
case "waiting":
|
|
8
|
+
return "等待中";
|
|
9
|
+
case "error":
|
|
10
|
+
return "出错";
|
|
11
|
+
case "cancelled":
|
|
12
|
+
return "已取消";
|
|
13
|
+
case "unknown":
|
|
14
|
+
return "结果未确认";
|
|
15
|
+
default:
|
|
16
|
+
return "已完成";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function executionStateTone(state) {
|
|
20
|
+
switch (state) {
|
|
21
|
+
case "queued":
|
|
22
|
+
case "cancelled":
|
|
23
|
+
return "idle";
|
|
24
|
+
case "running":
|
|
25
|
+
return "processing";
|
|
26
|
+
case "waiting":
|
|
27
|
+
return "warning";
|
|
28
|
+
case "error":
|
|
29
|
+
return "danger";
|
|
30
|
+
case "success":
|
|
31
|
+
case "complete":
|
|
32
|
+
return "success";
|
|
33
|
+
default:
|
|
34
|
+
return "unknown";
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -10,6 +10,21 @@ export const cornerShapeStyles = css `
|
|
|
10
10
|
}
|
|
11
11
|
`;
|
|
12
12
|
export const baseStyles = css `
|
|
13
|
+
/* Establish UI typography at an entry root without resetting an author's
|
|
14
|
+
typography when a nested region changes its theme or appearance. */
|
|
15
|
+
:where([data-meowui-theme-root="meowui"]:not([data-meowui-theme-root] *)) {
|
|
16
|
+
font-family: ${uiTokens.font};
|
|
17
|
+
font-size: ${uiTokens.fontBody};
|
|
18
|
+
line-height: ${uiTokens.leading};
|
|
19
|
+
}
|
|
20
|
+
/* Unlike typography, ink must resolve again at a local appearance boundary. */
|
|
21
|
+
:where(
|
|
22
|
+
[data-meowui-theme-root="meowui"],
|
|
23
|
+
[data-meowui-theme-root="meowui"]
|
|
24
|
+
[data-meowui-scope]:not([data-meowui-theme-root]:not([data-meowui-theme-root="meowui"]))
|
|
25
|
+
) {
|
|
26
|
+
color: ${uiTokens.foreground};
|
|
27
|
+
}
|
|
13
28
|
:where([data-meowui-theme-root="meowui"]) {
|
|
14
29
|
-webkit-font-smoothing: antialiased;
|
|
15
30
|
-moz-osx-font-smoothing: grayscale;
|
|
@@ -9,6 +9,7 @@ import { chatHeaderContract } from "../../chat/header.js";
|
|
|
9
9
|
import { pageFrameContract } from "../../components/page-frame.js";
|
|
10
10
|
import { chatComposerContract } from "../../chat/composer.js";
|
|
11
11
|
import { workCardContract } from "../../components/work-card.js";
|
|
12
|
+
import { buttonContract } from "../../components/button.js";
|
|
12
13
|
const root = partSelector(assistantViewContract, "root");
|
|
13
14
|
const layout = partSelector(assistantViewContract, "layout");
|
|
14
15
|
const messages = partSelector(assistantViewContract, "messages");
|
|
@@ -49,11 +50,15 @@ export const assistantStyles = css `
|
|
|
49
50
|
${messages} {
|
|
50
51
|
grid-area: messages;
|
|
51
52
|
position: relative;
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: column;
|
|
52
55
|
min-height: 0;
|
|
53
56
|
min-width: 0;
|
|
54
57
|
}
|
|
55
58
|
${viewport} {
|
|
56
|
-
|
|
59
|
+
flex: 1 1 0;
|
|
60
|
+
min-height: 0;
|
|
61
|
+
min-width: 0;
|
|
57
62
|
overflow-y: auto;
|
|
58
63
|
overflow-anchor: none;
|
|
59
64
|
overscroll-behavior-y: contain;
|
|
@@ -120,13 +125,20 @@ export const assistantStyles = css `
|
|
|
120
125
|
color: ${uiTokens.info};
|
|
121
126
|
}
|
|
122
127
|
${partSelector(assistantViewContract, "latest")} {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
display: flex;
|
|
129
|
+
justify-content: flex-end;
|
|
130
|
+
flex-shrink: 0;
|
|
131
|
+
width: 100%;
|
|
132
|
+
max-width: ${uiTokens.containerContent};
|
|
133
|
+
margin-inline: auto;
|
|
134
|
+
padding: ${uiTokens.spaceGroup} ${uiTokens.spacePanel};
|
|
135
|
+
box-sizing: border-box;
|
|
136
|
+
}
|
|
137
|
+
${partSelector(assistantViewContract, "latest")} > ${partSelector(buttonContract, "root")} {
|
|
138
|
+
min-width: 0;
|
|
139
|
+
max-width: 100%;
|
|
140
|
+
white-space: normal;
|
|
141
|
+
overflow-wrap: anywhere;
|
|
130
142
|
}
|
|
131
143
|
${composer} {
|
|
132
144
|
grid-area: composer;
|
|
@@ -280,7 +292,7 @@ export const assistantStyles = css `
|
|
|
280
292
|
padding-inline: ${uiTokens.pageInsetCompactInline};
|
|
281
293
|
}
|
|
282
294
|
${partSelector(assistantViewContract, "latest")} {
|
|
283
|
-
|
|
295
|
+
padding-inline: ${uiTokens.pageInsetCompactInline};
|
|
284
296
|
}
|
|
285
297
|
}
|
|
286
298
|
${root} {
|
|
@@ -95,7 +95,8 @@ export const chatComposerStyles = css `
|
|
|
95
95
|
border-radius: ${radiusTokens.float};
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
/* The frame owns its direct writing surface; a footer or card owns its own inset. */
|
|
99
|
+
${partSelector(chatFrameContract, "root")} > ${partSelector(chatComposerContract, "root")} {
|
|
99
100
|
flex: 0 0 auto;
|
|
100
101
|
box-sizing: border-box;
|
|
101
102
|
width: calc(100% - 2 * ${chatTokens.readingInset});
|
|
@@ -4,11 +4,17 @@ import { chatConversationContract } from "../../chat/conversation.js";
|
|
|
4
4
|
export const chatConversationStyles = css `
|
|
5
5
|
${partSelector(chatConversationContract, "root")} {
|
|
6
6
|
position: relative;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
7
9
|
min-height: 0;
|
|
10
|
+
min-width: 0;
|
|
8
11
|
font-family: ${uiTokens.font};
|
|
9
12
|
font-size: ${uiTokens.fontBody};
|
|
10
13
|
}
|
|
11
14
|
${partSelector(chatConversationContract, "viewport")} {
|
|
15
|
+
flex: 1 1 0;
|
|
16
|
+
min-height: 0;
|
|
17
|
+
min-width: 0;
|
|
12
18
|
scrollbar-gutter: stable;
|
|
13
19
|
overscroll-behavior-y: contain;
|
|
14
20
|
}
|
|
@@ -16,17 +22,19 @@ export const chatConversationStyles = css `
|
|
|
16
22
|
outline: 2px solid ${uiTokens.focus};
|
|
17
23
|
outline-offset: -2px;
|
|
18
24
|
}
|
|
19
|
-
${partSelector(chatConversationContract, "content")} {
|
|
20
|
-
padding-bottom: calc(${uiTokens.spaceGroup} + ${uiTokens.controlHeight});
|
|
21
|
-
}
|
|
22
25
|
${partSelector(chatConversationContract, "latest")} {
|
|
23
26
|
display: inline-flex;
|
|
24
27
|
align-items: center;
|
|
25
28
|
gap: 6px;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
flex-shrink: 0;
|
|
30
|
+
align-self: flex-end;
|
|
31
|
+
justify-self: end;
|
|
32
|
+
width: fit-content;
|
|
33
|
+
min-width: 0;
|
|
34
|
+
max-width: calc(100% - 2 * ${uiTokens.spaceSection});
|
|
35
|
+
margin: ${uiTokens.spaceGroup} ${uiTokens.spaceSection};
|
|
36
|
+
white-space: normal;
|
|
37
|
+
overflow-wrap: anywhere;
|
|
30
38
|
min-height: 34px;
|
|
31
39
|
padding: 0 ${uiTokens.controlPaddingInline};
|
|
32
40
|
box-sizing: border-box;
|
|
@@ -4,6 +4,7 @@ import { accentTokens } from "../palette.js";
|
|
|
4
4
|
import { chatProcessContract } from "../../chat/process.js";
|
|
5
5
|
import { chatSourcesContract } from "../../chat/sources.js";
|
|
6
6
|
import { chatToolCallContract } from "../../chat/tool-call.js";
|
|
7
|
+
import { outputBlockContract } from "../../components/output-block.js";
|
|
7
8
|
/** How far the chat type scale sits above the 14px body the row metrics were drawn at. */
|
|
8
9
|
const rowDelta = "--chat-row-delta";
|
|
9
10
|
/** Where a row's label begins; anything the row owns rather than sits beside starts here. */
|
|
@@ -68,6 +69,8 @@ export const chatRecordsStyles = css `
|
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
${partSelector(chatToolCallContract, "root")} {
|
|
72
|
+
container-type: inline-size;
|
|
73
|
+
min-width: 0;
|
|
71
74
|
display: grid;
|
|
72
75
|
gap: 0;
|
|
73
76
|
margin-top: 0;
|
|
@@ -92,8 +95,10 @@ export const chatRecordsStyles = css `
|
|
|
92
95
|
}
|
|
93
96
|
|
|
94
97
|
${partSelector(chatToolCallContract, "status")} {
|
|
95
|
-
flex: 0
|
|
96
|
-
white-space:
|
|
98
|
+
flex: 0 1 auto;
|
|
99
|
+
white-space: normal;
|
|
100
|
+
overflow-wrap: anywhere;
|
|
101
|
+
min-width: 0;
|
|
97
102
|
margin-left: 2px;
|
|
98
103
|
color: ${uiTokens.mutedForeground};
|
|
99
104
|
font-size: ${uiTokens.fontCaption};
|
|
@@ -107,9 +112,9 @@ export const chatRecordsStyles = css `
|
|
|
107
112
|
font-weight: 400;
|
|
108
113
|
}
|
|
109
114
|
|
|
110
|
-
/*
|
|
115
|
+
/* Both the action and its target can yield to long state facts in constrained containers. */
|
|
111
116
|
${partSelector(chatToolCallContract, "header")}:has(> ${partSelector(chatToolCallContract, "summary")}) > ${partSelector(chatToolCallContract, "label")} {
|
|
112
|
-
flex-shrink:
|
|
117
|
+
flex-shrink: 1;
|
|
113
118
|
}
|
|
114
119
|
|
|
115
120
|
${partSelector(chatToolCallContract, "root")}[data-tool-state="error"] ${partSelector(chatToolCallContract, "status")} {
|
|
@@ -141,6 +146,31 @@ export const chatRecordsStyles = css `
|
|
|
141
146
|
margin-inline-start: var(${rowIndent});
|
|
142
147
|
}
|
|
143
148
|
|
|
149
|
+
${partSelector(chatToolCallContract, "body")} {
|
|
150
|
+
display: grid;
|
|
151
|
+
gap: ${uiTokens.spaceGroup};
|
|
152
|
+
overflow-wrap: anywhere;
|
|
153
|
+
}
|
|
154
|
+
${partSelector(chatToolCallContract, "root")} [hidden] {
|
|
155
|
+
display: none;
|
|
156
|
+
}
|
|
157
|
+
${partSelector(chatToolCallContract, "outputSummary")} {
|
|
158
|
+
margin: 0;
|
|
159
|
+
color: ${uiTokens.foreground};
|
|
160
|
+
}
|
|
161
|
+
${partSelector(chatToolCallContract, "actions")} {
|
|
162
|
+
display: flex;
|
|
163
|
+
flex-wrap: wrap;
|
|
164
|
+
align-items: center;
|
|
165
|
+
gap: ${uiTokens.spaceGroup};
|
|
166
|
+
}
|
|
167
|
+
${partSelector(chatToolCallContract, "input")} ${partSelector(outputBlockContract, "body")},
|
|
168
|
+
${partSelector(chatToolCallContract, "output")} ${partSelector(outputBlockContract, "body")} {
|
|
169
|
+
max-height: 24rem;
|
|
170
|
+
}
|
|
171
|
+
${partSelector(chatToolCallContract, "root")}[data-tool-state="success"] ${partSelector(chatToolCallContract, "status")} {
|
|
172
|
+
color: ${uiTokens.success};
|
|
173
|
+
}
|
|
144
174
|
${partSelector(chatToolCallContract, "root")}[data-tool-state="running"] {
|
|
145
175
|
color: ${uiTokens.subtleForeground};
|
|
146
176
|
}
|
|
@@ -317,8 +347,8 @@ export const chatRecordsStyles = css `
|
|
|
317
347
|
${partSelector(chatToolCallContract, "root")}[data-tool-interactive="true"] ${partSelector(chatToolCallContract, "status")} {
|
|
318
348
|
margin-left: 2px;
|
|
319
349
|
font-size: ${uiTokens.fontCaption};
|
|
320
|
-
white-space:
|
|
321
|
-
flex-shrink:
|
|
350
|
+
white-space: normal;
|
|
351
|
+
flex-shrink: 1;
|
|
322
352
|
}
|
|
323
353
|
|
|
324
354
|
${partSelector(chatToolCallContract, "root")}[data-tool-state="error"][data-tool-interactive="true"] ${partSelector(chatToolCallContract, "status")} {
|
|
@@ -357,7 +387,7 @@ export const chatRecordsStyles = css `
|
|
|
357
387
|
overflow: hidden;
|
|
358
388
|
text-overflow: ellipsis;
|
|
359
389
|
white-space: nowrap;
|
|
360
|
-
flex: 1 1
|
|
390
|
+
flex: 1 1 0;
|
|
361
391
|
color: inherit;
|
|
362
392
|
}
|
|
363
393
|
|
|
@@ -382,6 +412,48 @@ export const chatRecordsStyles = css `
|
|
|
382
412
|
white-space: nowrap;
|
|
383
413
|
}
|
|
384
414
|
|
|
415
|
+
/* A narrow host gives each fact a readable line instead of making two thin text columns. */
|
|
416
|
+
@container (max-width: 400px) {
|
|
417
|
+
${partSelector(chatToolCallContract, "header")} {
|
|
418
|
+
display: grid;
|
|
419
|
+
grid-template-columns: calc(${uiTokens.iconSize} + var(${rowDelta}, 0px)) minmax(0, 1fr);
|
|
420
|
+
align-items: start;
|
|
421
|
+
row-gap: 0;
|
|
422
|
+
}
|
|
423
|
+
${partSelector(chatToolCallContract, "icon")} {
|
|
424
|
+
grid-column: 1;
|
|
425
|
+
grid-row: 1;
|
|
426
|
+
align-self: start;
|
|
427
|
+
margin-block-start: calc(
|
|
428
|
+
(
|
|
429
|
+
(${chatTokens.rowLine} + var(${rowDelta}, 0px)) -
|
|
430
|
+
(${uiTokens.iconSize} + var(${rowDelta}, 0px))
|
|
431
|
+
) /
|
|
432
|
+
2
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
${partSelector(chatToolCallContract, "label")},
|
|
436
|
+
${partSelector(chatToolCallContract, "summary")},
|
|
437
|
+
${partSelector(chatToolCallContract, "status")} {
|
|
438
|
+
grid-column: 2;
|
|
439
|
+
margin-inline-start: 0;
|
|
440
|
+
}
|
|
441
|
+
${partSelector(chatToolCallContract, "root")}[data-tool-interactive="true"] ${partSelector(chatToolCallContract, "chevron")} {
|
|
442
|
+
inset-block: auto;
|
|
443
|
+
top: calc(
|
|
444
|
+
(
|
|
445
|
+
(${chatTokens.rowLine} + var(${rowDelta}, 0px)) -
|
|
446
|
+
(${uiTokens.iconSize} + var(${rowDelta}, 0px))
|
|
447
|
+
) /
|
|
448
|
+
2
|
|
449
|
+
);
|
|
450
|
+
margin-block: 0;
|
|
451
|
+
}
|
|
452
|
+
${partSelector(chatToolCallContract, "summary")}::before {
|
|
453
|
+
display: none;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
385
457
|
@media (pointer: coarse) {
|
|
386
458
|
${partSelector(chatProcessContract, "summary")},
|
|
387
459
|
${partSelector(chatToolCallContract, "root")}[data-tool-interactive="true"] > ${partSelector(chatToolCallContract, "header")} {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const chatTaskStyles: import("meowcss/meowjsx").CSSFragment;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { css, partSelector } from "meowcss/meowjsx";
|
|
2
|
+
import { chatTaskContract } from "../../chat/task.js";
|
|
3
|
+
import { uiTokens } from "../tokens.js";
|
|
4
|
+
const part = (name) => partSelector(chatTaskContract, name);
|
|
5
|
+
export const chatTaskStyles = css `
|
|
6
|
+
${part("root")} {
|
|
7
|
+
display: grid;
|
|
8
|
+
grid-template-columns: minmax(0, 1fr);
|
|
9
|
+
align-content: start;
|
|
10
|
+
gap: ${uiTokens.spaceGroup};
|
|
11
|
+
min-width: 0;
|
|
12
|
+
max-width: 100%;
|
|
13
|
+
color: ${uiTokens.foreground};
|
|
14
|
+
font: ${uiTokens.fontBody}/${uiTokens.leading} ${uiTokens.font};
|
|
15
|
+
overflow-wrap: anywhere;
|
|
16
|
+
}
|
|
17
|
+
${part("header")} {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-wrap: wrap;
|
|
20
|
+
align-items: baseline;
|
|
21
|
+
gap: ${uiTokens.spaceGroup} ${uiTokens.spaceSection};
|
|
22
|
+
min-width: 0;
|
|
23
|
+
}
|
|
24
|
+
${part("title")} {
|
|
25
|
+
flex: 1 1 14rem;
|
|
26
|
+
min-width: 0;
|
|
27
|
+
font-weight: 600;
|
|
28
|
+
}
|
|
29
|
+
${part("status")} {
|
|
30
|
+
display: inline-flex;
|
|
31
|
+
align-items: baseline;
|
|
32
|
+
gap: ${uiTokens.spaceGroup};
|
|
33
|
+
min-width: 0;
|
|
34
|
+
max-width: 100%;
|
|
35
|
+
color: ${uiTokens.mutedForeground};
|
|
36
|
+
font-size: ${uiTokens.fontCaption};
|
|
37
|
+
}
|
|
38
|
+
${part("status")} > :first-child {
|
|
39
|
+
flex: 0 0 auto;
|
|
40
|
+
}
|
|
41
|
+
${part("description")}, ${part("execution")}, ${part("reply")} {
|
|
42
|
+
min-width: 0;
|
|
43
|
+
margin: 0;
|
|
44
|
+
white-space: pre-wrap;
|
|
45
|
+
color: ${uiTokens.mutedForeground};
|
|
46
|
+
}
|
|
47
|
+
${part("progress")} {
|
|
48
|
+
display: grid;
|
|
49
|
+
gap: ${uiTokens.spaceGroup};
|
|
50
|
+
min-width: 0;
|
|
51
|
+
color: ${uiTokens.mutedForeground};
|
|
52
|
+
font-size: ${uiTokens.fontCaption};
|
|
53
|
+
}
|
|
54
|
+
${part("progressBar")} {
|
|
55
|
+
display: block;
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
width: 100%;
|
|
58
|
+
min-width: 0;
|
|
59
|
+
height: ${uiTokens.spaceGroup};
|
|
60
|
+
accent-color: ${uiTokens.info};
|
|
61
|
+
}
|
|
62
|
+
${part("body")} {
|
|
63
|
+
display: grid;
|
|
64
|
+
align-content: start;
|
|
65
|
+
gap: ${uiTokens.spaceSection};
|
|
66
|
+
box-sizing: border-box;
|
|
67
|
+
min-width: 0;
|
|
68
|
+
padding-inline-start: ${uiTokens.spaceSection};
|
|
69
|
+
border-inline-start: 1px solid ${uiTokens.borderSoft};
|
|
70
|
+
}
|
|
71
|
+
${part("body")} > :first-child {
|
|
72
|
+
margin-block-start: 0;
|
|
73
|
+
}
|
|
74
|
+
${part("body")} > :last-child {
|
|
75
|
+
margin-block-end: 0;
|
|
76
|
+
}
|
|
77
|
+
${part("footer")} {
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-wrap: wrap;
|
|
80
|
+
align-items: baseline;
|
|
81
|
+
gap: ${uiTokens.spaceGroup};
|
|
82
|
+
min-width: 0;
|
|
83
|
+
}
|
|
84
|
+
${part("root")} > [hidden], ${part("body")}:empty, ${part("footer")}:empty {
|
|
85
|
+
display: none;
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
@@ -40,7 +40,10 @@ ${partSelector(cardHeaderContract, "root")} {
|
|
|
40
40
|
min-width: 0;
|
|
41
41
|
}
|
|
42
42
|
:where(${partSelector(cardHeaderContract, "root")}:has(> ${partSelector(cardActionContract, "root")})) {
|
|
43
|
-
|
|
43
|
+
/* Tracks collapse at the card's own width without size containment affecting intrinsic cards. */
|
|
44
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, ${uiTokens.gridColumnNormal}), max-content));
|
|
45
|
+
grid-auto-flow: row dense;
|
|
46
|
+
justify-content: space-between;
|
|
44
47
|
}
|
|
45
48
|
:where(${partSelector(cardHeaderContract, "root")} > ${partSelector(cardTitleContract, "root")}, ${partSelector(cardHeaderContract, "root")} > ${partSelector(cardDescriptionContract, "root")}) {
|
|
46
49
|
grid-column: 1;
|
|
@@ -67,8 +70,11 @@ ${partSelector(cardActionContract, "root")} {
|
|
|
67
70
|
align-items: center;
|
|
68
71
|
}
|
|
69
72
|
:where(${partSelector(cardHeaderContract, "root")} > ${partSelector(cardActionContract, "root")}) {
|
|
70
|
-
grid-column:
|
|
71
|
-
grid-row:
|
|
73
|
+
grid-column: auto;
|
|
74
|
+
grid-row: span 2;
|
|
75
|
+
order: 1;
|
|
76
|
+
min-width: 0;
|
|
77
|
+
max-width: 100%;
|
|
72
78
|
justify-self: end;
|
|
73
79
|
}
|
|
74
80
|
${partSelector(cardContentContract, "root")} {
|
|
@@ -9,15 +9,19 @@ export const fieldStyles = css `
|
|
|
9
9
|
}
|
|
10
10
|
${partSelector(fieldContract, "root")} {
|
|
11
11
|
display: grid;
|
|
12
|
+
grid-template-columns: minmax(0, 1fr);
|
|
13
|
+
min-width: 0;
|
|
12
14
|
gap: ${uiTokens.spaceGroup};
|
|
13
15
|
}
|
|
14
16
|
${partSelector(fieldContract, "label")} {
|
|
15
17
|
font-weight: 500;
|
|
18
|
+
overflow-wrap: anywhere;
|
|
16
19
|
}
|
|
17
20
|
:where(${partSelector(fieldContract, "description")}, ${partSelector(fieldContract, "error")}) {
|
|
18
21
|
margin: 0;
|
|
19
22
|
font-size: ${uiTokens.fontCaption};
|
|
20
23
|
line-height: 1.5;
|
|
24
|
+
overflow-wrap: anywhere;
|
|
21
25
|
}
|
|
22
26
|
${partSelector(fieldContract, "description")} {
|
|
23
27
|
color: ${uiTokens.mutedForeground};
|