@rtc-agent/component 0.1.5-rc.0 → 0.1.5-rc.1

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.
@@ -1,4 +1,4 @@
1
- import { s as e } from "./index-BAvGn_mA.js";
1
+ import { s as e } from "./index-BhUNxh1S.js";
2
2
  const s = {
3
3
  s0016a70887124d70: "Session",
4
4
  s0116da495c2a975c: "The AI wants to use a tool. Review the details below.",
@@ -1,4 +1,4 @@
1
- import { g as wl } from "./index-BAvGn_mA.js";
1
+ import { g as wl } from "./index-BhUNxh1S.js";
2
2
  function ml(n) {
3
3
  return n instanceof Map ? n.clear = n.delete = n.set = function() {
4
4
  throw new Error("map is read-only");
@@ -2047,15 +2047,24 @@ class ZI {
2047
2047
  * 从消息 content 中提取纯文本
2048
2048
  *
2049
2049
  * content 存储格式:
2050
- * - 本地写入:纯文本字符串(content.data 为 string 时直接存储)
2051
- * - 服务端回推:JSON 字符串,格式为 ContentData(如 '{"type":"text","data":"hello"}')
2050
+ * - 新格式(修复后):完整的 ContentData JSON,如 '{"type":"user_message","data":{"text":"..."}}'
2051
+ * - 旧格式(历史数据):纯文本字符串或只有 data 的对象,如 '{"text":"..."}'
2052
+ * - 纯文本:直接返回
2052
2053
  */
2053
2054
  _extractTextFromContent(e) {
2055
+ var r;
2054
2056
  if (!e) return "";
2055
2057
  try {
2056
- const r = JSON.parse(e);
2057
- if (r && typeof r == "object" && r.type === "text")
2058
- return r.data ?? "";
2058
+ const n = JSON.parse(e);
2059
+ if (n && typeof n == "object") {
2060
+ if ("type" in n) {
2061
+ if (n.type === "text" || n.type === "markdown" || n.type === "thinking")
2062
+ return n.data ?? "";
2063
+ if (n.type === "user_message")
2064
+ return ((r = n.data) == null ? void 0 : r.text) ?? "";
2065
+ } else if ("text" in n && typeof n.text == "string")
2066
+ return n.text;
2067
+ }
2059
2068
  } catch {
2060
2069
  }
2061
2070
  return e;
@@ -64780,7 +64789,7 @@ class _9 {
64780
64789
  try {
64781
64790
  for (; ; ) {
64782
64791
  this.pendingCheck = !1;
64783
- const e = await this.persistence.getNextRtcToProcess();
64792
+ const e = await this.persistence.getNextRtcToProcess(void 0);
64784
64793
  if (!e) {
64785
64794
  if (console.log("[RtcProcessor] processLoop: no more RTC to process, exiting"), this.pendingCheck)
64786
64795
  continue;
@@ -64927,7 +64936,7 @@ class _9 {
64927
64936
  }
64928
64937
  function xT(t) {
64929
64938
  return new SharedWorker(
64930
- "" + new URL("assets/shared-worker-DWdeA8LH.js", import.meta.url).href,
64939
+ "" + new URL("assets/shared-worker-DCHyP9C5.js", import.meta.url).href,
64931
64940
  {
64932
64941
  name: t == null ? void 0 : t.name
64933
64942
  }
@@ -65408,6 +65417,7 @@ const vo = class vo {
65408
65417
  throw new Error("[PersistenceController] connect() called without userId; refusing to open a shared database");
65409
65418
  const n = {
65410
65419
  databaseName: `rtc-agent-${r}`,
65420
+ deviceId: e,
65411
65421
  client: {
65412
65422
  endpoint: To.wsEndpoint,
65413
65423
  getToken: () => {
@@ -70860,7 +70870,7 @@ function _L() {
70860
70870
  NT || (NT = !0, RC());
70861
70871
  }
70862
70872
  const Jt = "zh-CN", Br = ["en-US"], DT = {
70863
- "en-US": async () => (await import("./en-US-5X8Pusw5.js")).default
70873
+ "en-US": async () => (await import("./en-US-ckomj5Hk.js")).default
70864
70874
  }, { getLocale: SL, setLocale: LC } = U9({
70865
70875
  sourceLocale: Jt,
70866
70876
  targetLocales: Br,
@@ -74655,7 +74665,7 @@ let ko = class extends xr {
74655
74665
  this._modulesPromise || (this._modulesPromise = Promise.all([
74656
74666
  import("./marked.esm-Dch69AxC.js"),
74657
74667
  import("./purify.es-C-6FFqDW.js"),
74658
- import("./index-CDXHF2WH.js")
74668
+ import("./index-B4hb17Br.js")
74659
74669
  ]).then(([c, h, p]) => ({
74660
74670
  marked: c.marked,
74661
74671
  DOMPurify: h.default,
@@ -80973,7 +80983,7 @@ let ds = class extends xr {
80973
80983
  return this._modulesPromise || (this._modulesPromise = Promise.all([
80974
80984
  import("./marked.esm-Dch69AxC.js"),
80975
80985
  import("./purify.es-C-6FFqDW.js"),
80976
- import("./index-CDXHF2WH.js")
80986
+ import("./index-B4hb17Br.js")
80977
80987
  ]).then(([t, e, r]) => ({
80978
80988
  marked: t.marked,
80979
80989
  DOMPurify: e.default,
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as s, D as t, E as n, F as o, a as r, R as i, S as d, b as l, c, d as u, e as F, f as g, h as m, i as p, j as E, l as R, o as S, p as A, v as T, w as f, k as h, m as v, z as w, n as C } from "./index-BAvGn_mA.js";
1
+ import { C as s, D as t, E as n, F as o, a as r, R as i, S as d, b as l, c, d as u, e as F, f as g, h as m, i as p, j as E, l as R, o as S, p as A, v as T, w as f, k as h, m as v, z as w, n as C } from "./index-BhUNxh1S.js";
2
2
  export {
3
3
  s as CancelledError,
4
4
  t as DEFAULT_SKILL_STATE,