@swmansion/argent 0.15.1-next.13 → 0.15.1-next.3
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 +3 -12
- package/bin/darwin/simulator-server +0 -0
- package/bin/linux/simulator-server +0 -0
- package/bin/linux-arm64/simulator-server +0 -0
- package/dist/bundled-paths.js +2 -3
- package/dist/bundled-paths.js.map +1 -1
- package/dist/cli-cmds.mjs +6 -39
- package/dist/installer.mjs +34 -416
- package/dist/mcp-server.mjs +3 -35
- package/dist/tool-server.cjs +122 -506
- package/package.json +5 -3
- package/rules/argent.md +2 -2
- package/scripts/postinstall.cjs +105 -0
- package/skills/argent-create-flow/SKILL.md +16 -22
- package/skills/argent-device-interact/SKILL.md +0 -12
- package/skills/argent-metro-debugger/SKILL.md +8 -11
- package/skills/argent-metro-debugger/references/failure-scenarios.md +6 -6
- package/skills/argent-test-ui-flow/SKILL.md +1 -3
- package/skills/argent-tv-interact/SKILL.md +1 -11
package/dist/installer.mjs
CHANGED
|
@@ -16141,10 +16141,10 @@ var FAILURE_CODES = {
|
|
|
16141
16141
|
ANDROID_UIAUTOMATOR_PARSE_FAILED: "ANDROID_UIAUTOMATOR_PARSE_FAILED",
|
|
16142
16142
|
ANDROID_UIAUTOMATOR_CAPTURE_FAILED: "ANDROID_UIAUTOMATOR_CAPTURE_FAILED",
|
|
16143
16143
|
DEBUGGER_METRO_NOT_RUNNING: "DEBUGGER_METRO_NOT_RUNNING",
|
|
16144
|
+
DEBUGGER_METRO_PROJECT_ROOT_MISSING: "DEBUGGER_METRO_PROJECT_ROOT_MISSING",
|
|
16144
16145
|
DEBUGGER_METRO_NO_TARGETS: "DEBUGGER_METRO_NO_TARGETS",
|
|
16145
16146
|
DEBUGGER_CDP_RUNTIME_EXCEPTION: "DEBUGGER_CDP_RUNTIME_EXCEPTION",
|
|
16146
16147
|
DEBUGGER_CDP_BINDING_TIMEOUT: "DEBUGGER_CDP_BINDING_TIMEOUT",
|
|
16147
|
-
DEBUGGER_CDP_BINDING_UNAVAILABLE: "DEBUGGER_CDP_BINDING_UNAVAILABLE",
|
|
16148
16148
|
DEBUGGER_CDP_PROTOCOL_ERROR: "DEBUGGER_CDP_PROTOCOL_ERROR",
|
|
16149
16149
|
DEBUGGER_RELOAD_FAILED: "DEBUGGER_RELOAD_FAILED",
|
|
16150
16150
|
JS_RUNTIME_CONSOLE_SERVER_BIND_FAILED: "JS_RUNTIME_CONSOLE_SERVER_BIND_FAILED",
|
|
@@ -16231,7 +16231,6 @@ var FAILURE_CODES = {
|
|
|
16231
16231
|
CHROMIUM_ELECTRON_EXITED_BEFORE_READY: "CHROMIUM_ELECTRON_EXITED_BEFORE_READY",
|
|
16232
16232
|
KEYBOARD_KEY_UNSUPPORTED: "KEYBOARD_KEY_UNSUPPORTED",
|
|
16233
16233
|
KEYBOARD_CHARACTER_UNSUPPORTED: "KEYBOARD_CHARACTER_UNSUPPORTED",
|
|
16234
|
-
SECRET_PLACEHOLDER_UNKNOWN: "SECRET_PLACEHOLDER_UNKNOWN",
|
|
16235
16234
|
SCREENSHOT_DIFF_INPUT_INVALID: "SCREENSHOT_DIFF_INPUT_INVALID",
|
|
16236
16235
|
BOOT_DEVICE_TARGET_SELECTION_INVALID: "BOOT_DEVICE_TARGET_SELECTION_INVALID",
|
|
16237
16236
|
BOOT_IOS_UNSUPPORTED_HOST: "BOOT_IOS_UNSUPPORTED_HOST",
|
|
@@ -16464,8 +16463,6 @@ var ALLOWED = {
|
|
|
16464
16463
|
action: PACKAGE_ACTION,
|
|
16465
16464
|
is_success: bool,
|
|
16466
16465
|
duration_ms: DURATION_MS,
|
|
16467
|
-
retry_count: COUNT,
|
|
16468
|
-
last_attempt_duration_ms: DURATION_MS,
|
|
16469
16466
|
...FAILURE_SIGNAL
|
|
16470
16467
|
},
|
|
16471
16468
|
"installation:cli_update_start": {},
|
|
@@ -17027,7 +17024,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
17027
17024
|
var SESSION_ID = randomUUID3();
|
|
17028
17025
|
function readCliVersion() {
|
|
17029
17026
|
if (true) {
|
|
17030
|
-
return "0.
|
|
17027
|
+
return "0.15.0";
|
|
17031
17028
|
}
|
|
17032
17029
|
return "0.0.0";
|
|
17033
17030
|
}
|
|
@@ -20045,30 +20042,12 @@ function detectPackageManager() {
|
|
|
20045
20042
|
if (agent.startsWith("bun")) return "bun";
|
|
20046
20043
|
return "npm";
|
|
20047
20044
|
}
|
|
20048
|
-
function asKnownPm(name) {
|
|
20049
|
-
return name === "npm" || name === "yarn" || name === "pnpm" || name === "bun" ? name : null;
|
|
20050
|
-
}
|
|
20051
20045
|
function pmFromPackageManagerField(dir) {
|
|
20052
20046
|
try {
|
|
20053
20047
|
const pkg = JSON.parse(fs8.readFileSync(path8.join(dir, "package.json"), "utf8"));
|
|
20054
|
-
if (typeof pkg.packageManager
|
|
20055
|
-
|
|
20056
|
-
|
|
20057
|
-
return null;
|
|
20058
|
-
} catch {
|
|
20059
|
-
return null;
|
|
20060
|
-
}
|
|
20061
|
-
}
|
|
20062
|
-
function pmFromDevEngines(dir) {
|
|
20063
|
-
try {
|
|
20064
|
-
const pkg = JSON.parse(fs8.readFileSync(path8.join(dir, "package.json"), "utf8"));
|
|
20065
|
-
const devEnginesPm = pkg.devEngines?.packageManager;
|
|
20066
|
-
const names = /* @__PURE__ */ new Set();
|
|
20067
|
-
for (const entry of Array.isArray(devEnginesPm) ? devEnginesPm : [devEnginesPm]) {
|
|
20068
|
-
const name = asKnownPm(entry?.name);
|
|
20069
|
-
if (name) names.add(name);
|
|
20070
|
-
}
|
|
20071
|
-
return names.size === 1 ? [...names][0] : null;
|
|
20048
|
+
if (typeof pkg.packageManager !== "string") return null;
|
|
20049
|
+
const name = pkg.packageManager.split("@")[0];
|
|
20050
|
+
return name === "npm" || name === "yarn" || name === "pnpm" || name === "bun" ? name : null;
|
|
20072
20051
|
} catch {
|
|
20073
20052
|
return null;
|
|
20074
20053
|
}
|
|
@@ -20081,13 +20060,10 @@ function pmFromLockfile(dir) {
|
|
|
20081
20060
|
if (has("package-lock.json") || has("npm-shrinkwrap.json")) return "npm";
|
|
20082
20061
|
return null;
|
|
20083
20062
|
}
|
|
20084
|
-
function pmFromWorkspaceMarker(dir) {
|
|
20085
|
-
return fs8.existsSync(path8.join(dir, "pnpm-workspace.yaml")) ? "pnpm" : null;
|
|
20086
|
-
}
|
|
20087
20063
|
function detectProjectPackageManager(projectRoot) {
|
|
20088
20064
|
let dir = path8.resolve(projectRoot);
|
|
20089
20065
|
for (; ; ) {
|
|
20090
|
-
const pm = pmFromPackageManagerField(dir) ?? pmFromLockfile(dir)
|
|
20066
|
+
const pm = pmFromPackageManagerField(dir) ?? pmFromLockfile(dir);
|
|
20091
20067
|
if (pm) return pm;
|
|
20092
20068
|
if (fs8.existsSync(path8.join(dir, ".git"))) break;
|
|
20093
20069
|
const parent = path8.dirname(dir);
|
|
@@ -20749,291 +20725,10 @@ function writeTomlOrRemove(filePath, data) {
|
|
|
20749
20725
|
}
|
|
20750
20726
|
writeToml(filePath, data);
|
|
20751
20727
|
}
|
|
20752
|
-
function dirHasEditorEvidence(dir, looksArgentOnly) {
|
|
20753
|
-
return dirExists(dir) && !looksArgentOnly(dir);
|
|
20754
|
-
}
|
|
20755
|
-
function fileHasEditorEvidence(filePath, looksArgentOnly) {
|
|
20756
|
-
return fs13.existsSync(filePath) && !looksArgentOnly(filePath);
|
|
20757
|
-
}
|
|
20758
|
-
function parseJsoncStrict(filePath) {
|
|
20759
|
-
let raw;
|
|
20760
|
-
try {
|
|
20761
|
-
raw = fs13.readFileSync(filePath, "utf8");
|
|
20762
|
-
} catch {
|
|
20763
|
-
return null;
|
|
20764
|
-
}
|
|
20765
|
-
if (raw.charCodeAt(0) === 65279) raw = raw.slice(1);
|
|
20766
|
-
const errors = [];
|
|
20767
|
-
const parsed = parse3(raw, errors, { allowTrailingComma: true });
|
|
20768
|
-
if (errors.length > 0 || parsed === null || typeof parsed !== "object" || Array.isArray(parsed))
|
|
20769
|
-
return null;
|
|
20770
|
-
return parsed;
|
|
20771
|
-
}
|
|
20772
|
-
function parseTomlStrict(filePath) {
|
|
20773
|
-
try {
|
|
20774
|
-
return parse(fs13.readFileSync(filePath, "utf8"));
|
|
20775
|
-
} catch {
|
|
20776
|
-
return null;
|
|
20777
|
-
}
|
|
20778
|
-
}
|
|
20779
|
-
function parseYamlStrict(filePath) {
|
|
20780
|
-
try {
|
|
20781
|
-
const parsed = (0, import_yaml2.parse)(fs13.readFileSync(filePath, "utf8"));
|
|
20782
|
-
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return null;
|
|
20783
|
-
return parsed;
|
|
20784
|
-
} catch {
|
|
20785
|
-
return null;
|
|
20786
|
-
}
|
|
20787
|
-
}
|
|
20788
|
-
function jsonLooksArgentServerOnly(filePath, containerKey) {
|
|
20789
|
-
const config = parseJsoncStrict(filePath);
|
|
20790
|
-
if (config === null) return false;
|
|
20791
|
-
const keys = Object.keys(config);
|
|
20792
|
-
if (keys.length !== 1 || keys[0] !== containerKey) return false;
|
|
20793
|
-
const servers = config[containerKey] ?? {};
|
|
20794
|
-
const serverKeys = Object.keys(servers);
|
|
20795
|
-
return serverKeys.length === 1 && serverKeys[0] === MCP_SERVER_KEY;
|
|
20796
|
-
}
|
|
20797
|
-
var bundledManagedNamesCache = null;
|
|
20798
|
-
function bundledManagedNames(kind) {
|
|
20799
|
-
if (!bundledManagedNamesCache) bundledManagedNamesCache = /* @__PURE__ */ new Map();
|
|
20800
|
-
const cached2 = bundledManagedNamesCache.get(kind);
|
|
20801
|
-
if (cached2) return cached2;
|
|
20802
|
-
let names;
|
|
20803
|
-
try {
|
|
20804
|
-
names = new Set(fs13.readdirSync(kind === "rules" ? RULES_DIR : AGENTS_DIR));
|
|
20805
|
-
} catch {
|
|
20806
|
-
names = /* @__PURE__ */ new Set();
|
|
20807
|
-
}
|
|
20808
|
-
bundledManagedNamesCache.set(kind, names);
|
|
20809
|
-
return names;
|
|
20810
|
-
}
|
|
20811
|
-
function managedDirLooksArgentOnly(dir, kind) {
|
|
20812
|
-
let entries;
|
|
20813
|
-
try {
|
|
20814
|
-
entries = fs13.readdirSync(dir);
|
|
20815
|
-
} catch {
|
|
20816
|
-
return false;
|
|
20817
|
-
}
|
|
20818
|
-
if (entries.length === 0) return false;
|
|
20819
|
-
if (kind === "skills") return entries.every((name) => name.startsWith(ARGENT_SKILL_PREFIX));
|
|
20820
|
-
const bundled = bundledManagedNames(kind);
|
|
20821
|
-
return entries.every((name) => bundled.has(name));
|
|
20822
|
-
}
|
|
20823
|
-
function cursorDirLooksArgentOnly(dir) {
|
|
20824
|
-
let entries;
|
|
20825
|
-
try {
|
|
20826
|
-
entries = fs13.readdirSync(dir);
|
|
20827
|
-
} catch {
|
|
20828
|
-
return false;
|
|
20829
|
-
}
|
|
20830
|
-
if (entries.length === 0) return false;
|
|
20831
|
-
return entries.every((entry) => {
|
|
20832
|
-
const full = path13.join(dir, entry);
|
|
20833
|
-
if (entry === "mcp.json") {
|
|
20834
|
-
return jsonLooksArgentServerOnly(full, "mcpServers");
|
|
20835
|
-
}
|
|
20836
|
-
if (entry === "permissions.json") {
|
|
20837
|
-
const config = parseJsoncStrict(full);
|
|
20838
|
-
if (config === null) return false;
|
|
20839
|
-
const keys = Object.keys(config);
|
|
20840
|
-
if (keys.length !== 1 || keys[0] !== "mcpAllowlist") return false;
|
|
20841
|
-
const list = config.mcpAllowlist;
|
|
20842
|
-
return Array.isArray(list) && list.length > 0 && list.every((rule) => rule === CURSOR_ALLOWLIST_PATTERN);
|
|
20843
|
-
}
|
|
20844
|
-
if (entry === "rules" || entry === "agents" || entry === "skills") {
|
|
20845
|
-
return managedDirLooksArgentOnly(full, entry);
|
|
20846
|
-
}
|
|
20847
|
-
return false;
|
|
20848
|
-
});
|
|
20849
|
-
}
|
|
20850
|
-
function claudeSettingsLooksArgentOnly(filePath) {
|
|
20851
|
-
const config = parseJsoncStrict(filePath);
|
|
20852
|
-
if (config === null) return false;
|
|
20853
|
-
const keys = Object.keys(config);
|
|
20854
|
-
if (keys.length !== 1 || keys[0] !== "permissions") return false;
|
|
20855
|
-
const permissions = config.permissions;
|
|
20856
|
-
if (!isRecord(permissions)) return false;
|
|
20857
|
-
const permKeys = Object.keys(permissions);
|
|
20858
|
-
if (permKeys.length !== 1 || permKeys[0] !== "allow") return false;
|
|
20859
|
-
const allow = permissions.allow;
|
|
20860
|
-
return Array.isArray(allow) && allow.length > 0 && allow.every((rule) => rule === PERMISSION_RULE);
|
|
20861
|
-
}
|
|
20862
|
-
function claudeDirLooksArgentOnly(dir) {
|
|
20863
|
-
let entries;
|
|
20864
|
-
try {
|
|
20865
|
-
entries = fs13.readdirSync(dir);
|
|
20866
|
-
} catch {
|
|
20867
|
-
return false;
|
|
20868
|
-
}
|
|
20869
|
-
if (entries.length === 0) return false;
|
|
20870
|
-
return entries.every((entry) => {
|
|
20871
|
-
const full = path13.join(dir, entry);
|
|
20872
|
-
if (entry === "settings.json") return claudeSettingsLooksArgentOnly(full);
|
|
20873
|
-
if (entry === "rules" || entry === "agents" || entry === "skills") {
|
|
20874
|
-
return managedDirLooksArgentOnly(full, entry);
|
|
20875
|
-
}
|
|
20876
|
-
return false;
|
|
20877
|
-
});
|
|
20878
|
-
}
|
|
20879
|
-
function vscodeDirLooksArgentOnly(dir) {
|
|
20880
|
-
let entries;
|
|
20881
|
-
try {
|
|
20882
|
-
entries = fs13.readdirSync(dir);
|
|
20883
|
-
} catch {
|
|
20884
|
-
return false;
|
|
20885
|
-
}
|
|
20886
|
-
if (entries.length === 0) return false;
|
|
20887
|
-
return entries.every(
|
|
20888
|
-
(entry) => entry === "mcp.json" && jsonLooksArgentServerOnly(path13.join(dir, entry), "servers")
|
|
20889
|
-
);
|
|
20890
|
-
}
|
|
20891
|
-
function windsurfDirLooksArgentOnly(dir) {
|
|
20892
|
-
let entries;
|
|
20893
|
-
try {
|
|
20894
|
-
entries = fs13.readdirSync(dir);
|
|
20895
|
-
} catch {
|
|
20896
|
-
return false;
|
|
20897
|
-
}
|
|
20898
|
-
if (entries.length === 0) return false;
|
|
20899
|
-
return entries.every(
|
|
20900
|
-
(entry) => entry === "mcp_config.json" && jsonLooksArgentServerOnly(path13.join(dir, entry), "mcpServers")
|
|
20901
|
-
);
|
|
20902
|
-
}
|
|
20903
|
-
function zedSettingsLooksArgentOnly(filePath) {
|
|
20904
|
-
const config = parseJsoncStrict(filePath);
|
|
20905
|
-
if (config === null) return false;
|
|
20906
|
-
const keys = Object.keys(config);
|
|
20907
|
-
if (keys.length === 0) return false;
|
|
20908
|
-
return keys.every((key) => {
|
|
20909
|
-
if (key === "context_servers") {
|
|
20910
|
-
const servers = config.context_servers;
|
|
20911
|
-
if (!isRecord(servers)) return false;
|
|
20912
|
-
const serverKeys = Object.keys(servers);
|
|
20913
|
-
return serverKeys.length === 1 && serverKeys[0] === MCP_SERVER_KEY;
|
|
20914
|
-
}
|
|
20915
|
-
if (key === "agent") {
|
|
20916
|
-
const agent = config.agent;
|
|
20917
|
-
if (!isRecord(agent)) return false;
|
|
20918
|
-
const agentKeys = Object.keys(agent);
|
|
20919
|
-
if (agentKeys.length !== 1 || agentKeys[0] !== "tool_permissions") return false;
|
|
20920
|
-
const perms = agent.tool_permissions;
|
|
20921
|
-
if (!isRecord(perms)) return false;
|
|
20922
|
-
const permKeys = Object.keys(perms);
|
|
20923
|
-
return permKeys.length === 1 && permKeys[0] === "default" && (perms.default === "allow" || perms.default === "confirm");
|
|
20924
|
-
}
|
|
20925
|
-
return false;
|
|
20926
|
-
});
|
|
20927
|
-
}
|
|
20928
|
-
function zedDirLooksArgentOnly(dir) {
|
|
20929
|
-
let entries;
|
|
20930
|
-
try {
|
|
20931
|
-
entries = fs13.readdirSync(dir);
|
|
20932
|
-
} catch {
|
|
20933
|
-
return false;
|
|
20934
|
-
}
|
|
20935
|
-
if (entries.length === 0) return false;
|
|
20936
|
-
return entries.every(
|
|
20937
|
-
(entry) => entry === "settings.json" && zedSettingsLooksArgentOnly(path13.join(dir, entry))
|
|
20938
|
-
);
|
|
20939
|
-
}
|
|
20940
|
-
function geminiDirLooksArgentOnly(dir) {
|
|
20941
|
-
let entries;
|
|
20942
|
-
try {
|
|
20943
|
-
entries = fs13.readdirSync(dir);
|
|
20944
|
-
} catch {
|
|
20945
|
-
return false;
|
|
20946
|
-
}
|
|
20947
|
-
if (entries.length === 0) return false;
|
|
20948
|
-
return entries.every((entry) => {
|
|
20949
|
-
const full = path13.join(dir, entry);
|
|
20950
|
-
if (entry === "settings.json") return jsonLooksArgentServerOnly(full, "mcpServers");
|
|
20951
|
-
if (entry === "rules" || entry === "agents") return managedDirLooksArgentOnly(full, entry);
|
|
20952
|
-
return false;
|
|
20953
|
-
});
|
|
20954
|
-
}
|
|
20955
|
-
function hermesConfigLooksArgentOnly(filePath) {
|
|
20956
|
-
const config = parseYamlStrict(filePath);
|
|
20957
|
-
if (config === null) return false;
|
|
20958
|
-
const keys = Object.keys(config);
|
|
20959
|
-
if (keys.length !== 1 || keys[0] !== "mcp_servers") return false;
|
|
20960
|
-
const servers = config.mcp_servers;
|
|
20961
|
-
if (!isRecord(servers)) return false;
|
|
20962
|
-
const serverKeys = Object.keys(servers);
|
|
20963
|
-
return serverKeys.length === 1 && serverKeys[0] === MCP_SERVER_KEY;
|
|
20964
|
-
}
|
|
20965
|
-
function hermesDirLooksArgentOnly(dir) {
|
|
20966
|
-
let entries;
|
|
20967
|
-
try {
|
|
20968
|
-
entries = fs13.readdirSync(dir);
|
|
20969
|
-
} catch {
|
|
20970
|
-
return false;
|
|
20971
|
-
}
|
|
20972
|
-
if (entries.length === 0) return false;
|
|
20973
|
-
return entries.every(
|
|
20974
|
-
(entry) => entry === "config.yaml" && hermesConfigLooksArgentOnly(path13.join(dir, entry))
|
|
20975
|
-
);
|
|
20976
|
-
}
|
|
20977
|
-
function kiroDirLooksArgentOnly(dir) {
|
|
20978
|
-
let entries;
|
|
20979
|
-
try {
|
|
20980
|
-
entries = fs13.readdirSync(dir);
|
|
20981
|
-
} catch {
|
|
20982
|
-
return false;
|
|
20983
|
-
}
|
|
20984
|
-
if (entries.length === 0) return false;
|
|
20985
|
-
return entries.every((entry) => {
|
|
20986
|
-
if (entry !== "settings") return false;
|
|
20987
|
-
const settingsDir = path13.join(dir, entry);
|
|
20988
|
-
let settingsEntries;
|
|
20989
|
-
try {
|
|
20990
|
-
settingsEntries = fs13.readdirSync(settingsDir);
|
|
20991
|
-
} catch {
|
|
20992
|
-
return false;
|
|
20993
|
-
}
|
|
20994
|
-
if (settingsEntries.length === 0) return false;
|
|
20995
|
-
return settingsEntries.every(
|
|
20996
|
-
(name) => name === "mcp.json" && jsonLooksArgentServerOnly(path13.join(settingsDir, name), "mcpServers")
|
|
20997
|
-
);
|
|
20998
|
-
});
|
|
20999
|
-
}
|
|
21000
|
-
function codexDirLooksArgentOnly(dir) {
|
|
21001
|
-
let entries;
|
|
21002
|
-
try {
|
|
21003
|
-
entries = fs13.readdirSync(dir);
|
|
21004
|
-
} catch {
|
|
21005
|
-
return false;
|
|
21006
|
-
}
|
|
21007
|
-
if (entries.length === 0) return false;
|
|
21008
|
-
return entries.every((entry) => {
|
|
21009
|
-
const full = path13.join(dir, entry);
|
|
21010
|
-
if (entry === "config.toml") {
|
|
21011
|
-
const config = parseTomlStrict(full);
|
|
21012
|
-
if (config === null) return false;
|
|
21013
|
-
const configEntries = Object.entries(config);
|
|
21014
|
-
if (configEntries.length === 0) return false;
|
|
21015
|
-
return configEntries.every(([key, value]) => {
|
|
21016
|
-
if (key === "mcp_servers") {
|
|
21017
|
-
const servers = value ?? {};
|
|
21018
|
-
const serverKeys = Object.keys(servers);
|
|
21019
|
-
return serverKeys.length === 1 && serverKeys[0] === MCP_SERVER_KEY;
|
|
21020
|
-
}
|
|
21021
|
-
if (key === "developer_instructions") {
|
|
21022
|
-
return typeof value === "string" && removeArgentSection(value) === "";
|
|
21023
|
-
}
|
|
21024
|
-
return false;
|
|
21025
|
-
});
|
|
21026
|
-
}
|
|
21027
|
-
if (entry === "rules" || entry === "agents" || entry === "skills") {
|
|
21028
|
-
return managedDirLooksArgentOnly(full, entry);
|
|
21029
|
-
}
|
|
21030
|
-
return false;
|
|
21031
|
-
});
|
|
21032
|
-
}
|
|
21033
20728
|
var cursorAdapter = {
|
|
21034
20729
|
name: "Cursor",
|
|
21035
20730
|
detect() {
|
|
21036
|
-
return
|
|
20731
|
+
return dirExists(path13.join(homedir4(), ".cursor")) || dirExists(path13.join(process.cwd(), ".cursor"));
|
|
21037
20732
|
},
|
|
21038
20733
|
projectPath(root) {
|
|
21039
20734
|
return path13.join(root, ".cursor", "mcp.json");
|
|
@@ -21137,8 +20832,7 @@ function claudeDisabledListFinding(settingsPath, label, projectConfined) {
|
|
|
21137
20832
|
var claudeAdapter = {
|
|
21138
20833
|
name: "Claude Code",
|
|
21139
20834
|
detect() {
|
|
21140
|
-
|
|
21141
|
-
return fileHasEditorEvidence(path13.join(process.cwd(), ".mcp.json"), mcpJsonArgentOnly) || fileHasEditorEvidence(path13.join(homedir4(), ".claude.json"), mcpJsonArgentOnly) || dirHasEditorEvidence(path13.join(process.cwd(), ".claude"), claudeDirLooksArgentOnly) || dirHasEditorEvidence(path13.join(homedir4(), ".claude"), claudeDirLooksArgentOnly);
|
|
20835
|
+
return fs13.existsSync(path13.join(process.cwd(), ".mcp.json")) || fs13.existsSync(path13.join(homedir4(), ".claude.json")) || dirExists(path13.join(process.cwd(), ".claude")) || dirExists(path13.join(homedir4(), ".claude"));
|
|
21142
20836
|
},
|
|
21143
20837
|
projectPath(root) {
|
|
21144
20838
|
return path13.join(root, ".mcp.json");
|
|
@@ -21246,7 +20940,7 @@ var claudeAdapter = {
|
|
|
21246
20940
|
var vscodeAdapter = {
|
|
21247
20941
|
name: "VS Code",
|
|
21248
20942
|
detect() {
|
|
21249
|
-
return
|
|
20943
|
+
return dirExists(path13.join(process.cwd(), ".vscode")) || dirExists(path13.join(homedir4(), ".vscode"));
|
|
21250
20944
|
},
|
|
21251
20945
|
projectPath(root) {
|
|
21252
20946
|
return path13.join(root, ".vscode", "mcp.json");
|
|
@@ -21329,10 +21023,7 @@ function vscodeUserDirs() {
|
|
|
21329
21023
|
var windsurfAdapter = {
|
|
21330
21024
|
name: "Windsurf",
|
|
21331
21025
|
detect() {
|
|
21332
|
-
return
|
|
21333
|
-
path13.join(homedir4(), ".codeium", "windsurf"),
|
|
21334
|
-
windsurfDirLooksArgentOnly
|
|
21335
|
-
);
|
|
21026
|
+
return dirExists(path13.join(homedir4(), ".codeium", "windsurf"));
|
|
21336
21027
|
},
|
|
21337
21028
|
projectPath() {
|
|
21338
21029
|
return null;
|
|
@@ -21392,7 +21083,7 @@ var windsurfAdapter = {
|
|
|
21392
21083
|
var zedAdapter = {
|
|
21393
21084
|
name: "Zed",
|
|
21394
21085
|
detect() {
|
|
21395
|
-
return
|
|
21086
|
+
return dirExists(path13.join(homedir4(), ".config", "zed"));
|
|
21396
21087
|
},
|
|
21397
21088
|
projectPath(root) {
|
|
21398
21089
|
return path13.join(root, ".zed", "settings.json");
|
|
@@ -21450,7 +21141,7 @@ var zedAdapter = {
|
|
|
21450
21141
|
var geminiAdapter = {
|
|
21451
21142
|
name: "Gemini",
|
|
21452
21143
|
detect() {
|
|
21453
|
-
return
|
|
21144
|
+
return dirExists(path13.join(homedir4(), ".gemini")) || dirExists(path13.join(process.cwd(), ".gemini"));
|
|
21454
21145
|
},
|
|
21455
21146
|
projectPath(root) {
|
|
21456
21147
|
return path13.join(root, ".gemini", "settings.json");
|
|
@@ -21515,7 +21206,7 @@ var CODEX_FILENAME = ".codex";
|
|
|
21515
21206
|
var codexAdapter = {
|
|
21516
21207
|
name: "Codex",
|
|
21517
21208
|
detect() {
|
|
21518
|
-
return
|
|
21209
|
+
return dirExists(path13.join(homedir4(), CODEX_FILENAME)) || dirExists(path13.join(process.cwd(), CODEX_FILENAME));
|
|
21519
21210
|
},
|
|
21520
21211
|
projectPath(root) {
|
|
21521
21212
|
return path13.join(root, CODEX_FILENAME, "config.toml");
|
|
@@ -21593,7 +21284,7 @@ var codexAdapter = {
|
|
|
21593
21284
|
var hermesAdapter = {
|
|
21594
21285
|
name: "Hermes",
|
|
21595
21286
|
detect() {
|
|
21596
|
-
return
|
|
21287
|
+
return dirExists(path13.join(homedir4(), ".hermes"));
|
|
21597
21288
|
},
|
|
21598
21289
|
projectPath() {
|
|
21599
21290
|
return null;
|
|
@@ -21717,7 +21408,7 @@ var KIRO_AUTO_APPROVE_ALL = ["*"];
|
|
|
21717
21408
|
var kiroAdapter = {
|
|
21718
21409
|
name: "Kiro",
|
|
21719
21410
|
detect() {
|
|
21720
|
-
return
|
|
21411
|
+
return dirExists(path13.join(homedir4(), ".kiro")) || dirExists(path13.join(process.cwd(), ".kiro"));
|
|
21721
21412
|
},
|
|
21722
21413
|
projectPath(root) {
|
|
21723
21414
|
return path13.join(root, ".kiro", "settings", "mcp.json");
|
|
@@ -22081,19 +21772,16 @@ async function resolveTelemetryConsent(opts) {
|
|
|
22081
21772
|
}
|
|
22082
21773
|
|
|
22083
21774
|
// ../argent-installer/src/init-args.ts
|
|
21775
|
+
function extractFlag(args, flag) {
|
|
21776
|
+
const idx = args.indexOf(flag);
|
|
21777
|
+
if (idx === -1 || idx + 1 >= args.length) return null;
|
|
21778
|
+
return args[idx + 1];
|
|
21779
|
+
}
|
|
22084
21780
|
function parseInitArgs(args) {
|
|
22085
|
-
let fromTar = null;
|
|
22086
|
-
for (let i2 = 0; i2 < args.length; i2++) {
|
|
22087
|
-
const arg = args[i2];
|
|
22088
|
-
if (arg === "--from" || arg.startsWith("--from=")) {
|
|
22089
|
-
const value = arg === "--from" ? i2 + 1 < args.length ? args[++i2] : "" : arg.slice(7);
|
|
22090
|
-
if (value !== "" && fromTar === null) fromTar = value;
|
|
22091
|
-
}
|
|
22092
|
-
}
|
|
22093
21781
|
return {
|
|
22094
21782
|
nonInteractive: args.includes("--yes") || args.includes("-y"),
|
|
22095
21783
|
noTelemetry: args.includes("--no-telemetry"),
|
|
22096
|
-
fromTar,
|
|
21784
|
+
fromTar: extractFlag(args, "--from"),
|
|
22097
21785
|
wantsLocal: args.includes("--local"),
|
|
22098
21786
|
wantsGlobal: args.includes("--global")
|
|
22099
21787
|
};
|
|
@@ -22186,13 +21874,12 @@ var InitTelemetry = class {
|
|
|
22186
21874
|
});
|
|
22187
21875
|
});
|
|
22188
21876
|
}
|
|
22189
|
-
async trackPackageAction(action, startedAt, isSuccess, failureSignal2
|
|
21877
|
+
async trackPackageAction(action, startedAt, isSuccess, failureSignal2) {
|
|
22190
21878
|
track("installation:package_action", {
|
|
22191
21879
|
trigger: "init",
|
|
22192
21880
|
action,
|
|
22193
21881
|
is_success: isSuccess,
|
|
22194
21882
|
duration_ms: performance.now() - startedAt,
|
|
22195
|
-
...attemptInfo ?? {},
|
|
22196
21883
|
...failureSignal2 ?? {}
|
|
22197
21884
|
});
|
|
22198
21885
|
}
|
|
@@ -22242,16 +21929,6 @@ function execShellCommandSync(cmd, opts = {}) {
|
|
|
22242
21929
|
...opts.env ? { env: opts.env } : {}
|
|
22243
21930
|
});
|
|
22244
21931
|
}
|
|
22245
|
-
var ShellCommandError = class extends Error {
|
|
22246
|
-
constructor(message, exitCode, signal) {
|
|
22247
|
-
super(message);
|
|
22248
|
-
this.exitCode = exitCode;
|
|
22249
|
-
this.signal = signal;
|
|
22250
|
-
this.name = "ShellCommandError";
|
|
22251
|
-
}
|
|
22252
|
-
exitCode;
|
|
22253
|
-
signal;
|
|
22254
|
-
};
|
|
22255
21932
|
function runShellCommand(cmd, opts = {}) {
|
|
22256
21933
|
return new Promise((resolve10, reject) => {
|
|
22257
21934
|
const child = spawn2(cmd.bin, cmd.args, {
|
|
@@ -22263,16 +21940,9 @@ function runShellCommand(cmd, opts = {}) {
|
|
|
22263
21940
|
child.stderr?.on("data", (chunk) => {
|
|
22264
21941
|
stderr += chunk.toString();
|
|
22265
21942
|
});
|
|
22266
|
-
child.on("close", (code
|
|
21943
|
+
child.on("close", (code) => {
|
|
22267
21944
|
if (code === 0) resolve10();
|
|
22268
|
-
else
|
|
22269
|
-
reject(
|
|
22270
|
-
new ShellCommandError(
|
|
22271
|
-
stderr.trim() || (signal !== null ? `Command terminated by signal ${signal}` : `Command exited with code ${code}`),
|
|
22272
|
-
code,
|
|
22273
|
-
signal
|
|
22274
|
-
)
|
|
22275
|
-
);
|
|
21945
|
+
else reject(new Error(stderr.trim() || `Command exited with code ${code}`));
|
|
22276
21946
|
});
|
|
22277
21947
|
child.on("error", reject);
|
|
22278
21948
|
});
|
|
@@ -22433,52 +22103,17 @@ async function installLocally(opts) {
|
|
|
22433
22103
|
materializeOnly ? `Installing project dependencies to materialize ${PACKAGE_NAME} (${pm})...` : `Adding ${PACKAGE_NAME} to devDependencies (${pm})...`
|
|
22434
22104
|
);
|
|
22435
22105
|
const startedAt = performance.now();
|
|
22436
|
-
const
|
|
22106
|
+
const { landed, exitError: installError } = await runTrustingDisk(
|
|
22437
22107
|
() => runShellCommand(cmd, { cwd: projectRoot }),
|
|
22438
22108
|
() => isLocallyInstalled(projectRoot) || isYarnPnp(projectRoot)
|
|
22439
22109
|
);
|
|
22440
|
-
let lastAttemptStartedAt = performance.now();
|
|
22441
|
-
let retryCount = 0;
|
|
22442
|
-
let { landed, exitError: installError } = await attempt();
|
|
22443
|
-
const isMissingBinaryError = (err) => err !== null && (err.code === "ENOENT" || process.platform === "win32" && err instanceof ShellCommandError && err.exitCode === 9009);
|
|
22444
|
-
const missingBinary = !landed && isMissingBinaryError(installError);
|
|
22445
|
-
const wasInterrupted = (err) => err instanceof ShellCommandError && (err.signal !== null || err.exitCode === null);
|
|
22446
|
-
const interrupted = !landed && wasInterrupted(installError);
|
|
22447
|
-
if (!landed && installError && !missingBinary && !interrupted) {
|
|
22448
|
-
spinner2.message(`${pm} failed \u2014 retrying once...`);
|
|
22449
|
-
retryCount = 1;
|
|
22450
|
-
lastAttemptStartedAt = performance.now();
|
|
22451
|
-
({ landed, exitError: installError } = await attempt());
|
|
22452
|
-
}
|
|
22453
|
-
const attemptTelemetry = () => ({
|
|
22454
|
-
retry_count: retryCount,
|
|
22455
|
-
last_attempt_duration_ms: performance.now() - lastAttemptStartedAt
|
|
22456
|
-
});
|
|
22457
22110
|
if (!landed) {
|
|
22458
|
-
spinner2.stop(import_picocolors3.default.red(
|
|
22459
|
-
|
|
22460
|
-
|
|
22461
|
-
`This project uses ${import_picocolors3.default.cyan(pm)}, but the ${import_picocolors3.default.cyan(pm)} command was not found on PATH.`
|
|
22462
|
-
);
|
|
22463
|
-
log.info(
|
|
22464
|
-
`Install ${import_picocolors3.default.cyan(pm)} first` + (pm === "pnpm" || pm === "yarn" ? ` (e.g. ${import_picocolors3.default.cyan(`corepack enable ${pm}`)}, or see the ${pm} install docs)` : "") + `, then re-run ${import_picocolors3.default.cyan("argent init --local")}.`
|
|
22465
|
-
);
|
|
22466
|
-
} else if (interrupted) {
|
|
22467
|
-
log.error(`The ${import_picocolors3.default.cyan(pm)} install was interrupted before it finished.`);
|
|
22468
|
-
log.info(`Re-run ${import_picocolors3.default.cyan("argent init --local")} to try again.`);
|
|
22469
|
-
} else {
|
|
22470
|
-
log.error(
|
|
22471
|
-
installError ? `${installError}` : `The install reported success but ${import_picocolors3.default.cyan(PACKAGE_NAME)} is not in node_modules.`
|
|
22472
|
-
);
|
|
22473
|
-
log.info(`Install manually with: ${import_picocolors3.default.cyan(`cd ${projectRoot} && ${cmdStr}`)}`);
|
|
22474
|
-
}
|
|
22475
|
-
await tel.trackPackageAction(
|
|
22476
|
-
"fresh_install",
|
|
22477
|
-
startedAt,
|
|
22478
|
-
false,
|
|
22479
|
-
INSTALL_LOCAL_PACKAGE_FAILED,
|
|
22480
|
-
attemptTelemetry()
|
|
22111
|
+
spinner2.stop(import_picocolors3.default.red("Local install failed."));
|
|
22112
|
+
log.error(
|
|
22113
|
+
installError ? `${installError}` : `The install reported success but ${import_picocolors3.default.cyan(PACKAGE_NAME)} is not in node_modules.`
|
|
22481
22114
|
);
|
|
22115
|
+
log.info(`Install manually with: ${import_picocolors3.default.cyan(`cd ${projectRoot} && ${cmdStr}`)}`);
|
|
22116
|
+
await tel.trackPackageAction("fresh_install", startedAt, false, INSTALL_LOCAL_PACKAGE_FAILED);
|
|
22482
22117
|
await tel.finalize(INSTALL_LOCAL_PACKAGE_FAILED);
|
|
22483
22118
|
process.exit(1);
|
|
22484
22119
|
}
|
|
@@ -22497,7 +22132,7 @@ async function installLocally(opts) {
|
|
|
22497
22132
|
);
|
|
22498
22133
|
}
|
|
22499
22134
|
}
|
|
22500
|
-
await tel.trackPackageAction("fresh_install", startedAt, true
|
|
22135
|
+
await tel.trackPackageAction("fresh_install", startedAt, true);
|
|
22501
22136
|
}
|
|
22502
22137
|
async function runGlobal(opts) {
|
|
22503
22138
|
const { fromTar, nonInteractive, tel } = opts;
|
|
@@ -22643,12 +22278,6 @@ async function runGlobal(opts) {
|
|
|
22643
22278
|
|
|
22644
22279
|
// ../argent-installer/src/init-adapters.ts
|
|
22645
22280
|
var import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
22646
|
-
function previouslyConfiguredAdapters(eligible, installMode) {
|
|
22647
|
-
const wantedScope = installMode === "local" ? "project" : "global";
|
|
22648
|
-
const scopes = findConfiguredAdapterScopes(eligible, process.cwd());
|
|
22649
|
-
const configured = new Set(scopes.filter((s) => s.scope === wantedScope).map((s) => s.adapter));
|
|
22650
|
-
return eligible.filter((a3) => configured.has(a3));
|
|
22651
|
-
}
|
|
22652
22281
|
async function chooseAdapters(opts) {
|
|
22653
22282
|
let eligible = ALL_ADAPTERS;
|
|
22654
22283
|
if (opts.installMode === "local") {
|
|
@@ -22664,16 +22293,12 @@ async function chooseAdapters(opts) {
|
|
|
22664
22293
|
}
|
|
22665
22294
|
const detected = detectAdapters().filter((a3) => eligible.includes(a3));
|
|
22666
22295
|
const detectedNames = detected.map((a3) => a3.name);
|
|
22667
|
-
const previouslyConfigured = previouslyConfiguredAdapters(eligible, opts.installMode);
|
|
22668
|
-
const previouslyConfiguredNames = previouslyConfigured.map((a3) => a3.name);
|
|
22669
|
-
const preselected = [...detected, ...previouslyConfigured.filter((a3) => !detected.includes(a3))];
|
|
22670
22296
|
if (opts.nonInteractive) {
|
|
22671
|
-
return { selected:
|
|
22297
|
+
return { selected: detected.length > 0 ? detected : eligible, detected };
|
|
22672
22298
|
}
|
|
22673
22299
|
const choices = eligible.map((a3) => {
|
|
22674
22300
|
const parts = [];
|
|
22675
22301
|
if (detectedNames.includes(a3.name)) parts.push("detected");
|
|
22676
|
-
else if (previouslyConfiguredNames.includes(a3.name)) parts.push("already configured");
|
|
22677
22302
|
const hasProject = a3.projectPath(process.cwd()) != null;
|
|
22678
22303
|
const hasGlobal = a3.globalPath() != null;
|
|
22679
22304
|
if (!hasProject && hasGlobal) {
|
|
@@ -22691,7 +22316,7 @@ async function chooseAdapters(opts) {
|
|
|
22691
22316
|
const selected = await multiselect({
|
|
22692
22317
|
message: "Which editors should Argent be configured for?",
|
|
22693
22318
|
options: choices,
|
|
22694
|
-
initialValues:
|
|
22319
|
+
initialValues: detected,
|
|
22695
22320
|
required: true
|
|
22696
22321
|
});
|
|
22697
22322
|
if (isCancel(selected)) throw new InitCancelled("editors");
|
|
@@ -23250,11 +22875,7 @@ async function init2(args) {
|
|
|
23250
22875
|
note(mcpLines.join("\n"), "MCP Configuration");
|
|
23251
22876
|
const staleCleanup = await cleanupStaleMcpConfigs({
|
|
23252
22877
|
writtenAdapters,
|
|
23253
|
-
|
|
23254
|
-
// gated on an existing argent entry (getArgentEntry), and the stale
|
|
23255
|
-
// entries most worth pruning live in argent-only dirs (~/.cursor,
|
|
23256
|
-
// ~/.codex) that detection now deliberately ignores.
|
|
23257
|
-
detectedAdapters: ALL_ADAPTERS,
|
|
22878
|
+
detectedAdapters: detected,
|
|
23258
22879
|
installMode: tel.installMode,
|
|
23259
22880
|
scope: normalizedScope,
|
|
23260
22881
|
effectiveRoot,
|
|
@@ -23903,9 +23524,6 @@ async function update(args) {
|
|
|
23903
23524
|
const { landed: reachedTarget, exitError: installError } = await runTrustingDisk(
|
|
23904
23525
|
() => {
|
|
23905
23526
|
execShellCommandSync(cmd, {
|
|
23906
|
-
// Older versions still ship a postinstall script that honors this
|
|
23907
|
-
// (current ones have none); keep it so downgrades and pinned
|
|
23908
|
-
// installs of those versions stay quiet and don't double-kill.
|
|
23909
23527
|
env: { ...process.env, ARGENT_SKIP_POSTINSTALL: "1" },
|
|
23910
23528
|
// Local installs must rewrite the project's manifest/lockfile.
|
|
23911
23529
|
...mode === "local" ? { cwd: projectRoot } : {}
|