@workflow-code/cli 0.2.2-20260826002 → 0.2.3-20260902001
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/chunk-27OW6OJ3.js +276 -0
- package/dist/chunk-HZABRDJK.js +169 -0
- package/dist/chunk-NSPRIPOP.js +36 -0
- package/dist/chunk-OLNPMIEF.js +14 -0
- package/dist/chunk-PGM3IPWA.js +174 -0
- package/dist/chunk-PPZ35MOY.js +66 -0
- package/dist/{chunk-2DNWG5WR.js → chunk-PSXLDKGX.js} +668 -486
- package/dist/index.js +19 -4
- package/dist/{local-TCDSZTVL.js → local-YVQXAXWF.js} +52 -14
- package/dist/mcp-SGAVKGVX.js +26662 -0
- package/dist/openai-responses-runner-K3HF3XOG.js +210 -0
- package/dist/openai-runner-stdio-ZQJG73I4.js +8 -0
- package/dist/{workspace-Y4TEIVC7.js → workspace-J3C6D5W5.js} +448 -468
- package/package.json +11 -5
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
i18n,
|
|
4
|
+
initI18n,
|
|
5
|
+
isSupportedLocale,
|
|
6
|
+
normalizeLocale
|
|
7
|
+
} from "./chunk-PSXLDKGX.js";
|
|
8
|
+
|
|
9
|
+
// src/locale.ts
|
|
10
|
+
import { WORKFLOW_RUNTIME_LOCALE_ENV } from "workflow-code";
|
|
11
|
+
function prepareCliInvocation(argv) {
|
|
12
|
+
initI18n({ preference: resolveSystemLocalePreference() });
|
|
13
|
+
const extracted = extractLocaleOption(argv);
|
|
14
|
+
const requestedLocale = extracted.locale ?? readEnvironmentLocale();
|
|
15
|
+
if (requestedLocale !== void 0) {
|
|
16
|
+
if (!isSupportedLocale(requestedLocale)) {
|
|
17
|
+
throw new Error(i18n.t("invalidLocale", {
|
|
18
|
+
ns: "cli",
|
|
19
|
+
value: requestedLocale
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
initI18n({ preference: requestedLocale });
|
|
23
|
+
}
|
|
24
|
+
const locale = normalizeLocale(i18n.language);
|
|
25
|
+
process.env[WORKFLOW_RUNTIME_LOCALE_ENV] = locale;
|
|
26
|
+
return {
|
|
27
|
+
argv: extracted.argv,
|
|
28
|
+
locale
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function extractLocaleOption(argv) {
|
|
32
|
+
const filtered = [];
|
|
33
|
+
let locale;
|
|
34
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
35
|
+
const arg = argv[index];
|
|
36
|
+
if (arg === "--") {
|
|
37
|
+
filtered.push(...argv.slice(index));
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
if (arg === "--locale" || arg.startsWith("--locale=")) {
|
|
41
|
+
if (locale !== void 0) {
|
|
42
|
+
throw new Error(i18n.t("duplicateLocale", { ns: "cli" }));
|
|
43
|
+
}
|
|
44
|
+
const value = arg === "--locale" ? argv[++index] : arg.slice("--locale=".length);
|
|
45
|
+
if (value === void 0 || value.trim() === "") {
|
|
46
|
+
throw new Error(i18n.t("missingOptionValue", { ns: "cli", name: "--locale" }));
|
|
47
|
+
}
|
|
48
|
+
locale = value;
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
filtered.push(arg);
|
|
52
|
+
}
|
|
53
|
+
return { argv: filtered, locale };
|
|
54
|
+
}
|
|
55
|
+
function readEnvironmentLocale() {
|
|
56
|
+
const value = process.env.WORKFLOW_CODE_LOCALE?.trim();
|
|
57
|
+
return value === "" ? void 0 : value;
|
|
58
|
+
}
|
|
59
|
+
function resolveSystemLocalePreference() {
|
|
60
|
+
const systemLocale = process.env.LC_ALL ?? process.env.LANG;
|
|
61
|
+
return systemLocale?.trim() ? normalizeLocale(systemLocale) : "system";
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
prepareCliInvocation
|
|
66
|
+
};
|