@kybernesis/create 0.24.3 → 0.24.4

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.
Files changed (2) hide show
  1. package/dist/upgrade.js +23 -3
  2. package/package.json +1 -1
package/dist/upgrade.js CHANGED
@@ -938,6 +938,21 @@ export async function upgrade(options = {}) {
938
938
  console.log(` ${dim(selfVersion.fix)} ${dim("(continuing: --allow-stale)")}\n`);
939
939
  }
940
940
  reportAgentInputLimit(cwd);
941
+ // An agent already on a newer eve line than this kyb was certified on must
942
+ // be upgraded by that line's kyb: from here every @kybernesis package would
943
+ // be "upgraded" to a build for the older eve.
944
+ const eveNow = installedPackageValue(cwd, "eve", ".version");
945
+ const nowLine = eveNow ? majorMinor(eveNow) : null;
946
+ const ownLine = majorMinor(EVE_VERSION);
947
+ if (nowLine && ownLine && (nowLine[0] > ownLine[0] || (nowLine[0] === ownLine[0] && nowLine[1] > ownLine[1]))) {
948
+ if (options.check)
949
+ printPlan({ ok: false, unresolved: ["eve"], changes: [], resetsConversations: false });
950
+ fail(`This agent runs eve ${eveNow}, a newer line than this kyb is certified for (${EVE_VERSION}). ` +
951
+ `Run the kyb for its line:\n npx --yes --package=@kybernesis/create@eve-${nowLine[0]}.${nowLine[1]} kyb upgrade\n` +
952
+ `Nothing was changed.`);
953
+ return;
954
+ }
955
+ const selfInstalled = "installed" in selfVersion ? selfVersion.installed : undefined;
941
956
  const entries = dependencyEntries(pkg);
942
957
  const installedVersions = new Map();
943
958
  const targetVersions = new Map();
@@ -956,11 +971,16 @@ export async function upgrade(options = {}) {
956
971
  // that supports the eve this host will be running — NOT npm's `latest`,
957
972
  // which for a per-eve-line package is routinely a build for a different
958
973
  // line and installs without complaint.
974
+ // kyb itself declares no eve peer, so the newest published kyb can belong
975
+ // to another eve line. The project carries the kyb doing this upgrade (a
976
+ // stale one renewed itself above), never a newer one.
959
977
  const target = name === "eve"
960
978
  ? EVE_VERSION
961
- : name.startsWith("@kybernesis/")
962
- ? newestBuildForEve(name, EVE_VERSION)
963
- : capture("npm", ["view", name, "version"])?.trim();
979
+ : name === "@kybernesis/create"
980
+ ? selfInstalled && versionLt(installed, selfInstalled) ? selfInstalled : installed
981
+ : name.startsWith("@kybernesis/")
982
+ ? newestBuildForEve(name, EVE_VERSION)
983
+ : capture("npm", ["view", name, "version"])?.trim();
964
984
  if (!target) {
965
985
  console.log(` ${yellow("!")} ${name}: ` +
966
986
  (name.startsWith("@kybernesis/")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kybernesis/create",
3
- "version": "0.24.3",
3
+ "version": "0.24.4",
4
4
  "description": "The Kybernesis agent scaffolder and FDE toolkit: one command to a governed, remembering, multiplayer, self-testing eve agent \u2014 plus doctor and upgrade.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",