@siact/sime-x-vue 0.0.13 → 0.0.15

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.
@@ -768,27 +768,28 @@ function injectStrict(key, defaultValue, treatDefaultAsFactory) {
768
768
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
769
769
  __name: "sime-provider",
770
770
  props: {
771
- project: {},
772
- description: {},
773
- debug: { type: Boolean },
774
- chatbotUrl: {},
775
- appId: {},
776
771
  appToken: {},
777
- agentId: {}
772
+ organizationId: {}
778
773
  },
779
774
  setup(__props) {
780
775
  const props = __props;
781
- const commandManager = shallowRef(new CommandManager({ debug: props.debug ?? false }));
776
+ const commandManager = shallowRef(new CommandManager({ debug: false }));
777
+ const startListeningRef = shallowRef(async () => {
778
+ });
779
+ const stopListeningRef = shallowRef(async () => {
780
+ });
782
781
  const stopBroadcastRef = shallowRef(async () => {
783
782
  });
784
783
  provide(AiChatbotXKey, {
785
- chatbotUrl: () => props.chatbotUrl,
786
- appId: () => props.appId,
787
784
  appToken: () => props.appToken,
788
- agentId: () => props.agentId,
785
+ organizationId: () => props.organizationId,
786
+ startListening: () => startListeningRef.value(),
787
+ stopListening: () => stopListeningRef.value(),
789
788
  stopBroadcast: () => stopBroadcastRef.value(),
790
789
  registerVoiceMethods: (methods) => {
791
790
  if (methods.stopBroadcast) stopBroadcastRef.value = methods.stopBroadcast;
791
+ if (methods.start) startListeningRef.value = methods.start;
792
+ if (methods.stop) stopListeningRef.value = methods.stop;
792
793
  },
793
794
  getCommads: async () => commandManager.value.getCommands(),
794
795
  registerCommand: (cmd) => {
@@ -1952,6 +1953,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1952
1953
  wakeWords: {},
1953
1954
  wakeResponses: {},
1954
1955
  modelPath: {},
1956
+ agentId: {},
1955
1957
  projectId: {},
1956
1958
  voiceConfig: {},
1957
1959
  bubbleSize: {},
@@ -1965,6 +1967,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1965
1967
  return null;
1966
1968
  };
1967
1969
  const wakeResponses = computed(() => props.wakeResponses || ["在呢"]);
1970
+ const agentId = computed(() => props.agentId);
1968
1971
  const tts = useTTS(getVoiceConfig);
1969
1972
  const bubbleBridge = {
1970
1973
  open: () => {
@@ -1974,7 +1977,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1974
1977
  scrollToBottom: () => {
1975
1978
  }
1976
1979
  };
1977
- const endpoint = `/sime/proxy/agent/${aiChatbotX.agentId()}/stream-invoke`;
1980
+ const endpoint = `/sime/proxy/organizations/${aiChatbotX.organizationId()}/agents/${agentId.value}/stream-invoke`;
1978
1981
  const agent = useAgentInvoke({
1979
1982
  endpoint,
1980
1983
  appToken: aiChatbotX.appToken(),
@@ -2030,7 +2033,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2030
2033
  const { voiceStatus, transcriptionText, wakeAnimating, isTranscribing } = voice;
2031
2034
  const { isInvoking, currentTextContent, currentToolParts, executingTools, hasAnyContent, toolDisplayName } = agent;
2032
2035
  aiChatbotX?.registerVoiceMethods({
2033
- stopBroadcast: async () => interruptCurrentResponse()
2036
+ stopBroadcast: async () => interruptCurrentResponse(),
2037
+ start: () => toggleVoiceMode(true),
2038
+ stop: () => toggleVoiceMode(false)
2034
2039
  });
2035
2040
  onBeforeUnmount(async () => {
2036
2041
  bubble.destroy();
@@ -2169,7 +2174,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2169
2174
  }
2170
2175
  });
2171
2176
 
2172
- const voiceAssistant = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a88f03ab"]]);
2177
+ const voiceAssistant = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-59d72f34"]]);
2173
2178
 
2174
2179
  var clientCommandKey = /* @__PURE__ */ ((clientCommandKey2) => {
2175
2180
  clientCommandKey2["SET_THEME"] = "SiMeAgent_setTheme";