@glodon-aiot/bot-client-sdk 3.26.0-alpha.33 → 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 L = Object.prototype.hasOwnProperty, E = 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
- L.call(i, e) && m(h, e, i[e]);
8
- if (v)
9
- for (var e of v(i))
10
- E.call(i, e) && m(h, e, i[e]);
11
- return h;
12
- }, g = (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,90 +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 B } from "./builtinTools/platformSkills.mjs";
35
- import { HostBridgeAdapter as C } from "./localFiles/adapters/HostBridgeAdapter.mjs";
36
- import { connectHostBridge as V } from "./localFiles/host/connectHostBridge.mjs";
37
- import { connectLocalMcpBridge as O } from "./localMcp/endpoints.mjs";
38
- import { LocalWorkspace as H } from "./localFiles/workspace/LocalWorkspace.mjs";
39
- import { createIndexedDbStore as P } from "./localFiles/workspace/handleStore.mjs";
40
- import { createDefaultSessionFileTransfer as D } from "./localFiles/transfer/SessionFileTransfer.mjs";
41
- import { ApplicationTypes as u, PromptVariableType as A } from "@glodon-aiot/apis";
42
- import F from "./AgentSession.mjs";
43
- import j from "./DialogSession.mjs";
44
- import Q from "./EventBus.mjs";
45
- import z from "./package.json.mjs";
46
- const I = new W("[BotClient] ");
47
- class ri {
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 {
48
48
  constructor(i, e, t = !0, o = {
49
49
  analytics: {
50
50
  enabled: !1
51
51
  }
52
52
  }) {
53
- l(this, "event", new Q());
54
- l(this, "cvforceApi");
53
+ h(this, "event", new $());
54
+ h(this, "cvforceApi");
55
55
  //从token解析出来的用户信息
56
- l(this, "_applicationId");
57
- l(this, "_application", null);
56
+ h(this, "_applicationId");
57
+ h(this, "_application", null);
58
58
  //session列表,被加载过的session将会被缓存到这个列表中
59
- l(this, "_sessions", []);
59
+ h(this, "_sessions", []);
60
60
  //活跃的session,只支持一个活跃的session
61
- l(this, "_activeSession");
62
- l(this, "_ready", !1);
61
+ h(this, "_activeSession");
62
+ h(this, "_ready", !1);
63
63
  //问题长度
64
- l(this, "_questionContextMaxLength", 4e3);
65
- l(this, "_promptVariables", []);
66
- l(this, "_localWorkspace");
67
- l(this, "_disconnectHost");
68
- 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, {
69
71
  refreshBuiltinPlugins: !1
70
- }), this._applicationId = y(i).rid || f.applicationId, !this._applicationId)
72
+ }), this._applicationId = S(i).rid || f.applicationId, !this._applicationId)
71
73
  throw "token is not vaild";
72
- this.cvforceApi = this.getService(), O(), this.setupLocalWorkspace(), this.loadApplication().then((n) => {
73
- k(g(_({}, e), {
74
- stream: e.stream === void 0 ? (n == null ? void 0 : n.type) === u.Dialog || (n == null ? void 0 : n.type) === u.Agent : e.stream
75
- })), 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
76
87
  });
77
88
  }
78
89
  setupLocalWorkspace() {
79
- var o, n;
90
+ var o, n, r;
80
91
  const i = (o = f.builtinPlugins) == null ? void 0 : o.localFiles;
81
92
  if (!(i != null && i.enabled)) {
82
- S(void 0), w();
93
+ d.log("workspace:disabled"), A(void 0), I();
83
94
  return;
84
95
  }
85
- 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";
86
100
  if (t !== "file-system-access" && t !== "host-bridge")
87
101
  e.push(new Error(`[LocalFiles] 不支持的 backend:${i.backend}`));
88
102
  else {
89
- const r = M(f.apiRoot, this.token, (s, a) => I.error(a));
90
- this._localWorkspace = new H({
103
+ const s = M(f.apiRoot, this.token, (a, c) => d.error(c));
104
+ this._localWorkspace = new F({
91
105
  applicationId: this._applicationId,
92
106
  config: i,
93
- store: P(),
107
+ store: j(),
94
108
  picker: t === "host-bridge" ? null : void 0,
95
- transfer: D(() => this.cvforceApi, () => r)
96
- }), S(this._localWorkspace), this._localWorkspace.platformSkills = new B({
109
+ transfer: z(() => this.cvforceApi, () => s)
110
+ }), A(this._localWorkspace), this._localWorkspace.platformSkills = new T({
97
111
  applicationId: () => this._applicationId,
98
112
  getToken: () => this.token,
99
113
  getSkills: () => {
100
- var s, a, c, d;
101
- 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 : [];
102
116
  },
103
117
  apiRoot: () => f.apiRoot,
104
118
  getSandbox: () => {
105
- var a;
106
- const s = (a = this._localWorkspace) == null ? void 0 : a.adapter;
107
- return s instanceof C ? 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;
108
122
  }
109
- }), t === "host-bridge" ? this._disconnectHost = V(this._localWorkspace) : this._localWorkspace.restore();
123
+ }), t === "host-bridge" ? this._disconnectHost = H(this._localWorkspace) : this._localWorkspace.restore();
110
124
  }
111
- 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)));
112
126
  }
