@nextclaw/ncp-react 0.3.4 → 0.3.5
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/dist/index.d.ts +2 -1
- package/dist/index.js +3 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NcpAgentConversationSnapshot, NcpMessage, NcpRequestEnvelope, NcpAgentClientEndpoint } from '@nextclaw/ncp';
|
|
1
|
+
import { NcpAgentConversationSnapshot, NcpMessage, NcpRequestEnvelope, NcpAgentClientEndpoint, NcpMessagePart } from '@nextclaw/ncp';
|
|
2
2
|
|
|
3
3
|
type NcpAgentSendInput = string | NcpRequestEnvelope;
|
|
4
4
|
type UseNcpAgentResult = {
|
|
@@ -61,6 +61,7 @@ declare function buildNcpRequestEnvelope(params: {
|
|
|
61
61
|
sessionId: string;
|
|
62
62
|
text?: string;
|
|
63
63
|
attachments?: readonly NcpDraftAttachment[];
|
|
64
|
+
parts?: readonly NcpMessagePart[];
|
|
64
65
|
metadata?: Record<string, unknown>;
|
|
65
66
|
messageId?: string;
|
|
66
67
|
timestamp?: string;
|
package/dist/index.js
CHANGED
|
@@ -259,11 +259,9 @@ function buildNcpImageAttachmentDataUrl(attachment) {
|
|
|
259
259
|
return `data:${attachment.mimeType};base64,${attachment.contentBase64}`;
|
|
260
260
|
}
|
|
261
261
|
function buildNcpRequestEnvelope(params) {
|
|
262
|
-
const
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
...trimmedText ? [{ type: "text", text: trimmedText }] : [],
|
|
266
|
-
...attachments.map((attachment) => ({
|
|
262
|
+
const parts = params.parts && params.parts.length > 0 ? params.parts.map((part) => structuredClone(part)) : [
|
|
263
|
+
...params.text?.trim() ?? "" ? [{ type: "text", text: params.text.trim() }] : [],
|
|
264
|
+
...(params.attachments ?? []).map((attachment) => ({
|
|
267
265
|
type: "file",
|
|
268
266
|
name: attachment.name,
|
|
269
267
|
mimeType: attachment.mimeType,
|