@tanstack/intent 0.0.41 → 0.0.43

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 (55) hide show
  1. package/dist/artifact-coverage-DA26utB1.mjs +3 -0
  2. package/dist/{cli-support-BxF1HIpw.mjs → cli-support-DV41R1Re.mjs} +4 -4
  3. package/dist/{cli-support-BHoEb9y1.mjs → cli-support-DzDBzS3-.mjs} +6 -6
  4. package/dist/cli.d.mts +2 -1
  5. package/dist/cli.mjs +21 -17
  6. package/dist/{core-DEiRgUqe.mjs → core-C7hpf0Tt.mjs} +20 -18
  7. package/dist/core.d.mts +1 -1
  8. package/dist/core.mjs +7 -7
  9. package/dist/{display-BPM-AJGc.mjs → display-0FnzlKRq.mjs} +3 -2
  10. package/dist/index.d.mts +42 -23
  11. package/dist/index.mjs +11 -11
  12. package/dist/{install-DCiBBx55.mjs → install-BW__b6st.mjs} +9 -6
  13. package/dist/{list-CpOcnLWv.mjs → list-DQvWxgPM.mjs} +10 -10
  14. package/dist/{load-BxmN8f0E.mjs → load-D5MM8OW9.mjs} +9 -9
  15. package/dist/{meta-Dstclm2x.mjs → meta-BEJIfnPG.mjs} +2 -2
  16. package/dist/{project-context-D4mFnCs7.mjs → project-context-BRIMzhi4.mjs} +6 -5
  17. package/dist/{resolver-B36uOK8c.mjs → resolver-D9cjsz11.mjs} +6 -7
  18. package/dist/{scanner-B6nnctK4.mjs → scanner-D3tAqvbj.mjs} +54 -26
  19. package/dist/scanner-DNM8orwt.mjs +6 -0
  20. package/dist/{setup-J4A9UfBB.mjs → setup-BklJkH_6.mjs} +2 -2
  21. package/dist/setup.d.mts +1 -1
  22. package/dist/setup.mjs +4 -4
  23. package/dist/{skill-paths-4kQXfQXo.mjs → skill-paths-B-j0dWDA.mjs} +1 -1
  24. package/dist/{stale-BD77r7KR.mjs → stale-C6dPKQ98.mjs} +1 -1
  25. package/dist/{staleness-DChVhbCN.mjs → staleness-BGFfic-Y.mjs} +2 -2
  26. package/dist/staleness-CB3qpVCq.mjs +5 -0
  27. package/dist/{utils-Chn-30vI.mjs → utils-9fhWAVua.mjs} +80 -22
  28. package/dist/utils-CSPzvaFu.mjs +3 -0
  29. package/dist/{validate-CTSG3eDc.mjs → validate-CZ65_6Li.mjs} +6 -6
  30. package/dist/{workflow-review-DcFipeG0.mjs → workflow-review-CrWkP7Hc.mjs} +1 -1
  31. package/dist/{workflow-review--Gc_yplP.mjs → workflow-review-D9Fg1G0P.mjs} +15 -15
  32. package/dist/{workspace-patterns-C5O4Dfpl.mjs → workspace-patterns-BffPlZ1D.mjs} +7 -8
  33. package/dist/{workspace-patterns-CA-UGM5C.mjs → workspace-patterns-Bjq_cXww.mjs} +2 -2
  34. package/package.json +3 -8
  35. package/dist/artifact-coverage-CbZALe7Q.mjs +0 -3
  36. package/dist/display-lWCJg5Bo.mjs +0 -5
  37. package/dist/install-EVdqAy8f.mjs +0 -7
  38. package/dist/intent-library.d.mts +0 -1
  39. package/dist/intent-library.mjs +0 -84
  40. package/dist/library-scanner-BpEuR__1.mjs +0 -116
  41. package/dist/library-scanner.d.mts +0 -16
  42. package/dist/library-scanner.mjs +0 -5
  43. package/dist/scanner-BWd4mS25.mjs +0 -6
  44. package/dist/staleness-Dm4laJFc.mjs +0 -5
  45. package/dist/utils-Ctlz_JG-.mjs +0 -3
  46. /package/dist/{artifact-coverage-Cqphhpfo.mjs → artifact-coverage-DgWuVqUp.mjs} +0 -0
  47. /package/dist/{cli-error-DOO5bLIG.mjs → cli-error-BrMXlbtx.mjs} +0 -0
  48. /package/dist/{command-runner-DJTliSTc.mjs → command-runner-C0yCOHLi.mjs} +0 -0
  49. /package/dist/{edit-package-json-cPClxVZZ.mjs → edit-package-json-CtuelQ_q.mjs} +0 -0
  50. /package/dist/{package-manager-DDZck142.mjs → package-manager-BUgTjW9Q.mjs} +0 -0
  51. /package/dist/{scaffold-CaShIIUY.mjs → scaffold-CLM6bt3c.mjs} +0 -0
  52. /package/dist/{setup-DL7qX_F-.d.mts → setup-DhMqESd3.d.mts} +0 -0
  53. /package/dist/{setup-github-actions-zzLUbyAL.mjs → setup-github-actions-CUd1oncY.mjs} +0 -0
  54. /package/dist/{skill-use-C0q2MEEX.mjs → skill-use-umYvZl94.mjs} +0 -0
  55. /package/dist/{types-DU_Z0qNT.d.mts → types-CIha6LtJ.d.mts} +0 -0
