@ai-accounts/vue-headless 0.3.8 → 0.3.10

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.cjs CHANGED
@@ -650,6 +650,8 @@ function useSmartChat() {
650
650
  const updated = new Map(backendResponses.value);
651
651
  updated.set(event.backend, {
652
652
  backend: event.backend,
653
+ backendKind: event.backend_kind ?? existing?.backendKind,
654
+ accountLabel: event.account_label ?? existing?.accountLabel,
653
655
  content: (existing?.content ?? "") + (event.text ?? ""),
654
656
  status: "streaming"
655
657
  });
@@ -660,7 +662,12 @@ function useSmartChat() {
660
662
  const existing = backendResponses.value.get(event.backend);
661
663
  if (existing) {
662
664
  const updated = new Map(backendResponses.value);
663
- updated.set(event.backend, { ...existing, status: "complete" });
665
+ updated.set(event.backend, {
666
+ ...existing,
667
+ backendKind: event.backend_kind ?? existing.backendKind,
668
+ accountLabel: event.account_label ?? existing.accountLabel,
669
+ status: "complete"
670
+ });
664
671
  backendResponses.value = updated;
665
672
  }
666
673
  break;
@@ -670,6 +677,8 @@ function useSmartChat() {
670
677
  const updated = new Map(backendResponses.value);
671
678
  updated.set(event.backend, {
672
679
  backend: event.backend,
680
+ backendKind: event.backend_kind ?? existing?.backendKind,
681
+ accountLabel: event.account_label ?? existing?.accountLabel,
673
682
  content: existing?.content ?? "",
674
683
  status: "error",
675
684
  error: event.error
@@ -682,6 +691,8 @@ function useSmartChat() {
682
691
  const updated = new Map(backendResponses.value);
683
692
  updated.set(event.backend, {
684
693
  backend: event.backend,
694
+ backendKind: event.backend_kind ?? existing?.backendKind,
695
+ accountLabel: event.account_label ?? existing?.accountLabel,
685
696
  content: existing?.content ?? "",
686
697
  status: "timeout"
687
698
  });
@@ -736,6 +747,16 @@ function useSmartChat() {
736
747
  selectedAccount.value = null;
737
748
  selectedModel.value = null;
738
749
  }
750
+ function resetSession() {
751
+ sessionId.value = null;
752
+ messages.value = [];
753
+ streamingContent.value = "";
754
+ backendResponses.value = /* @__PURE__ */ new Map();
755
+ synthesisState.value = null;
756
+ canFinalize.value = false;
757
+ detectedConfig.value = null;
758
+ error.value = null;
759
+ }
739
760
  return {
740
761
  sessionId,
741
762
  messages,
@@ -753,6 +774,7 @@ function useSmartChat() {
753
774
  send,
754
775
  setMode,
755
776
  selectBackend,
777
+ resetSession,
756
778
  processGroups,
757
779
  canFinalize,
758
780
  isFinalizing,
@@ -917,7 +939,7 @@ function useStreamingParser(options = {}) {
917
939
  }
918
940
 
919
941
  // src/index.ts
920
- var version = "0.3.7";
942
+ var version = "0.3.10";
921
943
  // Annotate the CommonJS export names for ESM import in node:
922
944
  0 && (module.exports = {
923
945
  aiAccountsKey,
package/dist/index.d.cts CHANGED
@@ -141,6 +141,8 @@ declare function useProcessGroups(): UseProcessGroupsReturn;
141
141
 
142
142
  interface BackendResponseState {
143
143
  backend: string;
144
+ backendKind?: string | undefined;
145
+ accountLabel?: string | undefined;
144
146
  content: string;
145
147
  status: 'streaming' | 'complete' | 'error' | 'timeout';
146
148
  error?: string;
@@ -169,6 +171,7 @@ interface UseSmartChatReturn {
169
171
  send: (content: string) => Promise<void>;
170
172
  setMode: (mode: ChatMode) => void;
171
173
  selectBackend: (kind: string | null) => void;
174
+ resetSession: () => void;
172
175
  processGroups: UseProcessGroupsReturn;
173
176
  canFinalize: Ref<boolean>;
174
177
  isFinalizing: Ref<boolean>;
@@ -213,6 +216,6 @@ interface UseStreamingParserReturn {
213
216
  */
214
217
  declare function useStreamingParser(options?: UseStreamingParserOptions): UseStreamingParserReturn;
215
218
 
216
- declare const version = "0.3.7";
219
+ declare const version = "0.3.10";
217
220
 
218
221
  export { type AiAccountsContext, type AiAccountsPluginOptions, type BackendResponseState, type LoginStatus, type ProcessGroup, type SynthesisStateRef, type UseAccountWizardOptions, type UseAccountWizardReturn, type UseConversationReturn, type UseLoginSession, type UseOnboardingOptions, type UseOnboardingReturn, type UseProcessGroupsReturn, type UseSmartChatReturn, type UseSmartScrollReturn, type UseStreamingParserOptions, type UseStreamingParserReturn, aiAccountsKey, aiAccountsPlugin, useAccountWizard, useAiAccounts, useBackendRegistry, useConversation, useLoginSession, useOnboarding, useProcessGroups, useSmartChat, useSmartScroll, useStreamingParser, version };
package/dist/index.d.ts CHANGED
@@ -141,6 +141,8 @@ declare function useProcessGroups(): UseProcessGroupsReturn;
141
141
 
142
142
  interface BackendResponseState {
143
143
  backend: string;
144
+ backendKind?: string | undefined;
145
+ accountLabel?: string | undefined;
144
146
  content: string;
145
147
  status: 'streaming' | 'complete' | 'error' | 'timeout';
146
148
  error?: string;
@@ -169,6 +171,7 @@ interface UseSmartChatReturn {
169
171
  send: (content: string) => Promise<void>;
170
172
  setMode: (mode: ChatMode) => void;
171
173
  selectBackend: (kind: string | null) => void;
174
+ resetSession: () => void;
172
175
  processGroups: UseProcessGroupsReturn;
173
176
  canFinalize: Ref<boolean>;
174
177
  isFinalizing: Ref<boolean>;
@@ -213,6 +216,6 @@ interface UseStreamingParserReturn {
213
216
  */
214
217
  declare function useStreamingParser(options?: UseStreamingParserOptions): UseStreamingParserReturn;
215
218
 
216
- declare const version = "0.3.7";
219
+ declare const version = "0.3.10";
217
220
 
218
221
  export { type AiAccountsContext, type AiAccountsPluginOptions, type BackendResponseState, type LoginStatus, type ProcessGroup, type SynthesisStateRef, type UseAccountWizardOptions, type UseAccountWizardReturn, type UseConversationReturn, type UseLoginSession, type UseOnboardingOptions, type UseOnboardingReturn, type UseProcessGroupsReturn, type UseSmartChatReturn, type UseSmartScrollReturn, type UseStreamingParserOptions, type UseStreamingParserReturn, aiAccountsKey, aiAccountsPlugin, useAccountWizard, useAiAccounts, useBackendRegistry, useConversation, useLoginSession, useOnboarding, useProcessGroups, useSmartChat, useSmartScroll, useStreamingParser, version };
package/dist/index.js CHANGED
@@ -606,6 +606,8 @@ function useSmartChat() {
606
606
  const updated = new Map(backendResponses.value);
607
607
  updated.set(event.backend, {
608
608
  backend: event.backend,
609
+ backendKind: event.backend_kind ?? existing?.backendKind,
610
+ accountLabel: event.account_label ?? existing?.accountLabel,
609
611
  content: (existing?.content ?? "") + (event.text ?? ""),
610
612
  status: "streaming"
611
613
  });
@@ -616,7 +618,12 @@ function useSmartChat() {
616
618
  const existing = backendResponses.value.get(event.backend);
617
619
  if (existing) {
618
620
  const updated = new Map(backendResponses.value);
619
- updated.set(event.backend, { ...existing, status: "complete" });
621
+ updated.set(event.backend, {
622
+ ...existing,
623
+ backendKind: event.backend_kind ?? existing.backendKind,
624
+ accountLabel: event.account_label ?? existing.accountLabel,
625
+ status: "complete"
626
+ });
620
627
  backendResponses.value = updated;
621
628
  }
622
629
  break;
@@ -626,6 +633,8 @@ function useSmartChat() {
626
633
  const updated = new Map(backendResponses.value);
627
634
  updated.set(event.backend, {
628
635
  backend: event.backend,
636
+ backendKind: event.backend_kind ?? existing?.backendKind,
637
+ accountLabel: event.account_label ?? existing?.accountLabel,
629
638
  content: existing?.content ?? "",
630
639
  status: "error",
631
640
  error: event.error
@@ -638,6 +647,8 @@ function useSmartChat() {
638
647
  const updated = new Map(backendResponses.value);
639
648
  updated.set(event.backend, {
640
649
  backend: event.backend,
650
+ backendKind: event.backend_kind ?? existing?.backendKind,
651
+ accountLabel: event.account_label ?? existing?.accountLabel,
641
652
  content: existing?.content ?? "",
642
653
  status: "timeout"
643
654
  });
@@ -692,6 +703,16 @@ function useSmartChat() {
692
703
  selectedAccount.value = null;
693
704
  selectedModel.value = null;
694
705
  }
706
+ function resetSession() {
707
+ sessionId.value = null;
708
+ messages.value = [];
709
+ streamingContent.value = "";
710
+ backendResponses.value = /* @__PURE__ */ new Map();
711
+ synthesisState.value = null;
712
+ canFinalize.value = false;
713
+ detectedConfig.value = null;
714
+ error.value = null;
715
+ }
695
716
  return {
696
717
  sessionId,
697
718
  messages,
@@ -709,6 +730,7 @@ function useSmartChat() {
709
730
  send,
710
731
  setMode,
711
732
  selectBackend,
733
+ resetSession,
712
734
  processGroups,
713
735
  canFinalize,
714
736
  isFinalizing,
@@ -873,7 +895,7 @@ function useStreamingParser(options = {}) {
873
895
  }
874
896
 
875
897
  // src/index.ts
876
- var version = "0.3.7";
898
+ var version = "0.3.10";
877
899
  export {
878
900
  aiAccountsKey,
879
901
  aiAccountsPlugin,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-accounts/vue-headless",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "description": "Vue 3 headless composables for ai-accounts",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -27,7 +27,7 @@
27
27
  }
28
28
  },
29
29
  "dependencies": {
30
- "@ai-accounts/ts-core": "0.3.8"
30
+ "@ai-accounts/ts-core": "0.3.10"
31
31
  },
32
32
  "devDependencies": {
33
33
  "vue": "^3.4.0",