@copilotkit/react-core 1.5.1-next.3 → 1.5.1-next.4
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 +11 -2
- package/package.json +5 -5
- package/dist/chunk-2KCEHGSI.mjs +0 -192
- package/dist/chunk-2KCEHGSI.mjs.map +0 -1
- package/dist/chunk-5FHSUKQL.mjs +0 -70
- package/dist/chunk-5FHSUKQL.mjs.map +0 -1
- package/dist/chunk-6OR25P32.mjs +0 -426
- package/dist/chunk-6OR25P32.mjs.map +0 -1
- package/dist/chunk-6U3UH3KO.mjs +0 -140
- package/dist/chunk-6U3UH3KO.mjs.map +0 -1
- package/dist/chunk-DCTJZ742.mjs +0 -22
- package/dist/chunk-DCTJZ742.mjs.map +0 -1
- package/dist/chunk-DDVXFNYA.mjs +0 -126
- package/dist/chunk-DDVXFNYA.mjs.map +0 -1
- package/dist/chunk-EFZPSZWO.mjs +0 -1
- package/dist/chunk-EFZPSZWO.mjs.map +0 -1
- package/dist/chunk-FXHKK52V.mjs +0 -119
- package/dist/chunk-FXHKK52V.mjs.map +0 -1
- package/dist/chunk-H4VZMKR6.mjs +0 -23
- package/dist/chunk-H4VZMKR6.mjs.map +0 -1
- package/dist/chunk-H7LSKIDK.mjs +0 -167
- package/dist/chunk-H7LSKIDK.mjs.map +0 -1
- package/dist/chunk-JDQCJCAQ.mjs +0 -295
- package/dist/chunk-JDQCJCAQ.mjs.map +0 -1
- package/dist/chunk-L34MHAXR.mjs +0 -1
- package/dist/chunk-L34MHAXR.mjs.map +0 -1
- package/dist/chunk-LODRWFMB.mjs +0 -75
- package/dist/chunk-LODRWFMB.mjs.map +0 -1
- package/dist/chunk-LUGEI4YQ.mjs +0 -1
- package/dist/chunk-LUGEI4YQ.mjs.map +0 -1
- package/dist/chunk-MLAS4QUR.mjs +0 -18
- package/dist/chunk-MLAS4QUR.mjs.map +0 -1
- package/dist/chunk-MWZO6TUR.mjs +0 -91
- package/dist/chunk-MWZO6TUR.mjs.map +0 -1
- package/dist/chunk-O7ARI5CV.mjs +0 -31
- package/dist/chunk-O7ARI5CV.mjs.map +0 -1
- package/dist/chunk-ODN4H66E.mjs +0 -31
- package/dist/chunk-ODN4H66E.mjs.map +0 -1
- package/dist/chunk-QDGDXRRJ.mjs +0 -28
- package/dist/chunk-QDGDXRRJ.mjs.map +0 -1
- package/dist/chunk-SKC7AJIV.mjs +0 -61
- package/dist/chunk-SKC7AJIV.mjs.map +0 -1
- package/dist/chunk-XINZBP3J.mjs +0 -49
- package/dist/chunk-XINZBP3J.mjs.map +0 -1
- package/dist/chunk-XXR4QFAQ.mjs +0 -29
- package/dist/chunk-XXR4QFAQ.mjs.map +0 -1
- package/dist/chunk-YPSGKPDA.mjs +0 -1
- package/dist/chunk-YPSGKPDA.mjs.map +0 -1
- package/dist/components/copilot-provider/copilot-messages.d.ts +0 -7
- package/dist/components/copilot-provider/copilot-messages.js +0 -80
- package/dist/components/copilot-provider/copilot-messages.js.map +0 -1
- package/dist/components/copilot-provider/copilot-messages.mjs +0 -9
- package/dist/components/copilot-provider/copilot-messages.mjs.map +0 -1
- package/dist/components/copilot-provider/copilotkit-props.d.ts +0 -72
- package/dist/components/copilot-provider/copilotkit-props.js +0 -19
- package/dist/components/copilot-provider/copilotkit-props.js.map +0 -1
- package/dist/components/copilot-provider/copilotkit-props.mjs +0 -1
- package/dist/components/copilot-provider/copilotkit-props.mjs.map +0 -1
- package/dist/components/copilot-provider/copilotkit.d.ts +0 -9
- package/dist/components/copilot-provider/copilotkit.js +0 -861
- package/dist/components/copilot-provider/copilotkit.js.map +0 -1
- package/dist/components/copilot-provider/copilotkit.mjs +0 -21
- package/dist/components/copilot-provider/copilotkit.mjs.map +0 -1
- package/dist/components/copilot-provider/index.d.ts +0 -4
- package/dist/components/copilot-provider/index.js +0 -861
- package/dist/components/copilot-provider/index.js.map +0 -1
- package/dist/components/copilot-provider/index.mjs +0 -19
- package/dist/components/copilot-provider/index.mjs.map +0 -1
- package/dist/components/index.d.ts +0 -4
- package/dist/components/index.js +0 -861
- package/dist/components/index.js.map +0 -1
- package/dist/components/index.mjs +0 -19
- package/dist/components/index.mjs.map +0 -1
- package/dist/components/toast/exclamation-mark-icon.d.ts +0 -9
- package/dist/components/toast/exclamation-mark-icon.js +0 -55
- package/dist/components/toast/exclamation-mark-icon.js.map +0 -1
- package/dist/components/toast/exclamation-mark-icon.mjs +0 -8
- package/dist/components/toast/exclamation-mark-icon.mjs.map +0 -1
- package/dist/components/toast/toast-provider.d.ts +0 -29
- package/dist/components/toast/toast-provider.js +0 -255
- package/dist/components/toast/toast-provider.js.map +0 -1
- package/dist/components/toast/toast-provider.mjs +0 -11
- package/dist/components/toast/toast-provider.mjs.map +0 -1
- package/dist/context/copilot-context.d.ts +0 -109
- package/dist/context/copilot-context.js +0 -126
- package/dist/context/copilot-context.js.map +0 -1
- package/dist/context/copilot-context.mjs +0 -10
- package/dist/context/copilot-context.mjs.map +0 -1
- package/dist/context/copilot-messages-context.d.ts +0 -15
- package/dist/context/copilot-messages-context.js +0 -57
- package/dist/context/copilot-messages-context.js.map +0 -1
- package/dist/context/copilot-messages-context.mjs +0 -10
- package/dist/context/copilot-messages-context.mjs.map +0 -1
- package/dist/context/index.d.ts +0 -11
- package/dist/context/index.js +0 -149
- package/dist/context/index.js.map +0 -1
- package/dist/context/index.mjs +0 -17
- package/dist/context/index.mjs.map +0 -1
- package/dist/hooks/index.d.ts +0 -19
- package/dist/hooks/index.js +0 -897
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/index.mjs +0 -44
- package/dist/hooks/index.mjs.map +0 -1
- package/dist/hooks/use-chat.d.ts +0 -92
- package/dist/hooks/use-chat.js +0 -360
- package/dist/hooks/use-chat.js.map +0 -1
- package/dist/hooks/use-chat.mjs +0 -11
- package/dist/hooks/use-chat.mjs.map +0 -1
- package/dist/hooks/use-coagent-state-render.d.ts +0 -60
- package/dist/hooks/use-coagent-state-render.js +0 -160
- package/dist/hooks/use-coagent-state-render.js.map +0 -1
- package/dist/hooks/use-coagent-state-render.mjs +0 -9
- package/dist/hooks/use-coagent-state-render.mjs.map +0 -1
- package/dist/hooks/use-coagent.d.ts +0 -186
- package/dist/hooks/use-coagent.js +0 -726
- package/dist/hooks/use-coagent.js.map +0 -1
- package/dist/hooks/use-coagent.mjs +0 -21
- package/dist/hooks/use-coagent.mjs.map +0 -1
- package/dist/hooks/use-copilot-action.d.ts +0 -130
- package/dist/hooks/use-copilot-action.js +0 -219
- package/dist/hooks/use-copilot-action.js.map +0 -1
- package/dist/hooks/use-copilot-action.mjs +0 -9
- package/dist/hooks/use-copilot-action.mjs.map +0 -1
- package/dist/hooks/use-copilot-chat.d.ts +0 -36
- package/dist/hooks/use-copilot-chat.js +0 -623
- package/dist/hooks/use-copilot-chat.js.map +0 -1
- package/dist/hooks/use-copilot-chat.mjs +0 -22
- package/dist/hooks/use-copilot-chat.mjs.map +0 -1
- package/dist/hooks/use-copilot-readable.d.ts +0 -33
- package/dist/hooks/use-copilot-readable.js +0 -146
- package/dist/hooks/use-copilot-readable.js.map +0 -1
- package/dist/hooks/use-copilot-readable.mjs +0 -9
- package/dist/hooks/use-copilot-readable.mjs.map +0 -1
- package/dist/hooks/use-copilot-runtime-client.d.ts +0 -5
- package/dist/hooks/use-copilot-runtime-client.js +0 -76
- package/dist/hooks/use-copilot-runtime-client.js.map +0 -1
- package/dist/hooks/use-copilot-runtime-client.mjs +0 -10
- package/dist/hooks/use-copilot-runtime-client.mjs.map +0 -1
- package/dist/hooks/use-flat-category-store.d.ts +0 -9
- package/dist/hooks/use-flat-category-store.js +0 -90
- package/dist/hooks/use-flat-category-store.js.map +0 -1
- package/dist/hooks/use-flat-category-store.mjs +0 -8
- package/dist/hooks/use-flat-category-store.mjs.map +0 -1
- package/dist/hooks/use-make-copilot-document-readable.d.ts +0 -12
- package/dist/hooks/use-make-copilot-document-readable.js +0 -141
- package/dist/hooks/use-make-copilot-document-readable.js.map +0 -1
- package/dist/hooks/use-make-copilot-document-readable.mjs +0 -9
- package/dist/hooks/use-make-copilot-document-readable.mjs.map +0 -1
- package/dist/hooks/use-tree.d.ts +0 -18
- package/dist/hooks/use-tree.js +0 -172
- package/dist/hooks/use-tree.js.map +0 -1
- package/dist/hooks/use-tree.mjs +0 -8
- package/dist/hooks/use-tree.mjs.map +0 -1
- package/dist/index.d.ts +0 -26
- package/dist/index.js +0 -1810
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -71
- package/dist/index.mjs.map +0 -1
- package/dist/lib/copilot-task.d.ts +0 -92
- package/dist/lib/copilot-task.js +0 -157
- package/dist/lib/copilot-task.js.map +0 -1
- package/dist/lib/copilot-task.mjs +0 -18
- package/dist/lib/copilot-task.mjs.map +0 -1
- package/dist/lib/index.d.ts +0 -11
- package/dist/lib/index.js +0 -159
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/index.mjs +0 -19
- package/dist/lib/index.mjs.map +0 -1
- package/dist/types/chat-suggestion-configuration.d.ts +0 -22
- package/dist/types/chat-suggestion-configuration.js +0 -19
- package/dist/types/chat-suggestion-configuration.js.map +0 -1
- package/dist/types/chat-suggestion-configuration.mjs +0 -1
- package/dist/types/chat-suggestion-configuration.mjs.map +0 -1
- package/dist/types/coagent-action.d.ts +0 -29
- package/dist/types/coagent-action.js +0 -19
- package/dist/types/coagent-action.js.map +0 -1
- package/dist/types/coagent-action.mjs +0 -1
- package/dist/types/coagent-action.mjs.map +0 -1
- package/dist/types/coagent-state.d.ts +0 -11
- package/dist/types/coagent-state.js +0 -19
- package/dist/types/coagent-state.js.map +0 -1
- package/dist/types/coagent-state.mjs +0 -1
- package/dist/types/coagent-state.mjs.map +0 -1
- package/dist/types/document-pointer.d.ts +0 -9
- package/dist/types/document-pointer.js +0 -19
- package/dist/types/document-pointer.js.map +0 -1
- package/dist/types/document-pointer.mjs +0 -1
- package/dist/types/document-pointer.mjs.map +0 -1
- package/dist/types/frontend-action.d.ts +0 -107
- package/dist/types/frontend-action.js +0 -19
- package/dist/types/frontend-action.js.map +0 -1
- package/dist/types/frontend-action.mjs +0 -1
- package/dist/types/frontend-action.mjs.map +0 -1
- package/dist/types/index.d.ts +0 -6
- package/dist/types/index.js +0 -19
- package/dist/types/index.js.map +0 -1
- package/dist/types/index.mjs +0 -2
- package/dist/types/index.mjs.map +0 -1
- package/dist/types/system-message.d.ts +0 -3
- package/dist/types/system-message.js +0 -19
- package/dist/types/system-message.js.map +0 -1
- package/dist/types/system-message.mjs +0 -1
- package/dist/types/system-message.mjs.map +0 -1
- package/dist/utils/dev-console.d.ts +0 -3
- package/dist/utils/dev-console.js +0 -42
- package/dist/utils/dev-console.js.map +0 -1
- package/dist/utils/dev-console.mjs +0 -8
- package/dist/utils/dev-console.mjs.map +0 -1
- package/dist/utils/extract.d.ts +0 -42
- package/dist/utils/extract.js +0 -190
- package/dist/utils/extract.js.map +0 -1
- package/dist/utils/extract.mjs +0 -17
- package/dist/utils/extract.mjs.map +0 -1
- package/dist/utils/index.d.ts +0 -13
- package/dist/utils/index.js +0 -208
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/index.mjs +0 -20
- package/dist/utils/index.mjs.map +0 -1
- package/dist/utils/utils.d.ts +0 -2
- package/dist/utils/utils.js +0 -19
- package/dist/utils/utils.js.map +0 -1
- package/dist/utils/utils.mjs +0 -1
- package/dist/utils/utils.mjs.map +0 -1
- package/dist/utils/utils.test.d.ts +0 -2
- package/dist/utils/utils.test.js +0 -9
- package/dist/utils/utils.test.js.map +0 -1
- package/dist/utils/utils.test.mjs +0 -7
- package/dist/utils/utils.test.mjs.map +0 -1
package/dist/chunk-ODN4H66E.mjs
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useToast
|
|
3
|
-
} from "./chunk-2KCEHGSI.mjs";
|
|
4
|
-
import {
|
|
5
|
-
__spreadProps,
|
|
6
|
-
__spreadValues
|
|
7
|
-
} from "./chunk-SKC7AJIV.mjs";
|
|
8
|
-
|
|
9
|
-
// src/hooks/use-copilot-runtime-client.ts
|
|
10
|
-
import {
|
|
11
|
-
CopilotRuntimeClient
|
|
12
|
-
} from "@copilotkit/runtime-client-gql";
|
|
13
|
-
import { useMemo } from "react";
|
|
14
|
-
var useCopilotRuntimeClient = (options) => {
|
|
15
|
-
const { addGraphQLErrorsToast } = useToast();
|
|
16
|
-
const runtimeClient = useMemo(() => {
|
|
17
|
-
return new CopilotRuntimeClient(__spreadProps(__spreadValues({}, options), {
|
|
18
|
-
handleGQLErrors: (error) => {
|
|
19
|
-
if (error.graphQLErrors.length) {
|
|
20
|
-
addGraphQLErrorsToast(error.graphQLErrors);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}));
|
|
24
|
-
}, [options, addGraphQLErrorsToast]);
|
|
25
|
-
return runtimeClient;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export {
|
|
29
|
-
useCopilotRuntimeClient
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=chunk-ODN4H66E.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-copilot-runtime-client.ts"],"sourcesContent":["import {\n CopilotRuntimeClient,\n CopilotRuntimeClientOptions,\n GraphQLError,\n} from \"@copilotkit/runtime-client-gql\";\nimport { useToast } from \"../components/toast/toast-provider\";\nimport { useMemo } from \"react\";\n\nexport const useCopilotRuntimeClient = (options: CopilotRuntimeClientOptions) => {\n const { addGraphQLErrorsToast } = useToast();\n\n const runtimeClient = useMemo(() => {\n return new CopilotRuntimeClient({\n ...options,\n handleGQLErrors: (error) => {\n if ((error as any).graphQLErrors.length) {\n addGraphQLErrorsToast((error as any).graphQLErrors as GraphQLError[]);\n }\n },\n });\n }, [options, addGraphQLErrorsToast]);\n\n return runtimeClient;\n};\n"],"mappings":";;;;;;;;;AAAA;AAAA,EACE;AAAA,OAGK;AAEP,SAAS,eAAe;AAEjB,IAAM,0BAA0B,CAAC,YAAyC;AAC/E,QAAM,EAAE,sBAAsB,IAAI,SAAS;AAE3C,QAAM,gBAAgB,QAAQ,MAAM;AAClC,WAAO,IAAI,qBAAqB,iCAC3B,UAD2B;AAAA,MAE9B,iBAAiB,CAAC,UAAU;AAC1B,YAAK,MAAc,cAAc,QAAQ;AACvC,gCAAuB,MAAc,aAA+B;AAAA,QACtE;AAAA,MACF;AAAA,IACF,EAAC;AAAA,EACH,GAAG,CAAC,SAAS,qBAAqB,CAAC;AAEnC,SAAO;AACT;","names":[]}
|
package/dist/chunk-QDGDXRRJ.mjs
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useCopilotContext
|
|
3
|
-
} from "./chunk-LODRWFMB.mjs";
|
|
4
|
-
|
|
5
|
-
// src/hooks/use-copilot-readable.ts
|
|
6
|
-
import { useEffect, useRef } from "react";
|
|
7
|
-
function convertToJSON(description, value) {
|
|
8
|
-
return `${description}: ${typeof value === "string" ? value : JSON.stringify(value)}`;
|
|
9
|
-
}
|
|
10
|
-
function useCopilotReadable({ description, value, parentId, categories, convert }, dependencies) {
|
|
11
|
-
const { addContext, removeContext } = useCopilotContext();
|
|
12
|
-
const idRef = useRef();
|
|
13
|
-
convert = convert || convertToJSON;
|
|
14
|
-
const information = convert(description, value);
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
const id = addContext(information, parentId, categories);
|
|
17
|
-
idRef.current = id;
|
|
18
|
-
return () => {
|
|
19
|
-
removeContext(id);
|
|
20
|
-
};
|
|
21
|
-
}, [information, parentId, addContext, removeContext, ...dependencies || []]);
|
|
22
|
-
return idRef.current;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export {
|
|
26
|
-
useCopilotReadable
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=chunk-QDGDXRRJ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-copilot-readable.ts"],"sourcesContent":["/**\n * `useCopilotReadable` is a React hook that provides app-state and other information\n * to the Copilot. Optionally, the hook can also handle hierarchical state within your\n * application, passing these parent-child relationships to the Copilot.\n *\n * ## Usage\n *\n * ### Simple Usage\n *\n * In its most basic usage, useCopilotReadable accepts a single string argument\n * representing any piece of app state, making it available for the Copilot to use\n * as context when responding to user input.\n *\n * ```tsx\n * import { useCopilotReadable } from \"@copilotkit/react-core\";\n *\n * export function MyComponent() {\n * const [employees, setEmployees] = useState([]);\n *\n * useCopilotReadable({\n * description: \"The list of employees\",\n * value: employees,\n * });\n * }\n * ```\n *\n * ### Nested Components\n *\n * Optionally, you can maintain the hierarchical structure of information by passing\n * `parentId`. This allows you to use `useCopilotReadable` in nested components:\n *\n * ```tsx /employeeContextId/1 {17,23}\n * import { useCopilotReadable } from \"@copilotkit/react-core\";\n *\n * function Employee(props: EmployeeProps) {\n * const { employeeName, workProfile, metadata } = props;\n *\n * // propagate any information to copilot\n * const employeeContextId = useCopilotReadable({\n * description: \"Employee name\",\n * value: employeeName\n * });\n *\n * // Pass a parentID to maintain a hierarchical structure.\n * // Especially useful with child React components, list elements, etc.\n * useCopilotReadable({\n * description: \"Work profile\",\n * value: workProfile.description(),\n * parentId: employeeContextId\n * });\n *\n * useCopilotReadable({\n * description: \"Employee metadata\",\n * value: metadata.description(),\n * parentId: employeeContextId\n * });\n *\n * return (\n * // Render as usual...\n * );\n * }\n * ```\n */\nimport { useEffect, useRef } from \"react\";\nimport { useCopilotContext } from \"../context/copilot-context\";\n\n/**\n * Options for the useCopilotReadable hook.\n */\nexport interface UseCopilotReadableOptions {\n /**\n * The description of the information to be added to the Copilot context.\n */\n description: string;\n /**\n * The value to be added to the Copilot context. Object values are automatically stringified.\n */\n value: any;\n /**\n * The ID of the parent context, if any.\n */\n parentId?: string;\n /**\n * An array of categories to control which context are visible where. Particularly useful\n * with CopilotTextarea (see `useMakeAutosuggestionFunction`)\n */\n categories?: string[];\n\n /**\n * A custom conversion function to use to serialize the value to a string. If not provided, the value\n * will be serialized using `JSON.stringify`.\n */\n convert?: (description: string, value: any) => string;\n}\n\nfunction convertToJSON(description: string, value: any): string {\n return `${description}: ${typeof value === \"string\" ? value : JSON.stringify(value)}`;\n}\n\n/**\n * Adds the given information to the Copilot context to make it readable by Copilot.\n */\nexport function useCopilotReadable(\n { description, value, parentId, categories, convert }: UseCopilotReadableOptions,\n dependencies?: any[],\n): string | undefined {\n const { addContext, removeContext } = useCopilotContext();\n const idRef = useRef<string>();\n convert = convert || convertToJSON;\n\n const information = convert(description, value);\n\n useEffect(() => {\n const id = addContext(information, parentId, categories);\n idRef.current = id;\n\n return () => {\n removeContext(id);\n };\n }, [information, parentId, addContext, removeContext, ...(dependencies || [])]);\n\n return idRef.current;\n}\n"],"mappings":";;;;;AA+DA,SAAS,WAAW,cAAc;AAgClC,SAAS,cAAc,aAAqB,OAAoB;AAC9D,SAAO,GAAG,gBAAgB,OAAO,UAAU,WAAW,QAAQ,KAAK,UAAU,KAAK;AACpF;AAKO,SAAS,mBACd,EAAE,aAAa,OAAO,UAAU,YAAY,QAAQ,GACpD,cACoB;AACpB,QAAM,EAAE,YAAY,cAAc,IAAI,kBAAkB;AACxD,QAAM,QAAQ,OAAe;AAC7B,YAAU,WAAW;AAErB,QAAM,cAAc,QAAQ,aAAa,KAAK;AAE9C,YAAU,MAAM;AACd,UAAM,KAAK,WAAW,aAAa,UAAU,UAAU;AACvD,UAAM,UAAU;AAEhB,WAAO,MAAM;AACX,oBAAc,EAAE;AAAA,IAClB;AAAA,EACF,GAAG,CAAC,aAAa,UAAU,YAAY,eAAe,GAAI,gBAAgB,CAAC,CAAE,CAAC;AAE9E,SAAO,MAAM;AACf;","names":[]}
|
package/dist/chunk-SKC7AJIV.mjs
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __restKey = (key) => typeof key === "symbol" ? key : key + "";
|
|
21
|
-
var __objRest = (source, exclude) => {
|
|
22
|
-
var target = {};
|
|
23
|
-
for (var prop in source)
|
|
24
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
-
target[prop] = source[prop];
|
|
26
|
-
if (source != null && __getOwnPropSymbols)
|
|
27
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
}
|
|
31
|
-
return target;
|
|
32
|
-
};
|
|
33
|
-
var __async = (__this, __arguments, generator) => {
|
|
34
|
-
return new Promise((resolve, reject) => {
|
|
35
|
-
var fulfilled = (value) => {
|
|
36
|
-
try {
|
|
37
|
-
step(generator.next(value));
|
|
38
|
-
} catch (e) {
|
|
39
|
-
reject(e);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
var rejected = (value) => {
|
|
43
|
-
try {
|
|
44
|
-
step(generator.throw(value));
|
|
45
|
-
} catch (e) {
|
|
46
|
-
reject(e);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
50
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export {
|
|
55
|
-
__spreadValues,
|
|
56
|
-
__spreadProps,
|
|
57
|
-
__restKey,
|
|
58
|
-
__objRest,
|
|
59
|
-
__async
|
|
60
|
-
};
|
|
61
|
-
//# sourceMappingURL=chunk-SKC7AJIV.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/chunk-XINZBP3J.mjs
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CopilotContext
|
|
3
|
-
} from "./chunk-LODRWFMB.mjs";
|
|
4
|
-
|
|
5
|
-
// src/hooks/use-coagent-state-render.ts
|
|
6
|
-
import { useRef, useContext, useEffect } from "react";
|
|
7
|
-
import { randomId } from "@copilotkit/shared";
|
|
8
|
-
function useCoAgentStateRender(action, dependencies) {
|
|
9
|
-
const {
|
|
10
|
-
setCoAgentStateRender,
|
|
11
|
-
removeCoAgentStateRender,
|
|
12
|
-
coAgentStateRenders,
|
|
13
|
-
chatComponentsCache
|
|
14
|
-
} = useContext(CopilotContext);
|
|
15
|
-
const idRef = useRef(randomId());
|
|
16
|
-
const key = `${action.name}-${action.nodeName || "global"}`;
|
|
17
|
-
if (dependencies === void 0) {
|
|
18
|
-
if (coAgentStateRenders[idRef.current]) {
|
|
19
|
-
coAgentStateRenders[idRef.current].handler = action.handler;
|
|
20
|
-
if (typeof action.render === "function") {
|
|
21
|
-
if (chatComponentsCache.current !== null) {
|
|
22
|
-
chatComponentsCache.current.coAgentStateRenders[key] = action.render;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
setCoAgentStateRender(idRef.current, action);
|
|
29
|
-
if (chatComponentsCache.current !== null && action.render !== void 0) {
|
|
30
|
-
chatComponentsCache.current.coAgentStateRenders[key] = action.render;
|
|
31
|
-
}
|
|
32
|
-
return () => {
|
|
33
|
-
removeCoAgentStateRender(idRef.current);
|
|
34
|
-
};
|
|
35
|
-
}, [
|
|
36
|
-
setCoAgentStateRender,
|
|
37
|
-
removeCoAgentStateRender,
|
|
38
|
-
action.name,
|
|
39
|
-
// include render only if it's a string
|
|
40
|
-
typeof action.render === "string" ? action.render : void 0,
|
|
41
|
-
// dependencies set by the developer
|
|
42
|
-
...dependencies || []
|
|
43
|
-
]);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export {
|
|
47
|
-
useCoAgentStateRender
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=chunk-XINZBP3J.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-coagent-state-render.ts"],"sourcesContent":["/**\n * <Callout type=\"info\">\n * Usage of this hook assumes some additional setup in your application, for more information\n * on that see the CoAgents <span className=\"text-blue-500\">[Agentic Generative UI documentation](/coagents/chat-ui/render-agent-state)</span>.\n * </Callout>\n *\n * The useCoAgentStateRender hook allows you to render UI components or text based on a Agentic Copilot's state.\n * This is particularly useful for showing intermediate state or progress during Agentic Copilot operations.\n *\n * ## Usage\n *\n * ### Simple Usage\n *\n * ```tsx\n * import { useCoagentStateRender } from \"@copilotkit/react-core\";\n *\n * type YourAgentState = {\n * agent_state_property: string;\n * }\n *\n * useCoagentStateRender<YourAgentState>({\n * name: \"basic_agent\",\n * nodeName: \"optionally_specify_a_specific_node\",\n * render: ({ status, state, nodeName }) => {\n * return (\n * <YourComponent\n * agentStateProperty={state.agent_state_property}\n * status={status}\n * nodeName={nodeName}\n * />\n * );\n * },\n * });\n * ```\n *\n * This allows for you to render UI components or text based on what is happening within the agent.\n *\n * ### Example\n * A great example of this is in our Perplexity Clone where we render the progress of an agent's internet search as it is happening.\n * You can play around with it below or learn how to build it with its [demo](/coagents/videos/perplexity-clone).\n *\n * <Callout type=\"info\">\n * This example is hosted on Vercel and may take a few seconds to load.\n * </Callout>\n *\n * <iframe src=\"https://examples-coagents-ai-researcher-ui.vercel.app/\" className=\"w-full rounded-lg border h-[700px] my-4\" />\n */\n\nimport { useRef, useContext, useEffect } from \"react\";\nimport { CopilotContext } from \"../context/copilot-context\";\nimport { randomId } from \"@copilotkit/shared\";\nimport { CoAgentStateRender } from \"../types/coagent-action\";\n\n/**\n * This hook is used to render agent state with custom UI components or text. This is particularly\n * useful for showing intermediate state or progress during Agentic Copilot operations.\n * To get started using rendering intermediate state through this hook, checkout the documentation.\n *\n * https://docs.copilotkit.ai/coagents/chat-ui/render-agent-state.\n */\n\n// We implement useCoAgentStateRender dependency handling so that\n// the developer has the option to not provide any dependencies.\n// see useCopilotAction for more details about this approach.\nexport function useCoAgentStateRender<T = any>(\n action: CoAgentStateRender<T>,\n dependencies?: any[],\n): void {\n const {\n setCoAgentStateRender,\n removeCoAgentStateRender,\n coAgentStateRenders,\n chatComponentsCache,\n } = useContext(CopilotContext);\n const idRef = useRef<string>(randomId());\n\n const key = `${action.name}-${action.nodeName || \"global\"}`;\n\n if (dependencies === undefined) {\n if (coAgentStateRenders[idRef.current]) {\n coAgentStateRenders[idRef.current].handler = action.handler as any;\n if (typeof action.render === \"function\") {\n if (chatComponentsCache.current !== null) {\n chatComponentsCache.current.coAgentStateRenders[key] = action.render;\n }\n }\n }\n }\n\n useEffect(() => {\n setCoAgentStateRender(idRef.current, action as any);\n if (chatComponentsCache.current !== null && action.render !== undefined) {\n chatComponentsCache.current.coAgentStateRenders[key] = action.render;\n }\n return () => {\n removeCoAgentStateRender(idRef.current);\n };\n }, [\n setCoAgentStateRender,\n removeCoAgentStateRender,\n action.name,\n // include render only if it's a string\n typeof action.render === \"string\" ? action.render : undefined,\n // dependencies set by the developer\n ...(dependencies || []),\n ]);\n}\n"],"mappings":";;;;;AAgDA,SAAS,QAAQ,YAAY,iBAAiB;AAE9C,SAAS,gBAAgB;AAclB,SAAS,sBACd,QACA,cACM;AACN,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,cAAc;AAC7B,QAAM,QAAQ,OAAe,SAAS,CAAC;AAEvC,QAAM,MAAM,GAAG,OAAO,QAAQ,OAAO,YAAY;AAEjD,MAAI,iBAAiB,QAAW;AAC9B,QAAI,oBAAoB,MAAM,OAAO,GAAG;AACtC,0BAAoB,MAAM,OAAO,EAAE,UAAU,OAAO;AACpD,UAAI,OAAO,OAAO,WAAW,YAAY;AACvC,YAAI,oBAAoB,YAAY,MAAM;AACxC,8BAAoB,QAAQ,oBAAoB,GAAG,IAAI,OAAO;AAAA,QAChE;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,YAAU,MAAM;AACd,0BAAsB,MAAM,SAAS,MAAa;AAClD,QAAI,oBAAoB,YAAY,QAAQ,OAAO,WAAW,QAAW;AACvE,0BAAoB,QAAQ,oBAAoB,GAAG,IAAI,OAAO;AAAA,IAChE;AACA,WAAO,MAAM;AACX,+BAAyB,MAAM,OAAO;AAAA,IACxC;AAAA,EACF,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA,OAAO;AAAA;AAAA,IAEP,OAAO,OAAO,WAAW,WAAW,OAAO,SAAS;AAAA;AAAA,IAEpD,GAAI,gBAAgB,CAAC;AAAA,EACvB,CAAC;AACH;","names":[]}
|
package/dist/chunk-XXR4QFAQ.mjs
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CopilotMessagesContext
|
|
3
|
-
} from "./chunk-DCTJZ742.mjs";
|
|
4
|
-
import {
|
|
5
|
-
__objRest
|
|
6
|
-
} from "./chunk-SKC7AJIV.mjs";
|
|
7
|
-
|
|
8
|
-
// src/components/copilot-provider/copilot-messages.tsx
|
|
9
|
-
import { useState } from "react";
|
|
10
|
-
import { jsx } from "react/jsx-runtime";
|
|
11
|
-
function CopilotMessages(_a) {
|
|
12
|
-
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
13
|
-
const [messages, setMessages] = useState([]);
|
|
14
|
-
return /* @__PURE__ */ jsx(
|
|
15
|
-
CopilotMessagesContext.Provider,
|
|
16
|
-
{
|
|
17
|
-
value: {
|
|
18
|
-
messages,
|
|
19
|
-
setMessages
|
|
20
|
-
},
|
|
21
|
-
children
|
|
22
|
-
}
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export {
|
|
27
|
-
CopilotMessages
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=chunk-XXR4QFAQ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/copilot-provider/copilot-messages.tsx"],"sourcesContent":["/**\n * An internal context to separate the messages state (which is constantly changing) from the rest of CopilotKit context\n */\n\nimport { useState } from \"react\";\nimport { CopilotMessagesContext } from \"../../context/copilot-messages-context\";\nimport { Message } from \"@copilotkit/runtime-client-gql\";\nimport { CopilotKitProps } from \"./copilotkit-props\";\n\nexport function CopilotMessages({ children, ...props }: CopilotKitProps) {\n const [messages, setMessages] = useState<Message[]>([]);\n\n return (\n <CopilotMessagesContext.Provider\n value={{\n messages,\n setMessages,\n }}\n >\n {children}\n </CopilotMessagesContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;AAIA,SAAS,gBAAgB;AASrB;AAJG,SAAS,gBAAgB,IAAyC;AAAzC,eAAE,WATlC,IASgC,IAAe,kBAAf,IAAe,CAAb;AAChC,QAAM,CAAC,UAAU,WAAW,IAAI,SAAoB,CAAC,CAAC;AAEtD,SACE;AAAA,IAAC,uBAAuB;AAAA,IAAvB;AAAA,MACC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,MACF;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;","names":[]}
|
package/dist/chunk-YPSGKPDA.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-YPSGKPDA.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { CopilotKitProps } from './copilotkit-props.js';
|
|
3
|
-
import 'react';
|
|
4
|
-
|
|
5
|
-
declare function CopilotMessages({ children, ...props }: CopilotKitProps): react_jsx_runtime.JSX.Element;
|
|
6
|
-
|
|
7
|
-
export { CopilotMessages };
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __objRest = (source, exclude) => {
|
|
11
|
-
var target = {};
|
|
12
|
-
for (var prop in source)
|
|
13
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
14
|
-
target[prop] = source[prop];
|
|
15
|
-
if (source != null && __getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
17
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
18
|
-
target[prop] = source[prop];
|
|
19
|
-
}
|
|
20
|
-
return target;
|
|
21
|
-
};
|
|
22
|
-
var __export = (target, all) => {
|
|
23
|
-
for (var name in all)
|
|
24
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
25
|
-
};
|
|
26
|
-
var __copyProps = (to, from, except, desc) => {
|
|
27
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
28
|
-
for (let key of __getOwnPropNames(from))
|
|
29
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
30
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
31
|
-
}
|
|
32
|
-
return to;
|
|
33
|
-
};
|
|
34
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
35
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
36
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
37
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
38
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
39
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
40
|
-
mod
|
|
41
|
-
));
|
|
42
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
43
|
-
|
|
44
|
-
// src/components/copilot-provider/copilot-messages.tsx
|
|
45
|
-
var copilot_messages_exports = {};
|
|
46
|
-
__export(copilot_messages_exports, {
|
|
47
|
-
CopilotMessages: () => CopilotMessages
|
|
48
|
-
});
|
|
49
|
-
module.exports = __toCommonJS(copilot_messages_exports);
|
|
50
|
-
var import_react2 = require("react");
|
|
51
|
-
|
|
52
|
-
// src/context/copilot-messages-context.tsx
|
|
53
|
-
var import_react = __toESM(require("react"));
|
|
54
|
-
var emptyCopilotContext = {
|
|
55
|
-
messages: [],
|
|
56
|
-
setMessages: () => []
|
|
57
|
-
};
|
|
58
|
-
var CopilotMessagesContext = import_react.default.createContext(emptyCopilotContext);
|
|
59
|
-
|
|
60
|
-
// src/components/copilot-provider/copilot-messages.tsx
|
|
61
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
62
|
-
function CopilotMessages(_a) {
|
|
63
|
-
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
64
|
-
const [messages, setMessages] = (0, import_react2.useState)([]);
|
|
65
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
66
|
-
CopilotMessagesContext.Provider,
|
|
67
|
-
{
|
|
68
|
-
value: {
|
|
69
|
-
messages,
|
|
70
|
-
setMessages
|
|
71
|
-
},
|
|
72
|
-
children
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
77
|
-
0 && (module.exports = {
|
|
78
|
-
CopilotMessages
|
|
79
|
-
});
|
|
80
|
-
//# sourceMappingURL=copilot-messages.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/copilot-provider/copilot-messages.tsx","../../../src/context/copilot-messages-context.tsx"],"sourcesContent":["/**\n * An internal context to separate the messages state (which is constantly changing) from the rest of CopilotKit context\n */\n\nimport { useState } from \"react\";\nimport { CopilotMessagesContext } from \"../../context/copilot-messages-context\";\nimport { Message } from \"@copilotkit/runtime-client-gql\";\nimport { CopilotKitProps } from \"./copilotkit-props\";\n\nexport function CopilotMessages({ children, ...props }: CopilotKitProps) {\n const [messages, setMessages] = useState<Message[]>([]);\n\n return (\n <CopilotMessagesContext.Provider\n value={{\n messages,\n setMessages,\n }}\n >\n {children}\n </CopilotMessagesContext.Provider>\n );\n}\n","/**\n * An internal context to separate the messages state (which is constantly changing) from the rest of CopilotKit context\n */\n\nimport { Message } from \"@copilotkit/runtime-client-gql\";\nimport React from \"react\";\n\nexport interface CopilotMessagesContextParams {\n messages: Message[];\n setMessages: React.Dispatch<React.SetStateAction<Message[]>>;\n}\n\nconst emptyCopilotContext: CopilotMessagesContextParams = {\n messages: [],\n setMessages: () => [],\n};\n\nexport const CopilotMessagesContext =\n React.createContext<CopilotMessagesContextParams>(emptyCopilotContext);\n\nexport function useCopilotMessagesContext(): CopilotMessagesContextParams {\n const context = React.useContext(CopilotMessagesContext);\n if (context === emptyCopilotContext) {\n throw new Error(\n \"A messages consuming component was not wrapped with `<CopilotMessages> {...} </CopilotMessages>`\",\n );\n }\n return context;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,IAAAA,gBAAyB;;;ACCzB,mBAAkB;AAOlB,IAAM,sBAAoD;AAAA,EACxD,UAAU,CAAC;AAAA,EACX,aAAa,MAAM,CAAC;AACtB;AAEO,IAAM,yBACX,aAAAC,QAAM,cAA4C,mBAAmB;;;ADLnE;AAJG,SAAS,gBAAgB,IAAyC;AAAzC,eAAE,WATlC,IASgC,IAAe,kBAAf,IAAe,CAAb;AAChC,QAAM,CAAC,UAAU,WAAW,QAAI,wBAAoB,CAAC,CAAC;AAEtD,SACE;AAAA,IAAC,uBAAuB;AAAA,IAAvB;AAAA,MACC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,MACF;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;","names":["import_react","React"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Props for CopilotKit.
|
|
5
|
-
*/
|
|
6
|
-
interface CopilotKitProps {
|
|
7
|
-
/**
|
|
8
|
-
* Your Copilot Cloud API key. Don't have it yet? Go to https://cloud.copilotkit.ai and get one for free.
|
|
9
|
-
*/
|
|
10
|
-
publicApiKey?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Restrict input to a specific topic.
|
|
13
|
-
*/
|
|
14
|
-
cloudRestrictToTopic?: {
|
|
15
|
-
validTopics?: string[];
|
|
16
|
-
invalidTopics?: string[];
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* The endpoint for the Copilot Runtime instance. [Click here for more information](/concepts/copilot-runtime).
|
|
20
|
-
*/
|
|
21
|
-
runtimeUrl?: string;
|
|
22
|
-
/**
|
|
23
|
-
* The endpoint for the Copilot transcribe audio service.
|
|
24
|
-
*/
|
|
25
|
-
transcribeAudioUrl?: string;
|
|
26
|
-
/**
|
|
27
|
-
* The endpoint for the Copilot text to speech service.
|
|
28
|
-
*/
|
|
29
|
-
textToSpeechUrl?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Additional headers to be sent with the request.
|
|
32
|
-
*
|
|
33
|
-
* For example:
|
|
34
|
-
* ```json
|
|
35
|
-
* {
|
|
36
|
-
* "Authorization": "Bearer X"
|
|
37
|
-
* }
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
headers?: Record<string, string>;
|
|
41
|
-
/**
|
|
42
|
-
* The children to be rendered within the CopilotKit.
|
|
43
|
-
*/
|
|
44
|
-
children: ReactNode;
|
|
45
|
-
/**
|
|
46
|
-
* Custom properties to be sent with the request
|
|
47
|
-
* For example:
|
|
48
|
-
* ```js
|
|
49
|
-
* {
|
|
50
|
-
* 'user_id': 'users_id',
|
|
51
|
-
* }
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
properties?: Record<string, any>;
|
|
55
|
-
/**
|
|
56
|
-
* Indicates whether the user agent should send or receive cookies from the other domain
|
|
57
|
-
* in the case of cross-origin requests.
|
|
58
|
-
*/
|
|
59
|
-
credentials?: RequestCredentials;
|
|
60
|
-
/**
|
|
61
|
-
* Whether to show the dev console.
|
|
62
|
-
*
|
|
63
|
-
* If set to "auto", the dev console will be show on localhost only.
|
|
64
|
-
*/
|
|
65
|
-
showDevConsole?: boolean | "auto";
|
|
66
|
-
/**
|
|
67
|
-
* The name of the agent to use.
|
|
68
|
-
*/
|
|
69
|
-
agent?: string;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export { CopilotKitProps };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/components/copilot-provider/copilotkit-props.tsx
|
|
17
|
-
var copilotkit_props_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(copilotkit_props_exports);
|
|
19
|
-
//# sourceMappingURL=copilotkit-props.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/copilot-provider/copilotkit-props.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\n\n/**\n * Props for CopilotKit.\n */\n\nexport interface CopilotKitProps {\n /**\n * Your Copilot Cloud API key. Don't have it yet? Go to https://cloud.copilotkit.ai and get one for free.\n */\n publicApiKey?: string;\n\n /**\n * Restrict input to a specific topic.\n */\n cloudRestrictToTopic?: {\n validTopics?: string[];\n invalidTopics?: string[];\n };\n\n /**\n * The endpoint for the Copilot Runtime instance. [Click here for more information](/concepts/copilot-runtime).\n */\n runtimeUrl?: string;\n\n /**\n * The endpoint for the Copilot transcribe audio service.\n */\n transcribeAudioUrl?: string;\n\n /**\n * The endpoint for the Copilot text to speech service.\n */\n textToSpeechUrl?: string;\n\n /**\n * Additional headers to be sent with the request.\n *\n * For example:\n * ```json\n * {\n * \"Authorization\": \"Bearer X\"\n * }\n * ```\n */\n headers?: Record<string, string>;\n\n /**\n * The children to be rendered within the CopilotKit.\n */\n children: ReactNode;\n\n /**\n * Custom properties to be sent with the request\n * For example:\n * ```js\n * {\n * 'user_id': 'users_id',\n * }\n * ```\n */\n properties?: Record<string, any>;\n\n /**\n * Indicates whether the user agent should send or receive cookies from the other domain\n * in the case of cross-origin requests.\n */\n credentials?: RequestCredentials;\n\n /**\n * Whether to show the dev console.\n *\n * If set to \"auto\", the dev console will be show on localhost only.\n */\n showDevConsole?: boolean | \"auto\";\n\n /**\n * The name of the agent to use.\n */\n agent?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=copilotkit-props.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CopilotKitProps } from './copilotkit-props.js';
|
|
2
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import 'react';
|
|
4
|
-
|
|
5
|
-
declare function CopilotKit({ children, ...props }: CopilotKitProps): react_jsx_runtime.JSX.Element;
|
|
6
|
-
declare function CopilotKitInternal({ children, ...props }: CopilotKitProps): react_jsx_runtime.JSX.Element;
|
|
7
|
-
declare const defaultCopilotContextCategories: string[];
|
|
8
|
-
|
|
9
|
-
export { CopilotKit, CopilotKitInternal, defaultCopilotContextCategories };
|