@tanstack/intent 0.0.39 → 0.0.41

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-CbZALe7Q.mjs +3 -0
  2. package/dist/{cli-support-Dmpj1iyQ.mjs → cli-support-BHoEb9y1.mjs} +6 -6
  3. package/dist/{cli-support-OrWuIzI3.mjs → cli-support-BxF1HIpw.mjs} +4 -4
  4. package/dist/cli.mjs +11 -11
  5. package/dist/command-runner-DJTliSTc.mjs +16 -0
  6. package/dist/{core-0H8zUKIh.mjs → core-DEiRgUqe.mjs} +50 -34
  7. package/dist/core.d.mts +5 -1
  8. package/dist/core.mjs +7 -7
  9. package/dist/{display-CVeoAwBd.mjs → display-BPM-AJGc.mjs} +12 -2
  10. package/dist/display-lWCJg5Bo.mjs +5 -0
  11. package/dist/index.d.mts +2 -2
  12. package/dist/index.mjs +11 -11
  13. package/dist/{install-7BAmUZFB.mjs → install-DCiBBx55.mjs} +14 -10
  14. package/dist/install-EVdqAy8f.mjs +7 -0
  15. package/dist/intent-library.mjs +8 -8
  16. package/dist/{library-scanner-CHepLJQJ.mjs → library-scanner-BpEuR__1.mjs} +2 -2
  17. package/dist/library-scanner.d.mts +1 -1
  18. package/dist/library-scanner.mjs +3 -3
  19. package/dist/{list-DNPHxYpR.mjs → list-CpOcnLWv.mjs} +19 -11
  20. package/dist/{load-CK7vr50h.mjs → load-BxmN8f0E.mjs} +12 -10
  21. package/dist/{meta-CYV9EzM8.mjs → meta-Dstclm2x.mjs} +2 -2
  22. package/dist/package-manager-DDZck142.mjs +48 -0
  23. package/dist/{project-context-Dx6XIJJo.mjs → project-context-D4mFnCs7.mjs} +1 -1
  24. package/dist/{resolver-CP0S8UjZ.mjs → resolver-B36uOK8c.mjs} +3 -3
  25. package/dist/{scanner-BaOA18pn.mjs → scanner-B6nnctK4.mjs} +139 -89
  26. package/dist/scanner-BWd4mS25.mjs +6 -0
  27. package/dist/{setup-kvWN4xCr.mjs → setup-J4A9UfBB.mjs} +2 -2
  28. package/dist/setup.d.mts +1 -1
  29. package/dist/setup.mjs +4 -4
  30. package/dist/{skill-paths-DNOHrvL5.mjs → skill-paths-4kQXfQXo.mjs} +1 -1
  31. package/dist/{stale-flPZnWfI.mjs → stale-BD77r7KR.mjs} +1 -1
  32. package/dist/{staleness-V-nwqFUh.mjs → staleness-DChVhbCN.mjs} +2 -2
  33. package/dist/staleness-Dm4laJFc.mjs +5 -0
  34. package/dist/{types-S2zpibHp.d.mts → types-DU_Z0qNT.d.mts} +8 -2
  35. package/dist/{utils-mdb4i6VA.mjs → utils-Chn-30vI.mjs} +70 -4
  36. package/dist/utils-Ctlz_JG-.mjs +3 -0
  37. package/dist/{validate-BYUd0qb8.mjs → validate-CTSG3eDc.mjs} +6 -6
  38. package/dist/{workflow-review-CIdJXmKP.mjs → workflow-review-DcFipeG0.mjs} +1 -1
  39. package/dist/{workspace-patterns-BZLEaMcS.mjs → workspace-patterns-C5O4Dfpl.mjs} +1 -1
  40. package/dist/{workspace-patterns-BWMz7TsI.mjs → workspace-patterns-CA-UGM5C.mjs} +2 -2
  41. package/package.json +1 -1
  42. package/dist/artifact-coverage-DA26utB1.mjs +0 -3
  43. package/dist/display-COlw5FaB.mjs +0 -5
  44. package/dist/install-Brf5PORN.mjs +0 -7
  45. package/dist/scanner-BoB20xOF.mjs +0 -6
  46. package/dist/staleness-IIyVmUxU.mjs +0 -5
  47. package/dist/utils-BHzSyNeJ.mjs +0 -3
  48. /package/dist/{artifact-coverage-DgWuVqUp.mjs → artifact-coverage-Cqphhpfo.mjs} +0 -0
  49. /package/dist/{cli-error-BrMXlbtx.mjs → cli-error-DOO5bLIG.mjs} +0 -0
  50. /package/dist/{edit-package-json-CzWlMXOf.mjs → edit-package-json-cPClxVZZ.mjs} +0 -0
  51. /package/dist/{scaffold-D2vwv9ls.mjs → scaffold-CaShIIUY.mjs} +0 -0
  52. /package/dist/{setup-2SE9zYJk.d.mts → setup-DL7qX_F-.d.mts} +0 -0
  53. /package/dist/{setup-github-actions-emXSyGy3.mjs → setup-github-actions-zzLUbyAL.mjs} +0 -0
  54. /package/dist/{skill-use-umYvZl94.mjs → skill-use-C0q2MEEX.mjs} +0 -0
  55. /package/dist/{workflow-review-CwcR2ge4.mjs → workflow-review--Gc_yplP.mjs} +0 -0