@@ -0,0 +1,3 @@
1
+ import { t as readIntentArtifacts } from "./artifact-coverage-DgWuVqUp.mjs";
2
+
3
+ export { readIntentArtifacts };
@@ -1,6 +1,6 @@
1
- import "./utils-Chn-30vI.mjs";
2
- import "./workspace-patterns-C5O4Dfpl.mjs";
3
- import "./project-context-D4mFnCs7.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-BHoEb9y1.mjs";
1
+ import "./utils-9fhWAVua.mjs";
2
+ import "./workspace-patterns-BffPlZ1D.mjs";
3
+ import "./project-context-BRIMzhi4.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-DzDBzS3-.mjs";
5
5
 
6
6
  export { INTENT_CHECK_SKILLS_WORKFLOW_VERSION, coreOptionsFromGlobalFlags, getCheckSkillsWorkflowAdvisories, getMetaDir, printDebugInfo, printWarnings, resolveStaleTargets, scanIntentsOrFail, scanOptionsFromGlobalFlags };
@@ -1,5 +1,5 @@
1
- import { t as resolveProjectContext } from "./project-context-D4mFnCs7.mjs";
2
- import { t as fail } from "./cli-error-DOO5bLIG.mjs";
1
+ import { t as resolveProjectContext } from "./project-context-BRIMzhi4.mjs";
2
+ import { t as fail } from "./cli-error-BrMXlbtx.mjs";
3
3
  import { existsSync, readFileSync } from "node:fs";
4
4
  import { dirname, join, relative, resolve } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
