@copilotkit/vue 1.62.0 → 1.62.2
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/PARITY.md +7 -7
- package/dist/index-By5nIKxT.js +1632 -0
- package/dist/index-By5nIKxT.js.map +1 -0
- package/dist/index-LFxZI63k.cjs +748 -0
- package/dist/index-LFxZI63k.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +70 -69
- package/dist/styles.css +1 -1
- package/dist/{use-render-activity-message-Bzh3Bckz.js → use-render-activity-message-DbGuwvBd.js} +3363 -3064
- package/dist/use-render-activity-message-DbGuwvBd.js.map +1 -0
- package/dist/use-render-activity-message-hlNcbV9l.cjs +85 -0
- package/dist/use-render-activity-message-hlNcbV9l.cjs.map +1 -0
- package/dist/v2/components/chat/CopilotChat.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotModalHeader.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotThreadsDrawer.vue.d.ts +42 -0
- package/dist/v2/components/chat/CopilotThreadsDrawer.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/index.d.ts +1 -0
- package/dist/v2/components/chat/index.d.ts.map +1 -1
- package/dist/v2/components/icons/index.d.ts +1 -1
- package/dist/v2/components/icons/index.d.ts.map +1 -1
- package/dist/v2/hooks/use-agent.d.ts.map +1 -1
- package/dist/v2/hooks/use-threads.d.ts +12 -0
- package/dist/v2/hooks/use-threads.d.ts.map +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.mjs +44 -43
- package/dist/v2/lib/is-mobile-viewport.d.ts +15 -0
- package/dist/v2/lib/is-mobile-viewport.d.ts.map +1 -0
- package/dist/v2/providers/CopilotChatConfigurationProvider.vue.d.ts.map +1 -1
- package/dist/v2/providers/types.d.ts +24 -0
- package/dist/v2/providers/types.d.ts.map +1 -1
- package/package.json +7 -6
- package/src/v2/components/chat/CopilotChat.vue +22 -4
- package/src/v2/components/chat/CopilotModalHeader.vue +61 -2
- package/src/v2/components/chat/CopilotThreadsDrawer.vue +285 -0
- package/src/v2/components/chat/__tests__/CopilotChat.clearOnFresh.test.ts +160 -0
- package/src/v2/components/chat/__tests__/CopilotModalHeader.drawerLauncher.test.ts +125 -0
- package/src/v2/components/chat/__tests__/CopilotThreadsDrawer.ssr.test.ts +25 -0
- package/src/v2/components/chat/__tests__/CopilotThreadsDrawer.test.ts +835 -0
- package/src/v2/components/chat/index.ts +1 -0
- package/src/v2/components/icons/index.ts +1 -0
- package/src/v2/hooks/__tests__/use-agent.test.ts +60 -1
- package/src/v2/hooks/__tests__/use-human-in-the-loop.e2e.test.ts +4 -4
- package/src/v2/hooks/__tests__/use-threads.test.ts +303 -6
- package/src/v2/hooks/use-agent.ts +4 -1
- package/src/v2/hooks/use-threads.ts +137 -8
- package/src/v2/lib/__tests__/is-mobile-viewport.test.ts +48 -0
- package/src/v2/lib/is-mobile-viewport.ts +23 -0
- package/src/v2/providers/CopilotChatConfigurationProvider.vue +120 -4
- package/src/v2/providers/__tests__/CopilotChatConfigurationProvider.test.ts +105 -1
- package/src/v2/providers/types.ts +25 -0
- package/dist/use-render-activity-message-Bzh3Bckz.js.map +0 -1
- package/dist/use-render-activity-message-CW3vipBB.cjs +0 -85
- package/dist/use-render-activity-message-CW3vipBB.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopilotChat.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/chat/CopilotChat.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CopilotChat.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/chat/CopilotChat.vue"],"names":[],"mappings":"AAkzBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAiBnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,KAAK,EACV,yBAAyB,EACzB,gBAAgB,EAChB,6BAA6B,EAC7B,kCAAkC,EAClC,gCAAgC,EAChC,iCAAiC,EAClC,MAAM,SAAS,CAAC;AAcjB,KAAK,WAAW,GAAG;IACjB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,gCAAgC,KAAK,OAAO,CAAC;IACnE,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE;QACvB,QAAQ,EAAE,OAAO,EAAE,CAAC;QACpB,SAAS,EAAE,OAAO,CAAC;KACpB,KAAK,OAAO,CAAC;IACd,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,6BAA6B,KAAK,OAAO,CAAC;IAC9D,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,OAAO,CAAC;IACtD,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,kCAAkC,KAAK,OAAO,CAAC;IAC3E,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,iCAAiC,KAAK,OAAO,CAAC;IACzE,iBAAiB,CAAC,EAAE,MAAM,OAAO,CAAC;IAElC,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,SAAS,CAAC;CACtD,CAAC;AA2yBF,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;6EAQnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopilotModalHeader.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/chat/CopilotModalHeader.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CopilotModalHeader.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/chat/CopilotModalHeader.vue"],"names":[],"mappings":"AA6IA,OAAO,KAAK,EACV,sCAAsC,EACtC,iCAAiC,EACjC,uBAAuB,EACvB,uCAAuC,EACxC,MAAM,SAAS,CAAC;AAOjB,KAAK,WAAW,GAAG;IACjB,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,uCAAuC,KAAK,OAAO,CAAC;IAC9E,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,sCAAsC,KAAK,OAAO,CAAC;IAC5E,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,iCAAiC,KAAK,OAAO,CAAC;CAChE,CAAC;AAsNF,QAAA,MAAM,eAAe,0TAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Thread } from "../../hooks/use-threads";
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
agentId?: string;
|
|
4
|
+
onThreadSelect?: (threadId: string) => void;
|
|
5
|
+
onNewThread?: () => void;
|
|
6
|
+
onLicensed?: () => void;
|
|
7
|
+
licenseUrl?: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
limit?: number;
|
|
10
|
+
dataTestId?: string;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_Slots = {
|
|
13
|
+
default(): unknown;
|
|
14
|
+
/**
|
|
15
|
+
* Optional per-row content. When provided, this slot is rendered as
|
|
16
|
+
* light-DOM children with `slot="row:{id}"` for EVERY thread in the list,
|
|
17
|
+
* so the element projects it in place of the default row for all rows.
|
|
18
|
+
*
|
|
19
|
+
* Unlike React's `renderRow` (which returns `ReactNode | null` and can
|
|
20
|
+
* fall back to the element's built-in row on a per-thread basis by
|
|
21
|
+
* returning `null`), Vue's scoped slot is all-or-nothing: there is no
|
|
22
|
+
* per-row escape hatch back to the element default once the slot is
|
|
23
|
+
* defined. This is an intentional Vue-idiom divergence, not a bug — if a
|
|
24
|
+
* consumer needs per-row fallback, they should replicate the default row
|
|
25
|
+
* markup themselves inside the slot for the threads they don't want to
|
|
26
|
+
* customize.
|
|
27
|
+
*/
|
|
28
|
+
row(props: {
|
|
29
|
+
thread: Thread;
|
|
30
|
+
}): unknown;
|
|
31
|
+
};
|
|
32
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
33
|
+
dataTestId: string;
|
|
34
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
36
|
+
export default _default;
|
|
37
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
38
|
+
new (): {
|
|
39
|
+
$slots: S;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=CopilotThreadsDrawer.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopilotThreadsDrawer.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/chat/CopilotThreadsDrawer.vue"],"names":[],"mappings":"AAkTA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAItD,KAAK,WAAW,GAAG;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAuMJ,KAAK,WAAW,GAAG;IACjB,OAAO,IAAI,OAAO,CAAC;IACnB;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;CACzC,CAAC;AAwHF,QAAA,MAAM,eAAe;gBAjVJ,MAAM;6EAwVrB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -11,6 +11,7 @@ export { default as CopilotChatSuggestionView } from "./CopilotChatSuggestionVie
|
|
|
11
11
|
export { default as CopilotChatToolCallsView } from "./CopilotChatToolCallsView.vue";
|
|
12
12
|
export { default as CopilotChatUserMessage } from "./CopilotChatUserMessage.vue";
|
|
13
13
|
export { default as CopilotChatView } from "./CopilotChatView.vue";
|
|
14
|
+
export { default as CopilotThreadsDrawer } from "./CopilotThreadsDrawer.vue";
|
|
14
15
|
import CopilotChatToggleButtonCloseIcon from "./CopilotChatToggleButtonCloseIcon";
|
|
15
16
|
import CopilotChatToggleButtonOpenIcon from "./CopilotChatToggleButtonOpenIcon";
|
|
16
17
|
export declare const CopilotChat: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/chat/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAGrF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CA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AAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEjE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAE7B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MessageCircle as IconMessageCircle, X as IconX, ChevronDown as IconChevronDown, Plus as IconPlus, Mic as IconMic, ArrowUp as IconArrowUp, Check as IconCheck, Square as IconSquare, Loader2 as IconLoader2, Copy as IconCopy, Download as IconDownload, Edit as IconEdit, ChevronLeft as IconChevronLeft, ChevronRight as IconChevronRight, ThumbsUp as IconThumbsUp, ThumbsDown as IconThumbsDown, Volume2 as IconVolume2, RefreshCw as IconRefreshCw, CheckCircle as IconCheckCircle, Circle as IconCircle, } from "lucide-vue-next";
|
|
1
|
+
export { MessageCircle as IconMessageCircle, X as IconX, ChevronDown as IconChevronDown, Plus as IconPlus, Mic as IconMic, ArrowUp as IconArrowUp, Check as IconCheck, Square as IconSquare, Loader2 as IconLoader2, Copy as IconCopy, Download as IconDownload, Edit as IconEdit, ChevronLeft as IconChevronLeft, ChevronRight as IconChevronRight, ThumbsUp as IconThumbsUp, ThumbsDown as IconThumbsDown, Volume2 as IconVolume2, RefreshCw as IconRefreshCw, CheckCircle as IconCheckCircle, Circle as IconCircle, PanelLeftOpen as IconPanelLeftOpen, } from "lucide-vue-next";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/icons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,IAAI,iBAAiB,EAClC,CAAC,IAAI,KAAK,EACV,WAAW,IAAI,eAAe,EAC9B,IAAI,IAAI,QAAQ,EAChB,GAAG,IAAI,OAAO,EACd,OAAO,IAAI,WAAW,EACtB,KAAK,IAAI,SAAS,EAClB,MAAM,IAAI,UAAU,EACpB,OAAO,IAAI,WAAW,EACtB,IAAI,IAAI,QAAQ,EAChB,QAAQ,IAAI,YAAY,EACxB,IAAI,IAAI,QAAQ,EAChB,WAAW,IAAI,eAAe,EAC9B,YAAY,IAAI,gBAAgB,EAChC,QAAQ,IAAI,YAAY,EACxB,UAAU,IAAI,cAAc,EAC5B,OAAO,IAAI,WAAW,EACtB,SAAS,IAAI,aAAa,EAC1B,WAAW,IAAI,eAAe,EAC9B,MAAM,IAAI,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/icons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,IAAI,iBAAiB,EAClC,CAAC,IAAI,KAAK,EACV,WAAW,IAAI,eAAe,EAC9B,IAAI,IAAI,QAAQ,EAChB,GAAG,IAAI,OAAO,EACd,OAAO,IAAI,WAAW,EACtB,KAAK,IAAI,SAAS,EAClB,MAAM,IAAI,UAAU,EACpB,OAAO,IAAI,WAAW,EACtB,IAAI,IAAI,QAAQ,EAChB,QAAQ,IAAI,YAAY,EACxB,IAAI,IAAI,QAAQ,EAChB,WAAW,IAAI,eAAe,EAC9B,YAAY,IAAI,gBAAgB,EAChC,QAAQ,IAAI,YAAY,EACxB,UAAU,IAAI,cAAc,EAC5B,OAAO,IAAI,WAAW,EACtB,SAAS,IAAI,aAAa,EAC1B,WAAW,IAAI,eAAe,EAC9B,MAAM,IAAI,UAAU,EACpB,aAAa,IAAI,iBAAiB,GACnC,MAAM,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-agent.d.ts","sourceRoot":"","sources":["../../../src/v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EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAChD,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;IAC3B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACnD;AAwBD,eAAO,MAAM,oBAAoB,oDAG9B,CAAC;AAEJ,wBAAgB,cAAc,CAC5B,aAAa,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,EAC/C,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAClC,aAAa,GAAG,SAAS,CAG3B;AA2BD;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,KAAK,GAAE,aAAkB;;EA0NjD"}
|
|
@@ -18,16 +18,28 @@ export interface UseThreadsInput {
|
|
|
18
18
|
agentId: MaybeRefOrGetter<string>;
|
|
19
19
|
includeArchived?: MaybeRefOrGetter<boolean | undefined>;
|
|
20
20
|
limit?: MaybeRefOrGetter<number | undefined>;
|
|
21
|
+
/**
|
|
22
|
+
* When `false`, the hook clears the store context and issues no `/threads`
|
|
23
|
+
* request — used by the drawer to skip fetching while unlicensed. Defaults
|
|
24
|
+
* to `true`.
|
|
25
|
+
*/
|
|
26
|
+
enabled?: MaybeRefOrGetter<boolean | undefined>;
|
|
21
27
|
}
|
|
22
28
|
export interface UseThreadsResult {
|
|
23
29
|
threads: Ref<Thread[]>;
|
|
24
30
|
isLoading: Ref<boolean>;
|
|
25
31
|
error: Ref<Error | null>;
|
|
32
|
+
/** Genuine list-load/mutation errors only — excludes dev/config errors. */
|
|
33
|
+
listError: Ref<Error | null>;
|
|
26
34
|
hasMoreThreads: Ref<boolean>;
|
|
27
35
|
isFetchingMoreThreads: Ref<boolean>;
|
|
36
|
+
isMutating: Ref<boolean>;
|
|
28
37
|
fetchMoreThreads: () => void;
|
|
38
|
+
refetchThreads: () => void;
|
|
39
|
+
startNewThread: () => void;
|
|
29
40
|
renameThread: (threadId: string, name: string) => Promise<void>;
|
|
30
41
|
archiveThread: (threadId: string) => Promise<void>;
|
|
42
|
+
unarchiveThread: (threadId: string) => Promise<void>;
|
|
31
43
|
deleteThread: (threadId: string) => Promise<void>;
|
|
32
44
|
}
|
|
33
45
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-threads.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/use-threads.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"use-threads.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/use-threads.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAcjD,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAClC,eAAe,CAAC,EAAE,gBAAgB,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;IACxD,KAAK,CAAC,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC7C;;;;OAIG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;CACjD;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IACvB,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACxB,KAAK,EAAE,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IACzB,2EAA2E;IAC3E,SAAS,EAAE,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IAC7B,cAAc,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,qBAAqB,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACpC,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACzB,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD;AAcD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,gBAAgB,CA+PnE"}
|
package/dist/v2/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@copilotkit/core"),i=require("@ag-ui/client"),e=require("../use-render-activity-message-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@copilotkit/core"),i=require("@ag-ui/client"),e=require("../use-render-activity-message-hlNcbV9l.cjs"),n=require("@copilotkit/shared");exports.A2UIActivityContentSchema=e.A2UIActivityContentSchema;exports.A2UISurfaceActivityRenderer=e._sfc_main;exports.A2UISurfaceActivityType=e.A2UISurfaceActivityType;exports.CopilotChat=e.CopilotChat;exports.CopilotChatAssistantMessage=e._sfc_main$1;exports.CopilotChatAttachmentQueue=e._sfc_main$2;exports.CopilotChatAttachmentRenderer=e._sfc_main$3;exports.CopilotChatAudioRecorder=e._sfc_main$4;exports.CopilotChatConfigurationProvider=e._sfc_main$5;exports.CopilotChatDefaultLabels=e.CopilotChatDefaultLabels;exports.CopilotChatInput=e._sfc_main$6;exports.CopilotChatMessageView=e._sfc_main$7;exports.CopilotChatReasoningMessage=e._sfc_main$8;exports.CopilotChatSuggestionPill=e._sfc_main$9;exports.CopilotChatSuggestionView=e._sfc_main$10;exports.CopilotChatToggleButton=e.CopilotChatToggleButton;exports.CopilotChatToggleButtonCloseIcon=e.CopilotChatToggleButtonCloseIcon;exports.CopilotChatToggleButtonOpenIcon=e.CopilotChatToggleButtonOpenIcon;exports.CopilotChatToolCallsView=e._sfc_main$11;exports.CopilotChatUserMessage=e._sfc_main$12;exports.CopilotChatView=e._sfc_main$13;exports.CopilotKitCoreVue=e.CopilotKitCoreVue;exports.CopilotKitInspector=e._sfc_main$14;exports.CopilotKitProvider=e._sfc_main$15;exports.CopilotModalHeader=e.CopilotModalHeader;exports.CopilotPopup=e._sfc_main$16;exports.CopilotPopupView=e.CopilotPopupView;exports.CopilotSidebar=e._sfc_main$17;exports.CopilotSidebarView=e.CopilotSidebarView;exports.CopilotThreadsDrawer=e._sfc_main$18;exports.GenerateSandboxedUiArgsSchema=e.GenerateSandboxedUiArgsSchema;exports.LicenseContextKey=e.LicenseContextKey;exports.MCPAppsActivityContentSchema=e.MCPAppsActivityContentSchema;exports.MCPAppsActivityRenderer=e.MCPAppsActivityRenderer;exports.MCPAppsActivityType=e.MCPAppsActivityType;exports.OpenGenerativeUIActivityRenderer=e.OpenGenerativeUIActivityRenderer;exports.OpenGenerativeUIActivityType=e.OpenGenerativeUIActivityType;exports.OpenGenerativeUIContentSchema=e.OpenGenerativeUIContentSchema;exports.OpenGenerativeUIRenderer=e.OpenGenerativeUIRenderer;exports.OpenGenerativeUIToolRenderer=e.OpenGenerativeUIToolRenderer;exports.UseAgentUpdate=e.UseAgentUpdate;exports.createA2UIMessageRenderer=e.createA2UIMessageRenderer;exports.createDefaultLicenseRef=e.createDefaultLicenseRef;exports.defineToolCallRenderer=e.defineToolCallRenderer;exports.extractCompleteStyles=e.extractCompleteStyles;exports.getOperationSurfaceId=e.getOperationSurfaceId;exports.processPartialHtml=e.processPartialHtml;exports.useAgent=e.useAgent;exports.useAgentContext=e.useAgentContext;exports.useAttachments=e.useAttachments;exports.useCapabilities=e.useCapabilities;exports.useComponent=e.useComponent;exports.useConfigureSuggestions=e.useConfigureSuggestions;exports.useCopilotChatConfiguration=e.useCopilotChatConfiguration;exports.useCopilotKit=e.useCopilotKit;exports.useDefaultRenderTool=e.useDefaultRenderTool;exports.useFrontendTool=e.useFrontendTool;exports.useHumanInTheLoop=e.useHumanInTheLoop;exports.useInterrupt=e.useInterrupt;exports.useKatexStyles=e.useKatexStyles;exports.useKeyboardHeight=e.useKeyboardHeight;exports.useLicenseContext=e.useLicenseContext;exports.useRenderActivityMessage=e.useRenderActivityMessage;exports.useRenderCustomMessages=e.useRenderCustomMessages;exports.useRenderTool=e.useRenderTool;exports.useSandboxFunctions=e.useSandboxFunctions;exports.useSuggestions=e.useSuggestions;exports.useThreads=e.useThreads;exports.vueBasicCatalog=e.vueBasicCatalog;Object.defineProperty(exports,"createLicenseContextValue",{enumerable:!0,get:()=>n.createLicenseContextValue});Object.keys(o).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>o[t]})});Object.keys(i).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>i[t]})});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/v2/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "@copilotkit/core";
|
|
2
2
|
export * from "@ag-ui/client";
|
|
3
|
-
import { A as o, _ as i, a as n, C, b as r, c as p, d as l, e as u, f as c, g, h as d, i as h, j as A, k as v, l as S, m, n as y, o as I, p as f, q as R, r as T, s as U, t as x, u as M, v as P, w as b, x as V, y as
|
|
4
|
-
import { createLicenseContextValue as
|
|
3
|
+
import { A as o, _ as i, a as n, C, b as r, c as p, d as l, e as u, f as c, g, h as d, i as h, j as A, k as v, l as S, m, n as y, o as I, p as f, q as R, r as T, s as U, t as x, u as M, v as P, w as b, x as V, y as w, z as K, B as O, G, L, M as B, D, E as H, O as F, F as Q, H as j, I as k, J as q, U as z, K as E, N as J, P as N, Q as W, R as X, S as Y, T as Z, V as _, W as $, X as ee, Y as ae, Z as te, $ as se, a0 as oe, a1 as ie, a2 as ne, a3 as Ce, a4 as re, a5 as pe, a6 as le, a7 as ue, a8 as ce, a9 as ge, aa as de, ab as he, ac as Ae, ad as ve, ae as Se } from "../use-render-activity-message-DbGuwvBd.js";
|
|
4
|
+
import { createLicenseContextValue as ye } from "@copilotkit/shared";
|
|
5
5
|
export {
|
|
6
6
|
o as A2UIActivityContentSchema,
|
|
7
7
|
i as A2UISurfaceActivityRenderer,
|
|
@@ -30,47 +30,48 @@ export {
|
|
|
30
30
|
P as CopilotModalHeader,
|
|
31
31
|
b as CopilotPopup,
|
|
32
32
|
V as CopilotPopupView,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
G as
|
|
37
|
-
L as
|
|
38
|
-
B as
|
|
33
|
+
w as CopilotSidebar,
|
|
34
|
+
K as CopilotSidebarView,
|
|
35
|
+
O as CopilotThreadsDrawer,
|
|
36
|
+
G as GenerateSandboxedUiArgsSchema,
|
|
37
|
+
L as LicenseContextKey,
|
|
38
|
+
B as MCPAppsActivityContentSchema,
|
|
39
|
+
D as MCPAppsActivityRenderer,
|
|
39
40
|
H as MCPAppsActivityType,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
41
|
+
F as OpenGenerativeUIActivityRenderer,
|
|
42
|
+
Q as OpenGenerativeUIActivityType,
|
|
43
|
+
j as OpenGenerativeUIContentSchema,
|
|
44
|
+
k as OpenGenerativeUIRenderer,
|
|
45
|
+
q as OpenGenerativeUIToolRenderer,
|
|
46
|
+
z as UseAgentUpdate,
|
|
47
|
+
E as createA2UIMessageRenderer,
|
|
48
|
+
J as createDefaultLicenseRef,
|
|
49
|
+
ye as createLicenseContextValue,
|
|
50
|
+
N as defineToolCallRenderer,
|
|
51
|
+
W as extractCompleteStyles,
|
|
52
|
+
X as getOperationSurfaceId,
|
|
53
|
+
Y as processPartialHtml,
|
|
54
|
+
Z as useAgent,
|
|
55
|
+
_ as useAgentContext,
|
|
56
|
+
$ as useAttachments,
|
|
57
|
+
ee as useCapabilities,
|
|
58
|
+
ae as useComponent,
|
|
59
|
+
te as useConfigureSuggestions,
|
|
60
|
+
se as useCopilotChatConfiguration,
|
|
61
|
+
oe as useCopilotKit,
|
|
62
|
+
ie as useDefaultRenderTool,
|
|
63
|
+
ne as useFrontendTool,
|
|
64
|
+
Ce as useHumanInTheLoop,
|
|
65
|
+
re as useInterrupt,
|
|
66
|
+
pe as useKatexStyles,
|
|
67
|
+
le as useKeyboardHeight,
|
|
68
|
+
ue as useLicenseContext,
|
|
69
|
+
ce as useRenderActivityMessage,
|
|
70
|
+
ge as useRenderCustomMessages,
|
|
71
|
+
de as useRenderTool,
|
|
72
|
+
he as useSandboxFunctions,
|
|
73
|
+
Ae as useSuggestions,
|
|
74
|
+
ve as useThreads,
|
|
75
|
+
Se as vueBasicCatalog
|
|
75
76
|
};
|
|
76
77
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Media query for the mobile breakpoint, shared so the string literal isn't
|
|
3
|
+
* duplicated across call sites within this package (e.g. `CopilotModalHeader`,
|
|
4
|
+
* which needs a live `matchMedia` change-listener and so can't call
|
|
5
|
+
* `isMobileViewport()` directly).
|
|
6
|
+
*/
|
|
7
|
+
export declare const MOBILE_MAX_WIDTH_QUERY = "(max-width: 767px)";
|
|
8
|
+
/**
|
|
9
|
+
* Reports whether the viewport is in the mobile range (`<768px`), where the
|
|
10
|
+
* drawer and chat modal are mutually exclusive. SSR-safe (returns `false`
|
|
11
|
+
* when `window` is absent) and guards environments where `window` exists but
|
|
12
|
+
* `window.matchMedia` does not (some test runners, embedded webviews).
|
|
13
|
+
*/
|
|
14
|
+
export declare function isMobileViewport(): boolean;
|
|
15
|
+
//# sourceMappingURL=is-mobile-viewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-mobile-viewport.d.ts","sourceRoot":"","sources":["../../../src/v2/lib/is-mobile-viewport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAQ1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopilotChatConfigurationProvider.vue.d.ts","sourceRoot":"","sources":["../../../src/v2/providers/CopilotChatConfigurationProvider.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CopilotChatConfigurationProvider.vue.d.ts","sourceRoot":"","sources":["../../../src/v2/providers/CopilotChatConfigurationProvider.vue"],"names":[],"mappings":"AAyNA,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,0CAA0C,CAAC;AAsNtG,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAmB/C,QAAA,MAAM,eAAe;;;6EAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -34,5 +34,29 @@ export interface CopilotChatConfigurationValue {
|
|
|
34
34
|
hasExplicitThreadId: boolean;
|
|
35
35
|
isModalOpen?: boolean;
|
|
36
36
|
setModalOpen?: (open: boolean) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Switches the active thread to `threadId`. `explicit` (default `true`)
|
|
39
|
+
* marks it a caller-driven choice so the welcome screen is suppressed.
|
|
40
|
+
* No-op when the provider's `threadId` prop is caller-authoritative.
|
|
41
|
+
*/
|
|
42
|
+
setActiveThreadId: (threadId: string, options?: {
|
|
43
|
+
explicit?: boolean;
|
|
44
|
+
}) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Switches to a freshly-minted, non-explicit thread (welcome screen shows).
|
|
47
|
+
* No-op when the provider's `threadId` prop is caller-authoritative.
|
|
48
|
+
*/
|
|
49
|
+
startNewThread: () => void;
|
|
50
|
+
/** Whether the mobile off-canvas drawer overlay is open. */
|
|
51
|
+
drawerOpen: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Toggles the drawer. On mobile (`<=767px`) opening the drawer closes the
|
|
54
|
+
* chat modal (mutual-exclusion). Desktop imposes no constraint.
|
|
55
|
+
*/
|
|
56
|
+
setDrawerOpen: (open: boolean) => void;
|
|
57
|
+
/** True when at least one drawer has registered (gates the header launcher). */
|
|
58
|
+
drawerRegistered: boolean;
|
|
59
|
+
/** Announces drawer presence; returns a cleanup that de-registers it. */
|
|
60
|
+
registerDrawer: () => () => void;
|
|
37
61
|
}
|
|
38
62
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/v2/providers/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;CAsB3B,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,OAAO,wBAAwB,CAAC;AAEhE,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/v2/providers/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;CAsB3B,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,OAAO,wBAAwB,CAAC;AAEhE,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC;;;;OAIG;IACH,iBAAiB,EAAE,CACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,KAC7B,IAAI,CAAC;IACV;;;OAGG;IACH,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,4DAA4D;IAC5D,UAAU,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,gFAAgF;IAChF,gBAAgB,EAAE,OAAO,CAAC;IAC1B,yEAAyE;IACzE,cAAc,EAAE,MAAM,MAAM,IAAI,CAAC;CAClC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@copilotkit/vue",
|
|
3
|
-
"version": "1.62.
|
|
3
|
+
"version": "1.62.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Vue 3 components and composables for CopilotKit",
|
|
6
6
|
"keywords": [
|
|
@@ -70,9 +70,10 @@
|
|
|
70
70
|
"streamdown-vue": "^1.0.29",
|
|
71
71
|
"zod": "^3.25.75",
|
|
72
72
|
"zod-to-json-schema": "^3.24.5",
|
|
73
|
-
"@copilotkit/core": "1.62.
|
|
74
|
-
"@copilotkit/web-
|
|
75
|
-
"@copilotkit/shared": "1.62.
|
|
73
|
+
"@copilotkit/core": "1.62.2",
|
|
74
|
+
"@copilotkit/web-components": "1.62.2",
|
|
75
|
+
"@copilotkit/shared": "1.62.2",
|
|
76
|
+
"@copilotkit/web-inspector": "1.62.2"
|
|
76
77
|
},
|
|
77
78
|
"devDependencies": {
|
|
78
79
|
"@eslint/js": "^9.39.2",
|
|
@@ -114,7 +115,7 @@
|
|
|
114
115
|
"scripts": {
|
|
115
116
|
"build": "vite build && pnpm build:css && pnpm build:types",
|
|
116
117
|
"build:css": "npx @tailwindcss/cli -i ./src/styles/globals.css -o ./dist/styles.css -m && node scripts/scope-preflight.mjs ./dist/styles.css",
|
|
117
|
-
"build:types": "vue-tsc -p tsconfig.json --declaration --emitDeclarationOnly --outDir dist --skipLibCheck &&
|
|
118
|
+
"build:types": "vue-tsc -p tsconfig.json --declaration --emitDeclarationOnly --outDir dist --skipLibCheck && node -e \"const fs=require('fs');fs.cpSync('./dist/index.d.ts','./dist/index.d.mts');fs.cpSync('./dist/index.d.ts','./dist/index.d.cts');fs.cpSync('./dist/v2/index.d.ts','./dist/v2/index.d.mts');fs.cpSync('./dist/v2/index.d.ts','./dist/v2/index.d.cts')\"",
|
|
118
119
|
"dev:css": "npx @tailwindcss/cli -i ./src/styles/globals.css -o ./dist/styles.css --watch --minify",
|
|
119
120
|
"dev": "concurrently \"pnpm dev:css\" \"vite build --watch\"",
|
|
120
121
|
"test": "vitest run",
|
|
@@ -125,6 +126,6 @@
|
|
|
125
126
|
"check-types": "vue-tsc --noEmit",
|
|
126
127
|
"publint": "publint .",
|
|
127
128
|
"attw": "attw --pack . --profile node16 --exclude-entrypoints ./styles.css --ignore-rules internal-resolution-error",
|
|
128
|
-
"clean": "
|
|
129
|
+
"clean": "node -e \"const fs=require('fs');fs.rmSync('dist',{recursive:true,force:true})\""
|
|
129
130
|
}
|
|
130
131
|
}
|
|
@@ -35,10 +35,8 @@ import {
|
|
|
35
35
|
TranscriptionError,
|
|
36
36
|
} from "../../lib/transcription-client";
|
|
37
37
|
import CopilotChatView from "./CopilotChatView.vue";
|
|
38
|
-
import {
|
|
39
|
-
|
|
40
|
-
type LastUserMessageState,
|
|
41
|
-
} from "./last-user-message-context";
|
|
38
|
+
import { LastUserMessageKey } from "./last-user-message-context";
|
|
39
|
+
import type { LastUserMessageState } from "./last-user-message-context";
|
|
42
40
|
import type { Message } from "@ag-ui/core";
|
|
43
41
|
import type { InputContent } from "@copilotkit/shared";
|
|
44
42
|
import type {
|
|
@@ -425,6 +423,26 @@ watch(
|
|
|
425
423
|
{ immediate: true },
|
|
426
424
|
);
|
|
427
425
|
|
|
426
|
+
// Clear stale messages when the active thread switches to a fresh,
|
|
427
|
+
// non-explicit thread (e.g. a "+ New" reset). Explicit thread switches
|
|
428
|
+
// replay their history via the /connect cycle above, and the very first
|
|
429
|
+
// resolution (mount) or an agent-store swap that keeps the same thread id
|
|
430
|
+
// must never clear — only a real fresh-thread transition does.
|
|
431
|
+
const lastFreshThreadId = ref<string | undefined>(undefined);
|
|
432
|
+
watch(
|
|
433
|
+
[resolvedThreadId, hasExplicitThreadId, () => agent.value],
|
|
434
|
+
([threadId, isExplicit, currentAgent]) => {
|
|
435
|
+
const previous = lastFreshThreadId.value;
|
|
436
|
+
lastFreshThreadId.value = threadId;
|
|
437
|
+
if (!currentAgent) return;
|
|
438
|
+
if (isExplicit) return;
|
|
439
|
+
if (previous === undefined) return;
|
|
440
|
+
if (threadId === previous) return;
|
|
441
|
+
currentAgent.setMessages([]);
|
|
442
|
+
},
|
|
443
|
+
{ immediate: true },
|
|
444
|
+
);
|
|
445
|
+
|
|
428
446
|
onBeforeUnmount(() => {
|
|
429
447
|
isUnmounting.value = true;
|
|
430
448
|
});
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, useAttrs } from "vue";
|
|
2
|
+
import { computed, onBeforeUnmount, onMounted, ref, useAttrs } from "vue";
|
|
3
3
|
import { useCopilotChatConfiguration } from "../../providers/useCopilotChatConfiguration";
|
|
4
4
|
import { CopilotChatDefaultLabels } from "../../providers/types";
|
|
5
|
+
import { MOBILE_MAX_WIDTH_QUERY } from "../../lib/is-mobile-viewport";
|
|
5
6
|
import CopilotModalHeaderCloseButton from "./CopilotModalHeaderCloseButton";
|
|
6
7
|
import CopilotModalHeaderTitle from "./CopilotModalHeaderTitle";
|
|
8
|
+
import { IconPanelLeftOpen } from "../icons";
|
|
7
9
|
import type {
|
|
8
10
|
CopilotModalHeaderCloseButtonSlotProps,
|
|
9
11
|
CopilotModalHeaderLayoutSlotProps,
|
|
@@ -43,6 +45,50 @@ const headerAttrs = computed(() => {
|
|
|
43
45
|
function handleClose() {
|
|
44
46
|
config.value?.setModalOpen?.(false);
|
|
45
47
|
}
|
|
48
|
+
|
|
49
|
+
// Tracks whether the viewport is in the mobile range (MOBILE_MAX_WIDTH_QUERY) — the same
|
|
50
|
+
// breakpoint the drawer + chat coordination use. SSR-safe: starts `false`
|
|
51
|
+
// (desktop) so the server render and first client render agree, then syncs
|
|
52
|
+
// on mount and on viewport changes.
|
|
53
|
+
const isMobile = ref(false);
|
|
54
|
+
let mobileMediaQuery: MediaQueryList | null = null;
|
|
55
|
+
|
|
56
|
+
function syncIsMobile() {
|
|
57
|
+
if (mobileMediaQuery) {
|
|
58
|
+
isMobile.value = mobileMediaQuery.matches;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
onMounted(() => {
|
|
63
|
+
if (
|
|
64
|
+
typeof window === "undefined" ||
|
|
65
|
+
typeof window.matchMedia !== "function"
|
|
66
|
+
) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
mobileMediaQuery = window.matchMedia(MOBILE_MAX_WIDTH_QUERY);
|
|
70
|
+
mobileMediaQuery.addEventListener("change", syncIsMobile);
|
|
71
|
+
syncIsMobile();
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
onBeforeUnmount(() => {
|
|
75
|
+
mobileMediaQuery?.removeEventListener("change", syncIsMobile);
|
|
76
|
+
mobileMediaQuery = null;
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// The thread-list launcher renders ONLY when a <CopilotThreadsDrawer> wrapper
|
|
80
|
+
// has registered with the chat configuration AND the viewport is mobile. On
|
|
81
|
+
// desktop the drawer is an in-flow, persistent panel (it ignores `open`), so
|
|
82
|
+
// an "open the drawer" launcher there is a dead no-op — it only does
|
|
83
|
+
// anything for the mobile off-canvas drawer. Chats with no drawer get no
|
|
84
|
+
// launcher and no behavior change.
|
|
85
|
+
const showDrawerLauncher = computed(
|
|
86
|
+
() => (config.value?.drawerRegistered ?? false) && isMobile.value,
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
function toggleDrawer() {
|
|
90
|
+
config.value?.setDrawerOpen?.(!config.value?.drawerOpen);
|
|
91
|
+
}
|
|
46
92
|
</script>
|
|
47
93
|
|
|
48
94
|
<template>
|
|
@@ -54,7 +100,20 @@ function handleClose() {
|
|
|
54
100
|
>
|
|
55
101
|
<slot name="layout" :title="resolvedTitle" :on-close="handleClose">
|
|
56
102
|
<div class="cpk:flex cpk:w-full cpk:items-center cpk:gap-2">
|
|
57
|
-
<div class="cpk:flex cpk:flex-1
|
|
103
|
+
<div class="cpk:flex cpk:flex-1 cpk:justify-start">
|
|
104
|
+
<button
|
|
105
|
+
v-if="showDrawerLauncher"
|
|
106
|
+
type="button"
|
|
107
|
+
data-testid="drawer-launcher"
|
|
108
|
+
class="cpk:inline-flex cpk:size-8 cpk:items-center cpk:justify-center cpk:rounded-full cpk:text-muted-foreground cpk:transition cpk:cursor-pointer cpk:hover:bg-muted cpk:hover:text-foreground cpk:focus-visible:outline-none cpk:focus-visible:ring-2 cpk:focus-visible:ring-ring"
|
|
109
|
+
:aria-expanded="config?.drawerOpen ?? false"
|
|
110
|
+
aria-label="Open threads"
|
|
111
|
+
@click="toggleDrawer"
|
|
112
|
+
>
|
|
113
|
+
<IconPanelLeftOpen class="cpk:h-4 cpk:w-4" aria-hidden="true" />
|
|
114
|
+
</button>
|
|
115
|
+
<span v-else aria-hidden="true" />
|
|
116
|
+
</div>
|
|
58
117
|
<div class="cpk:flex cpk:flex-1 cpk:justify-center cpk:text-center">
|
|
59
118
|
<slot name="title-content" :title="resolvedTitle">
|
|
60
119
|
<CopilotModalHeaderTitle>
|