@glodon-aiot/bot-client-sdk 3.26.0-alpha.5 → 3.26.0-alpha.8
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.
- package/README.md +76 -105
- package/dist/es/AgentSession.mjs +32 -33
- package/dist/es/Config.mjs +85 -63
- package/dist/es/DialogSession.mjs +39 -40
- package/dist/es/Session.mjs +71 -63
- package/dist/es/index.mjs +48 -49
- package/dist/es/localFiles/adapters/FileSystemAccessAdapter.mjs +103 -193
- package/dist/es/localFiles/adapters/HostBridgeAdapter.mjs +77 -138
- package/dist/es/localFiles/adapters/MemoryWorkspaceAdapter.mjs +97 -132
- package/dist/es/localFiles/adapters/WorkspaceFileAdapter.mjs +28 -32
- package/dist/es/localFiles/constants.mjs +1 -1
- package/dist/es/localFiles/createLocalPythonPlugin.mjs +196 -0
- package/dist/es/localFiles/host/connectHostBridge.mjs +18 -22
- package/dist/es/localFiles/host/protocol.mjs +5 -6
- package/dist/es/localFiles/schemas.mjs +60 -45
- package/dist/es/localFiles/validate.mjs +37 -37
- package/dist/es/localFiles/workspace/LocalWorkspace.mjs +52 -71
- package/dist/es/package.json.mjs +29 -38
- package/dist/lib/index.js +9 -372
- package/dist/src/Config.d.ts +2 -2
- package/dist/src/Session.d.ts +4 -0
- package/dist/src/localFiles/adapters/FileSystemAccessAdapter.d.ts +1 -4
- package/dist/src/localFiles/adapters/HostBridgeAdapter.d.ts +1 -20
- package/dist/src/localFiles/adapters/MemoryWorkspaceAdapter.d.ts +1 -4
- package/dist/src/localFiles/adapters/WorkspaceFileAdapter.d.ts +0 -14
- package/dist/src/localFiles/adapters/fsaTypes.d.ts +0 -2
- package/dist/src/localFiles/constants.d.ts +1 -2
- package/dist/src/localFiles/host/protocol.d.ts +0 -13
- package/dist/src/localFiles/index.d.ts +2 -3
- package/dist/src/localFiles/schemas.d.ts +3 -2
- package/dist/src/localFiles/types.d.ts +1 -14
- package/dist/src/localFiles/workspace/LocalWorkspace.d.ts +0 -12
- package/package.json +4 -13
- package/dist/es/builtinTools/browserRuntime/BrowserCommandRunner.mjs +0 -201
- package/dist/es/builtinTools/browserRuntime/PythonRunner.mjs +0 -356
- package/dist/es/builtinTools/browserRuntime/WorkspaceBashFs.mjs +0 -350
- package/dist/es/builtinTools/browserRuntime/assets.mjs +0 -9
- package/dist/es/builtinTools/browserRuntime/loadBash.mjs +0 -17
- package/dist/es/builtinTools/browserRuntime/pyodideRunner.py.mjs +0 -96
- package/dist/es/builtinTools/browserRuntime/pyodideWorker.mjs +0 -242
- package/dist/es/builtinTools/command.mjs +0 -56
- package/dist/es/builtinTools/constants.mjs +0 -10
- package/dist/es/builtinTools/createBuiltinToolsPlugin.mjs +0 -236
- package/dist/es/builtinTools/overview.mjs +0 -77
- package/dist/es/builtinTools/paths.mjs +0 -63
- package/dist/es/builtinTools/schemas.mjs +0 -216
- package/dist/es/builtinTools/tools.mjs +0 -471
- package/dist/src/builtinTools/browserRuntime/BrowserCommandRunner.d.ts +0 -26
- package/dist/src/builtinTools/browserRuntime/PythonRunner.d.ts +0 -67
- package/dist/src/builtinTools/browserRuntime/WorkspaceBashFs.d.ts +0 -51
- package/dist/src/builtinTools/browserRuntime/assets.d.ts +0 -13
- package/dist/src/builtinTools/browserRuntime/loadBash.d.ts +0 -3
- package/dist/src/builtinTools/browserRuntime/pyodideWorker.d.ts +0 -44
- package/dist/src/builtinTools/command.d.ts +0 -26
- package/dist/src/builtinTools/constants.d.ts +0 -17
- package/dist/src/builtinTools/createBuiltinToolsPlugin.d.ts +0 -11
- package/dist/src/builtinTools/overview.d.ts +0 -5
- package/dist/src/builtinTools/paths.d.ts +0 -15
- package/dist/src/builtinTools/schemas.d.ts +0 -3
- package/dist/src/builtinTools/tools.d.ts +0 -60
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var j = Object.defineProperty, p = Object.defineProperties;
|
|
2
|
+
var x = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var $ = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var g = (i,
|
|
6
|
-
for (var
|
|
7
|
-
|
|
4
|
+
var A = Object.prototype.hasOwnProperty, I = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var g = (i, r, n) => r in i ? j(i, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[r] = n, s = (i, r) => {
|
|
6
|
+
for (var n in r || (r = {}))
|
|
7
|
+
A.call(r, n) && g(i, n, r[n]);
|
|
8
8
|
if ($)
|
|
9
|
-
for (var
|
|
10
|
-
|
|
9
|
+
for (var n of $(r))
|
|
10
|
+
I.call(r, n) && g(i, n, r[n]);
|
|
11
11
|
return i;
|
|
12
|
-
},
|
|
13
|
-
import { ToolError as
|
|
14
|
-
function
|
|
15
|
-
throw new
|
|
12
|
+
}, c = (i, r) => p(i, x(r));
|
|
13
|
+
import { ToolError as O, ToolCode as w } from "./errors.mjs";
|
|
14
|
+
function t(i, r) {
|
|
15
|
+
throw new O(w.BadRequest, i ? `参数 ${i} ${r}` : `参数${r}`);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
return typeof i != "string" ? i : (
|
|
17
|
+
function N(i, r) {
|
|
18
|
+
return typeof i != "string" ? i : (r.type === "integer" || r.type === "number") && /^-?\d+(\.\d+)?$/.test(i.trim()) ? Number(i) : r.type === "boolean" && (i === "true" || i === "false") ? i === "true" : i;
|
|
19
19
|
}
|
|
20
|
-
function y(i,
|
|
21
|
-
switch (i =
|
|
20
|
+
function y(i, r, n) {
|
|
21
|
+
switch (i = N(i, r), r.type) {
|
|
22
22
|
case "string":
|
|
23
|
-
typeof i != "string" &&
|
|
23
|
+
typeof i != "string" && t(n, "必须是字符串。"), r.minLength !== void 0 && i.length < r.minLength && t(n, "不能为空。");
|
|
24
24
|
break;
|
|
25
25
|
case "integer":
|
|
26
|
-
(typeof i != "number" || !Number.isInteger(i)) &&
|
|
26
|
+
(typeof i != "number" || !Number.isInteger(i)) && t(n, "必须是整数。");
|
|
27
27
|
break;
|
|
28
28
|
case "number":
|
|
29
|
-
(typeof i != "number" || !Number.isFinite(i)) &&
|
|
29
|
+
(typeof i != "number" || !Number.isFinite(i)) && t(n, "必须是数字。");
|
|
30
30
|
break;
|
|
31
31
|
case "boolean":
|
|
32
|
-
typeof i != "boolean" &&
|
|
32
|
+
typeof i != "boolean" && t(n, "必须是布尔值。");
|
|
33
33
|
break;
|
|
34
34
|
case "array":
|
|
35
|
-
if (Array.isArray(i) ||
|
|
36
|
-
const e =
|
|
37
|
-
return i.map((f, m) => y(f, e, `${
|
|
35
|
+
if (Array.isArray(i) || t(n, "必须是数组。"), r.minItems !== void 0 && i.length < r.minItems && t(n, "不能为空。"), r.items) {
|
|
36
|
+
const e = r.items;
|
|
37
|
+
return i.map((f, m) => y(f, e, `${n}[${m}]`));
|
|
38
38
|
}
|
|
39
39
|
break;
|
|
40
40
|
case "object":
|
|
41
|
-
return
|
|
41
|
+
return k(i, r, n);
|
|
42
42
|
}
|
|
43
|
-
return
|
|
43
|
+
return r.enum && !r.enum.includes(i) && t(n, `必须是 ${r.enum.join("、")} 之一。`), typeof i == "number" && (r.minimum !== void 0 && i < r.minimum && t(n, `不能小于 ${r.minimum}。`), r.maximum !== void 0 && i > r.maximum && t(n, `不能大于 ${r.maximum}。`)), i;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function k(i, r, n) {
|
|
46
46
|
var m, d;
|
|
47
|
-
(!i || typeof i != "object" || Array.isArray(i)) &&
|
|
47
|
+
(!i || typeof i != "object" || Array.isArray(i)) && t(n, "必须是对象。");
|
|
48
48
|
const e = i, f = {};
|
|
49
|
-
for (const
|
|
50
|
-
(e[
|
|
51
|
-
for (const [
|
|
52
|
-
if (e[
|
|
49
|
+
for (const o of (m = r.required) != null ? m : [])
|
|
50
|
+
(e[o] === void 0 || e[o] === null) && t(n ? `${n}.${o}` : o, "是必填项。");
|
|
51
|
+
for (const [o, b] of Object.entries((d = r.properties) != null ? d : {})) {
|
|
52
|
+
if (e[o] === void 0 || e[o] === null)
|
|
53
53
|
continue;
|
|
54
|
-
const u =
|
|
55
|
-
f[
|
|
54
|
+
const u = n ? `${n}.${o}` : o;
|
|
55
|
+
f[o] = b.oneOf ? (y(e[o], c(s({}, b), {
|
|
56
56
|
oneOf: void 0
|
|
57
|
-
}), u), e[
|
|
57
|
+
}), u), e[o]) : y(e[o], b, u);
|
|
58
58
|
}
|
|
59
59
|
return f;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
return
|
|
61
|
+
function L(i, r) {
|
|
62
|
+
return k(i, r, "");
|
|
63
63
|
}
|
|
64
64
|
export {
|
|
65
|
-
|
|
65
|
+
L as validateToolInput
|
|
66
66
|
};
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var _ = Object.defineProperty, k = Object.defineProperties;
|
|
2
|
+
var S = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var w = Object.getOwnPropertySymbols;
|
|
4
|
+
var C = Object.prototype.hasOwnProperty, P = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var u = (r, e, t) => e in r ? _(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, f = (r, e) => {
|
|
6
6
|
for (var t in e || (e = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
|
|
7
|
+
C.call(e, t) && u(r, t, e[t]);
|
|
8
|
+
if (w)
|
|
9
|
+
for (var t of w(e))
|
|
10
|
+
P.call(e, t) && u(r, t, e[t]);
|
|
11
11
|
return r;
|
|
12
|
-
},
|
|
13
|
-
var s = (r, e, t) => (
|
|
14
|
-
var o = (r, e, t) => new Promise((i,
|
|
15
|
-
var
|
|
12
|
+
}, A = (r, e) => k(r, S(e));
|
|
13
|
+
var s = (r, e, t) => (u(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
14
|
+
var o = (r, e, t) => new Promise((i, a) => {
|
|
15
|
+
var n = (l) => {
|
|
16
16
|
try {
|
|
17
17
|
c(t.next(l));
|
|
18
18
|
} catch (d) {
|
|
19
|
-
|
|
19
|
+
a(d);
|
|
20
20
|
}
|
|
21
21
|
}, h = (l) => {
|
|
22
22
|
try {
|
|
23
23
|
c(t.throw(l));
|
|
24
24
|
} catch (d) {
|
|
25
|
-
|
|
25
|
+
a(d);
|
|
26
26
|
}
|
|
27
|
-
}, c = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(
|
|
27
|
+
}, c = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(n, h);
|
|
28
28
|
c((t = t.apply(r, e)).next());
|
|
29
29
|
});
|
|
30
|
-
import
|
|
31
|
-
import { FileSystemAccessAdapter as
|
|
32
|
-
import { getNativeDirectoryPicker as
|
|
33
|
-
import { LOCAL_FILES_FUNCTION_CODES as
|
|
34
|
-
import { getDownloadUrlAllowlist as
|
|
35
|
-
import { SensitiveFilePolicy as
|
|
36
|
-
import { resolveLimits as
|
|
37
|
-
import { createDefaultSessionFileTransfer as
|
|
38
|
-
import { createMemoryStore as
|
|
30
|
+
import H from "../../EventBus.mjs";
|
|
31
|
+
import { FileSystemAccessAdapter as b } from "../adapters/FileSystemAccessAdapter.mjs";
|
|
32
|
+
import { getNativeDirectoryPicker as D } from "../adapters/fsaTypes.mjs";
|
|
33
|
+
import { LOCAL_FILES_FUNCTION_CODES as T } from "../constants.mjs";
|
|
34
|
+
import { getDownloadUrlAllowlist as F } from "../security/downloadUrlPolicy.mjs";
|
|
35
|
+
import { SensitiveFilePolicy as W } from "../security/sensitiveFiles.mjs";
|
|
36
|
+
import { resolveLimits as q } from "../limits.mjs";
|
|
37
|
+
import { createDefaultSessionFileTransfer as N } from "../transfer/SessionFileTransfer.mjs";
|
|
38
|
+
import { createMemoryStore as I } from "./handleStore.mjs";
|
|
39
39
|
import { watchDirectoryHandle as E } from "./watchDirectory.mjs";
|
|
40
|
-
const
|
|
40
|
+
const p = {
|
|
41
41
|
mode: "readwrite"
|
|
42
42
|
};
|
|
43
|
-
function
|
|
43
|
+
function K(r) {
|
|
44
44
|
const e = r.replace(/\\/g, "/").trim().replace(/^\.\/+/, "").replace(/\/+$/, "");
|
|
45
45
|
if (!e || e === ".")
|
|
46
46
|
return "";
|
|
@@ -50,10 +50,10 @@ function U(r) {
|
|
|
50
50
|
if (!t.some((i) => !i || i === "." || i === ".."))
|
|
51
51
|
return t.join("/");
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function L(r) {
|
|
54
54
|
return !!r && typeof r == "object" && r.name === "AbortError";
|
|
55
55
|
}
|
|
56
|
-
class
|
|
56
|
+
class J {
|
|
57
57
|
constructor(e) {
|
|
58
58
|
s(this, "applicationId");
|
|
59
59
|
s(this, "limits");
|
|
@@ -62,18 +62,15 @@ class X {
|
|
|
62
62
|
s(this, "allowWorkspaceWideTextSearch");
|
|
63
63
|
s(this, "transfer");
|
|
64
64
|
s(this, "fetch");
|
|
65
|
-
s(this, "commandRunner");
|
|
66
|
-
s(this, "browserRuntime");
|
|
67
65
|
s(this, "store");
|
|
68
66
|
s(this, "picker");
|
|
69
|
-
s(this, "event", new
|
|
67
|
+
s(this, "event", new H(!0));
|
|
70
68
|
s(this, "_status");
|
|
71
69
|
s(this, "_displayName");
|
|
72
70
|
s(this, "_adapter", null);
|
|
73
71
|
s(this, "pendingHandle", null);
|
|
74
72
|
s(this, "approvalHandler");
|
|
75
73
|
s(this, "activeCalls", 0);
|
|
76
|
-
s(this, "commandRunning", !1);
|
|
77
74
|
s(this, "inflight", /* @__PURE__ */ new Set());
|
|
78
75
|
s(this, "_ready", Promise.resolve());
|
|
79
76
|
s(this, "stopWatching", () => {
|
|
@@ -81,23 +78,17 @@ class X {
|
|
|
81
78
|
s(this, "pendingChangePaths", /* @__PURE__ */ new Set());
|
|
82
79
|
s(this, "changeTimer");
|
|
83
80
|
s(this, "refreshAllVisible", !1);
|
|
84
|
-
var h, c, l, d,
|
|
85
|
-
const t = (
|
|
86
|
-
this.applicationId = e.applicationId, this.store = (
|
|
87
|
-
const i = (
|
|
81
|
+
var n, h, c, l, d, m, g, y, v;
|
|
82
|
+
const t = (n = e.config) != null ? n : {};
|
|
83
|
+
this.applicationId = e.applicationId, this.store = (h = e.store) != null ? h : I(), this.picker = e.picker === null ? void 0 : (c = e.picker) != null ? c : D(), this.limits = q(t.limits), this.sensitive = new W(t.sensitiveRulesAppend), this.downloadUrlAllowlist = F(t.downloadUrlAllowlistAppend), this.allowWorkspaceWideTextSearch = !!t.allowWorkspaceWideTextSearch, this.approvalHandler = t.onApprovalRequired;
|
|
84
|
+
const i = (l = e.transfer) != null ? l : N(() => {
|
|
88
85
|
});
|
|
89
86
|
this.transfer = {
|
|
90
|
-
upload: (
|
|
91
|
-
resolveDownload: (
|
|
87
|
+
upload: (m = (d = t.transfer) == null ? void 0 : d.upload) != null ? m : i.upload,
|
|
88
|
+
resolveDownload: (y = (g = t.transfer) == null ? void 0 : g.resolveDownload) != null ? y : i.resolveDownload
|
|
92
89
|
};
|
|
93
|
-
const
|
|
94
|
-
this.fetch =
|
|
95
|
-
const a = (A = t.commandRuntime) == null ? void 0 : A.browser;
|
|
96
|
-
this.browserRuntime = {
|
|
97
|
-
enabled: (a == null ? void 0 : a.enabled) !== !1,
|
|
98
|
-
bashModuleURL: a == null ? void 0 : a.bashModuleURL,
|
|
99
|
-
pyodideIndexURL: a == null ? void 0 : a.pyodideIndexURL
|
|
100
|
-
}, this._status = this.picker ? "none" : "unsupported";
|
|
90
|
+
const a = (v = e.fetch) != null ? v : typeof fetch == "function" ? fetch : void 0;
|
|
91
|
+
this.fetch = a ? a.bind(globalThis) : () => Promise.reject(new Error("fetch is not available")), this._status = this.picker ? "none" : "unsupported";
|
|
101
92
|
}
|
|
102
93
|
// -------------------------------------------------------------------------
|
|
103
94
|
// 状态
|
|
@@ -133,7 +124,7 @@ class X {
|
|
|
133
124
|
}));
|
|
134
125
|
}
|
|
135
126
|
attachHandle(e) {
|
|
136
|
-
this.cancelFilesChanged(), this.pendingHandle = e, this._adapter = new
|
|
127
|
+
this.cancelFilesChanged(), this.pendingHandle = e, this._adapter = new b(e), this.setStatus("granted", e.name), this.unwatchDirectory(), this.stopWatching = E(e, (t) => this.notifyFilesChanged(t));
|
|
137
128
|
}
|
|
138
129
|
// -------------------------------------------------------------------------
|
|
139
130
|
// 授权
|
|
@@ -154,9 +145,9 @@ class X {
|
|
|
154
145
|
return Promise.reject(t);
|
|
155
146
|
}
|
|
156
147
|
return e.then((t) => o(this, null, function* () {
|
|
157
|
-
var
|
|
148
|
+
var a, n;
|
|
158
149
|
this.cancelAll();
|
|
159
|
-
const i = (
|
|
150
|
+
const i = (n = yield (a = t.queryPermission) == null ? void 0 : a.call(t, p)) != null ? n : "granted";
|
|
160
151
|
return yield this.store.set(this.handleKey, {
|
|
161
152
|
handle: t,
|
|
162
153
|
displayName: t.name,
|
|
@@ -164,7 +155,7 @@ class X {
|
|
|
164
155
|
}).catch(() => {
|
|
165
156
|
}), i === "denied" ? (this.pendingHandle = t, this._adapter = null, this.setStatus("denied", t.name), !1) : (this.attachHandle(t), !0);
|
|
166
157
|
}), (t) => {
|
|
167
|
-
if (
|
|
158
|
+
if (L(t))
|
|
168
159
|
return !1;
|
|
169
160
|
throw t;
|
|
170
161
|
});
|
|
@@ -175,7 +166,7 @@ class X {
|
|
|
175
166
|
}
|
|
176
167
|
doRestore() {
|
|
177
168
|
return o(this, null, function* () {
|
|
178
|
-
var i,
|
|
169
|
+
var i, a, n;
|
|
179
170
|
if (!this.picker) {
|
|
180
171
|
this._adapter || this.setStatus("unsupported");
|
|
181
172
|
return;
|
|
@@ -192,7 +183,7 @@ class X {
|
|
|
192
183
|
}
|
|
193
184
|
let t;
|
|
194
185
|
try {
|
|
195
|
-
t = (
|
|
186
|
+
t = (n = yield (a = (i = e.handle).queryPermission) == null ? void 0 : a.call(i, p)) != null ? n : "prompt";
|
|
196
187
|
} catch (h) {
|
|
197
188
|
t = "prompt";
|
|
198
189
|
}
|
|
@@ -206,7 +197,7 @@ class X {
|
|
|
206
197
|
return Promise.resolve(!1);
|
|
207
198
|
let t;
|
|
208
199
|
try {
|
|
209
|
-
t = e.requestPermission(
|
|
200
|
+
t = e.requestPermission(p);
|
|
210
201
|
} catch (i) {
|
|
211
202
|
return Promise.reject(i);
|
|
212
203
|
}
|
|
@@ -233,7 +224,7 @@ class X {
|
|
|
233
224
|
this.refreshAllVisible = !0;
|
|
234
225
|
else
|
|
235
226
|
for (const t of e) {
|
|
236
|
-
const i =
|
|
227
|
+
const i = K(t);
|
|
237
228
|
i === void 0 ? this.refreshAllVisible = !0 : this.pendingChangePaths.add(i);
|
|
238
229
|
}
|
|
239
230
|
clearTimeout(this.changeTimer), this.changeTimer = setTimeout(() => this.flushFilesChanged(), 150);
|
|
@@ -245,7 +236,7 @@ class X {
|
|
|
245
236
|
const e = this.pendingHandle;
|
|
246
237
|
if (!(e != null && e.queryPermission))
|
|
247
238
|
return;
|
|
248
|
-
const t = yield e.queryPermission(
|
|
239
|
+
const t = yield e.queryPermission(p).catch(() => "prompt");
|
|
249
240
|
t !== "granted" && (this.cancelAll(), this.cancelFilesChanged(), this.unwatchDirectory(), this._adapter = null, this.setStatus(t === "denied" ? "denied" : "prompt", e.name));
|
|
250
241
|
});
|
|
251
242
|
}
|
|
@@ -290,16 +281,6 @@ class X {
|
|
|
290
281
|
e || (e = !0, this.activeCalls--);
|
|
291
282
|
};
|
|
292
283
|
}
|
|
293
|
-
/** @internal 同一工作区同一时间只跑一个命令;已有命令在运行时返回 null。 */
|
|
294
|
-
acquireCommand() {
|
|
295
|
-
if (this.commandRunning)
|
|
296
|
-
return null;
|
|
297
|
-
this.commandRunning = !0;
|
|
298
|
-
let e = !1;
|
|
299
|
-
return () => {
|
|
300
|
-
e || (e = !0, this.commandRunning = !1);
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
284
|
/** @internal 登记进行中的调用,更换或断开工作区时统一中止。 */
|
|
304
285
|
track(e) {
|
|
305
286
|
return this.inflight.add(e), () => this.inflight.delete(e);
|
|
@@ -310,14 +291,14 @@ class X {
|
|
|
310
291
|
this.inflight.clear(), e.forEach((t) => t.abort());
|
|
311
292
|
}
|
|
312
293
|
handshake() {
|
|
313
|
-
const e = Object.fromEntries(
|
|
294
|
+
const e = Object.fromEntries(T.map((t) => [t, !0]));
|
|
314
295
|
return {
|
|
315
296
|
protocolVersion: "1.0",
|
|
316
|
-
capabilities:
|
|
297
|
+
capabilities: A(f({}, e), {
|
|
317
298
|
cancellation: !0,
|
|
318
299
|
atomicWrite: !0
|
|
319
300
|
}),
|
|
320
|
-
limits:
|
|
301
|
+
limits: f({}, this.limits)
|
|
321
302
|
};
|
|
322
303
|
}
|
|
323
304
|
// -------------------------------------------------------------------------
|
|
@@ -339,7 +320,7 @@ class X {
|
|
|
339
320
|
}
|
|
340
321
|
flushFilesChanged() {
|
|
341
322
|
this.changeTimer = void 0;
|
|
342
|
-
const e = this.refreshAllVisible, t = [...this.pendingChangePaths].sort((i,
|
|
323
|
+
const e = this.refreshAllVisible, t = [...this.pendingChangePaths].sort((i, a) => i < a ? -1 : i > a ? 1 : 0);
|
|
343
324
|
this.pendingChangePaths.clear(), this.refreshAllVisible = !1, this._status === "granted" && this.emit("files:changed", {
|
|
344
325
|
paths: e ? [] : t
|
|
345
326
|
});
|
|
@@ -354,5 +335,5 @@ class X {
|
|
|
354
335
|
}
|
|
355
336
|
}
|
|
356
337
|
export {
|
|
357
|
-
|
|
338
|
+
J as LocalWorkspace
|
|
358
339
|
};
|
package/dist/es/package.json.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const e = "@glodon-aiot/bot-client-sdk",
|
|
1
|
+
const e = "@glodon-aiot/bot-client-sdk", t = "3.26.0-alpha.8", i = "glodoncv", s = "aiot bot client js sdk", n = "module", y = !1, o = [
|
|
2
2
|
"aiot",
|
|
3
3
|
"bot",
|
|
4
4
|
"bot client",
|
|
5
5
|
"sdk"
|
|
6
|
-
],
|
|
6
|
+
], l = [
|
|
7
7
|
"dist"
|
|
8
|
-
], p = "./dist/es/index.mjs",
|
|
8
|
+
], p = "./dist/es/index.mjs", c = "./dist/lib/index.js", r = "./dist/src/index.d.ts", d = {
|
|
9
9
|
".": {
|
|
10
10
|
import: "./dist/es/index.mjs",
|
|
11
11
|
require: "./dist/lib/index.js",
|
|
@@ -22,14 +22,8 @@ const e = "@glodon-aiot/bot-client-sdk", s = "3.26.0-alpha.5", t = "glodoncv", i
|
|
|
22
22
|
preview: "vite preview",
|
|
23
23
|
check: "yarn prettier --check .",
|
|
24
24
|
write: "yarn prettier --write .",
|
|
25
|
-
lint: "eslint --ext .tsx,.ts --fix ./example -c .eslintrc.js"
|
|
26
|
-
|
|
27
|
-
"upload:just-bash": "node scripts/build-just-bash.mjs && node scripts/upload-cdn-libs.cjs just-bash",
|
|
28
|
-
"build:pyodide": "node scripts/build-pyodide.mjs",
|
|
29
|
-
"upload:pyodide": "node scripts/build-pyodide.mjs && node scripts/upload-cdn-libs.cjs pyodide",
|
|
30
|
-
test: "vitest run",
|
|
31
|
-
"test:watch": "vitest"
|
|
32
|
-
}, b = {
|
|
25
|
+
lint: "eslint --ext .tsx,.ts --fix ./example -c .eslintrc.js"
|
|
26
|
+
}, g = {
|
|
33
27
|
"@babel/core": "^7.20.12",
|
|
34
28
|
"@commitlint/cli": "^17.0.3",
|
|
35
29
|
"@commitlint/config-conventional": "^17.0.3",
|
|
@@ -51,10 +45,8 @@ const e = "@glodon-aiot/bot-client-sdk", s = "3.26.0-alpha.5", t = "glodoncv", i
|
|
|
51
45
|
express: "4",
|
|
52
46
|
"http-proxy-middleware": "^3.0.0",
|
|
53
47
|
"identity-obj-proxy": "^3.0.0",
|
|
54
|
-
"just-bash": "3.6.0",
|
|
55
48
|
"npm-run-all": "^4.1.5",
|
|
56
49
|
prettier: "2.7.1",
|
|
57
|
-
pyodide: "314.0.7",
|
|
58
50
|
"rollup-plugin-visualizer": "^6.0.1",
|
|
59
51
|
"socket.io": "^4.7.5",
|
|
60
52
|
"ts-node": "^10.9.2",
|
|
@@ -62,58 +54,57 @@ const e = "@glodon-aiot/bot-client-sdk", s = "3.26.0-alpha.5", t = "glodoncv", i
|
|
|
62
54
|
vite: "^4.1.1",
|
|
63
55
|
"vite-plugin-dts": "^4.3.0",
|
|
64
56
|
"vite-plugin-externalize-deps": "^0.9.0",
|
|
65
|
-
"vite-tsconfig-paths": "^5.1.4"
|
|
66
|
-
vitest: "^0.34.6"
|
|
57
|
+
"vite-tsconfig-paths": "^5.1.4"
|
|
67
58
|
}, m = {
|
|
68
59
|
access: "public",
|
|
69
60
|
registry: "https://registry.npmjs.org/"
|
|
70
|
-
},
|
|
71
|
-
"@glodon-aiot/apis": "^3.26.0-alpha.
|
|
61
|
+
}, b = {
|
|
62
|
+
"@glodon-aiot/apis": "^3.26.0-alpha.8",
|
|
72
63
|
axios: "0.24.0",
|
|
73
64
|
buffer: "^6.0.3",
|
|
74
65
|
dayjs: "^1.11.13",
|
|
75
66
|
"js-base64": "^3.7.7",
|
|
76
67
|
"socket.io-client": "^4.7.5",
|
|
77
68
|
uuid: "^11.1.0"
|
|
78
|
-
},
|
|
69
|
+
}, x = {
|
|
79
70
|
name: e,
|
|
80
|
-
version:
|
|
81
|
-
author:
|
|
82
|
-
description:
|
|
71
|
+
version: t,
|
|
72
|
+
author: i,
|
|
73
|
+
description: s,
|
|
83
74
|
type: n,
|
|
84
75
|
sideEffects: !1,
|
|
85
76
|
keywords: o,
|
|
86
|
-
files:
|
|
77
|
+
files: l,
|
|
87
78
|
module: p,
|
|
88
|
-
main:
|
|
89
|
-
typings:
|
|
90
|
-
exports:
|
|
79
|
+
main: c,
|
|
80
|
+
typings: r,
|
|
81
|
+
exports: d,
|
|
91
82
|
license: a,
|
|
92
83
|
scripts: u,
|
|
93
|
-
devDependencies:
|
|
84
|
+
devDependencies: g,
|
|
94
85
|
"lint-staged": {
|
|
95
86
|
"*.{js,css,md,jsx,less,ts,tsx,json}": "prettier --write"
|
|
96
87
|
},
|
|
97
88
|
publishConfig: m,
|
|
98
|
-
dependencies:
|
|
89
|
+
dependencies: b
|
|
99
90
|
};
|
|
100
91
|
export {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
92
|
+
i as author,
|
|
93
|
+
x as default,
|
|
94
|
+
b as dependencies,
|
|
95
|
+
s as description,
|
|
96
|
+
g as devDependencies,
|
|
97
|
+
d as exports,
|
|
98
|
+
l as files,
|
|
108
99
|
o as keywords,
|
|
109
100
|
a as license,
|
|
110
|
-
|
|
101
|
+
c as main,
|
|
111
102
|
p as module,
|
|
112
103
|
e as name,
|
|
113
104
|
m as publishConfig,
|
|
114
105
|
u as scripts,
|
|
115
|
-
|
|
106
|
+
y as sideEffects,
|
|
116
107
|
n as type,
|
|
117
|
-
|
|
118
|
-
|
|
108
|
+
r as typings,
|
|
109
|
+
t as version
|
|
119
110
|
};
|