@blade-hq/agent-react 1.1.1 → 1.1.3
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/README.md +0 -1
- package/dist/chunk-ZXXLY4RM.js +28255 -0
- package/dist/chunk-ZXXLY4RM.js.map +1 -0
- package/dist/components/MarkdownContent.d.ts +1 -5
- package/dist/embed/entry.d.ts +3 -3
- package/dist/highlighted-body-B3W2YXNL-YD7FAP6V.js +27 -0
- package/dist/highlighted-body-B3W2YXNL-YD7FAP6V.js.map +1 -0
- package/dist/hooks/use-agent-session.d.ts +1 -1
- package/dist/index.js +757 -79
- package/dist/index.js.map +1 -1
- package/dist/mermaid-3ZIDBTTL-N7YKJ3SM.js +8 -0
- package/dist/mermaid-3ZIDBTTL-N7YKJ3SM.js.map +1 -0
- package/package.json +7 -6
- package/public-api.md +85 -23
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { type ComponentProps } from "react";
|
|
2
|
-
import { Streamdown } from "streamdown";
|
|
3
|
-
type StreamdownProps = ComponentProps<typeof Streamdown>;
|
|
4
1
|
export interface MarkdownContentProps {
|
|
5
2
|
children: string;
|
|
6
3
|
className?: string;
|
|
7
4
|
/** 流式渲染传 "streaming",历史静态内容默认 "static"。 */
|
|
8
|
-
mode?:
|
|
5
|
+
mode?: "streaming" | "static";
|
|
9
6
|
}
|
|
10
7
|
/**
|
|
11
8
|
* SDK 版 Markdown 渲染:Streamdown 默认转义/消毒(不开启任何 raw HTML),
|
|
@@ -13,4 +10,3 @@ export interface MarkdownContentProps {
|
|
|
13
10
|
* 会话文件卡片等第一方能力。
|
|
14
11
|
*/
|
|
15
12
|
export declare function MarkdownContent({ children, className, mode }: MarkdownContentProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export {};
|
package/dist/embed/entry.d.ts
CHANGED
|
@@ -18,16 +18,16 @@ declare function getChat(element: Element | null): Promise<AgentSession>;
|
|
|
18
18
|
declare const BladeAgent: {
|
|
19
19
|
BladeClient: typeof agentClient.BladeClient;
|
|
20
20
|
BladeApiError: typeof agentClient.BladeApiError;
|
|
21
|
-
VersionMismatchError: typeof agentClient.VersionMismatchError;
|
|
22
21
|
SDK_NAME: "agent-client";
|
|
23
|
-
SDK_VERSION:
|
|
24
|
-
MIN_SERVER_VERSION: "1.1.1";
|
|
22
|
+
SDK_VERSION: string;
|
|
25
23
|
AgentSession: typeof AgentSession;
|
|
26
24
|
SessionHub: typeof agentClient.SessionHub;
|
|
25
|
+
SessionSetupError: typeof agentClient.SessionSetupError;
|
|
27
26
|
createInitialSessionState: typeof agentClient.createInitialSessionState;
|
|
28
27
|
connectEmbedded: typeof agentClient.connectEmbedded;
|
|
29
28
|
isCommandEnvelope: typeof agentClient.isCommandEnvelope;
|
|
30
29
|
isInboundEnvelope: typeof agentClient.isInboundEnvelope;
|
|
30
|
+
ModelsResource: typeof agentClient.ModelsResource;
|
|
31
31
|
buildMessageContent: typeof agentClient.buildMessageContent;
|
|
32
32
|
contentPreview: typeof agentClient.contentPreview;
|
|
33
33
|
extractTextAttachments: typeof agentClient.extractTextAttachments;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Ks,
|
|
4
|
+
Qe,
|
|
5
|
+
R
|
|
6
|
+
} from "./chunk-ZXXLY4RM.js";
|
|
7
|
+
|
|
8
|
+
// ../../node_modules/.pnpm/streamdown@2.3.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/streamdown/dist/highlighted-body-B3W2YXNL.js
|
|
9
|
+
import { useContext, useState, useEffect } from "react";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
var L = ({ code: s, language: t, raw: e, className: n, ...d$1 }) => {
|
|
12
|
+
let { shikiTheme: l } = useContext(R), o = Ks(), [m, i] = useState(e);
|
|
13
|
+
return useEffect(() => {
|
|
14
|
+
if (!o) {
|
|
15
|
+
i(e);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
let g = o.highlight({ code: s, language: t, themes: l }, (p) => {
|
|
19
|
+
i(p);
|
|
20
|
+
});
|
|
21
|
+
g && i(g);
|
|
22
|
+
}, [s, t, l, o, e]), jsx(Qe, { className: n, language: t, result: m, ...d$1 });
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
L as HighlightedCodeBlockBody
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=highlighted-body-B3W2YXNL-YD7FAP6V.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/streamdown@2.3.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/streamdown/dist/highlighted-body-B3W2YXNL.js"],"sourcesContent":["\"use client\";\nimport {k,d,c}from'./chunk-RLXIAIE6.js';import {useContext,useState,useEffect}from'react';import {jsx}from'react/jsx-runtime';var L=({code:s,language:t,raw:e,className:n,...d$1})=>{let{shikiTheme:l}=useContext(k),o=d(),[m,i]=useState(e);return useEffect(()=>{if(!o){i(e);return}let g=o.highlight({code:s,language:t,themes:l},p=>{i(p);});g&&i(g);},[s,t,l,o,e]),jsx(c,{className:n,language:t,result:m,...d$1})};export{L as HighlightedCodeBlockBody};"],"mappings":";;;;;;;;AACwC,SAAQ,YAAW,UAAS,iBAAc;AAAQ,SAAQ,WAAQ;AAAoB,IAAI,IAAE,CAAC,EAAC,MAAK,GAAE,UAAS,GAAE,KAAI,GAAE,WAAU,GAAE,GAAG,IAAG,MAAI;AAAC,MAAG,EAAC,YAAW,EAAC,IAAE,WAAW,CAAC,GAAE,IAAE,GAAE,GAAE,CAAC,GAAE,CAAC,IAAE,SAAS,CAAC;AAAE,SAAO,UAAU,MAAI;AAAC,QAAG,CAAC,GAAE;AAAC,QAAE,CAAC;AAAE;AAAA,IAAM;AAAC,QAAI,IAAE,EAAE,UAAU,EAAC,MAAK,GAAE,UAAS,GAAE,QAAO,EAAC,GAAE,OAAG;AAAC,QAAE,CAAC;AAAA,IAAE,CAAC;AAAE,SAAG,EAAE,CAAC;AAAA,EAAE,GAAE,CAAC,GAAE,GAAE,GAAE,GAAE,CAAC,CAAC,GAAE,IAAI,IAAE,EAAC,WAAU,GAAE,UAAS,GAAE,QAAO,GAAE,GAAG,IAAG,CAAC;AAAC;","names":[]}
|