@swmansion/argent 0.22.1-next.1 → 0.22.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/bin/argent-simulator-server.cjs +12 -19
- package/bin/darwin/simulator-server +0 -0
- package/bin/linux/simulator-server +0 -0
- package/bin/linux-arm64/simulator-server +0 -0
- package/bin/win32/simulator-server.exe +0 -0
- package/dist/bundled-paths.js +21 -28
- package/dist/bundled-paths.js.map +1 -1
- package/dist/cli-cmds.mjs +391 -402
- package/dist/cli.d.ts +3 -25
- package/dist/cli.js +12 -41
- package/dist/cli.js.map +1 -1
- package/dist/fatal-handlers.js +13 -17
- package/dist/fatal-handlers.js.map +1 -1
- package/dist/installer-help.d.ts +31 -49
- package/dist/installer-help.js +31 -54
- package/dist/installer-help.js.map +1 -1
- package/dist/installer.mjs +129 -152
- package/dist/mcp-server.mjs +64 -56
- package/dist/preview-window/main.cjs +9 -13
- package/dist/tool-server.cjs +962 -798
- package/package.json +1 -1
- package/skills/argent-create-flow/references/flow-yaml.md +7 -1
- package/skills/argent-create-flow/references/reliability-and-recovery.md +4 -4
|
@@ -1,29 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// but the binary itself is platform-specific (Mach-O for darwin, ELF for
|
|
9
|
-
// linux). The native-devtools-ios resolver uses the same per-platform
|
|
10
|
-
// subdirectory layout, so a stable layout lives in exactly one place.
|
|
4
|
+
// Dispatcher published as the `argent-simulator-server` bin entry. npm's `bin`
|
|
5
|
+
// field resolves to a single file regardless of host platform, but the
|
|
6
|
+
// simulator-server binary is platform-specific, so pick it at invocation time
|
|
7
|
+
// and spawn it with the caller's args.
|
|
11
8
|
|
|
12
9
|
const { spawn } = require("node:child_process");
|
|
13
10
|
const path = require("node:path");
|
|
14
11
|
const fs = require("node:fs");
|
|
15
12
|
|
|
16
|
-
// Mirrors hostPlatformKey() in @argent/native-devtools-ios
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
// file — it ships verbatim as the npm `bin` entry.
|
|
13
|
+
// Mirrors hostPlatformKey() in @argent/native-devtools-ios; duplicated because
|
|
14
|
+
// this file ships verbatim as the npm `bin` entry and can't import. darwin ships
|
|
15
|
+
// a universal (lipo) binary, but Linux binaries are single-arch ELFs, so arm64
|
|
16
|
+
// Linux gets its own "linux-arm64" directory next to the x86_64 one ("linux").
|
|
21
17
|
const platformKey =
|
|
22
18
|
process.platform === "linux" && process.arch === "arm64" ? "linux-arm64" : process.platform;
|
|
23
19
|
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
// this file ships verbatim as the npm `bin` entry and can't import.
|
|
20
|
+
// Mirrors simulatorServerBinaryName() in @argent/native-devtools-ios; inlined
|
|
21
|
+
// because this file ships verbatim as the npm `bin` entry and can't import.
|
|
27
22
|
const binaryName = process.platform === "win32" ? "simulator-server.exe" : "simulator-server";
|
|
28
23
|
|
|
29
24
|
const binary = path.join(__dirname, platformKey, binaryName);
|
|
@@ -39,9 +34,7 @@ const child = spawn(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
|
39
34
|
|
|
40
35
|
// Forward termination signals so a supervisor that signals only the dispatcher
|
|
41
36
|
// PID (systemd, `kill -TERM <pid>`, container stop) doesn't orphan the child.
|
|
42
|
-
// Ctrl+C
|
|
43
|
-
// receives it too — these handlers cover the non-TTY case where the parent
|
|
44
|
-
// would otherwise exit alone and leave the binary reparented to init.
|
|
37
|
+
// A TTY Ctrl+C already reaches the whole process group.
|
|
45
38
|
/** @type {NodeJS.Signals[]} */
|
|
46
39
|
const FORWARDED_SIGNALS = ["SIGTERM", "SIGINT", "SIGHUP"];
|
|
47
40
|
for (const sig of FORWARDED_SIGNALS) {
|
|
@@ -50,7 +43,7 @@ for (const sig of FORWARDED_SIGNALS) {
|
|
|
50
43
|
try {
|
|
51
44
|
child.kill(sig);
|
|
52
45
|
} catch {
|
|
53
|
-
//
|
|
46
|
+
// Child already exited between the signal arriving and forwarding.
|
|
54
47
|
}
|
|
55
48
|
}
|
|
56
49
|
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/bundled-paths.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as fs from "node:fs";
|
|
2
2
|
import * as path from "node:path";
|
|
3
|
-
// Installed package version, read from the shipped package.json.
|
|
4
|
-
// launcher
|
|
5
|
-
// devDependency update rewrites tool-server.cjs at the same
|
|
6
|
-
//
|
|
7
|
-
// (--ignore-scripts, pnpm's build gate, Yarn
|
|
8
|
-
// why argent ships no postinstall script
|
|
3
|
+
// Installed package version, read from the shipped package.json. Feeds the
|
|
4
|
+
// launcher's version gate as the fallback for its on-disk read, so an in-place
|
|
5
|
+
// bump (a local devDependency update rewrites tool-server.cjs at the same
|
|
6
|
+
// path) retires the stale tool-server with no install-time hook: install
|
|
7
|
+
// scripts are frequently disabled (--ignore-scripts, pnpm's build gate, Yarn
|
|
8
|
+
// PnP, locked-down CI), which is why argent ships no postinstall script.
|
|
9
9
|
function readPackageVersion() {
|
|
10
10
|
try {
|
|
11
11
|
const pkg = JSON.parse(fs.readFileSync(path.join(import.meta.dirname, "..", "package.json"), "utf8"));
|
|
@@ -46,12 +46,10 @@ function findDeclaringRoot(startDir) {
|
|
|
46
46
|
// The version-STABLE package dir: the conventional <dir>/node_modules/<pkg>
|
|
47
47
|
// symlink closest to cwd that resolves to the running package. Unlike
|
|
48
48
|
// import.meta's realpath — pnpm's version-pinned .pnpm store dir, pruned on a
|
|
49
|
-
// bump — this symlink survives an in-place update.
|
|
50
|
-
// symlink sits in the DECLARING member's
|
|
51
|
-
// where the .pnpm store lives
|
|
52
|
-
//
|
|
53
|
-
// realpath equals the running package, so it can never point at a different
|
|
54
|
-
// install — just a different (stable) alias of the same real dir.
|
|
49
|
+
// bump — this symlink survives an in-place update. Scan every level from cwd
|
|
50
|
+
// up: in a pnpm WORKSPACE the symlink sits in the DECLARING member's
|
|
51
|
+
// node_modules, below the root where the .pnpm store lives. The realpath check
|
|
52
|
+
// means the result is only ever another alias of the same real dir.
|
|
55
53
|
export function findStablePackageDir(startDir, packageRoot) {
|
|
56
54
|
let dir = startDir;
|
|
57
55
|
for (;;) {
|
|
@@ -72,8 +70,7 @@ export function findStablePackageDir(startDir, packageRoot) {
|
|
|
72
70
|
// Install topology of this running package: a project's local devDependency
|
|
73
71
|
// (package root inside a node_modules found by walking up from cwd) or the
|
|
74
72
|
// global PATH install — and, for local, WHICH project. Classified at process
|
|
75
|
-
// start,
|
|
76
|
-
// resolves with cwd at the project root); the launcher forwards both as
|
|
73
|
+
// start, while cwd is still trustworthy; the launcher forwards both as
|
|
77
74
|
// ARGENT_INSTALL_KIND / ARGENT_PROJECT_ROOT so update-argent doesn't re-infer
|
|
78
75
|
// them from the detached server's editor-chosen cwd.
|
|
79
76
|
function classifyInstall() {
|
|
@@ -82,8 +79,8 @@ function classifyInstall() {
|
|
|
82
79
|
let cwd;
|
|
83
80
|
try {
|
|
84
81
|
packageRoot = fs.realpathSync(path.join(import.meta.dirname, ".."));
|
|
85
|
-
// cwd
|
|
86
|
-
//
|
|
82
|
+
// cwd throws (ENOENT) when the shell's directory was deleted, and this runs
|
|
83
|
+
// at module import, before fatal handlers are installed.
|
|
87
84
|
cwd = process.cwd();
|
|
88
85
|
dir = cwd;
|
|
89
86
|
}
|
|
@@ -94,11 +91,9 @@ function classifyInstall() {
|
|
|
94
91
|
try {
|
|
95
92
|
const nmReal = fs.realpathSync(path.join(dir, "node_modules"));
|
|
96
93
|
if (packageRoot === nmReal || packageRoot.startsWith(nmReal + path.sep)) {
|
|
97
|
-
//
|
|
98
|
-
//
|
|
99
|
-
//
|
|
100
|
-
// package dir (used for runtime paths that must survive a pnpm store
|
|
101
|
-
// prune) is found by its own cwd-up scan — see findStablePackageDir.
|
|
94
|
+
// Prefer the DECLARING root over this physical hoist root: in a
|
|
95
|
+
// hoisted workspace the declaring manifest sits at cwd (the member
|
|
96
|
+
// root) or an ancestor below `dir`.
|
|
102
97
|
return {
|
|
103
98
|
kind: "local",
|
|
104
99
|
projectRoot: findDeclaringRoot(cwd) ?? dir,
|
|
@@ -114,10 +109,9 @@ function classifyInstall() {
|
|
|
114
109
|
break;
|
|
115
110
|
dir = parent;
|
|
116
111
|
}
|
|
117
|
-
// Yarn PnP
|
|
118
|
-
//
|
|
119
|
-
//
|
|
120
|
-
// the user may not even have.
|
|
112
|
+
// Yarn PnP has no node_modules anywhere: the package runs from the project's
|
|
113
|
+
// .yarn dir. Falling through to "global" would point the update at a global
|
|
114
|
+
// install the user may not even have.
|
|
121
115
|
if (packageRoot.includes(`${path.sep}.yarn${path.sep}`)) {
|
|
122
116
|
const declRoot = findDeclaringRoot(cwd);
|
|
123
117
|
if (declRoot)
|
|
@@ -126,9 +120,8 @@ function classifyInstall() {
|
|
|
126
120
|
return { kind: "global" };
|
|
127
121
|
}
|
|
128
122
|
const classifiedInstall = classifyInstall();
|
|
129
|
-
//
|
|
130
|
-
//
|
|
131
|
-
// the classification found one (see classifyInstall).
|
|
123
|
+
// import.meta.dirname is dist/ in the published package, so ".." is the
|
|
124
|
+
// package root; prefer the version-stable alias when classification found one.
|
|
132
125
|
const packageDir = classifiedInstall.stablePackageDir ?? path.join(import.meta.dirname, "..");
|
|
133
126
|
export const BUNDLED_RUNTIME_PATHS = {
|
|
134
127
|
bundlePath: path.join(packageDir, "dist", "tool-server.cjs"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundled-paths.js","sourceRoot":"","sources":["../src/bundled-paths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAGlC,
|
|
1
|
+
{"version":3,"file":"bundled-paths.js","sourceRoot":"","sources":["../src/bundled-paths.ts"],"names":[],"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