@glodon-aiot/bot-client-sdk 3.26.0-alpha.13 → 3.26.0-alpha.14

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.
@@ -10,8 +10,8 @@ var p = (r, e, t) => e in r ? S(r, e, { enumerable: !0, configurable: !0, writab
10
10
  R.call(e, t) && p(r, t, e[t]);
11
11
  return r;
12
12
  }, k = (r, e) => C(r, P(e));
13
- var s = (r, e, t) => (p(r, typeof e != "symbol" ? e + "" : e, t), t);
14
- var o = (r, e, t) => new Promise((i, n) => {
13
+ var i = (r, e, t) => (p(r, typeof e != "symbol" ? e + "" : e, t), t);
14
+ var o = (r, e, t) => new Promise((s, n) => {
15
15
  var a = (l) => {
16
16
  try {
17
17
  c(t.next(l));
@@ -24,7 +24,7 @@ var o = (r, e, t) => new Promise((i, n) => {
24
24
  } catch (d) {
25
25
  n(d);
26
26
  }
27
- }, c = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(a, h);
27
+ }, c = (l) => l.done ? s(l.value) : Promise.resolve(l.value).then(a, h);
28
28
  c((t = t.apply(r, e)).next());
29
29
  });
30
30
  import b from "../../EventBus.mjs";
@@ -47,7 +47,7 @@ function U(r) {
47
47
  if (e.startsWith("/") || e.includes(":") || e.includes("\0"))
48
48
  return;
49
49
  const t = e.split("/");
50
- if (!t.some((i) => !i || i === "." || i === ".."))
50
+ if (!t.some((s) => !s || s === "." || s === ".."))
51
51
  return t.join("/");
52
52
  }
53
53
  function x(r) {
@@ -55,40 +55,42 @@ function x(r) {
55
55
  }
56
56
  class X {
57
57
  constructor(e) {
58
- s(this, "applicationId");
59
- s(this, "limits");
60
- s(this, "sensitive");
61
- s(this, "downloadUrlAllowlist");
62
- s(this, "allowWorkspaceWideTextSearch");
63
- s(this, "transfer");
64
- s(this, "fetch");
65
- s(this, "commandRunner");
66
- s(this, "browserRuntime");
67
- s(this, "store");
68
- s(this, "picker");
69
- s(this, "event", new b(!0));
70
- s(this, "_status");
71
- s(this, "_displayName");
72
- s(this, "_adapter", null);
73
- s(this, "pendingHandle", null);
74
- s(this, "approvalHandler");
75
- s(this, "activeCalls", 0);
76
- s(this, "commandRunning", !1);
77
- s(this, "inflight", /* @__PURE__ */ new Set());
78
- s(this, "_ready", Promise.resolve());
79
- s(this, "stopWatching", () => {
58
+ i(this, "applicationId");
59
+ i(this, "limits");
60
+ i(this, "sensitive");
61
+ i(this, "downloadUrlAllowlist");
62
+ i(this, "allowWorkspaceWideTextSearch");
63
+ i(this, "transfer");
64
+ i(this, "fetch");
65
+ i(this, "commandRunner");
66
+ /** 平台技能同步。由 BotClient 在启用本地工作区后挂上。 */
67
+ i(this, "platformSkills");
68
+ i(this, "browserRuntime");
69
+ i(this, "store");
70
+ i(this, "picker");
71
+ i(this, "event", new b(!0));
72
+ i(this, "_status");
73
+ i(this, "_displayName");
74
+ i(this, "_adapter", null);
75
+ i(this, "pendingHandle", null);
76
+ i(this, "approvalHandler");
77
+ i(this, "activeCalls", 0);
78
+ i(this, "commandRunning", !1);
79
+ i(this, "inflight", /* @__PURE__ */ new Set());
80
+ i(this, "_ready", Promise.resolve());
81
+ i(this, "stopWatching", () => {
80
82
  });
81
- s(this, "pendingChangePaths", /* @__PURE__ */ new Set());
82
- s(this, "changeTimer");
83
- s(this, "refreshAllVisible", !1);
83
+ i(this, "pendingChangePaths", /* @__PURE__ */ new Set());
84
+ i(this, "changeTimer");
85
+ i(this, "refreshAllVisible", !1);
84
86
  var h, c, l, d, f, g, y, v, w, A;
85
87
  const t = (h = e.config) != null ? h : {};
86
88
  this.applicationId = e.applicationId, this.store = (c = e.store) != null ? c : N(), this.picker = e.picker === null ? void 0 : (l = e.picker) != null ? l : T(), this.limits = I(t.limits), this.sensitive = new q(t.sensitiveRulesAppend), this.downloadUrlAllowlist = W(t.downloadUrlAllowlistAppend), this.allowWorkspaceWideTextSearch = !!t.allowWorkspaceWideTextSearch, this.approvalHandler = t.onApprovalRequired;
87
- const i = (d = e.transfer) != null ? d : L(() => {
89
+ const s = (d = e.transfer) != null ? d : L(() => {
88
90
  });
89
91
  this.transfer = {
90
- upload: (g = (f = t.transfer) == null ? void 0 : f.upload) != null ? g : i.upload,
91
- resolveDownload: (v = (y = t.transfer) == null ? void 0 : y.resolveDownload) != null ? v : i.resolveDownload
92
+ upload: (g = (f = t.transfer) == null ? void 0 : f.upload) != null ? g : s.upload,
93
+ resolveDownload: (v = (y = t.transfer) == null ? void 0 : y.resolveDownload) != null ? v : s.resolveDownload
92
94
  };
93
95
  const n = (w = e.fetch) != null ? w : typeof fetch == "function" ? fetch : void 0;
94
96
  this.fetch = n ? n.bind(globalThis) : () => Promise.reject(new Error("fetch is not available")), this.commandRunner = e.commandRunner;
@@ -156,13 +158,13 @@ class X {
156
158
  return e.then((t) => o(this, null, function* () {
157
159
  var n, a;
158
160
  this.cancelAll();
159
- const i = (a = yield (n = t.queryPermission) == null ? void 0 : n.call(t, u)) != null ? a : "granted";
161
+ const s = (a = yield (n = t.queryPermission) == null ? void 0 : n.call(t, u)) != null ? a : "granted";
160
162
  return yield this.store.set(this.handleKey, {
161
163
  handle: t,
162
164
  displayName: t.name,
163
165
  savedAt: Date.now()
164
166
  }).catch(() => {
165
- }), i === "denied" ? (this.pendingHandle = t, this._adapter = null, this.setStatus("denied", t.name), !1) : (this.attachHandle(t), !0);
167
+ }), s === "denied" ? (this.pendingHandle = t, this._adapter = null, this.setStatus("denied", t.name), !1) : (this.attachHandle(t), !0);
166
168
  }), (t) => {
167
169
  if (x(t))
168
170
  return !1;
@@ -175,7 +177,7 @@ class X {
175
177
  }
176
178
  doRestore() {
177
179
  return o(this, null, function* () {
178
- var i, n, a;
180
+ var s, n, a;
179
181
  if (!this.picker) {
180
182
  this._adapter || this.setStatus("unsupported");
181
183
  return;
@@ -192,7 +194,7 @@ class X {
192
194
  }
193
195
  let t;
194
196
  try {
195
- t = (a = yield (n = (i = e.handle).queryPermission) == null ? void 0 : n.call(i, u)) != null ? a : "prompt";
197
+ t = (a = yield (n = (s = e.handle).queryPermission) == null ? void 0 : n.call(s, u)) != null ? a : "prompt";
196
198
  } catch (h) {
197
199
  t = "prompt";
198
200
  }
@@ -207,10 +209,10 @@ class X {
207
209
  let t;
208
210
  try {
209
211
  t = e.requestPermission(u);
210
- } catch (i) {
211
- return Promise.reject(i);
212
+ } catch (s) {
213
+ return Promise.reject(s);
212
214
  }
213
- return t.then((i) => i === "granted" ? (this.attachHandle(e), !0) : (this._adapter = null, this.setStatus(i === "denied" ? "denied" : "prompt", e.name), !1));
215
+ return t.then((s) => s === "granted" ? (this.attachHandle(e), !0) : (this._adapter = null, this.setStatus(s === "denied" ? "denied" : "prompt", e.name), !1));
214
216
  }
215
217
  /** 断开工作区并删除持久化句柄。状态立即变为未授权,存储删除在其后完成。 */
216
218
  clear() {
@@ -233,8 +235,8 @@ class X {
233
235
  this.refreshAllVisible = !0;
234
236
  else
235
237
  for (const t of e) {
236
- const i = U(t);
237
- i === void 0 ? this.refreshAllVisible = !0 : this.pendingChangePaths.add(i);
238
+ const s = U(t);
239
+ s === void 0 ? this.refreshAllVisible = !0 : this.pendingChangePaths.add(s);
238
240
  }
239
241
  clearTimeout(this.changeTimer), this.changeTimer = setTimeout(() => this.flushFilesChanged(), 150);
240
242
  }
@@ -339,7 +341,7 @@ class X {
339
341
  }
340
342
  flushFilesChanged() {
341
343
  this.changeTimer = void 0;
342
- const e = this.refreshAllVisible, t = [...this.pendingChangePaths].sort((i, n) => i < n ? -1 : i > n ? 1 : 0);
344
+ const e = this.refreshAllVisible, t = [...this.pendingChangePaths].sort((s, n) => s < n ? -1 : s > n ? 1 : 0);
343
345
  this.pendingChangePaths.clear(), this.refreshAllVisible = !1, this._status === "granted" && this.emit("files:changed", {
344
346
  paths: e ? [] : t
345
347
  });
@@ -348,8 +350,8 @@ class X {
348
350
  emit(e, t) {
349
351
  try {
350
352
  this.event.emit(e, t);
351
- } catch (i) {
352
- console.error(`[LocalWorkspace] ${e} listener failed`, i);
353
+ } catch (s) {
354
+ console.error(`[LocalWorkspace] ${e} listener failed`, s);
353
355
  }
354
356
  }
355
357
  }
@@ -1,4 +1,4 @@
1
- const e = "@glodon-aiot/bot-client-sdk", s = "3.26.0-alpha.13", t = "glodoncv", i = "aiot bot client js sdk", n = "module", g = !1, o = [
1
+ const e = "@glodon-aiot/bot-client-sdk", s = "3.26.0-alpha.14", t = "glodoncv", i = "aiot bot client js sdk", n = "module", g = !1, o = [
2
2
  "aiot",
3
3
  "bot",
4
4
  "bot client",
@@ -68,7 +68,7 @@ const e = "@glodon-aiot/bot-client-sdk", s = "3.26.0-alpha.13", t = "glodoncv",
68
68
  access: "public",
69
69
  registry: "https://registry.npmjs.org/"
70
70
  }, y = {
71
- "@glodon-aiot/apis": "^3.26.0-alpha.13",
71
+ "@glodon-aiot/apis": "^3.26.0-alpha.14",
72
72
  axios: "0.24.0",
73
73
  buffer: "^6.0.3",
74
74
  dayjs: "^1.11.13",