epismo 1.28.1 → 1.29.1
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 +1 -1
- package/npm/launcher.js +51 -15
- package/npm/vendor/darwin-amd64/epismo +0 -0
- package/npm/vendor/darwin-arm64/epismo +0 -0
- package/npm/vendor/linux-amd64/epismo +0 -0
- package/npm/vendor/linux-arm64/epismo +0 -0
- package/npm/vendor/windows-amd64/epismo.exe +0 -0
- package/npm/vendor/windows-arm64/epismo.exe +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ Append `--help` to any command for its arguments and options.
|
|
|
52
52
|
|
|
53
53
|
## Scripts and agents
|
|
54
54
|
|
|
55
|
-
Commands return JSON on stdout; errors and progress go to stderr. Output fields use `snake_case`. Use `--output table` for interactive reading, or `--
|
|
55
|
+
Commands return JSON on stdout; errors and progress go to stderr. Output fields use `snake_case`. Use `--output table` for interactive reading, or `--request @file.json` and `--request -` for JSON input from a file or stdin. `--request` supplies all request parameters; `case start --input` and `case update --input` supply only the case input values. On update, `--input` replaces the complete object. Attach one playbook version to an open case without a playbook using `case update CASE_ID --version-id VERSION_ID --lock-version N`, optionally with `--input`; the resulting input must satisfy that version’s schema.
|
|
56
56
|
|
|
57
57
|
For automation, supply a workspace-scoped token through `EPISMO_TOKEN`. Set `EPISMO_WORKSPACE` or pass `--workspace` to select a workspace. Run `epismo doctor` to inspect your setup.
|
|
58
58
|
|
package/npm/launcher.js
CHANGED
|
@@ -5,46 +5,78 @@ import { fileURLToPath } from "node:url";
|
|
|
5
5
|
|
|
6
6
|
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
7
7
|
|
|
8
|
-
export function targetFor(
|
|
8
|
+
export function targetFor(
|
|
9
|
+
platform = process.platform,
|
|
10
|
+
architecture = process.arch,
|
|
11
|
+
) {
|
|
9
12
|
const os = { darwin: "darwin", linux: "linux", win32: "windows" }[platform];
|
|
10
13
|
const arch = { x64: "amd64", arm64: "arm64" }[architecture];
|
|
11
14
|
return os && arch ? `${os}-${arch}` : null;
|
|
12
15
|
}
|
|
13
16
|
|
|
14
|
-
export function binaryFor(
|
|
17
|
+
export function binaryFor(
|
|
18
|
+
platform = process.platform,
|
|
19
|
+
architecture = process.arch,
|
|
20
|
+
root = packageRoot,
|
|
21
|
+
) {
|
|
15
22
|
const target = targetFor(platform, architecture);
|
|
16
23
|
if (!target) return null;
|
|
17
|
-
return join(
|
|
24
|
+
return join(
|
|
25
|
+
root,
|
|
26
|
+
"npm",
|
|
27
|
+
"vendor",
|
|
28
|
+
target,
|
|
29
|
+
platform === "win32" ? "epismo.exe" : "epismo",
|
|
30
|
+
);
|
|
18
31
|
}
|
|
19
32
|
|
|
20
33
|
export function detectPackageManager({
|
|
21
34
|
root = packageRoot,
|
|
22
35
|
entrypoint = process.argv[1] || "",
|
|
23
36
|
userAgent = process.env.npm_config_user_agent || "",
|
|
24
|
-
execPath = process.env.npm_execpath || ""
|
|
37
|
+
execPath = process.env.npm_execpath || "",
|
|
25
38
|
} = {}) {
|
|
26
|
-
if (pnpmOwnsPackage(root, entrypoint))
|
|
39
|
+
if (pnpmOwnsPackage(root, entrypoint))
|
|
40
|
+
return { name: "pnpm", version: versionFromUserAgent(userAgent, "pnpm") };
|
|
27
41
|
const normalizedRoot = root.toLowerCase().replaceAll("\\", "/");
|
|
28
|
-
if (
|
|
42
|
+
if (
|
|
43
|
+
/\bbun\//i.test(userAgent) ||
|
|
44
|
+
/(?:^|[\\/])bun(?:\.exe)?$/i.test(execPath) ||
|
|
45
|
+
normalizedRoot.includes("/.bun/install/global/")
|
|
46
|
+
) {
|
|
29
47
|
return { name: "bun", version: versionFromUserAgent(userAgent, "bun") };
|
|
30
48
|
}
|
|
31
|
-
if (
|
|
32
|
-
|
|
49
|
+
if (
|
|
50
|
+
/\byarn\//i.test(userAgent) ||
|
|
51
|
+
/(?:^|[\\/])yarn(?:\.c?js|\.cmd)?$/i.test(execPath) ||
|
|
52
|
+
normalizedRoot.includes("/.config/yarn/global/")
|
|
53
|
+
) {
|
|
54
|
+
return {
|
|
55
|
+
name: "yarn",
|
|
56
|
+
version: versionFromUserAgent(userAgent, "yarn") || "1",
|
|
57
|
+
};
|
|
33
58
|
}
|
|
34
59
|
return { name: "npm", version: versionFromUserAgent(userAgent, "npm") };
|
|
35
60
|
}
|
|
36
61
|
|
|
37
62
|
export function installationScope(environment = process.env) {
|
|
38
|
-
return environment.npm_command === "exec" ||
|
|
63
|
+
return environment.npm_command === "exec" ||
|
|
64
|
+
environment.npm_lifecycle_event === "npx"
|
|
65
|
+
? "ephemeral"
|
|
66
|
+
: "global";
|
|
39
67
|
}
|
|
40
68
|
|
|
41
69
|
export function launch() {
|
|
42
70
|
const binary = binaryFor();
|
|
43
71
|
if (!binary) {
|
|
44
|
-
throw new Error(
|
|
72
|
+
throw new Error(
|
|
73
|
+
`Unsupported platform: ${process.platform}-${process.arch}`,
|
|
74
|
+
);
|
|
45
75
|
}
|
|
46
76
|
if (!existsSync(binary)) {
|
|
47
|
-
throw new Error(
|
|
77
|
+
throw new Error(
|
|
78
|
+
`Epismo native binary is missing for ${process.platform}-${process.arch}. Reinstall the epismo package.`,
|
|
79
|
+
);
|
|
48
80
|
}
|
|
49
81
|
const manager = detectPackageManager();
|
|
50
82
|
const env = {
|
|
@@ -52,12 +84,13 @@ export function launch() {
|
|
|
52
84
|
EPISMO_DISTRIBUTION: "node",
|
|
53
85
|
EPISMO_NODE_MANAGER: manager.name,
|
|
54
86
|
EPISMO_NODE_MANAGER_VERSION: manager.version || "",
|
|
55
|
-
EPISMO_NODE_SCOPE: installationScope()
|
|
87
|
+
EPISMO_NODE_SCOPE: installationScope(),
|
|
56
88
|
};
|
|
57
89
|
const child = spawn(binary, process.argv.slice(2), { stdio: "inherit", env });
|
|
58
90
|
const signalHandlers = new Map();
|
|
59
91
|
const removeSignalHandlers = () => {
|
|
60
|
-
for (const [signal, handler] of signalHandlers)
|
|
92
|
+
for (const [signal, handler] of signalHandlers)
|
|
93
|
+
process.off(signal, handler);
|
|
61
94
|
};
|
|
62
95
|
child.on("error", (error) => {
|
|
63
96
|
removeSignalHandlers();
|
|
@@ -82,7 +115,9 @@ export function launch() {
|
|
|
82
115
|
}
|
|
83
116
|
|
|
84
117
|
function versionFromUserAgent(userAgent, manager) {
|
|
85
|
-
return
|
|
118
|
+
return (
|
|
119
|
+
userAgent.match(new RegExp(`(?:^|\\s)${manager}/([^\\s]+)`, "i"))?.[1] || ""
|
|
120
|
+
);
|
|
86
121
|
}
|
|
87
122
|
|
|
88
123
|
function pnpmOwnsPackage(root, entrypoint) {
|
|
@@ -92,7 +127,8 @@ function pnpmOwnsPackage(root, entrypoint) {
|
|
|
92
127
|
const nodeModules = join(current, "node_modules");
|
|
93
128
|
if (existsSync(join(nodeModules, ".modules.yaml"))) {
|
|
94
129
|
try {
|
|
95
|
-
if (realpathSync(join(nodeModules, "epismo")) === realpathSync(root))
|
|
130
|
+
if (realpathSync(join(nodeModules, "epismo")) === realpathSync(root))
|
|
131
|
+
return true;
|
|
96
132
|
} catch {
|
|
97
133
|
// Keep looking for the owning pnpm node_modules directory.
|
|
98
134
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED