@copilotkit/react-core 1.5.19-next.0 → 1.5.19
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/CHANGELOG.md +20 -0
- package/dist/{chunk-5K2FUI34.mjs → chunk-534J55RX.mjs} +19 -13
- package/dist/chunk-534J55RX.mjs.map +1 -0
- package/dist/{chunk-TI25S2SR.mjs → chunk-6C6ZNKSS.mjs} +2 -2
- package/dist/{chunk-DB25UMNI.mjs → chunk-7YXUCWXF.mjs} +2 -2
- package/dist/{chunk-7IYA4DNK.mjs → chunk-DFNQGERN.mjs} +2 -2
- package/dist/{chunk-WSOA4BGM.mjs → chunk-JFCNSGNU.mjs} +2 -2
- package/dist/{chunk-2RIS4N5Q.mjs → chunk-OBGDZ7BM.mjs} +2 -2
- package/dist/components/copilot-provider/copilotkit.js +24 -18
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +2 -2
- package/dist/components/copilot-provider/index.js +24 -18
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +2 -2
- package/dist/components/error-boundary/error-boundary.d.ts +1 -1
- package/dist/components/error-boundary/error-boundary.js +18 -12
- package/dist/components/error-boundary/error-boundary.js.map +1 -1
- package/dist/components/error-boundary/error-boundary.mjs +1 -1
- package/dist/components/index.js +24 -18
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/hooks/index.mjs +5 -5
- package/dist/hooks/use-coagent.mjs +4 -4
- package/dist/hooks/use-copilot-chat.mjs +3 -3
- package/dist/hooks/use-langgraph-interrupt.mjs +4 -4
- package/dist/index.js +37 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/lib/copilot-task.mjs +3 -3
- package/dist/lib/index.mjs +3 -3
- package/dist/utils/extract.mjs +2 -2
- package/dist/utils/index.mjs +2 -2
- package/package.json +3 -3
- package/src/components/error-boundary/error-boundary.tsx +24 -13
- package/dist/chunk-5K2FUI34.mjs.map +0 -1
- /package/dist/{chunk-TI25S2SR.mjs.map → chunk-6C6ZNKSS.mjs.map} +0 -0
- /package/dist/{chunk-DB25UMNI.mjs.map → chunk-7YXUCWXF.mjs.map} +0 -0
- /package/dist/{chunk-7IYA4DNK.mjs.map → chunk-DFNQGERN.mjs.map} +0 -0
- /package/dist/{chunk-WSOA4BGM.mjs.map → chunk-JFCNSGNU.mjs.map} +0 -0
- /package/dist/{chunk-2RIS4N5Q.mjs.map → chunk-OBGDZ7BM.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -3,14 +3,14 @@ import "./chunk-EFZPSZWO.mjs";
|
|
|
3
3
|
import "./chunk-LUGEI4YQ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
CopilotTask
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JFCNSGNU.mjs";
|
|
7
7
|
import "./chunk-IGLITGLC.mjs";
|
|
8
8
|
import {
|
|
9
9
|
useLangGraphInterruptRender
|
|
10
10
|
} from "./chunk-ZAU4EMBM.mjs";
|
|
11
11
|
import {
|
|
12
12
|
useLangGraphInterrupt
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-6C6ZNKSS.mjs";
|
|
14
14
|
import {
|
|
15
15
|
useMakeCopilotDocumentReadable
|
|
16
16
|
} from "./chunk-XOHLZIZK.mjs";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
startAgent,
|
|
23
23
|
stopAgent,
|
|
24
24
|
useCoAgent
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-DFNQGERN.mjs";
|
|
26
26
|
import {
|
|
27
27
|
useCopilotAuthenticatedAction_c
|
|
28
28
|
} from "./chunk-2F6RYBYS.mjs";
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
} from "./chunk-T2EFA3D5.mjs";
|
|
32
32
|
import {
|
|
33
33
|
useCopilotChat
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-OBGDZ7BM.mjs";
|
|
35
35
|
import {
|
|
36
36
|
useCopilotReadable
|
|
37
37
|
} from "./chunk-7HWSAEOY.mjs";
|
|
@@ -39,8 +39,8 @@ import {
|
|
|
39
39
|
CopilotKit,
|
|
40
40
|
defaultCopilotContextCategories,
|
|
41
41
|
extract
|
|
42
|
-
} from "./chunk-
|
|
43
|
-
import "./chunk-
|
|
42
|
+
} from "./chunk-7YXUCWXF.mjs";
|
|
43
|
+
import "./chunk-534J55RX.mjs";
|
|
44
44
|
import "./chunk-5M47BILE.mjs";
|
|
45
45
|
import {
|
|
46
46
|
shouldShowDevConsole
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotTask
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-JFCNSGNU.mjs";
|
|
4
|
+
import "../chunk-7YXUCWXF.mjs";
|
|
5
|
+
import "../chunk-534J55RX.mjs";
|
|
6
6
|
import "../chunk-5M47BILE.mjs";
|
|
7
7
|
import "../chunk-MLAS4QUR.mjs";
|
|
8
8
|
import "../chunk-6U3UH3KO.mjs";
|
package/dist/lib/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../chunk-LUGEI4YQ.mjs";
|
|
2
2
|
import {
|
|
3
3
|
CopilotTask
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-JFCNSGNU.mjs";
|
|
5
|
+
import "../chunk-7YXUCWXF.mjs";
|
|
6
|
+
import "../chunk-534J55RX.mjs";
|
|
7
7
|
import "../chunk-5M47BILE.mjs";
|
|
8
8
|
import "../chunk-MLAS4QUR.mjs";
|
|
9
9
|
import "../chunk-6U3UH3KO.mjs";
|
package/dist/utils/extract.mjs
CHANGED
package/dist/utils/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
|
-
"version": "1.5.19
|
|
12
|
+
"version": "1.5.19",
|
|
13
13
|
"sideEffects": false,
|
|
14
14
|
"main": "./dist/index.js",
|
|
15
15
|
"module": "./dist/index.mjs",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@scarf/scarf": "^1.3.0",
|
|
44
44
|
"react-markdown": "^8.0.7",
|
|
45
45
|
"untruncate-json": "^0.0.1",
|
|
46
|
-
"@copilotkit/runtime-client-gql": "1.5.19
|
|
47
|
-
"@copilotkit/shared": "1.5.19
|
|
46
|
+
"@copilotkit/runtime-client-gql": "1.5.19",
|
|
47
|
+
"@copilotkit/shared": "1.5.19"
|
|
48
48
|
},
|
|
49
49
|
"keywords": [
|
|
50
50
|
"copilotkit",
|
|
@@ -3,6 +3,7 @@ import { Severity, CopilotKitError } from "@copilotkit/shared";
|
|
|
3
3
|
import { StatusChecker } from "../../lib/status-checker";
|
|
4
4
|
import { renderCopilotKitUsage, UsageBanner } from "../usage-banner";
|
|
5
5
|
import { useErrorToast } from "./error-utils";
|
|
6
|
+
import { COPILOT_CLOUD_ERROR_NAMES } from "@copilotkit/shared";
|
|
6
7
|
|
|
7
8
|
const statusChecker = new StatusChecker();
|
|
8
9
|
|
|
@@ -57,22 +58,31 @@ export class CopilotErrorBoundary extends React.Component<Props, State> {
|
|
|
57
58
|
render() {
|
|
58
59
|
if (this.state.hasError) {
|
|
59
60
|
if (this.state.error instanceof CopilotKitError) {
|
|
60
|
-
|
|
61
|
+
// @ts-expect-error -- It's a copilotkit error at this state. Name is valid
|
|
62
|
+
if (COPILOT_CLOUD_ERROR_NAMES.includes(this.state.error.name)) {
|
|
63
|
+
return (
|
|
64
|
+
<ErrorToast error={this.state.error}>
|
|
65
|
+
{renderCopilotKitUsage(this.state.error)}
|
|
66
|
+
</ErrorToast>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<>
|
|
72
|
+
{this.props.children}
|
|
73
|
+
{this.props.showUsageBanner && (
|
|
74
|
+
<UsageBanner
|
|
75
|
+
severity={this.state.status?.severity}
|
|
76
|
+
message={this.state.status?.message}
|
|
77
|
+
/>
|
|
78
|
+
)}
|
|
79
|
+
</>
|
|
80
|
+
);
|
|
61
81
|
}
|
|
62
|
-
|
|
82
|
+
throw this.state.error;
|
|
63
83
|
}
|
|
64
84
|
|
|
65
|
-
return
|
|
66
|
-
<>
|
|
67
|
-
{this.props.children}
|
|
68
|
-
{this.props.showUsageBanner ? (
|
|
69
|
-
<UsageBanner
|
|
70
|
-
severity={this.state.status?.severity}
|
|
71
|
-
message={this.state.status?.message}
|
|
72
|
-
/>
|
|
73
|
-
) : null}
|
|
74
|
-
</>
|
|
75
|
-
);
|
|
85
|
+
return this.props.children;
|
|
76
86
|
}
|
|
77
87
|
}
|
|
78
88
|
|
|
@@ -85,5 +95,6 @@ export function ErrorToast({ error, children }: { error?: Error; children: React
|
|
|
85
95
|
}
|
|
86
96
|
}, [error, addErrorToast]);
|
|
87
97
|
|
|
98
|
+
if (!error) throw error;
|
|
88
99
|
return children;
|
|
89
100
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/error-boundary/error-boundary.tsx"],"sourcesContent":["import React, { useEffect } from \"react\";\nimport { Severity, CopilotKitError } from \"@copilotkit/shared\";\nimport { StatusChecker } from \"../../lib/status-checker\";\nimport { renderCopilotKitUsage, UsageBanner } from \"../usage-banner\";\nimport { useErrorToast } from \"./error-utils\";\n\nconst statusChecker = new StatusChecker();\n\ninterface Props {\n children: React.ReactNode;\n publicApiKey?: string;\n showUsageBanner?: boolean;\n}\n\ninterface State {\n hasError: boolean;\n error?: CopilotKitError;\n status?: {\n severity: Severity;\n message: string;\n };\n}\n\nexport class CopilotErrorBoundary extends React.Component<Props, State> {\n constructor(props: Props) {\n super(props);\n this.state = {\n hasError: false,\n };\n }\n\n static getDerivedStateFromError(error: CopilotKitError): State {\n return { hasError: true, error };\n }\n\n componentDidMount() {\n if (this.props.publicApiKey) {\n statusChecker.start(this.props.publicApiKey, (newStatus) => {\n this.setState((prevState) => {\n if (newStatus?.severity !== prevState.status?.severity) {\n return { status: newStatus ?? undefined };\n }\n return null;\n });\n });\n }\n }\n\n componentWillUnmount() {\n statusChecker.stop();\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n console.error(\"CopilotKit Error:\", error, errorInfo);\n }\n\n render() {\n if (this.state.hasError) {\n if (this.state.error instanceof CopilotKitError) {\n return renderCopilotKitUsage(this.state.error);\n }\n return <ErrorToast error={this.state.error}>{this.props.children}</ErrorToast>;\n }\n\n return (\n <>\n {this.props.children}\n {this.props.showUsageBanner ? (\n <UsageBanner\n severity={this.state.status?.severity}\n message={this.state.status?.message}\n />\n ) : null}\n </>\n );\n }\n}\n\nexport function ErrorToast({ error, children }: { error?: Error; children: React.ReactNode }) {\n const addErrorToast = useErrorToast();\n\n useEffect(() => {\n if (error) {\n addErrorToast([error]);\n }\n }, [error, addErrorToast]);\n\n return children;\n}\n"],"mappings":";;;;;;;;;;;;AAAA,OAAO,SAAS,iBAAiB;AACjC,SAAmB,uBAAuB;AA4D7B,SAIP,UAJO,KAIP,YAJO;AAvDb,IAAM,gBAAgB,IAAI,cAAc;AAiBjC,IAAM,uBAAN,cAAmC,MAAM,UAAwB;AAAA,EACtE,YAAY,OAAc;AACxB,UAAM,KAAK;AACX,SAAK,QAAQ;AAAA,MACX,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EAEA,OAAO,yBAAyB,OAA+B;AAC7D,WAAO,EAAE,UAAU,MAAM,MAAM;AAAA,EACjC;AAAA,EAEA,oBAAoB;AAClB,QAAI,KAAK,MAAM,cAAc;AAC3B,oBAAc,MAAM,KAAK,MAAM,cAAc,CAAC,cAAc;AAC1D,aAAK,SAAS,CAAC,cAAc;AAtCrC;AAuCU,eAAI,uCAAW,gBAAa,eAAU,WAAV,mBAAkB,WAAU;AACtD,mBAAO,EAAE,QAAQ,gCAAa,OAAU;AAAA,UAC1C;AACA,iBAAO;AAAA,QACT,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,uBAAuB;AACrB,kBAAc,KAAK;AAAA,EACrB;AAAA,EAEA,kBAAkB,OAAc,WAA4B;AAC1D,YAAQ,MAAM,qBAAqB,OAAO,SAAS;AAAA,EACrD;AAAA,EAEA,SAAS;AAxDX;AAyDI,QAAI,KAAK,MAAM,UAAU;AACvB,UAAI,KAAK,MAAM,iBAAiB,iBAAiB;AAC/C,eAAO,sBAAsB,KAAK,MAAM,KAAK;AAAA,MAC/C;AACA,aAAO,oBAAC,cAAW,OAAO,KAAK,MAAM,OAAQ,eAAK,MAAM,UAAS;AAAA,IACnE;AAEA,WACE,iCACG;AAAA,WAAK,MAAM;AAAA,MACX,KAAK,MAAM,kBACV;AAAA,QAAC;AAAA;AAAA,UACC,WAAU,UAAK,MAAM,WAAX,mBAAmB;AAAA,UAC7B,UAAS,UAAK,MAAM,WAAX,mBAAmB;AAAA;AAAA,MAC9B,IACE;AAAA,OACN;AAAA,EAEJ;AACF;AAEO,SAAS,WAAW,EAAE,OAAO,SAAS,GAAiD;AAC5F,QAAM,gBAAgB,cAAc;AAEpC,YAAU,MAAM;AACd,QAAI,OAAO;AACT,oBAAc,CAAC,KAAK,CAAC;AAAA,IACvB;AAAA,EACF,GAAG,CAAC,OAAO,aAAa,CAAC;AAEzB,SAAO;AACT;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|