@tanstack/intent 0.0.38 → 0.0.39

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.
@@ -31,7 +31,7 @@ function getCheckSkillsWorkflowAdvisories(root) {
31
31
  return [`Intent workflow update available: run \`npx @tanstack/intent@latest setup\` to refresh ${relative(process.cwd(), workflowPath) || workflowPath}.`];
32
32
  }
33
33
  async function scanIntentsOrFail(options) {
34
- const { scanForIntents } = await import("./scanner-ByG70-E3.mjs");
34
+ const { scanForIntents } = await import("./scanner-BoB20xOF.mjs");
35
35
  try {
36
36
  return scanForIntents(void 0, options);
37
37
  } catch (err) {
@@ -68,7 +68,7 @@ async function resolveStaleTargets(targetDir) {
68
68
  targetPath: targetDir
69
69
  });
70
70
  const workflowAdvisories = getCheckSkillsWorkflowAdvisories(context.workspaceRoot ?? context.packageRoot ?? resolvedRoot);
71
- const { buildWorkspaceCoverageSignals, checkStaleness, readPackageName } = await import("./staleness-DpyuNdd5.mjs");
71
+ const { buildWorkspaceCoverageSignals, checkStaleness, readPackageName } = await import("./staleness-IIyVmUxU.mjs");
72
72
  const isWorkspaceRootTarget = context.workspaceRoot !== null && resolvedRoot === context.workspaceRoot;
73
73
  if (context.packageRoot && !isWorkspaceRootTarget && (context.targetSkillsDir !== null || context.workspaceRoot === null)) return {
74
74
  reports: [await checkStaleness(context.packageRoot, readPackageName(context.packageRoot), context.workspaceRoot ?? context.packageRoot)],
@@ -1,6 +1,6 @@
1
1
  import "./utils-mdb4i6VA.mjs";
2
2
  import "./workspace-patterns-BZLEaMcS.mjs";
3
3
  import "./project-context-Dx6XIJJo.mjs";
4
- import { a as printDebugInfo, c as scanOptionsFromGlobalFlags, i as getMetaDir, l as printWarnings, n as coreOptionsFromGlobalFlags, o as resolveStaleTargets, r as getCheckSkillsWorkflowAdvisories, s as scanIntentsOrFail, t as INTENT_CHECK_SKILLS_WORKFLOW_VERSION } from "./cli-support-BON5hn4L.mjs";
4
+ import { a as printDebugInfo, c as scanOptionsFromGlobalFlags, i as getMetaDir, l as printWarnings, n as coreOptionsFromGlobalFlags, o as resolveStaleTargets, r as getCheckSkillsWorkflowAdvisories, s as scanIntentsOrFail, t as INTENT_CHECK_SKILLS_WORKFLOW_VERSION } from "./cli-support-Dmpj1iyQ.mjs";
5
5
 
6
6
  export { INTENT_CHECK_SKILLS_WORKFLOW_VERSION, coreOptionsFromGlobalFlags, getCheckSkillsWorkflowAdvisories, getMetaDir, printDebugInfo, printWarnings, resolveStaleTargets, scanIntentsOrFail, scanOptionsFromGlobalFlags };
package/dist/cli.mjs CHANGED
@@ -9,31 +9,31 @@ function createCli() {
9
9
  const cli = cac("intent");
10
10
  cli.usage("<command> [options]");
11
11
  cli.command("list", "Discover intent-enabled packages from the project or workspace").usage("list [--json] [--debug] [--exclude <pattern>] [--global] [--global-only]").option("--json", "Output JSON").option("--debug", "Print discovery debug details to stderr").option("--exclude <pattern>", "Exclude package name glob").option("--global", "Include global packages after project packages").option("--global-only", "List global packages only").example("list").example("list --json").example("list --global").action(async (options) => {
12
- const { runListCommand } = await import("./list-iLIL-EO3.mjs");
12
+ const { runListCommand } = await import("./list-DNPHxYpR.mjs");
13
13
  await runListCommand(options);
14
14
  });
15
15
  cli.command("load [use]", "Load a compact skill use and print its SKILL.md").usage("load <use> [--path] [--json] [--debug] [--exclude <pattern>] [--global] [--global-only]").option("--path", "Print the resolved skill path instead of file content").option("--json", "Output JSON").option("--debug", "Print resolution debug details to stderr").option("--exclude <pattern>", "Exclude package name glob").option("--global", "Load from project packages, then global packages").option("--global-only", "Load from global packages only").example("load @tanstack/query#core").example("load @tanstack/query#core --path").action(async (use, options) => {
16
- const { runLoadCommand } = await import("./load-8868G50-.mjs");
16
+ const { runLoadCommand } = await import("./load-CK7vr50h.mjs");
17
17
  await runLoadCommand(use, options);
18
18
  });
19
19
  cli.command("meta [name]", "List meta-skills, or print one by name").usage("meta [name]").example("meta").example("meta domain-discovery").action(async (name) => {
20
- const [{ getMetaDir }, { runMetaCommand }] = await Promise.all([import("./cli-support-BlSsqyx7.mjs"), import("./meta-CYV9EzM8.mjs")]);
20
+ const [{ getMetaDir }, { runMetaCommand }] = await Promise.all([import("./cli-support-OrWuIzI3.mjs"), import("./meta-CYV9EzM8.mjs")]);
21
21
  await runMetaCommand(name, getMetaDir());
22
22
  });
23
23
  cli.command("validate [dir]", "Validate skill files").usage("validate [dir] [--github-summary]").option("--github-summary", "Write a GitHub Actions step summary").example("validate").example("validate packages/query/skills").action(async (dir, options) => {
24
- const { runValidateCommand } = await import("./validate-BL1SYAwh.mjs");
24
+ const { runValidateCommand } = await import("./validate-BYUd0qb8.mjs");
25
25
  await runValidateCommand(dir, options);
26
26
  });
27
27
  cli.command("install", "Create or update skill loading guidance in an agent config file").usage("install [--map] [--dry-run] [--print-prompt] [--global] [--global-only]").option("--map", "Write explicit skill-to-task mappings").option("--dry-run", "Print the generated block without writing").option("--print-prompt", "Print the legacy agent setup prompt instead of writing").option("--global", "Include global packages after project packages").option("--global-only", "Install mappings from global packages only").example("install").example("install --map").example("install --dry-run").example("install --print-prompt").example("install --global").action(async (options) => {
28
- const [{ scanIntentsOrFail }, { runInstallCommand }] = await Promise.all([import("./cli-support-BlSsqyx7.mjs"), import("./install-RZpz279M.mjs")]);
28
+ const [{ scanIntentsOrFail }, { runInstallCommand }] = await Promise.all([import("./cli-support-OrWuIzI3.mjs"), import("./install-Brf5PORN.mjs")]);
29
29
  await runInstallCommand(options, scanIntentsOrFail);
30
30
  });
31
31
  cli.command("scaffold", "Print maintainer scaffold prompt").usage("scaffold").action(async () => {
32
- const [{ getMetaDir }, { runScaffoldCommand }] = await Promise.all([import("./cli-support-BlSsqyx7.mjs"), import("./scaffold-D2vwv9ls.mjs")]);
32
+ const [{ getMetaDir }, { runScaffoldCommand }] = await Promise.all([import("./cli-support-OrWuIzI3.mjs"), import("./scaffold-D2vwv9ls.mjs")]);
33
33
  runScaffoldCommand(getMetaDir());
34
34
  });
35
35
  cli.command("stale [dir]", "Check skills for staleness in the current package or workspace").usage("stale [dir] [--json] [--github-review]").option("--json", "Output JSON").option("--github-review", "Write GitHub Actions review PR files").option("--package-label <label>", "Fallback package label for review PRs").example("stale").example("stale packages/query").example("stale --json").action(async (targetDir, options) => {
36
- const [{ resolveStaleTargets }, { runStaleCommand }] = await Promise.all([import("./cli-support-BlSsqyx7.mjs"), import("./stale-flPZnWfI.mjs")]);
36
+ const [{ resolveStaleTargets }, { runStaleCommand }] = await Promise.all([import("./cli-support-OrWuIzI3.mjs"), import("./stale-flPZnWfI.mjs")]);
37
37
  await runStaleCommand(targetDir, options, resolveStaleTargets);
38
38
  });
39
39
  cli.command("edit-package-json", "Update package.json files so skills are published").usage("edit-package-json").action(async () => {
@@ -41,11 +41,11 @@ function createCli() {
41
41
  await runEditPackageJsonCommand(process.cwd());
42
42
  });
43
43
  cli.command("setup", "Copy Intent CI workflow templates into .github/workflows/").usage("setup").action(async () => {
44
- const [{ getMetaDir }, { runSetupGithubActionsCommand }] = await Promise.all([import("./cli-support-BlSsqyx7.mjs"), import("./setup-github-actions-emXSyGy3.mjs")]);
44
+ const [{ getMetaDir }, { runSetupGithubActionsCommand }] = await Promise.all([import("./cli-support-OrWuIzI3.mjs"), import("./setup-github-actions-emXSyGy3.mjs")]);
45
45
  await runSetupGithubActionsCommand(process.cwd(), getMetaDir());
46
46
  });
47
47
  cli.command("setup-github-actions", "Copy Intent CI workflow templates into .github/workflows/").usage("setup-github-actions").action(async () => {
48
- const [{ getMetaDir }, { runSetupGithubActionsCommand }] = await Promise.all([import("./cli-support-BlSsqyx7.mjs"), import("./setup-github-actions-emXSyGy3.mjs")]);
48
+ const [{ getMetaDir }, { runSetupGithubActionsCommand }] = await Promise.all([import("./cli-support-OrWuIzI3.mjs"), import("./setup-github-actions-emXSyGy3.mjs")]);
49
49
  await runSetupGithubActionsCommand(process.cwd(), getMetaDir());
50
50
  });
51
51
  cli.command("help [command]", "Display help for a command").action((commandName) => {
@@ -1,5 +1,5 @@
1
1
  import { o as resolveDepDir, r as getDeps, s as toPosixPath } from "./utils-mdb4i6VA.mjs";
2
- import { n as scanIntentPackageAtRoot, t as scanForIntents } from "./scanner-DwYsjXzI.mjs";
2
+ import { n as scanIntentPackageAtRoot, t as scanForIntents } from "./scanner-BaOA18pn.mjs";
3
3
  import { o as resolveWorkspacePackages } from "./workspace-patterns-BZLEaMcS.mjs";
4
4
  import { i as parseSkillUse, n as formatSkillUse } from "./skill-use-umYvZl94.mjs";
5
5
  import { t as resolveProjectContext } from "./project-context-Dx6XIJJo.mjs";
package/dist/core.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import "./utils-mdb4i6VA.mjs";
2
2
  import "./skill-paths-DNOHrvL5.mjs";
3
- import "./scanner-DwYsjXzI.mjs";
3
+ import "./scanner-BaOA18pn.mjs";
4
4
  import "./workspace-patterns-BZLEaMcS.mjs";
5
5
  import "./project-context-Dx6XIJJo.mjs";
6
6
  import "./resolver-CP0S8UjZ.mjs";
7
- import { i as resolveIntentSkill, n as listIntentSkills, r as loadIntentSkill, t as IntentCoreError } from "./core-baYs6H7Z.mjs";
7
+ import { i as resolveIntentSkill, n as listIntentSkills, r as loadIntentSkill, t as IntentCoreError } from "./core-0H8zUKIh.mjs";
8
8
 
9
9
  export { IntentCoreError, listIntentSkills, loadIntentSkill, resolveIntentSkill };
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import { a as parseFrontmatter, n as findSkillFiles, o as resolveDepDir, r as getDeps } from "./utils-mdb4i6VA.mjs";
2
2
  import "./skill-paths-DNOHrvL5.mjs";
3
- import { t as scanForIntents } from "./scanner-DwYsjXzI.mjs";
3
+ import { t as scanForIntents } from "./scanner-BaOA18pn.mjs";
4
4
  import "./workspace-patterns-BZLEaMcS.mjs";
5
5
  import { t as readIntentArtifacts } from "./artifact-coverage-DgWuVqUp.mjs";
6
- import { n as checkStaleness } from "./staleness-CFr3W-RI.mjs";
6
+ import { n as checkStaleness } from "./staleness-V-nwqFUh.mjs";
7
7
  import { n as collectStaleReviewItems, r as createFailedStaleReviewItem, t as buildStaleReviewBody } from "./workflow-review-CwcR2ge4.mjs";
8
8
  import { i as parseSkillUse, n as formatSkillUse, r as isSkillUseParseError, t as SkillUseParseError } from "./skill-use-umYvZl94.mjs";
9
9
  import "./project-context-Dx6XIJJo.mjs";
@@ -1,6 +1,6 @@
1
1
  import { i as parseSkillUse, n as formatSkillUse } from "./skill-use-umYvZl94.mjs";
2
2
  import { t as fail } from "./cli-error-BrMXlbtx.mjs";
3
- import { c as scanOptionsFromGlobalFlags, l as printWarnings } from "./cli-support-BON5hn4L.mjs";
3
+ import { c as scanOptionsFromGlobalFlags, l as printWarnings } from "./cli-support-Dmpj1iyQ.mjs";
4
4
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
5
5
  import { dirname, join, relative } from "node:path";
6
6
  import { parse } from "yaml";
@@ -1,7 +1,7 @@
1
1
  import "./utils-mdb4i6VA.mjs";
2
2
  import "./workspace-patterns-BZLEaMcS.mjs";
3
3
  import "./project-context-Dx6XIJJo.mjs";
4
- import "./cli-support-BON5hn4L.mjs";
5
- import { n as runInstallCommand, t as INSTALL_PROMPT } from "./install-BPWtaOuo.mjs";
4
+ import "./cli-support-Dmpj1iyQ.mjs";
5
+ import { n as runInstallCommand, t as INSTALL_PROMPT } from "./install-7BAmUZFB.mjs";
6
6
 
7
7
  export { INSTALL_PROMPT, runInstallCommand };
@@ -4,8 +4,8 @@ import "./skill-paths-DNOHrvL5.mjs";
4
4
  import "./workspace-patterns-BZLEaMcS.mjs";
5
5
  import "./project-context-Dx6XIJJo.mjs";
6
6
  import { n as printSkillTree, r as printTable, t as computeSkillNameWidth } from "./display-CVeoAwBd.mjs";
7
- import "./cli-support-BON5hn4L.mjs";
8
- import { t as INSTALL_PROMPT } from "./install-BPWtaOuo.mjs";
7
+ import "./cli-support-Dmpj1iyQ.mjs";
8
+ import { t as INSTALL_PROMPT } from "./install-7BAmUZFB.mjs";
9
9
  import { t as scanLibrary } from "./library-scanner-CHepLJQJ.mjs";
10
10
 
11
11
  //#region src/intent-library.ts
@@ -1,11 +1,11 @@
1
1
  import "./utils-mdb4i6VA.mjs";
2
2
  import "./skill-paths-DNOHrvL5.mjs";
3
- import "./scanner-DwYsjXzI.mjs";
3
+ import "./scanner-BaOA18pn.mjs";
4
4
  import "./workspace-patterns-BZLEaMcS.mjs";
5
5
  import "./project-context-Dx6XIJJo.mjs";
6
6
  import "./resolver-CP0S8UjZ.mjs";
7
- import { a as printDebugInfo, l as printWarnings, n as coreOptionsFromGlobalFlags } from "./cli-support-BON5hn4L.mjs";
8
- import { n as listIntentSkills } from "./core-baYs6H7Z.mjs";
7
+ import { a as printDebugInfo, l as printWarnings, n as coreOptionsFromGlobalFlags } from "./cli-support-Dmpj1iyQ.mjs";
8
+ import { n as listIntentSkills } from "./core-0H8zUKIh.mjs";
9
9
 
10
10
  //#region src/commands/list.ts
11
11
  function printListDebug(result) {
@@ -1,12 +1,12 @@
1
1
  import "./utils-mdb4i6VA.mjs";
2
2
  import "./skill-paths-DNOHrvL5.mjs";
3
- import "./scanner-DwYsjXzI.mjs";
3
+ import "./scanner-BaOA18pn.mjs";
4
4
  import "./workspace-patterns-BZLEaMcS.mjs";
5
5
  import "./project-context-Dx6XIJJo.mjs";
6
6
  import "./resolver-CP0S8UjZ.mjs";
7
7
  import { t as fail } from "./cli-error-BrMXlbtx.mjs";
8
- import { a as printDebugInfo, n as coreOptionsFromGlobalFlags } from "./cli-support-BON5hn4L.mjs";
9
- import { i as resolveIntentSkill, r as loadIntentSkill, t as IntentCoreError } from "./core-baYs6H7Z.mjs";
8
+ import { a as printDebugInfo, n as coreOptionsFromGlobalFlags } from "./cli-support-Dmpj1iyQ.mjs";
9
+ import { i as resolveIntentSkill, r as loadIntentSkill, t as IntentCoreError } from "./core-0H8zUKIh.mjs";
10
10
 
11
11
  //#region src/commands/load.ts
12
12
  function printLoadDebug(loaded) {
@@ -4,6 +4,7 @@ import { a as readWorkspacePatterns, o as resolveWorkspacePackages, r as findWor
4
4
  import { createRequire } from "node:module";
5
5
  import { existsSync, readFileSync, readdirSync } from "node:fs";
6
6
  import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
7
+ import semver from "semver";
7
8
 
8
9
  //#region src/discovery/register.ts
9
10
  function isLocalToProject(dirPath, projectRoot) {
@@ -325,49 +326,20 @@ function topoSort(packages) {
325
326
  function getPackageDepth(packageRoot, projectRoot) {
326
327
  return relative(projectRoot, packageRoot).split(sep).length;
327
328
  }
328
- function parseSemver(version) {
329
- const match = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/.exec(version);
330
- if (!match) return null;
331
- const prerelease = match[4] ? match[4].split(".").map((identifier) => {
332
- return /^\d+$/.test(identifier) ? Number(identifier) : identifier;
333
- }) : [];
334
- return {
335
- major: Number(match[1]),
336
- minor: Number(match[2]),
337
- patch: Number(match[3]),
338
- prerelease
339
- };
340
- }
341
- function comparePrereleaseIdentifiers(a, b) {
342
- if (a === void 0) return b === void 0 ? 0 : 1;
343
- if (b === void 0) return -1;
344
- if (typeof a === "number" && typeof b === "number") return a - b;
345
- if (typeof a === "number") return -1;
346
- if (typeof b === "number") return 1;
347
- return a.localeCompare(b);
329
+ function normalizeVersion(version) {
330
+ const validVersion = semver.valid(version);
331
+ if (validVersion) return validVersion;
332
+ return semver.coerce(version)?.version ?? null;
348
333
  }
349
334
  function comparePackageVersions(a, b) {
350
- const parsedA = parseSemver(a);
351
- const parsedB = parseSemver(b);
352
- if (!parsedA || !parsedB) {
353
- if (parsedA) return 1;
354
- if (parsedB) return -1;
335
+ const versionA = normalizeVersion(a);
336
+ const versionB = normalizeVersion(b);
337
+ if (!versionA || !versionB) {
338
+ if (versionA) return 1;
339
+ if (versionB) return -1;
355
340
  return 0;
356
341
  }
357
- for (const key of [
358
- "major",
359
- "minor",
360
- "patch"
361
- ]) {
362
- const diff = parsedA[key] - parsedB[key];
363
- if (diff !== 0) return diff;
364
- }
365
- const length = Math.max(parsedA.prerelease.length, parsedB.prerelease.length);
366
- for (let i = 0; i < length; i++) {
367
- const diff = comparePrereleaseIdentifiers(parsedA.prerelease[i], parsedB.prerelease[i]);
368
- if (diff !== 0) return diff;
369
- }
370
- return 0;
342
+ return semver.compare(versionA, versionB);
371
343
  }
372
344
  function formatVariantWarning(name, variants, chosen) {
373
345
  const uniqueVersions = new Set(variants.map((variant) => variant.version));
@@ -1,6 +1,6 @@
1
1
  import "./utils-mdb4i6VA.mjs";
2
2
  import "./skill-paths-DNOHrvL5.mjs";
3
- import { n as scanIntentPackageAtRoot, t as scanForIntents } from "./scanner-DwYsjXzI.mjs";
3
+ import { n as scanIntentPackageAtRoot, t as scanForIntents } from "./scanner-BaOA18pn.mjs";
4
4
  import "./workspace-patterns-BZLEaMcS.mjs";
5
5
 
6
6
  export { scanForIntents };
@@ -1,5 +1,5 @@
1
1
  import "./utils-mdb4i6VA.mjs";
2
2
  import "./artifact-coverage-DgWuVqUp.mjs";
3
- import { n as checkStaleness, r as readPackageName, t as buildWorkspaceCoverageSignals } from "./staleness-CFr3W-RI.mjs";
3
+ import { n as checkStaleness, r as readPackageName, t as buildWorkspaceCoverageSignals } from "./staleness-V-nwqFUh.mjs";
4
4
 
5
5
  export { buildWorkspaceCoverageSignals, checkStaleness, readPackageName };
@@ -1,17 +1,34 @@
1
- import { a as parseFrontmatter, n as findSkillFiles } from "./utils-mdb4i6VA.mjs";
1
+ import { a as parseFrontmatter, n as findSkillFiles, s as toPosixPath } from "./utils-mdb4i6VA.mjs";
2
2
  import { t as readIntentArtifacts } from "./artifact-coverage-DgWuVqUp.mjs";
3
3
  import { existsSync, readFileSync } from "node:fs";
4
- import { isAbsolute, join, relative, resolve, sep } from "node:path";
4
+ import { isAbsolute, join, relative, resolve } from "node:path";
5
+ import semver from "semver";
5
6
 
6
7
  //#region src/staleness.ts
7
8
  function classifyVersionDrift(oldVer, newVer) {
8
- if (oldVer === newVer) return null;
9
- const oldParts = oldVer.replace(/[^0-9.]/g, "").split(".").map(Number);
10
- const newParts = newVer.replace(/[^0-9.]/g, "").split(".").map(Number);
11
- if ((newParts[0] ?? 0) > (oldParts[0] ?? 0)) return "major";
12
- if ((newParts[1] ?? 0) > (oldParts[1] ?? 0)) return "minor";
13
- if ((newParts[2] ?? 0) > (oldParts[2] ?? 0)) return "patch";
14
- return null;
9
+ const oldVersion = normalizeVersion(oldVer);
10
+ const newVersion = normalizeVersion(newVer);
11
+ if (!oldVersion || !newVersion) return null;
12
+ if (semver.eq(oldVersion, newVersion)) return null;
13
+ if (!semver.gt(newVersion, oldVersion)) return null;
14
+ const oldParsed = semver.parse(oldVersion);
15
+ const newParsed = semver.parse(newVersion);
16
+ if (oldParsed && newParsed && oldParsed.major === newParsed.major && oldParsed.minor === newParsed.minor && oldParsed.patch === newParsed.patch && oldParsed.prerelease.length > 0) return "patch";
17
+ switch (semver.diff(oldVersion, newVersion)) {
18
+ case "major":
19
+ case "premajor": return "major";
20
+ case "minor":
21
+ case "preminor": return "minor";
22
+ case "patch":
23
+ case "prepatch":
24
+ case "prerelease": return "patch";
25
+ default: return null;
26
+ }
27
+ }
28
+ function normalizeVersion(version) {
29
+ const validVersion = semver.valid(version);
30
+ if (validVersion) return validVersion;
31
+ return semver.coerce(version)?.version ?? null;
15
32
  }
16
33
  function readLocalVersion(packageDir) {
17
34
  try {
@@ -75,7 +92,10 @@ function readPackageJson(packageDir) {
75
92
  }
76
93
  }
77
94
  function normalizeFilePath(path) {
78
- return resolve(path).split(sep).join("/");
95
+ return toPosixPath(resolve(path));
96
+ }
97
+ function getRelativePackageDir(artifactRoot, packageDir) {
98
+ return toPosixPath(relative(artifactRoot, packageDir));
79
99
  }
80
100
  function normalizeList(values) {
81
101
  return [...new Set(values ?? [])].sort((a, b) => a.localeCompare(b));
@@ -86,7 +106,7 @@ function sameStringList(a, b) {
86
106
  return left.length === right.length && left.every((value, index) => value === right[index]);
87
107
  }
88
108
  function artifactPackageMatches(artifact, packageDir, packageName, artifactRoot) {
89
- const relPackageDir = relative(artifactRoot, packageDir).split(sep).join("/");
109
+ const relPackageDir = getRelativePackageDir(artifactRoot, packageDir);
90
110
  if (!relPackageDir) return true;
91
111
  if (artifact.packages.includes(packageName)) return true;
92
112
  if (artifact.packages.includes(relPackageDir)) return true;
@@ -163,11 +183,11 @@ function buildArtifactSignals({ artifactRoot, artifacts, library, packageDir, sk
163
183
  return signals;
164
184
  }
165
185
  function artifactCoversPackage(artifact, packageDir, packageName, artifactRoot) {
166
- const relPackageDir = relative(artifactRoot, packageDir).split(sep).join("/");
186
+ const relPackageDir = getRelativePackageDir(artifactRoot, packageDir);
167
187
  return artifact.packages.includes(packageName) || artifact.packages.includes(relPackageDir) || artifact.package === packageName || artifact.package === relPackageDir || artifact.path?.startsWith(`${relPackageDir}/`) === true;
168
188
  }
169
189
  function artifactIgnoresPackage(artifacts, packageDir, packageName, artifactRoot) {
170
- const relPackageDir = relative(artifactRoot, packageDir).split(sep).join("/");
190
+ const relPackageDir = getRelativePackageDir(artifactRoot, packageDir);
171
191
  return artifacts.ignoredPackages.some((ignored) => ignored.packageName === packageName || ignored.packageName === relPackageDir);
172
192
  }
173
193
  function buildWorkspaceCoverageSignals({ artifactRoot, artifacts, packageDirs }) {
@@ -187,17 +207,17 @@ function buildWorkspaceCoverageSignals({ artifactRoot, artifacts, packageDirs })
187
207
  reasons: ["workspace package is not represented by generated skills or _artifacts coverage"],
188
208
  needsReview: true,
189
209
  packageName,
190
- packageRoot: relative(artifactRoot, packageDir).split(sep).join("/")
210
+ packageRoot: getRelativePackageDir(artifactRoot, packageDir)
191
211
  });
192
212
  }
193
213
  return signals;
194
214
  }
195
215
  async function checkStaleness(packageDir, packageName, artifactRoot = packageDir) {
196
216
  const skillsDir = join(packageDir, "skills");
197
- const library = packageName ?? "unknown";
217
+ const library = packageName ?? readPackageName(packageDir);
198
218
  const skillMetas = findSkillFiles(skillsDir).map((filePath) => {
199
219
  const fm = parseFrontmatter(filePath);
200
- const relName = relative(skillsDir, filePath).replace(/[/\\]SKILL\.md$/, "").split(sep).join("/");
220
+ const relName = toPosixPath(relative(skillsDir, filePath)).replace(/[/\\]SKILL\.md$/, "");
201
221
  return {
202
222
  name: typeof fm?.name === "string" ? fm.name : relName,
203
223
  relName,
@@ -218,7 +238,7 @@ async function checkStaleness(packageDir, packageName, artifactRoot = packageDir
218
238
  versionDrift,
219
239
  skills: skillMetas.map((skill) => {
220
240
  const reasons = [];
221
- if (currentVersion && skill.libraryVersion && skill.libraryVersion !== currentVersion) reasons.push(`version drift (${skill.libraryVersion} → ${currentVersion})`);
241
+ if (currentVersion && skill.libraryVersion && classifyVersionDrift(skill.libraryVersion, currentVersion) !== null) reasons.push(`version drift (${skill.libraryVersion} → ${currentVersion})`);
222
242
  const storedShas = syncState?.skills?.[skill.name]?.sources_sha ?? {};
223
243
  if (skill.sources && Object.keys(storedShas).length > 0) {
224
244
  for (const source of skill.sources) if (!storedShas[source]) reasons.push(`new source (${source})`);
@@ -2,7 +2,7 @@ import "./utils-mdb4i6VA.mjs";
2
2
  import { n as findWorkspacePackages } from "./workspace-patterns-BZLEaMcS.mjs";
3
3
  import { t as resolveProjectContext } from "./project-context-Dx6XIJJo.mjs";
4
4
  import { n as isCliFailure, t as fail } from "./cli-error-BrMXlbtx.mjs";
5
- import { l as printWarnings } from "./cli-support-BON5hn4L.mjs";
5
+ import { l as printWarnings } from "./cli-support-Dmpj1iyQ.mjs";
6
6
  import { appendFileSync, existsSync, readFileSync } from "node:fs";
7
7
  import { basename, dirname, join, relative, resolve, sep } from "node:path";
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/intent",
3
- "version": "0.0.38",
3
+ "version": "0.0.39",
4
4
  "description": "Ship compositional knowledge for AI coding agents alongside your npm packages",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -33,9 +33,11 @@
33
33
  "dependencies": {
34
34
  "cac": "^6.7.14",
35
35
  "jsonc-parser": "^3.3.1",
36
+ "semver": "^7.7.4",
36
37
  "yaml": "2.8.3"
37
38
  },
38
39
  "devDependencies": {
40
+ "@types/semver": "^7.7.1",
39
41
  "@verdaccio/node-api": "6.0.0-6-next.76",
40
42
  "tsdown": "^0.19.0",
41
43
  "verdaccio": "^6.3.2"