@@ -6,7 +6,7 @@ interface IntentConfig {
6
6
  requires?: Array<string>;
7
7
  }
8
8
  interface ScanResult {
9
- packageManager: 'npm' | 'pnpm' | 'yarn' | 'bun' | 'unknown';
9
+ packageManager: PackageManager;
10
10
  packages: Array<IntentPackage>;
11
11
  warnings: Array<string>;
12
12
  conflicts: Array<VersionConflict>;
@@ -14,12 +14,18 @@ interface ScanResult {
14
14
  local: NodeModulesScanTarget;
15
15
  global: NodeModulesScanTarget;
16
16
  };
17
+ stats?: ScanStats;
17
18
  }
19
+ type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun' | 'unknown';
18
20
  type ScanScope = 'local' | 'local-and-global' | 'global';
19
21
  interface ScanOptions {
20
22
  includeGlobal?: boolean;
21
23
  scope?: ScanScope;
22
24
  }
25
+ interface ScanStats {
26
+ packageJsonReadCount: number;
27
+ packageJsonCacheHits: number;
28
+ }
23
29
  interface NodeModulesScanTarget {
24
30
  path: string | null;
25
31
  detected: boolean;
@@ -143,4 +149,4 @@ interface IntentProjectConfig {
143
149
  };
144
150
  }
145
151
  //#endregion
146
- export { SkillStaleness as _, IntentArtifactSet as a, VersionConflict as b, IntentConfig as c, MetaFeedbackPayload as d, MetaSkillName as f, SkillEntry as g, ScanScope as h, IntentArtifactFile as i, IntentPackage as l, ScanResult as m, FeedbackPayload as n, IntentArtifactSkill as o, ScanOptions as p, IntentArtifactCoverageIgnore as r, IntentArtifactWarning as s, AgentName as t, IntentProjectConfig as u, StalenessReport as v, StalenessSignal as y };
152
+ export { VersionConflict as S, ScanStats as _, IntentArtifactSet as a, StalenessReport as b, IntentConfig as c, MetaFeedbackPayload as d, MetaSkillName as f, ScanScope as g, ScanResult as h, IntentArtifactFile as i, IntentPackage as l, ScanOptions as m, FeedbackPayload as n, IntentArtifactSkill as o, PackageManager as p, IntentArtifactCoverageIgnore as r, IntentArtifactWarning as s, AgentName as t, IntentProjectConfig as u, SkillEntry as v, StalenessSignal as x, SkillStaleness as y };
@@ -1,6 +1,6 @@
1
1
  import { createRequire } from "node:module";
