@dipoleml/dcode-cli 1.0.0 → 1.1.0
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/dist/dcode.cjs +808 -581
- package/dist/provider/dcode-builtin.json +1 -50
- package/node_modules/@dcode/model-option-map/package.json +1 -1
- package/node_modules/@dcode/shared/dist/bots.d.ts +4 -4
- package/node_modules/@dcode/shared/dist/conversation-share.d.ts +35 -35
- package/node_modules/@dcode/shared/dist/dcode-protocol/index.d.ts +284 -284
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/command.d.ts +36 -36
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/controller.d.ts +70 -70
- package/node_modules/@dcode/shared/dist/dcode-protocol-v4/transport.d.ts +985 -985
- package/node_modules/@dcode/shared/dist/dcodeEndpoint.d.ts +2 -0
- package/node_modules/@dcode/shared/dist/dcodeEndpoint.js +4 -0
- package/node_modules/@dcode/shared/dist/protocol.d.ts +5 -0
- package/node_modules/@dcode/shared/dist/validation.d.ts +109 -109
- package/node_modules/@dcode/shared/dist/validationAppSettings.d.ts +7 -7
- package/node_modules/@dcode/shared/package.json +1 -1
- package/node_modules/@dcode/tui/dist/index.js +2 -2
- package/package.json +3 -3
package/dist/dcode.cjs
CHANGED
|
@@ -1194,7 +1194,7 @@ async function flushE2ECoverage() {
|
|
|
1194
1194
|
}
|
|
1195
1195
|
try {
|
|
1196
1196
|
(0, import_node_v8.takeCoverage)();
|
|
1197
|
-
await new Promise((
|
|
1197
|
+
await new Promise((resolve59) => setTimeout(resolve59, 500));
|
|
1198
1198
|
} catch {
|
|
1199
1199
|
}
|
|
1200
1200
|
}
|
|
@@ -1214,8 +1214,8 @@ async function runCliCleanupWithTimeout(cleanup, timeoutMs2) {
|
|
|
1214
1214
|
}
|
|
1215
1215
|
await Promise.race([
|
|
1216
1216
|
cleanupPromise,
|
|
1217
|
-
new Promise((
|
|
1218
|
-
timeout = setTimeout(
|
|
1217
|
+
new Promise((resolve59) => {
|
|
1218
|
+
timeout = setTimeout(resolve59, timeoutMs2);
|
|
1219
1219
|
timeout.unref?.();
|
|
1220
1220
|
})
|
|
1221
1221
|
]);
|
|
@@ -5748,7 +5748,7 @@ function isRef(value2) {
|
|
|
5748
5748
|
function cloneIssues(issues) {
|
|
5749
5749
|
return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
|
|
5750
5750
|
}
|
|
5751
|
-
function isRecursive(inst, stack,
|
|
5751
|
+
function isRecursive(inst, stack, resolve59) {
|
|
5752
5752
|
const cached2 = recursive.get(inst);
|
|
5753
5753
|
if (cached2 !== void 0)
|
|
5754
5754
|
return cached2 ? PROVEN : NONE;
|
|
@@ -5758,7 +5758,7 @@ function isRecursive(inst, stack, resolve58) {
|
|
|
5758
5758
|
let result = NONE;
|
|
5759
5759
|
const check3 = (child) => {
|
|
5760
5760
|
if (result !== PROVEN && child?._zod) {
|
|
5761
|
-
const answer = isRecursive(child, stack,
|
|
5761
|
+
const answer = isRecursive(child, stack, resolve59);
|
|
5762
5762
|
if (answer > result)
|
|
5763
5763
|
result = answer;
|
|
5764
5764
|
}
|
|
@@ -5769,7 +5769,7 @@ function isRecursive(inst, stack, resolve58) {
|
|
|
5769
5769
|
const desc = Object.getOwnPropertyDescriptor(sh, key2);
|
|
5770
5770
|
if (spread && !desc.enumerable)
|
|
5771
5771
|
continue;
|
|
5772
|
-
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack,
|
|
5772
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve59) : NONE;
|
|
5773
5773
|
if (child > answer)
|
|
5774
5774
|
answer = child;
|
|
5775
5775
|
}
|
|
@@ -5833,7 +5833,7 @@ function isRecursive(inst, stack, resolve58) {
|
|
|
5833
5833
|
break;
|
|
5834
5834
|
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
5835
5835
|
case "lazy": {
|
|
5836
|
-
const inner = def._cachedInner ?? (
|
|
5836
|
+
const inner = def._cachedInner ?? (resolve59 ? inst._zod.innerType : void 0);
|
|
5837
5837
|
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
5838
5838
|
break;
|
|
5839
5839
|
}
|
|
@@ -22383,8 +22383,8 @@ async function renameWithRetry(tempFile, filePath, retryDelaysMs) {
|
|
|
22383
22383
|
async function withFileLock(filePath, operation, options2 = {}) {
|
|
22384
22384
|
const previousTail = processFileLockTails.get(filePath) ?? Promise.resolve();
|
|
22385
22385
|
let releaseProcessQueue;
|
|
22386
|
-
const currentTail = new Promise((
|
|
22387
|
-
releaseProcessQueue =
|
|
22386
|
+
const currentTail = new Promise((resolve59) => {
|
|
22387
|
+
releaseProcessQueue = resolve59;
|
|
22388
22388
|
});
|
|
22389
22389
|
processFileLockTails.set(filePath, currentTail);
|
|
22390
22390
|
await previousTail;
|
|
@@ -24770,8 +24770,8 @@ var init_account_provider_service = __esm({
|
|
|
24770
24770
|
const generation = this.#requestedGeneration + 1;
|
|
24771
24771
|
this.#requestedGeneration = generation;
|
|
24772
24772
|
this.#pendingReasons.add(reason);
|
|
24773
|
-
const result = new Promise((
|
|
24774
|
-
this.#refreshWaiters.push({ generation, resolve:
|
|
24773
|
+
const result = new Promise((resolve59, reject) => {
|
|
24774
|
+
this.#refreshWaiters.push({ generation, resolve: resolve59, reject });
|
|
24775
24775
|
});
|
|
24776
24776
|
if (!this.#refreshInFlight) this.#startRefresh();
|
|
24777
24777
|
return result;
|
|
@@ -26072,8 +26072,8 @@ var init_registry_service = __esm({
|
|
|
26072
26072
|
const generation = this.#requestedGeneration + 1;
|
|
26073
26073
|
this.#requestedGeneration = generation;
|
|
26074
26074
|
this.#pendingReasons.add(reason);
|
|
26075
|
-
const result = new Promise((
|
|
26076
|
-
this.#refreshWaiters.push({ generation, resolve:
|
|
26075
|
+
const result = new Promise((resolve59, reject) => {
|
|
26076
|
+
this.#refreshWaiters.push({ generation, resolve: resolve59, reject });
|
|
26077
26077
|
});
|
|
26078
26078
|
this.#ensureRefreshLoop();
|
|
26079
26079
|
return result;
|
|
@@ -26521,11 +26521,11 @@ async function downloadDCodeBuiltinRelease(options2) {
|
|
|
26521
26521
|
}
|
|
26522
26522
|
}
|
|
26523
26523
|
function abortable(pending, signal) {
|
|
26524
|
-
return new Promise((
|
|
26524
|
+
return new Promise((resolve59, reject) => {
|
|
26525
26525
|
const abort = () => reject(signal.reason);
|
|
26526
26526
|
signal.addEventListener("abort", abort, { once: true });
|
|
26527
26527
|
if (signal.aborted) abort();
|
|
26528
|
-
void pending.then(
|
|
26528
|
+
void pending.then(resolve59, reject).finally(() => signal.removeEventListener("abort", abort));
|
|
26529
26529
|
});
|
|
26530
26530
|
}
|
|
26531
26531
|
var clientConfigSchema, DownloadBoundaryError;
|
|
@@ -32387,6 +32387,9 @@ function buildDcodeApiCreditsUrl(env = readProductEndpointEnv()) {
|
|
|
32387
32387
|
function buildDcodeAccountOverviewUrl(env = readProductEndpointEnv()) {
|
|
32388
32388
|
return buildDcodeOAuthUrl(resolveDcodeOAuthOrigin(env), "/api/account/overview");
|
|
32389
32389
|
}
|
|
32390
|
+
function buildDcodeAutoKeyUrl(env = readProductEndpointEnv()) {
|
|
32391
|
+
return buildDcodeOAuthUrl(resolveDcodeOAuthOrigin(env), "/api/keys/auto");
|
|
32392
|
+
}
|
|
32390
32393
|
function buildRuntimeDcodeOAuthUrl(env = readProductEndpointEnv(), path6) {
|
|
32391
32394
|
return buildDcodeOAuthUrl(resolveDcodeOAuthOrigin(env), path6);
|
|
32392
32395
|
}
|
|
@@ -44354,6 +44357,7 @@ __export(src_exports, {
|
|
|
44354
44357
|
buildDCodeToolEnvPassthroughEnv: () => buildDCodeToolEnvPassthroughEnv,
|
|
44355
44358
|
buildDcodeAccountOverviewUrl: () => buildDcodeAccountOverviewUrl,
|
|
44356
44359
|
buildDcodeApiCreditsUrl: () => buildDcodeApiCreditsUrl,
|
|
44360
|
+
buildDcodeAutoKeyUrl: () => buildDcodeAutoKeyUrl,
|
|
44357
44361
|
buildDcodeCodingPlanSubscribeUrl: () => buildDcodeCodingPlanSubscribeUrl,
|
|
44358
44362
|
buildDcodeOAuthUrl: () => buildDcodeOAuthUrl,
|
|
44359
44363
|
buildGhostSupplierIdentity: () => buildGhostSupplierIdentity,
|
|
@@ -50324,10 +50328,10 @@ var init_mcp_port = __esm({
|
|
|
50324
50328
|
}
|
|
50325
50329
|
});
|
|
50326
50330
|
|
|
50327
|
-
//
|
|
50331
|
+
// ../contracts/node_modules/zod/v3/helpers/util.js
|
|
50328
50332
|
var util, objectUtil, ZodParsedType, getParsedType2;
|
|
50329
50333
|
var init_util2 = __esm({
|
|
50330
|
-
"
|
|
50334
|
+
"../contracts/node_modules/zod/v3/helpers/util.js"() {
|
|
50331
50335
|
(function(util3) {
|
|
50332
50336
|
util3.assertEqual = (_2) => {
|
|
50333
50337
|
};
|
|
@@ -50461,10 +50465,10 @@ var init_util2 = __esm({
|
|
|
50461
50465
|
}
|
|
50462
50466
|
});
|
|
50463
50467
|
|
|
50464
|
-
//
|
|
50468
|
+
// ../contracts/node_modules/zod/v3/ZodError.js
|
|
50465
50469
|
var ZodIssueCode2, quotelessJson, ZodError2;
|
|
50466
50470
|
var init_ZodError = __esm({
|
|
50467
|
-
"
|
|
50471
|
+
"../contracts/node_modules/zod/v3/ZodError.js"() {
|
|
50468
50472
|
init_util2();
|
|
50469
50473
|
ZodIssueCode2 = util.arrayToEnum([
|
|
50470
50474
|
"invalid_type",
|
|
@@ -50585,10 +50589,10 @@ var init_ZodError = __esm({
|
|
|
50585
50589
|
}
|
|
50586
50590
|
});
|
|
50587
50591
|
|
|
50588
|
-
//
|
|
50592
|
+
// ../contracts/node_modules/zod/v3/locales/en.js
|
|
50589
50593
|
var errorMap, en_default2;
|
|
50590
50594
|
var init_en2 = __esm({
|
|
50591
|
-
"
|
|
50595
|
+
"../contracts/node_modules/zod/v3/locales/en.js"() {
|
|
50592
50596
|
init_ZodError();
|
|
50593
50597
|
init_util2();
|
|
50594
50598
|
errorMap = (issue3, _ctx) => {
|
|
@@ -50695,7 +50699,7 @@ var init_en2 = __esm({
|
|
|
50695
50699
|
}
|
|
50696
50700
|
});
|
|
50697
50701
|
|
|
50698
|
-
//
|
|
50702
|
+
// ../contracts/node_modules/zod/v3/errors.js
|
|
50699
50703
|
function setErrorMap2(map2) {
|
|
50700
50704
|
overrideErrorMap = map2;
|
|
50701
50705
|
}
|
|
@@ -50704,13 +50708,13 @@ function getErrorMap2() {
|
|
|
50704
50708
|
}
|
|
50705
50709
|
var overrideErrorMap;
|
|
50706
50710
|
var init_errors4 = __esm({
|
|
50707
|
-
"
|
|
50711
|
+
"../contracts/node_modules/zod/v3/errors.js"() {
|
|
50708
50712
|
init_en2();
|
|
50709
50713
|
overrideErrorMap = en_default2;
|
|
50710
50714
|
}
|
|
50711
50715
|
});
|
|
50712
50716
|
|
|
50713
|
-
//
|
|
50717
|
+
// ../contracts/node_modules/zod/v3/helpers/parseUtil.js
|
|
50714
50718
|
function addIssueToContext(ctx, issueData) {
|
|
50715
50719
|
const overrideMap = getErrorMap2();
|
|
50716
50720
|
const issue3 = makeIssue({
|
|
@@ -50732,7 +50736,7 @@ function addIssueToContext(ctx, issueData) {
|
|
|
50732
50736
|
}
|
|
50733
50737
|
var makeIssue, EMPTY_PATH, ParseStatus, INVALID2, DIRTY, OK, isAborted, isDirty, isValid, isAsync;
|
|
50734
50738
|
var init_parseUtil = __esm({
|
|
50735
|
-
"
|
|
50739
|
+
"../contracts/node_modules/zod/v3/helpers/parseUtil.js"() {
|
|
50736
50740
|
init_errors4();
|
|
50737
50741
|
init_en2();
|
|
50738
50742
|
makeIssue = (params) => {
|
|
@@ -50827,16 +50831,16 @@ var init_parseUtil = __esm({
|
|
|
50827
50831
|
}
|
|
50828
50832
|
});
|
|
50829
50833
|
|
|
50830
|
-
//
|
|
50834
|
+
// ../contracts/node_modules/zod/v3/helpers/typeAliases.js
|
|
50831
50835
|
var init_typeAliases = __esm({
|
|
50832
|
-
"
|
|
50836
|
+
"../contracts/node_modules/zod/v3/helpers/typeAliases.js"() {
|
|
50833
50837
|
}
|
|
50834
50838
|
});
|
|
50835
50839
|
|
|
50836
|
-
//
|
|
50840
|
+
// ../contracts/node_modules/zod/v3/helpers/errorUtil.js
|
|
50837
50841
|
var errorUtil;
|
|
50838
50842
|
var init_errorUtil = __esm({
|
|
50839
|
-
"
|
|
50843
|
+
"../contracts/node_modules/zod/v3/helpers/errorUtil.js"() {
|
|
50840
50844
|
(function(errorUtil3) {
|
|
50841
50845
|
errorUtil3.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
50842
50846
|
errorUtil3.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
@@ -50844,7 +50848,7 @@ var init_errorUtil = __esm({
|
|
|
50844
50848
|
}
|
|
50845
50849
|
});
|
|
50846
50850
|
|
|
50847
|
-
//
|
|
50851
|
+
// ../contracts/node_modules/zod/v3/types.js
|
|
50848
50852
|
function processCreateParams(params) {
|
|
50849
50853
|
if (!params)
|
|
50850
50854
|
return {};
|
|
@@ -51038,7 +51042,7 @@ function custom2(check3, _params = {}, fatal) {
|
|
|
51038
51042
|
}
|
|
51039
51043
|
var ParseInputLazyPath, handleResult, ZodType2, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, jwtRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv4CidrRegex, ipv6Regex, ipv6CidrRegex, base64Regex, base64urlRegex, dateRegexSource, dateRegex, ZodString2, ZodNumber2, ZodBigInt2, ZodBoolean2, ZodDate2, ZodSymbol2, ZodUndefined2, ZodNull2, ZodAny2, ZodUnknown2, ZodNever2, ZodVoid2, ZodArray2, ZodObject2, ZodUnion2, getDiscriminator, ZodDiscriminatedUnion2, ZodIntersection2, ZodTuple2, ZodRecord2, ZodMap2, ZodSet2, ZodFunction2, ZodLazy2, ZodLiteral2, ZodEnum2, ZodNativeEnum, ZodPromise2, ZodEffects, ZodOptional2, ZodNullable2, ZodDefault2, ZodCatch2, ZodNaN2, BRAND, ZodBranded, ZodPipeline, ZodReadonly2, late, ZodFirstPartyTypeKind2, instanceOfType, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, ostring, onumber, oboolean, coerce, NEVER2;
|
|
51040
51044
|
var init_types2 = __esm({
|
|
51041
|
-
"
|
|
51045
|
+
"../contracts/node_modules/zod/v3/types.js"() {
|
|
51042
51046
|
init_ZodError();
|
|
51043
51047
|
init_errors4();
|
|
51044
51048
|
init_errorUtil();
|
|
@@ -54300,7 +54304,7 @@ var init_types2 = __esm({
|
|
|
54300
54304
|
}
|
|
54301
54305
|
});
|
|
54302
54306
|
|
|
54303
|
-
//
|
|
54307
|
+
// ../contracts/node_modules/zod/v3/external.js
|
|
54304
54308
|
var external_exports2 = {};
|
|
54305
54309
|
__export(external_exports2, {
|
|
54306
54310
|
BRAND: () => BRAND,
|
|
@@ -54412,7 +54416,7 @@ __export(external_exports2, {
|
|
|
54412
54416
|
void: () => voidType
|
|
54413
54417
|
});
|
|
54414
54418
|
var init_external2 = __esm({
|
|
54415
|
-
"
|
|
54419
|
+
"../contracts/node_modules/zod/v3/external.js"() {
|
|
54416
54420
|
init_errors4();
|
|
54417
54421
|
init_parseUtil();
|
|
54418
54422
|
init_typeAliases();
|
|
@@ -54422,10 +54426,10 @@ var init_external2 = __esm({
|
|
|
54422
54426
|
}
|
|
54423
54427
|
});
|
|
54424
54428
|
|
|
54425
|
-
//
|
|
54429
|
+
// ../contracts/node_modules/zod/index.js
|
|
54426
54430
|
var zod_default;
|
|
54427
54431
|
var init_zod2 = __esm({
|
|
54428
|
-
"
|
|
54432
|
+
"../contracts/node_modules/zod/index.js"() {
|
|
54429
54433
|
init_external2();
|
|
54430
54434
|
init_external2();
|
|
54431
54435
|
zod_default = external_exports2;
|
|
@@ -55456,9 +55460,9 @@ var init_getRelativePath = __esm({
|
|
|
55456
55460
|
}
|
|
55457
55461
|
});
|
|
55458
55462
|
|
|
55459
|
-
//
|
|
55463
|
+
// ../contracts/node_modules/zod/v3/index.js
|
|
55460
55464
|
var init_v3 = __esm({
|
|
55461
|
-
"
|
|
55465
|
+
"../contracts/node_modules/zod/v3/index.js"() {
|
|
55462
55466
|
init_external2();
|
|
55463
55467
|
}
|
|
55464
55468
|
});
|
|
@@ -64977,7 +64981,7 @@ async function runSqliteSessionMigrationsAsync(db, dbPath, options2 = {}) {
|
|
|
64977
64981
|
try {
|
|
64978
64982
|
for (const step of steps) {
|
|
64979
64983
|
if ("delayMs" in step)
|
|
64980
|
-
await new Promise((
|
|
64984
|
+
await new Promise((resolve59) => setTimeout(resolve59, step.delayMs));
|
|
64981
64985
|
else if (step.phase === "failed") {
|
|
64982
64986
|
try {
|
|
64983
64987
|
await options2.onProgress?.(step);
|
|
@@ -68101,12 +68105,12 @@ function isNodeError2(error62, code) {
|
|
|
68101
68105
|
function delay(ms) {
|
|
68102
68106
|
return new Promise((resolveDelay) => setTimeout(resolveDelay, ms));
|
|
68103
68107
|
}
|
|
68104
|
-
var import_promises11,
|
|
68108
|
+
var import_promises11, import_node_child_process2, import_node_util2, import_node_crypto11, import_node_os5, import_node_path12, import_promises12, DEFAULT_LOCK_TIMEOUT_MS, DEFAULT_STALE_LOCK_MS, LOCK_RETRY_MS, DEFAULT_RENAME_RETRY_DELAYS_MS2, SECURITY_DIRECTORY, TRUST_STORE_FILE, LOCK_START_TIME_TOLERANCE_MS, PROC_CLOCK_TICKS_PER_SECOND, execFileAsync, ownStartTimeMs, FileWorkspaceHookTrustStore;
|
|
68105
68109
|
var init_workspace_hook_trust_store2 = __esm({
|
|
68106
68110
|
"../adapters/dist/storage/workspace-hook-trust-store.js"() {
|
|
68107
68111
|
"use strict";
|
|
68108
68112
|
import_promises11 = require("node:fs/promises");
|
|
68109
|
-
|
|
68113
|
+
import_node_child_process2 = require("node:child_process");
|
|
68110
68114
|
import_node_util2 = require("node:util");
|
|
68111
68115
|
import_node_crypto11 = require("node:crypto");
|
|
68112
68116
|
import_node_os5 = require("node:os");
|
|
@@ -68121,7 +68125,7 @@ var init_workspace_hook_trust_store2 = __esm({
|
|
|
68121
68125
|
TRUST_STORE_FILE = "workspace-hook-trust-v1.json";
|
|
68122
68126
|
LOCK_START_TIME_TOLERANCE_MS = 2e3;
|
|
68123
68127
|
PROC_CLOCK_TICKS_PER_SECOND = 100;
|
|
68124
|
-
execFileAsync = (0, import_node_util2.promisify)(
|
|
68128
|
+
execFileAsync = (0, import_node_util2.promisify)(import_node_child_process2.execFile);
|
|
68125
68129
|
FileWorkspaceHookTrustStore = class {
|
|
68126
68130
|
filePath;
|
|
68127
68131
|
lockPath;
|
|
@@ -73273,7 +73277,7 @@ function runBundledRipgrepWorker(args, preopens, options2) {
|
|
|
73273
73277
|
args: args.map(String),
|
|
73274
73278
|
preopens
|
|
73275
73279
|
});
|
|
73276
|
-
return new Promise((
|
|
73280
|
+
return new Promise((resolve59, reject) => {
|
|
73277
73281
|
let settled = false;
|
|
73278
73282
|
let timeoutId;
|
|
73279
73283
|
const terminateWorker = () => {
|
|
@@ -73308,7 +73312,7 @@ function runBundledRipgrepWorker(args, preopens, options2) {
|
|
|
73308
73312
|
settle3(() => {
|
|
73309
73313
|
const parsed = message;
|
|
73310
73314
|
if (parsed.type === "result" && parsed.result) {
|
|
73311
|
-
|
|
73315
|
+
resolve59(parsed.result);
|
|
73312
73316
|
return;
|
|
73313
73317
|
}
|
|
73314
73318
|
if (parsed.type === "error") {
|
|
@@ -74389,11 +74393,11 @@ function splitNonEmptyLines(value2) {
|
|
|
74389
74393
|
}
|
|
74390
74394
|
return value2.split(/\r?\n/u).map((line) => line.trimEnd()).filter((line) => line.length > 0);
|
|
74391
74395
|
}
|
|
74392
|
-
var
|
|
74396
|
+
var import_node_child_process3, import_node_util4, DEFAULT_GIT_COMMAND_TIMEOUT_MS, DEFAULT_COMMAND_MAX_BUFFER_BYTES, GIT_COMMAND, GIT_STATUS_NOT_REPO, GIT_STATUS_CLEAN, GIT_STATUS_DIRTY, MAX_RECENT_COMMITS, DEFAULT_MAIN_BRANCH_CANDIDATES, MAX_GIT_STATUS_CONTEXT_CHARS, execFile2;
|
|
74393
74397
|
var init_git_snapshot = __esm({
|
|
74394
74398
|
"../adapters/dist/context/git-snapshot.js"() {
|
|
74395
74399
|
"use strict";
|
|
74396
|
-
|
|
74400
|
+
import_node_child_process3 = require("node:child_process");
|
|
74397
74401
|
import_node_util4 = require("node:util");
|
|
74398
74402
|
DEFAULT_GIT_COMMAND_TIMEOUT_MS = 3e3;
|
|
74399
74403
|
DEFAULT_COMMAND_MAX_BUFFER_BYTES = 1024 * 1024;
|
|
@@ -74404,7 +74408,7 @@ var init_git_snapshot = __esm({
|
|
|
74404
74408
|
MAX_RECENT_COMMITS = 5;
|
|
74405
74409
|
DEFAULT_MAIN_BRANCH_CANDIDATES = ["main", "master"];
|
|
74406
74410
|
MAX_GIT_STATUS_CONTEXT_CHARS = 2e3;
|
|
74407
|
-
execFile2 = (0, import_node_util4.promisify)(
|
|
74411
|
+
execFile2 = (0, import_node_util4.promisify)(import_node_child_process3.execFile);
|
|
74408
74412
|
}
|
|
74409
74413
|
});
|
|
74410
74414
|
|
|
@@ -75210,7 +75214,7 @@ function createExecutionOutputStreamDecoder(legacyOutputEncoding) {
|
|
|
75210
75214
|
function readWindowsActiveCodePageEncoding(env) {
|
|
75211
75215
|
const comSpec = getEnvValue2(env, "ComSpec", "win32") ?? "cmd.exe";
|
|
75212
75216
|
try {
|
|
75213
|
-
const output2 = (0,
|
|
75217
|
+
const output2 = (0, import_node_child_process4.execFileSync)(comSpec, ["/d", "/s", "/c", "chcp"], {
|
|
75214
75218
|
encoding: "utf8",
|
|
75215
75219
|
env,
|
|
75216
75220
|
timeout: 1e3,
|
|
@@ -75262,11 +75266,11 @@ function resolveLegacyExecutionOutputEncoding(options2) {
|
|
|
75262
75266
|
}
|
|
75263
75267
|
return resolveWindowsLocaleLegacyEncoding(options2.processEnv);
|
|
75264
75268
|
}
|
|
75265
|
-
var
|
|
75269
|
+
var import_node_child_process4, import_node_string_decoder2, import_iconv_lite2, WINDOWS_OUTPUT_ENCODING_OVERRIDE_ENV, PYTHON_UTF8_ENV_PATCH;
|
|
75266
75270
|
var init_outputEncoding = __esm({
|
|
75267
75271
|
"../adapters/dist/exec/outputEncoding.js"() {
|
|
75268
75272
|
"use strict";
|
|
75269
|
-
|
|
75273
|
+
import_node_child_process4 = require("node:child_process");
|
|
75270
75274
|
import_node_string_decoder2 = require("node:string_decoder");
|
|
75271
75275
|
import_iconv_lite2 = __toESM(require_lib(), 1);
|
|
75272
75276
|
WINDOWS_OUTPUT_ENCODING_OVERRIDE_ENV = "DCODE_WINDOWS_OUTPUT_ENCODING";
|
|
@@ -76099,9 +76103,9 @@ function isSamplablePid(pid) {
|
|
|
76099
76103
|
return Number.isInteger(pid) && pid > 0;
|
|
76100
76104
|
}
|
|
76101
76105
|
function defaultProbeExecFile(file3, args, options2) {
|
|
76102
|
-
return new Promise((
|
|
76103
|
-
(0,
|
|
76104
|
-
|
|
76106
|
+
return new Promise((resolve59) => {
|
|
76107
|
+
(0, import_node_child_process5.execFile)(file3, [...args], options2, (error62, stdout, stderr) => {
|
|
76108
|
+
resolve59({
|
|
76105
76109
|
...error62 ? { error: error62 } : {},
|
|
76106
76110
|
status: resolveExitStatus(error62),
|
|
76107
76111
|
stderr,
|
|
@@ -76116,11 +76120,11 @@ function resolveExitStatus(error62) {
|
|
|
76116
76120
|
const code = error62.code;
|
|
76117
76121
|
return typeof code === "number" ? code : null;
|
|
76118
76122
|
}
|
|
76119
|
-
var
|
|
76123
|
+
var import_node_child_process5, PROCESS_PROBE_SAMPLE_TIMEOUT_MS, PROCESS_PROBE_MAX_BUFFER_BYTES, ProcessProbeFailure;
|
|
76120
76124
|
var init_process_probe_shared = __esm({
|
|
76121
76125
|
"../adapters/dist/device/process-probe-shared.js"() {
|
|
76122
76126
|
"use strict";
|
|
76123
|
-
|
|
76127
|
+
import_node_child_process5 = require("node:child_process");
|
|
76124
76128
|
PROCESS_PROBE_SAMPLE_TIMEOUT_MS = 1e3;
|
|
76125
76129
|
PROCESS_PROBE_MAX_BUFFER_BYTES = 8 * 1024 * 1024;
|
|
76126
76130
|
ProcessProbeFailure = class extends Error {
|
|
@@ -76424,8 +76428,8 @@ async function raceProbeTimeout(work) {
|
|
|
76424
76428
|
try {
|
|
76425
76429
|
return await Promise.race([
|
|
76426
76430
|
work,
|
|
76427
|
-
new Promise((
|
|
76428
|
-
timer = setTimeout(() =>
|
|
76431
|
+
new Promise((resolve59) => {
|
|
76432
|
+
timer = setTimeout(() => resolve59(PROBE_TIMED_OUT), PROCESS_PROBE_SAMPLE_TIMEOUT_MS);
|
|
76429
76433
|
timer.unref?.();
|
|
76430
76434
|
})
|
|
76431
76435
|
]);
|
|
@@ -76470,7 +76474,7 @@ function abortSignalReason(signal) {
|
|
|
76470
76474
|
return signal.reason;
|
|
76471
76475
|
}
|
|
76472
76476
|
function waitForPromise(promise2, timeoutMs2) {
|
|
76473
|
-
return new Promise((
|
|
76477
|
+
return new Promise((resolve59) => {
|
|
76474
76478
|
let settled = false;
|
|
76475
76479
|
let timer;
|
|
76476
76480
|
const finish = (completed) => {
|
|
@@ -76479,7 +76483,7 @@ function waitForPromise(promise2, timeoutMs2) {
|
|
|
76479
76483
|
settled = true;
|
|
76480
76484
|
if (timer)
|
|
76481
76485
|
clearTimeout(timer);
|
|
76482
|
-
|
|
76486
|
+
resolve59(completed);
|
|
76483
76487
|
};
|
|
76484
76488
|
timer = setTimeout(() => finish(false), timeoutMs2);
|
|
76485
76489
|
timer.unref?.();
|
|
@@ -76808,11 +76812,11 @@ function shellQuoteAlways2(value2) {
|
|
|
76808
76812
|
function shellDoubleQuote(value2) {
|
|
76809
76813
|
return `"${value2.replaceAll("\\", "\\\\").replaceAll('"', '\\"').replaceAll("$", "\\$").replaceAll("`", "\\`")}"`;
|
|
76810
76814
|
}
|
|
76811
|
-
var
|
|
76815
|
+
var import_node_child_process6, import_node_fs13, import_promises19, import_node_path23, import_node_util5, DAY_MS, SNAPSHOT_TIMEOUT_MS, SNAPSHOT_MAX_BUFFER_BYTES, DEFAULT_SHELL_INIT_SNAPSHOT_RETENTION_DAYS, defaultExecFile, ShellInitSnapshotCleanupRegistry, ShellInitSnapshotManager;
|
|
76812
76816
|
var init_shell_init_snapshot = __esm({
|
|
76813
76817
|
"../adapters/dist/exec/shell-init-snapshot.js"() {
|
|
76814
76818
|
"use strict";
|
|
76815
|
-
|
|
76819
|
+
import_node_child_process6 = require("node:child_process");
|
|
76816
76820
|
import_node_fs13 = require("node:fs");
|
|
76817
76821
|
import_promises19 = require("node:fs/promises");
|
|
76818
76822
|
import_node_path23 = require("node:path");
|
|
@@ -76823,7 +76827,7 @@ var init_shell_init_snapshot = __esm({
|
|
|
76823
76827
|
SNAPSHOT_MAX_BUFFER_BYTES = 1048576;
|
|
76824
76828
|
DEFAULT_SHELL_INIT_SNAPSHOT_RETENTION_DAYS = 30;
|
|
76825
76829
|
defaultExecFile = async (file3, args, options2) => {
|
|
76826
|
-
const execFileAsync3 = (0, import_node_util5.promisify)(
|
|
76830
|
+
const execFileAsync3 = (0, import_node_util5.promisify)(import_node_child_process6.execFile);
|
|
76827
76831
|
const result = await execFileAsync3(file3, args, options2);
|
|
76828
76832
|
return {
|
|
76829
76833
|
stdout: String(result.stdout),
|
|
@@ -77001,8 +77005,8 @@ var init_output_collector = __esm({
|
|
|
77001
77005
|
async close() {
|
|
77002
77006
|
if (!this.stream)
|
|
77003
77007
|
return;
|
|
77004
|
-
await new Promise((
|
|
77005
|
-
this.stream.end(
|
|
77008
|
+
await new Promise((resolve59) => {
|
|
77009
|
+
this.stream.end(resolve59);
|
|
77006
77010
|
});
|
|
77007
77011
|
}
|
|
77008
77012
|
result() {
|
|
@@ -77171,8 +77175,8 @@ var init_node_execution_adapter_base = __esm({
|
|
|
77171
77175
|
}
|
|
77172
77176
|
createBackgroundTaskRecord(args) {
|
|
77173
77177
|
let resolveCompletion = () => void 0;
|
|
77174
|
-
const completion = new Promise((
|
|
77175
|
-
resolveCompletion =
|
|
77178
|
+
const completion = new Promise((resolve59) => {
|
|
77179
|
+
resolveCompletion = resolve59;
|
|
77176
77180
|
});
|
|
77177
77181
|
return {
|
|
77178
77182
|
completion,
|
|
@@ -77251,8 +77255,8 @@ var init_node_execution_adapter_base = __esm({
|
|
|
77251
77255
|
registerActiveExecution(stop2) {
|
|
77252
77256
|
const executionId = crypto.randomUUID();
|
|
77253
77257
|
let resolveCompletion = () => void 0;
|
|
77254
|
-
const completion = new Promise((
|
|
77255
|
-
resolveCompletion =
|
|
77258
|
+
const completion = new Promise((resolve59) => {
|
|
77259
|
+
resolveCompletion = resolve59;
|
|
77256
77260
|
});
|
|
77257
77261
|
this.activeExecutions.set(executionId, {
|
|
77258
77262
|
completion,
|
|
@@ -77530,8 +77534,8 @@ async function collectPosixDescendantPids(rootPid) {
|
|
|
77530
77534
|
try {
|
|
77531
77535
|
stdout = await Promise.race([
|
|
77532
77536
|
readPosixProcessTable(),
|
|
77533
|
-
new Promise((
|
|
77534
|
-
const timer = setTimeout(() =>
|
|
77537
|
+
new Promise((resolve59) => {
|
|
77538
|
+
const timer = setTimeout(() => resolve59(""), POSIX_PROCESS_LOOKUP_TIMEOUT_MS);
|
|
77535
77539
|
timer.unref?.();
|
|
77536
77540
|
})
|
|
77537
77541
|
]);
|
|
@@ -77563,10 +77567,10 @@ async function collectPosixDescendantPids(rootPid) {
|
|
|
77563
77567
|
return descendants;
|
|
77564
77568
|
}
|
|
77565
77569
|
function readPosixProcessTable() {
|
|
77566
|
-
return new Promise((
|
|
77570
|
+
return new Promise((resolve59, reject) => {
|
|
77567
77571
|
let processTable;
|
|
77568
77572
|
try {
|
|
77569
|
-
processTable = (0,
|
|
77573
|
+
processTable = (0, import_node_child_process7.spawn)("ps", ["-A", "-o", "pid=", "-o", "ppid="], {
|
|
77570
77574
|
cwd: "/",
|
|
77571
77575
|
stdio: ["ignore", "pipe", "ignore"]
|
|
77572
77576
|
});
|
|
@@ -77579,14 +77583,14 @@ function readPosixProcessTable() {
|
|
|
77579
77583
|
stdout += chunk;
|
|
77580
77584
|
});
|
|
77581
77585
|
processTable.once("error", reject);
|
|
77582
|
-
processTable.once("close", () =>
|
|
77586
|
+
processTable.once("close", () => resolve59(stdout));
|
|
77583
77587
|
});
|
|
77584
77588
|
}
|
|
77585
|
-
var
|
|
77589
|
+
var import_node_child_process7, GENERIC_SIGTERM_TO_SIGKILL_MS, POSIX_PROCESS_LOOKUP_TIMEOUT_MS, BASH_SIGTERM_TO_SIGKILL_MS;
|
|
77586
77590
|
var init_process_tree = __esm({
|
|
77587
77591
|
"../adapters/dist/exec/process-tree.js"() {
|
|
77588
77592
|
"use strict";
|
|
77589
|
-
|
|
77593
|
+
import_node_child_process7 = require("node:child_process");
|
|
77590
77594
|
GENERIC_SIGTERM_TO_SIGKILL_MS = 750;
|
|
77591
77595
|
POSIX_PROCESS_LOOKUP_TIMEOUT_MS = 500;
|
|
77592
77596
|
BASH_SIGTERM_TO_SIGKILL_MS = 1500;
|
|
@@ -77594,11 +77598,11 @@ var init_process_tree = __esm({
|
|
|
77594
77598
|
});
|
|
77595
77599
|
|
|
77596
77600
|
// ../adapters/dist/exec/node-execution-adapter-process.js
|
|
77597
|
-
var
|
|
77601
|
+
var import_node_child_process8, NodeExecutionAdapterProcess;
|
|
77598
77602
|
var init_node_execution_adapter_process = __esm({
|
|
77599
77603
|
"../adapters/dist/exec/node-execution-adapter-process.js"() {
|
|
77600
77604
|
"use strict";
|
|
77601
|
-
|
|
77605
|
+
import_node_child_process8 = require("node:child_process");
|
|
77602
77606
|
init_bash_startup_script();
|
|
77603
77607
|
init_bash_resource_telemetry();
|
|
77604
77608
|
init_cwd_capture();
|
|
@@ -77693,16 +77697,16 @@ var init_node_execution_adapter_process = __esm({
|
|
|
77693
77697
|
return;
|
|
77694
77698
|
}
|
|
77695
77699
|
if (this.platform === "win32") {
|
|
77696
|
-
const killer = (0,
|
|
77700
|
+
const killer = (0, import_node_child_process8.spawn)("taskkill", ["/pid", String(child.pid), "/T", "/F"], {
|
|
77697
77701
|
stdio: "ignore",
|
|
77698
77702
|
windowsHide: true
|
|
77699
77703
|
});
|
|
77700
|
-
const completion = new Promise((
|
|
77704
|
+
const completion = new Promise((resolve59) => {
|
|
77701
77705
|
killer.once("error", () => {
|
|
77702
77706
|
child.kill("SIGKILL");
|
|
77703
|
-
|
|
77707
|
+
resolve59();
|
|
77704
77708
|
});
|
|
77705
|
-
killer.once("close", () =>
|
|
77709
|
+
killer.once("close", () => resolve59());
|
|
77706
77710
|
});
|
|
77707
77711
|
if (useBashProcessTreeStop) {
|
|
77708
77712
|
this.pendingBashProcessTreeKills.set(completion, killer);
|
|
@@ -77717,13 +77721,13 @@ var init_node_execution_adapter_process = __esm({
|
|
|
77717
77721
|
const rootPid = child.pid;
|
|
77718
77722
|
void signalPosixProcessTree(rootPid, "SIGTERM");
|
|
77719
77723
|
let timer;
|
|
77720
|
-
const escalation = new Promise((
|
|
77724
|
+
const escalation = new Promise((resolve59) => {
|
|
77721
77725
|
timer = setTimeout(() => {
|
|
77722
77726
|
try {
|
|
77723
77727
|
process.kill(-rootPid, "SIGKILL");
|
|
77724
77728
|
} catch {
|
|
77725
77729
|
}
|
|
77726
|
-
void signalPosixProcessTree(rootPid, "SIGKILL").then(
|
|
77730
|
+
void signalPosixProcessTree(rootPid, "SIGKILL").then(resolve59);
|
|
77727
77731
|
}, BASH_SIGTERM_TO_SIGKILL_MS);
|
|
77728
77732
|
timer.unref?.();
|
|
77729
77733
|
});
|
|
@@ -77787,11 +77791,11 @@ var init_node_execution_adapter_process = __esm({
|
|
|
77787
77791
|
});
|
|
77788
77792
|
|
|
77789
77793
|
// ../adapters/dist/exec/node-execution-adapter-run.js
|
|
77790
|
-
var
|
|
77794
|
+
var import_node_child_process9, NodeExecutionAdapterRun;
|
|
77791
77795
|
var init_node_execution_adapter_run = __esm({
|
|
77792
77796
|
"../adapters/dist/exec/node-execution-adapter-run.js"() {
|
|
77793
77797
|
"use strict";
|
|
77794
|
-
|
|
77798
|
+
import_node_child_process9 = require("node:child_process");
|
|
77795
77799
|
init_bash_file_output();
|
|
77796
77800
|
init_cwd_capture();
|
|
77797
77801
|
init_execution_command();
|
|
@@ -77919,7 +77923,7 @@ var init_node_execution_adapter_run = __esm({
|
|
|
77919
77923
|
file3.fd
|
|
77920
77924
|
];
|
|
77921
77925
|
}
|
|
77922
|
-
const spawnedChild = (0,
|
|
77926
|
+
const spawnedChild = (0, import_node_child_process9.spawn)(prepared.command.file, prepared.command.args, prepared.spawnOptions);
|
|
77923
77927
|
child = spawnedChild;
|
|
77924
77928
|
finishResourceTelemetry = this.trackBashResources(spawnedChild, useBashMergedOutput, () => ({
|
|
77925
77929
|
timedOut,
|
|
@@ -77927,7 +77931,7 @@ var init_node_execution_adapter_run = __esm({
|
|
|
77927
77931
|
}));
|
|
77928
77932
|
cwdDialect = prepared.cwdDialect;
|
|
77929
77933
|
cwdFilePath = prepared.cwdFilePath;
|
|
77930
|
-
const exitPromise = new Promise((
|
|
77934
|
+
const exitPromise = new Promise((resolve59) => {
|
|
77931
77935
|
finishExit = (state) => {
|
|
77932
77936
|
if (exited)
|
|
77933
77937
|
return;
|
|
@@ -77936,7 +77940,7 @@ var init_node_execution_adapter_run = __esm({
|
|
|
77936
77940
|
file3?.stopWatching();
|
|
77937
77941
|
if (file3)
|
|
77938
77942
|
internalOptions.bashLifecycle?.onExit?.();
|
|
77939
|
-
|
|
77943
|
+
resolve59(state);
|
|
77940
77944
|
};
|
|
77941
77945
|
spawnedChild.once("error", (error62) => finishExit({ error: error62 }));
|
|
77942
77946
|
spawnedChild.once("exit", (code, signal) => finishExit({
|
|
@@ -77944,10 +77948,10 @@ var init_node_execution_adapter_run = __esm({
|
|
|
77944
77948
|
signal: signal ?? void 0
|
|
77945
77949
|
}));
|
|
77946
77950
|
});
|
|
77947
|
-
const closePromise = new Promise((
|
|
77951
|
+
const closePromise = new Promise((resolve59) => {
|
|
77948
77952
|
spawnedChild.once("close", () => {
|
|
77949
77953
|
childClosed = true;
|
|
77950
|
-
|
|
77954
|
+
resolve59();
|
|
77951
77955
|
});
|
|
77952
77956
|
});
|
|
77953
77957
|
await file3?.close();
|
|
@@ -78200,8 +78204,8 @@ var init_node_execution_adapter_lifecycle = __esm({
|
|
|
78200
78204
|
let persistedLimitReached = false;
|
|
78201
78205
|
let timeoutTimer;
|
|
78202
78206
|
let resolveOutcome = () => void 0;
|
|
78203
|
-
const outcome = new Promise((
|
|
78204
|
-
resolveOutcome =
|
|
78207
|
+
const outcome = new Promise((resolve59) => {
|
|
78208
|
+
resolveOutcome = resolve59;
|
|
78205
78209
|
});
|
|
78206
78210
|
const externalAbort = () => {
|
|
78207
78211
|
if (state === "backgrounded" || state === "terminal")
|
|
@@ -78351,12 +78355,12 @@ var init_node_execution_adapter_lifecycle = __esm({
|
|
|
78351
78355
|
return this.snapshot(record3);
|
|
78352
78356
|
if (!options2.signal)
|
|
78353
78357
|
return await record3.completion;
|
|
78354
|
-
return await new Promise((
|
|
78355
|
-
const abort = () =>
|
|
78358
|
+
return await new Promise((resolve59) => {
|
|
78359
|
+
const abort = () => resolve59(this.snapshot(record3));
|
|
78356
78360
|
options2.signal?.addEventListener("abort", abort, { once: true });
|
|
78357
78361
|
record3.completion.then((snapshot2) => {
|
|
78358
78362
|
options2.signal?.removeEventListener("abort", abort);
|
|
78359
|
-
|
|
78363
|
+
resolve59(snapshot2);
|
|
78360
78364
|
});
|
|
78361
78365
|
});
|
|
78362
78366
|
}
|
|
@@ -80477,7 +80481,7 @@ var init_dist3 = __esm({
|
|
|
80477
80481
|
|
|
80478
80482
|
// ../../../../node_modules/proxy-agent/node_modules/https-proxy-agent/dist/parse-proxy-response.js
|
|
80479
80483
|
function parseProxyResponse(socket) {
|
|
80480
|
-
return new Promise((
|
|
80484
|
+
return new Promise((resolve59, reject) => {
|
|
80481
80485
|
let buffersLength = 0;
|
|
80482
80486
|
const buffers = [];
|
|
80483
80487
|
function read2() {
|
|
@@ -80543,7 +80547,7 @@ function parseProxyResponse(socket) {
|
|
|
80543
80547
|
}
|
|
80544
80548
|
debug2("got proxy server response: %o %o", firstLine3, headers);
|
|
80545
80549
|
cleanup();
|
|
80546
|
-
|
|
80550
|
+
resolve59({
|
|
80547
80551
|
connect: {
|
|
80548
80552
|
statusCode,
|
|
80549
80553
|
statusText,
|
|
@@ -83776,11 +83780,11 @@ var require_socksclient = __commonJS({
|
|
|
83776
83780
|
"use strict";
|
|
83777
83781
|
var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) {
|
|
83778
83782
|
function adopt(value2) {
|
|
83779
|
-
return value2 instanceof P2 ? value2 : new P2(function(
|
|
83780
|
-
|
|
83783
|
+
return value2 instanceof P2 ? value2 : new P2(function(resolve59) {
|
|
83784
|
+
resolve59(value2);
|
|
83781
83785
|
});
|
|
83782
83786
|
}
|
|
83783
|
-
return new (P2 || (P2 = Promise))(function(
|
|
83787
|
+
return new (P2 || (P2 = Promise))(function(resolve59, reject) {
|
|
83784
83788
|
function fulfilled(value2) {
|
|
83785
83789
|
try {
|
|
83786
83790
|
step(generator.next(value2));
|
|
@@ -83796,7 +83800,7 @@ var require_socksclient = __commonJS({
|
|
|
83796
83800
|
}
|
|
83797
83801
|
}
|
|
83798
83802
|
function step(result) {
|
|
83799
|
-
result.done ?
|
|
83803
|
+
result.done ? resolve59(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
83800
83804
|
}
|
|
83801
83805
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
83802
83806
|
});
|
|
@@ -83830,13 +83834,13 @@ var require_socksclient = __commonJS({
|
|
|
83830
83834
|
* @returns { Promise }
|
|
83831
83835
|
*/
|
|
83832
83836
|
static createConnection(options2, callback) {
|
|
83833
|
-
return new Promise((
|
|
83837
|
+
return new Promise((resolve59, reject) => {
|
|
83834
83838
|
try {
|
|
83835
83839
|
(0, helpers_1.validateSocksClientOptions)(options2, ["connect"]);
|
|
83836
83840
|
} catch (err) {
|
|
83837
83841
|
if (typeof callback === "function") {
|
|
83838
83842
|
callback(err);
|
|
83839
|
-
return
|
|
83843
|
+
return resolve59(err);
|
|
83840
83844
|
} else {
|
|
83841
83845
|
return reject(err);
|
|
83842
83846
|
}
|
|
@@ -83847,16 +83851,16 @@ var require_socksclient = __commonJS({
|
|
|
83847
83851
|
client.removeAllListeners();
|
|
83848
83852
|
if (typeof callback === "function") {
|
|
83849
83853
|
callback(null, info);
|
|
83850
|
-
|
|
83854
|
+
resolve59(info);
|
|
83851
83855
|
} else {
|
|
83852
|
-
|
|
83856
|
+
resolve59(info);
|
|
83853
83857
|
}
|
|
83854
83858
|
});
|
|
83855
83859
|
client.once("error", (err) => {
|
|
83856
83860
|
client.removeAllListeners();
|
|
83857
83861
|
if (typeof callback === "function") {
|
|
83858
83862
|
callback(err);
|
|
83859
|
-
|
|
83863
|
+
resolve59(err);
|
|
83860
83864
|
} else {
|
|
83861
83865
|
reject(err);
|
|
83862
83866
|
}
|
|
@@ -83873,13 +83877,13 @@ var require_socksclient = __commonJS({
|
|
|
83873
83877
|
* @returns { Promise }
|
|
83874
83878
|
*/
|
|
83875
83879
|
static createConnectionChain(options2, callback) {
|
|
83876
|
-
return new Promise((
|
|
83880
|
+
return new Promise((resolve59, reject) => __awaiter2(this, void 0, void 0, function* () {
|
|
83877
83881
|
try {
|
|
83878
83882
|
(0, helpers_1.validateSocksClientChainOptions)(options2);
|
|
83879
83883
|
} catch (err) {
|
|
83880
83884
|
if (typeof callback === "function") {
|
|
83881
83885
|
callback(err);
|
|
83882
|
-
return
|
|
83886
|
+
return resolve59(err);
|
|
83883
83887
|
} else {
|
|
83884
83888
|
return reject(err);
|
|
83885
83889
|
}
|
|
@@ -83905,14 +83909,14 @@ var require_socksclient = __commonJS({
|
|
|
83905
83909
|
}
|
|
83906
83910
|
if (typeof callback === "function") {
|
|
83907
83911
|
callback(null, { socket: sock });
|
|
83908
|
-
|
|
83912
|
+
resolve59({ socket: sock });
|
|
83909
83913
|
} else {
|
|
83910
|
-
|
|
83914
|
+
resolve59({ socket: sock });
|
|
83911
83915
|
}
|
|
83912
83916
|
} catch (err) {
|
|
83913
83917
|
if (typeof callback === "function") {
|
|
83914
83918
|
callback(err);
|
|
83915
|
-
|
|
83919
|
+
resolve59(err);
|
|
83916
83920
|
} else {
|
|
83917
83921
|
reject(err);
|
|
83918
83922
|
}
|
|
@@ -84578,12 +84582,12 @@ var init_dist5 = __esm({
|
|
|
84578
84582
|
let { host } = opts;
|
|
84579
84583
|
const { port, lookup: lookupFn = dns.lookup } = opts;
|
|
84580
84584
|
if (shouldLookup) {
|
|
84581
|
-
host = await new Promise((
|
|
84585
|
+
host = await new Promise((resolve59, reject) => {
|
|
84582
84586
|
lookupFn(host, {}, (err, address) => {
|
|
84583
84587
|
if (err) {
|
|
84584
84588
|
reject(err);
|
|
84585
84589
|
} else {
|
|
84586
|
-
|
|
84590
|
+
resolve59(typeof address === "string" ? address : address[0].address);
|
|
84587
84591
|
}
|
|
84588
84592
|
});
|
|
84589
84593
|
});
|
|
@@ -85741,7 +85745,7 @@ var require_netUtils = __commonJS({
|
|
|
85741
85745
|
return `${socket.remoteAddress}:${socket.remotePort}`;
|
|
85742
85746
|
}
|
|
85743
85747
|
function upgradeSocket(socket, options2) {
|
|
85744
|
-
return new Promise((
|
|
85748
|
+
return new Promise((resolve59, reject) => {
|
|
85745
85749
|
const tlsOptions = Object.assign({}, options2, {
|
|
85746
85750
|
socket
|
|
85747
85751
|
});
|
|
@@ -85751,7 +85755,7 @@ var require_netUtils = __commonJS({
|
|
|
85751
85755
|
reject(tlsSocket.authorizationError);
|
|
85752
85756
|
} else {
|
|
85753
85757
|
tlsSocket.removeAllListeners("error");
|
|
85754
|
-
|
|
85758
|
+
resolve59(tlsSocket);
|
|
85755
85759
|
}
|
|
85756
85760
|
}).once("error", (error62) => {
|
|
85757
85761
|
reject(error62);
|
|
@@ -85846,7 +85850,7 @@ var require_transfer = __commonJS({
|
|
|
85846
85850
|
};
|
|
85847
85851
|
}
|
|
85848
85852
|
function connectForPassiveTransfer(host, port, ftp2) {
|
|
85849
|
-
return new Promise((
|
|
85853
|
+
return new Promise((resolve59, reject) => {
|
|
85850
85854
|
let socket = ftp2._newSocket();
|
|
85851
85855
|
const handleConnErr = function(err) {
|
|
85852
85856
|
err.message = "Can't open data connection in passive mode: " + err.message;
|
|
@@ -85874,7 +85878,7 @@ var require_transfer = __commonJS({
|
|
|
85874
85878
|
socket.removeListener("error", handleConnErr);
|
|
85875
85879
|
socket.removeListener("timeout", handleTimeout);
|
|
85876
85880
|
ftp2.dataSocket = socket;
|
|
85877
|
-
|
|
85881
|
+
resolve59();
|
|
85878
85882
|
});
|
|
85879
85883
|
});
|
|
85880
85884
|
}
|
|
@@ -88219,7 +88223,7 @@ var require_util2 = __commonJS({
|
|
|
88219
88223
|
}
|
|
88220
88224
|
path6 = url2.path;
|
|
88221
88225
|
}
|
|
88222
|
-
var
|
|
88226
|
+
var isAbsolute28 = exports2.isAbsolute(path6);
|
|
88223
88227
|
var parts = path6.split(/\/+/);
|
|
88224
88228
|
for (var part, up = 0, i2 = parts.length - 1; i2 >= 0; i2--) {
|
|
88225
88229
|
part = parts[i2];
|
|
@@ -88239,7 +88243,7 @@ var require_util2 = __commonJS({
|
|
|
88239
88243
|
}
|
|
88240
88244
|
path6 = parts.join("/");
|
|
88241
88245
|
if (path6 === "") {
|
|
88242
|
-
path6 =
|
|
88246
|
+
path6 = isAbsolute28 ? "/" : ".";
|
|
88243
88247
|
}
|
|
88244
88248
|
if (url2) {
|
|
88245
88249
|
url2.path = path6;
|
|
@@ -88248,7 +88252,7 @@ var require_util2 = __commonJS({
|
|
|
88248
88252
|
return path6;
|
|
88249
88253
|
}
|
|
88250
88254
|
exports2.normalize = normalize6;
|
|
88251
|
-
function
|
|
88255
|
+
function join83(aRoot, aPath) {
|
|
88252
88256
|
if (aRoot === "") {
|
|
88253
88257
|
aRoot = ".";
|
|
88254
88258
|
}
|
|
@@ -88280,7 +88284,7 @@ var require_util2 = __commonJS({
|
|
|
88280
88284
|
}
|
|
88281
88285
|
return joined;
|
|
88282
88286
|
}
|
|
88283
|
-
exports2.join =
|
|
88287
|
+
exports2.join = join83;
|
|
88284
88288
|
exports2.isAbsolute = function(aPath) {
|
|
88285
88289
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
88286
88290
|
};
|
|
@@ -88453,7 +88457,7 @@ var require_util2 = __commonJS({
|
|
|
88453
88457
|
parsed.path = parsed.path.substring(0, index + 1);
|
|
88454
88458
|
}
|
|
88455
88459
|
}
|
|
88456
|
-
sourceURL =
|
|
88460
|
+
sourceURL = join83(urlGenerate(parsed), sourceURL);
|
|
88457
88461
|
}
|
|
88458
88462
|
return normalize6(sourceURL);
|
|
88459
88463
|
}
|
|
@@ -90255,7 +90259,7 @@ var require_escodegen = __commonJS({
|
|
|
90255
90259
|
function noEmptySpace() {
|
|
90256
90260
|
return space ? space : " ";
|
|
90257
90261
|
}
|
|
90258
|
-
function
|
|
90262
|
+
function join83(left, right) {
|
|
90259
90263
|
var leftSource, rightSource, leftCharCode, rightCharCode;
|
|
90260
90264
|
leftSource = toSourceNodeWhenNeeded(left).toString();
|
|
90261
90265
|
if (leftSource.length === 0) {
|
|
@@ -90586,8 +90590,8 @@ var require_escodegen = __commonJS({
|
|
|
90586
90590
|
} else {
|
|
90587
90591
|
result.push(that.generateExpression(stmt.left, Precedence.Call, E_TTT));
|
|
90588
90592
|
}
|
|
90589
|
-
result =
|
|
90590
|
-
result = [
|
|
90593
|
+
result = join83(result, operator);
|
|
90594
|
+
result = [join83(
|
|
90591
90595
|
result,
|
|
90592
90596
|
that.generateExpression(stmt.right, Precedence.Assignment, E_TTT)
|
|
90593
90597
|
), ")"];
|
|
@@ -90730,11 +90734,11 @@ var require_escodegen = __commonJS({
|
|
|
90730
90734
|
var result, fragment;
|
|
90731
90735
|
result = ["class"];
|
|
90732
90736
|
if (stmt.id) {
|
|
90733
|
-
result =
|
|
90737
|
+
result = join83(result, this.generateExpression(stmt.id, Precedence.Sequence, E_TTT));
|
|
90734
90738
|
}
|
|
90735
90739
|
if (stmt.superClass) {
|
|
90736
|
-
fragment =
|
|
90737
|
-
result =
|
|
90740
|
+
fragment = join83("extends", this.generateExpression(stmt.superClass, Precedence.Unary, E_TTT));
|
|
90741
|
+
result = join83(result, fragment);
|
|
90738
90742
|
}
|
|
90739
90743
|
result.push(space);
|
|
90740
90744
|
result.push(this.generateStatement(stmt.body, S_TFFT));
|
|
@@ -90747,9 +90751,9 @@ var require_escodegen = __commonJS({
|
|
|
90747
90751
|
return escapeDirective(stmt.directive) + this.semicolon(flags);
|
|
90748
90752
|
},
|
|
90749
90753
|
DoWhileStatement: function(stmt, flags) {
|
|
90750
|
-
var result =
|
|
90754
|
+
var result = join83("do", this.maybeBlock(stmt.body, S_TFFF));
|
|
90751
90755
|
result = this.maybeBlockSuffix(stmt.body, result);
|
|
90752
|
-
return
|
|
90756
|
+
return join83(result, [
|
|
90753
90757
|
"while" + space + "(",
|
|
90754
90758
|
this.generateExpression(stmt.test, Precedence.Sequence, E_TTT),
|
|
90755
90759
|
")" + this.semicolon(flags)
|
|
@@ -90785,11 +90789,11 @@ var require_escodegen = __commonJS({
|
|
|
90785
90789
|
ExportDefaultDeclaration: function(stmt, flags) {
|
|
90786
90790
|
var result = ["export"], bodyFlags;
|
|
90787
90791
|
bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF;
|
|
90788
|
-
result =
|
|
90792
|
+
result = join83(result, "default");
|
|
90789
90793
|
if (isStatement(stmt.declaration)) {
|
|
90790
|
-
result =
|
|
90794
|
+
result = join83(result, this.generateStatement(stmt.declaration, bodyFlags));
|
|
90791
90795
|
} else {
|
|
90792
|
-
result =
|
|
90796
|
+
result = join83(result, this.generateExpression(stmt.declaration, Precedence.Assignment, E_TTT) + this.semicolon(flags));
|
|
90793
90797
|
}
|
|
90794
90798
|
return result;
|
|
90795
90799
|
},
|
|
@@ -90797,15 +90801,15 @@ var require_escodegen = __commonJS({
|
|
|
90797
90801
|
var result = ["export"], bodyFlags, that = this;
|
|
90798
90802
|
bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF;
|
|
90799
90803
|
if (stmt.declaration) {
|
|
90800
|
-
return
|
|
90804
|
+
return join83(result, this.generateStatement(stmt.declaration, bodyFlags));
|
|
90801
90805
|
}
|
|
90802
90806
|
if (stmt.specifiers) {
|
|
90803
90807
|
if (stmt.specifiers.length === 0) {
|
|
90804
|
-
result =
|
|
90808
|
+
result = join83(result, "{" + space + "}");
|
|
90805
90809
|
} else if (stmt.specifiers[0].type === Syntax.ExportBatchSpecifier) {
|
|
90806
|
-
result =
|
|
90810
|
+
result = join83(result, this.generateExpression(stmt.specifiers[0], Precedence.Sequence, E_TTT));
|
|
90807
90811
|
} else {
|
|
90808
|
-
result =
|
|
90812
|
+
result = join83(result, "{");
|
|
90809
90813
|
withIndent(function(indent2) {
|
|
90810
90814
|
var i2, iz;
|
|
90811
90815
|
result.push(newline);
|
|
@@ -90823,7 +90827,7 @@ var require_escodegen = __commonJS({
|
|
|
90823
90827
|
result.push(base + "}");
|
|
90824
90828
|
}
|
|
90825
90829
|
if (stmt.source) {
|
|
90826
|
-
result =
|
|
90830
|
+
result = join83(result, [
|
|
90827
90831
|
"from" + space,
|
|
90828
90832
|
// ModuleSpecifier
|
|
90829
90833
|
this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
|
|
@@ -90911,7 +90915,7 @@ var require_escodegen = __commonJS({
|
|
|
90911
90915
|
];
|
|
90912
90916
|
cursor = 0;
|
|
90913
90917
|
if (stmt.specifiers[cursor].type === Syntax.ImportDefaultSpecifier) {
|
|
90914
|
-
result =
|
|
90918
|
+
result = join83(result, [
|
|
90915
90919
|
this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT)
|
|
90916
90920
|
]);
|
|
90917
90921
|
++cursor;
|
|
@@ -90921,7 +90925,7 @@ var require_escodegen = __commonJS({
|
|
|
90921
90925
|
result.push(",");
|
|
90922
90926
|
}
|
|
90923
90927
|
if (stmt.specifiers[cursor].type === Syntax.ImportNamespaceSpecifier) {
|
|
90924
|
-
result =
|
|
90928
|
+
result = join83(result, [
|
|
90925
90929
|
space,
|
|
90926
90930
|
this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT)
|
|
90927
90931
|
]);
|
|
@@ -90950,7 +90954,7 @@ var require_escodegen = __commonJS({
|
|
|
90950
90954
|
}
|
|
90951
90955
|
}
|
|
90952
90956
|
}
|
|
90953
|
-
result =
|
|
90957
|
+
result = join83(result, [
|
|
90954
90958
|
"from" + space,
|
|
90955
90959
|
// ModuleSpecifier
|
|
90956
90960
|
this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
|
|
@@ -91004,7 +91008,7 @@ var require_escodegen = __commonJS({
|
|
|
91004
91008
|
return result;
|
|
91005
91009
|
},
|
|
91006
91010
|
ThrowStatement: function(stmt, flags) {
|
|
91007
|
-
return [
|
|
91011
|
+
return [join83(
|
|
91008
91012
|
"throw",
|
|
91009
91013
|
this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT)
|
|
91010
91014
|
), this.semicolon(flags)];
|
|
@@ -91015,7 +91019,7 @@ var require_escodegen = __commonJS({
|
|
|
91015
91019
|
result = this.maybeBlockSuffix(stmt.block, result);
|
|
91016
91020
|
if (stmt.handlers) {
|
|
91017
91021
|
for (i2 = 0, iz = stmt.handlers.length; i2 < iz; ++i2) {
|
|
91018
|
-
result =
|
|
91022
|
+
result = join83(result, this.generateStatement(stmt.handlers[i2], S_TFFF));
|
|
91019
91023
|
if (stmt.finalizer || i2 + 1 !== iz) {
|
|
91020
91024
|
result = this.maybeBlockSuffix(stmt.handlers[i2].body, result);
|
|
91021
91025
|
}
|
|
@@ -91023,7 +91027,7 @@ var require_escodegen = __commonJS({
|
|
|
91023
91027
|
} else {
|
|
91024
91028
|
guardedHandlers = stmt.guardedHandlers || [];
|
|
91025
91029
|
for (i2 = 0, iz = guardedHandlers.length; i2 < iz; ++i2) {
|
|
91026
|
-
result =
|
|
91030
|
+
result = join83(result, this.generateStatement(guardedHandlers[i2], S_TFFF));
|
|
91027
91031
|
if (stmt.finalizer || i2 + 1 !== iz) {
|
|
91028
91032
|
result = this.maybeBlockSuffix(guardedHandlers[i2].body, result);
|
|
91029
91033
|
}
|
|
@@ -91031,13 +91035,13 @@ var require_escodegen = __commonJS({
|
|
|
91031
91035
|
if (stmt.handler) {
|
|
91032
91036
|
if (Array.isArray(stmt.handler)) {
|
|
91033
91037
|
for (i2 = 0, iz = stmt.handler.length; i2 < iz; ++i2) {
|
|
91034
|
-
result =
|
|
91038
|
+
result = join83(result, this.generateStatement(stmt.handler[i2], S_TFFF));
|
|
91035
91039
|
if (stmt.finalizer || i2 + 1 !== iz) {
|
|
91036
91040
|
result = this.maybeBlockSuffix(stmt.handler[i2].body, result);
|
|
91037
91041
|
}
|
|
91038
91042
|
}
|
|
91039
91043
|
} else {
|
|
91040
|
-
result =
|
|
91044
|
+
result = join83(result, this.generateStatement(stmt.handler, S_TFFF));
|
|
91041
91045
|
if (stmt.finalizer) {
|
|
91042
91046
|
result = this.maybeBlockSuffix(stmt.handler.body, result);
|
|
91043
91047
|
}
|
|
@@ -91045,7 +91049,7 @@ var require_escodegen = __commonJS({
|
|
|
91045
91049
|
}
|
|
91046
91050
|
}
|
|
91047
91051
|
if (stmt.finalizer) {
|
|
91048
|
-
result =
|
|
91052
|
+
result = join83(result, ["finally", this.maybeBlock(stmt.finalizer, S_TFFF)]);
|
|
91049
91053
|
}
|
|
91050
91054
|
return result;
|
|
91051
91055
|
},
|
|
@@ -91079,7 +91083,7 @@ var require_escodegen = __commonJS({
|
|
|
91079
91083
|
withIndent(function() {
|
|
91080
91084
|
if (stmt.test) {
|
|
91081
91085
|
result = [
|
|
91082
|
-
|
|
91086
|
+
join83("case", that.generateExpression(stmt.test, Precedence.Sequence, E_TTT)),
|
|
91083
91087
|
":"
|
|
91084
91088
|
];
|
|
91085
91089
|
} else {
|
|
@@ -91127,9 +91131,9 @@ var require_escodegen = __commonJS({
|
|
|
91127
91131
|
result.push(this.maybeBlock(stmt.consequent, S_TFFF));
|
|
91128
91132
|
result = this.maybeBlockSuffix(stmt.consequent, result);
|
|
91129
91133
|
if (stmt.alternate.type === Syntax.IfStatement) {
|
|
91130
|
-
result =
|
|
91134
|
+
result = join83(result, ["else ", this.generateStatement(stmt.alternate, bodyFlags)]);
|
|
91131
91135
|
} else {
|
|
91132
|
-
result =
|
|
91136
|
+
result = join83(result, join83("else", this.maybeBlock(stmt.alternate, bodyFlags)));
|
|
91133
91137
|
}
|
|
91134
91138
|
} else {
|
|
91135
91139
|
result.push(this.maybeBlock(stmt.consequent, bodyFlags));
|
|
@@ -91230,7 +91234,7 @@ var require_escodegen = __commonJS({
|
|
|
91230
91234
|
},
|
|
91231
91235
|
ReturnStatement: function(stmt, flags) {
|
|
91232
91236
|
if (stmt.argument) {
|
|
91233
|
-
return [
|
|
91237
|
+
return [join83(
|
|
91234
91238
|
"return",
|
|
91235
91239
|
this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT)
|
|
91236
91240
|
), this.semicolon(flags)];
|
|
@@ -91319,14 +91323,14 @@ var require_escodegen = __commonJS({
|
|
|
91319
91323
|
if (leftSource.charCodeAt(leftSource.length - 1) === 47 && esutils.code.isIdentifierPartES5(expr.operator.charCodeAt(0))) {
|
|
91320
91324
|
result = [fragment, noEmptySpace(), expr.operator];
|
|
91321
91325
|
} else {
|
|
91322
|
-
result =
|
|
91326
|
+
result = join83(fragment, expr.operator);
|
|
91323
91327
|
}
|
|
91324
91328
|
fragment = this.generateExpression(expr.right, rightPrecedence, flags);
|
|
91325
91329
|
if (expr.operator === "/" && fragment.toString().charAt(0) === "/" || expr.operator.slice(-1) === "<" && fragment.toString().slice(0, 3) === "!--") {
|
|
91326
91330
|
result.push(noEmptySpace());
|
|
91327
91331
|
result.push(fragment);
|
|
91328
91332
|
} else {
|
|
91329
|
-
result =
|
|
91333
|
+
result = join83(result, fragment);
|
|
91330
91334
|
}
|
|
91331
91335
|
if (expr.operator === "in" && !(flags & F_ALLOW_IN)) {
|
|
91332
91336
|
return ["(", result, ")"];
|
|
@@ -91366,7 +91370,7 @@ var require_escodegen = __commonJS({
|
|
|
91366
91370
|
var result, length, i2, iz, itemFlags;
|
|
91367
91371
|
length = expr["arguments"].length;
|
|
91368
91372
|
itemFlags = flags & F_ALLOW_UNPARATH_NEW && !parentheses && length === 0 ? E_TFT : E_TFF;
|
|
91369
|
-
result =
|
|
91373
|
+
result = join83(
|
|
91370
91374
|
"new",
|
|
91371
91375
|
this.generateExpression(expr.callee, Precedence.New, itemFlags)
|
|
91372
91376
|
);
|
|
@@ -91416,11 +91420,11 @@ var require_escodegen = __commonJS({
|
|
|
91416
91420
|
var result, fragment, rightCharCode, leftSource, leftCharCode;
|
|
91417
91421
|
fragment = this.generateExpression(expr.argument, Precedence.Unary, E_TTT);
|
|
91418
91422
|
if (space === "") {
|
|
91419
|
-
result =
|
|
91423
|
+
result = join83(expr.operator, fragment);
|
|
91420
91424
|
} else {
|
|
91421
91425
|
result = [expr.operator];
|
|
91422
91426
|
if (expr.operator.length > 2) {
|
|
91423
|
-
result =
|
|
91427
|
+
result = join83(result, fragment);
|
|
91424
91428
|
} else {
|
|
91425
91429
|
leftSource = toSourceNodeWhenNeeded(result).toString();
|
|
91426
91430
|
leftCharCode = leftSource.charCodeAt(leftSource.length - 1);
|
|
@@ -91443,7 +91447,7 @@ var require_escodegen = __commonJS({
|
|
|
91443
91447
|
result = "yield";
|
|
91444
91448
|
}
|
|
91445
91449
|
if (expr.argument) {
|
|
91446
|
-
result =
|
|
91450
|
+
result = join83(
|
|
91447
91451
|
result,
|
|
91448
91452
|
this.generateExpression(expr.argument, Precedence.Yield, E_TTT)
|
|
91449
91453
|
);
|
|
@@ -91451,7 +91455,7 @@ var require_escodegen = __commonJS({
|
|
|
91451
91455
|
return parenthesize(result, Precedence.Yield, precedence);
|
|
91452
91456
|
},
|
|
91453
91457
|
AwaitExpression: function(expr, precedence, flags) {
|
|
91454
|
-
var result =
|
|
91458
|
+
var result = join83(
|
|
91455
91459
|
expr.all ? "await*" : "await",
|
|
91456
91460
|
this.generateExpression(expr.argument, Precedence.Await, E_TTT)
|
|
91457
91461
|
);
|
|
@@ -91534,11 +91538,11 @@ var require_escodegen = __commonJS({
|
|
|
91534
91538
|
var result, fragment;
|
|
91535
91539
|
result = ["class"];
|
|
91536
91540
|
if (expr.id) {
|
|
91537
|
-
result =
|
|
91541
|
+
result = join83(result, this.generateExpression(expr.id, Precedence.Sequence, E_TTT));
|
|
91538
91542
|
}
|
|
91539
91543
|
if (expr.superClass) {
|
|
91540
|
-
fragment =
|
|
91541
|
-
result =
|
|
91544
|
+
fragment = join83("extends", this.generateExpression(expr.superClass, Precedence.Unary, E_TTT));
|
|
91545
|
+
result = join83(result, fragment);
|
|
91542
91546
|
}
|
|
91543
91547
|
result.push(space);
|
|
91544
91548
|
result.push(this.generateStatement(expr.body, S_TFFT));
|
|
@@ -91553,7 +91557,7 @@ var require_escodegen = __commonJS({
|
|
|
91553
91557
|
}
|
|
91554
91558
|
if (expr.kind === "get" || expr.kind === "set") {
|
|
91555
91559
|
fragment = [
|
|
91556
|
-
|
|
91560
|
+
join83(expr.kind, this.generatePropertyKey(expr.key, expr.computed)),
|
|
91557
91561
|
this.generateFunctionBody(expr.value)
|
|
91558
91562
|
];
|
|
91559
91563
|
} else {
|
|
@@ -91563,7 +91567,7 @@ var require_escodegen = __commonJS({
|
|
|
91563
91567
|
this.generateFunctionBody(expr.value)
|
|
91564
91568
|
];
|
|
91565
91569
|
}
|
|
91566
|
-
return
|
|
91570
|
+
return join83(result, fragment);
|
|
91567
91571
|
},
|
|
91568
91572
|
Property: function(expr, precedence, flags) {
|
|
91569
91573
|
if (expr.kind === "get" || expr.kind === "set") {
|
|
@@ -91758,7 +91762,7 @@ var require_escodegen = __commonJS({
|
|
|
91758
91762
|
for (i2 = 0, iz = expr.blocks.length; i2 < iz; ++i2) {
|
|
91759
91763
|
fragment = that.generateExpression(expr.blocks[i2], Precedence.Sequence, E_TTT);
|
|
91760
91764
|
if (i2 > 0 || extra.moz.comprehensionExpressionStartsWithAssignment) {
|
|
91761
|
-
result =
|
|
91765
|
+
result = join83(result, fragment);
|
|
91762
91766
|
} else {
|
|
91763
91767
|
result.push(fragment);
|
|
91764
91768
|
}
|
|
@@ -91766,13 +91770,13 @@ var require_escodegen = __commonJS({
|
|
|
91766
91770
|
});
|
|
91767
91771
|
}
|
|
91768
91772
|
if (expr.filter) {
|
|
91769
|
-
result =
|
|
91773
|
+
result = join83(result, "if" + space);
|
|
91770
91774
|
fragment = this.generateExpression(expr.filter, Precedence.Sequence, E_TTT);
|
|
91771
|
-
result =
|
|
91775
|
+
result = join83(result, ["(", fragment, ")"]);
|
|
91772
91776
|
}
|
|
91773
91777
|
if (!extra.moz.comprehensionExpressionStartsWithAssignment) {
|
|
91774
91778
|
fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT);
|
|
91775
|
-
result =
|
|
91779
|
+
result = join83(result, fragment);
|
|
91776
91780
|
}
|
|
91777
91781
|
result.push(expr.type === Syntax.GeneratorExpression ? ")" : "]");
|
|
91778
91782
|
return result;
|
|
@@ -91788,8 +91792,8 @@ var require_escodegen = __commonJS({
|
|
|
91788
91792
|
} else {
|
|
91789
91793
|
fragment = this.generateExpression(expr.left, Precedence.Call, E_TTT);
|
|
91790
91794
|
}
|
|
91791
|
-
fragment =
|
|
91792
|
-
fragment =
|
|
91795
|
+
fragment = join83(fragment, expr.of ? "of" : "in");
|
|
91796
|
+
fragment = join83(fragment, this.generateExpression(expr.right, Precedence.Sequence, E_TTT));
|
|
91793
91797
|
return ["for" + space + "(", fragment, ")"];
|
|
91794
91798
|
},
|
|
91795
91799
|
SpreadElement: function(expr, precedence, flags) {
|
|
@@ -98319,11 +98323,11 @@ function __metadata(metadataKey, metadataValue) {
|
|
|
98319
98323
|
}
|
|
98320
98324
|
function __awaiter(thisArg, _arguments, P2, generator) {
|
|
98321
98325
|
function adopt(value2) {
|
|
98322
|
-
return value2 instanceof P2 ? value2 : new P2(function(
|
|
98323
|
-
|
|
98326
|
+
return value2 instanceof P2 ? value2 : new P2(function(resolve59) {
|
|
98327
|
+
resolve59(value2);
|
|
98324
98328
|
});
|
|
98325
98329
|
}
|
|
98326
|
-
return new (P2 || (P2 = Promise))(function(
|
|
98330
|
+
return new (P2 || (P2 = Promise))(function(resolve59, reject) {
|
|
98327
98331
|
function fulfilled(value2) {
|
|
98328
98332
|
try {
|
|
98329
98333
|
step(generator.next(value2));
|
|
@@ -98339,7 +98343,7 @@ function __awaiter(thisArg, _arguments, P2, generator) {
|
|
|
98339
98343
|
}
|
|
98340
98344
|
}
|
|
98341
98345
|
function step(result) {
|
|
98342
|
-
result.done ?
|
|
98346
|
+
result.done ? resolve59(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
98343
98347
|
}
|
|
98344
98348
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
98345
98349
|
});
|
|
@@ -98530,14 +98534,14 @@ function __asyncValues(o2) {
|
|
|
98530
98534
|
}, i2);
|
|
98531
98535
|
function verb(n3) {
|
|
98532
98536
|
i2[n3] = o2[n3] && function(v2) {
|
|
98533
|
-
return new Promise(function(
|
|
98534
|
-
v2 = o2[n3](v2), settle3(
|
|
98537
|
+
return new Promise(function(resolve59, reject) {
|
|
98538
|
+
v2 = o2[n3](v2), settle3(resolve59, reject, v2.done, v2.value);
|
|
98535
98539
|
});
|
|
98536
98540
|
};
|
|
98537
98541
|
}
|
|
98538
|
-
function settle3(
|
|
98542
|
+
function settle3(resolve59, reject, d2, v2) {
|
|
98539
98543
|
Promise.resolve(v2).then(function(v3) {
|
|
98540
|
-
|
|
98544
|
+
resolve59({ value: v3, done: d2 });
|
|
98541
98545
|
}, reject);
|
|
98542
98546
|
}
|
|
98543
98547
|
}
|
|
@@ -102084,12 +102088,12 @@ var init_dnsDomainLevels = __esm({
|
|
|
102084
102088
|
|
|
102085
102089
|
// ../../../../node_modules/proxy-agent/node_modules/pac-resolver/dist/util.js
|
|
102086
102090
|
function dnsLookup(host, opts) {
|
|
102087
|
-
return new Promise((
|
|
102091
|
+
return new Promise((resolve59, reject) => {
|
|
102088
102092
|
(0, import_dns.lookup)(host, opts, (err, res) => {
|
|
102089
102093
|
if (err) {
|
|
102090
102094
|
reject(err);
|
|
102091
102095
|
} else {
|
|
102092
|
-
|
|
102096
|
+
resolve59(res);
|
|
102093
102097
|
}
|
|
102094
102098
|
});
|
|
102095
102099
|
});
|
|
@@ -102668,10 +102672,10 @@ var init_ip = __esm({
|
|
|
102668
102672
|
|
|
102669
102673
|
// ../../../../node_modules/proxy-agent/node_modules/pac-resolver/dist/myIpAddress.js
|
|
102670
102674
|
async function myIpAddress() {
|
|
102671
|
-
return new Promise((
|
|
102675
|
+
return new Promise((resolve59, reject) => {
|
|
102672
102676
|
const socket = import_net.default.connect({ host: "8.8.8.8", port: 53 });
|
|
102673
102677
|
const onError = () => {
|
|
102674
|
-
|
|
102678
|
+
resolve59(ip.address());
|
|
102675
102679
|
};
|
|
102676
102680
|
socket.once("error", onError);
|
|
102677
102681
|
socket.once("connect", () => {
|
|
@@ -102679,9 +102683,9 @@ async function myIpAddress() {
|
|
|
102679
102683
|
const addr = socket.address();
|
|
102680
102684
|
socket.destroy();
|
|
102681
102685
|
if (typeof addr === "string") {
|
|
102682
|
-
|
|
102686
|
+
resolve59(addr);
|
|
102683
102687
|
} else if (addr.address) {
|
|
102684
|
-
|
|
102688
|
+
resolve59(addr.address);
|
|
102685
102689
|
} else {
|
|
102686
102690
|
reject(new Error("Expected a `string`"));
|
|
102687
102691
|
}
|
|
@@ -105584,12 +105588,12 @@ function lookupDnsAddresses(hostname3, dnsLookup2, signal) {
|
|
|
105584
105588
|
if (!signal)
|
|
105585
105589
|
return lookup3;
|
|
105586
105590
|
throwIfAborted3(signal);
|
|
105587
|
-
return new Promise((
|
|
105591
|
+
return new Promise((resolve59, reject) => {
|
|
105588
105592
|
const onAbort = () => reject(abortReason(signal));
|
|
105589
105593
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
105590
105594
|
lookup3.then((addresses) => {
|
|
105591
105595
|
signal.removeEventListener("abort", onAbort);
|
|
105592
|
-
|
|
105596
|
+
resolve59(addresses);
|
|
105593
105597
|
}, (error62) => {
|
|
105594
105598
|
signal.removeEventListener("abort", onAbort);
|
|
105595
105599
|
reject(error62);
|
|
@@ -105728,7 +105732,7 @@ function fetchHttpResponse(url2, request, signal, proxyUrl, tlsCaCertificates, p
|
|
|
105728
105732
|
const transport = url2.protocol === "https:" ? import_node_https.default : import_node_http.default;
|
|
105729
105733
|
const agent = createRequestAgent(url2, proxyUrl, tlsCaCertificates);
|
|
105730
105734
|
const lookup3 = publicDnsLookup ? createPublicEgressLookup(url2.toString(), publicDnsLookup, { signal }) : void 0;
|
|
105731
|
-
return new Promise((
|
|
105735
|
+
return new Promise((resolve59, reject) => {
|
|
105732
105736
|
const requestOptions = {
|
|
105733
105737
|
agent,
|
|
105734
105738
|
headers: headersToOutgoing(headers),
|
|
@@ -105753,7 +105757,7 @@ function fetchHttpResponse(url2, request, signal, proxyUrl, tlsCaCertificates, p
|
|
|
105753
105757
|
responseHeaders.append(name30, String(value2));
|
|
105754
105758
|
}
|
|
105755
105759
|
}
|
|
105756
|
-
|
|
105760
|
+
resolve59(new Response(import_node_stream2.Readable.toWeb(message), {
|
|
105757
105761
|
headers: responseHeaders,
|
|
105758
105762
|
status: message.statusCode ?? 502,
|
|
105759
105763
|
statusText: message.statusMessage
|
|
@@ -111291,7 +111295,7 @@ var require_image_q = __commonJS({
|
|
|
111291
111295
|
colors,
|
|
111292
111296
|
onProgress
|
|
111293
111297
|
} = {}) {
|
|
111294
|
-
return new Promise((
|
|
111298
|
+
return new Promise((resolve59, reject) => {
|
|
111295
111299
|
const distanceCalculator = colorDistanceFormulaToColorDistance2(colorDistanceFormula);
|
|
111296
111300
|
const paletteQuantizer = paletteQuantizationToPaletteQuantizer2(distanceCalculator, paletteQuantization, colors);
|
|
111297
111301
|
images.forEach((image2) => paletteQuantizer.sample(image2));
|
|
@@ -111301,7 +111305,7 @@ var require_image_q = __commonJS({
|
|
|
111301
111305
|
try {
|
|
111302
111306
|
const result = iterator.next();
|
|
111303
111307
|
if (result.done) {
|
|
111304
|
-
|
|
111308
|
+
resolve59(palette2);
|
|
111305
111309
|
} else {
|
|
111306
111310
|
if (result.value.palette)
|
|
111307
111311
|
palette2 = result.value.palette;
|
|
@@ -111326,7 +111330,7 @@ var require_image_q = __commonJS({
|
|
|
111326
111330
|
imageQuantization,
|
|
111327
111331
|
onProgress
|
|
111328
111332
|
} = {}) {
|
|
111329
|
-
return new Promise((
|
|
111333
|
+
return new Promise((resolve59, reject) => {
|
|
111330
111334
|
const distanceCalculator = colorDistanceFormulaToColorDistance2(colorDistanceFormula);
|
|
111331
111335
|
const imageQuantizer = imageQuantizationToImageQuantizer2(distanceCalculator, imageQuantization);
|
|
111332
111336
|
let outPointContainer;
|
|
@@ -111335,7 +111339,7 @@ var require_image_q = __commonJS({
|
|
|
111335
111339
|
try {
|
|
111336
111340
|
const result = iterator.next();
|
|
111337
111341
|
if (result.done) {
|
|
111338
|
-
|
|
111342
|
+
resolve59(outPointContainer);
|
|
111339
111343
|
} else {
|
|
111340
111344
|
if (result.value.pointContainer) {
|
|
111341
111345
|
outPointContainer = result.value.pointContainer;
|
|
@@ -111763,22 +111767,22 @@ var require_gifutil = __commonJS({
|
|
|
111763
111767
|
}
|
|
111764
111768
|
}
|
|
111765
111769
|
function _readBinary(path6) {
|
|
111766
|
-
return new Promise((
|
|
111770
|
+
return new Promise((resolve59, reject) => {
|
|
111767
111771
|
fs4.readFile(path6, (err, buffer) => {
|
|
111768
111772
|
if (err) {
|
|
111769
111773
|
return reject(err);
|
|
111770
111774
|
}
|
|
111771
|
-
return
|
|
111775
|
+
return resolve59(buffer);
|
|
111772
111776
|
});
|
|
111773
111777
|
});
|
|
111774
111778
|
}
|
|
111775
111779
|
function _writeBinary(path6, buffer) {
|
|
111776
|
-
return new Promise((
|
|
111780
|
+
return new Promise((resolve59, reject) => {
|
|
111777
111781
|
fs4.writeFile(path6, buffer, (err) => {
|
|
111778
111782
|
if (err) {
|
|
111779
111783
|
return reject(err);
|
|
111780
111784
|
}
|
|
111781
|
-
return
|
|
111785
|
+
return resolve59();
|
|
111782
111786
|
});
|
|
111783
111787
|
});
|
|
111784
111788
|
}
|
|
@@ -127559,9 +127563,9 @@ var init_Deferred = __esm({
|
|
|
127559
127563
|
constructor() {
|
|
127560
127564
|
this.resolve = () => null;
|
|
127561
127565
|
this.reject = () => null;
|
|
127562
|
-
this.promise = new Promise((
|
|
127566
|
+
this.promise = new Promise((resolve59, reject) => {
|
|
127563
127567
|
this.reject = reject;
|
|
127564
|
-
this.resolve =
|
|
127568
|
+
this.resolve = resolve59;
|
|
127565
127569
|
});
|
|
127566
127570
|
}
|
|
127567
127571
|
};
|
|
@@ -129902,7 +129906,7 @@ function readByobReaderWithSignal(reader, buffer, signal) {
|
|
|
129902
129906
|
return reader.read(buffer);
|
|
129903
129907
|
}
|
|
129904
129908
|
signal.throwIfAborted();
|
|
129905
|
-
return new Promise((
|
|
129909
|
+
return new Promise((resolve59, reject) => {
|
|
129906
129910
|
const cleanup = () => {
|
|
129907
129911
|
signal.removeEventListener("abort", onAbort);
|
|
129908
129912
|
};
|
|
@@ -129922,7 +129926,7 @@ function readByobReaderWithSignal(reader, buffer, signal) {
|
|
|
129922
129926
|
try {
|
|
129923
129927
|
const result = await reader.read(buffer);
|
|
129924
129928
|
cleanup();
|
|
129925
|
-
|
|
129929
|
+
resolve59(result);
|
|
129926
129930
|
} catch (error62) {
|
|
129927
129931
|
cleanup();
|
|
129928
129932
|
reject(error62);
|
|
@@ -131843,7 +131847,7 @@ var init_file_type = __esm({
|
|
|
131843
131847
|
const { signal } = this.options;
|
|
131844
131848
|
const normalizedSampleSize = normalizeSampleSize(sampleSize);
|
|
131845
131849
|
signal?.throwIfAborted();
|
|
131846
|
-
return new Promise((
|
|
131850
|
+
return new Promise((resolve59, reject) => {
|
|
131847
131851
|
let isSettled = false;
|
|
131848
131852
|
const cleanup = () => {
|
|
131849
131853
|
readableStream.off("error", onError);
|
|
@@ -131883,7 +131887,7 @@ var init_file_type = __esm({
|
|
|
131883
131887
|
settle3(reject, error62);
|
|
131884
131888
|
}
|
|
131885
131889
|
}
|
|
131886
|
-
settle3(
|
|
131890
|
+
settle3(resolve59, outputStream);
|
|
131887
131891
|
} catch (error62) {
|
|
131888
131892
|
settle3(reject, error62);
|
|
131889
131893
|
}
|
|
@@ -143058,12 +143062,12 @@ var require_parser3 = __commonJS({
|
|
|
143058
143062
|
};
|
|
143059
143063
|
Parser4.prototype.parseStringPromise = function(str) {
|
|
143060
143064
|
return new Promise(/* @__PURE__ */ (function(_this) {
|
|
143061
|
-
return function(
|
|
143065
|
+
return function(resolve59, reject) {
|
|
143062
143066
|
return _this.parseString(str, function(err, value2) {
|
|
143063
143067
|
if (err) {
|
|
143064
143068
|
return reject(err);
|
|
143065
143069
|
} else {
|
|
143066
|
-
return
|
|
143070
|
+
return resolve59(value2);
|
|
143067
143071
|
}
|
|
143068
143072
|
});
|
|
143069
143073
|
};
|
|
@@ -177449,7 +177453,7 @@ async function normalizeFetchRequest(input2, init) {
|
|
|
177449
177453
|
}
|
|
177450
177454
|
function fetchWithAgent(request, options2) {
|
|
177451
177455
|
const transport = request.url.protocol === "https:" ? import_node_https2.default : import_node_http2.default;
|
|
177452
|
-
return new Promise((
|
|
177456
|
+
return new Promise((resolve59, reject) => {
|
|
177453
177457
|
const signal = request.signal ?? void 0;
|
|
177454
177458
|
if (signal?.aborted) {
|
|
177455
177459
|
reject(abortReason2(signal));
|
|
@@ -177514,7 +177518,7 @@ function fetchWithAgent(request, options2) {
|
|
|
177514
177518
|
}
|
|
177515
177519
|
}
|
|
177516
177520
|
settled = true;
|
|
177517
|
-
|
|
177521
|
+
resolve59(new Response(import_node_stream4.Readable.toWeb(message), {
|
|
177518
177522
|
headers,
|
|
177519
177523
|
status: message.statusCode ?? 502,
|
|
177520
177524
|
statusText: message.statusMessage
|
|
@@ -177827,8 +177831,8 @@ async function consumeBusinessErrorResponseBodyBestEffort(response) {
|
|
|
177827
177831
|
try {
|
|
177828
177832
|
await Promise.race([
|
|
177829
177833
|
response.arrayBuffer().then(() => void 0),
|
|
177830
|
-
new Promise((
|
|
177831
|
-
timeout = setTimeout(
|
|
177834
|
+
new Promise((resolve59) => {
|
|
177835
|
+
timeout = setTimeout(resolve59, PROVIDER_BUSINESS_ERROR_BODY_CLEANUP_TIMEOUT_MS);
|
|
177832
177836
|
})
|
|
177833
177837
|
]);
|
|
177834
177838
|
} catch {
|
|
@@ -198050,8 +198054,8 @@ async function settleModelIOValue(value2) {
|
|
|
198050
198054
|
async function settleModelIOValueWithTimeout(value2, timeoutMs2) {
|
|
198051
198055
|
let timer;
|
|
198052
198056
|
try {
|
|
198053
|
-
const timeout = new Promise((
|
|
198054
|
-
timer = setTimeout(() =>
|
|
198057
|
+
const timeout = new Promise((resolve59) => {
|
|
198058
|
+
timer = setTimeout(() => resolve59(void 0), timeoutMs2);
|
|
198055
198059
|
if (typeof timer === "object" && "unref" in timer) {
|
|
198056
198060
|
timer.unref();
|
|
198057
198061
|
}
|
|
@@ -198506,12 +198510,12 @@ async function sleep5(delayMs, abortSignal) {
|
|
|
198506
198510
|
}
|
|
198507
198511
|
return;
|
|
198508
198512
|
}
|
|
198509
|
-
await new Promise((
|
|
198513
|
+
await new Promise((resolve59, reject) => {
|
|
198510
198514
|
if (abortSignal?.aborted) {
|
|
198511
198515
|
reject(createAbortError5(abortSignal));
|
|
198512
198516
|
return;
|
|
198513
198517
|
}
|
|
198514
|
-
const timeout = setTimeout(
|
|
198518
|
+
const timeout = setTimeout(resolve59, delayMs);
|
|
198515
198519
|
const onAbort = () => {
|
|
198516
198520
|
clearTimeout(timeout);
|
|
198517
198521
|
reject(createAbortError5(abortSignal));
|
|
@@ -198792,13 +198796,13 @@ async function waitForHeaders(run2, signal) {
|
|
|
198792
198796
|
if (!signal)
|
|
198793
198797
|
return run2();
|
|
198794
198798
|
signal.throwIfAborted();
|
|
198795
|
-
return new Promise((
|
|
198799
|
+
return new Promise((resolve59, reject) => {
|
|
198796
198800
|
const onAbort = () => reject(signal.reason);
|
|
198797
198801
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
198798
198802
|
Promise.resolve().then(() => {
|
|
198799
198803
|
signal.throwIfAborted();
|
|
198800
198804
|
return run2();
|
|
198801
|
-
}).then(
|
|
198805
|
+
}).then(resolve59, reject).finally(() => signal.removeEventListener("abort", onAbort));
|
|
198802
198806
|
});
|
|
198803
198807
|
}
|
|
198804
198808
|
var RuntimeHeadersRefreshError;
|
|
@@ -199546,7 +199550,7 @@ function waitForGenerateTextOrAbort(pending, abortSignal) {
|
|
|
199546
199550
|
if (!abortSignal) {
|
|
199547
199551
|
return pending;
|
|
199548
199552
|
}
|
|
199549
|
-
return new Promise((
|
|
199553
|
+
return new Promise((resolve59, reject) => {
|
|
199550
199554
|
const cleanup = () => {
|
|
199551
199555
|
abortSignal.removeEventListener("abort", onAbort);
|
|
199552
199556
|
};
|
|
@@ -199561,7 +199565,7 @@ function waitForGenerateTextOrAbort(pending, abortSignal) {
|
|
|
199561
199565
|
abortSignal.addEventListener("abort", onAbort, { once: true });
|
|
199562
199566
|
pending.then((value2) => {
|
|
199563
199567
|
cleanup();
|
|
199564
|
-
|
|
199568
|
+
resolve59(value2);
|
|
199565
199569
|
}, (error62) => {
|
|
199566
199570
|
cleanup();
|
|
199567
199571
|
reject(error62);
|
|
@@ -200410,8 +200414,8 @@ async function closeStreamIteratorBestEffort(streamIterator, options2) {
|
|
|
200410
200414
|
results,
|
|
200411
200415
|
type: "settled"
|
|
200412
200416
|
})),
|
|
200413
|
-
new Promise((
|
|
200414
|
-
timeout = setTimeout(() =>
|
|
200417
|
+
new Promise((resolve59) => {
|
|
200418
|
+
timeout = setTimeout(() => resolve59({ type: "timed_out" }), STREAM_ATTEMPT_CLEANUP_TIMEOUT_MS);
|
|
200415
200419
|
})
|
|
200416
200420
|
]);
|
|
200417
200421
|
if (timeout !== void 0)
|
|
@@ -210082,7 +210086,7 @@ function tryParseUrl(input2) {
|
|
|
210082
210086
|
return null;
|
|
210083
210087
|
}
|
|
210084
210088
|
}
|
|
210085
|
-
var import_node_fs30, import_promises38, import_node_os18, import_node_path50,
|
|
210089
|
+
var import_node_fs30, import_promises38, import_node_os18, import_node_path50, import_node_child_process10, import_node_util6, execFileAsync2, KNOWN_MARKETPLACES_FILE, INSTALLED_PLUGINS_FILE, MARKETPLACE_FILE, MARKETPLACE_JSON_MAX_BYTES, MARKETPLACE_JSON_MAX_REDIRECTS, MARKETPLACE_JSON_TIMEOUT_MS, CLAUDE_MARKETPLACE_FILE, DCODE_MANIFEST_PATH, CLAUDE_MANIFEST_PATH, CODEX_MANIFEST_PATH, DEFAULT_VERSION, GIT_CLONE_MAX_ATTEMPTS, GIT_COMMAND_TIMEOUT_MS, GIT_CLONE_RETRY_DELAY_MS, MARKETPLACE_NAME_PATTERN, PLUGIN_NAME_PATTERN, SOURCE_SHA256_PATTERN, UNSUPPORTED_MANIFEST_FIELDS, UnsupportedMarketplaceSourceError, UnsupportedPluginSourceError;
|
|
210086
210090
|
var init_marketplace = __esm({
|
|
210087
210091
|
"../adapters/dist/plugins/marketplace.js"() {
|
|
210088
210092
|
"use strict";
|
|
@@ -210090,7 +210094,7 @@ var init_marketplace = __esm({
|
|
|
210090
210094
|
import_promises38 = require("node:fs/promises");
|
|
210091
210095
|
import_node_os18 = require("node:os");
|
|
210092
210096
|
import_node_path50 = require("node:path");
|
|
210093
|
-
|
|
210097
|
+
import_node_child_process10 = require("node:child_process");
|
|
210094
210098
|
import_node_util6 = require("node:util");
|
|
210095
210099
|
init_dist();
|
|
210096
210100
|
init_src3();
|
|
@@ -210104,7 +210108,7 @@ var init_marketplace = __esm({
|
|
|
210104
210108
|
init_atomic_directory();
|
|
210105
210109
|
init_github_archive_source();
|
|
210106
210110
|
init_source_errors();
|
|
210107
|
-
execFileAsync2 = (0, import_node_util6.promisify)(
|
|
210111
|
+
execFileAsync2 = (0, import_node_util6.promisify)(import_node_child_process10.execFile);
|
|
210108
210112
|
KNOWN_MARKETPLACES_FILE = "known_marketplaces.json";
|
|
210109
210113
|
INSTALLED_PLUGINS_FILE = "installed_plugins.json";
|
|
210110
210114
|
MARKETPLACE_FILE = "marketplace.json";
|
|
@@ -212079,9 +212083,9 @@ function comparePluginVersions(input2) {
|
|
|
212079
212083
|
return installed === latest ? "none" : "version-changed";
|
|
212080
212084
|
}
|
|
212081
212085
|
function comparePluginUpdate(input2) {
|
|
212082
|
-
const { installedVersion, installedSha, latestVersion, latestSha } = input2;
|
|
212083
|
-
if (
|
|
212084
|
-
return comparePluginVersions({ installed: installedVersion, latest:
|
|
212086
|
+
const { installedVersion, installedSha, latestVersion: latestVersion2, latestSha } = input2;
|
|
212087
|
+
if (latestVersion2) {
|
|
212088
|
+
return comparePluginVersions({ installed: installedVersion, latest: latestVersion2 });
|
|
212085
212089
|
}
|
|
212086
212090
|
if (latestSha) {
|
|
212087
212091
|
if (!installedSha)
|
|
@@ -212820,7 +212824,7 @@ var init_bigmodel_oauth = __esm({
|
|
|
212820
212824
|
async function openUrlInBrowser(url2, options2 = {}) {
|
|
212821
212825
|
const platform4 = options2.platform ?? process.platform;
|
|
212822
212826
|
const command = browserOpenCommand(platform4, url2);
|
|
212823
|
-
const spawnProcess = options2.spawnProcess ??
|
|
212827
|
+
const spawnProcess = options2.spawnProcess ?? import_node_child_process11.spawn;
|
|
212824
212828
|
try {
|
|
212825
212829
|
const child = spawnProcess(command.executable, command.args, {
|
|
212826
212830
|
detached: true,
|
|
@@ -212846,7 +212850,7 @@ function browserOpenCommand(platform4, url2) {
|
|
|
212846
212850
|
return { executable: "xdg-open", args: [url2] };
|
|
212847
212851
|
}
|
|
212848
212852
|
function waitForBrowserSpawn(child, command, timeoutMs2 = BROWSER_OPEN_SETTLE_TIMEOUT_MS) {
|
|
212849
|
-
return new Promise((
|
|
212853
|
+
return new Promise((resolve59) => {
|
|
212850
212854
|
let settled = false;
|
|
212851
212855
|
let timeout;
|
|
212852
212856
|
const settle3 = (result) => {
|
|
@@ -212859,7 +212863,7 @@ function waitForBrowserSpawn(child, command, timeoutMs2 = BROWSER_OPEN_SETTLE_TI
|
|
|
212859
212863
|
if (result.opened) {
|
|
212860
212864
|
child.unref();
|
|
212861
212865
|
}
|
|
212862
|
-
|
|
212866
|
+
resolve59(result);
|
|
212863
212867
|
};
|
|
212864
212868
|
timeout = setTimeout(() => {
|
|
212865
212869
|
settle3({ command, opened: true });
|
|
@@ -212876,11 +212880,11 @@ function waitForBrowserSpawn(child, command, timeoutMs2 = BROWSER_OPEN_SETTLE_TI
|
|
|
212876
212880
|
});
|
|
212877
212881
|
});
|
|
212878
212882
|
}
|
|
212879
|
-
var
|
|
212883
|
+
var import_node_child_process11, BROWSER_OPEN_SETTLE_TIMEOUT_MS;
|
|
212880
212884
|
var init_browser = __esm({
|
|
212881
212885
|
"../adapters/dist/auth/browser.js"() {
|
|
212882
212886
|
"use strict";
|
|
212883
|
-
|
|
212887
|
+
import_node_child_process11 = require("node:child_process");
|
|
212884
212888
|
BROWSER_OPEN_SETTLE_TIMEOUT_MS = 1e3;
|
|
212885
212889
|
}
|
|
212886
212890
|
});
|
|
@@ -213275,8 +213279,8 @@ async function createLocalhostOAuthCallbackServer(input2) {
|
|
|
213275
213279
|
let resolveCallback = () => void 0;
|
|
213276
213280
|
let rejectCallback = () => void 0;
|
|
213277
213281
|
let settled = false;
|
|
213278
|
-
const callbackPromise = new Promise((
|
|
213279
|
-
resolveCallback =
|
|
213282
|
+
const callbackPromise = new Promise((resolve59, reject) => {
|
|
213283
|
+
resolveCallback = resolve59;
|
|
213280
213284
|
rejectCallback = reject;
|
|
213281
213285
|
});
|
|
213282
213286
|
const server2 = (0, import_node_http3.createServer)((request, response) => {
|
|
@@ -213325,11 +213329,11 @@ async function createLocalhostOAuthCallbackServer(input2) {
|
|
|
213325
213329
|
}
|
|
213326
213330
|
}
|
|
213327
213331
|
});
|
|
213328
|
-
await new Promise((
|
|
213332
|
+
await new Promise((resolve59, reject) => {
|
|
213329
213333
|
server2.once("error", reject);
|
|
213330
213334
|
server2.listen(0, LOCALHOST, () => {
|
|
213331
213335
|
server2.off("error", reject);
|
|
213332
|
-
|
|
213336
|
+
resolve59();
|
|
213333
213337
|
});
|
|
213334
213338
|
});
|
|
213335
213339
|
const address = server2.address();
|
|
@@ -213357,13 +213361,13 @@ function closeServer(server2) {
|
|
|
213357
213361
|
if (!server2.listening) {
|
|
213358
213362
|
return Promise.resolve();
|
|
213359
213363
|
}
|
|
213360
|
-
return new Promise((
|
|
213364
|
+
return new Promise((resolve59, reject) => {
|
|
213361
213365
|
server2.close((error62) => {
|
|
213362
213366
|
if (error62) {
|
|
213363
213367
|
reject(error62);
|
|
213364
213368
|
return;
|
|
213365
213369
|
}
|
|
213366
|
-
|
|
213370
|
+
resolve59();
|
|
213367
213371
|
});
|
|
213368
213372
|
});
|
|
213369
213373
|
}
|
|
@@ -214386,7 +214390,7 @@ async function executeManagedPageCommand(page, command) {
|
|
|
214386
214390
|
case "playwright":
|
|
214387
214391
|
return await executeManagedPlaywrightAction(page, command.action);
|
|
214388
214392
|
case "playwrightWaitForTimeout":
|
|
214389
|
-
await new Promise((
|
|
214393
|
+
await new Promise((resolve59) => setTimeout(resolve59, command.timeoutMs));
|
|
214390
214394
|
return { ok: true };
|
|
214391
214395
|
default:
|
|
214392
214396
|
return {
|
|
@@ -214415,10 +214419,10 @@ function abortError() {
|
|
|
214415
214419
|
async function raceWithAbort(promise2, signal) {
|
|
214416
214420
|
if (signal.aborted)
|
|
214417
214421
|
throw abortError();
|
|
214418
|
-
return await new Promise((
|
|
214422
|
+
return await new Promise((resolve59, reject) => {
|
|
214419
214423
|
const onAbort = () => reject(abortError());
|
|
214420
214424
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
214421
|
-
promise2.then(
|
|
214425
|
+
promise2.then(resolve59, reject).finally(() => signal.removeEventListener("abort", onAbort));
|
|
214422
214426
|
});
|
|
214423
214427
|
}
|
|
214424
214428
|
function hasSideEffects(command) {
|
|
@@ -214596,7 +214600,7 @@ function createManagedCdpBrowserRuntime(options2 = {}) {
|
|
|
214596
214600
|
};
|
|
214597
214601
|
}
|
|
214598
214602
|
function waitForPromise2(promise2, timeoutMs2) {
|
|
214599
|
-
return new Promise((
|
|
214603
|
+
return new Promise((resolve59) => {
|
|
214600
214604
|
let settled = false;
|
|
214601
214605
|
let timer;
|
|
214602
214606
|
const finish = (completed) => {
|
|
@@ -214605,7 +214609,7 @@ function waitForPromise2(promise2, timeoutMs2) {
|
|
|
214605
214609
|
settled = true;
|
|
214606
214610
|
if (timer)
|
|
214607
214611
|
clearTimeout(timer);
|
|
214608
|
-
|
|
214612
|
+
resolve59(completed);
|
|
214609
214613
|
};
|
|
214610
214614
|
timer = setTimeout(() => finish(false), timeoutMs2);
|
|
214611
214615
|
void promise2.then(() => finish(true), () => finish(true));
|
|
@@ -218410,14 +218414,14 @@ function inputRequiredRoundsExceededMessage(method, maxRounds) {
|
|
|
218410
218414
|
return `Multi-round-trip request '${method}' still required input after ${maxRounds} rounds (inputRequired.maxRounds)`;
|
|
218411
218415
|
}
|
|
218412
218416
|
function sleep6(ms, signal) {
|
|
218413
|
-
return new Promise((
|
|
218417
|
+
return new Promise((resolve59, reject) => {
|
|
218414
218418
|
if (signal?.aborted) {
|
|
218415
218419
|
reject(signal.reason instanceof SdkError ? signal.reason : new SdkError(SdkErrorCode.RequestTimeout, String(signal.reason)));
|
|
218416
218420
|
return;
|
|
218417
218421
|
}
|
|
218418
218422
|
const timer = setTimeout(() => {
|
|
218419
218423
|
signal?.removeEventListener("abort", onAbort);
|
|
218420
|
-
|
|
218424
|
+
resolve59();
|
|
218421
218425
|
}, ms);
|
|
218422
218426
|
const onAbort = () => {
|
|
218423
218427
|
clearTimeout(timer);
|
|
@@ -220327,7 +220331,7 @@ var init_src_D_zzAWoS = __esm({
|
|
|
220327
220331
|
const flowStartedAt = Date.now();
|
|
220328
220332
|
let onAbort;
|
|
220329
220333
|
let cleanupMessageId;
|
|
220330
|
-
return new Promise((
|
|
220334
|
+
return new Promise((resolve59, reject) => {
|
|
220331
220335
|
const earlyReject = (error62) => {
|
|
220332
220336
|
reject(error62);
|
|
220333
220337
|
};
|
|
@@ -220395,7 +220399,7 @@ var init_src_D_zzAWoS = __esm({
|
|
|
220395
220399
|
}
|
|
220396
220400
|
if (decoded.kind === "invalid") return reject(decoded.error);
|
|
220397
220401
|
if (decoded.kind === "input_required") {
|
|
220398
|
-
if (options2?.allowInputRequired === true) return
|
|
220402
|
+
if (options2?.allowInputRequired === true) return resolve59(manualInputRequiredValue(decoded));
|
|
220399
220403
|
const flow = {
|
|
220400
220404
|
codec: codec2,
|
|
220401
220405
|
request,
|
|
@@ -220407,11 +220411,11 @@ var init_src_D_zzAWoS = __esm({
|
|
|
220407
220411
|
params
|
|
220408
220412
|
}, resultSchema, legOptions)
|
|
220409
220413
|
};
|
|
220410
|
-
return
|
|
220414
|
+
return resolve59(this._resolveNonCompleteResult(decoded, flow));
|
|
220411
220415
|
}
|
|
220412
220416
|
const result = decoded.result;
|
|
220413
220417
|
validateStandardSchema(resultSchema, result).then((parseResult) => {
|
|
220414
|
-
if (parseResult.success)
|
|
220418
|
+
if (parseResult.success) resolve59(parseResult.data);
|
|
220415
220419
|
else reject(new SdkError(SdkErrorCode.InvalidResult, `Invalid result for ${request.method}: ${parseResult.error}`));
|
|
220416
220420
|
}, reject);
|
|
220417
220421
|
});
|
|
@@ -223226,7 +223230,7 @@ var init_ajvProvider_97rDpkRx = __esm({
|
|
|
223226
223230
|
ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);
|
|
223227
223231
|
const schOrFunc = root3.refs[ref];
|
|
223228
223232
|
if (schOrFunc) return schOrFunc;
|
|
223229
|
-
let _sch =
|
|
223233
|
+
let _sch = resolve59.call(this, root3, ref);
|
|
223230
223234
|
if (_sch === void 0) {
|
|
223231
223235
|
const schema = (_a39 = root3.localRefs) === null || _a39 === void 0 ? void 0 : _a39[ref];
|
|
223232
223236
|
const { schemaId } = this.opts;
|
|
@@ -223252,7 +223256,7 @@ var init_ajvProvider_97rDpkRx = __esm({
|
|
|
223252
223256
|
function sameSchemaEnv(s1, s2) {
|
|
223253
223257
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
223254
223258
|
}
|
|
223255
|
-
function
|
|
223259
|
+
function resolve59(root3, ref) {
|
|
223256
223260
|
let sch;
|
|
223257
223261
|
while (typeof (sch = this.refs[ref]) == "string") ref = sch;
|
|
223258
223262
|
return sch || this.schemas[ref] || resolveSchema.call(this, root3, ref);
|
|
@@ -223702,7 +223706,7 @@ var init_ajvProvider_97rDpkRx = __esm({
|
|
|
223702
223706
|
else if (typeof uri === "object") uri = parse6(serialize(uri, options2), options2);
|
|
223703
223707
|
return uri;
|
|
223704
223708
|
}
|
|
223705
|
-
function
|
|
223709
|
+
function resolve59(baseURI, relativeURI, options2) {
|
|
223706
223710
|
const schemelessOptions = options2 ? Object.assign({ scheme: "null" }, options2) : { scheme: "null" };
|
|
223707
223711
|
const resolved = resolveComponent(parse6(baseURI, schemelessOptions), parse6(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
223708
223712
|
schemelessOptions.skipEscape = true;
|
|
@@ -223876,7 +223880,7 @@ var init_ajvProvider_97rDpkRx = __esm({
|
|
|
223876
223880
|
const fastUri = {
|
|
223877
223881
|
SCHEMES,
|
|
223878
223882
|
normalize: normalize6,
|
|
223879
|
-
resolve:
|
|
223883
|
+
resolve: resolve59,
|
|
223880
223884
|
resolveComponent,
|
|
223881
223885
|
equal,
|
|
223882
223886
|
serialize,
|
|
@@ -229754,14 +229758,14 @@ var init_dist30 = __esm({
|
|
|
229754
229758
|
*/
|
|
229755
229759
|
async exchange(buildRequest, timeoutMs2) {
|
|
229756
229760
|
const id = `server-discover-probe-${++this._probeCounter}`;
|
|
229757
|
-
return new Promise((
|
|
229761
|
+
return new Promise((resolve59) => {
|
|
229758
229762
|
let settled = false;
|
|
229759
229763
|
const settle3 = (reply) => {
|
|
229760
229764
|
if (settled) return;
|
|
229761
229765
|
settled = true;
|
|
229762
229766
|
clearTimeout(timer);
|
|
229763
229767
|
if (this._pending?.id === id) this._pending = void 0;
|
|
229764
|
-
|
|
229768
|
+
resolve59(reply);
|
|
229765
229769
|
};
|
|
229766
229770
|
const timer = setTimeout(() => settle3({ kind: "timeout" }), timeoutMs2);
|
|
229767
229771
|
this._pending = {
|
|
@@ -230761,13 +230765,13 @@ var init_dist30 = __esm({
|
|
|
230761
230765
|
let onCallerAbort;
|
|
230762
230766
|
let resolveOpening;
|
|
230763
230767
|
let rejectOpening;
|
|
230764
|
-
const opening = new Promise((
|
|
230765
|
-
resolveOpening =
|
|
230768
|
+
const opening = new Promise((resolve59, reject) => {
|
|
230769
|
+
resolveOpening = resolve59;
|
|
230766
230770
|
rejectOpening = reject;
|
|
230767
230771
|
});
|
|
230768
230772
|
let resolveClosed;
|
|
230769
|
-
const closed = new Promise((
|
|
230770
|
-
resolveClosed =
|
|
230773
|
+
const closed = new Promise((resolve59) => {
|
|
230774
|
+
resolveClosed = resolve59;
|
|
230771
230775
|
});
|
|
230772
230776
|
const settle3 = (outcome) => {
|
|
230773
230777
|
if (state === "closed") return;
|
|
@@ -231247,7 +231251,7 @@ var init_dist30 = __esm({
|
|
|
231247
231251
|
}
|
|
231248
231252
|
_startOrAuth() {
|
|
231249
231253
|
const fetchImpl = this?._eventSourceInit?.fetch ?? this._fetch ?? fetch;
|
|
231250
|
-
return new Promise((
|
|
231254
|
+
return new Promise((resolve59, reject) => {
|
|
231251
231255
|
this._eventSource = new EventSource(this._url.href, {
|
|
231252
231256
|
...this._eventSourceInit,
|
|
231253
231257
|
fetch: async (url2, init) => {
|
|
@@ -231279,7 +231283,7 @@ var init_dist30 = __esm({
|
|
|
231279
231283
|
response,
|
|
231280
231284
|
serverUrl: this._url,
|
|
231281
231285
|
fetchFn: this._fetchWithInit
|
|
231282
|
-
}).then(() => this._startOrAuth().then(
|
|
231286
|
+
}).then(() => this._startOrAuth().then(resolve59, reject), (error$2) => {
|
|
231283
231287
|
markAuthSeamEscape(error$2);
|
|
231284
231288
|
this.onerror?.(error$2);
|
|
231285
231289
|
reject(error$2);
|
|
@@ -231308,7 +231312,7 @@ var init_dist30 = __esm({
|
|
|
231308
231312
|
this.close();
|
|
231309
231313
|
return;
|
|
231310
231314
|
}
|
|
231311
|
-
|
|
231315
|
+
resolve59();
|
|
231312
231316
|
});
|
|
231313
231317
|
this._eventSource.onmessage = (event) => {
|
|
231314
231318
|
const messageEvent = event;
|
|
@@ -232058,12 +232062,12 @@ var require_isexe = __commonJS({
|
|
|
232058
232062
|
if (typeof Promise !== "function") {
|
|
232059
232063
|
throw new TypeError("callback not provided");
|
|
232060
232064
|
}
|
|
232061
|
-
return new Promise(function(
|
|
232065
|
+
return new Promise(function(resolve59, reject) {
|
|
232062
232066
|
isexe(path6, options2 || {}, function(er, is) {
|
|
232063
232067
|
if (er) {
|
|
232064
232068
|
reject(er);
|
|
232065
232069
|
} else {
|
|
232066
|
-
|
|
232070
|
+
resolve59(is);
|
|
232067
232071
|
}
|
|
232068
232072
|
});
|
|
232069
232073
|
});
|
|
@@ -232129,27 +232133,27 @@ var require_which = __commonJS({
|
|
|
232129
232133
|
opt = {};
|
|
232130
232134
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
232131
232135
|
const found = [];
|
|
232132
|
-
const step = (i2) => new Promise((
|
|
232136
|
+
const step = (i2) => new Promise((resolve59, reject) => {
|
|
232133
232137
|
if (i2 === pathEnv.length)
|
|
232134
|
-
return opt.all && found.length ?
|
|
232138
|
+
return opt.all && found.length ? resolve59(found) : reject(getNotFoundError(cmd));
|
|
232135
232139
|
const ppRaw = pathEnv[i2];
|
|
232136
232140
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
232137
232141
|
const pCmd = path6.join(pathPart, cmd);
|
|
232138
232142
|
const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
232139
|
-
|
|
232143
|
+
resolve59(subStep(p2, i2, 0));
|
|
232140
232144
|
});
|
|
232141
|
-
const subStep = (p2, i2, ii) => new Promise((
|
|
232145
|
+
const subStep = (p2, i2, ii) => new Promise((resolve59, reject) => {
|
|
232142
232146
|
if (ii === pathExt.length)
|
|
232143
|
-
return
|
|
232147
|
+
return resolve59(step(i2 + 1));
|
|
232144
232148
|
const ext = pathExt[ii];
|
|
232145
232149
|
isexe(p2 + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
232146
232150
|
if (!er && is) {
|
|
232147
232151
|
if (opt.all)
|
|
232148
232152
|
found.push(p2 + ext);
|
|
232149
232153
|
else
|
|
232150
|
-
return
|
|
232154
|
+
return resolve59(p2 + ext);
|
|
232151
232155
|
}
|
|
232152
|
-
return
|
|
232156
|
+
return resolve59(subStep(p2, i2, ii + 1));
|
|
232153
232157
|
});
|
|
232154
232158
|
});
|
|
232155
232159
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -232441,7 +232445,7 @@ var require_cross_spawn = __commonJS({
|
|
|
232441
232445
|
var cp2 = require("child_process");
|
|
232442
232446
|
var parse6 = require_parse2();
|
|
232443
232447
|
var enoent = require_enoent();
|
|
232444
|
-
function
|
|
232448
|
+
function spawn14(command, args, options2) {
|
|
232445
232449
|
const parsed = parse6(command, args, options2);
|
|
232446
232450
|
const spawned = cp2.spawn(parsed.command, parsed.args, parsed.options);
|
|
232447
232451
|
enoent.hookChildProcess(spawned, parsed);
|
|
@@ -232453,8 +232457,8 @@ var require_cross_spawn = __commonJS({
|
|
|
232453
232457
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
232454
232458
|
return result;
|
|
232455
232459
|
}
|
|
232456
|
-
module2.exports =
|
|
232457
|
-
module2.exports.spawn =
|
|
232460
|
+
module2.exports = spawn14;
|
|
232461
|
+
module2.exports.spawn = spawn14;
|
|
232458
232462
|
module2.exports.sync = spawnSync;
|
|
232459
232463
|
module2.exports._parse = parse6;
|
|
232460
232464
|
module2.exports._enoent = enoent;
|
|
@@ -232518,7 +232522,7 @@ var init_stdio = __esm({
|
|
|
232518
232522
|
*/
|
|
232519
232523
|
async start() {
|
|
232520
232524
|
if (this._process) throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");
|
|
232521
|
-
return new Promise((
|
|
232525
|
+
return new Promise((resolve59, reject) => {
|
|
232522
232526
|
this._process = (0, import_cross_spawn.default)(this._serverParams.command, this._serverParams.args ?? [], {
|
|
232523
232527
|
env: {
|
|
232524
232528
|
...getDefaultEnvironment(),
|
|
@@ -232538,7 +232542,7 @@ var init_stdio = __esm({
|
|
|
232538
232542
|
this.onerror?.(error62);
|
|
232539
232543
|
});
|
|
232540
232544
|
this._process.on("spawn", () => {
|
|
232541
|
-
|
|
232545
|
+
resolve59();
|
|
232542
232546
|
});
|
|
232543
232547
|
this._process.on("close", (_code) => {
|
|
232544
232548
|
this._process = void 0;
|
|
@@ -232603,7 +232607,7 @@ var init_stdio = __esm({
|
|
|
232603
232607
|
const proc = this._process;
|
|
232604
232608
|
this._process = void 0;
|
|
232605
232609
|
if (proc && proc.exitCode === null && proc.signalCode === null) {
|
|
232606
|
-
const exited = new Promise((
|
|
232610
|
+
const exited = new Promise((resolve59) => proc.once("exit", () => resolve59()));
|
|
232607
232611
|
try {
|
|
232608
232612
|
proc.stdin?.end();
|
|
232609
232613
|
} catch {
|
|
@@ -232612,7 +232616,7 @@ var init_stdio = __esm({
|
|
|
232612
232616
|
proc.kill("SIGTERM");
|
|
232613
232617
|
} catch {
|
|
232614
232618
|
}
|
|
232615
|
-
await Promise.race([exited, new Promise((
|
|
232619
|
+
await Promise.race([exited, new Promise((resolve59) => setTimeout(resolve59, 1e3).unref())]);
|
|
232616
232620
|
if (proc.exitCode === null && proc.signalCode === null) try {
|
|
232617
232621
|
proc.kill("SIGKILL");
|
|
232618
232622
|
} catch {
|
|
@@ -232637,22 +232641,22 @@ var init_stdio = __esm({
|
|
|
232637
232641
|
if (this._process) {
|
|
232638
232642
|
const processToClose = this._process;
|
|
232639
232643
|
this._process = void 0;
|
|
232640
|
-
const closePromise = new Promise((
|
|
232644
|
+
const closePromise = new Promise((resolve59) => {
|
|
232641
232645
|
processToClose.once("close", () => {
|
|
232642
|
-
|
|
232646
|
+
resolve59();
|
|
232643
232647
|
});
|
|
232644
232648
|
});
|
|
232645
232649
|
try {
|
|
232646
232650
|
processToClose.stdin?.end();
|
|
232647
232651
|
} catch {
|
|
232648
232652
|
}
|
|
232649
|
-
await Promise.race([closePromise, new Promise((
|
|
232653
|
+
await Promise.race([closePromise, new Promise((resolve59) => setTimeout(resolve59, 2e3).unref())]);
|
|
232650
232654
|
if (processToClose.exitCode === null) {
|
|
232651
232655
|
try {
|
|
232652
232656
|
processToClose.kill("SIGTERM");
|
|
232653
232657
|
} catch {
|
|
232654
232658
|
}
|
|
232655
|
-
await Promise.race([closePromise, new Promise((
|
|
232659
|
+
await Promise.race([closePromise, new Promise((resolve59) => setTimeout(resolve59, 2e3).unref())]);
|
|
232656
232660
|
}
|
|
232657
232661
|
if (processToClose.exitCode === null) try {
|
|
232658
232662
|
processToClose.kill("SIGKILL");
|
|
@@ -232662,11 +232666,11 @@ var init_stdio = __esm({
|
|
|
232662
232666
|
this._readBuffer.clear();
|
|
232663
232667
|
}
|
|
232664
232668
|
send(message) {
|
|
232665
|
-
return new Promise((
|
|
232669
|
+
return new Promise((resolve59) => {
|
|
232666
232670
|
if (!this._process?.stdin) throw new SdkError(SdkErrorCode.NotConnected, "Not connected");
|
|
232667
232671
|
const json3 = serializeMessage(message);
|
|
232668
|
-
if (this._process.stdin.write(json3))
|
|
232669
|
-
else this._process.stdin.once("drain",
|
|
232672
|
+
if (this._process.stdin.write(json3)) resolve59();
|
|
232673
|
+
else this._process.stdin.once("drain", resolve59);
|
|
232670
232674
|
});
|
|
232671
232675
|
}
|
|
232672
232676
|
};
|
|
@@ -234166,14 +234170,14 @@ function hashIdentifier(value2) {
|
|
|
234166
234170
|
return (0, import_node_crypto28.createHash)("sha256").update(value2).digest("hex").slice(0, 12);
|
|
234167
234171
|
}
|
|
234168
234172
|
function sleep7(durationMs, signal) {
|
|
234169
|
-
return new Promise((
|
|
234173
|
+
return new Promise((resolve59) => {
|
|
234170
234174
|
const timer = setTimeout(() => {
|
|
234171
234175
|
signal?.removeEventListener("abort", onAbort);
|
|
234172
|
-
|
|
234176
|
+
resolve59();
|
|
234173
234177
|
}, durationMs);
|
|
234174
234178
|
const onAbort = () => {
|
|
234175
234179
|
clearTimeout(timer);
|
|
234176
|
-
|
|
234180
|
+
resolve59();
|
|
234177
234181
|
};
|
|
234178
234182
|
signal?.addEventListener("abort", onAbort, { once: true });
|
|
234179
234183
|
});
|
|
@@ -234687,7 +234691,7 @@ function runCommand(file3, args, options2, terminatorOptions) {
|
|
|
234687
234691
|
}
|
|
234688
234692
|
function defaultExecFile2(file3, args, options2) {
|
|
234689
234693
|
return new Promise((resolveCommand) => {
|
|
234690
|
-
(0,
|
|
234694
|
+
(0, import_node_child_process12.execFile)(file3, [...args], options2, (error62, stdout, stderr) => {
|
|
234691
234695
|
resolveCommand({
|
|
234692
234696
|
error: error62,
|
|
234693
234697
|
status: getExitStatus(error62),
|
|
@@ -234706,11 +234710,11 @@ function getExitStatus(error62) {
|
|
|
234706
234710
|
function didTerminationFail(result) {
|
|
234707
234711
|
return Boolean(result.error) || result.status !== null && result.status !== 0;
|
|
234708
234712
|
}
|
|
234709
|
-
var
|
|
234713
|
+
var import_node_child_process12, PROCESS_LOOKUP_TIMEOUT_MS, POSIX_PROCESS_TREE_GRACE_MS, POSIX_PROCESS_TREE_FORCE_MS, POSIX_PROCESS_TREE_VERIFY_MS, POSIX_PROCESS_TREE_POLL_MS, WINDOWS_TASKKILL_TIMEOUT_MS;
|
|
234710
234714
|
var init_process_tree2 = __esm({
|
|
234711
234715
|
"../adapters/dist/mcp/process-tree.js"() {
|
|
234712
234716
|
"use strict";
|
|
234713
|
-
|
|
234717
|
+
import_node_child_process12 = require("node:child_process");
|
|
234714
234718
|
PROCESS_LOOKUP_TIMEOUT_MS = 1e3;
|
|
234715
234719
|
POSIX_PROCESS_TREE_GRACE_MS = 250;
|
|
234716
234720
|
POSIX_PROCESS_TREE_FORCE_MS = 750;
|
|
@@ -242070,8 +242074,8 @@ var init_registry3 = __esm({
|
|
|
242070
242074
|
const signal = options2?.signal;
|
|
242071
242075
|
if (signal?.aborted)
|
|
242072
242076
|
return Promise.reject(abortReason3(signal));
|
|
242073
|
-
return new Promise((
|
|
242074
|
-
const waiter = { resolve:
|
|
242077
|
+
return new Promise((resolve59, reject) => {
|
|
242078
|
+
const waiter = { resolve: resolve59, reject, signal };
|
|
242075
242079
|
if (signal) {
|
|
242076
242080
|
waiter.onAbort = () => {
|
|
242077
242081
|
this.removeWaiter(waitersByTask, id, waiter);
|
|
@@ -245091,7 +245095,7 @@ function observeToolAdmissionClock(event, toolCallId, deadline) {
|
|
|
245091
245095
|
deadline.resume();
|
|
245092
245096
|
}
|
|
245093
245097
|
async function executeWithTimeout(handler, input2, context3, deadline, abortController, entry) {
|
|
245094
|
-
return new Promise((
|
|
245098
|
+
return new Promise((resolve59, reject) => {
|
|
245095
245099
|
if (context3.abortSignal.aborted) {
|
|
245096
245100
|
reject(createCoreError(CoreErrorType.ToolCancelled, entry.cancellation?.userVisibleMessage ?? "Tool execution cancelled"));
|
|
245097
245101
|
return;
|
|
@@ -245114,7 +245118,7 @@ async function executeWithTimeout(handler, input2, context3, deadline, abortCont
|
|
|
245114
245118
|
return;
|
|
245115
245119
|
settled = true;
|
|
245116
245120
|
cleanup();
|
|
245117
|
-
|
|
245121
|
+
resolve59(result);
|
|
245118
245122
|
};
|
|
245119
245123
|
const timeoutMs2 = deadline.timeoutMs;
|
|
245120
245124
|
deadline.start(() => {
|
|
@@ -245257,7 +245261,7 @@ async function racePermissionResponders(input2) {
|
|
|
245257
245261
|
let settled = false;
|
|
245258
245262
|
let brokerClaimed = false;
|
|
245259
245263
|
try {
|
|
245260
|
-
return await new Promise((
|
|
245264
|
+
return await new Promise((resolve59, reject) => {
|
|
245261
245265
|
const settle3 = (action, abortLoser) => {
|
|
245262
245266
|
if (settled)
|
|
245263
245267
|
return;
|
|
@@ -245271,13 +245275,13 @@ async function racePermissionResponders(input2) {
|
|
|
245271
245275
|
brokerClaimed = true;
|
|
245272
245276
|
hookController.abort();
|
|
245273
245277
|
return true;
|
|
245274
|
-
}).then((result) => settle3(() =>
|
|
245278
|
+
}).then((result) => settle3(() => resolve59({ result, source: "broker" }), hookController), (error62) => {
|
|
245275
245279
|
settle3(() => reject(error62), hookController);
|
|
245276
245280
|
});
|
|
245277
245281
|
input2.runHooks(hookController.signal).then((decision) => {
|
|
245278
245282
|
if (decision === void 0 || brokerClaimed)
|
|
245279
245283
|
return;
|
|
245280
|
-
settle3(() =>
|
|
245284
|
+
settle3(() => resolve59({ result: decision, source: "hook" }), brokerController);
|
|
245281
245285
|
}, (error62) => {
|
|
245282
245286
|
if (settled)
|
|
245283
245287
|
return;
|
|
@@ -249052,7 +249056,7 @@ var init_runner2 = __esm({
|
|
|
249052
249056
|
const unlink10 = linkAbortSignal2(parentSignal, controller);
|
|
249053
249057
|
let timer;
|
|
249054
249058
|
try {
|
|
249055
|
-
return await new Promise((
|
|
249059
|
+
return await new Promise((resolve59, reject) => {
|
|
249056
249060
|
if (controller.signal.aborted) {
|
|
249057
249061
|
reject(createHookCancelledError());
|
|
249058
249062
|
return;
|
|
@@ -249065,7 +249069,7 @@ var init_runner2 = __esm({
|
|
|
249065
249069
|
controller.signal.addEventListener("abort", () => {
|
|
249066
249070
|
reject(controller.signal.reason === HOOK_TIMEOUT_ABORT_REASON ? createHookTimeoutError(timeoutMs2) : createHookCancelledError());
|
|
249067
249071
|
}, { once: true });
|
|
249068
|
-
Promise.resolve(hook.callback(input2, { hookIndex, signal: controller.signal })).then(
|
|
249072
|
+
Promise.resolve(hook.callback(input2, { hookIndex, signal: controller.signal })).then(resolve59, reject);
|
|
249069
249073
|
});
|
|
249070
249074
|
} finally {
|
|
249071
249075
|
if (timer)
|
|
@@ -249840,7 +249844,7 @@ function waitForWorkspaceHookAdmission(promise2, signal) {
|
|
|
249840
249844
|
if (!signal)
|
|
249841
249845
|
return promise2;
|
|
249842
249846
|
signal.throwIfAborted();
|
|
249843
|
-
return new Promise((
|
|
249847
|
+
return new Promise((resolve59, reject) => {
|
|
249844
249848
|
const onAbort = () => {
|
|
249845
249849
|
cleanup();
|
|
249846
249850
|
reject(signal.reason ?? new Error("Workspace Hook admission aborted"));
|
|
@@ -249849,7 +249853,7 @@ function waitForWorkspaceHookAdmission(promise2, signal) {
|
|
|
249849
249853
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
249850
249854
|
void promise2.then((value2) => {
|
|
249851
249855
|
cleanup();
|
|
249852
|
-
|
|
249856
|
+
resolve59(value2);
|
|
249853
249857
|
}, (error62) => {
|
|
249854
249858
|
cleanup();
|
|
249855
249859
|
reject(error62);
|
|
@@ -250211,8 +250215,8 @@ var init_workspace_hook_review_flow = __esm({
|
|
|
250211
250215
|
}
|
|
250212
250216
|
createFlow(request) {
|
|
250213
250217
|
let resolveResult;
|
|
250214
|
-
const result = new Promise((
|
|
250215
|
-
resolveResult =
|
|
250218
|
+
const result = new Promise((resolve59) => {
|
|
250219
|
+
resolveResult = resolve59;
|
|
250216
250220
|
});
|
|
250217
250221
|
const state = workspaceHookReviewFlowStateSchema.parse({
|
|
250218
250222
|
reviewFlowId: request.reviewFlowId,
|
|
@@ -278550,14 +278554,14 @@ function raceAbort(promise2, signal) {
|
|
|
278550
278554
|
if (signal.aborted) {
|
|
278551
278555
|
return Promise.reject(abortReason4(signal));
|
|
278552
278556
|
}
|
|
278553
|
-
return new Promise((
|
|
278557
|
+
return new Promise((resolve59, reject) => {
|
|
278554
278558
|
const onAbort = () => reject(abortReason4(signal));
|
|
278555
278559
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
278556
278560
|
if (signal.aborted)
|
|
278557
278561
|
onAbort();
|
|
278558
278562
|
promise2.then((v2) => {
|
|
278559
278563
|
signal.removeEventListener("abort", onAbort);
|
|
278560
|
-
|
|
278564
|
+
resolve59(v2);
|
|
278561
278565
|
}, (e2) => {
|
|
278562
278566
|
signal.removeEventListener("abort", onAbort);
|
|
278563
278567
|
reject(e2);
|
|
@@ -287150,8 +287154,8 @@ async function waitForTask(taskId, timeoutMs2, context3) {
|
|
|
287150
287154
|
return context3.runtimeTaskRegistry?.get(taskId);
|
|
287151
287155
|
}
|
|
287152
287156
|
function delay5(milliseconds) {
|
|
287153
|
-
return new Promise((
|
|
287154
|
-
setTimeout(
|
|
287157
|
+
return new Promise((resolve59) => {
|
|
287158
|
+
setTimeout(resolve59, milliseconds);
|
|
287155
287159
|
});
|
|
287156
287160
|
}
|
|
287157
287161
|
function markTaskNotified(task, context3) {
|
|
@@ -416460,7 +416464,7 @@ ${lanes.join("\n")}
|
|
|
416460
416464
|
}
|
|
416461
416465
|
}
|
|
416462
416466
|
function createImportCallExpressionAMD(arg, containsLexicalThis) {
|
|
416463
|
-
const
|
|
416467
|
+
const resolve59 = factory22.createUniqueName("resolve");
|
|
416464
416468
|
const reject = factory22.createUniqueName("reject");
|
|
416465
416469
|
const parameters = [
|
|
416466
416470
|
factory22.createParameterDeclaration(
|
|
@@ -416469,7 +416473,7 @@ ${lanes.join("\n")}
|
|
|
416469
416473
|
/*dotDotDotToken*/
|
|
416470
416474
|
void 0,
|
|
416471
416475
|
/*name*/
|
|
416472
|
-
|
|
416476
|
+
resolve59
|
|
416473
416477
|
),
|
|
416474
416478
|
factory22.createParameterDeclaration(
|
|
416475
416479
|
/*modifiers*/
|
|
@@ -416486,7 +416490,7 @@ ${lanes.join("\n")}
|
|
|
416486
416490
|
factory22.createIdentifier("require"),
|
|
416487
416491
|
/*typeArguments*/
|
|
416488
416492
|
void 0,
|
|
416489
|
-
[factory22.createArrayLiteralExpression([arg || factory22.createOmittedExpression()]),
|
|
416493
|
+
[factory22.createArrayLiteralExpression([arg || factory22.createOmittedExpression()]), resolve59, reject]
|
|
416490
416494
|
)
|
|
416491
416495
|
)
|
|
416492
416496
|
]);
|
|
@@ -503204,8 +503208,8 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
503204
503208
|
installPackage(options2) {
|
|
503205
503209
|
this.packageInstallId++;
|
|
503206
503210
|
const request = { kind: "installPackage", ...options2, id: this.packageInstallId };
|
|
503207
|
-
const promise2 = new Promise((
|
|
503208
|
-
(this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map())).set(this.packageInstallId, { resolve:
|
|
503211
|
+
const promise2 = new Promise((resolve59, reject) => {
|
|
503212
|
+
(this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map())).set(this.packageInstallId, { resolve: resolve59, reject });
|
|
503209
503213
|
});
|
|
503210
503214
|
this.installer.send(request);
|
|
503211
503215
|
return promise2;
|
|
@@ -506433,9 +506437,9 @@ function evalCall(ev, node2, ctx) {
|
|
|
506433
506437
|
const world = ev.s.worldByCall.get(node2);
|
|
506434
506438
|
if (world !== void 0)
|
|
506435
506439
|
return handleWorldRead(ev, world.id, world.args, ctx);
|
|
506436
|
-
const
|
|
506437
|
-
if (
|
|
506438
|
-
return handleJoin(ev, node2,
|
|
506440
|
+
const join83 = ev.s.joinByCall.get(node2);
|
|
506441
|
+
if (join83 !== void 0)
|
|
506442
|
+
return handleJoin(ev, node2, join83.id, join83.arg, ctx);
|
|
506439
506443
|
if (import_typescript19.default.isPropertyAccessExpression(node2.expression)) {
|
|
506440
506444
|
const cand = ev.s.candByCall.get(node2);
|
|
506441
506445
|
if (cand !== void 0)
|
|
@@ -510626,13 +510630,13 @@ var init_types10 = __esm({
|
|
|
510626
510630
|
|
|
510627
510631
|
// ../dynamic-workflow/dist/engine/scheduler-types.js
|
|
510628
510632
|
function defer() {
|
|
510629
|
-
let
|
|
510633
|
+
let resolve59;
|
|
510630
510634
|
let reject;
|
|
510631
510635
|
const promise2 = new Promise((res, rej) => {
|
|
510632
|
-
|
|
510636
|
+
resolve59 = res;
|
|
510633
510637
|
reject = rej;
|
|
510634
510638
|
});
|
|
510635
|
-
return { promise: promise2, resolve:
|
|
510639
|
+
return { promise: promise2, resolve: resolve59, reject };
|
|
510636
510640
|
}
|
|
510637
510641
|
function hashMismatch(instance, expected, got) {
|
|
510638
510642
|
return new WorkflowError(
|
|
@@ -511174,10 +511178,10 @@ function claimsOnReplay(node2) {
|
|
|
511174
511178
|
return typeof kind === "string" && !isArtifactPresetOp(kind);
|
|
511175
511179
|
}
|
|
511176
511180
|
function heldResolution(hold, instance, settle3) {
|
|
511177
|
-
return new Promise((
|
|
511181
|
+
return new Promise((resolve59, reject) => {
|
|
511178
511182
|
hold(instance, () => {
|
|
511179
511183
|
try {
|
|
511180
|
-
|
|
511184
|
+
resolve59(settle3());
|
|
511181
511185
|
} catch (cause) {
|
|
511182
511186
|
reject(cause);
|
|
511183
511187
|
}
|
|
@@ -512215,11 +512219,11 @@ var init_engine = __esm({
|
|
|
512215
512219
|
this.validate = config2.validate;
|
|
512216
512220
|
this.importedCache = config2.importedCache;
|
|
512217
512221
|
this.importedWorld = new ImportedWorldQueue(config2.importedCache?.world ?? /* @__PURE__ */ new Map());
|
|
512218
|
-
let
|
|
512222
|
+
let resolve59;
|
|
512219
512223
|
const promise2 = new Promise((res) => {
|
|
512220
|
-
|
|
512224
|
+
resolve59 = res;
|
|
512221
512225
|
});
|
|
512222
|
-
this.settledDeferred = { promise: promise2, resolve:
|
|
512226
|
+
this.settledDeferred = { promise: promise2, resolve: resolve59 };
|
|
512223
512227
|
this.state = {
|
|
512224
512228
|
runId: this.runId,
|
|
512225
512229
|
driver: this.driver,
|
|
@@ -516172,8 +516176,8 @@ function createAutoBackgroundTimer(registry2, agentId, timeoutMs2, signal) {
|
|
|
516172
516176
|
const onAbort = () => {
|
|
516173
516177
|
complete2({ kind: "ignored" });
|
|
516174
516178
|
};
|
|
516175
|
-
const promise2 = new Promise((
|
|
516176
|
-
resolvePromise =
|
|
516179
|
+
const promise2 = new Promise((resolve59) => {
|
|
516180
|
+
resolvePromise = resolve59;
|
|
516177
516181
|
if (signal?.aborted) {
|
|
516178
516182
|
complete2({ kind: "ignored" });
|
|
516179
516183
|
return;
|
|
@@ -516593,7 +516597,7 @@ function createSubagentActivityWatchdog(options2) {
|
|
|
516593
516597
|
function guardSubagentPromiseWithAbort(promise2, request, lifecycle, signal) {
|
|
516594
516598
|
if (!signal)
|
|
516595
516599
|
return promise2;
|
|
516596
|
-
return new Promise((
|
|
516600
|
+
return new Promise((resolve59, reject) => {
|
|
516597
516601
|
let settled = false;
|
|
516598
516602
|
const settle3 = (callback) => {
|
|
516599
516603
|
if (settled)
|
|
@@ -516618,7 +516622,7 @@ function guardSubagentPromiseWithAbort(promise2, request, lifecycle, signal) {
|
|
|
516618
516622
|
recoverable: true
|
|
516619
516623
|
})));
|
|
516620
516624
|
};
|
|
516621
|
-
promise2.then((completed) => settle3(() =>
|
|
516625
|
+
promise2.then((completed) => settle3(() => resolve59(completed)), (error62) => settle3(() => reject(error62)));
|
|
516622
516626
|
if (signal.aborted) {
|
|
516623
516627
|
abortHandler();
|
|
516624
516628
|
return;
|
|
@@ -516653,8 +516657,8 @@ async function runBackgroundAgent(options2, request, lifecycle, registry2, runOp
|
|
|
516653
516657
|
function createSubagentSessionReadyGate() {
|
|
516654
516658
|
let resolvePromise;
|
|
516655
516659
|
let rejectPromise;
|
|
516656
|
-
const promise2 = new Promise((
|
|
516657
|
-
resolvePromise =
|
|
516660
|
+
const promise2 = new Promise((resolve59, reject) => {
|
|
516661
|
+
resolvePromise = resolve59;
|
|
516658
516662
|
rejectPromise = reject;
|
|
516659
516663
|
});
|
|
516660
516664
|
let settled = false;
|
|
@@ -520882,8 +520886,8 @@ var init_events2 = __esm({
|
|
|
520882
520886
|
function runWorkflowNode(snapshotAccess, node2, options2, maxAttempts, runtime) {
|
|
520883
520887
|
let resolveStarted = () => {
|
|
520884
520888
|
};
|
|
520885
|
-
const started = new Promise((
|
|
520886
|
-
resolveStarted =
|
|
520889
|
+
const started = new Promise((resolve59) => {
|
|
520890
|
+
resolveStarted = resolve59;
|
|
520887
520891
|
});
|
|
520888
520892
|
const promise2 = (async () => {
|
|
520889
520893
|
const initialSnapshot = snapshotAccess.getSnapshot();
|
|
@@ -531594,7 +531598,7 @@ async function generateTargetCompletionVerificationText(input2) {
|
|
|
531594
531598
|
retryDelayMs,
|
|
531595
531599
|
status: "waiting"
|
|
531596
531600
|
});
|
|
531597
|
-
await new Promise((
|
|
531601
|
+
await new Promise((resolve59) => setTimeout(resolve59, retryDelayMs));
|
|
531598
531602
|
throwIfTurnAborted(input2.abortSignal);
|
|
531599
531603
|
}
|
|
531600
531604
|
}
|
|
@@ -531640,7 +531644,7 @@ var init_target_completion_verification = __esm({
|
|
|
531640
531644
|
|
|
531641
531645
|
// ../core/dist/runtime/methods/runtime-command-submit.js
|
|
531642
531646
|
function enqueueCancellableRuntimeCommand(runtime, input2) {
|
|
531643
|
-
return new Promise((
|
|
531647
|
+
return new Promise((resolve59, reject) => {
|
|
531644
531648
|
let settled = false;
|
|
531645
531649
|
const abortSignal = input2.abortSignal;
|
|
531646
531650
|
const cleanup = () => {
|
|
@@ -531651,7 +531655,7 @@ function enqueueCancellableRuntimeCommand(runtime, input2) {
|
|
|
531651
531655
|
return;
|
|
531652
531656
|
settled = true;
|
|
531653
531657
|
cleanup();
|
|
531654
|
-
|
|
531658
|
+
resolve59(result);
|
|
531655
531659
|
};
|
|
531656
531660
|
const rejectCommand = (error62) => {
|
|
531657
531661
|
if (settled)
|
|
@@ -531701,7 +531705,7 @@ async function continueActiveTargetIfIdle(options2) {
|
|
|
531701
531705
|
const traceContext = options2?.traceContext ?? this.rootTraceContext;
|
|
531702
531706
|
return await enqueueCancellableRuntimeCommand(this, {
|
|
531703
531707
|
abortSignal: options2?.abortSignal,
|
|
531704
|
-
createCommand: ({ reject, resolve:
|
|
531708
|
+
createCommand: ({ reject, resolve: resolve59 }) => {
|
|
531705
531709
|
const commandOptions = {
|
|
531706
531710
|
...options2?.abortSignal ? { abortSignal: options2.abortSignal } : {},
|
|
531707
531711
|
...options2?.inputId !== void 0 ? { inputId: options2.inputId } : {},
|
|
@@ -531716,7 +531720,7 @@ async function continueActiveTargetIfIdle(options2) {
|
|
|
531716
531720
|
options: commandOptions,
|
|
531717
531721
|
priority: "next",
|
|
531718
531722
|
reject,
|
|
531719
|
-
resolve:
|
|
531723
|
+
resolve: resolve59,
|
|
531720
531724
|
traceContext
|
|
531721
531725
|
};
|
|
531722
531726
|
}
|
|
@@ -532016,7 +532020,7 @@ async function continueActiveTargetLoop(options2) {
|
|
|
532016
532020
|
const traceContext = options2.traceContext ?? this.rootTraceContext;
|
|
532017
532021
|
return await enqueueCancellableRuntimeCommand(this, {
|
|
532018
532022
|
abortSignal: options2.abortSignal,
|
|
532019
|
-
createCommand: ({ reject, resolve:
|
|
532023
|
+
createCommand: ({ reject, resolve: resolve59 }) => ({
|
|
532020
532024
|
createdAt: /* @__PURE__ */ new Date(),
|
|
532021
532025
|
id: createRuntimeCommandId(),
|
|
532022
532026
|
mode: "target-continuation-loop",
|
|
@@ -532030,7 +532034,7 @@ async function continueActiveTargetLoop(options2) {
|
|
|
532030
532034
|
},
|
|
532031
532035
|
priority: "next",
|
|
532032
532036
|
reject,
|
|
532033
|
-
resolve:
|
|
532037
|
+
resolve: resolve59,
|
|
532034
532038
|
traceContext
|
|
532035
532039
|
})
|
|
532036
532040
|
});
|
|
@@ -532683,7 +532687,7 @@ function formatSubagentCoordinatorMessage(message) {
|
|
|
532683
532687
|
return [summary, "", message.message].join("\n");
|
|
532684
532688
|
}
|
|
532685
532689
|
function sleep8(ms) {
|
|
532686
|
-
return new Promise((
|
|
532690
|
+
return new Promise((resolve59) => setTimeout(resolve59, ms));
|
|
532687
532691
|
}
|
|
532688
532692
|
var init_message_steering = __esm({
|
|
532689
532693
|
"../core/dist/subagent/message-steering.js"() {
|
|
@@ -537837,8 +537841,8 @@ async function raceWithTimeout(promise2, timeoutMs2) {
|
|
|
537837
537841
|
try {
|
|
537838
537842
|
return await Promise.race([
|
|
537839
537843
|
promise2,
|
|
537840
|
-
new Promise((
|
|
537841
|
-
timeout = setTimeout(() =>
|
|
537844
|
+
new Promise((resolve59) => {
|
|
537845
|
+
timeout = setTimeout(() => resolve59(void 0), timeoutMs2);
|
|
537842
537846
|
})
|
|
537843
537847
|
]);
|
|
537844
537848
|
} finally {
|
|
@@ -538469,7 +538473,7 @@ async function runModelBackedTurnStepImpl(state, options2, assistantMessageId) {
|
|
|
538469
538473
|
toolCallIds: []
|
|
538470
538474
|
});
|
|
538471
538475
|
await streamingToolCoordinator.abandon("model_failed");
|
|
538472
|
-
await new Promise((
|
|
538476
|
+
await new Promise((resolve59) => setTimeout(resolve59, admissionRetryDelayMs));
|
|
538473
538477
|
throwIfTurnAborted(state.turnAbortSignal);
|
|
538474
538478
|
return "continue";
|
|
538475
538479
|
}
|
|
@@ -539266,10 +539270,10 @@ function acquireSnapshot(snapshot2) {
|
|
|
539266
539270
|
function waitForSnapshotAcquisitionOrShutdown(acquisition, signal) {
|
|
539267
539271
|
if (signal.aborted)
|
|
539268
539272
|
return Promise.resolve({ status: "shutdown" });
|
|
539269
|
-
return new Promise((
|
|
539273
|
+
return new Promise((resolve59) => {
|
|
539270
539274
|
const onAbort = () => {
|
|
539271
539275
|
cleanup();
|
|
539272
|
-
|
|
539276
|
+
resolve59({ status: "shutdown" });
|
|
539273
539277
|
};
|
|
539274
539278
|
const cleanup = () => {
|
|
539275
539279
|
signal.removeEventListener("abort", onAbort);
|
|
@@ -539277,7 +539281,7 @@ function waitForSnapshotAcquisitionOrShutdown(acquisition, signal) {
|
|
|
539277
539281
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
539278
539282
|
void acquisition.then((result) => {
|
|
539279
539283
|
cleanup();
|
|
539280
|
-
|
|
539284
|
+
resolve59(result);
|
|
539281
539285
|
});
|
|
539282
539286
|
});
|
|
539283
539287
|
}
|
|
@@ -539706,8 +539710,8 @@ async function drainMemoryExtractions(timeoutMs2 = EXTRACTION_DRAIN_TIMEOUT_MS)
|
|
|
539706
539710
|
try {
|
|
539707
539711
|
await Promise.race([
|
|
539708
539712
|
scheduler.drain(),
|
|
539709
|
-
new Promise((
|
|
539710
|
-
timeout = setTimeout(
|
|
539713
|
+
new Promise((resolve59) => {
|
|
539714
|
+
timeout = setTimeout(resolve59, timeoutMs2);
|
|
539711
539715
|
timeout.unref?.();
|
|
539712
539716
|
})
|
|
539713
539717
|
]);
|
|
@@ -539934,7 +539938,7 @@ var init_browser_turn_screenshot = __esm({
|
|
|
539934
539938
|
async function executeTurn(input2, attachments, options2) {
|
|
539935
539939
|
return await enqueueCancellableRuntimeCommand(this, {
|
|
539936
539940
|
abortSignal: options2?.abortSignal,
|
|
539937
|
-
createCommand: ({ reject, resolve:
|
|
539941
|
+
createCommand: ({ reject, resolve: resolve59 }) => ({
|
|
539938
539942
|
attachments,
|
|
539939
539943
|
createdAt: /* @__PURE__ */ new Date(),
|
|
539940
539944
|
id: createRuntimeCommandId(),
|
|
@@ -539943,7 +539947,7 @@ async function executeTurn(input2, attachments, options2) {
|
|
|
539943
539947
|
options: options2,
|
|
539944
539948
|
priority: "next",
|
|
539945
539949
|
reject,
|
|
539946
|
-
resolve:
|
|
539950
|
+
resolve: resolve59,
|
|
539947
539951
|
traceContext: options2?.traceContext ?? this.rootTraceContext
|
|
539948
539952
|
})
|
|
539949
539953
|
});
|
|
@@ -540601,7 +540605,7 @@ async function admitPrompt(input2, attachments, options2) {
|
|
|
540601
540605
|
const completion = enqueueCancellableRuntimeCommand(this, {
|
|
540602
540606
|
abortSignal: options2?.abortSignal,
|
|
540603
540607
|
onCommandCancelled: () => this.releaseTurnStart(turnId),
|
|
540604
|
-
createCommand: ({ reject, resolve:
|
|
540608
|
+
createCommand: ({ reject, resolve: resolve59 }) => ({
|
|
540605
540609
|
attachments,
|
|
540606
540610
|
createdAt: /* @__PURE__ */ new Date(),
|
|
540607
540611
|
id: createRuntimeCommandId(),
|
|
@@ -540614,7 +540618,7 @@ async function admitPrompt(input2, attachments, options2) {
|
|
|
540614
540618
|
},
|
|
540615
540619
|
priority: "next",
|
|
540616
540620
|
reject,
|
|
540617
|
-
resolve:
|
|
540621
|
+
resolve: resolve59,
|
|
540618
540622
|
startReservation: reservation,
|
|
540619
540623
|
traceContext: turnTraceContext
|
|
540620
540624
|
})
|
|
@@ -555272,8 +555276,8 @@ var require_promise = __commonJS({
|
|
|
555272
555276
|
_resolve;
|
|
555273
555277
|
_reject;
|
|
555274
555278
|
constructor() {
|
|
555275
|
-
this._promise = new Promise((
|
|
555276
|
-
this._resolve =
|
|
555279
|
+
this._promise = new Promise((resolve59, reject) => {
|
|
555280
|
+
this._resolve = resolve59;
|
|
555277
555281
|
this._reject = reject;
|
|
555278
555282
|
});
|
|
555279
555283
|
}
|
|
@@ -555369,9 +555373,9 @@ var require_exporter = __commonJS({
|
|
|
555369
555373
|
var api_1 = (init_esm33(), __toCommonJS(esm_exports20));
|
|
555370
555374
|
var suppress_tracing_1 = require_suppress_tracing();
|
|
555371
555375
|
function _export(exporter, arg) {
|
|
555372
|
-
return new Promise((
|
|
555376
|
+
return new Promise((resolve59) => {
|
|
555373
555377
|
api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => {
|
|
555374
|
-
exporter.export(arg,
|
|
555378
|
+
exporter.export(arg, resolve59);
|
|
555375
555379
|
});
|
|
555376
555380
|
});
|
|
555377
555381
|
}
|
|
@@ -560370,7 +560374,7 @@ var require_aspromise = __commonJS({
|
|
|
560370
560374
|
var params = new Array(arguments.length - 1), offset = 0, index = 2, pending = true;
|
|
560371
560375
|
while (index < arguments.length)
|
|
560372
560376
|
params[offset++] = arguments[index++];
|
|
560373
|
-
return new Promise(function executor(
|
|
560377
|
+
return new Promise(function executor(resolve59, reject) {
|
|
560374
560378
|
params[offset] = function callback(err) {
|
|
560375
560379
|
if (pending) {
|
|
560376
560380
|
pending = false;
|
|
@@ -560380,7 +560384,7 @@ var require_aspromise = __commonJS({
|
|
|
560380
560384
|
var params2 = new Array(arguments.length - 1), offset2 = 0;
|
|
560381
560385
|
while (offset2 < params2.length)
|
|
560382
560386
|
params2[offset2++] = arguments[offset2];
|
|
560383
|
-
|
|
560387
|
+
resolve59.apply(null, params2);
|
|
560384
560388
|
}
|
|
560385
560389
|
}
|
|
560386
560390
|
};
|
|
@@ -570755,7 +570759,7 @@ var init_version5 = __esm({
|
|
|
570755
570759
|
|
|
570756
570760
|
// ../../../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/http-transport-utils.js
|
|
570757
570761
|
function sendWithHttp(request, url2, headers, compression, userAgent, agent, data2, timeoutMillis) {
|
|
570758
|
-
return new Promise((
|
|
570762
|
+
return new Promise((resolve59) => {
|
|
570759
570763
|
const parsedUrl = new URL(url2);
|
|
570760
570764
|
if (userAgent) {
|
|
570761
570765
|
headers["User-Agent"] = `${userAgent} ${DEFAULT_USER_AGENT}`;
|
|
@@ -570775,18 +570779,18 @@ function sendWithHttp(request, url2, headers, compression, userAgent, agent, dat
|
|
|
570775
570779
|
res.on("data", (chunk) => responseData.push(chunk));
|
|
570776
570780
|
res.on("end", () => {
|
|
570777
570781
|
if (res.statusCode && res.statusCode <= 299) {
|
|
570778
|
-
|
|
570782
|
+
resolve59({
|
|
570779
570783
|
status: "success",
|
|
570780
570784
|
data: Buffer.concat(responseData)
|
|
570781
570785
|
});
|
|
570782
570786
|
} else if (res.statusCode && isExportHTTPErrorRetryable(res.statusCode)) {
|
|
570783
|
-
|
|
570787
|
+
resolve59({
|
|
570784
570788
|
status: "retryable",
|
|
570785
570789
|
retryInMillis: parseRetryAfterToMills(res.headers["retry-after"])
|
|
570786
570790
|
});
|
|
570787
570791
|
} else {
|
|
570788
570792
|
const error62 = new OTLPExporterError(res.statusMessage, res.statusCode, Buffer.concat(responseData).toString());
|
|
570789
|
-
|
|
570793
|
+
resolve59({
|
|
570790
570794
|
status: "failure",
|
|
570791
570795
|
error: error62
|
|
570792
570796
|
});
|
|
@@ -570794,17 +570798,17 @@ function sendWithHttp(request, url2, headers, compression, userAgent, agent, dat
|
|
|
570794
570798
|
});
|
|
570795
570799
|
res.on("error", (error62) => {
|
|
570796
570800
|
if (res.statusCode && res.statusCode <= 299) {
|
|
570797
|
-
|
|
570801
|
+
resolve59({
|
|
570798
570802
|
status: "success"
|
|
570799
570803
|
});
|
|
570800
570804
|
} else if (res.statusCode && isExportHTTPErrorRetryable(res.statusCode)) {
|
|
570801
|
-
|
|
570805
|
+
resolve59({
|
|
570802
570806
|
status: "retryable",
|
|
570803
570807
|
error: error62,
|
|
570804
570808
|
retryInMillis: parseRetryAfterToMills(res.headers["retry-after"])
|
|
570805
570809
|
});
|
|
570806
570810
|
} else {
|
|
570807
|
-
|
|
570811
|
+
resolve59({
|
|
570808
570812
|
status: "failure",
|
|
570809
570813
|
error: error62
|
|
570810
570814
|
});
|
|
@@ -570813,26 +570817,26 @@ function sendWithHttp(request, url2, headers, compression, userAgent, agent, dat
|
|
|
570813
570817
|
});
|
|
570814
570818
|
req.setTimeout(timeoutMillis, () => {
|
|
570815
570819
|
req.destroy();
|
|
570816
|
-
|
|
570820
|
+
resolve59({
|
|
570817
570821
|
status: "retryable",
|
|
570818
570822
|
error: new Error("Request timed out")
|
|
570819
570823
|
});
|
|
570820
570824
|
});
|
|
570821
570825
|
req.on("error", (error62) => {
|
|
570822
570826
|
if (isHttpTransportNetworkErrorRetryable(error62)) {
|
|
570823
|
-
|
|
570827
|
+
resolve59({
|
|
570824
570828
|
status: "retryable",
|
|
570825
570829
|
error: error62
|
|
570826
570830
|
});
|
|
570827
570831
|
} else {
|
|
570828
|
-
|
|
570832
|
+
resolve59({
|
|
570829
570833
|
status: "failure",
|
|
570830
570834
|
error: error62
|
|
570831
570835
|
});
|
|
570832
570836
|
}
|
|
570833
570837
|
});
|
|
570834
570838
|
compressAndSend(req, compression, data2, (error62) => {
|
|
570835
|
-
|
|
570839
|
+
resolve59({
|
|
570836
570840
|
status: "failure",
|
|
570837
570841
|
error: error62
|
|
570838
570842
|
});
|
|
@@ -570945,9 +570949,9 @@ var init_retrying_transport = __esm({
|
|
|
570945
570949
|
this._transport = transport;
|
|
570946
570950
|
}
|
|
570947
570951
|
retry(data2, timeoutMillis, inMillis) {
|
|
570948
|
-
return new Promise((
|
|
570952
|
+
return new Promise((resolve59, reject) => {
|
|
570949
570953
|
setTimeout(() => {
|
|
570950
|
-
this._transport.send(data2, timeoutMillis).then(
|
|
570954
|
+
this._transport.send(data2, timeoutMillis).then(resolve59, reject);
|
|
570951
570955
|
}, inMillis);
|
|
570952
570956
|
});
|
|
570953
570957
|
}
|
|
@@ -572133,14 +572137,14 @@ var require_BatchSpanProcessorBase = __commonJS({
|
|
|
572133
572137
|
* for all other cases _flush should be used
|
|
572134
572138
|
* */
|
|
572135
572139
|
_flushAll() {
|
|
572136
|
-
return new Promise((
|
|
572140
|
+
return new Promise((resolve59, reject) => {
|
|
572137
572141
|
const promises = [];
|
|
572138
572142
|
const count3 = Math.ceil(this._finishedSpans.length / this._maxExportBatchSize);
|
|
572139
572143
|
for (let i2 = 0, j2 = count3; i2 < j2; i2++) {
|
|
572140
572144
|
promises.push(this._flushOneBatch());
|
|
572141
572145
|
}
|
|
572142
572146
|
Promise.all(promises).then(() => {
|
|
572143
|
-
|
|
572147
|
+
resolve59();
|
|
572144
572148
|
}).catch(reject);
|
|
572145
572149
|
});
|
|
572146
572150
|
}
|
|
@@ -572149,7 +572153,7 @@ var require_BatchSpanProcessorBase = __commonJS({
|
|
|
572149
572153
|
if (this._finishedSpans.length === 0) {
|
|
572150
572154
|
return Promise.resolve();
|
|
572151
572155
|
}
|
|
572152
|
-
return new Promise((
|
|
572156
|
+
return new Promise((resolve59, reject) => {
|
|
572153
572157
|
const timer = setTimeout(() => {
|
|
572154
572158
|
reject(new Error("Timeout"));
|
|
572155
572159
|
}, this._exportTimeoutMillis);
|
|
@@ -572164,7 +572168,7 @@ var require_BatchSpanProcessorBase = __commonJS({
|
|
|
572164
572168
|
const doExport = () => this._exporter.export(spans, (result) => {
|
|
572165
572169
|
clearTimeout(timer);
|
|
572166
572170
|
if (result.code === core_1.ExportResultCode.SUCCESS) {
|
|
572167
|
-
|
|
572171
|
+
resolve59();
|
|
572168
572172
|
} else {
|
|
572169
572173
|
reject(result.error ?? new Error("BatchSpanProcessor: span export failed"));
|
|
572170
572174
|
}
|
|
@@ -572549,12 +572553,12 @@ var require_MultiSpanProcessor = __commonJS({
|
|
|
572549
572553
|
for (const spanProcessor of this._spanProcessors) {
|
|
572550
572554
|
promises.push(spanProcessor.forceFlush());
|
|
572551
572555
|
}
|
|
572552
|
-
return new Promise((
|
|
572556
|
+
return new Promise((resolve59) => {
|
|
572553
572557
|
Promise.all(promises).then(() => {
|
|
572554
|
-
|
|
572558
|
+
resolve59();
|
|
572555
572559
|
}).catch((error62) => {
|
|
572556
572560
|
(0, core_1.globalErrorHandler)(error62 || new Error("MultiSpanProcessor: forceFlush failed"));
|
|
572557
|
-
|
|
572561
|
+
resolve59();
|
|
572558
572562
|
});
|
|
572559
572563
|
});
|
|
572560
572564
|
}
|
|
@@ -572580,9 +572584,9 @@ var require_MultiSpanProcessor = __commonJS({
|
|
|
572580
572584
|
for (const spanProcessor of this._spanProcessors) {
|
|
572581
572585
|
promises.push(spanProcessor.shutdown());
|
|
572582
572586
|
}
|
|
572583
|
-
return new Promise((
|
|
572587
|
+
return new Promise((resolve59, reject) => {
|
|
572584
572588
|
Promise.all(promises).then(() => {
|
|
572585
|
-
|
|
572589
|
+
resolve59();
|
|
572586
572590
|
}, reject);
|
|
572587
572591
|
});
|
|
572588
572592
|
}
|
|
@@ -572637,32 +572641,32 @@ var require_BasicTracerProvider = __commonJS({
|
|
|
572637
572641
|
forceFlush() {
|
|
572638
572642
|
const timeout = this._config.forceFlushTimeoutMillis;
|
|
572639
572643
|
const promises = this._activeSpanProcessor["_spanProcessors"].map((spanProcessor) => {
|
|
572640
|
-
return new Promise((
|
|
572644
|
+
return new Promise((resolve59) => {
|
|
572641
572645
|
let state;
|
|
572642
572646
|
const timeoutInterval = setTimeout(() => {
|
|
572643
|
-
|
|
572647
|
+
resolve59(new Error(`Span processor did not completed within timeout period of ${timeout} ms`));
|
|
572644
572648
|
state = ForceFlushState.timeout;
|
|
572645
572649
|
}, timeout);
|
|
572646
572650
|
spanProcessor.forceFlush().then(() => {
|
|
572647
572651
|
clearTimeout(timeoutInterval);
|
|
572648
572652
|
if (state !== ForceFlushState.timeout) {
|
|
572649
572653
|
state = ForceFlushState.resolved;
|
|
572650
|
-
|
|
572654
|
+
resolve59(state);
|
|
572651
572655
|
}
|
|
572652
572656
|
}).catch((error62) => {
|
|
572653
572657
|
clearTimeout(timeoutInterval);
|
|
572654
572658
|
state = ForceFlushState.error;
|
|
572655
|
-
|
|
572659
|
+
resolve59(error62);
|
|
572656
572660
|
});
|
|
572657
572661
|
});
|
|
572658
572662
|
});
|
|
572659
|
-
return new Promise((
|
|
572663
|
+
return new Promise((resolve59, reject) => {
|
|
572660
572664
|
Promise.all(promises).then((results) => {
|
|
572661
572665
|
const errors = results.filter((result) => result !== ForceFlushState.resolved);
|
|
572662
572666
|
if (errors.length > 0) {
|
|
572663
572667
|
reject(errors);
|
|
572664
572668
|
} else {
|
|
572665
|
-
|
|
572669
|
+
resolve59();
|
|
572666
572670
|
}
|
|
572667
572671
|
}).catch((error62) => reject([error62]));
|
|
572668
572672
|
});
|
|
@@ -573571,8 +573575,8 @@ async function withTimeout2(promise2, timeoutMs2) {
|
|
|
573571
573575
|
try {
|
|
573572
573576
|
return await Promise.race([
|
|
573573
573577
|
promise2,
|
|
573574
|
-
new Promise((
|
|
573575
|
-
timeout = setTimeout(
|
|
573578
|
+
new Promise((resolve59) => {
|
|
573579
|
+
timeout = setTimeout(resolve59, Math.max(1, timeoutMs2));
|
|
573576
573580
|
})
|
|
573577
573581
|
]);
|
|
573578
573582
|
} finally {
|
|
@@ -578280,8 +578284,8 @@ async function closeSessionResourceWithinDeadline(name30, close, timeoutMs2, log
|
|
|
578280
578284
|
const closePromise = Promise.resolve().then(close);
|
|
578281
578285
|
const outcome = await Promise.race([
|
|
578282
578286
|
closePromise.then(() => ({ type: "completed" }), (error62) => ({ type: "failed", error: error62 })),
|
|
578283
|
-
new Promise((
|
|
578284
|
-
timer = setTimeout(() =>
|
|
578287
|
+
new Promise((resolve59) => {
|
|
578288
|
+
timer = setTimeout(() => resolve59({ type: "timed_out" }), timeoutMs2);
|
|
578285
578289
|
})
|
|
578286
578290
|
]);
|
|
578287
578291
|
if (timer)
|
|
@@ -579765,7 +579769,7 @@ function extractWorkflowScriptParts(source) {
|
|
|
579765
579769
|
};
|
|
579766
579770
|
}
|
|
579767
579771
|
async function evaluateMetaExpression(expression) {
|
|
579768
|
-
const child = (0,
|
|
579772
|
+
const child = (0, import_node_child_process13.spawn)(process.execPath, ["--input-type=module", "--eval", META_EVAL_SOURCE], {
|
|
579769
579773
|
stdio: ["pipe", "pipe", "pipe"]
|
|
579770
579774
|
});
|
|
579771
579775
|
const output2 = [];
|
|
@@ -579844,11 +579848,11 @@ function scanBlockComment(source, start) {
|
|
|
579844
579848
|
throw new Error("Workflow meta block comment is not closed.");
|
|
579845
579849
|
return index + 1;
|
|
579846
579850
|
}
|
|
579847
|
-
var
|
|
579851
|
+
var import_node_child_process13, import_node_crypto46, import_node_path107, META_EXPORT_PATTERN, META_EVAL_TIMEOUT_MS, MAX_META_EVAL_OUTPUT_BYTES, SCRIPT_READ_MAX_BYTES, META_EVAL_SOURCE;
|
|
579848
579852
|
var init_script_workflow_meta = __esm({
|
|
579849
579853
|
"../bootstrap/dist/app/script-workflow-meta.js"() {
|
|
579850
579854
|
"use strict";
|
|
579851
|
-
|
|
579855
|
+
import_node_child_process13 = require("node:child_process");
|
|
579852
579856
|
import_node_crypto46 = require("node:crypto");
|
|
579853
579857
|
import_node_path107 = require("node:path");
|
|
579854
579858
|
init_dist();
|
|
@@ -580420,7 +580424,7 @@ async function runScriptWorkflowChild(input2) {
|
|
|
580420
580424
|
scriptBody: input2.document.body,
|
|
580421
580425
|
scriptUrl: (0, import_node_url2.pathToFileURL)(input2.document.path).href
|
|
580422
580426
|
}), "utf8").toString("base64url");
|
|
580423
|
-
const child = (0,
|
|
580427
|
+
const child = (0, import_node_child_process14.spawn)(process.execPath, ["--input-type=module", "--eval", SCRIPT_WORKFLOW_CHILD_SOURCE, "--", payload], {
|
|
580424
580428
|
cwd: input2.workingDirectory,
|
|
580425
580429
|
stdio: ["pipe", "pipe", "pipe"]
|
|
580426
580430
|
});
|
|
@@ -580452,9 +580456,9 @@ async function runScriptWorkflowChild(input2) {
|
|
|
580452
580456
|
});
|
|
580453
580457
|
});
|
|
580454
580458
|
try {
|
|
580455
|
-
const exitCode = await new Promise((
|
|
580459
|
+
const exitCode = await new Promise((resolve59, reject) => {
|
|
580456
580460
|
child.on("error", reject);
|
|
580457
|
-
child.on("close",
|
|
580461
|
+
child.on("close", resolve59);
|
|
580458
580462
|
});
|
|
580459
580463
|
settled = true;
|
|
580460
580464
|
if (input2.signal?.aborted) {
|
|
@@ -580519,11 +580523,11 @@ function trimStderr(value2) {
|
|
|
580519
580523
|
return value2;
|
|
580520
580524
|
return value2.slice(-WORKFLOW_CHILD_STDERR_LIMIT);
|
|
580521
580525
|
}
|
|
580522
|
-
var
|
|
580526
|
+
var import_node_child_process14, import_node_readline, import_node_url2, WORKFLOW_CHILD_STDERR_LIMIT;
|
|
580523
580527
|
var init_script_workflow_process = __esm({
|
|
580524
580528
|
"../bootstrap/dist/app/script-workflow-process.js"() {
|
|
580525
580529
|
"use strict";
|
|
580526
|
-
|
|
580530
|
+
import_node_child_process14 = require("node:child_process");
|
|
580527
580531
|
import_node_readline = require("node:readline");
|
|
580528
580532
|
import_node_url2 = require("node:url");
|
|
580529
580533
|
init_script_workflow_child_source();
|
|
@@ -581062,7 +581066,7 @@ function waitForWorkflowTaskCompletion(completion, signal) {
|
|
|
581062
581066
|
return completion;
|
|
581063
581067
|
if (signal.aborted)
|
|
581064
581068
|
return Promise.reject(workflowAbortReason(signal));
|
|
581065
|
-
return new Promise((
|
|
581069
|
+
return new Promise((resolve59, reject) => {
|
|
581066
581070
|
const cleanup = () => {
|
|
581067
581071
|
signal.removeEventListener("abort", onAbort);
|
|
581068
581072
|
};
|
|
@@ -581073,7 +581077,7 @@ function waitForWorkflowTaskCompletion(completion, signal) {
|
|
|
581073
581077
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
581074
581078
|
completion.then((snapshot2) => {
|
|
581075
581079
|
cleanup();
|
|
581076
|
-
|
|
581080
|
+
resolve59(snapshot2);
|
|
581077
581081
|
}, (error62) => {
|
|
581078
581082
|
cleanup();
|
|
581079
581083
|
reject(error62);
|
|
@@ -581668,7 +581672,7 @@ async function runWorkflowScript(options2) {
|
|
|
581668
581672
|
source: renderChildEntry(payload, { runId }),
|
|
581669
581673
|
...options2.onWarning === void 0 ? {} : { onWarning: options2.onWarning }
|
|
581670
581674
|
});
|
|
581671
|
-
child = (0,
|
|
581675
|
+
child = (0, import_node_child_process15.spawn)(process.execPath, options2.childSpawn === void 0 ? [`--max-old-space-size=${maxOldSpaceSizeMb}`, entry.path] : [...options2.childSpawn.argsPrefix, entry.path], {
|
|
581672
581676
|
cwd,
|
|
581673
581677
|
stdio: ["pipe", "pipe", "pipe"],
|
|
581674
581678
|
// 桌面端 agent 由 Electron Helper 运行(process.execPath 指向 Helper),而 CLI
|
|
@@ -581707,7 +581711,7 @@ function bridge(deps) {
|
|
|
581707
581711
|
let finalized = false;
|
|
581708
581712
|
let timer;
|
|
581709
581713
|
let reader;
|
|
581710
|
-
return new Promise((
|
|
581714
|
+
return new Promise((resolve59) => {
|
|
581711
581715
|
const finalize2 = (settlement) => {
|
|
581712
581716
|
if (finalized)
|
|
581713
581717
|
return;
|
|
@@ -581719,7 +581723,7 @@ function bridge(deps) {
|
|
|
581719
581723
|
reader?.close();
|
|
581720
581724
|
if (child.exitCode === null && child.signalCode === null)
|
|
581721
581725
|
child.kill();
|
|
581722
|
-
|
|
581726
|
+
resolve59(settlement);
|
|
581723
581727
|
};
|
|
581724
581728
|
const failRun = (error62) => {
|
|
581725
581729
|
if (finalized)
|
|
@@ -581895,11 +581899,11 @@ function readSupersededBy(reason) {
|
|
|
581895
581899
|
const value2 = reason.superseded;
|
|
581896
581900
|
return typeof value2 === "string" && value2.length > 0 ? value2 : void 0;
|
|
581897
581901
|
}
|
|
581898
|
-
var
|
|
581902
|
+
var import_node_child_process15, import_node_readline2, DEFAULT_MAX_OLD_SPACE_MB, STDERR_LIMIT;
|
|
581899
581903
|
var init_harness = __esm({
|
|
581900
581904
|
"../dynamic-workflow-runtime/dist/harness.js"() {
|
|
581901
581905
|
"use strict";
|
|
581902
|
-
|
|
581906
|
+
import_node_child_process15 = require("node:child_process");
|
|
581903
581907
|
import_node_readline2 = require("node:readline");
|
|
581904
581908
|
init_dist32();
|
|
581905
581909
|
init_child_source();
|
|
@@ -582424,15 +582428,15 @@ async function settleOrAbort(settlement, signal) {
|
|
|
582424
582428
|
}
|
|
582425
582429
|
if (signal.aborted)
|
|
582426
582430
|
return;
|
|
582427
|
-
await new Promise((
|
|
582428
|
-
const onAbort = () =>
|
|
582431
|
+
await new Promise((resolve59) => {
|
|
582432
|
+
const onAbort = () => resolve59();
|
|
582429
582433
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
582430
582434
|
void settlement.then(() => {
|
|
582431
582435
|
signal.removeEventListener("abort", onAbort);
|
|
582432
|
-
|
|
582436
|
+
resolve59();
|
|
582433
582437
|
}, () => {
|
|
582434
582438
|
signal.removeEventListener("abort", onAbort);
|
|
582435
|
-
|
|
582439
|
+
resolve59();
|
|
582436
582440
|
});
|
|
582437
582441
|
});
|
|
582438
582442
|
}
|
|
@@ -583557,8 +583561,8 @@ function createWorkflowConcurrencyGovernor(options2) {
|
|
|
583557
583561
|
const bucket = bucketFor2(key2);
|
|
583558
583562
|
if (signal.aborted)
|
|
583559
583563
|
return Promise.reject(abortedError(signal));
|
|
583560
|
-
return new Promise((
|
|
583561
|
-
const waiter = { runId, resolve:
|
|
583564
|
+
return new Promise((resolve59, reject) => {
|
|
583565
|
+
const waiter = { runId, resolve: resolve59, reject, signal, onAbort: () => {
|
|
583562
583566
|
} };
|
|
583563
583567
|
waiter.onAbort = () => {
|
|
583564
583568
|
const queue2 = bucket.queues.get(runId);
|
|
@@ -583874,13 +583878,13 @@ var init_workflow_driver_concurrency = __esm({
|
|
|
583874
583878
|
|
|
583875
583879
|
// ../bootstrap/dist/app/workflow-driver-helpers.js
|
|
583876
583880
|
function defer2() {
|
|
583877
|
-
let
|
|
583881
|
+
let resolve59;
|
|
583878
583882
|
let reject;
|
|
583879
583883
|
const promise2 = new Promise((res, rej) => {
|
|
583880
|
-
|
|
583884
|
+
resolve59 = res;
|
|
583881
583885
|
reject = rej;
|
|
583882
583886
|
});
|
|
583883
|
-
return { promise: promise2, resolve:
|
|
583887
|
+
return { promise: promise2, resolve: resolve59, reject };
|
|
583884
583888
|
}
|
|
583885
583889
|
function mintActorSessionId(runId, actor) {
|
|
583886
583890
|
return createSessionId(`dwf-${sanitizeIdSegment(runId)}-${sanitizeIdSegment(refToString(actor))}`);
|
|
@@ -584114,8 +584118,8 @@ function closeActorRuntime(deps, state) {
|
|
|
584114
584118
|
}
|
|
584115
584119
|
async function settleWithin(work, delayMs, schedule) {
|
|
584116
584120
|
let cancel;
|
|
584117
|
-
const deadline = new Promise((
|
|
584118
|
-
cancel = schedule(
|
|
584121
|
+
const deadline = new Promise((resolve59) => {
|
|
584122
|
+
cancel = schedule(resolve59, delayMs);
|
|
584119
584123
|
});
|
|
584120
584124
|
try {
|
|
584121
584125
|
await Promise.race([work, deadline]);
|
|
@@ -584782,7 +584786,7 @@ function createWorkflowRunSeatGate(input2) {
|
|
|
584782
584786
|
if (signal?.aborted === true)
|
|
584783
584787
|
throw signal.reason;
|
|
584784
584788
|
working.delete(key2);
|
|
584785
|
-
return await new Promise((
|
|
584789
|
+
return await new Promise((resolve59, reject) => {
|
|
584786
584790
|
const onAbort = () => {
|
|
584787
584791
|
const index = parkedIndexOf(key2);
|
|
584788
584792
|
if (index >= 0) {
|
|
@@ -584795,7 +584799,7 @@ function createWorkflowRunSeatGate(input2) {
|
|
|
584795
584799
|
key: key2,
|
|
584796
584800
|
grant: () => {
|
|
584797
584801
|
signal?.removeEventListener("abort", onAbort);
|
|
584798
|
-
|
|
584802
|
+
resolve59();
|
|
584799
584803
|
},
|
|
584800
584804
|
refuse: (reason) => {
|
|
584801
584805
|
signal?.removeEventListener("abort", onAbort);
|
|
@@ -587498,8 +587502,8 @@ function createNodeReplBrowserBroker(input2) {
|
|
|
587498
587502
|
});
|
|
587499
587503
|
server2.listen(socketPath);
|
|
587500
587504
|
server2.unref();
|
|
587501
|
-
const ready = new Promise((
|
|
587502
|
-
server2.once("listening",
|
|
587505
|
+
const ready = new Promise((resolve59, reject) => {
|
|
587506
|
+
server2.once("listening", resolve59);
|
|
587503
587507
|
server2.once("error", reject);
|
|
587504
587508
|
});
|
|
587505
587509
|
return {
|
|
@@ -587617,7 +587621,7 @@ async function executeRequest(request, port, signal) {
|
|
|
587617
587621
|
return { id: request.id, ok: true, result };
|
|
587618
587622
|
}
|
|
587619
587623
|
async function readLine(socket, signal) {
|
|
587620
|
-
return await new Promise((
|
|
587624
|
+
return await new Promise((resolve59, reject) => {
|
|
587621
587625
|
let buffer = "";
|
|
587622
587626
|
const cleanup = () => {
|
|
587623
587627
|
socket.off("data", onData);
|
|
@@ -587635,7 +587639,7 @@ async function readLine(socket, signal) {
|
|
|
587635
587639
|
if (newline < 0)
|
|
587636
587640
|
return;
|
|
587637
587641
|
cleanup();
|
|
587638
|
-
|
|
587642
|
+
resolve59(buffer.slice(0, newline));
|
|
587639
587643
|
};
|
|
587640
587644
|
const onError = (error62) => {
|
|
587641
587645
|
cleanup();
|
|
@@ -587653,8 +587657,8 @@ async function readLine(socket, signal) {
|
|
|
587653
587657
|
async function closeServer2(server2) {
|
|
587654
587658
|
if (!server2.listening)
|
|
587655
587659
|
return;
|
|
587656
|
-
await new Promise((
|
|
587657
|
-
server2.close((error62) => error62 ? reject(error62) :
|
|
587660
|
+
await new Promise((resolve59, reject) => {
|
|
587661
|
+
server2.close((error62) => error62 ? reject(error62) : resolve59());
|
|
587658
587662
|
});
|
|
587659
587663
|
}
|
|
587660
587664
|
var import_node_crypto50, import_promises54, import_node_net3, import_node_os32, import_node_path114, NODE_REPL_MCP_SERVER_NAME, MAX_REQUEST_BYTES, UUID_PATTERN2;
|
|
@@ -590529,9 +590533,9 @@ async function openProtocolStartupStorage(options2) {
|
|
|
590529
590533
|
});
|
|
590530
590534
|
failedReported ||= params.phase === "failed";
|
|
590531
590535
|
options2.onProgress?.(params);
|
|
590532
|
-
await new Promise((
|
|
590536
|
+
await new Promise((resolve59, reject) => {
|
|
590533
590537
|
options2.output.write(`${JSON.stringify({ method: dcodeProtocolNotifications.storageStartup, params })}
|
|
590534
|
-
`, (error62) => error62 ? reject(error62) :
|
|
590538
|
+
`, (error62) => error62 ? reject(error62) : resolve59());
|
|
590535
590539
|
});
|
|
590536
590540
|
};
|
|
590537
590541
|
try {
|
|
@@ -590553,11 +590557,11 @@ async function openProtocolStartupStorage(options2) {
|
|
|
590553
590557
|
}
|
|
590554
590558
|
}
|
|
590555
590559
|
async function prepareProtocolStartupStorage(options2) {
|
|
590556
|
-
const { createInterface:
|
|
590560
|
+
const { createInterface: createInterface6 } = await import("node:readline");
|
|
590557
590561
|
const { dcodeStoragePathReadySchema: dcodeStoragePathReadySchema2, classifyDatabaseStartupError: classifyDatabaseStartupError2 } = await Promise.resolve().then(() => (init_src3(), src_exports));
|
|
590558
|
-
const lines =
|
|
590562
|
+
const lines = createInterface6({ input: options2.input });
|
|
590559
590563
|
let timer;
|
|
590560
|
-
const acknowledgement = new Promise((
|
|
590564
|
+
const acknowledgement = new Promise((resolve59, reject) => {
|
|
590561
590565
|
timer = setTimeout(() => reject(Object.assign(new Error("Storage observation handshake timed out"), {
|
|
590562
590566
|
kind: "startup_status_timeout"
|
|
590563
590567
|
})), 3e4);
|
|
@@ -590566,7 +590570,7 @@ async function prepareProtocolStartupStorage(options2) {
|
|
|
590566
590570
|
if (line.length > 1024)
|
|
590567
590571
|
throw new Error("Invalid storage acknowledgement");
|
|
590568
590572
|
const ack = dcodeStoragePathReadySchema2.parse(JSON.parse(line));
|
|
590569
|
-
|
|
590573
|
+
resolve59(ack.reuse ?? false);
|
|
590570
590574
|
} catch (error62) {
|
|
590571
590575
|
reject(error62);
|
|
590572
590576
|
}
|
|
@@ -590577,9 +590581,9 @@ async function prepareProtocolStartupStorage(options2) {
|
|
|
590577
590581
|
});
|
|
590578
590582
|
let store;
|
|
590579
590583
|
let failure4;
|
|
590580
|
-
const write2 = (frame) => new Promise((
|
|
590584
|
+
const write2 = (frame) => new Promise((resolve59, reject) => {
|
|
590581
590585
|
options2.output.write(`${JSON.stringify(frame)}
|
|
590582
|
-
`, (error62) => error62 ? reject(error62) :
|
|
590586
|
+
`, (error62) => error62 ? reject(error62) : resolve59());
|
|
590583
590587
|
});
|
|
590584
590588
|
try {
|
|
590585
590589
|
await write2({ method: "startup/storagePath", params: { path: options2.dbPath } });
|
|
@@ -592694,8 +592698,8 @@ var init_command_inbox = __esm({
|
|
|
592694
592698
|
async acquire(key2) {
|
|
592695
592699
|
const previous = this.tails.get(key2) ?? Promise.resolve();
|
|
592696
592700
|
let releaseCurrent;
|
|
592697
|
-
const current = new Promise((
|
|
592698
|
-
releaseCurrent =
|
|
592701
|
+
const current = new Promise((resolve59) => {
|
|
592702
|
+
releaseCurrent = resolve59;
|
|
592699
592703
|
});
|
|
592700
592704
|
const tail = previous.then(() => current);
|
|
592701
592705
|
this.tails.set(key2, tail);
|
|
@@ -592767,8 +592771,8 @@ var init_command_inbox = __esm({
|
|
|
592767
592771
|
const admittedAt = this.host.now?.() ?? Date.now();
|
|
592768
592772
|
this.admissionSeq.set(bucketKey, nextAdmissionSeq);
|
|
592769
592773
|
let resolveFinal;
|
|
592770
|
-
const final = new Promise((
|
|
592771
|
-
resolveFinal =
|
|
592774
|
+
const final = new Promise((resolve59) => {
|
|
592775
|
+
resolveFinal = resolve59;
|
|
592772
592776
|
});
|
|
592773
592777
|
const entry = { ack: decision.ack, final, resolveFinal };
|
|
592774
592778
|
this.mapFor(this.inFlight, bucketKey).set(envelope.commandId, entry);
|
|
@@ -599863,7 +599867,7 @@ var init_v4_gateway = __esm({
|
|
|
599863
599867
|
if (options2.signal?.aborted) {
|
|
599864
599868
|
return Promise.reject(new ProjectionEventCommitWaitError("fault.projectionEventCommit.aborted", `projection event commit wait aborted: ${eventId}`, { cause: options2.signal.reason }));
|
|
599865
599869
|
}
|
|
599866
|
-
return new Promise((
|
|
599870
|
+
return new Promise((resolve59, reject) => {
|
|
599867
599871
|
const byEvent = this.projectionEventCommitWaiters.get(sessionId) ?? /* @__PURE__ */ new Map();
|
|
599868
599872
|
this.projectionEventCommitWaiters.set(sessionId, byEvent);
|
|
599869
599873
|
const waiters = byEvent.get(eventId) ?? /* @__PURE__ */ new Set();
|
|
@@ -599884,7 +599888,7 @@ var init_v4_gateway = __esm({
|
|
|
599884
599888
|
return;
|
|
599885
599889
|
settled = true;
|
|
599886
599890
|
cleanup();
|
|
599887
|
-
|
|
599891
|
+
resolve59();
|
|
599888
599892
|
},
|
|
599889
599893
|
reject: (error62) => {
|
|
599890
599894
|
if (settled)
|
|
@@ -602069,7 +602073,7 @@ async function waitForSessionIdle(record3) {
|
|
|
602069
602073
|
if (Date.now() >= deadline) {
|
|
602070
602074
|
throw new V4SessionIdleTimeoutError(record3.app.sessionId);
|
|
602071
602075
|
}
|
|
602072
|
-
await new Promise((
|
|
602076
|
+
await new Promise((resolve59) => setTimeout(resolve59, IDLE_POLL_INTERVAL_MS));
|
|
602073
602077
|
}
|
|
602074
602078
|
}
|
|
602075
602079
|
async function preemptActiveTurnAndWait(host, record3, options2) {
|
|
@@ -605199,8 +605203,8 @@ async function raceClientRequestWithV4Interaction(context3, interactionId, outer
|
|
|
605199
605203
|
const controller = new AbortController();
|
|
605200
605204
|
let fullAccessFailure;
|
|
605201
605205
|
let finishAnswer;
|
|
605202
|
-
const answerReady = new Promise((
|
|
605203
|
-
finishAnswer =
|
|
605206
|
+
const answerReady = new Promise((resolve59) => {
|
|
605207
|
+
finishAnswer = resolve59;
|
|
605204
605208
|
});
|
|
605205
605209
|
const forwardAbort = () => {
|
|
605206
605210
|
controller.abort();
|
|
@@ -605220,8 +605224,8 @@ async function raceClientRequestWithV4Interaction(context3, interactionId, outer
|
|
|
605220
605224
|
...registrationOptions,
|
|
605221
605225
|
fullAccess: async () => {
|
|
605222
605226
|
let notifyFailure;
|
|
605223
|
-
const failure4 = new Promise((
|
|
605224
|
-
notifyFailure =
|
|
605227
|
+
const failure4 = new Promise((resolve59) => {
|
|
605228
|
+
notifyFailure = resolve59;
|
|
605225
605229
|
});
|
|
605226
605230
|
fullAccessFailure = failure4;
|
|
605227
605231
|
try {
|
|
@@ -609982,7 +609986,7 @@ function hasPendingOAuthAuthorization(statuses) {
|
|
|
609982
609986
|
return Object.values(statuses).some((status) => Boolean(status.authorization?.authorizationUrl));
|
|
609983
609987
|
}
|
|
609984
609988
|
function delay7(ms) {
|
|
609985
|
-
return new Promise((
|
|
609989
|
+
return new Promise((resolve59) => setTimeout(resolve59, ms));
|
|
609986
609990
|
}
|
|
609987
609991
|
var noopLogger, MCP_OAUTH_AUTHORIZATION_STATUS_WAIT_MS, MCP_OAUTH_AUTHORIZATION_STATUS_POLL_MS;
|
|
609988
609992
|
var init_mcp6 = __esm({
|
|
@@ -610402,14 +610406,14 @@ var init_interaction_registry = __esm({
|
|
|
610402
610406
|
* RPC-response 收口都清理,防泄漏)。同一 interactionId 重注册(reannounce 重发)覆盖
|
|
610403
610407
|
* 旧回调——旧的反向请求已被 broker 的 race/abort 作废,指向最新一次等待。
|
|
610404
610408
|
*/
|
|
610405
|
-
register(interactionId,
|
|
610409
|
+
register(interactionId, resolve59, options2) {
|
|
610406
610410
|
const previous = this.pending.get(interactionId);
|
|
610407
610411
|
const token2 = Symbol(interactionId);
|
|
610408
610412
|
if (previous) {
|
|
610409
610413
|
this.clearTimers(previous);
|
|
610410
610414
|
}
|
|
610411
610415
|
const entry = {
|
|
610412
|
-
resolve:
|
|
610416
|
+
resolve: resolve59,
|
|
610413
610417
|
options: options2,
|
|
610414
610418
|
token: token2,
|
|
610415
610419
|
autoResolutionEligible: previous?.autoResolutionEligible ?? (options2?.kind === "askUserQuestion" ? this.askUserQuestionAutoResolutionEnabled : false),
|
|
@@ -615399,12 +615403,12 @@ var init_server = __esm({
|
|
|
615399
615403
|
if (!this.messageSink) {
|
|
615400
615404
|
throw new ProtocolRequestError(-32020, `No DCode Protocol client is attached for ${method}`);
|
|
615401
615405
|
}
|
|
615402
|
-
return new Promise((
|
|
615406
|
+
return new Promise((resolve59, reject) => {
|
|
615403
615407
|
let active = true;
|
|
615404
615408
|
const pending = {
|
|
615405
615409
|
method,
|
|
615406
615410
|
reject,
|
|
615407
|
-
resolve:
|
|
615411
|
+
resolve: resolve59,
|
|
615408
615412
|
resultSchema,
|
|
615409
615413
|
requestKeys: /* @__PURE__ */ new Set(),
|
|
615410
615414
|
signal: options2?.signal
|
|
@@ -615525,8 +615529,8 @@ var init_transport2 = __esm({
|
|
|
615525
615529
|
drainTimer;
|
|
615526
615530
|
constructor(options2) {
|
|
615527
615531
|
this.options = options2;
|
|
615528
|
-
this.closedPromise = new Promise((
|
|
615529
|
-
this.resolveClosed =
|
|
615532
|
+
this.closedPromise = new Promise((resolve59, reject) => {
|
|
615533
|
+
this.resolveClosed = resolve59;
|
|
615530
615534
|
this.rejectClosed = reject;
|
|
615531
615535
|
});
|
|
615532
615536
|
}
|
|
@@ -615639,8 +615643,8 @@ var init_transport2 = __esm({
|
|
|
615639
615643
|
return;
|
|
615640
615644
|
}
|
|
615641
615645
|
let markStarted;
|
|
615642
|
-
const started = new Promise((
|
|
615643
|
-
markStarted =
|
|
615646
|
+
const started = new Promise((resolve59) => {
|
|
615647
|
+
markStarted = resolve59;
|
|
615644
615648
|
});
|
|
615645
615649
|
this.lastQueuedMessageStarted = started;
|
|
615646
615650
|
this.processing = this.processing.then(async () => {
|
|
@@ -615947,7 +615951,7 @@ async function acquireProtocolStartupResource(options2) {
|
|
|
615947
615951
|
signal?.throwIfAborted();
|
|
615948
615952
|
if (!signal)
|
|
615949
615953
|
return options2.create();
|
|
615950
|
-
return new Promise((
|
|
615954
|
+
return new Promise((resolve59, reject) => {
|
|
615951
615955
|
const abort = () => reject(signal.reason);
|
|
615952
615956
|
signal.addEventListener("abort", abort, { once: true });
|
|
615953
615957
|
void Promise.resolve().then(() => {
|
|
@@ -615956,7 +615960,7 @@ async function acquireProtocolStartupResource(options2) {
|
|
|
615956
615960
|
}).then(async (resource) => {
|
|
615957
615961
|
signal.removeEventListener("abort", abort);
|
|
615958
615962
|
if (!signal.aborted)
|
|
615959
|
-
return
|
|
615963
|
+
return resolve59(resource);
|
|
615960
615964
|
try {
|
|
615961
615965
|
await options2.disposeLate?.(resource);
|
|
615962
615966
|
} catch (error62) {
|
|
@@ -616409,6 +616413,139 @@ var init_dist37 = __esm({
|
|
|
616409
616413
|
}
|
|
616410
616414
|
});
|
|
616411
616415
|
|
|
616416
|
+
// src/first-run.ts
|
|
616417
|
+
function firstRunMarkerPath(env = process.env) {
|
|
616418
|
+
const configured = env.DCODE_DATA_BASE_DIR?.trim();
|
|
616419
|
+
if (configured && (0, import_node_path125.isAbsolute)(configured) && (0, import_node_path125.resolve)(configured) === configured) {
|
|
616420
|
+
return (0, import_node_path125.join)(configured, "cli", "first-run.json");
|
|
616421
|
+
}
|
|
616422
|
+
return (0, import_node_path125.join)((0, import_node_os35.homedir)(), ".dcode", "cli", "first-run.json");
|
|
616423
|
+
}
|
|
616424
|
+
function hasSeenFirstRunMarker(env) {
|
|
616425
|
+
try {
|
|
616426
|
+
const path6 = firstRunMarkerPath(env);
|
|
616427
|
+
if (!(0, import_node_fs46.existsSync)(path6)) return false;
|
|
616428
|
+
return JSON.parse((0, import_node_fs46.readFileSync)(path6, "utf8"))?.seen === true;
|
|
616429
|
+
} catch {
|
|
616430
|
+
return false;
|
|
616431
|
+
}
|
|
616432
|
+
}
|
|
616433
|
+
function writeFirstRunMarker(env) {
|
|
616434
|
+
try {
|
|
616435
|
+
const path6 = firstRunMarkerPath(env);
|
|
616436
|
+
const dir = path6.slice(0, Math.max(path6.lastIndexOf("/"), path6.lastIndexOf("\\")));
|
|
616437
|
+
if (dir) (0, import_node_fs46.mkdirSync)(dir, { recursive: true });
|
|
616438
|
+
(0, import_node_fs46.writeFileSync)(path6, JSON.stringify({ seen: true, at: Date.now() }), "utf8");
|
|
616439
|
+
} catch {
|
|
616440
|
+
}
|
|
616441
|
+
}
|
|
616442
|
+
async function hasDcodeCredentials(env) {
|
|
616443
|
+
try {
|
|
616444
|
+
const store = createSharedDCodeCredentialStore({ env });
|
|
616445
|
+
const values = await store.loadMany(["oauth:dcode:access_token"]);
|
|
616446
|
+
return Boolean(values["oauth:dcode:access_token"]?.trim());
|
|
616447
|
+
} catch {
|
|
616448
|
+
return false;
|
|
616449
|
+
}
|
|
616450
|
+
}
|
|
616451
|
+
async function shouldRunFirstRunOnboarding(options2 = {}) {
|
|
616452
|
+
const env = options2.env ?? process.env;
|
|
616453
|
+
if (hasSeenFirstRunMarker(env)) return false;
|
|
616454
|
+
if (env.DCODE_SKIP_FIRST_RUN === "1" || env.CI === "true") return false;
|
|
616455
|
+
if (!process.stdout.isTTY || !process.stdin.isTTY) return false;
|
|
616456
|
+
if (await hasDcodeCredentials(env)) {
|
|
616457
|
+
writeFirstRunMarker(env);
|
|
616458
|
+
return false;
|
|
616459
|
+
}
|
|
616460
|
+
return true;
|
|
616461
|
+
}
|
|
616462
|
+
async function askContinueOrSkip(question, options2) {
|
|
616463
|
+
const rl = (0, import_promises59.createInterface)({
|
|
616464
|
+
input: options2.input ?? process.stdin,
|
|
616465
|
+
output: options2.output ?? process.stdout
|
|
616466
|
+
});
|
|
616467
|
+
try {
|
|
616468
|
+
const answer = (await rl.question(question)).trim().toLowerCase();
|
|
616469
|
+
return answer === "s" || answer === "n" ? "skip" : "continue";
|
|
616470
|
+
} catch {
|
|
616471
|
+
return "skip";
|
|
616472
|
+
} finally {
|
|
616473
|
+
rl.close();
|
|
616474
|
+
}
|
|
616475
|
+
}
|
|
616476
|
+
async function runFirstRunOnboarding(options2 = {}) {
|
|
616477
|
+
const env = options2.env ?? process.env;
|
|
616478
|
+
const out = options2.output ?? process.stdout;
|
|
616479
|
+
const useColor = !options2.noColor && !env.NO_COLOR;
|
|
616480
|
+
const blue = (text3) => useColor ? THEME_BLUE + text3 + RESET : text3;
|
|
616481
|
+
const bold = (text3) => useColor ? BOLD + text3 + RESET : text3;
|
|
616482
|
+
const dim = (text3) => useColor ? DIM + text3 + RESET : text3;
|
|
616483
|
+
out.write("\n");
|
|
616484
|
+
for (const line of DCODE_MARK) {
|
|
616485
|
+
out.write(" " + blue(line) + "\n");
|
|
616486
|
+
}
|
|
616487
|
+
out.write("\n");
|
|
616488
|
+
out.write(" " + bold("dcode") + dim(" - the agentic coding harness by DipoleML") + "\n");
|
|
616489
|
+
out.write(" " + dim("Canadian Frontier Intelligence - dipoleml.com") + "\n");
|
|
616490
|
+
out.write("\n");
|
|
616491
|
+
const decision = await askContinueOrSkip(
|
|
616492
|
+
" " + dim("Sign in with your DipoleML account to start (Enter), or") + " s " + dim("to skip: "),
|
|
616493
|
+
options2
|
|
616494
|
+
);
|
|
616495
|
+
if (decision === "skip") {
|
|
616496
|
+
writeFirstRunMarker(env);
|
|
616497
|
+
out.write("\n " + dim("Skipped. You can sign in any time with: dcode login") + "\n\n");
|
|
616498
|
+
return "skipped";
|
|
616499
|
+
}
|
|
616500
|
+
const result = await loginDCodeCli({
|
|
616501
|
+
env,
|
|
616502
|
+
onAuthorizeUrl: (initData) => {
|
|
616503
|
+
out.write("\n Opening your browser to sign in...\n");
|
|
616504
|
+
out.write(" " + dim("If nothing opens, copy this URL:") + "\n");
|
|
616505
|
+
out.write(" " + initData.authorize_url + "\n");
|
|
616506
|
+
out.write(" " + dim("Waiting for authorization") + "\n");
|
|
616507
|
+
}
|
|
616508
|
+
}).then(
|
|
616509
|
+
(value2) => ({ ok: true, value: value2 }),
|
|
616510
|
+
(error62) => ({ ok: false, error: error62 })
|
|
616511
|
+
);
|
|
616512
|
+
if (!result.ok) {
|
|
616513
|
+
out.write("\n Sign-in did not complete. Try again any time with: dcode login\n\n");
|
|
616514
|
+
return "failed";
|
|
616515
|
+
}
|
|
616516
|
+
const name30 = result.value.user?.name?.trim();
|
|
616517
|
+
writeFirstRunMarker(env);
|
|
616518
|
+
out.write(
|
|
616519
|
+
"\n Signed in" + (name30 ? " as " + name30 : "") + ". " + dim("Welcome aboard.") + "\n\n"
|
|
616520
|
+
);
|
|
616521
|
+
return "completed";
|
|
616522
|
+
}
|
|
616523
|
+
var import_node_fs46, import_node_os35, import_node_path125, import_promises59, THEME_BLUE, DIM, BOLD, RESET, DCODE_MARK;
|
|
616524
|
+
var init_first_run = __esm({
|
|
616525
|
+
"src/first-run.ts"() {
|
|
616526
|
+
"use strict";
|
|
616527
|
+
import_node_fs46 = require("node:fs");
|
|
616528
|
+
import_node_os35 = require("node:os");
|
|
616529
|
+
import_node_path125 = require("node:path");
|
|
616530
|
+
import_promises59 = require("node:readline/promises");
|
|
616531
|
+
init_dist31();
|
|
616532
|
+
init_dist37();
|
|
616533
|
+
THEME_BLUE = "\x1B[38;2;0;80;223m";
|
|
616534
|
+
DIM = "\x1B[2m";
|
|
616535
|
+
BOLD = "\x1B[1m";
|
|
616536
|
+
RESET = "\x1B[0m";
|
|
616537
|
+
DCODE_MARK = [
|
|
616538
|
+
" \u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584 ",
|
|
616539
|
+
" \u2588\u2588\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2588\u2588 ",
|
|
616540
|
+
" \u2588\u2588 \u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584 \u2588\u2588 ",
|
|
616541
|
+
" \u2588\u2588 \u2588 \u2584\u2584 \u2588\u2588 ",
|
|
616542
|
+
" \u2588\u2588 \u2588\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2580\u2580 \u2588\u2588 ",
|
|
616543
|
+
" \u2588\u2588\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2588\u2588 ",
|
|
616544
|
+
" \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580 "
|
|
616545
|
+
];
|
|
616546
|
+
}
|
|
616547
|
+
});
|
|
616548
|
+
|
|
616412
616549
|
// src/hooks-trust-command.ts
|
|
616413
616550
|
async function runHooksCommand(ctx, deps, version4) {
|
|
616414
616551
|
if (ctx.argv[1] !== "trust") return fail(ctx, `Unknown hooks command: ${ctx.argv[1] ?? ""}`);
|
|
@@ -616490,7 +616627,7 @@ function resolveTarget(value2, cwd, userConfigPath) {
|
|
|
616490
616627
|
const selected = value2?.trim();
|
|
616491
616628
|
const identity = selected && looksLikeWorkspaceIdentity(selected) ? selected : void 0;
|
|
616492
616629
|
return {
|
|
616493
|
-
workspacePath: identity ? (0,
|
|
616630
|
+
workspacePath: identity ? (0, import_node_path126.resolve)(cwd) : selected ? (0, import_node_path126.resolve)(cwd, selected) : (0, import_node_path126.resolve)(cwd),
|
|
616494
616631
|
...identity ? { workspaceIdentity: identity } : {},
|
|
616495
616632
|
...userConfigPath ? { userConfigPath } : {}
|
|
616496
616633
|
};
|
|
@@ -616544,12 +616681,12 @@ function fail(ctx, message) {
|
|
|
616544
616681
|
${USAGE}`);
|
|
616545
616682
|
return 1;
|
|
616546
616683
|
}
|
|
616547
|
-
var import_node_util11,
|
|
616684
|
+
var import_node_util11, import_node_path126, USAGE;
|
|
616548
616685
|
var init_hooks_trust_command = __esm({
|
|
616549
616686
|
"src/hooks-trust-command.ts"() {
|
|
616550
616687
|
"use strict";
|
|
616551
616688
|
import_node_util11 = require("node:util");
|
|
616552
|
-
|
|
616689
|
+
import_node_path126 = require("node:path");
|
|
616553
616690
|
USAGE = `Usage:
|
|
616554
616691
|
dcode hooks trust status [--workspace <path-or-identity>] [--json]
|
|
616555
616692
|
dcode hooks trust review [--workspace <path-or-identity>] [--json]
|
|
@@ -616618,12 +616755,12 @@ function resolveNativeSearchArgs(command, args) {
|
|
|
616618
616755
|
return [...GREP_DEFAULT_ARGS, ...args];
|
|
616619
616756
|
}
|
|
616620
616757
|
function runNativeSearchCommand(command, args, io, signal) {
|
|
616621
|
-
return new Promise((
|
|
616758
|
+
return new Promise((resolve59) => {
|
|
616622
616759
|
if (signal.aborted) {
|
|
616623
|
-
|
|
616760
|
+
resolve59(exitCodeForAbortSignal(signal));
|
|
616624
616761
|
return;
|
|
616625
616762
|
}
|
|
616626
|
-
const child = (0,
|
|
616763
|
+
const child = (0, import_node_child_process16.spawn)(command, resolveNativeSearchArgs(command, args), {
|
|
616627
616764
|
cwd: io.cwd,
|
|
616628
616765
|
stdio: ["pipe", "pipe", "pipe"],
|
|
616629
616766
|
windowsHide: true
|
|
@@ -616643,7 +616780,7 @@ function runNativeSearchCommand(command, args, io, signal) {
|
|
|
616643
616780
|
if (settled) return;
|
|
616644
616781
|
settled = true;
|
|
616645
616782
|
cleanupRuntimeListeners();
|
|
616646
|
-
|
|
616783
|
+
resolve59(exitCode);
|
|
616647
616784
|
};
|
|
616648
616785
|
const requestChildTermination = () => {
|
|
616649
616786
|
if (terminationRequested || childExited) return;
|
|
@@ -616771,7 +616908,7 @@ function terminateNativeSearchChild(child, hasExited) {
|
|
|
616771
616908
|
return void 0;
|
|
616772
616909
|
}
|
|
616773
616910
|
if (process.platform === "win32") {
|
|
616774
|
-
const killer = (0,
|
|
616911
|
+
const killer = (0, import_node_child_process16.spawn)("taskkill", ["/pid", String(pid), "/T", "/F"], {
|
|
616775
616912
|
stdio: "ignore",
|
|
616776
616913
|
windowsHide: true
|
|
616777
616914
|
});
|
|
@@ -616808,11 +616945,11 @@ function isGrepBypassArgument(argument) {
|
|
|
616808
616945
|
function isOutputClosedError(error62) {
|
|
616809
616946
|
return typeof error62 === "object" && error62 !== null && "code" in error62 && typeof error62.code === "string" && OUTPUT_CLOSED_ERROR_CODES.has(error62.code);
|
|
616810
616947
|
}
|
|
616811
|
-
var
|
|
616948
|
+
var import_node_child_process16, GREP_DEFAULT_ARGS, GREP_BYPASS_PATTERNS, OUTPUT_CLOSED_ERROR_CODES, SIGTERM_TO_SIGKILL_MS, DEFAULT_ABORT_EXIT_CODE, SIGNAL_EXIT_CODES3, EMBEDDED_SEARCH_ABORT_REASON;
|
|
616812
616949
|
var init_embedded_search_cli = __esm({
|
|
616813
616950
|
"src/internal-search/embedded-search-cli.ts"() {
|
|
616814
616951
|
"use strict";
|
|
616815
|
-
|
|
616952
|
+
import_node_child_process16 = require("node:child_process");
|
|
616816
616953
|
GREP_DEFAULT_ARGS = [
|
|
616817
616954
|
"-G",
|
|
616818
616955
|
"-I",
|
|
@@ -617032,10 +617169,10 @@ function resolveCliCwd(options2) {
|
|
|
617032
617169
|
if (options2.requestedCwd.length === 0) {
|
|
617033
617170
|
throw new Error(`${CWD_OPTION_LABEL} requires a non-empty path.`);
|
|
617034
617171
|
}
|
|
617035
|
-
const workingDirectory = (0,
|
|
617172
|
+
const workingDirectory = (0, import_node_path127.resolve)(baseDirectory, options2.requestedCwd);
|
|
617036
617173
|
let stats;
|
|
617037
617174
|
try {
|
|
617038
|
-
stats = (0,
|
|
617175
|
+
stats = (0, import_node_fs47.statSync)(workingDirectory);
|
|
617039
617176
|
} catch (error62) {
|
|
617040
617177
|
throw new Error(`${CWD_OPTION_LABEL} path is not accessible: ${workingDirectory}`, {
|
|
617041
617178
|
cause: error62
|
|
@@ -617046,12 +617183,12 @@ function resolveCliCwd(options2) {
|
|
|
617046
617183
|
}
|
|
617047
617184
|
return workingDirectory;
|
|
617048
617185
|
}
|
|
617049
|
-
var
|
|
617186
|
+
var import_node_fs47, import_node_path127, CWD_OPTION_LABEL;
|
|
617050
617187
|
var init_cwd = __esm({
|
|
617051
617188
|
"src/cwd.ts"() {
|
|
617052
617189
|
"use strict";
|
|
617053
|
-
|
|
617054
|
-
|
|
617190
|
+
import_node_fs47 = require("node:fs");
|
|
617191
|
+
import_node_path127 = require("node:path");
|
|
617055
617192
|
CWD_OPTION_LABEL = "--cwd";
|
|
617056
617193
|
}
|
|
617057
617194
|
});
|
|
@@ -617209,7 +617346,7 @@ async function runDwfChildCommand(ctx, argv) {
|
|
|
617209
617346
|
return 1;
|
|
617210
617347
|
}
|
|
617211
617348
|
try {
|
|
617212
|
-
const entry = await import((0, import_node_url3.pathToFileURL)((0,
|
|
617349
|
+
const entry = await import((0, import_node_url3.pathToFileURL)((0, import_node_path128.resolve)(entryPath)).href);
|
|
617213
617350
|
if (typeof entry.start !== "function") {
|
|
617214
617351
|
throw new Error(`workflow entry file exports no start(): ${entryPath}`);
|
|
617215
617352
|
}
|
|
@@ -617227,11 +617364,11 @@ async function runDwfChildCommand(ctx, argv) {
|
|
|
617227
617364
|
return 1;
|
|
617228
617365
|
}
|
|
617229
617366
|
}
|
|
617230
|
-
var
|
|
617367
|
+
var import_node_path128, import_node_readline3, import_node_url3, import_node_vm3;
|
|
617231
617368
|
var init_dwf_child_command = __esm({
|
|
617232
617369
|
"src/dwf-child-command.ts"() {
|
|
617233
617370
|
"use strict";
|
|
617234
|
-
|
|
617371
|
+
import_node_path128 = require("node:path");
|
|
617235
617372
|
import_node_readline3 = require("node:readline");
|
|
617236
617373
|
import_node_url3 = require("node:url");
|
|
617237
617374
|
import_node_vm3 = require("node:vm");
|
|
@@ -619377,22 +619514,22 @@ async function loadCliPlaywrightChromium() {
|
|
|
619377
619514
|
return await import("playwright-core");
|
|
619378
619515
|
}
|
|
619379
619516
|
const runtimeDirectory = await ensureSeaPlaywrightRuntime(sea);
|
|
619380
|
-
const require2 = (0, import_node_module2.createRequire)((0,
|
|
619517
|
+
const require2 = (0, import_node_module2.createRequire)((0, import_node_path129.join)(runtimeDirectory, "dcode-playwright-loader.cjs"));
|
|
619381
619518
|
return require2("playwright-core");
|
|
619382
619519
|
}
|
|
619383
619520
|
async function ensureSeaPlaywrightRuntime(sea) {
|
|
619384
619521
|
const manifest = readManifest3(sea);
|
|
619385
|
-
const cacheDirectory = (0,
|
|
619522
|
+
const cacheDirectory = (0, import_node_path129.join)(
|
|
619386
619523
|
cacheBaseDirectory(),
|
|
619387
|
-
"1.
|
|
619524
|
+
"1.1.0",
|
|
619388
619525
|
manifest.target,
|
|
619389
619526
|
`playwright-${manifest.packageVersion}-${manifest.hash}`
|
|
619390
619527
|
);
|
|
619391
|
-
const markerPath = (0,
|
|
619528
|
+
const markerPath = (0, import_node_path129.join)(cacheDirectory, MARKER_FILE);
|
|
619392
619529
|
if (await isCacheCurrent2(markerPath, manifest)) return cacheDirectory;
|
|
619393
619530
|
const temporaryDirectory = `${cacheDirectory}.tmp-${process.pid}-${Date.now()}`;
|
|
619394
|
-
await (0,
|
|
619395
|
-
await (0,
|
|
619531
|
+
await (0, import_promises60.rm)(temporaryDirectory, { force: true, recursive: true });
|
|
619532
|
+
await (0, import_promises60.mkdir)(temporaryDirectory, { recursive: true });
|
|
619396
619533
|
for (const file3 of manifest.files) {
|
|
619397
619534
|
assertSafeRuntimePath(file3.path);
|
|
619398
619535
|
const bytes = Buffer.from(sea.getRawAsset(`${ASSET_PREFIX}${file3.path}`));
|
|
@@ -619400,18 +619537,18 @@ async function ensureSeaPlaywrightRuntime(sea) {
|
|
|
619400
619537
|
if (hash2 !== file3.sha256) {
|
|
619401
619538
|
throw new Error(`SEA Playwright asset hash mismatch for ${file3.path}`);
|
|
619402
619539
|
}
|
|
619403
|
-
const outputPath = (0,
|
|
619404
|
-
await (0,
|
|
619405
|
-
await (0,
|
|
619406
|
-
await (0,
|
|
619540
|
+
const outputPath = (0, import_node_path129.join)(temporaryDirectory, file3.path);
|
|
619541
|
+
await (0, import_promises60.mkdir)((0, import_node_path129.dirname)(outputPath), { recursive: true });
|
|
619542
|
+
await (0, import_promises60.writeFile)(outputPath, bytes);
|
|
619543
|
+
await (0, import_promises60.chmod)(outputPath, file3.mode);
|
|
619407
619544
|
}
|
|
619408
|
-
if (!(0,
|
|
619545
|
+
if (!(0, import_node_fs48.existsSync)((0, import_node_path129.join)(temporaryDirectory, PACKAGE_JSON_PATH))) {
|
|
619409
619546
|
throw new Error("SEA Playwright runtime is missing playwright-core/package.json");
|
|
619410
619547
|
}
|
|
619411
|
-
await (0,
|
|
619412
|
-
await (0,
|
|
619413
|
-
await (0,
|
|
619414
|
-
await (0,
|
|
619548
|
+
await (0, import_promises60.writeFile)((0, import_node_path129.join)(temporaryDirectory, MARKER_FILE), JSON.stringify(manifest, null, 2));
|
|
619549
|
+
await (0, import_promises60.mkdir)((0, import_node_path129.dirname)(cacheDirectory), { recursive: true });
|
|
619550
|
+
await (0, import_promises60.rm)(cacheDirectory, { force: true, recursive: true });
|
|
619551
|
+
await (0, import_promises60.rename)(temporaryDirectory, cacheDirectory);
|
|
619415
619552
|
return cacheDirectory;
|
|
619416
619553
|
}
|
|
619417
619554
|
function readManifest3(sea) {
|
|
@@ -619422,49 +619559,49 @@ function readManifest3(sea) {
|
|
|
619422
619559
|
return parsed;
|
|
619423
619560
|
}
|
|
619424
619561
|
async function isCacheCurrent2(markerPath, expected) {
|
|
619425
|
-
if (!(0,
|
|
619562
|
+
if (!(0, import_node_fs48.existsSync)(markerPath)) return false;
|
|
619426
619563
|
try {
|
|
619427
|
-
const current = JSON.parse(await (0,
|
|
619564
|
+
const current = JSON.parse(await (0, import_promises60.readFile)(markerPath, "utf8"));
|
|
619428
619565
|
return current.hash === expected.hash && current.target === expected.target;
|
|
619429
619566
|
} catch {
|
|
619430
619567
|
return false;
|
|
619431
619568
|
}
|
|
619432
619569
|
}
|
|
619433
619570
|
function assertSafeRuntimePath(filePath) {
|
|
619434
|
-
const normalized = (0,
|
|
619435
|
-
if (normalized.startsWith(`..${
|
|
619571
|
+
const normalized = (0, import_node_path129.normalize)(filePath);
|
|
619572
|
+
if (normalized.startsWith(`..${import_node_path129.sep}`) || normalized === ".." || !normalized.startsWith(`node_modules${import_node_path129.sep}playwright-core${import_node_path129.sep}`)) {
|
|
619436
619573
|
throw new Error(`Invalid SEA Playwright asset path: ${filePath}`);
|
|
619437
619574
|
}
|
|
619438
619575
|
}
|
|
619439
619576
|
function cacheBaseDirectory() {
|
|
619440
|
-
const home = (0,
|
|
619441
|
-
if ((0,
|
|
619442
|
-
return (0,
|
|
619577
|
+
const home = (0, import_node_os36.homedir)();
|
|
619578
|
+
if ((0, import_node_os36.platform)() === "darwin" && home) {
|
|
619579
|
+
return (0, import_node_path129.join)(home, "Library", "Caches", "dcode", "sea-assets");
|
|
619443
619580
|
}
|
|
619444
|
-
if ((0,
|
|
619445
|
-
return (0,
|
|
619446
|
-
process.env.LOCALAPPDATA ?? (0,
|
|
619581
|
+
if ((0, import_node_os36.platform)() === "win32") {
|
|
619582
|
+
return (0, import_node_path129.join)(
|
|
619583
|
+
process.env.LOCALAPPDATA ?? (0, import_node_path129.join)(home || (0, import_node_os36.tmpdir)(), "AppData", "Local"),
|
|
619447
619584
|
"dcode",
|
|
619448
619585
|
"Cache",
|
|
619449
619586
|
"sea-assets"
|
|
619450
619587
|
);
|
|
619451
619588
|
}
|
|
619452
|
-
return (0,
|
|
619453
|
-
process.env.XDG_CACHE_HOME ?? (0,
|
|
619589
|
+
return (0, import_node_path129.join)(
|
|
619590
|
+
process.env.XDG_CACHE_HOME ?? (0, import_node_path129.join)(home || (0, import_node_os36.tmpdir)(), ".cache"),
|
|
619454
619591
|
"dcode",
|
|
619455
619592
|
"sea-assets"
|
|
619456
619593
|
);
|
|
619457
619594
|
}
|
|
619458
|
-
var import_node_crypto59,
|
|
619595
|
+
var import_node_crypto59, import_node_fs48, import_promises60, import_node_module2, import_node_os36, import_node_path129, ASSET_PREFIX, MANIFEST_ASSET_KEY, MARKER_FILE, PACKAGE_JSON_PATH;
|
|
619459
619596
|
var init_sea_playwright_runtime = __esm({
|
|
619460
619597
|
"src/sea-playwright-runtime.ts"() {
|
|
619461
619598
|
"use strict";
|
|
619462
619599
|
import_node_crypto59 = require("node:crypto");
|
|
619463
|
-
|
|
619464
|
-
|
|
619600
|
+
import_node_fs48 = require("node:fs");
|
|
619601
|
+
import_promises60 = require("node:fs/promises");
|
|
619465
619602
|
import_node_module2 = require("node:module");
|
|
619466
|
-
|
|
619467
|
-
|
|
619603
|
+
import_node_os36 = require("node:os");
|
|
619604
|
+
import_node_path129 = require("node:path");
|
|
619468
619605
|
ASSET_PREFIX = "dcode-playwright-runtime/";
|
|
619469
619606
|
MANIFEST_ASSET_KEY = `${ASSET_PREFIX}manifest.json`;
|
|
619470
619607
|
MARKER_FILE = "playwright-manifest.json";
|
|
@@ -619640,7 +619777,7 @@ var init_headless_workflow = __esm({
|
|
|
619640
619777
|
HEADLESS_WORKFLOW_POLL_INTERVAL_MS = 100;
|
|
619641
619778
|
waitForHeadlessWorkflowSettle = async (input2) => {
|
|
619642
619779
|
const intervalMs = input2.intervalMs ?? HEADLESS_WORKFLOW_POLL_INTERVAL_MS;
|
|
619643
|
-
const sleep9 = input2.sleep ?? ((ms) => new Promise((
|
|
619780
|
+
const sleep9 = input2.sleep ?? ((ms) => new Promise((resolve59) => setTimeout(resolve59, ms)));
|
|
619644
619781
|
while (!input2.signal.aborted) {
|
|
619645
619782
|
if (!input2.runtime.hasRunningBackgroundTasks() && !input2.runtime.hasActiveOrQueuedTurnWork()) {
|
|
619646
619783
|
return;
|
|
@@ -619873,7 +620010,7 @@ ${SKILLS_COMMAND_USAGE}
|
|
|
619873
620010
|
|
|
619874
620011
|
// src/prompt-command.ts
|
|
619875
620012
|
function inferAttachmentTypeFromPath(path6) {
|
|
619876
|
-
const extension = (0,
|
|
620013
|
+
const extension = (0, import_node_path130.extname)(path6).toLowerCase();
|
|
619877
620014
|
if (IMAGE_EXTENSIONS.has(extension)) return "image";
|
|
619878
620015
|
if (VIDEO_EXTENSIONS.has(extension)) return "video";
|
|
619879
620016
|
if (extension === ".pdf") return "pdf";
|
|
@@ -620017,11 +620154,11 @@ function writeHeadlessWorkspaceHookTrustDiagnostic(ctx, status) {
|
|
|
620017
620154
|
].join("\n") + "\n"
|
|
620018
620155
|
);
|
|
620019
620156
|
}
|
|
620020
|
-
var
|
|
620157
|
+
var import_node_path130, wantsJsonSummary, wantsEventStream, IMAGE_EXTENSIONS, VIDEO_EXTENSIONS, EMPTY_PROMPT_ERROR, MEMORY_BENCH_DISABLED_ERROR, TARGET_SELECTION_UNAVAILABLE_ERROR, runPrompt, customCommandNotFoundPattern2, HEADLESS_WORKSPACE_HOOK_BLOCK_REASONS;
|
|
620021
620158
|
var init_prompt_command = __esm({
|
|
620022
620159
|
"src/prompt-command.ts"() {
|
|
620023
620160
|
"use strict";
|
|
620024
|
-
|
|
620161
|
+
import_node_path130 = require("node:path");
|
|
620025
620162
|
init_dist33();
|
|
620026
620163
|
init_bootstrap_loader();
|
|
620027
620164
|
init_command_center();
|
|
@@ -621003,8 +621140,8 @@ Scopes: user (default), project. \`dcode plugin\` is an alias of \`dcode plugins
|
|
|
621003
621140
|
|
|
621004
621141
|
// src/clipboard-image.ts
|
|
621005
621142
|
function resolveDefaultClipboardDirectory(processEnv = process.env) {
|
|
621006
|
-
const storageRoot = processEnv.DCODE_STORAGE_DIR?.trim() || (0,
|
|
621007
|
-
return (0,
|
|
621143
|
+
const storageRoot = processEnv.DCODE_STORAGE_DIR?.trim() || (0, import_node_path131.join)((0, import_node_os37.homedir)(), ".dcode");
|
|
621144
|
+
return (0, import_node_path131.join)(storageRoot, "clipboard");
|
|
621008
621145
|
}
|
|
621009
621146
|
function createNodeClipboardImageReader(options2 = {}) {
|
|
621010
621147
|
const platform4 = options2.platform ?? process.platform;
|
|
@@ -621039,9 +621176,9 @@ function createNodeClipboardImageReader(options2 = {}) {
|
|
|
621039
621176
|
};
|
|
621040
621177
|
}
|
|
621041
621178
|
async function readMacClipboardImage(options2) {
|
|
621042
|
-
await (0,
|
|
621043
|
-
const directory = await (0,
|
|
621044
|
-
const imagePath = (0,
|
|
621179
|
+
await (0, import_promises61.mkdir)(options2.tempDirectory, { recursive: true });
|
|
621180
|
+
const directory = await (0, import_promises61.mkdtemp)((0, import_node_path131.join)(options2.tempDirectory, "dcode-clipboard-"));
|
|
621181
|
+
const imagePath = (0, import_node_path131.join)(directory, "clipboard.png");
|
|
621045
621182
|
try {
|
|
621046
621183
|
const result = await options2.runCommand(
|
|
621047
621184
|
"osascript",
|
|
@@ -621060,7 +621197,7 @@ async function readMacClipboardImage(options2) {
|
|
|
621060
621197
|
if (result.exitCode !== 0) return null;
|
|
621061
621198
|
return await readImageFile2(imagePath, "image/png", options2.maxBytes);
|
|
621062
621199
|
} finally {
|
|
621063
|
-
await (0,
|
|
621200
|
+
await (0, import_promises61.rm)(directory, { force: true, recursive: true });
|
|
621064
621201
|
}
|
|
621065
621202
|
}
|
|
621066
621203
|
async function readLinuxClipboardImage(options2) {
|
|
@@ -621101,9 +621238,9 @@ async function readLinuxClipboardImage(options2) {
|
|
|
621101
621238
|
return null;
|
|
621102
621239
|
}
|
|
621103
621240
|
async function readWindowsClipboardImage(options2) {
|
|
621104
|
-
await (0,
|
|
621105
|
-
const directory = await (0,
|
|
621106
|
-
const imagePath = (0,
|
|
621241
|
+
await (0, import_promises61.mkdir)(options2.tempDirectory, { recursive: true });
|
|
621242
|
+
const directory = await (0, import_promises61.mkdtemp)((0, import_node_path131.join)(options2.tempDirectory, "dcode-clipboard-"));
|
|
621243
|
+
const imagePath = (0, import_node_path131.join)(directory, "clipboard.png");
|
|
621107
621244
|
const script = [
|
|
621108
621245
|
"Add-Type -AssemblyName System.Windows.Forms;",
|
|
621109
621246
|
"$img = Get-Clipboard -Format Image;",
|
|
@@ -621119,11 +621256,11 @@ async function readWindowsClipboardImage(options2) {
|
|
|
621119
621256
|
if (result.exitCode !== 0) return null;
|
|
621120
621257
|
return await readImageFile2(imagePath, "image/png", options2.maxBytes);
|
|
621121
621258
|
} finally {
|
|
621122
|
-
await (0,
|
|
621259
|
+
await (0, import_promises61.rm)(directory, { force: true, recursive: true });
|
|
621123
621260
|
}
|
|
621124
621261
|
}
|
|
621125
621262
|
async function readImageFile2(path6, mediaType, maxBytes) {
|
|
621126
|
-
const buffer = await (0,
|
|
621263
|
+
const buffer = await (0, import_promises61.readFile)(path6);
|
|
621127
621264
|
return bufferToClipboardImage(buffer, mediaType, maxBytes);
|
|
621128
621265
|
}
|
|
621129
621266
|
function bufferToClipboardImage(buffer, mediaType, maxBytes) {
|
|
@@ -621135,16 +621272,16 @@ function bufferToClipboardImage(buffer, mediaType, maxBytes) {
|
|
|
621135
621272
|
};
|
|
621136
621273
|
}
|
|
621137
621274
|
async function runCommandBuffer(file3, args, options2) {
|
|
621138
|
-
return await new Promise((
|
|
621275
|
+
return await new Promise((resolve59) => {
|
|
621139
621276
|
let child;
|
|
621140
621277
|
try {
|
|
621141
|
-
child = (0,
|
|
621278
|
+
child = (0, import_node_child_process17.spawn)(file3, args, {
|
|
621142
621279
|
signal: options2.signal,
|
|
621143
621280
|
stdio: ["ignore", "pipe", "ignore"],
|
|
621144
621281
|
windowsHide: true
|
|
621145
621282
|
});
|
|
621146
621283
|
} catch {
|
|
621147
|
-
|
|
621284
|
+
resolve59({ exitCode: -1, stdout: Buffer.alloc(0) });
|
|
621148
621285
|
return;
|
|
621149
621286
|
}
|
|
621150
621287
|
const chunks = [];
|
|
@@ -621153,7 +621290,7 @@ async function runCommandBuffer(file3, args, options2) {
|
|
|
621153
621290
|
const finish = (result) => {
|
|
621154
621291
|
if (settled) return;
|
|
621155
621292
|
settled = true;
|
|
621156
|
-
|
|
621293
|
+
resolve59(result);
|
|
621157
621294
|
};
|
|
621158
621295
|
child.stdout?.on("data", (chunk) => {
|
|
621159
621296
|
bytes += chunk.byteLength;
|
|
@@ -621179,14 +621316,14 @@ function appleScriptString(value2) {
|
|
|
621179
621316
|
function powershellString(value2) {
|
|
621180
621317
|
return `'${value2.replace(/'/g, "''")}'`;
|
|
621181
621318
|
}
|
|
621182
|
-
var
|
|
621319
|
+
var import_node_child_process17, import_promises61, import_node_os37, import_node_path131, DEFAULT_MAX_CLIPBOARD_IMAGE_BYTES;
|
|
621183
621320
|
var init_clipboard_image = __esm({
|
|
621184
621321
|
"src/clipboard-image.ts"() {
|
|
621185
621322
|
"use strict";
|
|
621186
|
-
|
|
621187
|
-
|
|
621188
|
-
|
|
621189
|
-
|
|
621323
|
+
import_node_child_process17 = require("node:child_process");
|
|
621324
|
+
import_promises61 = require("node:fs/promises");
|
|
621325
|
+
import_node_os37 = require("node:os");
|
|
621326
|
+
import_node_path131 = require("node:path");
|
|
621190
621327
|
DEFAULT_MAX_CLIPBOARD_IMAGE_BYTES = 20 * 1024 * 1024;
|
|
621191
621328
|
}
|
|
621192
621329
|
});
|
|
@@ -621259,22 +621396,22 @@ function assertClipboardTextSize(text3, maxBytes) {
|
|
|
621259
621396
|
return buffer;
|
|
621260
621397
|
}
|
|
621261
621398
|
async function runCommandText(file3, args, options2) {
|
|
621262
|
-
return await new Promise((
|
|
621399
|
+
return await new Promise((resolve59) => {
|
|
621263
621400
|
let child;
|
|
621264
621401
|
try {
|
|
621265
|
-
child = (0,
|
|
621402
|
+
child = (0, import_node_child_process18.spawn)(file3, args, {
|
|
621266
621403
|
stdio: ["pipe", "ignore", "ignore"],
|
|
621267
621404
|
windowsHide: true
|
|
621268
621405
|
});
|
|
621269
621406
|
} catch {
|
|
621270
|
-
|
|
621407
|
+
resolve59({ exitCode: -1 });
|
|
621271
621408
|
return;
|
|
621272
621409
|
}
|
|
621273
621410
|
let settled = false;
|
|
621274
621411
|
const finish = (result) => {
|
|
621275
621412
|
if (settled) return;
|
|
621276
621413
|
settled = true;
|
|
621277
|
-
|
|
621414
|
+
resolve59(result);
|
|
621278
621415
|
};
|
|
621279
621416
|
child.stdin?.on("error", () => void 0);
|
|
621280
621417
|
child.stdin?.end(options2.input);
|
|
@@ -621282,11 +621419,11 @@ async function runCommandText(file3, args, options2) {
|
|
|
621282
621419
|
child.on("close", (exitCode, signal) => finish({ exitCode, signal }));
|
|
621283
621420
|
});
|
|
621284
621421
|
}
|
|
621285
|
-
var
|
|
621422
|
+
var import_node_child_process18, DEFAULT_MAX_CLIPBOARD_TEXT_BYTES, OSC_52_CLIPBOARD_TARGET, OSC_52_PREFIX, OSC_52_SUFFIX, POWERSHELL_SET_CLIPBOARD;
|
|
621286
621423
|
var init_clipboard_text = __esm({
|
|
621287
621424
|
"src/clipboard-text.ts"() {
|
|
621288
621425
|
"use strict";
|
|
621289
|
-
|
|
621426
|
+
import_node_child_process18 = require("node:child_process");
|
|
621290
621427
|
DEFAULT_MAX_CLIPBOARD_TEXT_BYTES = 1024 * 1024;
|
|
621291
621428
|
OSC_52_CLIPBOARD_TARGET = "c";
|
|
621292
621429
|
OSC_52_PREFIX = "\x1B]52;";
|
|
@@ -621941,15 +622078,15 @@ var init_tui_prompt_handler = __esm({
|
|
|
621941
622078
|
});
|
|
621942
622079
|
|
|
621943
622080
|
// src/tui-runtime-loader.ts
|
|
621944
|
-
var import_node_crypto60,
|
|
622081
|
+
var import_node_crypto60, import_node_fs49, import_promises62, import_node_os38, import_node_path132, import_node_url4, assetPrefix2, manifestAssetKey2, packageEntryPath, manifestFileName, loadTuiRuntime, ensureSeaTuiRuntime, readManifest4, isCacheCurrent3, cacheBaseDirectory2, markerPathForDirectory, modeForPath;
|
|
621945
622082
|
var init_tui_runtime_loader = __esm({
|
|
621946
622083
|
"src/tui-runtime-loader.ts"() {
|
|
621947
622084
|
"use strict";
|
|
621948
622085
|
import_node_crypto60 = require("node:crypto");
|
|
621949
|
-
|
|
621950
|
-
|
|
621951
|
-
|
|
621952
|
-
|
|
622086
|
+
import_node_fs49 = require("node:fs");
|
|
622087
|
+
import_promises62 = require("node:fs/promises");
|
|
622088
|
+
import_node_os38 = require("node:os");
|
|
622089
|
+
import_node_path132 = require("node:path");
|
|
621953
622090
|
import_node_url4 = require("node:url");
|
|
621954
622091
|
assetPrefix2 = "dcode-tui-runtime/";
|
|
621955
622092
|
manifestAssetKey2 = `${assetPrefix2}manifest.json`;
|
|
@@ -621961,26 +622098,26 @@ var init_tui_runtime_loader = __esm({
|
|
|
621961
622098
|
return await import("@dcode/tui");
|
|
621962
622099
|
}
|
|
621963
622100
|
const runtimeDirectory = await ensureSeaTuiRuntime(sea);
|
|
621964
|
-
return await import((0, import_node_url4.pathToFileURL)((0,
|
|
622101
|
+
return await import((0, import_node_url4.pathToFileURL)((0, import_node_path132.join)(runtimeDirectory, packageEntryPath)).href);
|
|
621965
622102
|
};
|
|
621966
622103
|
ensureSeaTuiRuntime = async (sea) => {
|
|
621967
622104
|
const manifest = readManifest4(sea);
|
|
621968
|
-
const cacheDirectory = (0,
|
|
622105
|
+
const cacheDirectory = (0, import_node_path132.join)(
|
|
621969
622106
|
cacheBaseDirectory2(),
|
|
621970
|
-
"1.
|
|
622107
|
+
"1.1.0",
|
|
621971
622108
|
manifest.target,
|
|
621972
622109
|
manifest.hash
|
|
621973
622110
|
);
|
|
621974
|
-
const markerPath = (0,
|
|
622111
|
+
const markerPath = (0, import_node_path132.join)(cacheDirectory, manifestFileName);
|
|
621975
622112
|
if (await isCacheCurrent3(markerPath, manifest)) {
|
|
621976
622113
|
return cacheDirectory;
|
|
621977
622114
|
}
|
|
621978
622115
|
const temporaryDirectory = `${cacheDirectory}.tmp-${process.pid}-${Date.now()}`;
|
|
621979
|
-
await (0,
|
|
622116
|
+
await (0, import_promises62.rm)(temporaryDirectory, {
|
|
621980
622117
|
force: true,
|
|
621981
622118
|
recursive: true
|
|
621982
622119
|
});
|
|
621983
|
-
await (0,
|
|
622120
|
+
await (0, import_promises62.mkdir)(temporaryDirectory, {
|
|
621984
622121
|
recursive: true
|
|
621985
622122
|
});
|
|
621986
622123
|
for (const file3 of manifest.files) {
|
|
@@ -621990,22 +622127,22 @@ var init_tui_runtime_loader = __esm({
|
|
|
621990
622127
|
if (actualHash !== file3.sha256) {
|
|
621991
622128
|
throw new Error(`SEA TUI asset hash mismatch for ${file3.path}`);
|
|
621992
622129
|
}
|
|
621993
|
-
const outputPath = (0,
|
|
621994
|
-
await (0,
|
|
622130
|
+
const outputPath = (0, import_node_path132.join)(temporaryDirectory, file3.path);
|
|
622131
|
+
await (0, import_promises62.mkdir)((0, import_node_path132.dirname)(outputPath), {
|
|
621995
622132
|
recursive: true
|
|
621996
622133
|
});
|
|
621997
|
-
await (0,
|
|
621998
|
-
await (0,
|
|
622134
|
+
await (0, import_promises62.writeFile)(outputPath, bytes);
|
|
622135
|
+
await (0, import_promises62.chmod)(outputPath, file3.mode ?? modeForPath(file3.path));
|
|
621999
622136
|
}
|
|
622000
|
-
await (0,
|
|
622001
|
-
await (0,
|
|
622137
|
+
await (0, import_promises62.writeFile)(markerPathForDirectory(temporaryDirectory), JSON.stringify(manifest, null, 2));
|
|
622138
|
+
await (0, import_promises62.rm)(cacheDirectory, {
|
|
622002
622139
|
force: true,
|
|
622003
622140
|
recursive: true
|
|
622004
622141
|
});
|
|
622005
|
-
await (0,
|
|
622142
|
+
await (0, import_promises62.mkdir)((0, import_node_path132.dirname)(cacheDirectory), {
|
|
622006
622143
|
recursive: true
|
|
622007
622144
|
});
|
|
622008
|
-
await (0,
|
|
622145
|
+
await (0, import_promises62.rename)(temporaryDirectory, cacheDirectory);
|
|
622009
622146
|
return cacheDirectory;
|
|
622010
622147
|
};
|
|
622011
622148
|
readManifest4 = (sea) => {
|
|
@@ -622017,34 +622154,34 @@ var init_tui_runtime_loader = __esm({
|
|
|
622017
622154
|
return manifest;
|
|
622018
622155
|
};
|
|
622019
622156
|
isCacheCurrent3 = async (markerPath, expected) => {
|
|
622020
|
-
if (!(0,
|
|
622157
|
+
if (!(0, import_node_fs49.existsSync)(markerPath)) return false;
|
|
622021
622158
|
try {
|
|
622022
|
-
const current = JSON.parse(await (0,
|
|
622159
|
+
const current = JSON.parse(await (0, import_promises62.readFile)(markerPath, "utf8"));
|
|
622023
622160
|
return current.hash === expected.hash && current.target === expected.target;
|
|
622024
622161
|
} catch {
|
|
622025
622162
|
return false;
|
|
622026
622163
|
}
|
|
622027
622164
|
};
|
|
622028
622165
|
cacheBaseDirectory2 = () => {
|
|
622029
|
-
const home = (0,
|
|
622030
|
-
if ((0,
|
|
622031
|
-
return (0,
|
|
622166
|
+
const home = (0, import_node_os38.homedir)();
|
|
622167
|
+
if ((0, import_node_os38.platform)() === "darwin" && home) {
|
|
622168
|
+
return (0, import_node_path132.join)(home, "Library", "Caches", "dcode", "sea-assets");
|
|
622032
622169
|
}
|
|
622033
|
-
if ((0,
|
|
622034
|
-
return (0,
|
|
622035
|
-
process.env.LOCALAPPDATA ?? (0,
|
|
622170
|
+
if ((0, import_node_os38.platform)() === "win32") {
|
|
622171
|
+
return (0, import_node_path132.join)(
|
|
622172
|
+
process.env.LOCALAPPDATA ?? (0, import_node_path132.join)(home || (0, import_node_os38.tmpdir)(), "AppData", "Local"),
|
|
622036
622173
|
"dcode",
|
|
622037
622174
|
"Cache",
|
|
622038
622175
|
"sea-assets"
|
|
622039
622176
|
);
|
|
622040
622177
|
}
|
|
622041
|
-
return (0,
|
|
622042
|
-
process.env.XDG_CACHE_HOME ?? (0,
|
|
622178
|
+
return (0, import_node_path132.join)(
|
|
622179
|
+
process.env.XDG_CACHE_HOME ?? (0, import_node_path132.join)(home || (0, import_node_os38.tmpdir)(), ".cache"),
|
|
622043
622180
|
"dcode",
|
|
622044
622181
|
"sea-assets"
|
|
622045
622182
|
);
|
|
622046
622183
|
};
|
|
622047
|
-
markerPathForDirectory = (directory) => (0,
|
|
622184
|
+
markerPathForDirectory = (directory) => (0, import_node_path132.join)(directory, manifestFileName);
|
|
622048
622185
|
modeForPath = (filePath) => /\.(?:dll|dylib|node|so)$/i.test(filePath) ? 493 : 420;
|
|
622049
622186
|
}
|
|
622050
622187
|
});
|
|
@@ -622082,11 +622219,11 @@ var init_tui_startup_locale = __esm({
|
|
|
622082
622219
|
// src/tui-workspace-paths.ts
|
|
622083
622220
|
function createWorkspacePathSuggestionProvider(options2) {
|
|
622084
622221
|
const fileSystemPort = options2.fileSystemPort ?? createNodeFileSystemAdapter();
|
|
622085
|
-
const workspaceDirectory = (0,
|
|
622222
|
+
const workspaceDirectory = (0, import_node_path133.resolve)(options2.workspaceDirectory);
|
|
622086
622223
|
return async (request) => {
|
|
622087
622224
|
const parsed = parseWorkspacePathToken(request.token);
|
|
622088
622225
|
if (!parsed) return { items: [], truncated: false };
|
|
622089
|
-
const directory = (0,
|
|
622226
|
+
const directory = (0, import_node_path133.resolve)(workspaceDirectory, parsed.directoryToken);
|
|
622090
622227
|
if (!isPathInside(workspaceDirectory, directory)) {
|
|
622091
622228
|
return { items: [], truncated: false };
|
|
622092
622229
|
}
|
|
@@ -622124,7 +622261,7 @@ function createWorkspacePathSuggestionProvider(options2) {
|
|
|
622124
622261
|
}
|
|
622125
622262
|
function parseWorkspacePathToken(token2) {
|
|
622126
622263
|
const trimmed = token2.replace(/^@/u, "");
|
|
622127
|
-
if (trimmed.startsWith("/") || trimmed.startsWith("\\") || (0,
|
|
622264
|
+
if (trimmed.startsWith("/") || trimmed.startsWith("\\") || (0, import_node_path133.isAbsolute)(trimmed) || WINDOWS_ABSOLUTE_PATH_PATTERN.test(trimmed)) {
|
|
622128
622265
|
return void 0;
|
|
622129
622266
|
}
|
|
622130
622267
|
const normalized = trimmed.replace(PATH_SEPARATOR_PATTERN, "/");
|
|
@@ -622158,22 +622295,22 @@ function basenameFromSuggestion(path6) {
|
|
|
622158
622295
|
return slashIndex < 0 ? withoutSlash : withoutSlash.slice(slashIndex + 1);
|
|
622159
622296
|
}
|
|
622160
622297
|
function toWorkspaceRelativePath(workspaceDirectory, path6) {
|
|
622161
|
-
const relativePath2 = (0,
|
|
622162
|
-
if (!relativePath2 || relativePath2.startsWith("..") || (0,
|
|
622298
|
+
const relativePath2 = (0, import_node_path133.relative)(workspaceDirectory, path6);
|
|
622299
|
+
if (!relativePath2 || relativePath2.startsWith("..") || (0, import_node_path133.isAbsolute)(relativePath2)) {
|
|
622163
622300
|
return void 0;
|
|
622164
622301
|
}
|
|
622165
|
-
return relativePath2.split(
|
|
622302
|
+
return relativePath2.split(import_node_path133.sep).join("/");
|
|
622166
622303
|
}
|
|
622167
622304
|
function isPathInside(root3, path6) {
|
|
622168
|
-
const relativePath2 = (0,
|
|
622169
|
-
return relativePath2 === "" || !relativePath2.startsWith("..") && !(0,
|
|
622305
|
+
const relativePath2 = (0, import_node_path133.relative)(root3, path6);
|
|
622306
|
+
return relativePath2 === "" || !relativePath2.startsWith("..") && !(0, import_node_path133.isAbsolute)(relativePath2);
|
|
622170
622307
|
}
|
|
622171
|
-
var
|
|
622308
|
+
var import_node_path133, DEFAULT_WORKSPACE_PATH_SUGGESTION_LIMIT, PATH_SEPARATOR_PATTERN, WINDOWS_ABSOLUTE_PATH_PATTERN, EXCLUDED_DIRECTORY_NAMES;
|
|
622172
622309
|
var init_tui_workspace_paths = __esm({
|
|
622173
622310
|
"src/tui-workspace-paths.ts"() {
|
|
622174
622311
|
"use strict";
|
|
622175
622312
|
init_fs();
|
|
622176
|
-
|
|
622313
|
+
import_node_path133 = require("node:path");
|
|
622177
622314
|
DEFAULT_WORKSPACE_PATH_SUGGESTION_LIMIT = 50;
|
|
622178
622315
|
PATH_SEPARATOR_PATTERN = /[\\/]+/gu;
|
|
622179
622316
|
WINDOWS_ABSOLUTE_PATH_PATTERN = /^[a-zA-Z]:[\\/]/u;
|
|
@@ -622193,6 +622330,7 @@ var init_tui_workspace_paths = __esm({
|
|
|
622193
622330
|
async function resolveWorkspaceGitBranch(options2) {
|
|
622194
622331
|
const maxOutputBytes = options2.maxOutputBytes ?? DEFAULT_GIT_OUTPUT_LIMIT_BYTES;
|
|
622195
622332
|
const timeoutMs2 = options2.timeoutMs ?? DEFAULT_GIT_TIMEOUT_MS;
|
|
622333
|
+
if (!DARWIN_TOOLCHAIN_PRESENT) return void 0;
|
|
622196
622334
|
const runCommand2 = options2.runCommand ?? runGitCommand;
|
|
622197
622335
|
const result = await runCommand2(
|
|
622198
622336
|
GIT_COMMAND2,
|
|
@@ -622208,15 +622346,15 @@ async function resolveWorkspaceGitBranch(options2) {
|
|
|
622208
622346
|
return branch;
|
|
622209
622347
|
}
|
|
622210
622348
|
async function runGitCommand(file3, args, options2) {
|
|
622211
|
-
return await new Promise((
|
|
622349
|
+
return await new Promise((resolve59) => {
|
|
622212
622350
|
let child;
|
|
622213
622351
|
try {
|
|
622214
|
-
child = (0,
|
|
622352
|
+
child = (0, import_node_child_process19.spawn)(file3, args, {
|
|
622215
622353
|
stdio: ["ignore", "pipe", "ignore"],
|
|
622216
622354
|
windowsHide: true
|
|
622217
622355
|
});
|
|
622218
622356
|
} catch {
|
|
622219
|
-
|
|
622357
|
+
resolve59({ exitCode: -1, stdout: "" });
|
|
622220
622358
|
return;
|
|
622221
622359
|
}
|
|
622222
622360
|
let stdout = "";
|
|
@@ -622229,7 +622367,7 @@ async function runGitCommand(file3, args, options2) {
|
|
|
622229
622367
|
if (settled) return;
|
|
622230
622368
|
settled = true;
|
|
622231
622369
|
clearTimeout(timeout);
|
|
622232
|
-
|
|
622370
|
+
resolve59(result);
|
|
622233
622371
|
};
|
|
622234
622372
|
child.stdout?.on("data", (chunk) => {
|
|
622235
622373
|
stdout += chunk.toString("utf8");
|
|
@@ -622242,16 +622380,20 @@ async function runGitCommand(file3, args, options2) {
|
|
|
622242
622380
|
child.on("close", (exitCode) => finish({ exitCode, stdout }));
|
|
622243
622381
|
});
|
|
622244
622382
|
}
|
|
622245
|
-
var
|
|
622383
|
+
var import_node_fs50, import_node_child_process19, GIT_COMMAND2, GIT_BRANCH_ARGS, DEFAULT_GIT_TIMEOUT_MS, DEFAULT_GIT_OUTPUT_LIMIT_BYTES, DETACHED_HEAD_LABEL, DARWIN_TOOLCHAIN_PRESENT;
|
|
622246
622384
|
var init_tui_workspace_git = __esm({
|
|
622247
622385
|
"src/tui-workspace-git.ts"() {
|
|
622248
622386
|
"use strict";
|
|
622249
|
-
|
|
622387
|
+
import_node_fs50 = require("node:fs");
|
|
622388
|
+
import_node_child_process19 = require("node:child_process");
|
|
622250
622389
|
GIT_COMMAND2 = "git";
|
|
622251
622390
|
GIT_BRANCH_ARGS = ["symbolic-ref", "--quiet", "--short", "HEAD"];
|
|
622252
622391
|
DEFAULT_GIT_TIMEOUT_MS = 750;
|
|
622253
622392
|
DEFAULT_GIT_OUTPUT_LIMIT_BYTES = 512;
|
|
622254
622393
|
DETACHED_HEAD_LABEL = "HEAD";
|
|
622394
|
+
DARWIN_TOOLCHAIN_PRESENT = process.platform !== "darwin" || ["/Library/Developer/CommandLineTools", "/Applications/Xcode.app/Contents/Developer"].some(
|
|
622395
|
+
(marker31) => (0, import_node_fs50.existsSync)(marker31)
|
|
622396
|
+
);
|
|
622255
622397
|
}
|
|
622256
622398
|
});
|
|
622257
622399
|
|
|
@@ -622388,6 +622530,7 @@ var init_run = __esm({
|
|
|
622388
622530
|
init_dist34();
|
|
622389
622531
|
init_env();
|
|
622390
622532
|
init_help();
|
|
622533
|
+
init_first_run();
|
|
622391
622534
|
init_hooks_trust_command();
|
|
622392
622535
|
init_locale2();
|
|
622393
622536
|
init_bootstrap_loader();
|
|
@@ -622402,7 +622545,7 @@ var init_run = __esm({
|
|
|
622402
622545
|
init_plugins_command();
|
|
622403
622546
|
init_skills_command();
|
|
622404
622547
|
init_tui_command();
|
|
622405
|
-
version3 = true ? "1.
|
|
622548
|
+
version3 = true ? "1.1.0" : "0.0.0";
|
|
622406
622549
|
EMPTY_TARGET_ERROR = "--target requires non-empty text.";
|
|
622407
622550
|
DEFAULT_HEADLESS_PROMPT_MODE = "yolo";
|
|
622408
622551
|
FORCE_MCS_SCOPE_ERROR = "--force-mcs can only be used with --prompt, --target, or tui.";
|
|
@@ -622839,6 +622982,9 @@ var init_run = __esm({
|
|
|
622839
622982
|
case "skills":
|
|
622840
622983
|
return await runSkillsCommand(ctx, options2, commandDeps, parsed.positionals.slice(1));
|
|
622841
622984
|
case "tui":
|
|
622985
|
+
if (await shouldRunFirstRunOnboarding({ noColor: options2.noColor })) {
|
|
622986
|
+
await runFirstRunOnboarding({ noColor: options2.noColor });
|
|
622987
|
+
}
|
|
622842
622988
|
return await runTuiCommand(
|
|
622843
622989
|
ctx,
|
|
622844
622990
|
options2,
|
|
@@ -623383,21 +623529,102 @@ function createProtocolProcessLifecycle(options2 = {}) {
|
|
|
623383
623529
|
};
|
|
623384
623530
|
}
|
|
623385
623531
|
function flush(stream) {
|
|
623386
|
-
return new Promise((
|
|
623387
|
-
if (!stream.writable) return
|
|
623532
|
+
return new Promise((resolve59) => {
|
|
623533
|
+
if (!stream.writable) return resolve59();
|
|
623388
623534
|
try {
|
|
623389
|
-
stream.write("", () =>
|
|
623535
|
+
stream.write("", () => resolve59());
|
|
623390
623536
|
} catch {
|
|
623391
|
-
|
|
623537
|
+
resolve59();
|
|
623392
623538
|
}
|
|
623393
623539
|
});
|
|
623394
623540
|
}
|
|
623395
623541
|
|
|
623396
623542
|
// src/main.ts
|
|
623397
623543
|
init_arguments();
|
|
623544
|
+
|
|
623545
|
+
// src/self-update.ts
|
|
623546
|
+
var import_node_child_process = require("node:child_process");
|
|
623547
|
+
var CLI_VERSION = true ? "1.1.0" : "0.0.0";
|
|
623548
|
+
var PACKAGE = "@dipoleml/dcode-cli";
|
|
623549
|
+
var DIST_TAGS_URL = "https://registry.npmjs.org/-/package/@dipoleml%2Fdcode-cli/dist-tags";
|
|
623550
|
+
var CHECK_TIMEOUT_MS = 1500;
|
|
623551
|
+
var INSTALL_TIMEOUT_MS = 18e4;
|
|
623552
|
+
var skipReasons = {
|
|
623553
|
+
ci: () => process.env.CI === "true" || process.env.CI === "1",
|
|
623554
|
+
env: () => process.env.DCODE_SKIP_UPDATE_CHECK === "1",
|
|
623555
|
+
guard: () => process.env.DCODE_SELF_UPDATED === "1",
|
|
623556
|
+
nonTty: () => !process.stdout.isTTY
|
|
623557
|
+
};
|
|
623558
|
+
function isNewer(candidate, current) {
|
|
623559
|
+
const parse6 = (v2) => {
|
|
623560
|
+
const m2 = /^(\d+)\.(\d+)\.(\d+)/.exec(v2.trim());
|
|
623561
|
+
return m2 ? [Number(m2[1]), Number(m2[2]), Number(m2[3])] : null;
|
|
623562
|
+
};
|
|
623563
|
+
const c3 = parse6(candidate);
|
|
623564
|
+
const k2 = parse6(current);
|
|
623565
|
+
if (!c3 || !k2) return false;
|
|
623566
|
+
return c3[0] !== k2[0] ? c3[0] > k2[0] : c3[1] !== k2[1] ? c3[1] > k2[1] : c3[2] > k2[2];
|
|
623567
|
+
}
|
|
623568
|
+
async function latestVersion() {
|
|
623569
|
+
try {
|
|
623570
|
+
const res = await fetch(DIST_TAGS_URL, {
|
|
623571
|
+
signal: AbortSignal.timeout(CHECK_TIMEOUT_MS),
|
|
623572
|
+
headers: { accept: "application/vnd.npm.install-v1+json" }
|
|
623573
|
+
});
|
|
623574
|
+
if (!res.ok) return null;
|
|
623575
|
+
const tags = await res.json();
|
|
623576
|
+
return typeof tags.latest === "string" ? tags.latest : null;
|
|
623577
|
+
} catch {
|
|
623578
|
+
return null;
|
|
623579
|
+
}
|
|
623580
|
+
}
|
|
623581
|
+
function reexec(argv) {
|
|
623582
|
+
const command = process.platform === "win32" ? "dcode.cmd" : "dcode";
|
|
623583
|
+
const child = (0, import_node_child_process.spawn)(command, argv, {
|
|
623584
|
+
stdio: "inherit",
|
|
623585
|
+
shell: process.platform === "win32",
|
|
623586
|
+
env: { ...process.env, DCODE_SELF_UPDATED: "1" }
|
|
623587
|
+
});
|
|
623588
|
+
child.on("exit", (code, signal) => {
|
|
623589
|
+
if (signal) process.kill(process.pid, signal);
|
|
623590
|
+
else process.exit(code ?? 0);
|
|
623591
|
+
});
|
|
623592
|
+
child.on("error", () => {
|
|
623593
|
+
});
|
|
623594
|
+
}
|
|
623595
|
+
async function runStartupUpdateCheck(argv) {
|
|
623596
|
+
try {
|
|
623597
|
+
if (Object.values(skipReasons).some((check3) => check3())) return;
|
|
623598
|
+
const first = argv[0] ?? "";
|
|
623599
|
+
if (argv.includes("--version") || argv.includes("-v") || argv.includes("--help") || argv.includes("-h")) {
|
|
623600
|
+
return;
|
|
623601
|
+
}
|
|
623602
|
+
if (["app-server", "agent-server", "protocol", "plugin-host", "dwf-child", "prepare-storage"].includes(first)) {
|
|
623603
|
+
return;
|
|
623604
|
+
}
|
|
623605
|
+
if (argv.includes("--no-update-check")) return;
|
|
623606
|
+
const latest = await latestVersion();
|
|
623607
|
+
if (!latest || !isNewer(latest, CLI_VERSION)) return;
|
|
623608
|
+
process.stdout.write(`Updating ${PACKAGE} from ${CLI_VERSION} to ${latest}\u2026
|
|
623609
|
+
`);
|
|
623610
|
+
const npm = process.platform === "win32" ? "npm.cmd" : "npm";
|
|
623611
|
+
(0, import_node_child_process.execFileSync)(npm, ["install", "-g", `${PACKAGE}@${latest}`], {
|
|
623612
|
+
stdio: "inherit",
|
|
623613
|
+
timeout: INSTALL_TIMEOUT_MS,
|
|
623614
|
+
shell: process.platform === "win32"
|
|
623615
|
+
});
|
|
623616
|
+
process.stdout.write(`Updated to ${latest}. Starting the session.
|
|
623617
|
+
`);
|
|
623618
|
+
reexec(argv);
|
|
623619
|
+
} catch {
|
|
623620
|
+
}
|
|
623621
|
+
}
|
|
623622
|
+
|
|
623623
|
+
// src/main.ts
|
|
623398
623624
|
void main();
|
|
623399
623625
|
async function main() {
|
|
623400
623626
|
const argv = process.argv.slice(2);
|
|
623627
|
+
await runStartupUpdateCheck(argv);
|
|
623401
623628
|
if (!argv.includes("--prepare-storage")) setCliProcessTitle();
|
|
623402
623629
|
applyCliRuntimeEnvSanitization(process.env);
|
|
623403
623630
|
const isProtocol = isProtocolServerInvocation(argv);
|
|
@@ -623480,7 +623707,7 @@ function normalizeProcessExitCode(exitCode) {
|
|
|
623480
623707
|
return 0;
|
|
623481
623708
|
}
|
|
623482
623709
|
function waitForPendingWarnings() {
|
|
623483
|
-
return new Promise((
|
|
623710
|
+
return new Promise((resolve59) => setImmediate(resolve59));
|
|
623484
623711
|
}
|
|
623485
623712
|
}
|
|
623486
623713
|
//# sourceMappingURL=dcode.cjs.map
|