@glodon-aiot/bot-client-sdk 3.26.0-alpha.32 → 3.26.0-alpha.34

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,17 +1,17 @@
1
- var x = Object.defineProperty, b = Object.defineProperties;
2
- var R = Object.getOwnPropertyDescriptors;
3
- var v = Object.getOwnPropertySymbols;
4
- var E = Object.prototype.hasOwnProperty, L = Object.prototype.propertyIsEnumerable;
5
- var m = (h, i, e) => i in h ? x(h, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[i] = e, _ = (h, i) => {
1
+ var x = Object.defineProperty, R = Object.defineProperties;
2
+ var E = Object.getOwnPropertyDescriptors;
3
+ var y = Object.getOwnPropertySymbols;
4
+ var L = Object.prototype.hasOwnProperty, W = Object.prototype.propertyIsEnumerable;
5
+ var m = (l, i, e) => i in l ? x(l, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[i] = e, _ = (l, i) => {
6
6
  for (var e in i || (i = {}))
7
- E.call(i, e) && m(h, e, i[e]);
8
- if (v)
9
- for (var e of v(i))
10
- L.call(i, e) && m(h, e, i[e]);
11
- return h;
12
- }, u = (h, i) => b(h, R(i));
13
- var l = (h, i, e) => (m(h, typeof i != "symbol" ? i + "" : i, e), e);
14
- var p = (h, i, e) => new Promise((t, o) => {
7
+ L.call(i, e) && m(l, e, i[e]);
8
+ if (y)
9
+ for (var e of y(i))
10
+ W.call(i, e) && m(l, e, i[e]);
11
+ return l;
12
+ }, u = (l, i) => R(l, E(i));
13
+ var h = (l, i, e) => (m(l, typeof i != "symbol" ? i + "" : i, e), e);
14
+ var p = (l, i, e) => new Promise((t, o) => {
15
15
  var n = (a) => {
16
16
  try {
17
17
  s(e.next(a));
@@ -25,89 +25,104 @@ var p = (h, i, e) => new Promise((t, o) => {
25
25
  o(c);
26
26
  }
27
27
  }, s = (a) => a.done ? t(a.value) : Promise.resolve(a.value).then(n, r);
28
- s((e = e.apply(h, i)).next());
28
+ s((e = e.apply(l, i)).next());
29
29
  });
30
- import { parseJWT as y } from "./utils.mjs";
31
- import W from "./Logger.mjs";
32
- import { getAIShopService as M, getCVForceService as T } from "./api/index.mjs";
33
- import { configure as k, configuration as f, setActiveLocalWorkspace as S, refreshBuiltinPlugins as w } from "./Config.mjs";
34
- import { PlatformSkillSync as C } from "./builtinTools/platformSkills.mjs";
35
- import { HostBridgeAdapter as B } from "./localFiles/adapters/HostBridgeAdapter.mjs";
36
- import { connectHostBridge as V } from "./localFiles/host/connectHostBridge.mjs";
37
- import { LocalWorkspace as O } from "./localFiles/workspace/LocalWorkspace.mjs";
38
- import { createIndexedDbStore as H } from "./localFiles/workspace/handleStore.mjs";
39
- import { createDefaultSessionFileTransfer as P } from "./localFiles/transfer/SessionFileTransfer.mjs";
40
- import { ApplicationTypes as g, PromptVariableType as A } from "@glodon-aiot/apis";
41
- import D from "./AgentSession.mjs";
42
- import F from "./DialogSession.mjs";
43
- import j from "./EventBus.mjs";
44
- import Q from "./package.json.mjs";
45
- const I = new W("[BotClient] ");
46
- class ni {
30
+ import { parseJWT as S } from "./utils.mjs";
31
+ import B from "./Logger.mjs";
32
+ import { getAIShopService as M, getCVForceService as C } from "./api/index.mjs";
33
+ import { configure as w, configuration as f, setActiveLocalWorkspace as A, refreshBuiltinPlugins as I } from "./Config.mjs";
34
+ import { PlatformSkillSync as T, pullArrangeSkills as V } from "./builtinTools/platformSkills.mjs";
35
+ import { HostBridgeAdapter as O } from "./localFiles/adapters/HostBridgeAdapter.mjs";
36
+ import { connectHostBridge as H } from "./localFiles/host/connectHostBridge.mjs";
37
+ import { connectLocalMcpBridge as D } from "./localMcp/endpoints.mjs";
38
+ import { LocalWorkspace as F } from "./localFiles/workspace/LocalWorkspace.mjs";
39
+ import { createIndexedDbStore as j } from "./localFiles/workspace/handleStore.mjs";
40
+ import { createDefaultSessionFileTransfer as z } from "./localFiles/transfer/SessionFileTransfer.mjs";
41
+ import { ApplicationTypes as k, PromptVariableType as b } from "@glodon-aiot/apis";
42
+ import Q from "./AgentSession.mjs";
43
+ import J from "./DialogSession.mjs";
44
+ import $ from "./EventBus.mjs";
45
+ import P from "./package.json.mjs";
46
+ const d = new B("[BotClient] ");
47
+ class li {
47
48
  constructor(i, e, t = !0, o = {
48
49
  analytics: {
49
50
  enabled: !1
50
51
  }
51
52
  }) {
52
- l(this, "event", new j());
53
- l(this, "cvforceApi");
53
+ h(this, "event", new $());
54
+ h(this, "cvforceApi");
54
55
  //从token解析出来的用户信息
55
- l(this, "_applicationId");
56
- l(this, "_application", null);
56
+ h(this, "_applicationId");
57
+ h(this, "_application", null);
57
58
  //session列表,被加载过的session将会被缓存到这个列表中
58
- l(this, "_sessions", []);
59
+ h(this, "_sessions", []);
59
60
  //活跃的session,只支持一个活跃的session
60
- l(this, "_activeSession");
61
- l(this, "_ready", !1);
61
+ h(this, "_activeSession");
62
+ h(this, "_ready", !1);
62
63
  //问题长度
63
- l(this, "_questionContextMaxLength", 4e3);
64
- l(this, "_promptVariables", []);
65
- l(this, "_localWorkspace");
66
- l(this, "_disconnectHost");
67
- if (this._token = i, this.lazyload = t, this.sdkConfigs = o, k(e, {
64
+ h(this, "_questionContextMaxLength", 4e3);
65
+ h(this, "_promptVariables", []);
66
+ h(this, "_localWorkspace");
67
+ h(this, "_disconnectHost");
68
+ /** 后进入的会话作废尚未返回的编排刷新。 */
69
+ h(this, "arrangeSkillEpoch", 0);
70
+ if (this._token = i, this.lazyload = t, this.sdkConfigs = o, w(e, {
68
71
  refreshBuiltinPlugins: !1
69
- }), this._applicationId = y(i).rid || f.applicationId, !this._applicationId)
72
+ }), this._applicationId = S(i).rid || f.applicationId, !this._applicationId)
70
73
  throw "token is not vaild";
71
- this.cvforceApi = this.getService(), this.setupLocalWorkspace(), this.loadApplication().then((n) => {
72
- k(u(_({}, e), {
73
- stream: e.stream === void 0 ? (n == null ? void 0 : n.type) === g.Dialog || (n == null ? void 0 : n.type) === g.Agent : e.stream
74
- })), this.event.emit("ready");
74
+ this.cvforceApi = this.getService(), D(), this.setupLocalWorkspace(), this.loadApplication().then((n) => {
75
+ w(u(_({}, e), {
76
+ stream: e.stream === void 0 ? (n == null ? void 0 : n.type) === k.Dialog || (n == null ? void 0 : n.type) === k.Agent : e.stream
77
+ })), this.logReady(), this.event.emit("ready");
78
+ });
79
+ }
80
+ logReady() {
81
+ var i, e;
82
+ d.log("ready", {
83
+ applicationId: this._applicationId,
84
+ type: (i = this._application) == null ? void 0 : i.type,
85
+ stream: f.stream,
86
+ workspace: (e = this._localWorkspace) == null ? void 0 : e.status
75
87
  });
76
88
  }
77
89
  setupLocalWorkspace() {
78
- var o, n;
90
+ var o, n, r;
79
91
  const i = (o = f.builtinPlugins) == null ? void 0 : o.localFiles;
80
92
  if (!(i != null && i.enabled)) {
81
- S(void 0), w();
93
+ d.log("workspace:disabled"), A(void 0), I();
82
94
  return;
83
95
  }
84
- const e = [], t = (n = i.backend) != null ? n : "file-system-access";
96
+ d.log("workspace:setup", {
97
+ backend: (n = i.backend) != null ? n : "file-system-access"
98
+ });
99
+ const e = [], t = (r = i.backend) != null ? r : "file-system-access";
85
100
  if (t !== "file-system-access" && t !== "host-bridge")
86
101
  e.push(new Error(`[LocalFiles] 不支持的 backend:${i.backend}`));
87
102
  else {
88
- const r = M(f.apiRoot, this.token, (s, a) => I.error(a));
89
- this._localWorkspace = new O({
103
+ const s = M(f.apiRoot, this.token, (a, c) => d.error(c));
104
+ this._localWorkspace = new F({
90
105
  applicationId: this._applicationId,
91
106
  config: i,
92
- store: H(),
107
+ store: j(),
93
108
  picker: t === "host-bridge" ? null : void 0,
94
- transfer: P(() => this.cvforceApi, () => r)
95
- }), S(this._localWorkspace), this._localWorkspace.platformSkills = new C({
109
+ transfer: z(() => this.cvforceApi, () => s)
110
+ }), A(this._localWorkspace), this._localWorkspace.platformSkills = new T({
96
111
  applicationId: () => this._applicationId,
97
112
  getToken: () => this.token,
98
113
  getSkills: () => {
99
- var s, a, c, d;
100
- return (d = (c = (a = (s = this._application) == null ? void 0 : s.arrange) == null ? void 0 : a[0]) == null ? void 0 : c.skills) != null ? d : [];
114
+ var a, c, g, v;
115
+ return (v = (g = (c = (a = this._application) == null ? void 0 : a.arrange) == null ? void 0 : c[0]) == null ? void 0 : g.skills) != null ? v : [];
101
116
  },
102
117
  apiRoot: () => f.apiRoot,
103
118
  getSandbox: () => {
104
- var a;
105
- const s = (a = this._localWorkspace) == null ? void 0 : a.adapter;
106
- return s instanceof B ? s.sandbox : void 0;
119
+ var c;
120
+ const a = (c = this._localWorkspace) == null ? void 0 : c.adapter;
121
+ return a instanceof O ? a.sandbox : void 0;
107
122
  }
108
- }), t === "host-bridge" ? this._disconnectHost = V(this._localWorkspace) : this._localWorkspace.restore();
123
+ }), t === "host-bridge" ? this._disconnectHost = H(this._localWorkspace) : this._localWorkspace.restore();
109
124
  }
110
- e.push(...w()), e.length && Promise.resolve().then(() => e.forEach((r) => this.event.emit("error", r)));
125
+ e.push(...I()), e.length && Promise.resolve().then(() => e.forEach((s) => this.event.emit("error", s)));
111
126
  }
112
127
  /** 启用 builtinPlugins.localFiles 后可用;UI 与纯 SDK 集成共用此实例。 */
113
128
  get localWorkspace() {
@@ -148,7 +163,7 @@ class ni {
148
163
  {
149
164
  ui: (e = this.sdkConfigs.ui) == null ? void 0 : e.name,
150
165
  uiVersion: (t = this.sdkConfigs.ui) == null ? void 0 : t.version,
151
- sdkVersion: Q.version
166
+ sdkVersion: P.version
152
167
  }
153
168
  ).then((s) => (typeof s.arrange[0].thinkingModeOpen != "boolean" && (s.arrange[0].thinkingModeOpen = !0), typeof s.arrange[0].thinkingTextOpen != "boolean" && (s.arrange[0].thinkingTextOpen = !0), u(_({}, s), {
154
169
  arrange: [u(_({}, s.arrange[0]), {
@@ -157,23 +172,23 @@ class ni {
157
172
  })));
158
173
  const i = (r = (n = (o = this._application) == null ? void 0 : o.arrange) == null ? void 0 : n[0]) == null ? void 0 : r.llmModel;
159
174
  return i && (this._questionContextMaxLength = yield this.cvforceApi.getBaseModel(i).then((s) => s.maxModelLength)), this._promptVariables = yield Promise.all([this.cvforceApi.getPrompts(this._applicationId, {
160
- type: A.User
175
+ type: b.User
161
176
  }), this.cvforceApi.getPrompts(this._applicationId, {
162
- type: A.System
177
+ type: b.System
163
178
  })]).then(([s, a]) => [...s, ...a]), this._ready = !0, this.event.emit("application:loaded"), this._application;
164
179
  });
165
180
  }
166
181
  getService() {
167
- return this.cvforceApi ? this.cvforceApi : T(f.apiRoot, this.token, (i, e) => I.error(e));
182
+ return this.cvforceApi ? this.cvforceApi : C(f.apiRoot, this.token, (i, e) => d.error(e));
168
183
  }
169
184
  get token() {
170
185
  return this._token;
171
186
  }
172
187
  set token(i) {
173
188
  this.checkReady(), this._token = i, this.ready = !1;
174
- const e = y(i).rid;
189
+ const e = S(i).rid;
175
190
  this._applicationId !== e && (this._applicationId = e, this._application = null, this.loadApplication().then(() => {
176
- this.event.emit("ready");
191
+ this.logReady(), this.event.emit("ready");
177
192
  }), this.clean());
178
193
  }
179
194
  get applicationId() {
@@ -195,13 +210,13 @@ class ni {
195
210
  return p(this, null, function* () {
196
211
  const r = this;
197
212
  return new Promise((s, a) => {
198
- const c = (d) => p(this, null, function* () {
199
- if (d === g.Agent)
200
- s(new D(i, e, t, o, n, r));
201
- else if (d === g.Dialog)
202
- s(new F(i, e, t, o, n, r));
213
+ const c = (g) => p(this, null, function* () {
214
+ if (g === k.Agent)
215
+ s(new Q(i, e, t, o, n, r));
216
+ else if (g === k.Dialog)
217
+ s(new J(i, e, t, o, n, r));
203
218
  else
204
- throw Error(`不支持的应用类型:${d}`);
219
+ throw Error(`不支持的应用类型:${g}`);
205
220
  });
206
221
  if (this.ready) {
207
222
  if (!this._application)
@@ -247,7 +262,10 @@ class ni {
247
262
  r.push(c);
248
263
  }
249
264
  }
250
- if (i != null && i.pageSize) {
265
+ if (d.log("sessions", {
266
+ count: r.length,
267
+ paged: !!(i != null && i.pageSize)
268
+ }), i != null && i.pageSize) {
251
269
  const s = [...this._sessions, ...r], a = /* @__PURE__ */ new Map();
252
270
  for (const c of s)
253
271
  a.set(c.id, c);
@@ -268,12 +286,37 @@ class ni {
268
286
  });
269
287
  });
270
288
  }
289
+ /** 只更新 arrange[0].skills。查询失败时保留内存中的名单,会话仍可进入。 */
290
+ refreshArrangeSkills() {
291
+ return p(this, null, function* () {
292
+ var t, o, n;
293
+ const i = (o = (t = this._application) == null ? void 0 : t.arrange) == null ? void 0 : o[0], e = ++this.arrangeSkillEpoch;
294
+ try {
295
+ yield V({
296
+ // 已发布的 IArrange 类型尚未带上 skills,与 getSkills 一样在这里收窄。
297
+ arrange: i,
298
+ fetchApplication: () => this.cvforceApi.getApplicationId(this._applicationId),
299
+ stillCurrent: () => {
300
+ var s, a;
301
+ return e === this.arrangeSkillEpoch && ((a = (s = this._application) == null ? void 0 : s.arrange) == null ? void 0 : a[0]) === i;
302
+ }
303
+ });
304
+ const r = (n = i == null ? void 0 : i.skills) != null ? n : [];
305
+ d.log("arrange:skills", r.map((s) => s.name).filter(Boolean));
306
+ } catch (r) {
307
+ d.error("刷新编排技能失败", r);
308
+ }
309
+ });
310
+ }
271
311
  loadSession(i = "", e) {
272
312
  return p(this, null, function* () {
273
313
  var o, n;
274
- this.checkReady(), (n = (o = this._localWorkspace) == null ? void 0 : o.platformSkills) == null || n.sync();
314
+ this.checkReady(), yield this.refreshArrangeSkills(), (n = (o = this._localWorkspace) == null ? void 0 : o.platformSkills) == null || n.sync();
275
315
  let t = this.sessions.find((r) => r.id === i);
276
- if (t || (t = yield this.createSession(this.token, i, e), this._sessions.push(t)), this._activeSession) {
316
+ if (d.log("loadSession", {
317
+ sessionId: i || "(new)",
318
+ existing: !!t
319
+ }), t || (t = yield this.createSession(this.token, i, e), this._sessions.push(t)), this._activeSession) {
277
320
  if (this._activeSession === t)
278
321
  return t;
279
322
  this._activeSession.inactivate();
@@ -293,7 +336,7 @@ class ni {
293
336
  yield this.reload();
294
337
  let e = this._sessions.find((t) => t.id === i) || this._activeSession;
295
338
  if (!e) {
296
- console.warn("reloadSession session failed.");
339
+ d.warn("reloadSession session failed.");
297
340
  return;
298
341
  }
299
342
  return yield e.reload(), e;
@@ -303,7 +346,7 @@ class ni {
303
346
  return p(this, null, function* () {
304
347
  let o = i ? this._sessions.find((n) => n.id === i) : this._activeSession;
305
348
  if (!o) {
306
- console.warn("setTop session failed.");
349
+ d.warn("setTop session failed.");
307
350
  return;
308
351
  }
309
352
  return yield o.setTop(e), this.getSessions({
@@ -331,7 +374,7 @@ class ni {
331
374
  const o = this._sessions[t];
332
375
  e && (yield o.delete()), this._sessions.splice(t, 1);
333
376
  } else
334
- console.warn("session delete failed, session is not exist.");
377
+ d.warn("session delete failed, session is not exist.");
335
378
  });
336
379
  }
337
380
  clean() {
@@ -340,5 +383,5 @@ class ni {
340
383
  }
341
384
  }
342
385
  export {
343
- ni as default
386
+ li as default
344
387
  };
@@ -1,21 +1,21 @@
1
- var L = Object.defineProperty, B = Object.defineProperties;
2
- var R = Object.getOwnPropertyDescriptors;
3
- var b = Object.getOwnPropertySymbols;
4
- var w = Object.prototype.hasOwnProperty, k = Object.prototype.propertyIsEnumerable;
5
- var P = (e, o, i) => o in e ? L(e, o, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[o] = i, c = (e, o) => {
6
- for (var i in o || (o = {}))
7
- w.call(o, i) && P(e, i, o[i]);
8
- if (b)
9
- for (var i of b(o))
10
- k.call(o, i) && P(e, i, o[i]);
1
+ var B = Object.defineProperty, R = Object.defineProperties;
2
+ var w = Object.getOwnPropertyDescriptors;
3
+ var v = Object.getOwnPropertySymbols;
4
+ var k = Object.prototype.hasOwnProperty, E = Object.prototype.propertyIsEnumerable;
5
+ var b = (e, i, o) => i in e ? B(e, i, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[i] = o, c = (e, i) => {
6
+ for (var o in i || (i = {}))
7
+ k.call(i, o) && b(e, o, i[o]);
8
+ if (v)
9
+ for (var o of v(i))
10
+ E.call(i, o) && b(e, o, i[o]);
11
11
  return e;
12
- }, h = (e, o) => B(e, R(o));
13
- import r from "./Logger.mjs";
14
- import { LOCAL_FILES_PLUGIN_CODES as E } from "./localFiles/constants.mjs";
15
- import { createBuiltinToolsPlugin as I } from "./builtinTools/createBuiltinToolsPlugin.mjs";
16
- import { applyLocalMcpPlugins as S } from "./localMcp/registry.mjs";
17
- const T = new r("[Config] ");
18
- var C = /* @__PURE__ */ ((e) => (e.dev = "https://aiot-dev.glodon.com/api/cvforcepd", e.test = "https://aiot-dev.glodon.com/api/cvforce", e.prod = "https://copilot.glodon.com/api/cvforce", e.local = "http://localhost:3000/api/cvforcepd", e))(C || {});
12
+ }, P = (e, i) => R(e, w(i));
13
+ import h from "./Logger.mjs";
14
+ import { LOCAL_FILES_PLUGIN_CODES as I } from "./localFiles/constants.mjs";
15
+ import { createBuiltinToolsPlugin as S } from "./builtinTools/createBuiltinToolsPlugin.mjs";
16
+ import { applyLocalMcpPlugins as T } from "./localMcp/registry.mjs";
17
+ const C = new h("[Config] ");
18
+ var L = /* @__PURE__ */ ((e) => (e.dev = "https://aiot-dev.glodon.com/api/cvforcepd", e.test = "https://aiot-dev.glodon.com/api/cvforce", e.prod = "https://copilot.glodon.com/api/cvforce", e.local = "http://localhost:3000/api/cvforcepd", e))(L || {});
19
19
  let n = {
20
20
  debug: !1,
21
21
  env: "prod",
@@ -32,57 +32,57 @@ let n = {
32
32
  loadRelatedQuesions: !0,
33
33
  stream: !1
34
34
  }, u, l;
35
- const f = /* @__PURE__ */ new Set();
35
+ const r = /* @__PURE__ */ new Set();
36
36
  function G(e) {
37
- u !== e && (u = e, l = void 0, f.clear());
37
+ u !== e && (u = e, l = void 0, r.clear());
38
38
  }
39
39
  function M() {
40
40
  if (!l)
41
41
  return;
42
42
  const {
43
43
  pluginCode: e,
44
- table: o
45
- } = l, i = n.plugins[e], t = o[e];
46
- if (!(!i || i.shell !== t.shell))
44
+ table: i
45
+ } = l, o = n.plugins[e], t = i[e];
46
+ if (!(!o || o.shell !== t.shell))
47
47
  return e;
48
48
  }
49
- function _(e, o) {
50
- return (e == null ? void 0 : e.pluginCode) || E[o];
49
+ function _(e, i) {
50
+ return (e == null ? void 0 : e.pluginCode) || I[i];
51
51
  }
52
52
  function O() {
53
- var p, v;
54
- const e = (p = n.businessPlugins) != null ? p : {}, o = (v = n.builtinPlugins) == null ? void 0 : v.localFiles, i = [], t = c({}, e);
55
- if (!!!(o != null && o.enabled))
56
- return g(t), i;
53
+ var f, p;
54
+ const e = (f = n.businessPlugins) != null ? f : {}, i = (p = n.builtinPlugins) == null ? void 0 : p.localFiles, o = [], t = c({}, e);
55
+ if (!!!(i != null && i.enabled))
56
+ return g(t), o;
57
57
  if (!u)
58
- return i.push("[BuiltinTools] 内置工具依赖已启用的本地工作区。工具未注册。"), g(t), i;
59
- const s = o != null && o.enabled ? _(o, n.env) : void 0;
60
- return s ? e[s] ? i.push(`[BuiltinTools] 业务插件中已存在 pluginCode「${s}」,已保留业务插件,内置工具未注册。`) : (((l == null ? void 0 : l.workspace) !== u || l.pluginCode !== s) && (l = {
58
+ return o.push("[BuiltinTools] 内置工具依赖已启用的本地工作区。工具未注册。"), g(t), o;
59
+ const s = i != null && i.enabled ? _(i, n.env) : void 0;
60
+ return s ? e[s] ? o.push(`[BuiltinTools] 业务插件中已存在 pluginCode「${s}」,已保留业务插件,内置工具未注册。`) : (((l == null ? void 0 : l.workspace) !== u || l.pluginCode !== s) && (l = {
61
61
  workspace: u,
62
62
  pluginCode: s,
63
- table: I({
63
+ table: S({
64
64
  pluginCode: s,
65
65
  workspace: u
66
66
  })
67
- }), t[s] = l.table[s]) : i.push(`[BuiltinTools] 当前环境(env: ${n.env})没有默认的内置工具插件编码,请配置 builtinPlugins.localFiles.pluginCode。内置工具未注册。`), g(t), i;
67
+ }), t[s] = l.table[s]) : o.push(`[BuiltinTools] 当前环境(env: ${n.env})没有默认的内置工具插件编码,请配置 builtinPlugins.localFiles.pluginCode。内置工具未注册。`), g(t), o;
68
68
  }
69
69
  function g(e) {
70
- S(e), n.plugins = e;
70
+ T(e), n.plugins = e;
71
71
  }
72
72
  function W() {
73
- return O().filter((e) => !f.has(e)).map((e) => (f.add(e), console.error(e), new Error(e)));
73
+ return O().filter((e) => !r.has(e)).map((e) => (r.add(e), C.report(e), new Error(e)));
74
74
  }
75
- function N(e, o = {}) {
76
- var i, t, d;
77
- r.debug = (e == null ? void 0 : e.debug) || !1, n = h(c(c({}, n), e), {
78
- apiRoot: (e == null ? void 0 : e.apiRoot) || n.apiRoot || (e != null && e.env ? C[e.env || "prod"] : n.apiRoot),
75
+ function N(e, i = {}) {
76
+ var o, t, d;
77
+ h.debug = (e == null ? void 0 : e.debug) || !1, n = P(c(c({}, n), e), {
78
+ apiRoot: (e == null ? void 0 : e.apiRoot) || n.apiRoot || (e != null && e.env ? L[e.env || "prod"] : n.apiRoot),
79
79
  // 应用未注册插件时 param.plugins 为 undefined,避免覆盖默认空表
80
- businessPlugins: (t = (i = e == null ? void 0 : e.plugins) != null ? i : n.businessPlugins) != null ? t : {},
80
+ businessPlugins: (t = (o = e == null ? void 0 : e.plugins) != null ? o : n.businessPlugins) != null ? t : {},
81
81
  builtinPlugins: (d = e == null ? void 0 : e.builtinPlugins) != null ? d : n.builtinPlugins
82
- }), o.refreshBuiltinPlugins !== !1 && W(), r.debug && T.log("updated", n);
82
+ }), i.refreshBuiltinPlugins !== !1 && W(), C.log("updated", n);
83
83
  }
84
84
  export {
85
- C as ApiUrl,
85
+ L as ApiUrl,
86
86
  n as configuration,
87
87
  N as configure,
88
88
  M as getRegisteredLocalFilesPluginCode,