@@ -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-BWd4mS25.mjs");
34
+ const { scanForIntents } = await import("./scanner-DNM8orwt.mjs");
35
35
  try {
36
36
  return scanForIntents(void 0, options);
37
37
  } catch (err) {
@@ -68,18 +68,18 @@ 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-Dm4laJFc.mjs");
71
+ const { buildWorkspaceCoverageSignals, checkStaleness, readPackageName } = await import("./staleness-CB3qpVCq.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)],
75
75
  workflowAdvisories
76
76
  };
77
- const { findWorkspaceRoot, getWorkspaceInfo } = await import("./workspace-patterns-CA-UGM5C.mjs");
77
+ const { findWorkspaceRoot, getWorkspaceInfo } = await import("./workspace-patterns-Bjq_cXww.mjs");
78
78
  const workspaceRoot = findWorkspaceRoot(resolvedRoot);
79
79
  const workspaceInfo = workspaceRoot ? getWorkspaceInfo(workspaceRoot) : null;
80
80
  if (workspaceInfo) {
81
81
  const reports = await Promise.all(workspaceInfo.packageDirsWithSkills.map((packageDir) => checkStaleness(packageDir, readPackageName(packageDir), workspaceInfo.root)));
82
- const { readIntentArtifacts } = await import("./artifact-coverage-CbZALe7Q.mjs");
82
+ const { readIntentArtifacts } = await import("./artifact-coverage-DA26utB1.mjs");
83
83
  const artifacts = existsSync(join(workspaceInfo.root, "_artifacts")) ? readIntentArtifacts(workspaceInfo.root) : null;
84
84
  const coverageSignals = buildWorkspaceCoverageSignals({
85
85
  artifactRoot: workspaceInfo.root,
package/dist/cli.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  //#region src/cli.d.ts
3
3
  declare function main(argv?: Array<string>): Promise<number>;
4
+ declare function isMainModule(metaUrl: string, argvPath: string | undefined, realpath?: (path: string) => string): boolean;
4
5
  //#endregion
5
- export { main };
6
+ export { isMainModule, main };
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as isCliFailure, t as fail } from "./cli-error-DOO5bLIG.mjs";
2
+ import { n as isCliFailure, t as fail } from "./cli-error-BrMXlbtx.mjs";
3
3
  import { realpathSync } from "node:fs";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { cac } from "cac";
@@ -9,43 +9,43 @@ 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-CpOcnLWv.mjs");
12
+ const { runListCommand } = await import("./list-DQvWxgPM.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-BxmN8f0E.mjs");
16
+ const { runLoadCommand } = await import("./load-D5MM8OW9.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-BxF1HIpw.mjs"), import("./meta-Dstclm2x.mjs")]);
20
+ const [{ getMetaDir }, { runMetaCommand }] = await Promise.all([import("./cli-support-DV41R1Re.mjs"), import("./meta-BEJIfnPG.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-CTSG3eDc.mjs");
24
+ const { runValidateCommand } = await import("./validate-CZ65_6Li.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-BxF1HIpw.mjs"), import("./install-EVdqAy8f.mjs")]);
28
+ const [{ scanIntentsOrFail }, { runInstallCommand }] = await Promise.all([import("./cli-support-DV41R1Re.mjs"), import("./install-BW__b6st.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-BxF1HIpw.mjs"), import("./scaffold-CaShIIUY.mjs")]);
32
+ const [{ getMetaDir }, { runScaffoldCommand }] = await Promise.all([import("./cli-support-DV41R1Re.mjs"), import("./scaffold-CLM6bt3c.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-BxF1HIpw.mjs"), import("./stale-BD77r7KR.mjs")]);
36
+ const [{ resolveStaleTargets }, { runStaleCommand }] = await Promise.all([import("./cli-support-DV41R1Re.mjs"), import("./stale-C6dPKQ98.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 () => {
40
- const { runEditPackageJsonCommand } = await import("./edit-package-json-cPClxVZZ.mjs");
40
+ const { runEditPackageJsonCommand } = await import("./edit-package-json-CtuelQ_q.mjs");
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-BxF1HIpw.mjs"), import("./setup-github-actions-zzLUbyAL.mjs")]);
44
+ const [{ getMetaDir }, { runSetupGithubActionsCommand }] = await Promise.all([import("./cli-support-DV41R1Re.mjs"), import("./setup-github-actions-CUd1oncY.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-BxF1HIpw.mjs"), import("./setup-github-actions-zzLUbyAL.mjs")]);
48
+ const [{ getMetaDir }, { runSetupGithubActionsCommand }] = await Promise.all([import("./cli-support-DV41R1Re.mjs"), import("./setup-github-actions-CUd1oncY.mjs")]);
49
49
  await runSetupGithubActionsCommand(process.cwd(), getMetaDir());
50
50
  });
51
51
  cli.command("help [command]", "Display help for a command").action((commandName) => {
@@ -91,14 +91,18 @@ async function main(argv = process.argv.slice(2)) {
91
91
  throw err;
92
92
  }
93
93
  }
94
- let isMain = false;
95
- try {
96
- isMain = process.argv[1] !== void 0 && fileURLToPath(import.meta.url) === realpathSync(process.argv[1]);
97
- } catch {}
98
- if (isMain) {
94
+ function isMainModule(metaUrl, argvPath, realpath = realpathSync) {
95
+ if (argvPath === void 0) return false;
96
+ try {
97
+ return fileURLToPath(metaUrl) === realpath(argvPath);
98
+ } catch {
99
+ return false;
100
+ }
101
+ }
102
+ if (isMainModule(import.meta.url, process.argv[1])) {
99
103
  const exitCode = await main();
100
104
  process.exit(exitCode);
101
105
  }
102
106
 
103
107
  //#endregion
104
- export { main };
108
+ export { isMainModule, main };
@@ -1,10 +1,10 @@
1
- import { c as resolveDepDir, i as getDeps, l as toPosixPath } from "./utils-Chn-30vI.mjs";
2
- import { n as scanIntentPackageAtRoot, r as createIntentFsCache, t as scanForIntents } from "./scanner-B6nnctK4.mjs";
3
- import { n as findWorkspacePackages } from "./workspace-patterns-C5O4Dfpl.mjs";
4
- import { i as parseSkillUse, n as formatSkillUse } from "./skill-use-C0q2MEEX.mjs";
5
- import { t as resolveProjectContext } from "./project-context-D4mFnCs7.mjs";
6
- import { a as compileExcludePatterns, c as warningMentionsPackage, i as resolveSkillUse, o as getEffectiveExcludePatterns, r as resolveSkillEntry, s as isPackageExcluded, t as ResolveSkillUseError } from "./resolver-B36uOK8c.mjs";
7
- import { existsSync, readFileSync, realpathSync } from "node:fs";
1
+ import { i as getDeps, l as resolveDepDir, u as toPosixPath } from "./utils-9fhWAVua.mjs";
2
+ import { n as scanIntentPackageAtRoot, r as createIntentFsCache, t as scanForIntents } from "./scanner-D3tAqvbj.mjs";
3
+ import { n as findWorkspacePackages } from "./workspace-patterns-BffPlZ1D.mjs";
4
+ import { i as parseSkillUse, n as formatSkillUse } from "./skill-use-umYvZl94.mjs";
5
+ import { t as resolveProjectContext } from "./project-context-BRIMzhi4.mjs";
6
+ import { a as compileExcludePatterns, c as warningMentionsPackage, i as resolveSkillUse, o as getEffectiveExcludePatterns, r as resolveSkillEntry, s as isPackageExcluded, t as ResolveSkillUseError } from "./resolver-D9cjsz11.mjs";
7
+ import { existsSync } from "node:fs";
8
8
  import { dirname, isAbsolute, join, relative, resolve } from "node:path";
9
9
 
10
10
  //#region src/core/markdown.ts
@@ -239,13 +239,14 @@ function addCandidateDir(candidates, seen, dir) {
239
239
  }
240
240
  function findVisibleDependencyDir(packageName, fromDir) {
241
241
  let dir = fromDir;
242
- while (true) {
242
+ let prev;
243
+ while (dir !== prev) {
243
244
  const candidate = join(dir, "node_modules", packageName);
244
245
  if (existsSync(join(candidate, "package.json"))) return candidate;
245
- const next = dirname(dir);
246
- if (next === dir) return null;
247
- dir = next;
246
+ prev = dir;
247
+ dir = dirname(dir);
248
248
  }
249
+ return null;
249
250
  }
250
251
  function resolveDependencyPackageDir(packageName, fromDir) {
251
252
  return findVisibleDependencyDir(packageName, fromDir) ?? resolveDepDir(packageName, fromDir);
@@ -266,7 +267,7 @@ function getDirectLoadFastPathCandidateDirs(packageName, context, cwd) {
266
267
  addCandidateDir(candidates, seen, resolveDependencyPackageDir(packageName, context.packageRoot ?? cwd));
267
268
  return candidates;
268
269
  }
269
- addCandidateDir(candidates, seen, resolveDependencyPackageDir(packageName, context.packageRoot ?? context.workspaceRoot ?? cwd));
270
+ addCandidateDir(candidates, seen, resolveDependencyPackageDir(packageName, context.packageRoot ?? context.workspaceRoot));
270
271
  if (context.workspaceRoot && context.workspaceRoot !== context.packageRoot) addCandidateDir(candidates, seen, resolveDependencyPackageDir(packageName, context.workspaceRoot));
271
272
  return candidates;
272
273
  }
@@ -410,14 +411,14 @@ function isResolvedPathInsidePackageRoot(path, packageRoot) {
410
411
  const relativePath = relative(packageRoot, path);
411
412
  return relativePath === "" || !relativePath.startsWith("..") && !isAbsolute(relativePath);
412
413
  }
413
- function toResolvedIntentSkill(cwd, use, resolved, debug) {
414
+ function toResolvedIntentSkill(cwd, use, resolved, readFs, debug) {
414
415
  let realResolvedPath;
415
416
  try {
416
- realResolvedPath = realpathSync.native(resolveFromCwd(cwd, resolved.path));
417
+ realResolvedPath = readFs.realpathSync.native(resolveFromCwd(cwd, resolved.path));
417
418
  } catch {
418
419
  throw new IntentCoreError("skill-file-not-found", `Resolved skill file was not found: ${resolved.path}`);
419
420
  }
420
- const realPackageRoot = realpathSync.native(resolveFromCwd(cwd, resolved.packageRoot));
421
+ const realPackageRoot = readFs.realpathSync.native(resolveFromCwd(cwd, resolved.packageRoot));
421
422
  if (!isResolvedPathInsidePackageRoot(realResolvedPath, realPackageRoot)) throw new IntentCoreError("skill-path-outside-package", `Resolved skill path for "${use}" is outside package root: ${resolved.path}`);
422
423
  const result = {
423
424
  path: resolved.path,
@@ -433,6 +434,7 @@ function toResolvedIntentSkill(cwd, use, resolved, debug) {
433
434
  return {
434
435
  realPackageRoot,
435
436
  realResolvedPath,
437
+ readFs,
436
438
  result
437
439
  };
438
440
  }
@@ -466,7 +468,7 @@ function resolveIntentSkillInCwd(cwd, use, options = {}) {
466
468
  const scanOptions = toScanOptions(options);
467
469
  const scope = getScanScope(scanOptions);
468
470
  const fastPathResolved = resolveSkillUseFastPath(parsedUse, options, projectContext, cwd, fsCache);
469
- if (fastPathResolved) return toResolvedIntentSkill(cwd, use, fastPathResolved, options.debug ? createLoadedSkillDebug({
471
+ if (fastPathResolved) return toResolvedIntentSkill(cwd, use, fastPathResolved, fsCache.getReadFs(), options.debug ? createLoadedSkillDebug({
470
472
  cwd,
471
473
  excludes: excludePatterns,
472
474
  resolution: "fast-path",
@@ -482,7 +484,7 @@ function resolveIntentSkillInCwd(cwd, use, options = {}) {
482
484
  if (err instanceof ResolveSkillUseError) throw new IntentCoreError(err.code, err.message, { suggestedSkills: err.suggestedSkills });
483
485
  throw err;
484
486
  }
485
- return toResolvedIntentSkill(cwd, use, resolved, options.debug ? createLoadedSkillDebug({
487
+ return toResolvedIntentSkill(cwd, use, resolved, fsCache.getReadFs(), options.debug ? createLoadedSkillDebug({
486
488
  cwd,
487
489
  excludes: excludePatterns,
488
490
  resolution: "full-scan",
@@ -498,7 +500,7 @@ function loadIntentSkill(use, options = {}) {
498
500
  const cwd = resolveCoreCwd(options);
499
501
  const resolved = resolveIntentSkillInCwd(cwd, use, options);
500
502
  const content = rewriteLoadedSkillMarkdownDestinations({
501
- content: readFileSync(resolved.realResolvedPath, "utf8"),
503
+ content: resolved.readFs.readFileSync(resolved.realResolvedPath, "utf8"),
502
504
  cwd,
503
505
  packageRoot: resolved.realPackageRoot,
504
506
  skillFilePath: resolved.realResolvedPath
package/dist/core.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as VersionConflict, _ as ScanStats, g as ScanScope, l as IntentPackage, p as PackageManager } from "./types-DU_Z0qNT.mjs";
1
+ import { S as VersionConflict, _ as ScanStats, g as ScanScope, l as IntentPackage, p as PackageManager } from "./types-CIha6LtJ.mjs";
2
2
 
3
3
  //#region src/core/types.d.ts
4
4
  interface IntentCoreOptions {
package/dist/core.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import "./utils-Chn-30vI.mjs";
2
- import "./skill-paths-4kQXfQXo.mjs";
3
- import "./scanner-B6nnctK4.mjs";
4
- import "./workspace-patterns-C5O4Dfpl.mjs";
5
- import "./project-context-D4mFnCs7.mjs";
6
- import "./resolver-B36uOK8c.mjs";
7
- import { i as resolveIntentSkill, n as listIntentSkills, r as loadIntentSkill, t as IntentCoreError } from "./core-DEiRgUqe.mjs";
1
+ import "./utils-9fhWAVua.mjs";
2
+ import "./skill-paths-B-j0dWDA.mjs";
3
+ import "./scanner-D3tAqvbj.mjs";
4
+ import "./workspace-patterns-BffPlZ1D.mjs";
5
+ import "./project-context-BRIMzhi4.mjs";
6
+ import "./resolver-D9cjsz11.mjs";
7
+ import { i as resolveIntentSkill, n as listIntentSkills, r as loadIntentSkill, t as IntentCoreError } from "./core-C7hpf0Tt.mjs";
8
8
 
9
9
  export { IntentCoreError, listIntentSkills, loadIntentSkill, resolveIntentSkill };
@@ -1,4 +1,5 @@
1
- import { n as isStableLoadPath, t as formatRuntimeSkillLookupHint } from "./skill-paths-4kQXfQXo.mjs";
1
+ import "./utils-9fhWAVua.mjs";
2
+ import { n as isStableLoadPath, t as formatRuntimeSkillLookupHint } from "./skill-paths-B-j0dWDA.mjs";
2
3
 
3
4
  //#region src/display.ts
4
5
  function padColumn(text, width) {
@@ -70,4 +71,4 @@ function computeSkillNameWidth(allPackageSkills) {
70
71
  }
71
72
 
72
73
  //#endregion
73
- export { printSkillTree as n, printTable as r, computeSkillNameWidth as t };
74
+ export { computeSkillNameWidth, printSkillTree, printTable };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,46 @@
1
- import { S as VersionConflict, a as IntentArtifactSet, b as StalenessReport, c as IntentConfig, d as MetaFeedbackPayload, f as MetaSkillName, h as ScanResult, i as IntentArtifactFile, l as IntentPackage, m as ScanOptions, n as FeedbackPayload, o as IntentArtifactSkill, r as IntentArtifactCoverageIgnore, s as IntentArtifactWarning, t as AgentName, u as IntentProjectConfig, v as SkillEntry, x as StalenessSignal, y as SkillStaleness } from "./types-DU_Z0qNT.mjs";
2
- import { i as runEditPackageJson, o as runSetupGithubActions, r as SetupGithubActionsResult, t as EditPackageJsonResult } from "./setup-DL7qX_F-.mjs";
1
+ import { S as VersionConflict, a as IntentArtifactSet, b as StalenessReport, c as IntentConfig, d as MetaFeedbackPayload, f as MetaSkillName, h as ScanResult, i as IntentArtifactFile, l as IntentPackage, m as ScanOptions, n as FeedbackPayload, o as IntentArtifactSkill, r as IntentArtifactCoverageIgnore, s as IntentArtifactWarning, t as AgentName, u as IntentProjectConfig, v as SkillEntry, x as StalenessSignal, y as SkillStaleness } from "./types-CIha6LtJ.mjs";
2
+ import { i as runEditPackageJson, o as runSetupGithubActions, r as SetupGithubActionsResult, t as EditPackageJsonResult } from "./setup-DhMqESd3.mjs";
3
+ import { closeSync, existsSync, lstatSync, openSync, readFileSync, readSync, readdirSync, realpathSync } from "node:fs";
3
4
 
5
+ //#region src/utils.d.ts
6
+
7
+ /**
8
+ * The subset of `node:fs` the scanner reads through. Under Yarn PnP this is
9
+ * swapped for Yarn's libzip-patched `fs` so reads can reach files inside
10
+ * `.yarn/cache/*.zip` (see scanner `loadPnpApi`). The static `node:fs` named
11
+ * imports cannot be used directly for that, because their bindings are captured
12
+ * before Yarn's `setup()` patches the CommonJS `fs` module.
13
+ */
14
+ interface ReadFs {
15
+ existsSync: typeof existsSync;
16
+ lstatSync: typeof lstatSync;
17
+ readFileSync: typeof readFileSync;
18
+ readdirSync: typeof readdirSync;
19
+ realpathSync: typeof realpathSync;
20
+ /**
21
+ * Optional low-level read primitives. When present (always on `node:fs` and
22
+ * Yarn's libzip-patched module) `parseFrontmatter` reads only the leading
23
+ * region of a file instead of its whole body.
24
+ */
25
+ openSync?: typeof openSync;
26
+ readSync?: typeof readSync;
27
+ closeSync?: typeof closeSync;
28
+ }
29
+ /**
30
+ * Recursively find all SKILL.md files under a directory.
31
+ */
32
+ declare function findSkillFiles(dir: string, fs?: ReadFs): Array<string>;
33
+ /**
34
+ * Read dependencies and peerDependencies (and optionally devDependencies) from
35
+ * a parsed package.json object.
36
+ */
37
+ declare function getDeps(pkgJson: Record<string, unknown>, includeDevDeps?: boolean): Array<string>;
38
+ declare function resolveDepDir(depName: string, parentDir: string): string | null;
39
+ /**
40
+ * Parse YAML frontmatter from a file. Returns null if no frontmatter or on error.
41
+ */
42
+ declare function parseFrontmatter(filePath: string, fs?: ReadFs): Record<string, unknown> | null;
43
+ //#endregion
4
44
  //#region src/scanner.d.ts
5
45
  declare function scanForIntents(root?: string, options?: ScanOptions): ScanResult;
6
46
  //#endregion
@@ -52,27 +92,6 @@ declare function submitMetaFeedback(payload: MetaFeedbackPayload, opts: {
52
92
  outputPath?: string;
53
93
  }): SubmitResult;
54
94
  //#endregion
55
- //#region src/utils.d.ts
56
- /**
57
- * Recursively find all SKILL.md files under a directory.
58
- */
59
- declare function findSkillFiles(dir: string): Array<string>;
60
- /**
61
- * Read dependencies and peerDependencies (and optionally devDependencies) from
62
- * a parsed package.json object.
63
- */
64
- declare function getDeps(pkgJson: Record<string, unknown>, includeDevDeps?: boolean): Array<string>;
65
- /**
66
- * Resolve the directory of a dependency by name. Tries createRequire first
67
- * (handles pnpm symlinks), then falls back to walking up node_modules
68
- * directories (handles packages with export maps that block ./package.json).
69
- */
70
- declare function resolveDepDir(depName: string, parentDir: string): string | null;
71
- /**
72
- * Parse YAML frontmatter from a file. Returns null if no frontmatter or on error.
73
- */
74
- declare function parseFrontmatter(filePath: string): Record<string, unknown> | null;
75
- //#endregion
76
95
  //#region src/skill-use.d.ts
77
96
  interface SkillUse {
78
97
  packageName: string;
package/dist/index.mjs CHANGED
@@ -1,14 +1,14 @@
1
- import { c as resolveDepDir, i as getDeps, r as findSkillFiles, s as parseFrontmatter } from "./utils-Chn-30vI.mjs";
2
- import "./skill-paths-4kQXfQXo.mjs";
3
- import { t as scanForIntents } from "./scanner-B6nnctK4.mjs";
4
- import "./workspace-patterns-C5O4Dfpl.mjs";
5
- import { t as readIntentArtifacts } from "./artifact-coverage-Cqphhpfo.mjs";
6
- import { n as checkStaleness } from "./staleness-DChVhbCN.mjs";
7
- import { n as collectStaleReviewItems, r as createFailedStaleReviewItem, t as buildStaleReviewBody } from "./workflow-review--Gc_yplP.mjs";
8
- import { i as parseSkillUse, n as formatSkillUse, r as isSkillUseParseError, t as SkillUseParseError } from "./skill-use-C0q2MEEX.mjs";
9
- import "./project-context-D4mFnCs7.mjs";
10
- import { i as resolveSkillUse, n as isResolveSkillUseError, t as ResolveSkillUseError } from "./resolver-B36uOK8c.mjs";
11
- import { r as runSetupGithubActions, t as runEditPackageJson } from "./setup-J4A9UfBB.mjs";
1
+ import { c as parseFrontmatter, i as getDeps, l as resolveDepDir, r as findSkillFiles } from "./utils-9fhWAVua.mjs";
2
+ import "./skill-paths-B-j0dWDA.mjs";
3
+ import { t as scanForIntents } from "./scanner-D3tAqvbj.mjs";
4
+ import "./workspace-patterns-BffPlZ1D.mjs";
5
+ import { t as readIntentArtifacts } from "./artifact-coverage-DgWuVqUp.mjs";
6
+ import { n as checkStaleness } from "./staleness-BGFfic-Y.mjs";
7
+ import { n as collectStaleReviewItems, r as createFailedStaleReviewItem, t as buildStaleReviewBody } from "./workflow-review-D9Fg1G0P.mjs";
8
+ import { i as parseSkillUse, n as formatSkillUse, r as isSkillUseParseError, t as SkillUseParseError } from "./skill-use-umYvZl94.mjs";
9
+ import "./project-context-BRIMzhi4.mjs";
10
+ import { i as resolveSkillUse, n as isResolveSkillUseError, t as ResolveSkillUseError } from "./resolver-D9cjsz11.mjs";
11
+ import { r as runSetupGithubActions, t as runEditPackageJson } from "./setup-BklJkH_6.mjs";
12
12
  import { readFileSync, writeFileSync } from "node:fs";
13
13
  import { join } from "node:path";
14
14
  import { execFileSync, execSync } from "node:child_process";
@@ -1,8 +1,11 @@
1
- import { t as detectPackageManager } from "./package-manager-DDZck142.mjs";
2
- import { i as parseSkillUse, n as formatSkillUse } from "./skill-use-C0q2MEEX.mjs";
3
- import { t as fail } from "./cli-error-DOO5bLIG.mjs";
4
- import { t as formatIntentCommand } from "./command-runner-DJTliSTc.mjs";
5
- import { c as scanOptionsFromGlobalFlags, l as printWarnings } from "./cli-support-BHoEb9y1.mjs";
1
+ import "./utils-9fhWAVua.mjs";
2
+ import "./workspace-patterns-BffPlZ1D.mjs";
3
+ import { t as detectPackageManager } from "./package-manager-BUgTjW9Q.mjs";
4
+ import { i as parseSkillUse, n as formatSkillUse } from "./skill-use-umYvZl94.mjs";
5
+ import "./project-context-BRIMzhi4.mjs";
6
+ import { t as fail } from "./cli-error-BrMXlbtx.mjs";
7
+ import { c as scanOptionsFromGlobalFlags, l as printWarnings } from "./cli-support-DzDBzS3-.mjs";
8
+ import { t as formatIntentCommand } from "./command-runner-C0yCOHLi.mjs";
6
9
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
7
10
  import { dirname, join, relative } from "node:path";
8
11
  import { parse } from "yaml";
@@ -439,4 +442,4 @@ async function runInstallCommand(options, scanIntentsOrFail) {
439
442
  }
440
443
 
441
444
  //#endregion
442
- export { runInstallCommand as n, INSTALL_PROMPT as t };
445
+ export { INSTALL_PROMPT, runInstallCommand };
@@ -1,12 +1,12 @@
1
- import "./utils-Chn-30vI.mjs";
2
- import "./skill-paths-4kQXfQXo.mjs";
3
- import "./scanner-B6nnctK4.mjs";
4
- import "./workspace-patterns-C5O4Dfpl.mjs";
5
- import "./project-context-D4mFnCs7.mjs";
6
- import "./resolver-B36uOK8c.mjs";
7
- import { t as formatIntentCommand } from "./command-runner-DJTliSTc.mjs";
8
- import { a as printDebugInfo, l as printWarnings, n as coreOptionsFromGlobalFlags } from "./cli-support-BHoEb9y1.mjs";
9
- import { n as listIntentSkills } from "./core-DEiRgUqe.mjs";
1
+ import "./utils-9fhWAVua.mjs";
2
+ import "./skill-paths-B-j0dWDA.mjs";
3
+ import "./scanner-D3tAqvbj.mjs";
4
+ import "./workspace-patterns-BffPlZ1D.mjs";
5
+ import "./project-context-BRIMzhi4.mjs";
6
+ import "./resolver-D9cjsz11.mjs";
7
+ import { n as listIntentSkills } from "./core-C7hpf0Tt.mjs";
8
+ import { a as printDebugInfo, l as printWarnings, n as coreOptionsFromGlobalFlags } from "./cli-support-DzDBzS3-.mjs";
9
+ import { t as formatIntentCommand } from "./command-runner-C0yCOHLi.mjs";
10
10
 
11
11
  //#region src/commands/list.ts
12
12
  function printListDebug(result) {
@@ -59,7 +59,7 @@ async function runListCommand(options, _scanIntentsOrFail) {
59
59
  console.log(JSON.stringify(jsonResult, null, 2));
60
60
  return;
61
61
  }
62
- const { computeSkillNameWidth, printSkillTree, printTable } = await import("./display-lWCJg5Bo.mjs");
62
+ const { computeSkillNameWidth, printSkillTree, printTable } = await import("./display-0FnzlKRq.mjs");
63
63
  if (result.packages.length === 0) {
64
64
  console.log("No intent-enabled packages found.");
65
65
  if (result.warnings.length > 0) {
@@ -1,12 +1,12 @@
1
- import "./utils-Chn-30vI.mjs";
2
- import "./skill-paths-4kQXfQXo.mjs";
3
- import "./scanner-B6nnctK4.mjs";
4
- import "./workspace-patterns-C5O4Dfpl.mjs";
5
- import "./project-context-D4mFnCs7.mjs";
6
- import "./resolver-B36uOK8c.mjs";
7
- import { t as fail } from "./cli-error-DOO5bLIG.mjs";
8
- import { a as printDebugInfo, n as coreOptionsFromGlobalFlags } from "./cli-support-BHoEb9y1.mjs";
9
- import { i as resolveIntentSkill, r as loadIntentSkill, t as IntentCoreError } from "./core-DEiRgUqe.mjs";
1
+ import "./utils-9fhWAVua.mjs";
2
+ import "./skill-paths-B-j0dWDA.mjs";
3
+ import "./scanner-D3tAqvbj.mjs";
4
+ import "./workspace-patterns-BffPlZ1D.mjs";
5
+ import "./project-context-BRIMzhi4.mjs";
6
+ import "./resolver-D9cjsz11.mjs";
7
+ import { t as fail } from "./cli-error-BrMXlbtx.mjs";
8
+ import { i as resolveIntentSkill, r as loadIntentSkill, t as IntentCoreError } from "./core-C7hpf0Tt.mjs";
9
+ import { a as printDebugInfo, n as coreOptionsFromGlobalFlags } from "./cli-support-DzDBzS3-.mjs";
10
10
 
11
11
  //#region src/commands/load.ts
12
12
  function printLoadDebug(loaded) {
@@ -1,4 +1,4 @@
1
- import { t as fail } from "./cli-error-DOO5bLIG.mjs";
1
+ import { t as fail } from "./cli-error-BrMXlbtx.mjs";
2
2
  import { existsSync, readFileSync, readdirSync } from "node:fs";
3
3
  import { join } from "node:path";
4
4
 
@@ -16,7 +16,7 @@ async function runMetaCommand(name, metaDir) {
16
16
  }
17
17
  return;
18
18
  }
19
- const { parseFrontmatter } = await import("./utils-Ctlz_JG-.mjs");
19
+ const { parseFrontmatter } = await import("./utils-CSPzvaFu.mjs");
20
20
  const entries = readdirSync(metaDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).filter((entry) => existsSync(join(metaDir, entry.name, "SKILL.md")));
21
21
  if (entries.length === 0) {
22
22
  console.log("No meta-skills found.");
@@ -1,4 +1,4 @@
1
- import { a as readWorkspacePatterns, r as findWorkspaceRoot } from "./workspace-patterns-C5O4Dfpl.mjs";
1
+ import { a as readWorkspacePatterns, r as findWorkspaceRoot } from "./workspace-patterns-BffPlZ1D.mjs";
2
2
  import { existsSync, statSync } from "node:fs";
3
3
  import { dirname, join, relative, resolve } from "node:path";
4
4
 
@@ -26,12 +26,13 @@ function resolveProjectContext({ cwd, targetPath }) {
26
26
  }
27
27
  function findOwningPackageRoot(startPath) {
28
28
  let dir = toSearchDir(startPath);
29
- while (true) {
29
+ let prev;
30
+ while (dir !== prev) {
30
31
  if (existsSync(join(dir, "package.json"))) return dir;
31
- const next = dirname(dir);
32
- if (next === dir) return null;
33
- dir = next;
32
+ prev = dir;
33
+ dir = dirname(dir);
34
34
  }
35
+ return null;
35
36
  }
36
37
  function toSearchDir(path) {
37
38
  if (!existsSync(path)) return path;
@@ -1,5 +1,5 @@
1
- import { i as parseSkillUse } from "./skill-use-C0q2MEEX.mjs";
2
- import { t as resolveProjectContext } from "./project-context-D4mFnCs7.mjs";
1
+ import { i as parseSkillUse } from "./skill-use-umYvZl94.mjs";
2
+ import { t as resolveProjectContext } from "./project-context-BRIMzhi4.mjs";
3
3
  import { readFileSync } from "node:fs";
4
4
  import { dirname, isAbsolute, join, relative, resolve } from "node:path";
5
5
 
@@ -73,15 +73,14 @@ function isPackageExcluded(packageName, matchers) {
73
73
  return matchers.some((matcher) => matcher.matches(packageName));
74
74
  }
75
75
  function warningMentionsPackage(warning, packageName) {
76
- let fromIndex = 0;
77
- while (true) {
78
- const idx = warning.indexOf(packageName, fromIndex);
79
- if (idx === -1) return false;
76
+ let idx = warning.indexOf(packageName);
77
+ while (idx !== -1) {
80
78
  const before = warning[idx - 1];
81
79
  const after = warning[idx + packageName.length];
82
80
  if ((before === void 0 || PACKAGE_NAME_BOUNDARY.test(before)) && (after === void 0 || PACKAGE_NAME_BOUNDARY.test(after))) return true;
83
- fromIndex = idx + packageName.length;
81
+ idx = warning.indexOf(packageName, idx + packageName.length);
84
82
  }
83
+ return false;
85
84
  }
86
85
 
87
86
  //#endregion