@workflow-code/cli 0.2.4-20260921002 → 0.2.4-20260921004.codex-ai-model-attributes
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/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import "./chunk-NSPRIPOP.js";
|
|
10
10
|
|
|
11
11
|
// src/index.ts
|
|
12
|
+
import { realpathSync } from "fs";
|
|
12
13
|
import path from "path";
|
|
13
14
|
import { pathToFileURL } from "url";
|
|
14
15
|
async function main(argv = process.argv.slice(2)) {
|
|
@@ -38,13 +39,24 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
38
39
|
}
|
|
39
40
|
const { register } = await import("tsx/esm/api");
|
|
40
41
|
register();
|
|
41
|
-
const localCli = await import("./local-
|
|
42
|
+
const localCli = await import("./local-7XY6XQ3G.js");
|
|
42
43
|
return localCli.main(argv, { localeInitialized: true });
|
|
43
44
|
}
|
|
44
45
|
function formatHelp() {
|
|
45
46
|
return i18n.t("rootHelp", { ns: "cli" });
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
+
function isCliEntryPoint() {
|
|
49
|
+
const entry = process.argv[1];
|
|
50
|
+
if (entry === void 0) return false;
|
|
51
|
+
const absolute = path.resolve(entry);
|
|
52
|
+
const candidates = /* @__PURE__ */ new Set([absolute]);
|
|
53
|
+
try {
|
|
54
|
+
candidates.add(realpathSync(absolute));
|
|
55
|
+
} catch {
|
|
56
|
+
}
|
|
57
|
+
return [...candidates].some((candidate) => import.meta.url === pathToFileURL(candidate).href);
|
|
58
|
+
}
|
|
59
|
+
if (isCliEntryPoint()) {
|
|
48
60
|
main().then((exitCode) => {
|
|
49
61
|
process.exitCode = exitCode;
|
|
50
62
|
}).catch((error) => {
|
|
@@ -2043,6 +2043,77 @@ function readRequiredCoreVersion(manifest) {
|
|
|
2043
2043
|
}
|
|
2044
2044
|
return normalizeExactVersion(value, "Workflow Core requirement");
|
|
2045
2045
|
}
|
|
2046
|
+
var EXACT_VERSION_PATTERN = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/u;
|
|
2047
|
+
var LOCAL_SPECIFIER_PATTERN = /^(?:file|link):(.*)$/u;
|
|
2048
|
+
function classifyVersionReference(manifest, packageName, { section = "devDependencies" } = {}) {
|
|
2049
|
+
if (!isRecord(manifest)) throw new Error("Workflow package.json root must be an object.");
|
|
2050
|
+
const dependencies = manifest[section];
|
|
2051
|
+
const label = `${section}.${packageName}`;
|
|
2052
|
+
const value = isRecord(dependencies) ? dependencies[packageName] : void 0;
|
|
2053
|
+
if (typeof value !== "string" || value.trim() === "") {
|
|
2054
|
+
throw new Error(`Workflow package.json must declare ${label} as an exact version.`);
|
|
2055
|
+
}
|
|
2056
|
+
const specifier = value.trim();
|
|
2057
|
+
const local = LOCAL_SPECIFIER_PATTERN.exec(specifier);
|
|
2058
|
+
if (local !== null) {
|
|
2059
|
+
const relative = local[1];
|
|
2060
|
+
if (!relative.startsWith("./") && !relative.startsWith("../")) {
|
|
2061
|
+
throw new Error(`${label} must use a relative file:/link: specifier, received ${specifier}.`);
|
|
2062
|
+
}
|
|
2063
|
+
return { kind: "local", specifier, relative };
|
|
2064
|
+
}
|
|
2065
|
+
if (!EXACT_VERSION_PATTERN.test(specifier)) {
|
|
2066
|
+
throw new Error(`${label} "${value}" must be an exact SemVer version.`);
|
|
2067
|
+
}
|
|
2068
|
+
return { kind: "exact", version: specifier, specifier };
|
|
2069
|
+
}
|
|
2070
|
+
function resolveReleaseMode(env = process.env) {
|
|
2071
|
+
const override = String(env.WORKFLOW_REPOSITORY_MODE ?? "").trim();
|
|
2072
|
+
if (override !== "" && override !== "main") {
|
|
2073
|
+
throw new Error("WORKFLOW_REPOSITORY_MODE only accepts main as a fail-closed override.");
|
|
2074
|
+
}
|
|
2075
|
+
if (override === "main") return "main";
|
|
2076
|
+
if (String(env.CI_COMMIT_TAG ?? "").trim() !== "") return "main";
|
|
2077
|
+
const branch = String(env.CI_COMMIT_BRANCH ?? env.CI_MERGE_REQUEST_SOURCE_BRANCH_NAME ?? "").trim();
|
|
2078
|
+
return branch === "main" || branch === "alpha" ? "main" : "dev";
|
|
2079
|
+
}
|
|
2080
|
+
function resolveSiblingDirectory(relative, repositoryDirectory) {
|
|
2081
|
+
const segments = String(repositoryDirectory).split("/").filter((segment) => segment !== "");
|
|
2082
|
+
if (segments.length === 0) throw new Error("The declaring repository directory is required.");
|
|
2083
|
+
for (const segment of String(relative).split("/")) {
|
|
2084
|
+
if (segment === "" || segment === ".") continue;
|
|
2085
|
+
if (segment === "..") {
|
|
2086
|
+
if (segments.length === 0) {
|
|
2087
|
+
throw new Error(`${relative} must stay inside the workspace root.`);
|
|
2088
|
+
}
|
|
2089
|
+
segments.pop();
|
|
2090
|
+
continue;
|
|
2091
|
+
}
|
|
2092
|
+
if (segment.includes("\\")) throw new Error(`${relative} must use forward slashes.`);
|
|
2093
|
+
segments.push(segment);
|
|
2094
|
+
}
|
|
2095
|
+
if (segments.length === 0) {
|
|
2096
|
+
throw new Error(`${relative} must point at a sibling repository, not the workspace root.`);
|
|
2097
|
+
}
|
|
2098
|
+
return segments.join("/");
|
|
2099
|
+
}
|
|
2100
|
+
function resolveRequiredCoreVersion(manifest, options) {
|
|
2101
|
+
const reference = classifyVersionReference(manifest, WORKFLOW_CORE_PACKAGE_NAME, {
|
|
2102
|
+
section: options.section ?? "devDependencies"
|
|
2103
|
+
});
|
|
2104
|
+
if (reference.kind === "exact") return normalizeExactVersion(reference.version, "Workflow Core requirement");
|
|
2105
|
+
if (options.mode === "main") {
|
|
2106
|
+
throw new Error(
|
|
2107
|
+
`devDependencies.${WORKFLOW_CORE_PACKAGE_NAME} must declare an exact published version on main and alpha; ${reference.specifier} is only allowed on dev and feature branches.`
|
|
2108
|
+
);
|
|
2109
|
+
}
|
|
2110
|
+
const siblingDirectory = resolveSiblingDirectory(reference.relative, options.repositoryDirectory);
|
|
2111
|
+
const sibling = options.readSiblingManifest(siblingDirectory);
|
|
2112
|
+
if (!isRecord(sibling) || sibling.name !== WORKFLOW_CORE_PACKAGE_NAME) {
|
|
2113
|
+
throw new Error(`${reference.specifier} must point at the sibling Core repository (${siblingDirectory}).`);
|
|
2114
|
+
}
|
|
2115
|
+
return normalizeExactVersion(String(sibling.version ?? ""), "Sibling Core version");
|
|
2116
|
+
}
|
|
2046
2117
|
function normalizeExactVersion(value, label = "version") {
|
|
2047
2118
|
const normalized = value.trim();
|
|
2048
2119
|
const validVersion = import_semver.default.valid(normalized);
|
|
@@ -2378,13 +2449,20 @@ function runStructureCommand(argv) {
|
|
|
2378
2449
|
return 1;
|
|
2379
2450
|
}
|
|
2380
2451
|
}
|
|
2381
|
-
function assertLocalCliCoreCompatible(workflowDir, hostCoreVersion = readInstalledWorkflowCoreVersion()) {
|
|
2452
|
+
function assertLocalCliCoreCompatible(workflowDir, hostCoreVersion = readInstalledWorkflowCoreVersion(), options = {}) {
|
|
2382
2453
|
const cliManifest = readJsonFile(new URL("../package.json", import.meta.url), "CLI package.json");
|
|
2383
2454
|
const cliRequiredCoreVersion = readRequiredCoreVersion(cliManifest);
|
|
2384
2455
|
assertCoreCompatibility(hostCoreVersion, cliRequiredCoreVersion);
|
|
2385
|
-
const
|
|
2386
|
-
const projectManifest = readJsonFile(
|
|
2387
|
-
const projectRequiredCoreVersion =
|
|
2456
|
+
const projectDirectory = path.resolve(workflowDir);
|
|
2457
|
+
const projectManifest = readJsonFile(path.join(projectDirectory, "package.json"), "Workflow package.json");
|
|
2458
|
+
const projectRequiredCoreVersion = resolveRequiredCoreVersion(projectManifest, {
|
|
2459
|
+
mode: options.mode ?? resolveReleaseMode(),
|
|
2460
|
+
repositoryDirectory: path.basename(projectDirectory),
|
|
2461
|
+
readSiblingManifest: (siblingDirectory) => readJsonFile(
|
|
2462
|
+
path.join(path.dirname(projectDirectory), siblingDirectory, "package.json"),
|
|
2463
|
+
"Sibling Core package.json"
|
|
2464
|
+
)
|
|
2465
|
+
});
|
|
2388
2466
|
assertCoreCompatibility(hostCoreVersion, projectRequiredCoreVersion);
|
|
2389
2467
|
return { cliRequiredCoreVersion, projectRequiredCoreVersion };
|
|
2390
2468
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workflow-code/cli",
|
|
3
|
-
"version": "0.2.4-
|
|
3
|
+
"version": "0.2.4-20260921004.codex-ai-model-attributes",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"workflow-code": "./dist/index.js"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"zod": "4.4.3"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"workflow-code": "0.2.4-
|
|
23
|
+
"workflow-code": "0.2.4-20260921005.codex-ai-model-attributes"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^25.6.0",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"tsup": "^8.5.1",
|
|
30
30
|
"typescript": "^6.0.3",
|
|
31
31
|
"vitest": "^4.1.7",
|
|
32
|
-
"workflow-code": "0.2.4-
|
|
32
|
+
"workflow-code": "0.2.4-20260921005.codex-ai-model-attributes",
|
|
33
33
|
"@workflow-code/auth-config": "0.1.0",
|
|
34
34
|
"@workflow-code/execution-targets": "0.1.0",
|
|
35
|
-
"@workflow-code/openai-responses": "0.1.0",
|
|
36
35
|
"@workflow-code/i18n": "0.1.0",
|
|
36
|
+
"@workflow-code/openai-responses": "0.1.0",
|
|
37
37
|
"@workflow-code/project-dependencies": "0.1.0",
|
|
38
38
|
"@workflow-code/project-info": "0.1.0",
|
|
39
39
|
"@workflow-code/project-upload": "0.1.0",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"test": "pnpm build && vitest run",
|
|
52
52
|
"coverage": "pnpm build && vitest run --coverage",
|
|
53
53
|
"test:scripts": "node --test --test-reporter=spec scripts/__tests__/*.test.mjs",
|
|
54
|
-
"release:prepare": "node scripts/prepare-release.mjs"
|
|
54
|
+
"release:prepare": "node scripts/prepare-release.mjs",
|
|
55
|
+
"release:feature": "node scripts/feature-release.mjs tag"
|
|
55
56
|
}
|
|
56
57
|
}
|