@rayul/kordis 0.9.0 → 0.9.2

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/index.js +32 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2968,6 +2968,26 @@ function pushCommand() {
2968
2968
  throw err instanceof Error ? err : new Error(String(err));
2969
2969
  }
2970
2970
  if (opts.dryRun) {
2971
+ const explicitBump = opts.bump && opts.bump !== "patch" ? opts.bump : null;
2972
+ if (explicitBump && nameFromFm) {
2973
+ const slugForCheck = opts.slug?.includes("/") ? opts.slug.split("/", 2) : bundle.username ? [bundle.username, opts.slug ?? nameFromFm] : null;
2974
+ if (slugForCheck && slugForCheck[0] && slugForCheck[1]) {
2975
+ const [u, s2] = slugForCheck;
2976
+ try {
2977
+ await bundle.api.getPackage(u, s2);
2978
+ } catch (err) {
2979
+ if (err && typeof err === "object" && "code" in err && err.code === "not_found") {
2980
+ throw new KordisApiError(400, {
2981
+ error: {
2982
+ code: "usage_error",
2983
+ message: `--bump ${explicitBump} cannot apply to a first publish (no existing version to bump from)`,
2984
+ hint: 'First publish derives version from frontmatter `version:` or defaults to "0.1.0". Drop --bump (or set frontmatter version explicitly), then re-run.'
2985
+ }
2986
+ });
2987
+ }
2988
+ }
2989
+ }
2990
+ }
2971
2991
  await runDryRun({ content, assets });
2972
2992
  return;
2973
2993
  }
@@ -3663,6 +3683,11 @@ function kordisHome2() {
3663
3683
  function lockfilePath() {
3664
3684
  return join8(kordisHome2(), "installed.json");
3665
3685
  }
3686
+ function lockfileDisplayPath() {
3687
+ const path2 = lockfilePath();
3688
+ const home = process.env["HOME"];
3689
+ return home && path2.startsWith(home) ? "~" + path2.slice(home.length) : path2;
3690
+ }
3666
3691
  async function readLockfile() {
3667
3692
  try {
3668
3693
  const raw = await readFile7(lockfilePath(), "utf8");
@@ -3904,6 +3929,7 @@ function pullCommand() {
3904
3929
  );
3905
3930
  for (const w of dep.result.written) printHuman(` ${c.gray("wrote")} ${w}`);
3906
3931
  }
3932
+ printHuman(c.gray(` lockfile: ${lockfileDisplayPath()}`));
3907
3933
  }
3908
3934
  });
3909
3935
  const reminder = await maybeRenderReminder();
@@ -3950,13 +3976,14 @@ function readCommand() {
3950
3976
  async (rawSlug, opts) => {
3951
3977
  const parsed = parseSlugAtVersion(rawSlug);
3952
3978
  const pin = opts.pin ?? parsed.version ?? parsed.range;
3979
+ const pinIsRange = pin ? /[\^~*]/.test(pin) : false;
3953
3980
  const bundle = await useClient();
3954
3981
  let resolvedVersion;
3955
- if (parsed.range && !opts.pin) {
3982
+ if (pin && pinIsRange) {
3956
3983
  const resolved = await bundle.api.resolveVersion(
3957
3984
  parsed.username,
3958
3985
  parsed.slug,
3959
- parsed.range
3986
+ pin
3960
3987
  );
3961
3988
  resolvedVersion = resolved.resolved_version;
3962
3989
  }
@@ -3982,7 +4009,7 @@ function readCommand() {
3982
4009
  `);
3983
4010
  }
3984
4011
  }
3985
- const resolvedNote = parsed.range && resolvedVersion ? ` ${c.gray("(resolved")} ${c.gray("@" + parsed.range)} ${c.gray("\u2192")} ${resolvedVersion}${c.gray(")")}` : "";
4012
+ const resolvedNote = pinIsRange && resolvedVersion ? ` ${c.gray("(resolved")} ${c.gray("@" + pin)} ${c.gray("\u2192")} ${resolvedVersion}${c.gray(")")}` : "";
3986
4013
  process.stderr.write(
3987
4014
  `${c.gray("\u2014")} ${c.bold(res.full_slug)}${c.gray("@")}${res.version}${resolvedNote} ${c.gray("\xB7")} ${res.type} (tier ${res.tier}) ${c.gray("\xB7")} ${c.cyan(res.attribution)}
3988
4015
  `
@@ -3999,9 +4026,9 @@ function infoCommand() {
3999
4026
  return new Command7("info").description("show details about a package").argument(
4000
4027
  "<full_slug>",
4001
4028
  "package identifier {username}/{slug} or {username}/{slug}@{version|range}"
4002
- ).action(async (fullSlug) => {
4029
+ ).option("--pin <semver>", "pin to an exact version or range (overrides @suffix)").action(async (fullSlug, opts) => {
4003
4030
  const parsed = parseSlugAtVersion(fullSlug);
4004
- const pin = parsed.version ?? parsed.range;
4031
+ const pin = opts.pin ?? parsed.version ?? parsed.range;
4005
4032
  const bundle = await useClient();
4006
4033
  const detail = await bundle.api.getPackage(parsed.username, parsed.slug, {
4007
4034
  ...pin ? { version: pin } : {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rayul/kordis",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "private": false,
5
5
  "description": "Command-line client for the Kordis registry — discover, install, and publish agentic-coding packages.",
6
6
  "license": "MIT",