create-yss-spec 3.5.4 → 3.5.5
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 +8 -0
- package/cli-core.lock.json +130 -0
- package/package.json +7 -3
- package/resources/upgrade-skill/SKILL.md +26 -0
- package/resources/upgrade-skill/protocol.md +40 -0
- package/resources/upgrade-skill/references/cli-families.md +14 -0
- package/src/cli/help.js +1 -0
- package/src/cli/index.js +12 -0
- package/src/filesystem/transaction-runner.js +27 -0
- package/src/template/asset-runtime.js +6 -0
- package/src/template/verification-runtime.js +9 -1
- package/template/.agents/skills/.strategic-design-skills-manifest.json +2 -2
- package/template/.agents/skills/yss-harness-upgrade/SKILL.md +26 -0
- package/template/.agents/skills/yss-harness-upgrade/references/cli-families.md +14 -0
- package/template/.agents/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -0
- package/template/.agents/skills/yss-product-lifecycle/SKILL.md +15 -19
- package/template/.agents/skills/yss-stage-decision/SKILL.md +3 -0
- package/template/.agents/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -4
- package/template/.agents/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -4
- package/template/.agents/skills/yss-stage-decision/tests/run-scenarios.mjs +13 -1
- package/template/.codex/skills/yss-harness-upgrade/SKILL.md +26 -0
- package/template/.codex/skills/yss-harness-upgrade/references/cli-families.md +14 -0
- package/template/.codex/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -0
- package/template/.codex/skills/yss-product-lifecycle/SKILL.md +15 -19
- package/template/.codex/skills/yss-stage-decision/SKILL.md +3 -0
- package/template/.codex/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -4
- package/template/.codex/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -4
- package/template/.codex/skills/yss-stage-decision/tests/run-scenarios.mjs +13 -1
- package/template/.cursor/skills/yss-harness-upgrade/SKILL.md +26 -0
- package/template/.cursor/skills/yss-harness-upgrade/references/cli-families.md +14 -0
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -0
- package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +15 -19
- package/template/.cursor/skills/yss-stage-decision/SKILL.md +3 -0
- package/template/.cursor/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -4
- package/template/.cursor/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -4
- package/template/.cursor/skills/yss-stage-decision/tests/run-scenarios.mjs +13 -1
- package/template/.pi/skills/yss-harness-upgrade/SKILL.md +26 -0
- package/template/.pi/skills/yss-harness-upgrade/references/cli-families.md +14 -0
- package/template/.pi/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -0
- package/template/.pi/skills/yss-product-lifecycle/SKILL.md +15 -19
- package/template/.pi/skills/yss-stage-decision/SKILL.md +3 -0
- package/template/.pi/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -4
- package/template/.pi/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -4
- package/template/.pi/skills/yss-stage-decision/tests/run-scenarios.mjs +13 -1
- package/template/.template-spec/agents/yss-skill-registry.yaml +9 -1
- package/template/.template-spec/process/contract-reading.md +1 -1
- package/template/.template-spec/process/document-writing.md +12 -0
- package/template/.template-spec/process/harness-upgrade.md +40 -0
- package/template/.template-spec/process/lifecycle-artifact-map.md +2 -2
- package/template/.template-spec/process/lifecycle-registry.yaml +3 -1
- package/template/.template-spec/process/schemas/approval-record.schema.json +23 -0
- package/template/.template-spec/process/stage-tracking.md +2 -2
- package/template/.template-spec/process/structured-assets.md +35 -0
- package/template/.template-spec/process/templates/lifecycle-checkpoint-template.json +48 -0
- package/template/.template-spec/templates/approval-record-template.json +23 -0
- package/template/scripts/check-plan-stage-coverage +12 -0
- package/template/scripts/contract +6 -0
- package/template/scripts/lib/approval-record.mjs +4 -3
- package/template/scripts/lib/asset-command.mjs +35 -0
- package/template/scripts/lib/asset-migration.mjs +101 -0
- package/template/scripts/lib/asset-transactions.mjs +235 -0
- package/template/scripts/lib/checkpoint-boundary.mjs +3 -0
- package/template/scripts/lib/contract-views.mjs +7 -1
- package/template/scripts/lib/json-schema.mjs +43 -4
- package/template/scripts/lib/lifecycle-context-query.mjs +7 -0
- package/template/scripts/lib/lifecycle-presentation.mjs +77 -0
- package/template/scripts/lib/lifecycle-status.mjs +16 -1
- package/template/scripts/lib/plan-stage-coverage.mjs +40 -0
- package/template/scripts/lib/reading-view-bundle.mjs +1 -0
- package/template/scripts/lib/reading-view-markdown.mjs +8 -6
- package/template/scripts/lib/stage-tracking-migration.mjs +11 -3
- package/template/scripts/lib/structured-assets.mjs +81 -0
- package/template/scripts/lib/task-package.mjs +4 -1
- package/template/scripts/lifecycle-status +6 -3
- package/template/scripts/verify-lifecycle-checkpoint +8 -5
- package/template/skills-lock.json +21 -9
- package/template.manifest.json +2 -1
- package/template.snapshot.json +5 -5
- package/vendor/cli-core/build.mjs +302 -0
- package/vendor/cli-core/bundle.mjs +198 -0
- package/vendor/cli-core/cli.mjs +182 -0
- package/vendor/cli-core/command-runner.mjs +107 -0
- package/vendor/cli-core/engine.mjs +239 -0
- package/vendor/cli-core/family.mjs +28 -0
- package/vendor/cli-core/gitignore.mjs +15 -0
- package/vendor/cli-core/identity.mjs +274 -0
- package/vendor/cli-core/io.mjs +153 -0
- package/vendor/cli-core/layout-migration.mjs +64 -0
- package/vendor/cli-core/legacy.mjs +19 -0
- package/vendor/cli-core/migrate.mjs +237 -0
- package/vendor/cli-core/migration-adapter.mjs +19 -0
- package/vendor/cli-core/package.json +13 -0
- package/vendor/cli-core/scaffold.mjs +117 -0
- package/vendor/cli-core/spec-migration-adapter.mjs +83 -0
- package/vendor/cli-core/tests/build.test.mjs +40 -0
- package/vendor/cli-core/tests/cli.test.mjs +1065 -0
- package/vendor/cli-core/tests/migration-version.test.mjs +8 -0
- package/vendor/cli-core/tests/package-contract.mjs +75 -0
- package/vendor/cli-core/transaction.mjs +529 -0
- package/vendor/cli-core/update.mjs +79 -0
- package/vendor/cli-core/vendor/NOTICES.md +6 -0
- package/vendor/cli-core/vendor/yaml.LICENSE +13 -0
- package/vendor/cli-core/vendor/yaml.mjs +6311 -0
- package/vendor/cli-core/verification.mjs +131 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { runCommandSync } from "./command-runner.mjs";
|
|
3
|
+
import { ensure, stat } from "./io.mjs";
|
|
4
|
+
function npm(args, cwd) {
|
|
5
|
+
const r = runCommandSync("npm", args, { cwd, timeoutMs: 120000 });
|
|
6
|
+
ensure(
|
|
7
|
+
!r.error && r.status === 0,
|
|
8
|
+
`npm ${args[0]} 失败: ${r.termination || r.error?.message || r.stderr}`,
|
|
9
|
+
"UPDATE",
|
|
10
|
+
);
|
|
11
|
+
return r.stdout.trim();
|
|
12
|
+
}
|
|
13
|
+
function version(v) {
|
|
14
|
+
ensure(/^\d+\.\d+\.\d+$/.test(v), `不支持的稳定版本号: ${v}`, "UPDATE");
|
|
15
|
+
return v.split(".").map(Number);
|
|
16
|
+
}
|
|
17
|
+
export function update(packageRoot, pkg, opts) {
|
|
18
|
+
packageRoot = path.resolve(packageRoot);
|
|
19
|
+
const packageName = pkg.name;
|
|
20
|
+
ensure(
|
|
21
|
+
/^create-yss-harness-(design|backend|frontend)$/.test(packageName),
|
|
22
|
+
"未知升级包名",
|
|
23
|
+
);
|
|
24
|
+
const latestVersion = npm(["view", packageName, "version"]).replace(
|
|
25
|
+
/^"|"$/g,
|
|
26
|
+
"",
|
|
27
|
+
);
|
|
28
|
+
const current = version(pkg.version),
|
|
29
|
+
latest = version(latestVersion);
|
|
30
|
+
let comparison = 0;
|
|
31
|
+
for (let i = 0; i < 3; i++) {
|
|
32
|
+
if (latest[i] !== current[i]) {
|
|
33
|
+
comparison = latest[i] > current[i] ? 1 : -1;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const result = {
|
|
38
|
+
schemaVersion: 1,
|
|
39
|
+
command: opts.command,
|
|
40
|
+
packageName,
|
|
41
|
+
currentVersion: pkg.version,
|
|
42
|
+
latestVersion,
|
|
43
|
+
status: "current",
|
|
44
|
+
advice: `npx ${packageName}@latest --help`,
|
|
45
|
+
};
|
|
46
|
+
if (comparison < 0 || (comparison === 0 && !opts.force)) return result;
|
|
47
|
+
let kind = "unknown",
|
|
48
|
+
cwd,
|
|
49
|
+
args;
|
|
50
|
+
if (packageRoot.split(path.sep).includes("_npx")) kind = "npx";
|
|
51
|
+
else if (stat(path.join(packageRoot, ".git"))) kind = "source";
|
|
52
|
+
else {
|
|
53
|
+
const prefix = path.resolve(npm(["prefix", "-g"]));
|
|
54
|
+
if (
|
|
55
|
+
[
|
|
56
|
+
path.join(prefix, "lib", "node_modules", packageName),
|
|
57
|
+
path.join(prefix, "node_modules", packageName),
|
|
58
|
+
].includes(packageRoot)
|
|
59
|
+
) {
|
|
60
|
+
kind = "global";
|
|
61
|
+
args = ["install", "-g", `${packageName}@latest`];
|
|
62
|
+
} else if (
|
|
63
|
+
path.basename(path.dirname(packageRoot)) === "node_modules" &&
|
|
64
|
+
path.basename(packageRoot) === packageName
|
|
65
|
+
) {
|
|
66
|
+
kind = "local";
|
|
67
|
+
cwd = path.dirname(path.dirname(packageRoot));
|
|
68
|
+
args = ["install", `${packageName}@latest`];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
result.installKind = kind;
|
|
72
|
+
result.status = args ? (opts.dryRun ? "preview" : "updated") : "instructions";
|
|
73
|
+
if (args) {
|
|
74
|
+
result.commandLine = ["npm", ...args];
|
|
75
|
+
result.cwd = cwd || null;
|
|
76
|
+
if (!opts.dryRun) result.output = npm(args, cwd);
|
|
77
|
+
}
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# yaml parser
|
|
2
|
+
|
|
3
|
+
yaml 2.9.0 (ISC), github:eemeli/yaml. Bundle copied from the canonical
|
|
4
|
+
`scripts/vendor/yaml.mjs` (esbuild 0.28.2, node22).
|
|
5
|
+
SHA-256: 58c510627769ef4e75e90bcf410d63ba33e64b46bc9cfc53149839d5ccb1709b.
|
|
6
|
+
The accompanying yaml.LICENSE preserves the upstream license.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright Eemeli Aro <eemeli@gmail.com>
|
|
2
|
+
|
|
3
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
4
|
+
with or without fee is hereby granted, provided that the above copyright notice
|
|
5
|
+
and this permission notice appear in all copies.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
9
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
11
|
+
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
12
|
+
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
|
13
|
+
THIS SOFTWARE.
|