@springbrand/message-panel 0.1.3-alpha.26 → 0.1.3-alpha.28
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/cloud-os/capability-chip.tsx +1 -1
- package/cloud-os/chat/transcript-model.ts +2 -2
- package/cloud-os/composer/cloud-os-chat-input.tsx +1 -1
- package/cloud-os/styles/cloud-os.css +5 -1
- package/package.json +1 -1
- package/src/camel/camel-chat-messages.tsx +1 -1
- package/src/composer/composer-attachments.tsx +1 -1
- package/src/composer/composer.tsx +2 -2
- package/src/message-panel.tsx +1 -1
- package/src/parts/index.tsx +1 -1
|
@@ -35,7 +35,7 @@ export interface CloudOsMessageMetadata extends UnknownRecord {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export interface CloudOsRequestedCapability {
|
|
38
|
-
kind: "skill" | "plan";
|
|
38
|
+
kind: "skill" | "tool" | "plan";
|
|
39
39
|
name: string;
|
|
40
40
|
label: string;
|
|
41
41
|
}
|
|
@@ -186,7 +186,7 @@ export function requestedCapabilitiesOf(
|
|
|
186
186
|
return metadata.requestedCapabilities.flatMap((value) => {
|
|
187
187
|
const capability = recordOf(value);
|
|
188
188
|
if (
|
|
189
|
-
(capability.kind !== "skill" && capability.kind !== "plan") ||
|
|
189
|
+
(capability.kind !== "skill" && capability.kind !== "tool" && capability.kind !== "plan") ||
|
|
190
190
|
typeof capability.name !== "string" ||
|
|
191
191
|
!capability.name.trim() ||
|
|
192
192
|
typeof capability.label !== "string" ||
|
|
@@ -532,8 +532,12 @@
|
|
|
532
532
|
font-weight: 600;
|
|
533
533
|
}
|
|
534
534
|
.cos-markdown img {
|
|
535
|
-
max-width: 100
|
|
535
|
+
max-width: min(100%, 16rem);
|
|
536
|
+
max-height: 13rem;
|
|
537
|
+
width: auto;
|
|
536
538
|
height: auto;
|
|
539
|
+
border-radius: 0.75rem;
|
|
540
|
+
object-fit: contain;
|
|
537
541
|
}
|
|
538
542
|
|
|
539
543
|
/* ── 输入框容器(container query 决定「添加资源」标签是否显示)─────────────── */
|
package/package.json
CHANGED
|
@@ -59,7 +59,7 @@ export const AttachmentPreview = forwardRef<
|
|
|
59
59
|
attachment.status === "uploading"
|
|
60
60
|
? "上传中…"
|
|
61
61
|
: attachment.status === "error"
|
|
62
|
-
? "
|
|
62
|
+
? "Upload failed"
|
|
63
63
|
: [attachment.note, formatSize(attachment.size)].filter(Boolean).join(" · ");
|
|
64
64
|
return (
|
|
65
65
|
<div
|
|
@@ -211,10 +211,10 @@ function ComposerInner<TAttachment>(
|
|
|
211
211
|
);
|
|
212
212
|
const invalid = selected.filter((file) => !valid.includes(file));
|
|
213
213
|
if (all.length > selected.length) {
|
|
214
|
-
onValidationError?.(
|
|
214
|
+
onValidationError?.(`You can add up to ${maxFiles ?? 1} attachments`, all);
|
|
215
215
|
}
|
|
216
216
|
if (invalid.length) {
|
|
217
|
-
onValidationError?.("
|
|
217
|
+
onValidationError?.("Some files are unsupported or exceed the size limit", invalid);
|
|
218
218
|
}
|
|
219
219
|
if (valid.length) void onFilesAdded?.(valid);
|
|
220
220
|
},
|
package/src/message-panel.tsx
CHANGED
|
@@ -277,7 +277,7 @@ function MessagePanelInner<T>(
|
|
|
277
277
|
? slots.error(error)
|
|
278
278
|
: slots.error ?? (
|
|
279
279
|
<PanelStatus kind="error">
|
|
280
|
-
{error instanceof Error ? error.message : "
|
|
280
|
+
{error instanceof Error ? error.message : "This turn failed. Please try again."}
|
|
281
281
|
</PanelStatus>
|
|
282
282
|
))}
|
|
283
283
|
<Conversation>
|
package/src/parts/index.tsx
CHANGED
|
@@ -1115,7 +1115,7 @@ export function DefaultPartRenderer({
|
|
|
1115
1115
|
);
|
|
1116
1116
|
}
|
|
1117
1117
|
if (kind === "error") {
|
|
1118
|
-
return <ErrorPart title={String(data.title ?? "Error")} body={String(data.body ?? data.message ?? "
|
|
1118
|
+
return <ErrorPart title={String(data.title ?? "Error")} body={String(data.body ?? data.message ?? "Request failed")} />;
|
|
1119
1119
|
}
|
|
1120
1120
|
if (kind === "image") {
|
|
1121
1121
|
return <ImagePart src={String(record.src ?? record.url ?? data.src ?? data.url ?? "")} alt={String(record.alt ?? record.filename ?? data.alt ?? data.filename ?? "图片")} onPreview={() => context.actions.onPreview?.(part)} />;
|