opencode-feishu-plugin 0.1.3 → 0.1.4
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.en.md +3 -2
- package/README.md +3 -2
- package/dist/index.js +192 -122
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -388,7 +388,7 @@ Without this relay, any clarifying question would stall the Feishu session forev
|
|
|
388
388
|
| `recentModelsLimit` | number | `5` | Number of recent models (1–20) |
|
|
389
389
|
| `logLevel` | `debug`\|`info`\|`warn`\|`error` | `info` | Log level (secrets are never logged, only their presence) |
|
|
390
390
|
| `logFile` | string \| boolean | — | `true` writes `<configDir>/plugins/feishu.log`. **Plugin stderr is discarded in service mode — enable this when debugging** |
|
|
391
|
-
| `gatewayLocation` | string | — | Only start the gateway in this location
|
|
391
|
+
| `gatewayLocation` | string | — | Only start the gateway in this location **or any of its subdirectories**. `~` is expanded and relative paths / trailing slashes are normalized. **Set this to your usual working directory** to avoid multiple long connections; leave empty to run in every location |
|
|
392
392
|
| `approvalTtlMs` | number | `600000` | Approval token / card TTL |
|
|
393
393
|
| `staleExecutionMs` | number | `300000` | Watchdog threshold: an execution with no event for this long is treated as stuck and auto-interrupted; a queue stuck this long without `execution.started` also triggers a notice. Clamped to 1–60 minutes |
|
|
394
394
|
| `maxResourcesShown` | number | `8` | Max resource lines shown on an approval card |
|
|
@@ -440,7 +440,8 @@ otherwise (per session preset) → ask ─────────────
|
|
|
440
440
|
| `feishu.json` changes ignored | Confirm the path is `<configDir>/plugins/feishu.json`, then `opencode reload` |
|
|
441
441
|
| Plugin never loads (no logs, no error) | npm path: make sure the package name is in the config `plugins` array (`opencode plugin list` shows it). Directory path: make sure `plugins/<name>/index.js` exists (OpenCode ignores `package.json#main`) |
|
|
442
442
|
| Plugin code changes ignored | `opencode reload` only re-runs `setup`; it does **not** re-import the module from the same path. Upgrade with `opencode plugin update opencode-feishu-plugin`, or restart the service |
|
|
443
|
-
| Multiple long connections / duplicate replies | Set `gatewayLocation` to your usual working directory |
|
|
443
|
+
| Multiple long connections / duplicate replies | Set `gatewayLocation` to your usual working directory (subdirectories also match) |
|
|
444
|
+
| **No response at all**, and no "long connection started" / "plugin ready" in the log | Almost always `gatewayLocation` does not match the directory where you actually opened opencode. The plugin emits a `warn` about "no loaded location matched" after ~2s; you can also set `logLevel: "debug"` to see `skipping non-gateway location`. If still stuck, leave `gatewayLocation` empty to rule it out |
|
|
444
445
|
| No approval cards | The session did not originate from Feishu (no mapping); by design the plugin does not take it over |
|
|
445
446
|
| "Invalid credentials" on button tap | Token expired (default 10 min) or the tapper is not allow-listed |
|
|
446
447
|
| Card content truncated | Feishu card limit is ~30KB; the plugin truncates and marks it. Very long sessions drop the oldest blocks from the card (full content stays in the session) |
|
package/README.md
CHANGED
|
@@ -243,7 +243,7 @@ agent 调 `question` 等 form 类交互时,插件把它转成飞书卡片:
|
|
|
243
243
|
| `recentDirsLimit` / `recentModelsLimit` | number | `5` | 表单「最近使用」条数(1–20) |
|
|
244
244
|
| `logLevel` | `debug`\|`info`\|`warn`\|`error` | `info` | 日志级别 |
|
|
245
245
|
| `logFile` | string \| boolean | — | `true` = 写 `<configDir>/plugins/feishu.log`;服务模式建议开启 |
|
|
246
|
-
| `gatewayLocation` | string | — | 只在该 location
|
|
246
|
+
| `gatewayLocation` | string | — | 只在该 location(或其**子目录**)启动网关;`~` 自动展开、相对路径/尾斜杠会归一化。留空 = 任意 location 生效 |
|
|
247
247
|
| `approvalTtlMs` | number | `600000` | 审批 token / 卡片有效期 |
|
|
248
248
|
| `staleExecutionMs` | number | `300000` | 看门狗阈值(夹取 1–60 分钟) |
|
|
249
249
|
| `maxResourcesShown` | number | `8` | 审批卡最多展示的资源行数 |
|
|
@@ -284,7 +284,8 @@ permission.evaluate (插件 hook) permission.asked (事件流)
|
|
|
284
284
|
| 改了 `feishu.json` 不生效 | 确认路径,然后 `opencode reload` |
|
|
285
285
|
| 插件完全没被加载 | npm 方式确认包名在 `plugins` 数组;目录方式确认 `plugins/<名>/index.js` 存在 |
|
|
286
286
|
| 改了插件代码不生效 | `opencode reload` 不会重新 import 同路径模块;用 `opencode plugin update` 或重启服务 |
|
|
287
|
-
| 出现多个长连接 / 重复回复 | 设置 `gatewayLocation`
|
|
287
|
+
| 出现多个长连接 / 重复回复 | 设置 `gatewayLocation` 为常用工作目录(其子目录也会命中) |
|
|
288
|
+
| **完全无响应**,且日志中没有任何「长连接已启动」/「飞书插件已就绪」 | 多半是 `gatewayLocation` 与实际打开 opencode 的目录不匹配。插件会在延迟约 2 秒后用 `warn` 打出「已加载的 location 均未命中」;也可临时设 `logLevel: "debug"` 查看 `跳过非网关 location`。确认无误仍无响应就先**留空** `gatewayLocation` 排除该项 |
|
|
288
289
|
| 审批卡收不到 | 该会话不是从飞书发起的(无映射),插件按设计不接管 |
|
|
289
290
|
| 点按钮提示凭证无效 | token 过期(默认 10 分钟)或点击者不在白名单 |
|
|
290
291
|
| 卡片内容被截断 | 飞书卡片上限约 30KB,超长会话丢弃卡片上最旧块(完整内容仍在会话里) |
|
package/dist/index.js
CHANGED
|
@@ -4,11 +4,11 @@ import http from 'http';
|
|
|
4
4
|
import https from 'https';
|
|
5
5
|
import http2 from 'http2';
|
|
6
6
|
import util from 'util';
|
|
7
|
-
import path, { dirname, isAbsolute, resolve as resolve$1, join,
|
|
7
|
+
import path, { dirname, isAbsolute, sep, resolve as resolve$1, join, basename } from 'path';
|
|
8
8
|
import zlib from 'zlib';
|
|
9
9
|
import stream3, { Readable } from 'stream';
|
|
10
10
|
import { EventEmitter } from 'events';
|
|
11
|
-
import fs, { mkdirSync, createWriteStream, readFileSync,
|
|
11
|
+
import fs, { mkdirSync, createWriteStream, readFileSync, realpathSync, statSync } from 'fs';
|
|
12
12
|
import qs from 'querystring';
|
|
13
13
|
import { homedir } from 'os';
|
|
14
14
|
import { readFile, readdir } from 'fs/promises';
|
|
@@ -10936,12 +10936,12 @@ var require_promisify = __commonJS({
|
|
|
10936
10936
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10937
10937
|
function promisify(fn3) {
|
|
10938
10938
|
return function(req, opts) {
|
|
10939
|
-
return new Promise((
|
|
10939
|
+
return new Promise((resolve4, reject) => {
|
|
10940
10940
|
fn3.call(this, req, opts, (err2, rtn) => {
|
|
10941
10941
|
if (err2) {
|
|
10942
10942
|
reject(err2);
|
|
10943
10943
|
} else {
|
|
10944
|
-
|
|
10944
|
+
resolve4(rtn);
|
|
10945
10945
|
}
|
|
10946
10946
|
});
|
|
10947
10947
|
});
|
|
@@ -11143,7 +11143,7 @@ var require_parse_proxy_response = __commonJS({
|
|
|
11143
11143
|
var debug_1 = __importDefault(require_src());
|
|
11144
11144
|
var debug = debug_1.default("https-proxy-agent:parse-proxy-response");
|
|
11145
11145
|
function parseProxyResponse(socket) {
|
|
11146
|
-
return new Promise((
|
|
11146
|
+
return new Promise((resolve4, reject) => {
|
|
11147
11147
|
let buffersLength = 0;
|
|
11148
11148
|
const buffers = [];
|
|
11149
11149
|
function read() {
|
|
@@ -11183,7 +11183,7 @@ var require_parse_proxy_response = __commonJS({
|
|
|
11183
11183
|
const firstLine = buffered.toString("ascii", 0, buffered.indexOf("\r\n"));
|
|
11184
11184
|
const statusCode = +firstLine.split(" ")[1];
|
|
11185
11185
|
debug("got proxy server response: %o", firstLine);
|
|
11186
|
-
|
|
11186
|
+
resolve4({
|
|
11187
11187
|
statusCode,
|
|
11188
11188
|
buffered
|
|
11189
11189
|
});
|
|
@@ -11203,11 +11203,11 @@ var require_agent = __commonJS({
|
|
|
11203
11203
|
"node_modules/https-proxy-agent/dist/agent.js"(exports) {
|
|
11204
11204
|
var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
11205
11205
|
function adopt(value3) {
|
|
11206
|
-
return value3 instanceof P ? value3 : new P(function(
|
|
11207
|
-
|
|
11206
|
+
return value3 instanceof P ? value3 : new P(function(resolve4) {
|
|
11207
|
+
resolve4(value3);
|
|
11208
11208
|
});
|
|
11209
11209
|
}
|
|
11210
|
-
return new (P || (P = Promise))(function(
|
|
11210
|
+
return new (P || (P = Promise))(function(resolve4, reject) {
|
|
11211
11211
|
function fulfilled(value3) {
|
|
11212
11212
|
try {
|
|
11213
11213
|
step(generator.next(value3));
|
|
@@ -11223,7 +11223,7 @@ var require_agent = __commonJS({
|
|
|
11223
11223
|
}
|
|
11224
11224
|
}
|
|
11225
11225
|
function step(result3) {
|
|
11226
|
-
result3.done ?
|
|
11226
|
+
result3.done ? resolve4(result3.value) : adopt(result3.value).then(fulfilled, rejected);
|
|
11227
11227
|
}
|
|
11228
11228
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11229
11229
|
});
|
|
@@ -18969,7 +18969,7 @@ var require_aspromise = __commonJS({
|
|
|
18969
18969
|
var params = new Array(arguments.length - 1), offset = 0, index2 = 2, pending = true;
|
|
18970
18970
|
while (index2 < arguments.length)
|
|
18971
18971
|
params[offset++] = arguments[index2++];
|
|
18972
|
-
return new Promise(function executor(
|
|
18972
|
+
return new Promise(function executor(resolve4, reject) {
|
|
18973
18973
|
params[offset] = function callback3(err2) {
|
|
18974
18974
|
if (pending) {
|
|
18975
18975
|
pending = false;
|
|
@@ -18979,7 +18979,7 @@ var require_aspromise = __commonJS({
|
|
|
18979
18979
|
var params2 = new Array(arguments.length - 1), offset2 = 0;
|
|
18980
18980
|
while (offset2 < params2.length)
|
|
18981
18981
|
params2[offset2++] = arguments[offset2];
|
|
18982
|
-
|
|
18982
|
+
resolve4.apply(null, params2);
|
|
18983
18983
|
}
|
|
18984
18984
|
}
|
|
18985
18985
|
};
|
|
@@ -23158,10 +23158,10 @@ var CanceledError = class extends AxiosError_default {
|
|
|
23158
23158
|
var CanceledError_default = CanceledError;
|
|
23159
23159
|
|
|
23160
23160
|
// node_modules/axios/lib/core/settle.js
|
|
23161
|
-
function settle(
|
|
23161
|
+
function settle(resolve4, reject, response2) {
|
|
23162
23162
|
const validateStatus2 = response2.config.validateStatus;
|
|
23163
23163
|
if (!response2.status || !validateStatus2 || validateStatus2(response2.status)) {
|
|
23164
|
-
|
|
23164
|
+
resolve4(response2);
|
|
23165
23165
|
} else {
|
|
23166
23166
|
reject(new AxiosError_default(
|
|
23167
23167
|
"Request failed with status code " + response2.status,
|
|
@@ -24494,7 +24494,7 @@ function setProxy(options2, configProxy, location, isRedirect, configHttpsAgent,
|
|
|
24494
24494
|
}
|
|
24495
24495
|
var isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process";
|
|
24496
24496
|
var wrapAsync = (asyncExecutor) => {
|
|
24497
|
-
return new Promise((
|
|
24497
|
+
return new Promise((resolve4, reject) => {
|
|
24498
24498
|
let onDone;
|
|
24499
24499
|
let isDone3;
|
|
24500
24500
|
const done4 = (value3, isRejected) => {
|
|
@@ -24504,7 +24504,7 @@ var wrapAsync = (asyncExecutor) => {
|
|
|
24504
24504
|
};
|
|
24505
24505
|
const _resolve = (value3) => {
|
|
24506
24506
|
done4(value3);
|
|
24507
|
-
|
|
24507
|
+
resolve4(value3);
|
|
24508
24508
|
};
|
|
24509
24509
|
const _reject = (reason) => {
|
|
24510
24510
|
done4(reason, true);
|
|
@@ -24575,7 +24575,7 @@ var http2Transport = {
|
|
|
24575
24575
|
}
|
|
24576
24576
|
};
|
|
24577
24577
|
var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
24578
|
-
return wrapAsync(async function dispatchHttpRequest(
|
|
24578
|
+
return wrapAsync(async function dispatchHttpRequest(resolve4, reject, onDone) {
|
|
24579
24579
|
const own2 = (key) => utils_default.getSafeProp(config, key);
|
|
24580
24580
|
const transitional2 = own2("transitional") || transitional_default;
|
|
24581
24581
|
let data = own2("data");
|
|
@@ -24712,7 +24712,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
24712
24712
|
}
|
|
24713
24713
|
let convertedData;
|
|
24714
24714
|
if (method !== "GET") {
|
|
24715
|
-
return settle(
|
|
24715
|
+
return settle(resolve4, reject, {
|
|
24716
24716
|
status: 405,
|
|
24717
24717
|
statusText: "method not allowed",
|
|
24718
24718
|
headers: {},
|
|
@@ -24734,7 +24734,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
24734
24734
|
} else if (responseType === "stream") {
|
|
24735
24735
|
convertedData = stream3.Readable.from(convertedData);
|
|
24736
24736
|
}
|
|
24737
|
-
return settle(
|
|
24737
|
+
return settle(resolve4, reject, {
|
|
24738
24738
|
data: convertedData,
|
|
24739
24739
|
status: 200,
|
|
24740
24740
|
statusText: "OK",
|
|
@@ -25105,7 +25105,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
25105
25105
|
});
|
|
25106
25106
|
}
|
|
25107
25107
|
response2.data = responseStream;
|
|
25108
|
-
settle(
|
|
25108
|
+
settle(resolve4, reject, response2);
|
|
25109
25109
|
} else {
|
|
25110
25110
|
const responseBuffer = [];
|
|
25111
25111
|
let totalResponseBytes = 0;
|
|
@@ -25156,7 +25156,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
25156
25156
|
} catch (err2) {
|
|
25157
25157
|
return reject(AxiosError_default.from(err2, null, config, response2.request, response2));
|
|
25158
25158
|
}
|
|
25159
|
-
settle(
|
|
25159
|
+
settle(resolve4, reject, response2);
|
|
25160
25160
|
});
|
|
25161
25161
|
}
|
|
25162
25162
|
abortEmitter.once("abort", (err2) => {
|
|
@@ -25530,7 +25530,7 @@ var resolveConfig_default = resolveConfig;
|
|
|
25530
25530
|
// node_modules/axios/lib/adapters/xhr.js
|
|
25531
25531
|
var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
25532
25532
|
var xhr_default = isXHRAdapterSupported && function(config) {
|
|
25533
|
-
return new Promise(function dispatchXhrRequest(
|
|
25533
|
+
return new Promise(function dispatchXhrRequest(resolve4, reject) {
|
|
25534
25534
|
const _config = resolveConfig_default(config);
|
|
25535
25535
|
let requestData = _config.data;
|
|
25536
25536
|
const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
|
|
@@ -25585,7 +25585,7 @@ var xhr_default = isXHRAdapterSupported && function(config) {
|
|
|
25585
25585
|
};
|
|
25586
25586
|
settle(
|
|
25587
25587
|
function _resolve(value3) {
|
|
25588
|
-
|
|
25588
|
+
resolve4(value3);
|
|
25589
25589
|
done4();
|
|
25590
25590
|
},
|
|
25591
25591
|
function _reject(err2) {
|
|
@@ -26210,8 +26210,8 @@ var factory = (env) => {
|
|
|
26210
26210
|
}
|
|
26211
26211
|
}
|
|
26212
26212
|
!isStreamResponse && unsubscribe && unsubscribe();
|
|
26213
|
-
return await new Promise((
|
|
26214
|
-
settle(
|
|
26213
|
+
return await new Promise((resolve4, reject) => {
|
|
26214
|
+
settle(resolve4, reject, {
|
|
26215
26215
|
data: responseData,
|
|
26216
26216
|
headers: AxiosHeaders_default.from(response2.headers),
|
|
26217
26217
|
status: response2.status,
|
|
@@ -26690,8 +26690,8 @@ var CancelToken = class _CancelToken {
|
|
|
26690
26690
|
throw new TypeError("executor must be a function.");
|
|
26691
26691
|
}
|
|
26692
26692
|
let resolvePromise;
|
|
26693
|
-
this.promise = new Promise(function promiseExecutor(
|
|
26694
|
-
resolvePromise =
|
|
26693
|
+
this.promise = new Promise(function promiseExecutor(resolve4) {
|
|
26694
|
+
resolvePromise = resolve4;
|
|
26695
26695
|
});
|
|
26696
26696
|
const token = this;
|
|
26697
26697
|
this.promise.then((cancel) => {
|
|
@@ -26704,9 +26704,9 @@ var CancelToken = class _CancelToken {
|
|
|
26704
26704
|
});
|
|
26705
26705
|
this.promise.then = (onfulfilled) => {
|
|
26706
26706
|
let _resolve;
|
|
26707
|
-
const promise3 = new Promise((
|
|
26708
|
-
token.subscribe(
|
|
26709
|
-
_resolve =
|
|
26707
|
+
const promise3 = new Promise((resolve4) => {
|
|
26708
|
+
token.subscribe(resolve4);
|
|
26709
|
+
_resolve = resolve4;
|
|
26710
26710
|
}).then(onfulfilled);
|
|
26711
26711
|
promise3.cancel = function reject() {
|
|
26712
26712
|
token.unsubscribe(_resolve);
|
|
@@ -26966,11 +26966,11 @@ function __rest(s, e) {
|
|
|
26966
26966
|
}
|
|
26967
26967
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
26968
26968
|
function adopt(value3) {
|
|
26969
|
-
return value3 instanceof P ? value3 : new P(function(
|
|
26970
|
-
|
|
26969
|
+
return value3 instanceof P ? value3 : new P(function(resolve4) {
|
|
26970
|
+
resolve4(value3);
|
|
26971
26971
|
});
|
|
26972
26972
|
}
|
|
26973
|
-
return new (P || (P = Promise))(function(
|
|
26973
|
+
return new (P || (P = Promise))(function(resolve4, reject) {
|
|
26974
26974
|
function fulfilled(value3) {
|
|
26975
26975
|
try {
|
|
26976
26976
|
step(generator.next(value3));
|
|
@@ -26986,7 +26986,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
26986
26986
|
}
|
|
26987
26987
|
}
|
|
26988
26988
|
function step(result3) {
|
|
26989
|
-
result3.done ?
|
|
26989
|
+
result3.done ? resolve4(result3.value) : adopt(result3.value).then(fulfilled, rejected);
|
|
26990
26990
|
}
|
|
26991
26991
|
step((generator = generator.apply(thisArg, [])).next());
|
|
26992
26992
|
});
|
|
@@ -27011,11 +27011,11 @@ function __asyncGenerator(thisArg, _arguments, generator) {
|
|
|
27011
27011
|
try {
|
|
27012
27012
|
step(g[n](v));
|
|
27013
27013
|
} catch (e) {
|
|
27014
|
-
|
|
27014
|
+
settle3(q[0][3], e);
|
|
27015
27015
|
}
|
|
27016
27016
|
}
|
|
27017
27017
|
function step(r) {
|
|
27018
|
-
r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) :
|
|
27018
|
+
r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle3(q[0][2], r);
|
|
27019
27019
|
}
|
|
27020
27020
|
function fulfill(value3) {
|
|
27021
27021
|
resume("next", value3);
|
|
@@ -27023,7 +27023,7 @@ function __asyncGenerator(thisArg, _arguments, generator) {
|
|
|
27023
27023
|
function reject(value3) {
|
|
27024
27024
|
resume("throw", value3);
|
|
27025
27025
|
}
|
|
27026
|
-
function
|
|
27026
|
+
function settle3(f, v) {
|
|
27027
27027
|
if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
|
|
27028
27028
|
}
|
|
27029
27029
|
}
|
|
@@ -27376,10 +27376,10 @@ var Client$1P = class {
|
|
|
27376
27376
|
return {
|
|
27377
27377
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
27378
27378
|
checkIsReadable();
|
|
27379
|
-
return new Promise((
|
|
27379
|
+
return new Promise((resolve4, reject) => {
|
|
27380
27380
|
const writableStream = fs.createWriteStream(filePath);
|
|
27381
27381
|
writableStream.on("finish", () => {
|
|
27382
|
-
|
|
27382
|
+
resolve4(filePath);
|
|
27383
27383
|
});
|
|
27384
27384
|
writableStream.on("error", (e) => {
|
|
27385
27385
|
reject(e);
|
|
@@ -27559,10 +27559,10 @@ var Client$1P = class {
|
|
|
27559
27559
|
return {
|
|
27560
27560
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
27561
27561
|
checkIsReadable();
|
|
27562
|
-
return new Promise((
|
|
27562
|
+
return new Promise((resolve4, reject) => {
|
|
27563
27563
|
const writableStream = fs.createWriteStream(filePath);
|
|
27564
27564
|
writableStream.on("finish", () => {
|
|
27565
|
-
|
|
27565
|
+
resolve4(filePath);
|
|
27566
27566
|
});
|
|
27567
27567
|
writableStream.on("error", (e) => {
|
|
27568
27568
|
reject(e);
|
|
@@ -27895,10 +27895,10 @@ var Client$1P = class {
|
|
|
27895
27895
|
return {
|
|
27896
27896
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
27897
27897
|
checkIsReadable();
|
|
27898
|
-
return new Promise((
|
|
27898
|
+
return new Promise((resolve4, reject) => {
|
|
27899
27899
|
const writableStream = fs.createWriteStream(filePath);
|
|
27900
27900
|
writableStream.on("finish", () => {
|
|
27901
|
-
|
|
27901
|
+
resolve4(filePath);
|
|
27902
27902
|
});
|
|
27903
27903
|
writableStream.on("error", (e) => {
|
|
27904
27904
|
reject(e);
|
|
@@ -28080,10 +28080,10 @@ var Client$1P = class {
|
|
|
28080
28080
|
return {
|
|
28081
28081
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
28082
28082
|
checkIsReadable();
|
|
28083
|
-
return new Promise((
|
|
28083
|
+
return new Promise((resolve4, reject) => {
|
|
28084
28084
|
const writableStream = fs.createWriteStream(filePath);
|
|
28085
28085
|
writableStream.on("finish", () => {
|
|
28086
|
-
|
|
28086
|
+
resolve4(filePath);
|
|
28087
28087
|
});
|
|
28088
28088
|
writableStream.on("error", (e) => {
|
|
28089
28089
|
reject(e);
|
|
@@ -36923,10 +36923,10 @@ var Client$1H = class extends Client$1I {
|
|
|
36923
36923
|
return {
|
|
36924
36924
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
36925
36925
|
checkIsReadable();
|
|
36926
|
-
return new Promise((
|
|
36926
|
+
return new Promise((resolve4, reject) => {
|
|
36927
36927
|
const writableStream = fs.createWriteStream(filePath);
|
|
36928
36928
|
writableStream.on("finish", () => {
|
|
36929
|
-
|
|
36929
|
+
resolve4(filePath);
|
|
36930
36930
|
});
|
|
36931
36931
|
writableStream.on("error", (e) => {
|
|
36932
36932
|
reject(e);
|
|
@@ -38105,10 +38105,10 @@ var Client$1H = class extends Client$1I {
|
|
|
38105
38105
|
return {
|
|
38106
38106
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
38107
38107
|
checkIsReadable();
|
|
38108
|
-
return new Promise((
|
|
38108
|
+
return new Promise((resolve4, reject) => {
|
|
38109
38109
|
const writableStream = fs.createWriteStream(filePath);
|
|
38110
38110
|
writableStream.on("finish", () => {
|
|
38111
|
-
|
|
38111
|
+
resolve4(filePath);
|
|
38112
38112
|
});
|
|
38113
38113
|
writableStream.on("error", (e) => {
|
|
38114
38114
|
reject(e);
|
|
@@ -40311,10 +40311,10 @@ var Client$1B = class extends Client$1C {
|
|
|
40311
40311
|
return {
|
|
40312
40312
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
40313
40313
|
checkIsReadable();
|
|
40314
|
-
return new Promise((
|
|
40314
|
+
return new Promise((resolve4, reject) => {
|
|
40315
40315
|
const writableStream = fs.createWriteStream(filePath);
|
|
40316
40316
|
writableStream.on("finish", () => {
|
|
40317
|
-
|
|
40317
|
+
resolve4(filePath);
|
|
40318
40318
|
});
|
|
40319
40319
|
writableStream.on("error", (e) => {
|
|
40320
40320
|
reject(e);
|
|
@@ -40837,10 +40837,10 @@ var Client$1B = class extends Client$1C {
|
|
|
40837
40837
|
return {
|
|
40838
40838
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
40839
40839
|
checkIsReadable();
|
|
40840
|
-
return new Promise((
|
|
40840
|
+
return new Promise((resolve4, reject) => {
|
|
40841
40841
|
const writableStream = fs.createWriteStream(filePath);
|
|
40842
40842
|
writableStream.on("finish", () => {
|
|
40843
|
-
|
|
40843
|
+
resolve4(filePath);
|
|
40844
40844
|
});
|
|
40845
40845
|
writableStream.on("error", (e) => {
|
|
40846
40846
|
reject(e);
|
|
@@ -44858,10 +44858,10 @@ var Client$1x = class extends Client$1y {
|
|
|
44858
44858
|
return {
|
|
44859
44859
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
44860
44860
|
checkIsReadable();
|
|
44861
|
-
return new Promise((
|
|
44861
|
+
return new Promise((resolve4, reject) => {
|
|
44862
44862
|
const writableStream = fs.createWriteStream(filePath);
|
|
44863
44863
|
writableStream.on("finish", () => {
|
|
44864
|
-
|
|
44864
|
+
resolve4(filePath);
|
|
44865
44865
|
});
|
|
44866
44866
|
writableStream.on("error", (e) => {
|
|
44867
44867
|
reject(e);
|
|
@@ -55831,10 +55831,10 @@ var Client$1l = class extends Client$1m {
|
|
|
55831
55831
|
return {
|
|
55832
55832
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
55833
55833
|
checkIsReadable();
|
|
55834
|
-
return new Promise((
|
|
55834
|
+
return new Promise((resolve4, reject) => {
|
|
55835
55835
|
const writableStream = fs.createWriteStream(filePath);
|
|
55836
55836
|
writableStream.on("finish", () => {
|
|
55837
|
-
|
|
55837
|
+
resolve4(filePath);
|
|
55838
55838
|
});
|
|
55839
55839
|
writableStream.on("error", (e) => {
|
|
55840
55840
|
reject(e);
|
|
@@ -58588,10 +58588,10 @@ var Client$1l = class extends Client$1m {
|
|
|
58588
58588
|
return {
|
|
58589
58589
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
58590
58590
|
checkIsReadable();
|
|
58591
|
-
return new Promise((
|
|
58591
|
+
return new Promise((resolve4, reject) => {
|
|
58592
58592
|
const writableStream = fs.createWriteStream(filePath);
|
|
58593
58593
|
writableStream.on("finish", () => {
|
|
58594
|
-
|
|
58594
|
+
resolve4(filePath);
|
|
58595
58595
|
});
|
|
58596
58596
|
writableStream.on("error", (e) => {
|
|
58597
58597
|
reject(e);
|
|
@@ -62027,10 +62027,10 @@ var Client$1l = class extends Client$1m {
|
|
|
62027
62027
|
return {
|
|
62028
62028
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
62029
62029
|
checkIsReadable();
|
|
62030
|
-
return new Promise((
|
|
62030
|
+
return new Promise((resolve4, reject) => {
|
|
62031
62031
|
const writableStream = fs.createWriteStream(filePath);
|
|
62032
62032
|
writableStream.on("finish", () => {
|
|
62033
|
-
|
|
62033
|
+
resolve4(filePath);
|
|
62034
62034
|
});
|
|
62035
62035
|
writableStream.on("error", (e) => {
|
|
62036
62036
|
reject(e);
|
|
@@ -68652,10 +68652,10 @@ var Client$1c = class extends Client$1d {
|
|
|
68652
68652
|
return {
|
|
68653
68653
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
68654
68654
|
checkIsReadable();
|
|
68655
|
-
return new Promise((
|
|
68655
|
+
return new Promise((resolve4, reject) => {
|
|
68656
68656
|
const writableStream = fs.createWriteStream(filePath);
|
|
68657
68657
|
writableStream.on("finish", () => {
|
|
68658
|
-
|
|
68658
|
+
resolve4(filePath);
|
|
68659
68659
|
});
|
|
68660
68660
|
writableStream.on("error", (e) => {
|
|
68661
68661
|
reject(e);
|
|
@@ -68904,10 +68904,10 @@ var Client$1c = class extends Client$1d {
|
|
|
68904
68904
|
return {
|
|
68905
68905
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
68906
68906
|
checkIsReadable();
|
|
68907
|
-
return new Promise((
|
|
68907
|
+
return new Promise((resolve4, reject) => {
|
|
68908
68908
|
const writableStream = fs.createWriteStream(filePath);
|
|
68909
68909
|
writableStream.on("finish", () => {
|
|
68910
|
-
|
|
68910
|
+
resolve4(filePath);
|
|
68911
68911
|
});
|
|
68912
68912
|
writableStream.on("error", (e) => {
|
|
68913
68913
|
reject(e);
|
|
@@ -69525,10 +69525,10 @@ var Client$1c = class extends Client$1d {
|
|
|
69525
69525
|
return {
|
|
69526
69526
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
69527
69527
|
checkIsReadable();
|
|
69528
|
-
return new Promise((
|
|
69528
|
+
return new Promise((resolve4, reject) => {
|
|
69529
69529
|
const writableStream = fs.createWriteStream(filePath);
|
|
69530
69530
|
writableStream.on("finish", () => {
|
|
69531
|
-
|
|
69531
|
+
resolve4(filePath);
|
|
69532
69532
|
});
|
|
69533
69533
|
writableStream.on("error", (e) => {
|
|
69534
69534
|
reject(e);
|
|
@@ -70471,10 +70471,10 @@ var Client$1c = class extends Client$1d {
|
|
|
70471
70471
|
return {
|
|
70472
70472
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
70473
70473
|
checkIsReadable();
|
|
70474
|
-
return new Promise((
|
|
70474
|
+
return new Promise((resolve4, reject) => {
|
|
70475
70475
|
const writableStream = fs.createWriteStream(filePath);
|
|
70476
70476
|
writableStream.on("finish", () => {
|
|
70477
|
-
|
|
70477
|
+
resolve4(filePath);
|
|
70478
70478
|
});
|
|
70479
70479
|
writableStream.on("error", (e) => {
|
|
70480
70480
|
reject(e);
|
|
@@ -70723,10 +70723,10 @@ var Client$1c = class extends Client$1d {
|
|
|
70723
70723
|
return {
|
|
70724
70724
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
70725
70725
|
checkIsReadable();
|
|
70726
|
-
return new Promise((
|
|
70726
|
+
return new Promise((resolve4, reject) => {
|
|
70727
70727
|
const writableStream = fs.createWriteStream(filePath);
|
|
70728
70728
|
writableStream.on("finish", () => {
|
|
70729
|
-
|
|
70729
|
+
resolve4(filePath);
|
|
70730
70730
|
});
|
|
70731
70731
|
writableStream.on("error", (e) => {
|
|
70732
70732
|
reject(e);
|
|
@@ -71350,10 +71350,10 @@ var Client$1c = class extends Client$1d {
|
|
|
71350
71350
|
return {
|
|
71351
71351
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
71352
71352
|
checkIsReadable();
|
|
71353
|
-
return new Promise((
|
|
71353
|
+
return new Promise((resolve4, reject) => {
|
|
71354
71354
|
const writableStream = fs.createWriteStream(filePath);
|
|
71355
71355
|
writableStream.on("finish", () => {
|
|
71356
|
-
|
|
71356
|
+
resolve4(filePath);
|
|
71357
71357
|
});
|
|
71358
71358
|
writableStream.on("error", (e) => {
|
|
71359
71359
|
reject(e);
|
|
@@ -72189,10 +72189,10 @@ var Client$19 = class extends Client$1a {
|
|
|
72189
72189
|
return {
|
|
72190
72190
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
72191
72191
|
checkIsReadable();
|
|
72192
|
-
return new Promise((
|
|
72192
|
+
return new Promise((resolve4, reject) => {
|
|
72193
72193
|
const writableStream = fs.createWriteStream(filePath);
|
|
72194
72194
|
writableStream.on("finish", () => {
|
|
72195
|
-
|
|
72195
|
+
resolve4(filePath);
|
|
72196
72196
|
});
|
|
72197
72197
|
writableStream.on("error", (e) => {
|
|
72198
72198
|
reject(e);
|
|
@@ -72325,10 +72325,10 @@ var Client$19 = class extends Client$1a {
|
|
|
72325
72325
|
return {
|
|
72326
72326
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
72327
72327
|
checkIsReadable();
|
|
72328
|
-
return new Promise((
|
|
72328
|
+
return new Promise((resolve4, reject) => {
|
|
72329
72329
|
const writableStream = fs.createWriteStream(filePath);
|
|
72330
72330
|
writableStream.on("finish", () => {
|
|
72331
|
-
|
|
72331
|
+
resolve4(filePath);
|
|
72332
72332
|
});
|
|
72333
72333
|
writableStream.on("error", (e) => {
|
|
72334
72334
|
reject(e);
|
|
@@ -73160,10 +73160,10 @@ var Client$11 = class extends Client$12 {
|
|
|
73160
73160
|
return {
|
|
73161
73161
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
73162
73162
|
checkIsReadable();
|
|
73163
|
-
return new Promise((
|
|
73163
|
+
return new Promise((resolve4, reject) => {
|
|
73164
73164
|
const writableStream = fs.createWriteStream(filePath);
|
|
73165
73165
|
writableStream.on("finish", () => {
|
|
73166
|
-
|
|
73166
|
+
resolve4(filePath);
|
|
73167
73167
|
});
|
|
73168
73168
|
writableStream.on("error", (e) => {
|
|
73169
73169
|
reject(e);
|
|
@@ -73558,10 +73558,10 @@ var Client$11 = class extends Client$12 {
|
|
|
73558
73558
|
return {
|
|
73559
73559
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
73560
73560
|
checkIsReadable();
|
|
73561
|
-
return new Promise((
|
|
73561
|
+
return new Promise((resolve4, reject) => {
|
|
73562
73562
|
const writableStream = fs.createWriteStream(filePath);
|
|
73563
73563
|
writableStream.on("finish", () => {
|
|
73564
|
-
|
|
73564
|
+
resolve4(filePath);
|
|
73565
73565
|
});
|
|
73566
73566
|
writableStream.on("error", (e) => {
|
|
73567
73567
|
reject(e);
|
|
@@ -74598,10 +74598,10 @@ var Client$11 = class extends Client$12 {
|
|
|
74598
74598
|
return {
|
|
74599
74599
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
74600
74600
|
checkIsReadable();
|
|
74601
|
-
return new Promise((
|
|
74601
|
+
return new Promise((resolve4, reject) => {
|
|
74602
74602
|
const writableStream = fs.createWriteStream(filePath);
|
|
74603
74603
|
writableStream.on("finish", () => {
|
|
74604
|
-
|
|
74604
|
+
resolve4(filePath);
|
|
74605
74605
|
});
|
|
74606
74606
|
writableStream.on("error", (e) => {
|
|
74607
74607
|
reject(e);
|
|
@@ -75000,10 +75000,10 @@ var Client$11 = class extends Client$12 {
|
|
|
75000
75000
|
return {
|
|
75001
75001
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
75002
75002
|
checkIsReadable();
|
|
75003
|
-
return new Promise((
|
|
75003
|
+
return new Promise((resolve4, reject) => {
|
|
75004
75004
|
const writableStream = fs.createWriteStream(filePath);
|
|
75005
75005
|
writableStream.on("finish", () => {
|
|
75006
|
-
|
|
75006
|
+
resolve4(filePath);
|
|
75007
75007
|
});
|
|
75008
75008
|
writableStream.on("error", (e) => {
|
|
75009
75009
|
reject(e);
|
|
@@ -89699,10 +89699,10 @@ var Client$_ = class extends Client$$ {
|
|
|
89699
89699
|
return {
|
|
89700
89700
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
89701
89701
|
checkIsReadable();
|
|
89702
|
-
return new Promise((
|
|
89702
|
+
return new Promise((resolve4, reject) => {
|
|
89703
89703
|
const writableStream = fs.createWriteStream(filePath);
|
|
89704
89704
|
writableStream.on("finish", () => {
|
|
89705
|
-
|
|
89705
|
+
resolve4(filePath);
|
|
89706
89706
|
});
|
|
89707
89707
|
writableStream.on("error", (e) => {
|
|
89708
89708
|
reject(e);
|
|
@@ -89937,10 +89937,10 @@ var Client$_ = class extends Client$$ {
|
|
|
89937
89937
|
return {
|
|
89938
89938
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
89939
89939
|
checkIsReadable();
|
|
89940
|
-
return new Promise((
|
|
89940
|
+
return new Promise((resolve4, reject) => {
|
|
89941
89941
|
const writableStream = fs.createWriteStream(filePath);
|
|
89942
89942
|
writableStream.on("finish", () => {
|
|
89943
|
-
|
|
89943
|
+
resolve4(filePath);
|
|
89944
89944
|
});
|
|
89945
89945
|
writableStream.on("error", (e) => {
|
|
89946
89946
|
reject(e);
|
|
@@ -90022,10 +90022,10 @@ var Client$_ = class extends Client$$ {
|
|
|
90022
90022
|
return {
|
|
90023
90023
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
90024
90024
|
checkIsReadable();
|
|
90025
|
-
return new Promise((
|
|
90025
|
+
return new Promise((resolve4, reject) => {
|
|
90026
90026
|
const writableStream = fs.createWriteStream(filePath);
|
|
90027
90027
|
writableStream.on("finish", () => {
|
|
90028
|
-
|
|
90028
|
+
resolve4(filePath);
|
|
90029
90029
|
});
|
|
90030
90030
|
writableStream.on("error", (e) => {
|
|
90031
90031
|
reject(e);
|
|
@@ -91844,10 +91844,10 @@ var Client$_ = class extends Client$$ {
|
|
|
91844
91844
|
return {
|
|
91845
91845
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
91846
91846
|
checkIsReadable();
|
|
91847
|
-
return new Promise((
|
|
91847
|
+
return new Promise((resolve4, reject) => {
|
|
91848
91848
|
const writableStream = fs.createWriteStream(filePath);
|
|
91849
91849
|
writableStream.on("finish", () => {
|
|
91850
|
-
|
|
91850
|
+
resolve4(filePath);
|
|
91851
91851
|
});
|
|
91852
91852
|
writableStream.on("error", (e) => {
|
|
91853
91853
|
reject(e);
|
|
@@ -92084,10 +92084,10 @@ var Client$_ = class extends Client$$ {
|
|
|
92084
92084
|
return {
|
|
92085
92085
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
92086
92086
|
checkIsReadable();
|
|
92087
|
-
return new Promise((
|
|
92087
|
+
return new Promise((resolve4, reject) => {
|
|
92088
92088
|
const writableStream = fs.createWriteStream(filePath);
|
|
92089
92089
|
writableStream.on("finish", () => {
|
|
92090
|
-
|
|
92090
|
+
resolve4(filePath);
|
|
92091
92091
|
});
|
|
92092
92092
|
writableStream.on("error", (e) => {
|
|
92093
92093
|
reject(e);
|
|
@@ -92169,10 +92169,10 @@ var Client$_ = class extends Client$$ {
|
|
|
92169
92169
|
return {
|
|
92170
92170
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
92171
92171
|
checkIsReadable();
|
|
92172
|
-
return new Promise((
|
|
92172
|
+
return new Promise((resolve4, reject) => {
|
|
92173
92173
|
const writableStream = fs.createWriteStream(filePath);
|
|
92174
92174
|
writableStream.on("finish", () => {
|
|
92175
|
-
|
|
92175
|
+
resolve4(filePath);
|
|
92176
92176
|
});
|
|
92177
92177
|
writableStream.on("error", (e) => {
|
|
92178
92178
|
reject(e);
|
|
@@ -92674,10 +92674,10 @@ var Client$X = class extends Client$Y {
|
|
|
92674
92674
|
return {
|
|
92675
92675
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
92676
92676
|
checkIsReadable();
|
|
92677
|
-
return new Promise((
|
|
92677
|
+
return new Promise((resolve4, reject) => {
|
|
92678
92678
|
const writableStream = fs.createWriteStream(filePath);
|
|
92679
92679
|
writableStream.on("finish", () => {
|
|
92680
|
-
|
|
92680
|
+
resolve4(filePath);
|
|
92681
92681
|
});
|
|
92682
92682
|
writableStream.on("error", (e) => {
|
|
92683
92683
|
reject(e);
|
|
@@ -99848,10 +99848,10 @@ var Client$Q = class extends Client$R {
|
|
|
99848
99848
|
return {
|
|
99849
99849
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
99850
99850
|
checkIsReadable();
|
|
99851
|
-
return new Promise((
|
|
99851
|
+
return new Promise((resolve4, reject) => {
|
|
99852
99852
|
const writableStream = fs.createWriteStream(filePath);
|
|
99853
99853
|
writableStream.on("finish", () => {
|
|
99854
|
-
|
|
99854
|
+
resolve4(filePath);
|
|
99855
99855
|
});
|
|
99856
99856
|
writableStream.on("error", (e) => {
|
|
99857
99857
|
reject(e);
|
|
@@ -114511,10 +114511,10 @@ var Client$4 = class extends Client$5 {
|
|
|
114511
114511
|
return {
|
|
114512
114512
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
114513
114513
|
checkIsReadable();
|
|
114514
|
-
return new Promise((
|
|
114514
|
+
return new Promise((resolve4, reject) => {
|
|
114515
114515
|
const writableStream = fs.createWriteStream(filePath);
|
|
114516
114516
|
writableStream.on("finish", () => {
|
|
114517
|
-
|
|
114517
|
+
resolve4(filePath);
|
|
114518
114518
|
});
|
|
114519
114519
|
writableStream.on("error", (e) => {
|
|
114520
114520
|
reject(e);
|
|
@@ -117842,10 +117842,10 @@ var Client$4 = class extends Client$5 {
|
|
|
117842
117842
|
return {
|
|
117843
117843
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
117844
117844
|
checkIsReadable();
|
|
117845
|
-
return new Promise((
|
|
117845
|
+
return new Promise((resolve4, reject) => {
|
|
117846
117846
|
const writableStream = fs.createWriteStream(filePath);
|
|
117847
117847
|
writableStream.on("finish", () => {
|
|
117848
|
-
|
|
117848
|
+
resolve4(filePath);
|
|
117849
117849
|
});
|
|
117850
117850
|
writableStream.on("error", (e) => {
|
|
117851
117851
|
reject(e);
|
|
@@ -121514,7 +121514,7 @@ var WSClient = class {
|
|
|
121514
121514
|
if (!wsInstance) {
|
|
121515
121515
|
return Promise.resolve(false);
|
|
121516
121516
|
}
|
|
121517
|
-
return new Promise((
|
|
121517
|
+
return new Promise((resolve4) => {
|
|
121518
121518
|
let settled = false;
|
|
121519
121519
|
let timer;
|
|
121520
121520
|
const settleOnce = (ok) => {
|
|
@@ -121523,7 +121523,7 @@ var WSClient = class {
|
|
|
121523
121523
|
settled = true;
|
|
121524
121524
|
if (timer)
|
|
121525
121525
|
clearTimeout(timer);
|
|
121526
|
-
|
|
121526
|
+
resolve4(ok);
|
|
121527
121527
|
};
|
|
121528
121528
|
if (this.handshakeTimeoutMs && this.handshakeTimeoutMs > 0) {
|
|
121529
121529
|
timer = setTimeout(() => {
|
|
@@ -126771,8 +126771,8 @@ var runPromiseExitWith = (context3) => {
|
|
|
126771
126771
|
const runFork3 = runForkWith(context3);
|
|
126772
126772
|
return (effect2, options2) => {
|
|
126773
126773
|
const fiber3 = runFork3(effect2, options2);
|
|
126774
|
-
return new Promise((
|
|
126775
|
-
fiber3.addObserver((exit3) =>
|
|
126774
|
+
return new Promise((resolve4) => {
|
|
126775
|
+
fiber3.addObserver((exit3) => resolve4(exit3));
|
|
126776
126776
|
});
|
|
126777
126777
|
};
|
|
126778
126778
|
};
|
|
@@ -137127,9 +137127,9 @@ function toStandardSchemaV1(self2, options2) {
|
|
|
137127
137127
|
if (exit3) {
|
|
137128
137128
|
return makeStandardResult(exit3);
|
|
137129
137129
|
}
|
|
137130
|
-
return new Promise((
|
|
137130
|
+
return new Promise((resolve4) => {
|
|
137131
137131
|
fiber3.addObserver((exit4) => {
|
|
137132
|
-
|
|
137132
|
+
resolve4(makeStandardResult(exit4));
|
|
137133
137133
|
});
|
|
137134
137134
|
});
|
|
137135
137135
|
};
|
|
@@ -144026,7 +144026,7 @@ function resolveConfig2(raw, env = process.env, deps = {}) {
|
|
|
144026
144026
|
const cardMaxTables = clamp4(asNumber(merged.cardMaxTables, 4), 1, 5);
|
|
144027
144027
|
const domain = merged.domain === "lark" ? "lark" : "feishu";
|
|
144028
144028
|
const logFile = resolveLogFile(merged.logFile, env, deps);
|
|
144029
|
-
const gatewayLocation = asString(merged.gatewayLocation)
|
|
144029
|
+
const gatewayLocation = normalizeGatewayLocation(asString(merged.gatewayLocation));
|
|
144030
144030
|
const signSecretRaw = expandEnv(asString(merged.signSecret), env);
|
|
144031
144031
|
const signSecret = signSecretRaw && signSecretRaw.length > 0 ? signSecretRaw : deriveSignSecret(appSecret);
|
|
144032
144032
|
let enabled = true;
|
|
@@ -144114,6 +144114,17 @@ function resolveConfigDir(env, explicit) {
|
|
|
144114
144114
|
if (fromEnv) return fromEnv;
|
|
144115
144115
|
return join(homedir(), ".config", "opencode");
|
|
144116
144116
|
}
|
|
144117
|
+
function normalizeGatewayLocation(raw) {
|
|
144118
|
+
const trimmed = raw.trim();
|
|
144119
|
+
if (!trimmed) return void 0;
|
|
144120
|
+
const expanded = trimmed === "~" ? homedir() : trimmed.startsWith("~/") ? join(homedir(), trimmed.slice(2)) : trimmed;
|
|
144121
|
+
const resolved = resolve$1(expanded);
|
|
144122
|
+
try {
|
|
144123
|
+
return realpathSync(resolved);
|
|
144124
|
+
} catch {
|
|
144125
|
+
return resolved;
|
|
144126
|
+
}
|
|
144127
|
+
}
|
|
144117
144128
|
function resolveLogFile(raw, env, deps) {
|
|
144118
144129
|
if (raw === true) return join(resolveConfigDir(env, deps.configDir), ...LOG_FILE_RELATIVE);
|
|
144119
144130
|
if (typeof raw !== "string") return void 0;
|
|
@@ -144258,6 +144269,56 @@ function releaseProcessGuard() {
|
|
|
144258
144269
|
const slot = g[GUARD_SLOT];
|
|
144259
144270
|
if (slot) slot.active = false;
|
|
144260
144271
|
}
|
|
144272
|
+
var GATEWAY_SEEN_SLOT = /* @__PURE__ */ Symbol.for("opencode-feishu-v2/gateway-seen");
|
|
144273
|
+
function trackGatewayLocationSeen(input) {
|
|
144274
|
+
const g = globalThis;
|
|
144275
|
+
let slot = g[GATEWAY_SEEN_SLOT];
|
|
144276
|
+
if (!slot || slot.expected !== input.expected) {
|
|
144277
|
+
if (slot) settle2(slot);
|
|
144278
|
+
slot = { expected: input.expected, seen: [], matched: false, warned: false, onSettled: [], timer: void 0 };
|
|
144279
|
+
g[GATEWAY_SEEN_SLOT] = slot;
|
|
144280
|
+
}
|
|
144281
|
+
const current = slot;
|
|
144282
|
+
if (!current.seen.includes(input.here)) current.seen = [...current.seen, input.here];
|
|
144283
|
+
if (input.matched) {
|
|
144284
|
+
current.matched = true;
|
|
144285
|
+
settle2(current);
|
|
144286
|
+
return;
|
|
144287
|
+
}
|
|
144288
|
+
if (current.matched || current.warned) {
|
|
144289
|
+
runOnSettled(input.onSettled);
|
|
144290
|
+
return;
|
|
144291
|
+
}
|
|
144292
|
+
if (input.onSettled) current.onSettled.push(input.onSettled);
|
|
144293
|
+
if (current.timer) clearTimeout(current.timer);
|
|
144294
|
+
current.timer = setTimeout(() => {
|
|
144295
|
+
const live = g[GATEWAY_SEEN_SLOT];
|
|
144296
|
+
if (live !== current) return;
|
|
144297
|
+
current.timer = void 0;
|
|
144298
|
+
if (current.matched || current.warned) return;
|
|
144299
|
+
current.warned = true;
|
|
144300
|
+
input.warn(
|
|
144301
|
+
`\u5DF2\u914D\u7F6E gatewayLocation="${current.expected}"\uFF0C\u4F46\u5DF2\u52A0\u8F7D\u7684 location \u5747\u672A\u547D\u4E2D\uFF1A[${current.seen.join(", ") || "(\u65E0)"}]\u3002\u98DE\u4E66\u957F\u8FDE\u63A5\u4E0D\u4F1A\u542F\u52A8\uFF08\u673A\u5668\u4EBA\u65E0\u54CD\u5E94\uFF09\u3002\u8BF7\u786E\u8BA4 gatewayLocation \u662F\u5B9E\u9645\u6253\u5F00 opencode \u7684\u76EE\u5F55\u6216\u5176\u7236\u76EE\u5F55\uFF1B\u7559\u7A7A\u5219\u4EFB\u610F location \u751F\u6548\u3002`
|
|
144302
|
+
);
|
|
144303
|
+
runOnSettled(...current.onSettled.splice(0));
|
|
144304
|
+
}, input.delayMs ?? 2e3);
|
|
144305
|
+
}
|
|
144306
|
+
function settle2(slot) {
|
|
144307
|
+
if (slot.timer) {
|
|
144308
|
+
clearTimeout(slot.timer);
|
|
144309
|
+
slot.timer = void 0;
|
|
144310
|
+
}
|
|
144311
|
+
runOnSettled(...slot.onSettled.splice(0));
|
|
144312
|
+
}
|
|
144313
|
+
function runOnSettled(...callbacks) {
|
|
144314
|
+
for (const cb of callbacks) {
|
|
144315
|
+
if (!cb) continue;
|
|
144316
|
+
try {
|
|
144317
|
+
cb();
|
|
144318
|
+
} catch {
|
|
144319
|
+
}
|
|
144320
|
+
}
|
|
144321
|
+
}
|
|
144261
144322
|
|
|
144262
144323
|
// src/security/allowlist.ts
|
|
144263
144324
|
var OWNER_STORAGE_KEY = "feishu:v2:owner";
|
|
@@ -150096,13 +150157,13 @@ var SummaryTimeoutError = class extends Error {
|
|
|
150096
150157
|
}
|
|
150097
150158
|
};
|
|
150098
150159
|
function withTimeout(promise3, ms) {
|
|
150099
|
-
return new Promise((
|
|
150160
|
+
return new Promise((resolve4, reject) => {
|
|
150100
150161
|
const timer = setTimeout(() => reject(new SummaryTimeoutError()), Math.max(1, ms));
|
|
150101
150162
|
timer.unref?.();
|
|
150102
150163
|
promise3.then(
|
|
150103
150164
|
(value3) => {
|
|
150104
150165
|
clearTimeout(timer);
|
|
150105
|
-
|
|
150166
|
+
resolve4(value3);
|
|
150106
150167
|
},
|
|
150107
150168
|
(err2) => {
|
|
150108
150169
|
clearTimeout(timer);
|
|
@@ -150234,7 +150295,7 @@ var CompactController = class {
|
|
|
150234
150295
|
constructor(deps) {
|
|
150235
150296
|
this.deps = deps;
|
|
150236
150297
|
this.now = deps.now ?? (() => Date.now());
|
|
150237
|
-
this.sleep = deps.sleep ?? ((ms) => new Promise((
|
|
150298
|
+
this.sleep = deps.sleep ?? ((ms) => new Promise((resolve4) => setTimeout(resolve4, ms)));
|
|
150238
150299
|
}
|
|
150239
150300
|
deps;
|
|
150240
150301
|
now;
|
|
@@ -150575,13 +150636,13 @@ async function quickGenerateWithSession(deps, input) {
|
|
|
150575
150636
|
return { route: "http", result: result3 };
|
|
150576
150637
|
}
|
|
150577
150638
|
function withAttemptTimeout(promise3, ms) {
|
|
150578
|
-
return new Promise((
|
|
150639
|
+
return new Promise((resolve4, reject) => {
|
|
150579
150640
|
const timer = setTimeout(() => reject(new Error("generate-attempt-timeout")), Math.max(1, ms));
|
|
150580
150641
|
timer.unref?.();
|
|
150581
150642
|
promise3.then(
|
|
150582
150643
|
(value3) => {
|
|
150583
150644
|
clearTimeout(timer);
|
|
150584
|
-
|
|
150645
|
+
resolve4(value3);
|
|
150585
150646
|
},
|
|
150586
150647
|
(err2) => {
|
|
150587
150648
|
clearTimeout(timer);
|
|
@@ -150619,11 +150680,20 @@ var index_default = plugin_exports.define({
|
|
|
150619
150680
|
hasAppSecret: hasSecret(config.appSecret)
|
|
150620
150681
|
});
|
|
150621
150682
|
const here = ctx.location?.directory;
|
|
150622
|
-
if (config.gatewayLocation
|
|
150623
|
-
|
|
150624
|
-
|
|
150625
|
-
|
|
150626
|
-
|
|
150683
|
+
if (config.gatewayLocation) {
|
|
150684
|
+
const matched = Boolean(here) && isUnder(here, config.gatewayLocation);
|
|
150685
|
+
trackGatewayLocationSeen({
|
|
150686
|
+
here: here ?? "(unknown)",
|
|
150687
|
+
expected: config.gatewayLocation,
|
|
150688
|
+
matched,
|
|
150689
|
+
warn: (message) => log2.warn(message),
|
|
150690
|
+
...matched ? {} : { onSettled: () => logSink?.close() }
|
|
150691
|
+
});
|
|
150692
|
+
if (!matched) {
|
|
150693
|
+
log2.debug("\u8DF3\u8FC7\u975E\u7F51\u5173 location", { here, expected: config.gatewayLocation });
|
|
150694
|
+
return async () => {
|
|
150695
|
+
};
|
|
150696
|
+
}
|
|
150627
150697
|
}
|
|
150628
150698
|
if (!acquireProcessGuard()) {
|
|
150629
150699
|
log2.debug("\u68C0\u6D4B\u5230\u540C\u8FDB\u7A0B\u91CD\u590D setup\uFF0C\u8DF3\u8FC7\u542F\u52A8\uFF08\u4EC5\u9996\u4E2A\u5B9E\u4F8B\u751F\u6548\uFF09");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-feishu-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Feishu/Lark plugin for OpenCode V2 — single-user topics as sessions, in-card permission approvals, streaming cards. Minimal permissions, no public endpoint.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|