@swmansion/argent 0.18.1-next.0 → 0.18.1-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli-cmds.mjs +69 -30
- package/dist/installer.mjs +32 -30
- package/dist/mcp-server.mjs +225 -19
- package/dist/tool-server.cjs +1623 -1273
- package/package.json +5 -1
- package/skills/argent-screen-recording/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ Argent drives a growing set of targets through a single toolkit, each with the r
|
|
|
52
52
|
|
|
53
53
|
#### Prerequisites
|
|
54
54
|
|
|
55
|
-
- **Node.js 20.
|
|
55
|
+
- **Node.js 20.12** or later
|
|
56
56
|
- For iOS / tvOS: macOS with **Xcode** installed (Apple TV uses tvOS simulators — Xcode downloads the tvOS runtime on demand)
|
|
57
57
|
- For Android / Android TV: **Android SDK Platform Tools** (`adb`) on `PATH`, and the **Android Emulator** package if you want to boot AVDs from Argent. Create AVDs via Android Studio or `avdmanager`.
|
|
58
58
|
- For Fire TV (Vega): the **Vega SDK** (`vega` CLI) on `PATH`
|
package/dist/cli-cmds.mjs
CHANGED
|
@@ -204,7 +204,7 @@ function generateAuthToken() {
|
|
|
204
204
|
return generateToken();
|
|
205
205
|
}
|
|
206
206
|
function findFreePort() {
|
|
207
|
-
return new Promise((
|
|
207
|
+
return new Promise((resolve9, reject) => {
|
|
208
208
|
const srv = net.createServer();
|
|
209
209
|
srv.listen(0, "127.0.0.1", () => {
|
|
210
210
|
const addr = srv.address();
|
|
@@ -215,7 +215,7 @@ function findFreePort() {
|
|
|
215
215
|
const port = addr.port;
|
|
216
216
|
srv.close((err) => {
|
|
217
217
|
if (err) reject(err);
|
|
218
|
-
else
|
|
218
|
+
else resolve9(port);
|
|
219
219
|
});
|
|
220
220
|
});
|
|
221
221
|
srv.on("error", reject);
|
|
@@ -316,7 +316,7 @@ function killSpawnedChild(child, pid) {
|
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
function spawnToolsServer(paths, port, options = {}) {
|
|
319
|
-
return new Promise((
|
|
319
|
+
return new Promise((resolve9, reject) => {
|
|
320
320
|
let logFd;
|
|
321
321
|
try {
|
|
322
322
|
fs.mkdirSync(STATE_DIR, { recursive: true });
|
|
@@ -353,7 +353,7 @@ function spawnToolsServer(paths, port, options = {}) {
|
|
|
353
353
|
rl.close();
|
|
354
354
|
child.stdout?.resume();
|
|
355
355
|
child.stdout?.unref?.();
|
|
356
|
-
settle(() =>
|
|
356
|
+
settle(() => resolve9({ port: actualPort, pid }));
|
|
357
357
|
}
|
|
358
358
|
});
|
|
359
359
|
child.on("error", (err) => {
|
|
@@ -879,9 +879,9 @@ async function tarball(sourcePath) {
|
|
|
879
879
|
return tarPath;
|
|
880
880
|
}
|
|
881
881
|
function sha256File(filePath) {
|
|
882
|
-
return new Promise((
|
|
882
|
+
return new Promise((resolve9, reject) => {
|
|
883
883
|
const hash = createHash2("sha256");
|
|
884
|
-
createReadStream(filePath).on("data", (chunk) => hash.update(chunk)).on("end", () =>
|
|
884
|
+
createReadStream(filePath).on("data", (chunk) => hash.update(chunk)).on("end", () => resolve9(hash.digest("hex"))).on("error", reject);
|
|
885
885
|
});
|
|
886
886
|
}
|
|
887
887
|
async function uploadTar(tarPath, endpoint) {
|
|
@@ -1103,7 +1103,7 @@ function createToolsClient(options = {}) {
|
|
|
1103
1103
|
import { copyFile, mkdir as mkdir4, readFile as readFile4, realpath, rm as rm3, stat as stat2, writeFile as writeFile4 } from "node:fs/promises";
|
|
1104
1104
|
import { constants as fsConstants } from "node:fs";
|
|
1105
1105
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
1106
|
-
import { basename as basename3, dirname as dirname5, extname, isAbsolute as isAbsolute3, join as join8, normalize, sep as sep2 } from "node:path";
|
|
1106
|
+
import { basename as basename3, dirname as dirname5, extname, isAbsolute as isAbsolute3, join as join8, normalize, resolve as resolve5, sep as sep2 } from "node:path";
|
|
1107
1107
|
import { createHash as createHash3 } from "node:crypto";
|
|
1108
1108
|
|
|
1109
1109
|
// ../configuration-core/src/flags.ts
|
|
@@ -1493,6 +1493,18 @@ var CONFIG_SCHEMA = [
|
|
|
1493
1493
|
// must precede dedup) and guards on the preset staying "union".
|
|
1494
1494
|
merge: "union",
|
|
1495
1495
|
example: '["~/DeviceSets/ci"]'
|
|
1496
|
+
},
|
|
1497
|
+
{
|
|
1498
|
+
key: "recordings.directory",
|
|
1499
|
+
description: "Directory where finished screen recordings (mp4) are saved on the client host. Absolute, `~`-prefixed, or relative to the project root (home dir when not in a project). Unset \u21D2 `.argent/recordings` under the project root.",
|
|
1500
|
+
scopes: ["project", "global"],
|
|
1501
|
+
parse: asString,
|
|
1502
|
+
// A repo can pin where its recordings land; falls back to the user's global
|
|
1503
|
+
// preference. Resolution happens on the client (the machine the mp4 is
|
|
1504
|
+
// persisted to), so with a remote `argent link` tool-server it is the
|
|
1505
|
+
// *client's* config that decides.
|
|
1506
|
+
merge: "prioritize-local",
|
|
1507
|
+
example: "~/Movies/argent"
|
|
1496
1508
|
}
|
|
1497
1509
|
];
|
|
1498
1510
|
function getConfigDefinition(key, registry = CONFIG_SCHEMA) {
|
|
@@ -1654,6 +1666,21 @@ function durableBaseDir() {
|
|
|
1654
1666
|
return projectRoot ?? dirname5(argentHomeDir());
|
|
1655
1667
|
}
|
|
1656
1668
|
var ALLOWED_SAVE_DIRS = /* @__PURE__ */ new Set([normalize(".argent/recordings")]);
|
|
1669
|
+
var RECORDINGS_SAVE_DIR = normalize(".argent/recordings");
|
|
1670
|
+
function configuredRecordingsDir() {
|
|
1671
|
+
let value;
|
|
1672
|
+
try {
|
|
1673
|
+
value = getConfigValueByKey("recordings.directory");
|
|
1674
|
+
} catch {
|
|
1675
|
+
return null;
|
|
1676
|
+
}
|
|
1677
|
+
if (typeof value !== "string") return null;
|
|
1678
|
+
const trimmed = value.trim();
|
|
1679
|
+
if (trimmed === "") return null;
|
|
1680
|
+
const home = dirname5(argentHomeDir());
|
|
1681
|
+
const expanded = trimmed === "~" ? home : trimmed.startsWith("~/") || trimmed.startsWith(`~${sep2}`) ? join8(home, trimmed.slice(2)) : trimmed;
|
|
1682
|
+
return resolve5(durableBaseDir(), expanded);
|
|
1683
|
+
}
|
|
1657
1684
|
var MAX_DURABLE_BYTES = 2 * 1024 * 1024 * 1024;
|
|
1658
1685
|
async function readCapped(res, cap) {
|
|
1659
1686
|
const headers = res.headers;
|
|
@@ -1703,6 +1730,17 @@ function durableSaveTarget(handle) {
|
|
|
1703
1730
|
return null;
|
|
1704
1731
|
}
|
|
1705
1732
|
if (!ALLOWED_SAVE_DIRS.has(rel)) return null;
|
|
1733
|
+
if (rel === RECORDINGS_SAVE_DIR) {
|
|
1734
|
+
const configured = configuredRecordingsDir();
|
|
1735
|
+
if (configured) {
|
|
1736
|
+
return {
|
|
1737
|
+
dir: configured,
|
|
1738
|
+
path: join8(configured, sanitizeSegment(handle.filename)),
|
|
1739
|
+
base: configured,
|
|
1740
|
+
rel: ""
|
|
1741
|
+
};
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1706
1744
|
const base = durableBaseDir();
|
|
1707
1745
|
const dir = join8(base, rel);
|
|
1708
1746
|
return { dir, path: join8(dir, sanitizeSegment(handle.filename)), base, rel };
|
|
@@ -4438,14 +4476,14 @@ async function addSourceContext(frames) {
|
|
|
4438
4476
|
return frames;
|
|
4439
4477
|
}
|
|
4440
4478
|
function getContextLinesFromFile(path16, ranges, output) {
|
|
4441
|
-
return new Promise((
|
|
4479
|
+
return new Promise((resolve9) => {
|
|
4442
4480
|
const stream = createReadStream2(path16);
|
|
4443
4481
|
const lineReaded = createInterface2({
|
|
4444
4482
|
input: stream
|
|
4445
4483
|
});
|
|
4446
4484
|
function destroyStreamAndResolve() {
|
|
4447
4485
|
stream.destroy();
|
|
4448
|
-
|
|
4486
|
+
resolve9();
|
|
4449
4487
|
}
|
|
4450
4488
|
let lineNumber = 0;
|
|
4451
4489
|
let currentRangeIndex = 0;
|
|
@@ -5742,9 +5780,9 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
|
|
|
5742
5780
|
if (!waitUntil) return;
|
|
5743
5781
|
if (this.disabled || this.optedOut) return;
|
|
5744
5782
|
if (!this._waitUntilCycle) {
|
|
5745
|
-
let
|
|
5783
|
+
let resolve9;
|
|
5746
5784
|
const promise = new Promise((r2) => {
|
|
5747
|
-
|
|
5785
|
+
resolve9 = r2;
|
|
5748
5786
|
});
|
|
5749
5787
|
try {
|
|
5750
5788
|
waitUntil(promise);
|
|
@@ -5752,7 +5790,7 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
|
|
|
5752
5790
|
return;
|
|
5753
5791
|
}
|
|
5754
5792
|
this._waitUntilCycle = {
|
|
5755
|
-
resolve:
|
|
5793
|
+
resolve: resolve9,
|
|
5756
5794
|
startedAt: Date.now(),
|
|
5757
5795
|
timer: void 0
|
|
5758
5796
|
};
|
|
@@ -5776,12 +5814,12 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
|
|
|
5776
5814
|
return cycle?.resolve;
|
|
5777
5815
|
}
|
|
5778
5816
|
async resolveWaitUntilFlush() {
|
|
5779
|
-
const
|
|
5817
|
+
const resolve9 = this._consumeWaitUntilCycle();
|
|
5780
5818
|
try {
|
|
5781
5819
|
await super.flush();
|
|
5782
5820
|
} catch {
|
|
5783
5821
|
} finally {
|
|
5784
|
-
|
|
5822
|
+
resolve9?.();
|
|
5785
5823
|
}
|
|
5786
5824
|
}
|
|
5787
5825
|
getPersistedProperty(key) {
|
|
@@ -5902,15 +5940,15 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
|
|
|
5902
5940
|
async waitForLocalEvaluationReady(timeoutMs = THIRTY_SECONDS) {
|
|
5903
5941
|
if (this.isLocalEvaluationReady()) return true;
|
|
5904
5942
|
if (void 0 === this.featureFlagsPoller) return false;
|
|
5905
|
-
return new Promise((
|
|
5943
|
+
return new Promise((resolve9) => {
|
|
5906
5944
|
const timeout = setTimeout(() => {
|
|
5907
5945
|
cleanup();
|
|
5908
|
-
|
|
5946
|
+
resolve9(false);
|
|
5909
5947
|
}, timeoutMs);
|
|
5910
5948
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count) => {
|
|
5911
5949
|
clearTimeout(timeout);
|
|
5912
5950
|
cleanup();
|
|
5913
|
-
|
|
5951
|
+
resolve9(count > 0);
|
|
5914
5952
|
});
|
|
5915
5953
|
});
|
|
5916
5954
|
}
|
|
@@ -6365,14 +6403,14 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
|
|
|
6365
6403
|
this.context?.enter(data, options);
|
|
6366
6404
|
}
|
|
6367
6405
|
async _shutdown(shutdownTimeoutMs) {
|
|
6368
|
-
const
|
|
6406
|
+
const resolve9 = this._consumeWaitUntilCycle();
|
|
6369
6407
|
await this.featureFlagsPoller?.stopPoller(shutdownTimeoutMs);
|
|
6370
6408
|
this.errorTracking.shutdown();
|
|
6371
6409
|
try {
|
|
6372
6410
|
return await super._shutdown(shutdownTimeoutMs);
|
|
6373
6411
|
} finally {
|
|
6374
6412
|
this.distinctIdHasSentFlagCalls = {};
|
|
6375
|
-
|
|
6413
|
+
resolve9?.();
|
|
6376
6414
|
}
|
|
6377
6415
|
}
|
|
6378
6416
|
async _requestRemoteConfigPayload(flagKey) {
|
|
@@ -6971,6 +7009,7 @@ var FAILURE_CODES = {
|
|
|
6971
7009
|
CHROMIUM_DEVICE_ID_INVALID: "CHROMIUM_DEVICE_ID_INVALID",
|
|
6972
7010
|
CHROMIUM_PARAM_INVALID: "CHROMIUM_PARAM_INVALID",
|
|
6973
7011
|
CHROMIUM_INPUT_INVALID: "CHROMIUM_INPUT_INVALID",
|
|
7012
|
+
CHROMIUM_WINDOW_HIDDEN: "CHROMIUM_WINDOW_HIDDEN",
|
|
6974
7013
|
CHROMIUM_VIEWPORT_READ_FAILED: "CHROMIUM_VIEWPORT_READ_FAILED",
|
|
6975
7014
|
CHROMIUM_SCREENSHOT_FAILED: "CHROMIUM_SCREENSHOT_FAILED",
|
|
6976
7015
|
CHROMIUM_STORAGE_EVAL_FAILED: "CHROMIUM_STORAGE_EVAL_FAILED",
|
|
@@ -7780,7 +7819,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
7780
7819
|
var SESSION_ID2 = randomUUID5();
|
|
7781
7820
|
function readCliVersion() {
|
|
7782
7821
|
if (true) {
|
|
7783
|
-
return "0.18.
|
|
7822
|
+
return "0.18.1";
|
|
7784
7823
|
}
|
|
7785
7824
|
return "0.0.0";
|
|
7786
7825
|
}
|
|
@@ -8106,12 +8145,12 @@ function resolveHostFingerprint() {
|
|
|
8106
8145
|
}
|
|
8107
8146
|
}
|
|
8108
8147
|
function resolveHostFingerprintAsync() {
|
|
8109
|
-
return new Promise((
|
|
8148
|
+
return new Promise((resolve9) => {
|
|
8110
8149
|
let binary;
|
|
8111
8150
|
try {
|
|
8112
8151
|
binary = simulatorServerBinaryPath();
|
|
8113
8152
|
} catch {
|
|
8114
|
-
|
|
8153
|
+
resolve9(null);
|
|
8115
8154
|
return;
|
|
8116
8155
|
}
|
|
8117
8156
|
let settled = false;
|
|
@@ -8124,7 +8163,7 @@ function resolveHostFingerprintAsync() {
|
|
|
8124
8163
|
child?.kill("SIGKILL");
|
|
8125
8164
|
} catch {
|
|
8126
8165
|
}
|
|
8127
|
-
|
|
8166
|
+
resolve9(value);
|
|
8128
8167
|
};
|
|
8129
8168
|
const watchdog = setTimeout(() => finish(null), FINGERPRINT_TIMEOUT_MS);
|
|
8130
8169
|
watchdog.unref?.();
|
|
@@ -8366,7 +8405,7 @@ async function shutdown(timeoutMs = SHORT_FLUSH_TIMEOUT_MS) {
|
|
|
8366
8405
|
try {
|
|
8367
8406
|
await Promise.race([
|
|
8368
8407
|
client2.shutdown(timeoutMs),
|
|
8369
|
-
new Promise((
|
|
8408
|
+
new Promise((resolve9) => setTimeout(resolve9, timeoutMs + 250).unref())
|
|
8370
8409
|
]);
|
|
8371
8410
|
} catch (err) {
|
|
8372
8411
|
emitDebugError("shutdown failed", err);
|
|
@@ -8386,7 +8425,7 @@ async function markDisabled() {
|
|
|
8386
8425
|
try {
|
|
8387
8426
|
await Promise.race([
|
|
8388
8427
|
client2.shutdown(SHORT_FLUSH_TIMEOUT_MS),
|
|
8389
|
-
new Promise((
|
|
8428
|
+
new Promise((resolve9) => setTimeout(resolve9, SHORT_FLUSH_TIMEOUT_MS).unref())
|
|
8390
8429
|
]);
|
|
8391
8430
|
} catch {
|
|
8392
8431
|
}
|
|
@@ -8628,13 +8667,13 @@ function splitOptions(argv) {
|
|
|
8628
8667
|
return { json, outPath, argvForFlags: rest };
|
|
8629
8668
|
}
|
|
8630
8669
|
async function readStdin() {
|
|
8631
|
-
return new Promise((
|
|
8670
|
+
return new Promise((resolve9, reject) => {
|
|
8632
8671
|
let data = "";
|
|
8633
8672
|
process.stdin.setEncoding("utf8");
|
|
8634
8673
|
process.stdin.on("data", (chunk) => {
|
|
8635
8674
|
data += chunk;
|
|
8636
8675
|
});
|
|
8637
|
-
process.stdin.on("end", () =>
|
|
8676
|
+
process.stdin.on("end", () => resolve9(data));
|
|
8638
8677
|
process.stdin.on("error", reject);
|
|
8639
8678
|
});
|
|
8640
8679
|
}
|
|
@@ -8996,7 +9035,7 @@ function resolveArtifactDisplayPaths(report) {
|
|
|
8996
9035
|
}
|
|
8997
9036
|
function exitAfterFlush(code, streams = [process.stdout, process.stderr]) {
|
|
8998
9037
|
return Promise.all(
|
|
8999
|
-
streams.map((s) => new Promise((
|
|
9038
|
+
streams.map((s) => new Promise((resolve9) => s.write("", () => resolve9())))
|
|
9000
9039
|
).then(() => process.exit(code));
|
|
9001
9040
|
}
|
|
9002
9041
|
function renderReport(report) {
|
|
@@ -9881,7 +9920,7 @@ function ptyInjectBeats(text2) {
|
|
|
9881
9920
|
];
|
|
9882
9921
|
}
|
|
9883
9922
|
function sleep(ms) {
|
|
9884
|
-
return new Promise((
|
|
9923
|
+
return new Promise((resolve9) => setTimeout(resolve9, ms));
|
|
9885
9924
|
}
|
|
9886
9925
|
var DEFAULT_COLS = 80;
|
|
9887
9926
|
var DEFAULT_ROWS = 24;
|
|
@@ -10102,7 +10141,7 @@ var SPAWN_GRACE_MS = 8e3;
|
|
|
10102
10141
|
var DEATH_CONFIRMATIONS = 3;
|
|
10103
10142
|
var SSE_RECONNECT_MS = 1e3;
|
|
10104
10143
|
function sleep2(ms) {
|
|
10105
|
-
return new Promise((
|
|
10144
|
+
return new Promise((resolve9) => setTimeout(resolve9, ms));
|
|
10106
10145
|
}
|
|
10107
10146
|
var TRUST_PROMPT_RE = /trust this folder|do you trust|yes,? i trust|trust the files in this/i;
|
|
10108
10147
|
async function dismissTrustPrompt(session) {
|
package/dist/installer.mjs
CHANGED
|
@@ -9593,13 +9593,13 @@ var require_min_release_age = __commonJS({
|
|
|
9593
9593
|
return Number.isFinite(days) && days > 0 ? days * config_parse_1.DAY_MS : 0;
|
|
9594
9594
|
}
|
|
9595
9595
|
function probe(p) {
|
|
9596
|
-
return new Promise((
|
|
9596
|
+
return new Promise((resolve12) => {
|
|
9597
9597
|
(0, node_child_process_1.exec)(p.command, { timeout: PROBE_TIMEOUT_MS2, windowsHide: true }, (err, stdout2) => {
|
|
9598
9598
|
if (err) {
|
|
9599
|
-
|
|
9599
|
+
resolve12(0);
|
|
9600
9600
|
return;
|
|
9601
9601
|
}
|
|
9602
|
-
|
|
9602
|
+
resolve12(p.parse(stdout2));
|
|
9603
9603
|
});
|
|
9604
9604
|
});
|
|
9605
9605
|
}
|
|
@@ -9632,12 +9632,12 @@ var require_registry = __commonJS({
|
|
|
9632
9632
|
var node_https_1 = __importDefault(__require("node:https"));
|
|
9633
9633
|
var REQUEST_TIMEOUT_MS = 1e4;
|
|
9634
9634
|
function fetchRegistryInfo2(url) {
|
|
9635
|
-
return new Promise((
|
|
9635
|
+
return new Promise((resolve12) => {
|
|
9636
9636
|
let resolved = false;
|
|
9637
9637
|
const safeResolve = (value) => {
|
|
9638
9638
|
if (!resolved) {
|
|
9639
9639
|
resolved = true;
|
|
9640
|
-
|
|
9640
|
+
resolve12(value);
|
|
9641
9641
|
}
|
|
9642
9642
|
};
|
|
9643
9643
|
const req = node_https_1.default.get(url, { timeout: REQUEST_TIMEOUT_MS }, (res) => {
|
|
@@ -13702,14 +13702,14 @@ async function addSourceContext(frames) {
|
|
|
13702
13702
|
return frames;
|
|
13703
13703
|
}
|
|
13704
13704
|
function getContextLinesFromFile(path20, ranges, output) {
|
|
13705
|
-
return new Promise((
|
|
13705
|
+
return new Promise((resolve12) => {
|
|
13706
13706
|
const stream = createReadStream(path20);
|
|
13707
13707
|
const lineReaded = createInterface2({
|
|
13708
13708
|
input: stream
|
|
13709
13709
|
});
|
|
13710
13710
|
function destroyStreamAndResolve() {
|
|
13711
13711
|
stream.destroy();
|
|
13712
|
-
|
|
13712
|
+
resolve12();
|
|
13713
13713
|
}
|
|
13714
13714
|
let lineNumber = 0;
|
|
13715
13715
|
let currentRangeIndex = 0;
|
|
@@ -15006,9 +15006,9 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
|
|
|
15006
15006
|
if (!waitUntil) return;
|
|
15007
15007
|
if (this.disabled || this.optedOut) return;
|
|
15008
15008
|
if (!this._waitUntilCycle) {
|
|
15009
|
-
let
|
|
15009
|
+
let resolve12;
|
|
15010
15010
|
const promise = new Promise((r2) => {
|
|
15011
|
-
|
|
15011
|
+
resolve12 = r2;
|
|
15012
15012
|
});
|
|
15013
15013
|
try {
|
|
15014
15014
|
waitUntil(promise);
|
|
@@ -15016,7 +15016,7 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
|
|
|
15016
15016
|
return;
|
|
15017
15017
|
}
|
|
15018
15018
|
this._waitUntilCycle = {
|
|
15019
|
-
resolve:
|
|
15019
|
+
resolve: resolve12,
|
|
15020
15020
|
startedAt: Date.now(),
|
|
15021
15021
|
timer: void 0
|
|
15022
15022
|
};
|
|
@@ -15040,12 +15040,12 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
|
|
|
15040
15040
|
return cycle?.resolve;
|
|
15041
15041
|
}
|
|
15042
15042
|
async resolveWaitUntilFlush() {
|
|
15043
|
-
const
|
|
15043
|
+
const resolve12 = this._consumeWaitUntilCycle();
|
|
15044
15044
|
try {
|
|
15045
15045
|
await super.flush();
|
|
15046
15046
|
} catch {
|
|
15047
15047
|
} finally {
|
|
15048
|
-
|
|
15048
|
+
resolve12?.();
|
|
15049
15049
|
}
|
|
15050
15050
|
}
|
|
15051
15051
|
getPersistedProperty(key) {
|
|
@@ -15166,15 +15166,15 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
|
|
|
15166
15166
|
async waitForLocalEvaluationReady(timeoutMs = THIRTY_SECONDS) {
|
|
15167
15167
|
if (this.isLocalEvaluationReady()) return true;
|
|
15168
15168
|
if (void 0 === this.featureFlagsPoller) return false;
|
|
15169
|
-
return new Promise((
|
|
15169
|
+
return new Promise((resolve12) => {
|
|
15170
15170
|
const timeout = setTimeout(() => {
|
|
15171
15171
|
cleanup();
|
|
15172
|
-
|
|
15172
|
+
resolve12(false);
|
|
15173
15173
|
}, timeoutMs);
|
|
15174
15174
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count) => {
|
|
15175
15175
|
clearTimeout(timeout);
|
|
15176
15176
|
cleanup();
|
|
15177
|
-
|
|
15177
|
+
resolve12(count > 0);
|
|
15178
15178
|
});
|
|
15179
15179
|
});
|
|
15180
15180
|
}
|
|
@@ -15629,14 +15629,14 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
|
|
|
15629
15629
|
this.context?.enter(data, options);
|
|
15630
15630
|
}
|
|
15631
15631
|
async _shutdown(shutdownTimeoutMs) {
|
|
15632
|
-
const
|
|
15632
|
+
const resolve12 = this._consumeWaitUntilCycle();
|
|
15633
15633
|
await this.featureFlagsPoller?.stopPoller(shutdownTimeoutMs);
|
|
15634
15634
|
this.errorTracking.shutdown();
|
|
15635
15635
|
try {
|
|
15636
15636
|
return await super._shutdown(shutdownTimeoutMs);
|
|
15637
15637
|
} finally {
|
|
15638
15638
|
this.distinctIdHasSentFlagCalls = {};
|
|
15639
|
-
|
|
15639
|
+
resolve12?.();
|
|
15640
15640
|
}
|
|
15641
15641
|
}
|
|
15642
15642
|
async _requestRemoteConfigPayload(flagKey) {
|
|
@@ -16235,6 +16235,7 @@ var FAILURE_CODES = {
|
|
|
16235
16235
|
CHROMIUM_DEVICE_ID_INVALID: "CHROMIUM_DEVICE_ID_INVALID",
|
|
16236
16236
|
CHROMIUM_PARAM_INVALID: "CHROMIUM_PARAM_INVALID",
|
|
16237
16237
|
CHROMIUM_INPUT_INVALID: "CHROMIUM_INPUT_INVALID",
|
|
16238
|
+
CHROMIUM_WINDOW_HIDDEN: "CHROMIUM_WINDOW_HIDDEN",
|
|
16238
16239
|
CHROMIUM_VIEWPORT_READ_FAILED: "CHROMIUM_VIEWPORT_READ_FAILED",
|
|
16239
16240
|
CHROMIUM_SCREENSHOT_FAILED: "CHROMIUM_SCREENSHOT_FAILED",
|
|
16240
16241
|
CHROMIUM_STORAGE_EVAL_FAILED: "CHROMIUM_STORAGE_EVAL_FAILED",
|
|
@@ -17044,7 +17045,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
17044
17045
|
var SESSION_ID = randomUUID3();
|
|
17045
17046
|
function readCliVersion() {
|
|
17046
17047
|
if (true) {
|
|
17047
|
-
return "0.18.
|
|
17048
|
+
return "0.18.1";
|
|
17048
17049
|
}
|
|
17049
17050
|
return "0.0.0";
|
|
17050
17051
|
}
|
|
@@ -17524,12 +17525,12 @@ function resolveHostFingerprint() {
|
|
|
17524
17525
|
}
|
|
17525
17526
|
}
|
|
17526
17527
|
function resolveHostFingerprintAsync() {
|
|
17527
|
-
return new Promise((
|
|
17528
|
+
return new Promise((resolve12) => {
|
|
17528
17529
|
let binary;
|
|
17529
17530
|
try {
|
|
17530
17531
|
binary = simulatorServerBinaryPath();
|
|
17531
17532
|
} catch {
|
|
17532
|
-
|
|
17533
|
+
resolve12(null);
|
|
17533
17534
|
return;
|
|
17534
17535
|
}
|
|
17535
17536
|
let settled = false;
|
|
@@ -17542,7 +17543,7 @@ function resolveHostFingerprintAsync() {
|
|
|
17542
17543
|
child?.kill("SIGKILL");
|
|
17543
17544
|
} catch {
|
|
17544
17545
|
}
|
|
17545
|
-
|
|
17546
|
+
resolve12(value);
|
|
17546
17547
|
};
|
|
17547
17548
|
const watchdog = setTimeout(() => finish(null), FINGERPRINT_TIMEOUT_MS);
|
|
17548
17549
|
watchdog.unref?.();
|
|
@@ -17840,7 +17841,7 @@ async function shutdown(timeoutMs = SHORT_FLUSH_TIMEOUT_MS) {
|
|
|
17840
17841
|
try {
|
|
17841
17842
|
await Promise.race([
|
|
17842
17843
|
client2.shutdown(timeoutMs),
|
|
17843
|
-
new Promise((
|
|
17844
|
+
new Promise((resolve12) => setTimeout(resolve12, timeoutMs + 250).unref())
|
|
17844
17845
|
]);
|
|
17845
17846
|
} catch (err) {
|
|
17846
17847
|
emitDebugError("shutdown failed", err);
|
|
@@ -20678,12 +20679,12 @@ async function isOnline(timeoutMs = PROBE_TIMEOUT_MS) {
|
|
|
20678
20679
|
} catch {
|
|
20679
20680
|
return false;
|
|
20680
20681
|
}
|
|
20681
|
-
return new Promise((
|
|
20682
|
-
const timer = setTimeout(() =>
|
|
20682
|
+
return new Promise((resolve12) => {
|
|
20683
|
+
const timer = setTimeout(() => resolve12(false), timeoutMs);
|
|
20683
20684
|
timer.unref();
|
|
20684
20685
|
dns.lookup(host, (err) => {
|
|
20685
20686
|
clearTimeout(timer);
|
|
20686
|
-
|
|
20687
|
+
resolve12(!err);
|
|
20687
20688
|
});
|
|
20688
20689
|
});
|
|
20689
20690
|
}
|
|
@@ -22303,7 +22304,7 @@ var ShellCommandError = class extends Error {
|
|
|
22303
22304
|
signal;
|
|
22304
22305
|
};
|
|
22305
22306
|
function runShellCommand(cmd, opts = {}) {
|
|
22306
|
-
return new Promise((
|
|
22307
|
+
return new Promise((resolve12, reject) => {
|
|
22307
22308
|
const child = spawn2(cmd.bin, cmd.args, {
|
|
22308
22309
|
stdio: ["ignore", "pipe", "pipe"],
|
|
22309
22310
|
shell: process.platform === "win32",
|
|
@@ -22314,7 +22315,7 @@ function runShellCommand(cmd, opts = {}) {
|
|
|
22314
22315
|
stderr += chunk.toString();
|
|
22315
22316
|
});
|
|
22316
22317
|
child.on("close", (code, signal) => {
|
|
22317
|
-
if (code === 0)
|
|
22318
|
+
if (code === 0) resolve12();
|
|
22318
22319
|
else
|
|
22319
22320
|
reject(
|
|
22320
22321
|
new ShellCommandError(
|
|
@@ -23189,7 +23190,7 @@ async function runSkillsStep(args) {
|
|
|
23189
23190
|
return skillsMethod;
|
|
23190
23191
|
}
|
|
23191
23192
|
function runNpxSkills(args, interactive, cwd) {
|
|
23192
|
-
return new Promise((
|
|
23193
|
+
return new Promise((resolve12, reject) => {
|
|
23193
23194
|
const npxCmd = process.platform === "win32" ? "npx.cmd" : "npx";
|
|
23194
23195
|
const child = spawn3(npxCmd, args, {
|
|
23195
23196
|
stdio: interactive ? "inherit" : ["ignore", "pipe", "pipe"],
|
|
@@ -23208,7 +23209,7 @@ function runNpxSkills(args, interactive, cwd) {
|
|
|
23208
23209
|
}
|
|
23209
23210
|
child.on("close", (code) => {
|
|
23210
23211
|
if (code === 0) {
|
|
23211
|
-
|
|
23212
|
+
resolve12();
|
|
23212
23213
|
} else {
|
|
23213
23214
|
const output = [stderr, stdout2].filter(Boolean).join("\n").trim();
|
|
23214
23215
|
reject(new Error(output || `npx skills exited with code ${code}`));
|
|
@@ -23685,9 +23686,10 @@ var MAX_CONTENT_BYTES = 32 * 1024 * 1024;
|
|
|
23685
23686
|
import { copyFile, mkdir as mkdir4, readFile as readFile4, realpath, rm as rm3, stat as stat3, writeFile as writeFile4 } from "node:fs/promises";
|
|
23686
23687
|
import { constants as fsConstants } from "node:fs";
|
|
23687
23688
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
23688
|
-
import { basename as basename4, dirname as dirname13, extname as extname2, isAbsolute as isAbsolute5, join as join19, normalize, sep as sep6 } from "node:path";
|
|
23689
|
+
import { basename as basename4, dirname as dirname13, extname as extname2, isAbsolute as isAbsolute5, join as join19, normalize, resolve as resolve10, sep as sep6 } from "node:path";
|
|
23689
23690
|
import { createHash as createHash4 } from "node:crypto";
|
|
23690
23691
|
var ALLOWED_SAVE_DIRS = /* @__PURE__ */ new Set([normalize(".argent/recordings")]);
|
|
23692
|
+
var RECORDINGS_SAVE_DIR = normalize(".argent/recordings");
|
|
23691
23693
|
var MAX_DURABLE_BYTES = 2 * 1024 * 1024 * 1024;
|
|
23692
23694
|
|
|
23693
23695
|
// ../argent-installer/src/update.ts
|