113
127
  /** 启用 builtinPlugins.localFiles 后可用;UI 与纯 SDK 集成共用此实例。 */
114
128
  get localWorkspace() {
@@ -149,32 +163,32 @@ class ri {
149
163
  {
150
164
  ui: (e = this.sdkConfigs.ui) == null ? void 0 : e.name,
151
165
  uiVersion: (t = this.sdkConfigs.ui) == null ? void 0 : t.version,
152
- sdkVersion: z.version
166
+ sdkVersion: P.version
153
167
  }
154
- ).then((s) => (typeof s.arrange[0].thinkingModeOpen != "boolean" && (s.arrange[0].thinkingModeOpen = !0), typeof s.arrange[0].thinkingTextOpen != "boolean" && (s.arrange[0].thinkingTextOpen = !0), g(_({}, s), {
155
- arrange: [g(_({}, s.arrange[0]), {
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), {
169
+ arrange: [u(_({}, s.arrange[0]), {
156
170
  recommendQuestionOpen: f.loadRelatedQuesions && s.arrange[0].recommendQuestionOpen
157
171
  })]
158
172
  })));
159
173
  const i = (r = (n = (o = this._application) == null ? void 0 : o.arrange) == null ? void 0 : n[0]) == null ? void 0 : r.llmModel;
160
174
  return i && (this._questionContextMaxLength = yield this.cvforceApi.getBaseModel(i).then((s) => s.maxModelLength)), this._promptVariables = yield Promise.all([this.cvforceApi.getPrompts(this._applicationId, {
161
- type: A.User
175
+ type: b.User
162
176
  }), this.cvforceApi.getPrompts(this._applicationId, {
163
- type: A.System
177
+ type: b.System
164
178
  })]).then(([s, a]) => [...s, ...a]), this._ready = !0, this.event.emit("application:loaded"), this._application;
165
179
  });
166
180
  }
167
181
  getService() {
168
- 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));
169
183
  }
170
184
  get token() {
171
185
  return this._token;
172
186
  }
173
187
  set token(i) {
174
188
  this.checkReady(), this._token = i, this.ready = !1;
175
- const e = y(i).rid;
189
+ const e = S(i).rid;
176
190
  this._applicationId !== e && (this._applicationId = e, this._application = null, this.loadApplication().then(() => {
177
- this.event.emit("ready");
191
+ this.logReady(), this.event.emit("ready");
178
192
  }), this.clean());
179
193
  }
180
194
  get applicationId() {
@@ -196,13 +210,13 @@ class ri {
196
210
  return p(this, null, function* () {
197
211
  const r = this;
198
212
  return new Promise((s, a) => {
199
- const c = (d) => p(this, null, function* () {
200
- if (d === u.Agent)
201
- s(new F(i, e, t, o, n, r));
202
- else if (d === u.Dialog)
203
- s(new j(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));
204
218
  else
205
- throw Error(`不支持的应用类型:${d}`);
219
+ throw Error(`不支持的应用类型:${g}`);
206
220
  });
207
221
  if (this.ready) {
208
222
  if (!this._application)
@@ -248,7 +262,10 @@ class ri {
248
262
  r.push(c);
249
263
  }
250
264
  }
251
- 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) {
252
269
  const s = [...this._sessions, ...r], a = /* @__PURE__ */ new Map();
253
270
  for (const c of s)
254
271
  a.set(c.id, c);
@@ -269,12 +286,37 @@ class ri {
269
286
  });
270
287
  });
271
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
+ }
272
311
  loadSession(i = "", e) {
273
312
  return p(this, null, function* () {
274
313
  var o, n;
275
- 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();
276
315
  let t = this.sessions.find((r) => r.id === i);
277
- 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) {
278
320
  if (this._activeSession === t)
279
321
  return t;
280
322
  this._activeSession.inactivate();
@@ -294,7 +336,7 @@ class ri {
294
336
  yield this.reload();
295
337
  let e = this._sessions.find((t) => t.id === i) || this._activeSession;
296
338
  if (!e) {
297
- console.warn("reloadSession session failed.");
339
+ d.warn("reloadSession session failed.");
298
340
  return;
299
341
  }
300
342
  return yield e.reload(), e;
@@ -304,7 +346,7 @@ class ri {
304
346
  return p(this, null, function* () {
305
347
  let o = i ? this._sessions.find((n) => n.id === i) : this._activeSession;
306
348
  if (!o) {
307
- console.warn("setTop session failed.");
349
+ d.warn("setTop session failed.");
308
350
  return;
309
351
  }
310
352
  return yield o.setTop(e), this.getSessions({
@@ -332,7 +374,7 @@ class ri {
332
374
  const o = this._sessions[t];
333
375
  e && (yield o.delete()), this._sessions.splice(t, 1);
334
376
  } else
335
- console.warn("session delete failed, session is not exist.");
377
+ d.warn("session delete failed, session is not exist.");
336
378
  });
337
379
  }
338
380
  clean() {
@@ -341,5 +383,5 @@ class ri {
341
383
  }
342
384
  }
343
385
  export {
344
- ri as default
386
+ li as default
345
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,