@deepagents/react-genai 7.45.4 → 7.46.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/dist/index.js +811 -800
- package/dist/index.js.map +1 -1
- package/dist/lib/chat/citation-order.d.ts +12 -0
- package/dist/lib/chat/citation-order.d.ts.map +1 -0
- package/dist/lib/chat/citations.d.ts +4 -3
- package/dist/lib/chat/citations.d.ts.map +1 -1
- package/dist/lib/chat/message-parts.d.ts.map +1 -1
- package/dist/lib/chat/trajectory/segments/index.d.ts.map +1 -1
- package/dist/lib/components/CitationPill.d.ts.map +1 -1
- package/dist/lib/copy/assistant-snapshot.d.ts +4 -0
- package/dist/lib/copy/assistant-snapshot.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { UrlCitation } from './citations.ts';
|
|
2
|
+
/**
|
|
3
|
+
* A text's citations in reading order, each at the offset it sits at: after
|
|
4
|
+
* the words it supports, or at the end of the text when the provider gives no
|
|
5
|
+
* offset (Anthropic sends none). `order` is the citation's index in its array.
|
|
6
|
+
*/
|
|
7
|
+
export declare function citationsInReadingOrder(text: string, citations: UrlCitation[]): {
|
|
8
|
+
citation: UrlCitation;
|
|
9
|
+
order: number;
|
|
10
|
+
at: number;
|
|
11
|
+
}[];
|
|
12
|
+
//# sourceMappingURL=citation-order.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"citation-order.d.ts","sources":["../../../src/lib/chat/citation-order.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,WAAW,EAAE;;;;IASzB"}
|
|
@@ -11,10 +11,11 @@ export type UrlCitation = Citation & {
|
|
|
11
11
|
};
|
|
12
12
|
export declare function urlCitationsOf(citations: Citation[] | undefined): UrlCitation[];
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* An answer's sources, deduped by URL and numbered per answer in the order the
|
|
15
|
+
* answer shows them: a text's citations where they sit, and a source-url part
|
|
16
|
+
* where it stands, unless a text citation of the answer draws it inline.
|
|
16
17
|
*/
|
|
17
|
-
export declare function
|
|
18
|
+
export declare function extractSourcesFromMessage(message: UIMessage): CitationSource[];
|
|
18
19
|
/**
|
|
19
20
|
* The 1-based citation number of `url` in `sources`, or null when `sources`
|
|
20
21
|
* does not hold it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"citations.d.ts","sources":["../../../src/lib/chat/citations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"citations.d.ts","sources":["../../../src/lib/chat/citations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAI9C,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,iEAAiE;AACjE,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG;IACnC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAAE,UAAU,EAAE,KAAK,CAAA;KAAE,CAAC,CAAC;CAC5D,CAAC;AAEF,wBAAgB,cAAc,CAC5B,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,GAChC,WAAW,EAAE,CAIf;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,SAAS,GACjB,cAAc,EAAE,CAwBlB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,cAAc,EAAE,EACzB,GAAG,EAAE,MAAM,GACV,MAAM,GAAG,IAAI,CAGf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-parts.d.ts","sources":["../../../src/lib/chat/message-parts.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAK/C,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"message-parts.d.ts","sources":["../../../src/lib/chat/message-parts.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAK/C,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,uCAAuC,CAAC;AAmB/C,eAAO,MAAM,iBAAiB;aAAK,SAAS,EAAE,SAAS;CAAW,CAAC;AAEnE,KAAK,0BAA0B,GAAG;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAiEF,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,SAAS,EACT,GAAG,GACJ,EAAE,0BAA0B,+BAM5B;AAmDD,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,SAAS,GACV,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,uBAAuB,EAAE,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAkCA;AAED,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,+BAQ7D;AAED,wBAAgB,YAAY,IAAI,OAAO,CAItC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":["../../../../../src/lib/chat/trajectory/segments/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK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KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAK3D,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,KAAK,EACL,MAA+D,EAC/D,QAAQ,GACT,EAAE;IACD,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,MAAM,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,+
|
|
1
|
+
{"version":3,"file":"CitationPill.d.ts","sources":["../../../src/lib/components/CitationPill.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAK3D,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,KAAK,EACL,MAA+D,EAC/D,QAAQ,GACT,EAAE;IACD,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,MAAM,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,+BA4CA"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type UIMessage } from 'ai';
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* The answer's text with each citation as `[n]` where it sits, then one line
|
|
5
|
+
* per source, numbered as the answer draws them.
|
|
6
|
+
*/
|
|
3
7
|
export declare function extractAssistantRawText(message: UIMessage): string;
|
|
4
8
|
export declare function useIsAssistantSnapshotRender(): boolean;
|
|
5
9
|
export declare function AssistantSnapshot({ message, renderContent, className, }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assistant-snapshot.d.ts","sources":["../../../src/lib/copy/assistant-snapshot.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAgB,MAAM,IAAI,CAAC;AAGlD,OAAO,EACL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"assistant-snapshot.d.ts","sources":["../../../src/lib/copy/assistant-snapshot.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAgB,MAAM,IAAI,CAAC;AAGlD,OAAO,EACL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAaf;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,CAoBlE;AAED,wBAAgB,4BAA4B,YAE3C;AAED,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,aAAa,EACb,SAAS,GACV,EAAE;IACD,OAAO,EAAE,SAAS,CAAC;IACnB,aAAa,EAAE,MAAM,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BA6DA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepagents/react-genai",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.46.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@ai-sdk/react": "^4.0.186",
|
|
34
|
-
"@deepagents/context": "7.
|
|
35
|
-
"@deepagents/elements": "7.
|
|
36
|
-
"@deepagents/react-formatters": "7.
|
|
37
|
-
"@deepagents/react-input": "7.
|
|
34
|
+
"@deepagents/context": "7.46.0",
|
|
35
|
+
"@deepagents/elements": "7.46.0",
|
|
36
|
+
"@deepagents/react-formatters": "7.46.0",
|
|
37
|
+
"@deepagents/react-input": "7.46.0",
|
|
38
38
|
"@types/mdast": "^4.0.4",
|
|
39
39
|
"ai": "^7.0.181",
|
|
40
40
|
"cn": "^0.4.0",
|