@swmansion/argent 0.18.0 → 0.18.1-next.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/bin/argent-android-devtools-0.1.0.apk +0 -0
- package/bin/darwin/ax-service +0 -0
- package/bin/darwin/tvos-ax-service +0 -0
- package/bin/darwin/tvos-hid-daemon +0 -0
- package/bin/tcp/ax-service +0 -0
- package/dist/cli-cmds.mjs +106 -81
- package/dist/installer.mjs +298 -292
- package/dist/mcp-server.mjs +53 -47
- package/dist/tool-server.cjs +6 -3
- package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/libKeyboardPatch.dylib +0 -0
- package/dylibs/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/tcp/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tcp/libKeyboardPatch.dylib +0 -0
- package/dylibs/tcp/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/tvos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tvos/libKeyboardPatch.dylib +0 -0
- package/dylibs/tvos/libNativeDevtoolsIos.dylib +0 -0
- package/package.json +1 -1
package/dist/mcp-server.mjs
CHANGED
|
@@ -2984,7 +2984,7 @@ var require_compile = __commonJS({
|
|
|
2984
2984
|
const schOrFunc = root.refs[ref];
|
|
2985
2985
|
if (schOrFunc)
|
|
2986
2986
|
return schOrFunc;
|
|
2987
|
-
let _sch =
|
|
2987
|
+
let _sch = resolve6.call(this, root, ref);
|
|
2988
2988
|
if (_sch === void 0) {
|
|
2989
2989
|
const schema = (_a3 = root.localRefs) === null || _a3 === void 0 ? void 0 : _a3[ref];
|
|
2990
2990
|
const { schemaId } = this.opts;
|
|
@@ -3011,7 +3011,7 @@ var require_compile = __commonJS({
|
|
|
3011
3011
|
function sameSchemaEnv(s1, s2) {
|
|
3012
3012
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
3013
3013
|
}
|
|
3014
|
-
function
|
|
3014
|
+
function resolve6(root, ref) {
|
|
3015
3015
|
let sch;
|
|
3016
3016
|
while (typeof (sch = this.refs[ref]) == "string")
|
|
3017
3017
|
ref = sch;
|
|
@@ -3229,8 +3229,8 @@ var require_utils = __commonJS({
|
|
|
3229
3229
|
}
|
|
3230
3230
|
return ind;
|
|
3231
3231
|
}
|
|
3232
|
-
function removeDotSegments(
|
|
3233
|
-
let input =
|
|
3232
|
+
function removeDotSegments(path12) {
|
|
3233
|
+
let input = path12;
|
|
3234
3234
|
const output = [];
|
|
3235
3235
|
let nextSlash = -1;
|
|
3236
3236
|
let len = 0;
|
|
@@ -3482,8 +3482,8 @@ var require_schemes = __commonJS({
|
|
|
3482
3482
|
wsComponent.secure = void 0;
|
|
3483
3483
|
}
|
|
3484
3484
|
if (wsComponent.resourceName) {
|
|
3485
|
-
const [
|
|
3486
|
-
wsComponent.path =
|
|
3485
|
+
const [path12, query] = wsComponent.resourceName.split("?");
|
|
3486
|
+
wsComponent.path = path12 && path12 !== "/" ? path12 : void 0;
|
|
3487
3487
|
wsComponent.query = query;
|
|
3488
3488
|
wsComponent.resourceName = void 0;
|
|
3489
3489
|
}
|
|
@@ -3642,7 +3642,7 @@ var require_fast_uri = __commonJS({
|
|
|
3642
3642
|
}
|
|
3643
3643
|
return uri;
|
|
3644
3644
|
}
|
|
3645
|
-
function
|
|
3645
|
+
function resolve6(baseURI, relativeURI, options) {
|
|
3646
3646
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
3647
3647
|
const resolved = resolveComponent(parse3(baseURI, schemelessOptions), parse3(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
3648
3648
|
schemelessOptions.skipEscape = true;
|
|
@@ -3900,7 +3900,7 @@ var require_fast_uri = __commonJS({
|
|
|
3900
3900
|
var fastUri = {
|
|
3901
3901
|
SCHEMES,
|
|
3902
3902
|
normalize: normalize2,
|
|
3903
|
-
resolve:
|
|
3903
|
+
resolve: resolve6,
|
|
3904
3904
|
resolveComponent,
|
|
3905
3905
|
equal,
|
|
3906
3906
|
serialize,
|
|
@@ -7137,10 +7137,10 @@ function mergeDefs(...defs) {
|
|
|
7137
7137
|
function cloneDef(schema) {
|
|
7138
7138
|
return mergeDefs(schema._zod.def);
|
|
7139
7139
|
}
|
|
7140
|
-
function getElementAtPath(obj,
|
|
7141
|
-
if (!
|
|
7140
|
+
function getElementAtPath(obj, path12) {
|
|
7141
|
+
if (!path12)
|
|
7142
7142
|
return obj;
|
|
7143
|
-
return
|
|
7143
|
+
return path12.reduce((acc, key) => acc?.[key], obj);
|
|
7144
7144
|
}
|
|
7145
7145
|
function promiseAllObject(promisesObj) {
|
|
7146
7146
|
const keys = Object.keys(promisesObj);
|
|
@@ -7549,11 +7549,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
7549
7549
|
}
|
|
7550
7550
|
return false;
|
|
7551
7551
|
}
|
|
7552
|
-
function prefixIssues(
|
|
7552
|
+
function prefixIssues(path12, issues) {
|
|
7553
7553
|
return issues.map((iss) => {
|
|
7554
7554
|
var _a3;
|
|
7555
7555
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
7556
|
-
iss.path.unshift(
|
|
7556
|
+
iss.path.unshift(path12);
|
|
7557
7557
|
return iss;
|
|
7558
7558
|
});
|
|
7559
7559
|
}
|
|
@@ -7700,16 +7700,16 @@ function flattenError(error2, mapper = (issue2) => issue2.message) {
|
|
|
7700
7700
|
}
|
|
7701
7701
|
function formatError(error2, mapper = (issue2) => issue2.message) {
|
|
7702
7702
|
const fieldErrors = { _errors: [] };
|
|
7703
|
-
const processError = (error3,
|
|
7703
|
+
const processError = (error3, path12 = []) => {
|
|
7704
7704
|
for (const issue2 of error3.issues) {
|
|
7705
7705
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
7706
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
7706
|
+
issue2.errors.map((issues) => processError({ issues }, [...path12, ...issue2.path]));
|
|
7707
7707
|
} else if (issue2.code === "invalid_key") {
|
|
7708
|
-
processError({ issues: issue2.issues }, [...
|
|
7708
|
+
processError({ issues: issue2.issues }, [...path12, ...issue2.path]);
|
|
7709
7709
|
} else if (issue2.code === "invalid_element") {
|
|
7710
|
-
processError({ issues: issue2.issues }, [...
|
|
7710
|
+
processError({ issues: issue2.issues }, [...path12, ...issue2.path]);
|
|
7711
7711
|
} else {
|
|
7712
|
-
const fullpath = [...
|
|
7712
|
+
const fullpath = [...path12, ...issue2.path];
|
|
7713
7713
|
if (fullpath.length === 0) {
|
|
7714
7714
|
fieldErrors._errors.push(mapper(issue2));
|
|
7715
7715
|
} else {
|
|
@@ -13701,12 +13701,12 @@ var StdioServerTransport = class {
|
|
|
13701
13701
|
this.onclose?.();
|
|
13702
13702
|
}
|
|
13703
13703
|
send(message) {
|
|
13704
|
-
return new Promise((
|
|
13704
|
+
return new Promise((resolve6) => {
|
|
13705
13705
|
const json = serializeMessage(message);
|
|
13706
13706
|
if (this._stdout.write(json)) {
|
|
13707
|
-
|
|
13707
|
+
resolve6();
|
|
13708
13708
|
} else {
|
|
13709
|
-
this._stdout.once("drain",
|
|
13709
|
+
this._stdout.once("drain", resolve6);
|
|
13710
13710
|
}
|
|
13711
13711
|
});
|
|
13712
13712
|
}
|
|
@@ -14304,7 +14304,7 @@ var Protocol = class {
|
|
|
14304
14304
|
return;
|
|
14305
14305
|
}
|
|
14306
14306
|
const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
|
|
14307
|
-
await new Promise((
|
|
14307
|
+
await new Promise((resolve6) => setTimeout(resolve6, pollInterval));
|
|
14308
14308
|
options?.signal?.throwIfAborted();
|
|
14309
14309
|
}
|
|
14310
14310
|
} catch (error2) {
|
|
@@ -14321,7 +14321,7 @@ var Protocol = class {
|
|
|
14321
14321
|
*/
|
|
14322
14322
|
request(request, resultSchema, options) {
|
|
14323
14323
|
const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
|
|
14324
|
-
return new Promise((
|
|
14324
|
+
return new Promise((resolve6, reject) => {
|
|
14325
14325
|
const earlyReject = (error2) => {
|
|
14326
14326
|
reject(error2);
|
|
14327
14327
|
};
|
|
@@ -14399,7 +14399,7 @@ var Protocol = class {
|
|
|
14399
14399
|
if (!parseResult.success) {
|
|
14400
14400
|
reject(parseResult.error);
|
|
14401
14401
|
} else {
|
|
14402
|
-
|
|
14402
|
+
resolve6(parseResult.data);
|
|
14403
14403
|
}
|
|
14404
14404
|
} catch (error2) {
|
|
14405
14405
|
reject(error2);
|
|
@@ -14660,12 +14660,12 @@ var Protocol = class {
|
|
|
14660
14660
|
}
|
|
14661
14661
|
} catch {
|
|
14662
14662
|
}
|
|
14663
|
-
return new Promise((
|
|
14663
|
+
return new Promise((resolve6, reject) => {
|
|
14664
14664
|
if (signal.aborted) {
|
|
14665
14665
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
14666
14666
|
return;
|
|
14667
14667
|
}
|
|
14668
|
-
const timeoutId = setTimeout(
|
|
14668
|
+
const timeoutId = setTimeout(resolve6, interval);
|
|
14669
14669
|
signal.addEventListener("abort", () => {
|
|
14670
14670
|
clearTimeout(timeoutId);
|
|
14671
14671
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
@@ -15490,7 +15490,7 @@ function generateToken() {
|
|
|
15490
15490
|
return randomBytes(AUTH_TOKEN_BYTES).toString("hex");
|
|
15491
15491
|
}
|
|
15492
15492
|
function findFreePort() {
|
|
15493
|
-
return new Promise((
|
|
15493
|
+
return new Promise((resolve6, reject) => {
|
|
15494
15494
|
const srv = net.createServer();
|
|
15495
15495
|
srv.listen(0, "127.0.0.1", () => {
|
|
15496
15496
|
const addr = srv.address();
|
|
@@ -15501,7 +15501,7 @@ function findFreePort() {
|
|
|
15501
15501
|
const port = addr.port;
|
|
15502
15502
|
srv.close((err) => {
|
|
15503
15503
|
if (err) reject(err);
|
|
15504
|
-
else
|
|
15504
|
+
else resolve6(port);
|
|
15505
15505
|
});
|
|
15506
15506
|
});
|
|
15507
15507
|
srv.on("error", reject);
|
|
@@ -15599,7 +15599,7 @@ function killSpawnedChild(child, pid) {
|
|
|
15599
15599
|
}
|
|
15600
15600
|
}
|
|
15601
15601
|
function spawnToolsServer(paths, port, options = {}) {
|
|
15602
|
-
return new Promise((
|
|
15602
|
+
return new Promise((resolve6, reject) => {
|
|
15603
15603
|
let logFd;
|
|
15604
15604
|
try {
|
|
15605
15605
|
fs.mkdirSync(STATE_DIR, { recursive: true });
|
|
@@ -15636,7 +15636,7 @@ function spawnToolsServer(paths, port, options = {}) {
|
|
|
15636
15636
|
rl.close();
|
|
15637
15637
|
child.stdout?.resume();
|
|
15638
15638
|
child.stdout?.unref?.();
|
|
15639
|
-
settle(() =>
|
|
15639
|
+
settle(() => resolve6({ port: actualPort, pid }));
|
|
15640
15640
|
}
|
|
15641
15641
|
});
|
|
15642
15642
|
child.on("error", (err) => {
|
|
@@ -16085,9 +16085,9 @@ async function tarball(sourcePath) {
|
|
|
16085
16085
|
return tarPath;
|
|
16086
16086
|
}
|
|
16087
16087
|
function sha256File(filePath) {
|
|
16088
|
-
return new Promise((
|
|
16088
|
+
return new Promise((resolve6, reject) => {
|
|
16089
16089
|
const hash = createHash2("sha256");
|
|
16090
|
-
createReadStream(filePath).on("data", (chunk) => hash.update(chunk)).on("end", () =>
|
|
16090
|
+
createReadStream(filePath).on("data", (chunk) => hash.update(chunk)).on("end", () => resolve6(hash.digest("hex"))).on("error", reject);
|
|
16091
16091
|
});
|
|
16092
16092
|
}
|
|
16093
16093
|
async function uploadTar(tarPath, endpoint) {
|
|
@@ -16277,13 +16277,16 @@ function nonEmpty(value) {
|
|
|
16277
16277
|
const trimmed = value.trim();
|
|
16278
16278
|
return trimmed === "" ? null : value;
|
|
16279
16279
|
}
|
|
16280
|
+
function resolveHomeDir(options = {}) {
|
|
16281
|
+
if (options.homeDir) return options.homeDir;
|
|
16282
|
+
return process.platform === "win32" ? nonEmpty(process.env.USERPROFILE) ?? os.homedir() : nonEmpty(process.env.HOME) ?? os.homedir();
|
|
16283
|
+
}
|
|
16280
16284
|
function argentHomeDir() {
|
|
16281
|
-
|
|
16282
|
-
return path5.join(home, ".argent");
|
|
16285
|
+
return path5.join(resolveHomeDir(), ".argent");
|
|
16283
16286
|
}
|
|
16284
16287
|
function configDir(scope = "global", options = {}) {
|
|
16285
16288
|
if (scope === "global") {
|
|
16286
|
-
return
|
|
16289
|
+
return path5.join(resolveHomeDir(options), ".argent");
|
|
16287
16290
|
}
|
|
16288
16291
|
const cwd = options.cwd ?? process.cwd();
|
|
16289
16292
|
return path5.join(resolveProjectRoot(cwd), ".argent");
|
|
@@ -16379,6 +16382,9 @@ function updateConfig(mutate, scope = "global", options = {}) {
|
|
|
16379
16382
|
}
|
|
16380
16383
|
}
|
|
16381
16384
|
|
|
16385
|
+
// ../configuration-core/src/config-access.ts
|
|
16386
|
+
import * as path7 from "node:path";
|
|
16387
|
+
|
|
16382
16388
|
// ../argent-tools-client/src/artifacts.ts
|
|
16383
16389
|
var ARTIFACT_MARKER = "__argentArtifact";
|
|
16384
16390
|
function isArtifactHandle(value) {
|
|
@@ -16445,10 +16451,10 @@ async function writeDurableUnique(dir, filename, write) {
|
|
|
16445
16451
|
const stem = filename.slice(0, filename.length - ext.length);
|
|
16446
16452
|
for (let i = 1; i <= 1e3; i++) {
|
|
16447
16453
|
const candidate = i === 1 ? filename : `${stem} (${i})${ext}`;
|
|
16448
|
-
const
|
|
16454
|
+
const path12 = join8(dir, candidate);
|
|
16449
16455
|
try {
|
|
16450
|
-
await write(
|
|
16451
|
-
return
|
|
16456
|
+
await write(path12);
|
|
16457
|
+
return path12;
|
|
16452
16458
|
} catch (err) {
|
|
16453
16459
|
if (err?.code === "EEXIST") continue;
|
|
16454
16460
|
throw err;
|
|
@@ -18794,21 +18800,21 @@ var SESSION_ID2 = randomUUID5();
|
|
|
18794
18800
|
// ../telemetry/src/identity.ts
|
|
18795
18801
|
import * as crypto2 from "node:crypto";
|
|
18796
18802
|
import * as fs4 from "node:fs";
|
|
18797
|
-
import * as
|
|
18803
|
+
import * as path9 from "node:path";
|
|
18798
18804
|
|
|
18799
18805
|
// ../telemetry/src/paths.ts
|
|
18800
|
-
import * as
|
|
18806
|
+
import * as path8 from "node:path";
|
|
18801
18807
|
|
|
18802
18808
|
// ../telemetry/src/fingerprint.ts
|
|
18803
18809
|
import { execFileSync as execFileSync2, spawn as spawn2 } from "node:child_process";
|
|
18804
18810
|
|
|
18805
18811
|
// ../native-devtools-ios/src/index.ts
|
|
18806
|
-
import * as
|
|
18812
|
+
import * as path10 from "node:path";
|
|
18807
18813
|
import * as fs5 from "node:fs";
|
|
18808
|
-
var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ??
|
|
18809
|
-
var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ??
|
|
18810
|
-
var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ??
|
|
18811
|
-
var DYLIB_TVOS_DIR =
|
|
18814
|
+
var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ?? path10.join(__dirname, "..", "dylibs");
|
|
18815
|
+
var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ?? path10.join(__dirname, "..", "bin");
|
|
18816
|
+
var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ?? path10.join(DYLIB_DIR, "tcp");
|
|
18817
|
+
var DYLIB_TVOS_DIR = path10.join(DYLIB_DIR, "tvos");
|
|
18812
18818
|
|
|
18813
18819
|
// ../telemetry/src/consent.ts
|
|
18814
18820
|
import * as fs6 from "node:fs";
|
|
@@ -19198,10 +19204,10 @@ function toMcpTool(t) {
|
|
|
19198
19204
|
|
|
19199
19205
|
// ../argent-mcp/src/installed-version.ts
|
|
19200
19206
|
import * as fs8 from "node:fs";
|
|
19201
|
-
import * as
|
|
19207
|
+
import * as path11 from "node:path";
|
|
19202
19208
|
function getInstalledVersion() {
|
|
19203
19209
|
try {
|
|
19204
|
-
const pkgPath =
|
|
19210
|
+
const pkgPath = path11.resolve(import.meta.dirname, "..", "package.json");
|
|
19205
19211
|
const pkg = JSON.parse(fs8.readFileSync(pkgPath, "utf8"));
|
|
19206
19212
|
return pkg.version ?? "unknown";
|
|
19207
19213
|
} catch {
|
package/dist/tool-server.cjs
CHANGED
|
@@ -98853,13 +98853,16 @@ function nonEmpty(value) {
|
|
|
98853
98853
|
const trimmed = value.trim();
|
|
98854
98854
|
return trimmed === "" ? null : value;
|
|
98855
98855
|
}
|
|
98856
|
+
function resolveHomeDir(options = {}) {
|
|
98857
|
+
if (options.homeDir) return options.homeDir;
|
|
98858
|
+
return process.platform === "win32" ? nonEmpty(process.env.USERPROFILE) ?? os.homedir() : nonEmpty(process.env.HOME) ?? os.homedir();
|
|
98859
|
+
}
|
|
98856
98860
|
function argentHomeDir() {
|
|
98857
|
-
|
|
98858
|
-
return path2.join(home, ".argent");
|
|
98861
|
+
return path2.join(resolveHomeDir(), ".argent");
|
|
98859
98862
|
}
|
|
98860
98863
|
function configDir(scope = "global", options = {}) {
|
|
98861
98864
|
if (scope === "global") {
|
|
98862
|
-
return
|
|
98865
|
+
return path2.join(resolveHomeDir(options), ".argent");
|
|
98863
98866
|
}
|
|
98864
98867
|
const cwd = options.cwd ?? process.cwd();
|
|
98865
98868
|
return path2.join(resolveProjectRoot(cwd), ".argent");
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|