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
package/AGENT-COMPONENTS.md
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
# Agent
|
|
2
|
-
|
|
3
|
-
Meowtail
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
| Markdown
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
| plan / todo /
|
|
22
|
-
|
|
|
23
|
-
| error / retry / cancel / interrupt
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
| timing / usage
|
|
27
|
-
| composer
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
32
|
-
##
|
|
1
|
+
# Agent display components and composition
|
|
2
|
+
|
|
3
|
+
Meowtail is a component library, not an Agent execution framework. Tool calls, delegation, messages, permissions, networking, persistence, and real execution facts are provided by the host; components organize these facts into a readable, operable interface. What users call meowface corresponds to `meowtail` in this repository; no separate package name exists.
|
|
4
|
+
|
|
5
|
+
This round fills two high-frequency joints: extending the existing `ChatToolCall` state, lazy input/output, and resume intent; and adding `ChatTask` to present execution, public reply, and grounded progress separately. Messages, activity, questions, attachments, sources, code, and the composer continue to use existing components. No Agent-specific layout language, OpenUI runtime, streaming protocol, or other design scale was introduced.
|
|
6
|
+
|
|
7
|
+
## Capability matrix
|
|
8
|
+
|
|
9
|
+
"Existing" means the current repository already implements it, not that this round reworked it; "Added this round" means new or extended in this round; "Host / later" describes the current finite boundary.
|
|
10
|
+
|
|
11
|
+
| Lifecycle / reading task | Existing capability | Added this round | Host / later boundary |
|
|
12
|
+
| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
+
| Message role, author, time, streaming text | `ChatMessage`, `ChatMessageList`, `ChatConversation`, `AssistantView`; stable id updates messages | Assistant default parts connect tools and tasks | The host normalizes events and updates data; it does not parse server streaming protocols |
|
|
14
|
+
| Markdown and code | Assistant `text` is safe Markdown by default, `code` reuses `CodeBlock`; unknown languages stay plain text | Tool input/output are displayed separately as raw text | Tool strings are not executed as Markdown or HTML; code is not executed |
|
|
15
|
+
| Public execution summary | `ChatProcess`, `ProcessGroup/ProcessStep`, Assistant process/activity | `ChatTask` description, executionText | Display publicly shareable activity facts; do not require or assume disclosure of private model reasoning |
|
|
16
|
+
| Tool call state | `ChatToolCall`, `ChatStatus`, `StatusDot` | queued/running/waiting/success/error/cancelled/unknown; complete stays compatible | State comes from the host; success/failure is not inferred from output presence, timeouts, or lack of reply |
|
|
17
|
+
| Input, output, and long results | `ReadBlock`, `TerminalBlock`, `JsonBlock/JsonTree`, etc.; internally reuses OutputBlock | `ChatToolCall` reactive input/output/outputSummary, collapse, and full copy | `maxLines` is a display window, not data truncation; merging streaming chunks is the host's responsibility |
|
|
18
|
+
| Multimodal tool results | `ChatAttachments`, `ImagePreview/ImageLightbox`, media and resource components | Tool children keep an ordinary composition outlet | The host provides alternative descriptions, sources, and supported resources; arbitrary binary formats are not guessed |
|
|
19
|
+
| Delegation, nesting, and concurrent tasks | Assistant activity/work, `WorkCard`, shared layout and process groups | `ChatTask` and the Assistant task part | Compose trees with children and `ChatProcess`; there is no task scheduler or general tree protocol |
|
|
20
|
+
| Execution completion and reply delivery | AssistantWork already wires executionText/replyText separately | `ChatTask` and the task part are equally explicit | success can simultaneously show "public reply not received" without becoming error |
|
|
21
|
+
| plan / todo / progress | native ol/li, `ProcessGroup/ProcessStep`, Assistant steps | `ChatTask` labeled native progress | Values must have a real basis; omit them when unknown, and do not invent percentages or countdowns; the plan editor stays with the host |
|
|
22
|
+
| Waiting for users, options, and authorization display | `ChatQuestion`, `ChoiceGroup`, Assistant questions; `RiskConfirmation` when needed | Composition demos with waiting tasks | The UI does not define authorization policy; unanswered questions, replies being submitted, and execution failures are modeled separately |
|
|
23
|
+
| error / retry / cancel / interrupt | `Button variant="stop"`, feedback, Assistant readState and recovery drafts | Tool onRetry/onCancel intent and disabled states; Assistant onToolAction | Callbacks do not automatically retry or stop tasks; cancel, interrupt, retry eligibility, and concurrency conflicts are decided by the host |
|
|
24
|
+
| Cited sources | `ChatSources`, safe Markdown links, `ResourceLink` | Composition examples make source and artifact ownership explicit | The host verifies sources; tools and tasks do not search or generate citations automatically |
|
|
25
|
+
| Attachments, file artifacts, and code diffs | `ChatAttachments`, `ResourceLink`, `DiffBlock`, `CodeBlock` | Compose with task footer / Assistant local slots | No upload and no patch application; protected resource addresses and download authorization stay with the host |
|
|
26
|
+
| Metadata such as timing / usage | `DescriptionList/DescriptionItem`, `Inline`, tags | Reuse demos without adding another Agent metadata API | Numbers and times come from the host; unknown values are not shown as zero; no billing or usage calculations |
|
|
27
|
+
| composer, attachments, send, and stop | `ChatComposer`, complete Assistant draft/attachments/model/trailing; submission acceptance and draft consumption are separate | Continue reusing them; the tool cancel button is independent of send state | A streaming response does not automatically equal send pending; the host places the stop button in trailing and binds an explicit intent |
|
|
28
|
+
| Empty state, initial load, refresh failure | Assistant readState loading/ready/error, EmptyState | Tool empty strings are separate from missing results; Task defaults to unknown | refresh error keeps the read body; no data does not imply execution failure |
|
|
29
|
+
| Connection interruption and stale data | Assistant readFeedback/work feedback, explicit status text | Examples use unknown + last known output | Keep the last result and make clear "current state unknown"; reconnection and stale-time policies come from the host |
|
|
30
|
+
| Keyboard, focus, and narrow containers | native buttons/details, shared layout, Assistant reading anchors and narrow-container activity dialog | New compositions preserve expansion, long I/O, 320px local width, and nested tasks across updates | No global shortcuts; reduced motion follows the shared theme; see the receipt for the actual verification scope |
|
|
31
|
+
|
|
32
|
+
## Tool calls: separate data from execution actions
|
|
33
33
|
|
|
34
34
|
```tsx
|
|
35
35
|
import { h, signal } from "meowjsx";
|
|
@@ -40,12 +40,12 @@ const output = signal<string | undefined>(undefined);
|
|
|
40
40
|
|
|
41
41
|
const view = (
|
|
42
42
|
<ChatToolCall
|
|
43
|
-
label="
|
|
43
|
+
label="Read file"
|
|
44
44
|
summary="docs/layout.md"
|
|
45
45
|
state={state}
|
|
46
46
|
input={'{"path":"docs/layout.md"}'}
|
|
47
47
|
output={output}
|
|
48
|
-
outputSummary="
|
|
48
|
+
outputSummary="Short result provided by the host"
|
|
49
49
|
maxLines={8}
|
|
50
50
|
collapsible
|
|
51
51
|
onCancel={() => hostRequestCancel()}
|
|
@@ -53,15 +53,15 @@ const view = (
|
|
|
53
53
|
);
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
`label`
|
|
56
|
+
`label` names the action, `summary` is the short target still visible when collapsed, and `statusLabel` adds the specific progress or the object being waited for. Input/output titles, empty content, and retry/cancel text can be overridden locally through `labels`. When `input/output` is `undefined`, that section is omitted; an empty string explicitly shows empty data. While queued or running, missing output never means an error. `outputSummary` is the expanded body summary supplied by the host and is visible only while the tool body is expanded; content that must remain visible when collapsed goes in `summary`. The component does not trim, reason about, or rewrite tool results.
|
|
57
57
|
|
|
58
|
-
`maxLines`
|
|
58
|
+
`maxLines` defaults to the internally shared `OutputBlock` (no new public export); when content exceeds it, the beginning and end are kept, the middle expands through native disclosure, and copying uses the full original payload. Text I/O wraps by default; dedicated structures such as code and terminals continue to use their corresponding components. The tool's overall disclosure and the output's middle-lines disclosure keep their own expansion state separately.
|
|
59
59
|
|
|
60
|
-
`onRetry
|
|
60
|
+
`onRetry` and `onCancel` express user intent only. The component does not turn error into running on its own, does not silently drop existing results, and does not claim the task succeeded because a callback returned. The Assistant part's `canRetry/canCancel` only decide whether entries are shown and grant no execution permission; the host must still check eligibility. The host can prevent duplicate operations with reactive `retryDisabled/cancelDisabled` and must update state explicitly. When `onActivate` chooses a host navigation action, the tool row does not also toggle its internal disclosure; do not wrap the entire row button in another clickable card.
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
For compatibility with existing calls, using `ChatToolCall` alone and omitting state still follows `complete`; new calls should pass facts explicitly and use `unknown` when they are unknown. The Assistant tool part uses unknown when state is omitted, so a missing fact does not become completion. `complete` and success are both spellings of execution completion and do not mean the public reply was delivered.
|
|
63
63
|
|
|
64
|
-
##
|
|
64
|
+
## Tasks: execution, progress, and waiting are separately visible
|
|
65
65
|
|
|
66
66
|
```tsx
|
|
67
67
|
import { h } from "meowjsx";
|
|
@@ -70,48 +70,48 @@ import { Button, Inline } from "meowtail";
|
|
|
70
70
|
|
|
71
71
|
const view = (
|
|
72
72
|
<ChatTask
|
|
73
|
-
title="
|
|
73
|
+
title="Independent keyboard review"
|
|
74
74
|
state="success"
|
|
75
|
-
statusLabel="
|
|
76
|
-
executionText="
|
|
77
|
-
replyText="
|
|
78
|
-
progress={{ value: 5, max: 5, label: "
|
|
75
|
+
statusLabel="Execution succeeded · waiting for public reply"
|
|
76
|
+
executionText="Execution returned; 5 checks completed."
|
|
77
|
+
replyText="Public reply not yet received."
|
|
78
|
+
progress={{ value: 5, max: 5, label: "Checked 5 / 5 items" }}
|
|
79
79
|
footer={
|
|
80
80
|
<Inline>
|
|
81
|
-
<Button variant="outline"
|
|
81
|
+
<Button variant="outline">View review record</Button>
|
|
82
82
|
</Inline>
|
|
83
83
|
}
|
|
84
84
|
>
|
|
85
|
-
<ChatToolCall label="
|
|
85
|
+
<ChatToolCall label="Check focus order" state="success" summary="5 interaction entry points" />
|
|
86
86
|
</ChatTask>
|
|
87
87
|
);
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
`ChatTask`
|
|
90
|
+
`ChatTask` is a semantic section with state and optional content; its default state is unknown, and it is not an execution container or a whole-card button. `title/state/statusLabel/description/executionText/replyText/progress` can all be updated by Signals. `progress` accepts only finite valid numbers, requiring `0 <= value <= max` and `max > 0`, and explicitly throws otherwise; when not provided, no progress bar is shown.
|
|
91
91
|
|
|
92
|
-
waiting
|
|
92
|
+
waiting should say "who and what it is waiting for": waiting for a user option, waiting for scheduling, and waiting for an external result are different facts. queued means not yet started; running should have a current activity fact; unknown fits a state that cannot be confirmed after a connection interruption. No result, no new message, and no public reply are not automatic failure conditions.
|
|
93
93
|
|
|
94
|
-
##
|
|
94
|
+
## Composition rules
|
|
95
95
|
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
- footer
|
|
100
|
-
-
|
|
101
|
-
-
|
|
102
|
-
-
|
|
103
|
-
-
|
|
96
|
+
- Use `Stack`, `Inline`, `Grid`, and `LayoutItem` in one workspace. Parallel tasks can use `Grid columns="auto" minColumnWidth="wide"` to arrange themselves by host width; a fixed column count keeps that explicit count and does not silently become a mobile template.
|
|
97
|
+
- The parent layout allocates gaps between groups; Task owns the internal rhythm of its header/body/footer; tools own their own expanded indentation. By default, the Task body marks content ownership with a single low-contrast start edge and `spaceSection` indentation; child-task footers stay inside that boundary, and the parent-task footer returns to the parent axis, so adjacent actions are not confused. Ordinary tasks do not get an extra Card wrapper, and tool groups do not add another ring of panel padding. Nested tasks collapse low-frequency records through `ChatProcess`, so every level does not expand into a long wall.
|
|
98
|
+
- Collapse low-frequency raw results by default and keep actions, targets, states, and short results. Expand only the one or two tools currently worth reading; collapsing must not hide failures, the object being waited for, or the current activity state. The display window for long output and full copy share the same data.
|
|
99
|
+
- footer holds ordinary `Button`, `ResourceLink`, and `Inline`; the body does not align actions with spaces or `space-between`. Tool retry/cancel actions live in the expanded body; a footer placed inside collapsible content is also hidden when its ancestor collapses. A global Stop / interrupt that must always be reachable belongs outside the collapsible region in an ordinary action group or the Assistant `headerActions/composerTrailing`; do not hide it in task details. Tasks of different lengths keep their natural height; if the host needs equal-height cards, the host should allocate space explicitly rather than faking content with placeholder text.
|
|
100
|
+
- Public plans use native ol/li or process components. A Task can contain child Tasks, but the tree's ids, ordering, parent/child relationships, and permissions are still decided by the host; do not execute a task title as a program path.
|
|
101
|
+
- Visible states always have text; the status dot is only decoration. Native details, button, and progress keep their keyboard semantics; updating state does not move user focus on its own. Large output can be read with the keyboard in its own region.
|
|
102
|
+
- Tool input/output are lazy strings. Do not hand payloads to `innerHTML`, event attributes, or a script interpreter. The safe Markdown policy for Assistant default text and the tool text policy hold separately; the security of a custom `renderPart` remains the extension author's responsibility.
|
|
103
|
+
- Files, URLs, callback names, state enums, and confirmation displays by themselves grant no permissions. Cite sources with `ChatSources` or safe links and artifacts with `ResourceLink` / `ChatAttachments`; download, read, and authorization are handled by the host.
|
|
104
104
|
|
|
105
|
-
##
|
|
105
|
+
## Complete Assistant and local outlets
|
|
106
106
|
|
|
107
|
-
Assistant
|
|
107
|
+
Assistant messages add typed parts with `kind: "tool"` and `kind: "task"`. The tool part provides label/summary/state/input/output/outputSummary/maxLines/defaultOpen, action entry visibility, and disabled fields; `onToolAction(messageId, partId, "retry" | "cancel")` is handed to the host. The Task part provides a title, separate execution/reply text, progress, and optional steps. Arrays update immutably by the same stable id; the same id/kind preserves the default component instance and native expansion state, while changing kind rebuilds that part. `defaultOpen` means initially expanded, not a forced control on every message update.
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
Content beyond the default parts continues to use `renderPart`; do not replace the whole Assistant page for one kind of artifact. The complete Assistant's drafts, attachment acceptance, submission snapshots, activity details, questions, and reading anchors follow the [existing contract](ASSISTANT.md). This round also adds finite tool/task message branches and an `onToolAction` action schema to the existing `AssistantView` JSON catalog, still rendering the same components; it adds no separate `ChatTask/ChatToolCall` JSON entry, recursive task tree, or arbitrary object interpretation capability. See the [JSON contract](JSON.md) for the supported field set; network protocols and actual execution remain the host's responsibility.
|
|
110
110
|
|
|
111
|
-
Meowbook
|
|
111
|
+
Meowbook scenes:
|
|
112
112
|
|
|
113
|
-
- `agent-workflow
|
|
114
|
-
- `agent-workflow-narrow
|
|
115
|
-
- `agent-workflow-assistant
|
|
113
|
+
- `agent-workflow`: concurrent runs, queuing, waiting for the user, and successful execution without a received reply; includes nested tasks, native plans, optional metadata, artifacts, attachments, and diffs.
|
|
114
|
+
- `agent-workflow-narrow`: the same composition placed in a 320px local host inside a wide viewport, checking long Chinese and English text and paths without spaces.
|
|
115
|
+
- `agent-workflow-assistant`: default tool/task parts coexist with safe Markdown, activity, unanswered questions, attachments, sources, and the composer; buttons drive local output appends, retries, and cancellations without making external requests.
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
This page describes capabilities and usage boundaries; actual run, independent review, screenshots, and installed-state results are governed by the verification receipt for that round. Browsers, screen readers, and real backend adapters that were not run are not considered passing just because the capabilities are listed here.
|
package/ASSISTANT.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Complete Assistant composition
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Status: the new composition is implemented, and the author's local behavior regression plus independent source/page acceptance are in progress; the first-stage five-package tarball does not contain the capabilities on this page, so its installed-state pass cannot stand in for acceptance of this composition. Nothing is officially released yet, and Rossovia's consumption has not been switched.
|
|
4
4
|
|
|
5
|
-
`meowtail/chat`
|
|
5
|
+
`AssistantView` from `meowtail/chat` provides messages, safe Markdown, code, processes, inputs, attachments, model and thinking options, current activity, background work details, and unanswered questions. The default structure and visuals live in the library; the `assistant-complete` scene in Meowbook only supplies local data and actions.
|
|
6
6
|
|
|
7
7
|
```tsx
|
|
8
8
|
import { h, signal } from "meowjsx";
|
|
@@ -26,47 +26,47 @@ const view = (
|
|
|
26
26
|
);
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
The component takes a constrained height from its parent container; standard installation still needs `createMeowUI` and `standardTheme.cssText`, and does not depend on Rossovia's CSS or controller. Messages and the composer share one reading column, and the return-to-latest action anchors only to the message region. Activity appears beside the container when wide and becomes a single native modal dialog when narrow, without re-mounting messages and drafts.
|
|
30
|
+
The return-to-latest action uses normal layout flow below the message viewport; while shown it claims its natural height, and when hidden it returns that space. Historical body text is never covered by the button, and the composer still has its own region.
|
|
31
31
|
|
|
32
|
-
##
|
|
32
|
+
## Ownership of data and actions
|
|
33
33
|
|
|
34
|
-
-
|
|
35
|
-
- `onSubmit`
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
- `messages
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
- `readState="error"`
|
|
34
|
+
- When `draft` is passed, the host is the only owner and must provide `onDraftChange` or an explicit `readOnly`. The component does not write to the passed Signal directly; when `draft` is not passed, `defaultDraft` initializes the component's own temporary draft. The host owns persistence.
|
|
35
|
+
- `onSubmit` must explicitly return `{accepted: true}` to consume the submitted snapshot. Editing can continue while waiting; text with no new edits can be cleared, attachments from the original snapshot are consumed separately, and attachments added or replaced later are kept. Rejection and exceptions keep the draft and show feedback. That acceptance only means the host accepted the message; it does not mean the Agent has processed it or that the task is complete.
|
|
36
|
+
- The default file selection only keeps a `File` and preview URL locally; it does not upload, execute, or persist. When the host provides `onAttach`, it can return normalized attachments; it can also update a controlled draft directly and return null. Do not both append to the draft and return the same attachment in one callback. Preview URLs are released when the component unmounts; persisted message attachments should be replaced by the host with its own resource addresses.
|
|
37
|
+
- Hosts that only support existing serialized attachments can set `allowAttachments={false}` to remove the local file selection entry; existing attachments can still be displayed, removed, and submitted with the message. The first slice of the JSON catalog uses this explicit boundary and does not mix File into JSON drafts.
|
|
38
|
+
- `messages`, `activity`, `work`, `questions`, model and thinking options support `MaybeSignal`. Drive the view with immutable array updates. A stable `id` for the same message and part preserves its node; changing a part's `kind` rebuilds that part.
|
|
39
|
+
- Work's `statusText`, `executionText`, and `replyText` are all provided by the host; the UI does not interpret pending as running, does not treat returned as goal completion, and does not infer from execution results that a public reply has been published. The status dot only supports the corresponding text.
|
|
40
|
+
- Question state is determined by the host's `open/submitting/answered/unavailable` facts. A return from `onAnswer` does not automatically mark the question answered; exceptions keep local answers. `onDismissQuestion` only notifies the host; there is no implicit business close or retry.
|
|
41
|
+
- `readState="error"` keeps the messages already given and shows the failure; `loading`, truly empty messages, and refresh failure render separately. Work details keep the body on `error` and hide the body on `unavailable`. Authorization and data withdrawal remain the host's responsibility.
|
|
42
42
|
|
|
43
|
-
##
|
|
43
|
+
## Content and local customization
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Message `parts` include `text`, `code`, `process`, `attachments`, `tool`, and `task`. `text` is safe Markdown by default: raw HTML and images are shown as text, and only explicit HTTP, HTTPS, and mailto links navigate; code parts use the shared `CodeBlock`. Processes use native disclosure, and process steps take only normalized titles, descriptions, status text, and visual tone.
|
|
46
46
|
|
|
47
|
-
`renderPart`
|
|
47
|
+
`renderPart` can replace just one part, and returning `undefined` uses the default implementation; `renderWorkDetail` replaces only the detail body. `composerTrailing` and `headerActions` hold local controls without replacing the whole page. Custom components still consume ancestor Context in the original render tree and do not create another renderer root.
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
New default copy is centralized in `assistantCopy`; hosts can override local text with `labels={{ latest: "Back to latest", send: "Send" }}` without installing a separate internationalization runtime. Titles, statuses, and descriptions in the data are still provided by the host.
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
When the host passes historical messages, prepend them to `messages` directly, and the component keeps the visible message anchor; appending and streaming updates do not force a jump to the bottom while reading upward. `onLoadOlder` only asks the host to load; the UI does not own pagination, networking, or record permissions. The list uses the same keyed mechanism as MeowJSX; removed items release their component lifecycles.
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Model selection, files, paths, URLs, callback names, and UI state grant no backend permissions. Connection, upload, execution, stop, publish, authorization, and recovery are wired in by the application adapter; there is no Agent execution framework here.
|
|
54
54
|
|
|
55
|
-
##
|
|
55
|
+
## Standard Agent content
|
|
56
56
|
|
|
57
|
-
`tool` part
|
|
58
|
-
|
|
59
|
-
`canRetry/canCancel`
|
|
60
|
-
`retryDisabled/cancelDisabled`
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
The `tool` part reuses `ChatToolCall` by default: action and target, explicit execution state, lazy input/output, outputSummary,
|
|
58
|
+
long-result window, and default expansion. outputSummary appears only in the expanded body; the collapsed summary uses summary.
|
|
59
|
+
`canRetry/canCancel` only decide whether the corresponding entry exists and grant no execution permission.
|
|
60
|
+
`retryDisabled/cancelDisabled` only disable entries; `onToolAction(messageId, partId, action)`
|
|
61
|
+
notifies the host of a retry or cancel intent; it does not execute the tool or switch state on its own. Actions are hidden when the tool body collapses;
|
|
62
|
+
global stop/interrupt should be placed by the host outside the collapsible region in headerActions, composerTrailing, or an ordinary action group. A missing tool state uses unknown,
|
|
63
|
+
and neither missing output nor an unanswered public reply is automatically treated as failure.
|
|
64
64
|
|
|
65
|
-
`task` part
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
The `task` part reuses `ChatTask`; execution state, executionText, replyText, and labeled progress are each provided by the host,
|
|
66
|
+
and existing process steps can be attached. Execution success and "public reply not yet received" can coexist.
|
|
67
|
+
Stable ids and kinds for the same message/part preserve the component instance, native expansion, and focus; immutable data updates are enough,
|
|
68
|
+
and the whole conversation does not need to be recreated. defaultOpen only means initially expanded; later output updates do not force it to collapse again.
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
JSON
|
|
72
|
-
|
|
70
|
+
See [Agent components](AGENT-COMPONENTS.md) for the standard composition and the full capability matrix. This round also extends typed JSX/Assistant parts and the finite tool/task schema and onToolAction action of the existing AssistantView JSON catalog.
|
|
71
|
+
JSON still provides no separate ChatTask/ChatToolCall entry, recursive task tree, arbitrary object interpretation, execution protocol, or requirement to disclose private reasoning;
|
|
72
|
+
see the [JSON contract](JSON.md) for the exact fields.
|
package/JSON.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Finite JSON UI catalog
|
|
2
2
|
|
|
3
|
-
`meowtail/json`
|
|
3
|
+
`createMeowUICatalog()` from `meowtail/json` registers the existing `AssistantView`, `Button`, `Input`, and `Stack`, and builds the same MeowJSX VNodes through `meowjsx/json`. It does not copy the renderer, theme, component implementations, or business stores, and does not reflect arbitrary properties from TypeScript's open Props.
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
import { createJsonView, parseJsonView } from "meowjsx/json";
|
|
@@ -41,15 +41,15 @@ const child = createJsonView(view, {
|
|
|
41
41
|
});
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
`messages`
|
|
44
|
+
`messages` is required. Messages support six explicit branches: text/code/process/attachments/tool/task; process steps, activity, background work, questions, model options, read state, drafts, and submission snapshots use finite schemas. `assistantJsonSchemas` and the catalog reuse the same definitions, so validation, descriptions, and type associations are not maintained in separate copies. A controlled draft must be wired to `onDraftChange` or set to read-only; whether a submission is accepted is still decided by the host explicitly returning `{accepted:true}`.
|
|
45
45
|
|
|
46
|
-
tool
|
|
47
|
-
|
|
48
|
-
canRetry/canCancel
|
|
49
|
-
`"retry" | "cancel"
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
The tool branch accepts label/summary/state/statusLabel, lazy input/output/outputSummary, maxLines/defaultOpen,
|
|
47
|
+
and canRetry/canCancel plus retryDisabled/cancelDisabled. outputSummary is visible only in the expanded body; the collapsed summary uses summary.
|
|
48
|
+
canRetry/canCancel only control action visibility and grant no permission; the `onToolAction` action passes only the validated messageId, partId, and
|
|
49
|
+
`"retry" | "cancel"`; execution eligibility and result updates are the host's responsibility. The task branch accepts title, state, description, separate executionText/replyText,
|
|
50
|
+
labeled progress, and finite steps, and renders the same `ChatTask`. This is not a separate ChatTask/ChatToolCall JSON entry,
|
|
51
|
+
and it provides no recursive task tree, children/footer slots, or arbitrary object interpretation.
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
This slice supports serialized attachment metadata (id/name/url/mediaType/sizeBytes) and does not support File, local file upload, attachment callbacks, renderPart/renderWorkDetail, or headerActions/composerTrailing slots. Use the full `meowtail/chat` JSX API when these capabilities are needed. JSON provides no `onAttach` and turns off the local file selection entry with the finite default `allowAttachments: false`; an explicit true is rejected. Text editing, sending, and displaying/removing existing attachments still work. Networking, permissions, persistence, data protocols, and uploads always belong to the host.
|
|
54
54
|
|
|
55
|
-
Button
|
|
55
|
+
Button click actions pass no native event; the Input input action passes only the validated current string value. Only the listed properties are available; open JSX native props, HTML tag names, ref/raw HTML, arbitrary event objects, arbitrary code, path expressions, and dynamic import are not in the catalog. Other MeowUI components do not yet provide JSON metadata; this slice does not claim automatic serialization of every UI property.
|