2
- import { existsSync, readFileSync, readdirSync } from "node:fs";
3
- import { dirname, join, sep } from "node:path";
2
+ import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync } from "node:fs";
3
+ import { dirname, join, resolve, sep } from "node:path";
4
4
  import { execFileSync } from "node:child_process";
5
5
  import { parse } from "yaml";
6
6
 
@@ -11,13 +11,38 @@ import { parse } from "yaml";
11
11
  function toPosixPath(p) {
12
12
  return p.split(sep).join("/");
13
13
  }
14
+ function createFsIdentityCache() {
15
+ const cache = /* @__PURE__ */ new Map();
16
+ return (path) => {
17
+ const resolved = resolve(path);
18
+ const cached = cache.get(resolved);
19
+ if (cached) return cached;
20
+ let identity;
21
+ try {
22
+ identity = lstatSync(resolved).isSymbolicLink() ? realpathSync(resolved) : resolved;
23
+ } catch {
24
+ identity = resolved;
25
+ }
26
+ cache.set(resolved, identity);
27
+ return identity;
28
+ };
29
+ }
14
30
  /**
15
31
  * Recursively find all SKILL.md files under a directory.
16
32
  */
17
33
  function findSkillFiles(dir) {
18
34
  const files = [];
19
35
  if (!existsSync(dir)) return files;
20
- for (const entry of readdirSync(dir, { withFileTypes: true })) {
36
+ let entries;
37
+ try {
38
+ entries = readdirSync(dir, {
39
+ withFileTypes: true,
40
+ encoding: "utf8"
41
+ });
42
+ } catch {
43
+ return files;
44
+ }
45
+ for (const entry of entries) {
21
46
  const fullPath = join(dir, entry.name);
22
47
  if (entry.isDirectory()) files.push(...findSkillFiles(fullPath));
23
48
  else if (entry.name === "SKILL.md") files.push(fullPath);
@@ -74,6 +99,47 @@ function listNodeModulesPackageDirs(nodeModulesDir) {
74
99
  }
75
100
  return packageDirs;
76
101
  }
102
+ function listNestedNodeModulesPackageDirs(nodeModulesDir, getFsIdentity = createFsIdentityCache()) {
103
+ const packageDirs = [];
104
+ const visitedNodeModulesDirs = /* @__PURE__ */ new Set();
105
+ const visitedPackageDirs = /* @__PURE__ */ new Set();
106
+ function readDir(dir) {
107
+ try {
108
+ return readdirSync(dir, {
109
+ withFileTypes: true,
110
+ encoding: "utf8"
111
+ });
112
+ } catch {
113
+ return [];
114
+ }
115
+ }
116
+ function addPackageDir(packageDir) {
117
+ const key = getFsIdentity(packageDir);
118
+ if (visitedPackageDirs.has(key)) return;
119
+ visitedPackageDirs.add(key);
120
+ if (existsSync(join(packageDir, "package.json"))) packageDirs.push(packageDir);
121
+ scanNodeModulesDir(join(packageDir, "node_modules"));
122
+ }
123
+ function scanNodeModulesDir(dir) {
124
+ const key = getFsIdentity(dir);
125
+ if (visitedNodeModulesDirs.has(key)) return;
126
+ visitedNodeModulesDirs.add(key);
127
+ for (const entry of readDir(dir)) {
128
+ if (!entry.isDirectory() && !entry.isSymbolicLink()) continue;
129
+ const dirPath = join(dir, entry.name);
130
+ if (entry.name.startsWith("@")) {
131
+ for (const scoped of readDir(dirPath)) {
132
+ if (!scoped.isDirectory() && !scoped.isSymbolicLink()) continue;
133
+ addPackageDir(join(dirPath, scoped.name));
134
+ }
135
+ continue;
136
+ }
137
+ if (!entry.name.startsWith(".")) addPackageDir(dirPath);
138
+ }
139
+ }
140
+ scanNodeModulesDir(nodeModulesDir);
141
+ return packageDirs;
142
+ }
77
143
  function detectGlobalNodeModules(packageManager) {
78
144
  const envPath = process.env.INTENT_GLOBAL_NODE_MODULES?.trim();
79
145
  if (envPath) return {
@@ -155,4 +221,4 @@ function parseFrontmatter(filePath) {
155
221
  }
156
222
 
157
223
  //#endregion
158
- export { parseFrontmatter as a, listNodeModulesPackageDirs as i, findSkillFiles as n, resolveDepDir as o, getDeps as r, toPosixPath as s, detectGlobalNodeModules as t };
224
+ export { listNestedNodeModulesPackageDirs as a, resolveDepDir as c, getDeps as i, toPosixPath as l, detectGlobalNodeModules as n, listNodeModulesPackageDirs as o, findSkillFiles as r, parseFrontmatter as s, createFsIdentityCache as t };
@@ -0,0 +1,3 @@
1
+ import { a as listNestedNodeModulesPackageDirs, c as resolveDepDir, i as getDeps, l as toPosixPath, n as detectGlobalNodeModules, o as listNodeModulesPackageDirs, r as findSkillFiles, s as parseFrontmatter, t as createFsIdentityCache } from "./utils-Chn-30vI.mjs";
2
+
3
+ export { createFsIdentityCache, detectGlobalNodeModules, findSkillFiles, getDeps, listNestedNodeModulesPackageDirs, listNodeModulesPackageDirs, parseFrontmatter, resolveDepDir, toPosixPath };
@@ -1,8 +1,8 @@
1
- import "./utils-mdb4i6VA.mjs";
2
- import { n as findWorkspacePackages } from "./workspace-patterns-BZLEaMcS.mjs";
3
- import { t as resolveProjectContext } from "./project-context-Dx6XIJJo.mjs";
4
- import { n as isCliFailure, t as fail } from "./cli-error-BrMXlbtx.mjs";
5
- import { l as printWarnings } from "./cli-support-Dmpj1iyQ.mjs";
1
+ import "./utils-Chn-30vI.mjs";
2
+ import { n as findWorkspacePackages } from "./workspace-patterns-C5O4Dfpl.mjs";
3
+ import { t as resolveProjectContext } from "./project-context-D4mFnCs7.mjs";
4
+ import { n as isCliFailure, t as fail } from "./cli-error-DOO5bLIG.mjs";
5
+ import { l as printWarnings } from "./cli-support-BHoEb9y1.mjs";
6
6
  import { appendFileSync, existsSync, readFileSync } from "node:fs";
7
7
  import { basename, dirname, join, relative, resolve, sep } from "node:path";
8
8
 
@@ -115,7 +115,7 @@ async function runValidateCommand(dir, options = {}) {
115
115
  }
116
116
  }
117
117
  async function runValidateCommandInternal(dir) {
118
- const [{ parse: parseYaml }, { findSkillFiles }] = await Promise.all([import("yaml"), import("./utils-BHzSyNeJ.mjs")]);
118
+ const [{ parse: parseYaml }, { findSkillFiles }] = await Promise.all([import("yaml"), import("./utils-Ctlz_JG-.mjs")]);
119
119
  const context = resolveProjectContext({
120
120
  cwd: process.cwd(),
121
121
  targetPath: dir
@@ -1,3 +1,3 @@
1
- import { a as writeStaleReviewWorkflowFiles, i as createWorkflowAdvisoryReviewItems, n as collectStaleReviewItems, r as createFailedStaleReviewItem, t as buildStaleReviewBody } from "./workflow-review-CwcR2ge4.mjs";
1
+ import { a as writeStaleReviewWorkflowFiles, i as createWorkflowAdvisoryReviewItems, n as collectStaleReviewItems, r as createFailedStaleReviewItem, t as buildStaleReviewBody } from "./workflow-review--Gc_yplP.mjs";
2
2
 
3
3
  export { collectStaleReviewItems, createFailedStaleReviewItem, createWorkflowAdvisoryReviewItems, writeStaleReviewWorkflowFiles };
@@ -1,4 +1,4 @@
1
- import { n as findSkillFiles } from "./utils-mdb4i6VA.mjs";
1
+ import { r as findSkillFiles } from "./utils-Chn-30vI.mjs";
2
2
  import { existsSync, readFileSync, readdirSync } from "node:fs";
3
3
  import { dirname, join } from "node:path";
4
4
  import { parse } from "yaml";
@@ -1,4 +1,4 @@
1
- import "./utils-mdb4i6VA.mjs";
2
- import { a as readWorkspacePatterns, i as getWorkspaceInfo, n as findWorkspacePackages, o as resolveWorkspacePackages, r as findWorkspaceRoot, t as findPackagesWithSkills } from "./workspace-patterns-BZLEaMcS.mjs";
1
+ import "./utils-Chn-30vI.mjs";
2
+ import { a as readWorkspacePatterns, i as getWorkspaceInfo, n as findWorkspacePackages, o as resolveWorkspacePackages, r as findWorkspaceRoot, t as findPackagesWithSkills } from "./workspace-patterns-C5O4Dfpl.mjs";
3
3
 
4
4
  export { findWorkspaceRoot, getWorkspaceInfo };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/intent",
3
- "version": "0.0.39",
3
+ "version": "0.0.41",
4
4
  "description": "Ship compositional knowledge for AI coding agents alongside your npm packages",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,3 +0,0 @@
1
- import { t as readIntentArtifacts } from "./artifact-coverage-DgWuVqUp.mjs";
2
-
3
- export { readIntentArtifacts };
@@ -1,5 +0,0 @@
1
- import "./utils-mdb4i6VA.mjs";
2
- import "./skill-paths-DNOHrvL5.mjs";
3
- import { n as printSkillTree, r as printTable, t as computeSkillNameWidth } from "./display-CVeoAwBd.mjs";
4
-
5
- export { computeSkillNameWidth, printSkillTree, printTable };
@@ -1,7 +0,0 @@
1
- import "./utils-mdb4i6VA.mjs";
2
- import "./workspace-patterns-BZLEaMcS.mjs";
3
- import "./project-context-Dx6XIJJo.mjs";
4
- import "./cli-support-Dmpj1iyQ.mjs";
5
- import { n as runInstallCommand, t as INSTALL_PROMPT } from "./install-7BAmUZFB.mjs";
6
-
7
- export { INSTALL_PROMPT, runInstallCommand };
@@ -1,6 +0,0 @@
1
- import "./utils-mdb4i6VA.mjs";
2
- import "./skill-paths-DNOHrvL5.mjs";
3
- import { n as scanIntentPackageAtRoot, t as scanForIntents } from "./scanner-BaOA18pn.mjs";
4
- import "./workspace-patterns-BZLEaMcS.mjs";
5
-
6
- export { scanForIntents };
@@ -1,5 +0,0 @@
1
- import "./utils-mdb4i6VA.mjs";
2
- import "./artifact-coverage-DgWuVqUp.mjs";
3
- import { n as checkStaleness, r as readPackageName, t as buildWorkspaceCoverageSignals } from "./staleness-V-nwqFUh.mjs";
4
-
5
- export { buildWorkspaceCoverageSignals, checkStaleness, readPackageName };
@@ -1,3 +0,0 @@
1
- import { a as parseFrontmatter, i as listNodeModulesPackageDirs, n as findSkillFiles, o as resolveDepDir, r as getDeps, s as toPosixPath, t as detectGlobalNodeModules } from "./utils-mdb4i6VA.mjs";
2
-
3
- export { detectGlobalNodeModules, findSkillFiles, getDeps, listNodeModulesPackageDirs, parseFrontmatter, resolveDepDir, toPosixPath };