@swmansion/argent 0.8.0 → 0.9.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/ax-service +0 -0
- package/dist/argent-android-devtools-0.1.0.apk +0 -0
- package/dist/installer.mjs +379 -27
- package/dist/mcp-server.mjs +2194 -669
- package/dist/tool-server.cjs +21453 -5693
- package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/libKeyboardPatch.dylib +0 -0
- package/dylibs/libNativeDevtoolsIos.dylib +0 -0
- package/manifest.json +7 -0
- package/package.json +2 -1
- package/rules/argent.md +8 -2
- package/skills/argent-device-interact/SKILL.md +11 -2
- package/skills/argent-react-native-app-workflow/SKILL.md +2 -0
- package/skills/argent-screenshot-diff/SKILL.md +67 -0
- package/skills/argent-test-ui-flow/SKILL.md +38 -16
package/bin/ax-service
CHANGED
|
Binary file
|
|
Binary file
|
package/dist/installer.mjs
CHANGED
|
@@ -9459,6 +9459,291 @@ var require_dist = __commonJS({
|
|
|
9459
9459
|
}
|
|
9460
9460
|
});
|
|
9461
9461
|
|
|
9462
|
+
// ../update-core/dist/config-parse.js
|
|
9463
|
+
var require_config_parse = __commonJS({
|
|
9464
|
+
"../update-core/dist/config-parse.js"(exports) {
|
|
9465
|
+
"use strict";
|
|
9466
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9467
|
+
exports.DAY_MS = exports.MINUTE_MS = exports.SECOND_MS = void 0;
|
|
9468
|
+
exports.parseConfigValue = parseConfigValue;
|
|
9469
|
+
exports.parseBeforeAgeMs = parseBeforeAgeMs;
|
|
9470
|
+
exports.parseYarnAgeGateMs = parseYarnAgeGateMs;
|
|
9471
|
+
exports.SECOND_MS = 1e3;
|
|
9472
|
+
exports.MINUTE_MS = 60 * 1e3;
|
|
9473
|
+
exports.DAY_MS = 24 * 60 * 60 * 1e3;
|
|
9474
|
+
function trimConfigValue(stdout) {
|
|
9475
|
+
const trimmed = stdout.trim();
|
|
9476
|
+
if (!trimmed || trimmed === "undefined" || trimmed === "null")
|
|
9477
|
+
return null;
|
|
9478
|
+
if (trimmed.startsWith('"') && trimmed.endsWith('"') || trimmed.startsWith("'") && trimmed.endsWith("'")) {
|
|
9479
|
+
return trimmed.slice(1, -1).trim();
|
|
9480
|
+
}
|
|
9481
|
+
return trimmed;
|
|
9482
|
+
}
|
|
9483
|
+
function parseConfigValue(stdout) {
|
|
9484
|
+
const value = trimConfigValue(stdout);
|
|
9485
|
+
if (!value)
|
|
9486
|
+
return 0;
|
|
9487
|
+
const n = Number(value);
|
|
9488
|
+
return Number.isFinite(n) && n > 0 ? n : 0;
|
|
9489
|
+
}
|
|
9490
|
+
function parseBeforeAgeMs(stdout, now = Date.now()) {
|
|
9491
|
+
const value = trimConfigValue(stdout);
|
|
9492
|
+
if (!value)
|
|
9493
|
+
return 0;
|
|
9494
|
+
const candidates = [value, value.replace(/\s+\([^)]*\)$/, "")];
|
|
9495
|
+
for (const candidate of candidates) {
|
|
9496
|
+
const ts = Date.parse(candidate);
|
|
9497
|
+
if (!Number.isNaN(ts)) {
|
|
9498
|
+
return ts < now ? now - ts : 0;
|
|
9499
|
+
}
|
|
9500
|
+
}
|
|
9501
|
+
return 0;
|
|
9502
|
+
}
|
|
9503
|
+
function parseYarnAgeGateMs(stdout) {
|
|
9504
|
+
const value = trimConfigValue(stdout);
|
|
9505
|
+
if (!value)
|
|
9506
|
+
return 0;
|
|
9507
|
+
const numeric = Number(value);
|
|
9508
|
+
if (Number.isFinite(numeric) && numeric > 0) {
|
|
9509
|
+
return numeric * exports.MINUTE_MS;
|
|
9510
|
+
}
|
|
9511
|
+
const match = value.match(/^(\d+(?:\.\d+)?)\s*(ms|s|m|h|d|w)$/i);
|
|
9512
|
+
if (!match)
|
|
9513
|
+
return 0;
|
|
9514
|
+
const amount = Number(match[1]);
|
|
9515
|
+
if (!Number.isFinite(amount) || amount <= 0)
|
|
9516
|
+
return 0;
|
|
9517
|
+
switch (match[2].toLowerCase()) {
|
|
9518
|
+
case "ms":
|
|
9519
|
+
return amount;
|
|
9520
|
+
case "s":
|
|
9521
|
+
return amount * exports.SECOND_MS;
|
|
9522
|
+
case "m":
|
|
9523
|
+
return amount * exports.MINUTE_MS;
|
|
9524
|
+
case "h":
|
|
9525
|
+
return amount * 60 * exports.MINUTE_MS;
|
|
9526
|
+
case "d":
|
|
9527
|
+
return amount * exports.DAY_MS;
|
|
9528
|
+
case "w":
|
|
9529
|
+
return amount * 7 * exports.DAY_MS;
|
|
9530
|
+
default:
|
|
9531
|
+
return 0;
|
|
9532
|
+
}
|
|
9533
|
+
}
|
|
9534
|
+
}
|
|
9535
|
+
});
|
|
9536
|
+
|
|
9537
|
+
// ../update-core/dist/min-release-age.js
|
|
9538
|
+
var require_min_release_age = __commonJS({
|
|
9539
|
+
"../update-core/dist/min-release-age.js"(exports) {
|
|
9540
|
+
"use strict";
|
|
9541
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9542
|
+
exports.detectMinReleaseAgeMsForPm = detectMinReleaseAgeMsForPm2;
|
|
9543
|
+
exports.detectMinReleaseAgeMs = detectMinReleaseAgeMs;
|
|
9544
|
+
var node_child_process_1 = __require("node:child_process");
|
|
9545
|
+
var config_parse_1 = require_config_parse();
|
|
9546
|
+
var PROBE_TIMEOUT_MS2 = 3e3;
|
|
9547
|
+
var OVERRIDE_ENV = "ARGENT_MIN_RELEASE_AGE_DAYS";
|
|
9548
|
+
var PM_PROBES = {
|
|
9549
|
+
// npm flattens `min-release-age` to an effective `before` cutoff, and some
|
|
9550
|
+
// npm 11.x builds report `min-release-age=null` even while the policy is
|
|
9551
|
+
// active. Probe `before`, which is what the resolver actually uses.
|
|
9552
|
+
npm: { command: "npm config get before", parse: config_parse_1.parseBeforeAgeMs },
|
|
9553
|
+
pnpm: {
|
|
9554
|
+
command: "pnpm config get minimumReleaseAge",
|
|
9555
|
+
parse: (stdout) => (0, config_parse_1.parseConfigValue)(stdout) * config_parse_1.MINUTE_MS
|
|
9556
|
+
},
|
|
9557
|
+
yarn: { command: "yarn config get npmMinimalAgeGate", parse: config_parse_1.parseYarnAgeGateMs }
|
|
9558
|
+
};
|
|
9559
|
+
function overrideMs() {
|
|
9560
|
+
const override = process.env[OVERRIDE_ENV];
|
|
9561
|
+
if (override === void 0)
|
|
9562
|
+
return null;
|
|
9563
|
+
const days = Number(override);
|
|
9564
|
+
return Number.isFinite(days) && days > 0 ? days * config_parse_1.DAY_MS : 0;
|
|
9565
|
+
}
|
|
9566
|
+
function probe(p2) {
|
|
9567
|
+
return new Promise((resolve3) => {
|
|
9568
|
+
(0, node_child_process_1.exec)(p2.command, { timeout: PROBE_TIMEOUT_MS2, windowsHide: true }, (err, stdout) => {
|
|
9569
|
+
if (err) {
|
|
9570
|
+
resolve3(0);
|
|
9571
|
+
return;
|
|
9572
|
+
}
|
|
9573
|
+
resolve3(p2.parse(stdout));
|
|
9574
|
+
});
|
|
9575
|
+
});
|
|
9576
|
+
}
|
|
9577
|
+
async function detectMinReleaseAgeMsForPm2(pm) {
|
|
9578
|
+
const override = overrideMs();
|
|
9579
|
+
if (override !== null)
|
|
9580
|
+
return override;
|
|
9581
|
+
const p2 = PM_PROBES[pm];
|
|
9582
|
+
return p2 ? probe(p2) : 0;
|
|
9583
|
+
}
|
|
9584
|
+
async function detectMinReleaseAgeMs() {
|
|
9585
|
+
const override = overrideMs();
|
|
9586
|
+
if (override !== null)
|
|
9587
|
+
return override;
|
|
9588
|
+
const ages = await Promise.all(Object.values(PM_PROBES).map(probe));
|
|
9589
|
+
return ages.reduce((max, ms) => Math.max(max, ms), 0);
|
|
9590
|
+
}
|
|
9591
|
+
}
|
|
9592
|
+
});
|
|
9593
|
+
|
|
9594
|
+
// ../update-core/dist/registry.js
|
|
9595
|
+
var require_registry = __commonJS({
|
|
9596
|
+
"../update-core/dist/registry.js"(exports) {
|
|
9597
|
+
"use strict";
|
|
9598
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
9599
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
9600
|
+
};
|
|
9601
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9602
|
+
exports.fetchRegistryInfo = fetchRegistryInfo2;
|
|
9603
|
+
var node_https_1 = __importDefault(__require("node:https"));
|
|
9604
|
+
var REQUEST_TIMEOUT_MS = 1e4;
|
|
9605
|
+
function fetchRegistryInfo2(url) {
|
|
9606
|
+
return new Promise((resolve3) => {
|
|
9607
|
+
let resolved = false;
|
|
9608
|
+
const safeResolve = (value) => {
|
|
9609
|
+
if (!resolved) {
|
|
9610
|
+
resolved = true;
|
|
9611
|
+
resolve3(value);
|
|
9612
|
+
}
|
|
9613
|
+
};
|
|
9614
|
+
const req = node_https_1.default.get(url, { timeout: REQUEST_TIMEOUT_MS }, (res) => {
|
|
9615
|
+
if (res.statusCode !== 200) {
|
|
9616
|
+
res.resume();
|
|
9617
|
+
safeResolve(null);
|
|
9618
|
+
return;
|
|
9619
|
+
}
|
|
9620
|
+
let body = "";
|
|
9621
|
+
res.setEncoding("utf8");
|
|
9622
|
+
res.on("data", (chunk) => {
|
|
9623
|
+
body += chunk;
|
|
9624
|
+
});
|
|
9625
|
+
res.on("end", () => {
|
|
9626
|
+
try {
|
|
9627
|
+
const json = JSON.parse(body);
|
|
9628
|
+
const latestVersion = json["dist-tags"]?.latest;
|
|
9629
|
+
if (!latestVersion) {
|
|
9630
|
+
safeResolve(null);
|
|
9631
|
+
return;
|
|
9632
|
+
}
|
|
9633
|
+
const times = json.time ?? {};
|
|
9634
|
+
safeResolve({
|
|
9635
|
+
latest: { version: latestVersion, publishedAt: times[latestVersion] ?? null },
|
|
9636
|
+
times
|
|
9637
|
+
});
|
|
9638
|
+
} catch {
|
|
9639
|
+
safeResolve(null);
|
|
9640
|
+
}
|
|
9641
|
+
});
|
|
9642
|
+
res.on("error", () => safeResolve(null));
|
|
9643
|
+
});
|
|
9644
|
+
req.on("error", () => safeResolve(null));
|
|
9645
|
+
req.on("timeout", () => {
|
|
9646
|
+
req.destroy();
|
|
9647
|
+
safeResolve(null);
|
|
9648
|
+
});
|
|
9649
|
+
});
|
|
9650
|
+
}
|
|
9651
|
+
}
|
|
9652
|
+
});
|
|
9653
|
+
|
|
9654
|
+
// ../update-core/dist/pick-target.js
|
|
9655
|
+
var require_pick_target = __commonJS({
|
|
9656
|
+
"../update-core/dist/pick-target.js"(exports) {
|
|
9657
|
+
"use strict";
|
|
9658
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
9659
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
9660
|
+
};
|
|
9661
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9662
|
+
exports.pickInstallableTarget = pickInstallableTarget2;
|
|
9663
|
+
var semver_1 = __importDefault(require_semver2());
|
|
9664
|
+
function isStableUpgrade(version, current) {
|
|
9665
|
+
if (!semver_1.default.valid(version) || semver_1.default.prerelease(version))
|
|
9666
|
+
return false;
|
|
9667
|
+
if (current === null)
|
|
9668
|
+
return true;
|
|
9669
|
+
if (!semver_1.default.valid(current))
|
|
9670
|
+
return false;
|
|
9671
|
+
return semver_1.default.gt(version, current);
|
|
9672
|
+
}
|
|
9673
|
+
function isOldEnough(publishedAt, minReleaseAgeMs) {
|
|
9674
|
+
if (minReleaseAgeMs <= 0)
|
|
9675
|
+
return true;
|
|
9676
|
+
if (!publishedAt)
|
|
9677
|
+
return false;
|
|
9678
|
+
const published = Date.parse(publishedAt);
|
|
9679
|
+
if (Number.isNaN(published))
|
|
9680
|
+
return false;
|
|
9681
|
+
return Date.now() - published >= minReleaseAgeMs;
|
|
9682
|
+
}
|
|
9683
|
+
function pickInstallableTarget2(latest, times, current, minReleaseAgeMs) {
|
|
9684
|
+
if (minReleaseAgeMs <= 0) {
|
|
9685
|
+
return isStableUpgrade(latest.version, current) ? latest : null;
|
|
9686
|
+
}
|
|
9687
|
+
let best = null;
|
|
9688
|
+
for (const [version, publishedAt] of Object.entries(times)) {
|
|
9689
|
+
if (!semver_1.default.valid(version) || semver_1.default.prerelease(version))
|
|
9690
|
+
continue;
|
|
9691
|
+
if (current !== null && !semver_1.default.gt(version, current))
|
|
9692
|
+
continue;
|
|
9693
|
+
if (!isOldEnough(publishedAt, minReleaseAgeMs))
|
|
9694
|
+
continue;
|
|
9695
|
+
if (best === null || semver_1.default.gt(version, best.version)) {
|
|
9696
|
+
best = { version, publishedAt };
|
|
9697
|
+
}
|
|
9698
|
+
}
|
|
9699
|
+
return best;
|
|
9700
|
+
}
|
|
9701
|
+
}
|
|
9702
|
+
});
|
|
9703
|
+
|
|
9704
|
+
// ../update-core/dist/index.js
|
|
9705
|
+
var require_dist2 = __commonJS({
|
|
9706
|
+
"../update-core/dist/index.js"(exports) {
|
|
9707
|
+
"use strict";
|
|
9708
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9709
|
+
exports.pickInstallableTarget = exports.fetchRegistryInfo = exports.detectMinReleaseAgeMsForPm = exports.detectMinReleaseAgeMs = exports.parseYarnAgeGateMs = exports.parseBeforeAgeMs = exports.parseConfigValue = exports.DAY_MS = exports.MINUTE_MS = exports.SECOND_MS = void 0;
|
|
9710
|
+
var config_parse_1 = require_config_parse();
|
|
9711
|
+
Object.defineProperty(exports, "SECOND_MS", { enumerable: true, get: function() {
|
|
9712
|
+
return config_parse_1.SECOND_MS;
|
|
9713
|
+
} });
|
|
9714
|
+
Object.defineProperty(exports, "MINUTE_MS", { enumerable: true, get: function() {
|
|
9715
|
+
return config_parse_1.MINUTE_MS;
|
|
9716
|
+
} });
|
|
9717
|
+
Object.defineProperty(exports, "DAY_MS", { enumerable: true, get: function() {
|
|
9718
|
+
return config_parse_1.DAY_MS;
|
|
9719
|
+
} });
|
|
9720
|
+
Object.defineProperty(exports, "parseConfigValue", { enumerable: true, get: function() {
|
|
9721
|
+
return config_parse_1.parseConfigValue;
|
|
9722
|
+
} });
|
|
9723
|
+
Object.defineProperty(exports, "parseBeforeAgeMs", { enumerable: true, get: function() {
|
|
9724
|
+
return config_parse_1.parseBeforeAgeMs;
|
|
9725
|
+
} });
|
|
9726
|
+
Object.defineProperty(exports, "parseYarnAgeGateMs", { enumerable: true, get: function() {
|
|
9727
|
+
return config_parse_1.parseYarnAgeGateMs;
|
|
9728
|
+
} });
|
|
9729
|
+
var min_release_age_1 = require_min_release_age();
|
|
9730
|
+
Object.defineProperty(exports, "detectMinReleaseAgeMs", { enumerable: true, get: function() {
|
|
9731
|
+
return min_release_age_1.detectMinReleaseAgeMs;
|
|
9732
|
+
} });
|
|
9733
|
+
Object.defineProperty(exports, "detectMinReleaseAgeMsForPm", { enumerable: true, get: function() {
|
|
9734
|
+
return min_release_age_1.detectMinReleaseAgeMsForPm;
|
|
9735
|
+
} });
|
|
9736
|
+
var registry_1 = require_registry();
|
|
9737
|
+
Object.defineProperty(exports, "fetchRegistryInfo", { enumerable: true, get: function() {
|
|
9738
|
+
return registry_1.fetchRegistryInfo;
|
|
9739
|
+
} });
|
|
9740
|
+
var pick_target_1 = require_pick_target();
|
|
9741
|
+
Object.defineProperty(exports, "pickInstallableTarget", { enumerable: true, get: function() {
|
|
9742
|
+
return pick_target_1.pickInstallableTarget;
|
|
9743
|
+
} });
|
|
9744
|
+
}
|
|
9745
|
+
});
|
|
9746
|
+
|
|
9462
9747
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
9463
9748
|
import { styleText as v } from "node:util";
|
|
9464
9749
|
import { stdout as x, stdin as D } from "node:process";
|
|
@@ -13020,16 +13305,17 @@ function getAvailableToolIds() {
|
|
|
13020
13305
|
return tools.map((t) => t.id);
|
|
13021
13306
|
}
|
|
13022
13307
|
function buildMcpEntry() {
|
|
13023
|
-
const logFile = path2.join(homedir2(), ".argent", "mcp-calls.log");
|
|
13024
13308
|
return {
|
|
13025
13309
|
command: MCP_BINARY_NAME,
|
|
13026
|
-
args: ["mcp"]
|
|
13027
|
-
env: { ARGENT_MCP_LOG: logFile }
|
|
13310
|
+
args: ["mcp"]
|
|
13028
13311
|
};
|
|
13029
13312
|
}
|
|
13030
13313
|
function getMcpEntry() {
|
|
13031
13314
|
return buildMcpEntry();
|
|
13032
13315
|
}
|
|
13316
|
+
function hasEnv(entry) {
|
|
13317
|
+
return entry.env != null && Object.keys(entry.env).length > 0;
|
|
13318
|
+
}
|
|
13033
13319
|
function removeDirIfEmpty(dirPath) {
|
|
13034
13320
|
try {
|
|
13035
13321
|
if (!fs2.existsSync(dirPath)) return;
|
|
@@ -13091,7 +13377,7 @@ var cursorAdapter = {
|
|
|
13091
13377
|
servers[MCP_SERVER_KEY] = {
|
|
13092
13378
|
command: entry.command,
|
|
13093
13379
|
args: entry.args,
|
|
13094
|
-
env: entry.env
|
|
13380
|
+
...hasEnv(entry) ? { env: entry.env } : {}
|
|
13095
13381
|
};
|
|
13096
13382
|
config.mcpServers = servers;
|
|
13097
13383
|
writeJson(configPath, config);
|
|
@@ -13146,7 +13432,7 @@ var claudeAdapter = {
|
|
|
13146
13432
|
type: "stdio",
|
|
13147
13433
|
command: entry.command,
|
|
13148
13434
|
args: entry.args,
|
|
13149
|
-
env: entry.env
|
|
13435
|
+
...hasEnv(entry) ? { env: entry.env } : {}
|
|
13150
13436
|
};
|
|
13151
13437
|
config.mcpServers = servers;
|
|
13152
13438
|
writeJson(configPath, config);
|
|
@@ -13185,7 +13471,7 @@ var vscodeAdapter = {
|
|
|
13185
13471
|
type: "stdio",
|
|
13186
13472
|
command: entry.command,
|
|
13187
13473
|
args: entry.args,
|
|
13188
|
-
env: entry.env
|
|
13474
|
+
...hasEnv(entry) ? { env: entry.env } : {}
|
|
13189
13475
|
};
|
|
13190
13476
|
config.servers = servers;
|
|
13191
13477
|
writeJson(configPath, config);
|
|
@@ -13217,7 +13503,7 @@ var windsurfAdapter = {
|
|
|
13217
13503
|
servers[MCP_SERVER_KEY] = {
|
|
13218
13504
|
command: entry.command,
|
|
13219
13505
|
args: entry.args,
|
|
13220
|
-
env: entry.env
|
|
13506
|
+
...hasEnv(entry) ? { env: entry.env } : {}
|
|
13221
13507
|
};
|
|
13222
13508
|
config.mcpServers = servers;
|
|
13223
13509
|
writeJson(configPath, config);
|
|
@@ -13272,7 +13558,7 @@ var zedAdapter = {
|
|
|
13272
13558
|
source: "custom",
|
|
13273
13559
|
command: entry.command,
|
|
13274
13560
|
args: entry.args,
|
|
13275
|
-
env: entry.env
|
|
13561
|
+
...hasEnv(entry) ? { env: entry.env } : {}
|
|
13276
13562
|
});
|
|
13277
13563
|
},
|
|
13278
13564
|
remove(configPath) {
|
|
@@ -13317,7 +13603,7 @@ var geminiAdapter = {
|
|
|
13317
13603
|
servers[MCP_SERVER_KEY] = {
|
|
13318
13604
|
command: entry.command,
|
|
13319
13605
|
args: entry.args,
|
|
13320
|
-
env: entry.env
|
|
13606
|
+
...hasEnv(entry) ? { env: entry.env } : {}
|
|
13321
13607
|
};
|
|
13322
13608
|
config.mcpServers = servers;
|
|
13323
13609
|
writeJson(configPath, config);
|
|
@@ -13374,7 +13660,7 @@ var codexAdapter = {
|
|
|
13374
13660
|
servers[MCP_SERVER_KEY] = {
|
|
13375
13661
|
command: entry.command,
|
|
13376
13662
|
args: entry.args,
|
|
13377
|
-
env: entry.env
|
|
13663
|
+
...hasEnv(entry) ? { env: entry.env } : {}
|
|
13378
13664
|
};
|
|
13379
13665
|
config.mcp_servers = servers;
|
|
13380
13666
|
writeToml(configPath, config);
|
|
@@ -13448,7 +13734,7 @@ var hermesAdapter = {
|
|
|
13448
13734
|
doc.setIn(["mcp_servers", MCP_SERVER_KEY], {
|
|
13449
13735
|
command: entry.command,
|
|
13450
13736
|
args: entry.args,
|
|
13451
|
-
env: entry.env
|
|
13737
|
+
...hasEnv(entry) ? { env: entry.env } : {}
|
|
13452
13738
|
});
|
|
13453
13739
|
writeYaml(configPath, doc);
|
|
13454
13740
|
},
|
|
@@ -13502,7 +13788,7 @@ var openCodeAdapter = {
|
|
|
13502
13788
|
type: "local",
|
|
13503
13789
|
command: [entry.command, ...entry.args],
|
|
13504
13790
|
enabled: true,
|
|
13505
|
-
environment: entry.env
|
|
13791
|
+
...hasEnv(entry) ? { environment: entry.env } : {}
|
|
13506
13792
|
});
|
|
13507
13793
|
},
|
|
13508
13794
|
remove(configPath) {
|
|
@@ -14325,8 +14611,24 @@ function runNpxSkills(args, interactive, cwd) {
|
|
|
14325
14611
|
|
|
14326
14612
|
// ../argent-installer/src/update.ts
|
|
14327
14613
|
var import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
14614
|
+
var import_semver2 = __toESM(require_semver2(), 1);
|
|
14328
14615
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
14329
14616
|
|
|
14617
|
+
// ../argent-installer/src/update-target.ts
|
|
14618
|
+
var import_update_core = __toESM(require_dist2(), 1);
|
|
14619
|
+
async function resolveInstallableUpdateTarget(pm, current) {
|
|
14620
|
+
const info = await (0, import_update_core.fetchRegistryInfo)(`${NPM_REGISTRY}/${PACKAGE_NAME}`);
|
|
14621
|
+
if (info === null) return null;
|
|
14622
|
+
const minReleaseAgeMs = await (0, import_update_core.detectMinReleaseAgeMsForPm)(pm);
|
|
14623
|
+
const target = (0, import_update_core.pickInstallableTarget)(info.latest, info.times, current, minReleaseAgeMs);
|
|
14624
|
+
return {
|
|
14625
|
+
latestVersion: info.latest.version,
|
|
14626
|
+
latestPublishedAt: info.latest.publishedAt,
|
|
14627
|
+
targetVersion: target?.version ?? null,
|
|
14628
|
+
minReleaseAgeMs
|
|
14629
|
+
};
|
|
14630
|
+
}
|
|
14631
|
+
|
|
14330
14632
|
// ../argent-tools-client/src/launcher.ts
|
|
14331
14633
|
import * as net from "node:net";
|
|
14332
14634
|
import * as fs3 from "node:fs";
|
|
@@ -14363,8 +14665,21 @@ async function killToolServer() {
|
|
|
14363
14665
|
}
|
|
14364
14666
|
|
|
14365
14667
|
// ../argent-installer/src/update.ts
|
|
14668
|
+
function getRequestedVersion(args) {
|
|
14669
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
14670
|
+
const arg = args[i];
|
|
14671
|
+
if (arg === "--version") {
|
|
14672
|
+
return args[i + 1] ?? null;
|
|
14673
|
+
}
|
|
14674
|
+
if (arg?.startsWith("--version=")) {
|
|
14675
|
+
return arg.slice("--version=".length) || null;
|
|
14676
|
+
}
|
|
14677
|
+
}
|
|
14678
|
+
return null;
|
|
14679
|
+
}
|
|
14366
14680
|
async function update(args) {
|
|
14367
14681
|
const nonInteractive = args.includes("--yes") || args.includes("-y");
|
|
14682
|
+
const requestedVersion = getRequestedVersion(args);
|
|
14368
14683
|
ge(import_picocolors3.default.bgCyan(import_picocolors3.default.black(" argent update ")));
|
|
14369
14684
|
const globallyInstalled = isGloballyInstalled();
|
|
14370
14685
|
const installed = globallyInstalled ? getGloballyInstalledVersion() : null;
|
|
@@ -14374,13 +14689,34 @@ async function update(args) {
|
|
|
14374
14689
|
}
|
|
14375
14690
|
const spinner = ft();
|
|
14376
14691
|
spinner.start("Checking for updates...");
|
|
14377
|
-
|
|
14378
|
-
|
|
14379
|
-
|
|
14380
|
-
|
|
14381
|
-
|
|
14382
|
-
|
|
14383
|
-
|
|
14692
|
+
const pm = detectPackageManager();
|
|
14693
|
+
let latest = null;
|
|
14694
|
+
let target = null;
|
|
14695
|
+
let minReleaseAgeMs = 0;
|
|
14696
|
+
if (requestedVersion !== null) {
|
|
14697
|
+
if (!import_semver2.default.valid(requestedVersion) || import_semver2.default.prerelease(requestedVersion)) {
|
|
14698
|
+
spinner.stop(import_picocolors3.default.red("Invalid update target."));
|
|
14699
|
+
R2.error(`Requested version is not a stable semver: ${requestedVersion}`);
|
|
14700
|
+
process.exit(1);
|
|
14701
|
+
}
|
|
14702
|
+
target = requestedVersion;
|
|
14703
|
+
} else {
|
|
14704
|
+
let resolved;
|
|
14705
|
+
try {
|
|
14706
|
+
resolved = await resolveInstallableUpdateTarget(pm, installed);
|
|
14707
|
+
} catch (err) {
|
|
14708
|
+
spinner.stop(import_picocolors3.default.red("Could not reach registry."));
|
|
14709
|
+
R2.error(`Failed to check registry: ${err}`);
|
|
14710
|
+
process.exit(1);
|
|
14711
|
+
}
|
|
14712
|
+
if (resolved === null) {
|
|
14713
|
+
spinner.stop(import_picocolors3.default.red("Could not reach registry."));
|
|
14714
|
+
R2.error("Failed to determine the latest Argent release from the registry.");
|
|
14715
|
+
process.exit(1);
|
|
14716
|
+
}
|
|
14717
|
+
latest = resolved.latestVersion;
|
|
14718
|
+
target = resolved.targetVersion;
|
|
14719
|
+
minReleaseAgeMs = resolved.minReleaseAgeMs;
|
|
14384
14720
|
}
|
|
14385
14721
|
spinner.stop("Version check complete.");
|
|
14386
14722
|
if (installed) {
|
|
@@ -14388,19 +14724,26 @@ async function update(args) {
|
|
|
14388
14724
|
} else {
|
|
14389
14725
|
R2.warn(`${PACKAGE_NAME} is not installed globally.`);
|
|
14390
14726
|
}
|
|
14391
|
-
|
|
14392
|
-
|
|
14393
|
-
|
|
14727
|
+
if (latest) {
|
|
14728
|
+
R2.info(`Latest: ${import_picocolors3.default.cyan(`v${latest}`)}`);
|
|
14729
|
+
}
|
|
14730
|
+
if (target) {
|
|
14731
|
+
const label = latest && latest !== target ? "Target: " : "Version: ";
|
|
14732
|
+
const suffix = latest && latest !== target ? import_picocolors3.default.dim(" (newest installable)") : "";
|
|
14733
|
+
R2.info(`${label}${import_picocolors3.default.cyan(`v${target}`)}${suffix}`);
|
|
14734
|
+
}
|
|
14735
|
+
const needsInstall = target !== null && (!installed || isNewerVersion(target, installed));
|
|
14736
|
+
const latestIsNewer = latest !== null && (!installed || isNewerVersion(latest, installed));
|
|
14737
|
+
if (needsInstall && target !== null) {
|
|
14394
14738
|
if (installed) {
|
|
14395
|
-
R2.warn(`Update available: ${import_picocolors3.default.yellow(`v${installed}`)} -> ${import_picocolors3.default.green(`v${
|
|
14739
|
+
R2.warn(`Update available: ${import_picocolors3.default.yellow(`v${installed}`)} -> ${import_picocolors3.default.green(`v${target}`)}`);
|
|
14396
14740
|
}
|
|
14397
|
-
const
|
|
14398
|
-
const cmd = globalInstallCommand(pm, `${PACKAGE_NAME}@${latest}`);
|
|
14741
|
+
const cmd = globalInstallCommand(pm, `${PACKAGE_NAME}@${target}`);
|
|
14399
14742
|
const cmdStr = formatShellCommand(cmd);
|
|
14400
14743
|
if (!nonInteractive) {
|
|
14401
14744
|
R2.message(import_picocolors3.default.dim(" Press y for yes, n for no, enter to confirm."));
|
|
14402
14745
|
const proceed = await ue({
|
|
14403
|
-
message: installed ? `Update to v${
|
|
14746
|
+
message: installed ? `Update to v${target}?` : `Install ${PACKAGE_NAME}@${target} globally?`,
|
|
14404
14747
|
initialValue: true
|
|
14405
14748
|
});
|
|
14406
14749
|
if (q(proceed) || !proceed) {
|
|
@@ -14420,7 +14763,16 @@ async function update(args) {
|
|
|
14420
14763
|
process.exit(1);
|
|
14421
14764
|
}
|
|
14422
14765
|
} else {
|
|
14423
|
-
|
|
14766
|
+
if (latest && target === null && latestIsNewer && minReleaseAgeMs > 0) {
|
|
14767
|
+
R2.warn(
|
|
14768
|
+
`Latest version ${import_picocolors3.default.cyan(`v${latest}`)} is still held by your minimum-release-age policy.`
|
|
14769
|
+
);
|
|
14770
|
+
R2.info("No installable update is available yet.");
|
|
14771
|
+
} else if (latest && target && latest !== target) {
|
|
14772
|
+
R2.success("Already on the latest installable version.");
|
|
14773
|
+
} else {
|
|
14774
|
+
R2.success("Already on the latest version.");
|
|
14775
|
+
}
|
|
14424
14776
|
}
|
|
14425
14777
|
spinner.start("Refreshing workspace configuration...");
|
|
14426
14778
|
const projectRoot = resolveProjectRoot(process.cwd());
|