@swmansion/argent 0.13.1-next.1 → 0.13.1-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-cmds.mjs +1165 -209
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -1
- package/dist/installer.mjs +441 -433
- package/dist/mcp-server.mjs +90 -89
- package/dist/preview-ui/index.html +746 -47
- package/dist/preview-ui/theme.css +1 -0
- package/dist/preview-window/main.cjs +4 -2
- package/dist/tool-server.cjs +1087 -753
- package/package.json +3 -2
- package/scripts/postinstall.cjs +22 -0
package/dist/mcp-server.mjs
CHANGED
|
@@ -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(path10) {
|
|
3233
|
+
let input = path10;
|
|
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 [path10, query] = wsComponent.resourceName.split("?");
|
|
3486
|
+
wsComponent.path = path10 && path10 !== "/" ? path10 : void 0;
|
|
3487
3487
|
wsComponent.query = query;
|
|
3488
3488
|
wsComponent.resourceName = void 0;
|
|
3489
3489
|
}
|
|
@@ -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, path10) {
|
|
7141
|
+
if (!path10)
|
|
7142
7142
|
return obj;
|
|
7143
|
-
return
|
|
7143
|
+
return path10.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(path10, 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(path10);
|
|
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, path10 = []) => {
|
|
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 }, [...path10, ...issue2.path]));
|
|
7707
7707
|
} else if (issue2.code === "invalid_key") {
|
|
7708
|
-
processError({ issues: issue2.issues }, [...
|
|
7708
|
+
processError({ issues: issue2.issues }, [...path10, ...issue2.path]);
|
|
7709
7709
|
} else if (issue2.code === "invalid_element") {
|
|
7710
|
-
processError({ issues: issue2.issues }, [...
|
|
7710
|
+
processError({ issues: issue2.issues }, [...path10, ...issue2.path]);
|
|
7711
7711
|
} else {
|
|
7712
|
-
const fullpath = [...
|
|
7712
|
+
const fullpath = [...path10, ...issue2.path];
|
|
7713
7713
|
if (fullpath.length === 0) {
|
|
7714
7714
|
fieldErrors._errors.push(mapper(issue2));
|
|
7715
7715
|
} else {
|
|
@@ -18082,13 +18082,74 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
18082
18082
|
var SESSION_ID2 = randomUUID3();
|
|
18083
18083
|
|
|
18084
18084
|
// ../telemetry/src/identity.ts
|
|
18085
|
-
import * as
|
|
18086
|
-
import * as
|
|
18087
|
-
import * as
|
|
18085
|
+
import * as crypto2 from "node:crypto";
|
|
18086
|
+
import * as fs4 from "node:fs";
|
|
18087
|
+
import * as path8 from "node:path";
|
|
18088
18088
|
|
|
18089
18089
|
// ../telemetry/src/paths.ts
|
|
18090
|
-
import * as
|
|
18090
|
+
import * as path7 from "node:path";
|
|
18091
|
+
|
|
18092
|
+
// ../configuration-core/src/flags.ts
|
|
18093
|
+
import * as fs2 from "node:fs";
|
|
18091
18094
|
import * as path4 from "node:path";
|
|
18095
|
+
import { homedir as homedir3 } from "node:os";
|
|
18096
|
+
var PROJECT_MARKERS = [".argent", ".git", "package.json"];
|
|
18097
|
+
function resolveProjectRoot(startDir) {
|
|
18098
|
+
const initial = path4.resolve(startDir);
|
|
18099
|
+
let current = initial;
|
|
18100
|
+
while (true) {
|
|
18101
|
+
for (const marker of PROJECT_MARKERS) {
|
|
18102
|
+
if (fs2.existsSync(path4.join(current, marker))) return current;
|
|
18103
|
+
}
|
|
18104
|
+
const parent = path4.dirname(current);
|
|
18105
|
+
if (parent === current) return initial;
|
|
18106
|
+
current = parent;
|
|
18107
|
+
}
|
|
18108
|
+
}
|
|
18109
|
+
function getFlagsPath(scope, options = {}) {
|
|
18110
|
+
const home = options.homeDir ?? homedir3();
|
|
18111
|
+
if (scope === "global") {
|
|
18112
|
+
return path4.join(home, ".argent", "flags.json");
|
|
18113
|
+
}
|
|
18114
|
+
const cwd = options.cwd ?? process.cwd();
|
|
18115
|
+
return path4.join(resolveProjectRoot(cwd), ".argent", "flags.json");
|
|
18116
|
+
}
|
|
18117
|
+
function readFlagsFile(filePath) {
|
|
18118
|
+
let raw;
|
|
18119
|
+
try {
|
|
18120
|
+
raw = fs2.readFileSync(filePath, "utf8");
|
|
18121
|
+
} catch {
|
|
18122
|
+
return {};
|
|
18123
|
+
}
|
|
18124
|
+
let parsed;
|
|
18125
|
+
try {
|
|
18126
|
+
parsed = JSON.parse(raw);
|
|
18127
|
+
} catch {
|
|
18128
|
+
return {};
|
|
18129
|
+
}
|
|
18130
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
18131
|
+
const flags = parsed.flags;
|
|
18132
|
+
if (!flags || typeof flags !== "object" || Array.isArray(flags)) return {};
|
|
18133
|
+
const out = {};
|
|
18134
|
+
for (const [k, v] of Object.entries(flags)) {
|
|
18135
|
+
if (typeof v === "boolean") out[k] = v;
|
|
18136
|
+
}
|
|
18137
|
+
return out;
|
|
18138
|
+
}
|
|
18139
|
+
function readFlags(scope, options = {}) {
|
|
18140
|
+
return readFlagsFile(getFlagsPath(scope, options));
|
|
18141
|
+
}
|
|
18142
|
+
function isFlagEnabled(name, options = {}) {
|
|
18143
|
+
const projectFlags = readFlags("project", options);
|
|
18144
|
+
if (Object.hasOwn(projectFlags, name)) return projectFlags[name];
|
|
18145
|
+
const globalFlags = readFlags("global", options);
|
|
18146
|
+
if (Object.hasOwn(globalFlags, name)) return globalFlags[name];
|
|
18147
|
+
return false;
|
|
18148
|
+
}
|
|
18149
|
+
|
|
18150
|
+
// ../configuration-core/src/paths.ts
|
|
18151
|
+
import * as os from "node:os";
|
|
18152
|
+
import * as path5 from "node:path";
|
|
18092
18153
|
function nonEmpty(value) {
|
|
18093
18154
|
if (value == void 0) return null;
|
|
18094
18155
|
const trimmed = value.trim();
|
|
@@ -18096,17 +18157,14 @@ function nonEmpty(value) {
|
|
|
18096
18157
|
}
|
|
18097
18158
|
function argentHomeDir() {
|
|
18098
18159
|
const home = process.platform === "win32" ? nonEmpty(process.env.USERPROFILE) ?? os.homedir() : nonEmpty(process.env.HOME) ?? os.homedir();
|
|
18099
|
-
return
|
|
18160
|
+
return path5.join(home, ".argent");
|
|
18100
18161
|
}
|
|
18101
18162
|
function configFilePath() {
|
|
18102
|
-
return
|
|
18163
|
+
return path5.join(argentHomeDir(), "config.json");
|
|
18103
18164
|
}
|
|
18104
18165
|
|
|
18105
|
-
// ../
|
|
18106
|
-
import * as
|
|
18107
|
-
|
|
18108
|
-
// ../telemetry/src/config-file.ts
|
|
18109
|
-
import * as crypto2 from "node:crypto";
|
|
18166
|
+
// ../configuration-core/src/config.ts
|
|
18167
|
+
import * as crypto from "node:crypto";
|
|
18110
18168
|
import * as fs3 from "node:fs";
|
|
18111
18169
|
import * as path6 from "node:path";
|
|
18112
18170
|
function readConfigObject() {
|
|
@@ -18169,7 +18227,7 @@ function updateConfig(mutate) {
|
|
|
18169
18227
|
const next = readConfigObject();
|
|
18170
18228
|
mutate(next);
|
|
18171
18229
|
const finalPath = configFilePath();
|
|
18172
|
-
const tmpPath = path6.join(argentHomeDir(), `.config.tmp.${process.pid}.${
|
|
18230
|
+
const tmpPath = path6.join(argentHomeDir(), `.config.tmp.${process.pid}.${crypto.randomUUID()}`);
|
|
18173
18231
|
const fd = fs3.openSync(tmpPath, "wx", 384);
|
|
18174
18232
|
try {
|
|
18175
18233
|
fs3.writeSync(fd, JSON.stringify(next, null, 2) + "\n");
|
|
@@ -18192,12 +18250,13 @@ function updateConfig(mutate) {
|
|
|
18192
18250
|
}
|
|
18193
18251
|
|
|
18194
18252
|
// ../telemetry/src/consent.ts
|
|
18253
|
+
import * as fs5 from "node:fs";
|
|
18195
18254
|
var cache = { current: null };
|
|
18196
18255
|
var sessionOverride = null;
|
|
18197
18256
|
function readConfigOverride() {
|
|
18198
18257
|
let stats;
|
|
18199
18258
|
try {
|
|
18200
|
-
stats =
|
|
18259
|
+
stats = fs5.lstatSync(configFilePath());
|
|
18201
18260
|
} catch (err) {
|
|
18202
18261
|
if (err.code === "ENOENT") {
|
|
18203
18262
|
cache.current = { mtimeMs: null, fingerprint: null, enabledOverride: null };
|
|
@@ -18217,7 +18276,7 @@ function readConfigOverride() {
|
|
|
18217
18276
|
}
|
|
18218
18277
|
let parsedEnabled = null;
|
|
18219
18278
|
try {
|
|
18220
|
-
const raw =
|
|
18279
|
+
const raw = fs5.readFileSync(configFilePath(), "utf8");
|
|
18221
18280
|
const json = JSON.parse(raw);
|
|
18222
18281
|
if (json && typeof json === "object") {
|
|
18223
18282
|
const t = json.telemetry;
|
|
@@ -18271,7 +18330,7 @@ function isEnabled(env = process.env) {
|
|
|
18271
18330
|
}
|
|
18272
18331
|
|
|
18273
18332
|
// ../telemetry/src/debug.ts
|
|
18274
|
-
import * as
|
|
18333
|
+
import * as fs6 from "node:fs";
|
|
18275
18334
|
|
|
18276
18335
|
// ../telemetry/src/notice.ts
|
|
18277
18336
|
var TELEMETRY_OPT_OUT_COMMAND = "argent telemetry disable";
|
|
@@ -18440,64 +18499,6 @@ async function flowRunToMcpContent(result, ctx) {
|
|
|
18440
18499
|
return blocks;
|
|
18441
18500
|
}
|
|
18442
18501
|
|
|
18443
|
-
// ../configuration-core/src/flags.ts
|
|
18444
|
-
import * as fs6 from "node:fs";
|
|
18445
|
-
import * as path7 from "node:path";
|
|
18446
|
-
import { homedir as homedir4 } from "node:os";
|
|
18447
|
-
var PROJECT_MARKERS = [".argent", ".git", "package.json"];
|
|
18448
|
-
function resolveProjectRoot(startDir) {
|
|
18449
|
-
const initial = path7.resolve(startDir);
|
|
18450
|
-
let current = initial;
|
|
18451
|
-
while (true) {
|
|
18452
|
-
for (const marker of PROJECT_MARKERS) {
|
|
18453
|
-
if (fs6.existsSync(path7.join(current, marker))) return current;
|
|
18454
|
-
}
|
|
18455
|
-
const parent = path7.dirname(current);
|
|
18456
|
-
if (parent === current) return initial;
|
|
18457
|
-
current = parent;
|
|
18458
|
-
}
|
|
18459
|
-
}
|
|
18460
|
-
function getFlagsPath(scope, options = {}) {
|
|
18461
|
-
const home = options.homeDir ?? homedir4();
|
|
18462
|
-
if (scope === "global") {
|
|
18463
|
-
return path7.join(home, ".argent", "flags.json");
|
|
18464
|
-
}
|
|
18465
|
-
const cwd = options.cwd ?? process.cwd();
|
|
18466
|
-
return path7.join(resolveProjectRoot(cwd), ".argent", "flags.json");
|
|
18467
|
-
}
|
|
18468
|
-
function readFlagsFile(filePath) {
|
|
18469
|
-
let raw;
|
|
18470
|
-
try {
|
|
18471
|
-
raw = fs6.readFileSync(filePath, "utf8");
|
|
18472
|
-
} catch {
|
|
18473
|
-
return {};
|
|
18474
|
-
}
|
|
18475
|
-
let parsed;
|
|
18476
|
-
try {
|
|
18477
|
-
parsed = JSON.parse(raw);
|
|
18478
|
-
} catch {
|
|
18479
|
-
return {};
|
|
18480
|
-
}
|
|
18481
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
18482
|
-
const flags = parsed.flags;
|
|
18483
|
-
if (!flags || typeof flags !== "object" || Array.isArray(flags)) return {};
|
|
18484
|
-
const out = {};
|
|
18485
|
-
for (const [k, v] of Object.entries(flags)) {
|
|
18486
|
-
if (typeof v === "boolean") out[k] = v;
|
|
18487
|
-
}
|
|
18488
|
-
return out;
|
|
18489
|
-
}
|
|
18490
|
-
function readFlags(scope, options = {}) {
|
|
18491
|
-
return readFlagsFile(getFlagsPath(scope, options));
|
|
18492
|
-
}
|
|
18493
|
-
function isFlagEnabled(name, options = {}) {
|
|
18494
|
-
const projectFlags = readFlags("project", options);
|
|
18495
|
-
if (Object.hasOwn(projectFlags, name)) return projectFlags[name];
|
|
18496
|
-
const globalFlags = readFlags("global", options);
|
|
18497
|
-
if (Object.hasOwn(globalFlags, name)) return globalFlags[name];
|
|
18498
|
-
return false;
|
|
18499
|
-
}
|
|
18500
|
-
|
|
18501
18502
|
// ../argent-mcp/src/auto-screenshot.ts
|
|
18502
18503
|
var AUTO_SCREENSHOT_TOOLS = /* @__PURE__ */ new Set([
|
|
18503
18504
|
"gesture-tap",
|
|
@@ -18577,10 +18578,10 @@ function toMcpTool(t) {
|
|
|
18577
18578
|
|
|
18578
18579
|
// ../argent-mcp/src/installed-version.ts
|
|
18579
18580
|
import * as fs7 from "node:fs";
|
|
18580
|
-
import * as
|
|
18581
|
+
import * as path9 from "node:path";
|
|
18581
18582
|
function getInstalledVersion() {
|
|
18582
18583
|
try {
|
|
18583
|
-
const pkgPath =
|
|
18584
|
+
const pkgPath = path9.resolve(import.meta.dirname, "..", "package.json");
|
|
18584
18585
|
const pkg = JSON.parse(fs7.readFileSync(pkgPath, "utf8"));
|
|
18585
18586
|
return pkg.version ?? "unknown";
|
|
18586
18587
|
} catch {
|