@tanstack/intent 0.0.40 → 0.0.42

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 (49) hide show
  1. package/dist/{cli-support-Cb9lNXhL.mjs → cli-support-B26oUGbf.mjs} +4 -4
  2. package/dist/{cli-support-DtqVDiJv.mjs → cli-support-C-t4xQw0.mjs} +4 -4
  3. package/dist/cli.d.mts +2 -1
  4. package/dist/cli.mjs +20 -16
  5. package/dist/command-runner-C0yCOHLi.mjs +16 -0
  6. package/dist/{core-BOSjgetf.mjs → core-CEeo37aT.mjs} +26 -23
  7. package/dist/core.d.mts +2 -1
  8. package/dist/core.mjs +7 -7
  9. package/dist/{display-DHNuzSqR.mjs → display-BdSvrwWJ.mjs} +14 -3
  10. package/dist/index.d.mts +2 -2
  11. package/dist/index.mjs +9 -9
  12. package/dist/{install-CLkmoPOY.mjs → install-t4jkDdD0.mjs} +16 -9
  13. package/dist/{list-CxSm8YYl.mjs → list-DQxqa1AT.mjs} +16 -10
  14. package/dist/{load-DF-zIT3-.mjs → load-3ACx3170.mjs} +8 -8
  15. package/dist/{meta-BNSVXFQu.mjs → meta-DZgsju5x.mjs} +1 -1
  16. package/dist/package-manager-BUgTjW9Q.mjs +48 -0
  17. package/dist/{project-context-Bv9BDh8B.mjs → project-context-4wzbLY9c.mjs} +6 -5
  18. package/dist/{resolver-BDsZ3kWg.mjs → resolver-D8sX72Lg.mjs} +5 -6
  19. package/dist/scanner-BK8rIEA3.mjs +6 -0
  20. package/dist/{scanner-BGyQTQ3U.mjs → scanner-QujEINYm.mjs} +44 -44
  21. package/dist/{setup-DQMKxEoA.mjs → setup-BElEzHxS.mjs} +2 -2
  22. package/dist/setup.d.mts +1 -1
  23. package/dist/setup.mjs +4 -4
  24. package/dist/{skill-paths-BHbdWniB.mjs → skill-paths-Cc0-Y331.mjs} +1 -1
  25. package/dist/{stale-flPZnWfI.mjs → stale-C6dPKQ98.mjs} +1 -1
  26. package/dist/{staleness-CGLs-swr.mjs → staleness-BwcLygsY.mjs} +1 -1
  27. package/dist/{staleness-Dl-m8JWM.mjs → staleness-Dd1kWwCz.mjs} +2 -2
  28. package/dist/{types-Cq5cY9h9.d.mts → types-CIha6LtJ.d.mts} +3 -2
  29. package/dist/{utils-BPDvfmcd.mjs → utils-CF7OL__5.mjs} +64 -7
  30. package/dist/utils-DTvYXAsM.mjs +3 -0
  31. package/dist/{validate-Divq4AiV.mjs → validate-D0n-rBpp.mjs} +5 -5
  32. package/dist/{workflow-review-CIdJXmKP.mjs → workflow-review-CrWkP7Hc.mjs} +1 -1
  33. package/dist/{workflow-review-CwcR2ge4.mjs → workflow-review-D9Fg1G0P.mjs} +15 -15
  34. package/dist/{workspace-patterns-Diy5gtz_.mjs → workspace-patterns-CnGMcicG.mjs} +2 -2
  35. package/dist/{workspace-patterns-CIJQCwbJ.mjs → workspace-patterns-FljtM2Xb.mjs} +7 -8
  36. package/package.json +3 -8
  37. package/dist/display-CmLzVAae.mjs +0 -5
  38. package/dist/install-ChddjnhO.mjs +0 -7
  39. package/dist/intent-library.d.mts +0 -1
  40. package/dist/intent-library.mjs +0 -84
  41. package/dist/library-scanner-BAJ7bXtW.mjs +0 -116
  42. package/dist/library-scanner.d.mts +0 -16
  43. package/dist/library-scanner.mjs +0 -5
  44. package/dist/scanner-Ix6MmxfB.mjs +0 -6
  45. package/dist/utils-DqdIC3RY.mjs +0 -3
  46. /package/dist/{edit-package-json-CzWlMXOf.mjs → edit-package-json-CtuelQ_q.mjs} +0 -0
  47. /package/dist/{scaffold-D2vwv9ls.mjs → scaffold-CLM6bt3c.mjs} +0 -0
  48. /package/dist/{setup-2SE9zYJk.d.mts → setup-DhMqESd3.d.mts} +0 -0
  49. /package/dist/{setup-github-actions-emXSyGy3.mjs → setup-github-actions-CUd1oncY.mjs} +0 -0
@@ -1,84 +0,0 @@
1
- #!/usr/bin/env node
2
- import "./utils-BPDvfmcd.mjs";
3
- import "./skill-paths-BHbdWniB.mjs";
4
- import "./workspace-patterns-CIJQCwbJ.mjs";
5
- import "./project-context-Bv9BDh8B.mjs";
6
- import { n as printSkillTree, r as printTable, t as computeSkillNameWidth } from "./display-DHNuzSqR.mjs";
7
- import "./cli-support-DtqVDiJv.mjs";
8
- import { t as INSTALL_PROMPT } from "./install-CLkmoPOY.mjs";
9
- import { t as scanLibrary } from "./library-scanner-BAJ7bXtW.mjs";
10
-
11
- //#region src/intent-library.ts
12
- function cmdList() {
13
- let result;
14
- try {
15
- result = scanLibrary(process.argv[1], process.cwd());
16
- } catch (err) {
17
- console.error(err.message);
18
- process.exit(1);
19
- }
20
- if (result.packages.length === 0) {
21
- console.log("No intent-enabled packages found.");
22
- if (result.warnings.length > 0) {
23
- console.log("\nWarnings:");
24
- for (const w of result.warnings) console.log(` ⚠ ${w}`);
25
- }
26
- return;
27
- }
28
- const totalSkills = result.packages.reduce((sum, p) => sum + p.skills.length, 0);
29
- console.log(`\n${result.packages.length} intent-enabled packages, ${totalSkills} skills\n`);
30
- printTable([
31
- "PACKAGE",
32
- "VERSION",
33
- "SKILLS"
34
- ], result.packages.map((pkg) => [
35
- pkg.name,
36
- pkg.version,
37
- String(pkg.skills.length)
38
- ]));
39
- const nameWidth = computeSkillNameWidth(result.packages.map((p) => p.skills));
40
- const showTypes = result.packages.some((p) => p.skills.some((s) => s.type));
41
- console.log(`\nSkills:\n`);
42
- for (const pkg of result.packages) {
43
- console.log(` ${pkg.name}`);
44
- printSkillTree(pkg.skills, {
45
- nameWidth,
46
- packageName: pkg.name,
47
- showTypes
48
- });
49
- console.log();
50
- }
51
- console.log(`Feedback:`);
52
- console.log(` Submit feedback on skill usage to help maintainers improve the skills.`);
53
- console.log(` Load: node_modules/@tanstack/intent/meta/feedback-collection/SKILL.md`);
54
- console.log();
55
- if (result.warnings.length > 0) {
56
- console.log(`Warnings:`);
57
- for (const w of result.warnings) console.log(` ⚠ ${w}`);
58
- }
59
- }
60
- function cmdInstall() {
61
- console.log(INSTALL_PROMPT);
62
- }
63
- const USAGE = `TanStack Intent
64
-
65
- Usage:
66
- intent list List all available skills from this library and its dependencies
67
- intent install Print a skill that guides your coding agent to scan the project
68
- and set up skill loading guidance in your agent config`;
69
- const command = process.argv[2];
70
- switch (command) {
71
- case "list":
72
- case void 0:
73
- cmdList();
74
- break;
75
- case "install":
76
- cmdInstall();
77
- break;
78
- default:
79
- console.log(USAGE);
80
- process.exit(command ? 1 : 0);
81
- }
82
-
83
- //#endregion
84
- export { };
@@ -1,116 +0,0 @@
1
- import { a as parseFrontmatter, o as resolveDepDir, r as getDeps, s as toPosixPath } from "./utils-BPDvfmcd.mjs";
2
- import { r as rewriteSkillLoadPaths } from "./skill-paths-BHbdWniB.mjs";
3
- import { existsSync, readFileSync, readdirSync } from "node:fs";
4
- import { dirname, join, relative } from "node:path";
5
-
6
- //#region src/library-scanner.ts
7
- function readPkgJson(dir) {
8
- try {
9
- return JSON.parse(readFileSync(join(dir, "package.json"), "utf8"));
10
- } catch {
11
- return null;
12
- }
13
- }
14
- function findHomeDir(scriptPath) {
15
- let dir = dirname(scriptPath);
16
- for (;;) {
17
- if (existsSync(join(dir, "package.json"))) return dir;
18
- const parent = dirname(dir);
19
- if (parent === dir) return null;
20
- dir = parent;
21
- }
22
- }
23
- function isIntentPackage(pkg) {
24
- const keywords = pkg.keywords;
25
- if (Array.isArray(keywords) && keywords.includes("tanstack-intent")) return true;
26
- const bin = pkg.bin;
27
- if (bin && typeof bin === "object" && "intent" in bin) return true;
28
- return false;
29
- }
30
- function discoverSkills(skillsDir) {
31
- const skills = [];
32
- function walk(dir) {
33
- let entries;
34
- try {
35
- entries = readdirSync(dir, {
36
- withFileTypes: true,
37
- encoding: "utf8"
38
- });
39
- } catch {
40
- return;
41
- }
42
- for (const entry of entries) {
43
- if (!entry.isDirectory()) continue;
44
- const childDir = join(dir, entry.name);
45
- const skillFile = join(childDir, "SKILL.md");
46
- if (existsSync(skillFile)) {
47
- const fm = parseFrontmatter(skillFile);
48
- const relName = toPosixPath(relative(skillsDir, childDir));
49
- skills.push({
50
- name: typeof fm?.name === "string" ? fm.name : relName,
51
- path: skillFile,
52
- description: typeof fm?.description === "string" ? fm.description.replace(/\s+/g, " ").trim() : "",
53
- type: typeof fm?.type === "string" ? fm.type : void 0,
54
- framework: typeof fm?.framework === "string" ? fm.framework : void 0
55
- });
56
- }
57
- walk(childDir);
58
- }
59
- }
60
- walk(skillsDir);
61
- return skills;
62
- }
63
- function scanLibrary(scriptPath, projectRoot) {
64
- const packages = [];
65
- const warnings = [];
66
- const visited = /* @__PURE__ */ new Set();
67
- const homeDir = findHomeDir(scriptPath);
68
- if (!homeDir) return {
69
- packages,
70
- warnings: ["Could not determine home package directory"]
71
- };
72
- const homePkg = readPkgJson(homeDir);
73
- if (!homePkg) return {
74
- packages,
75
- warnings: ["Could not read home package.json"]
76
- };
77
- const homeName = typeof homePkg.name === "string" ? homePkg.name : "";
78
- const scanRoot = projectRoot ?? homeDir;
79
- function processPackage(name, dir) {
80
- if (visited.has(name)) return;
81
- visited.add(name);
82
- const pkg = readPkgJson(dir);
83
- if (!pkg) {
84
- warnings.push(`Could not read package.json for ${name}`);
85
- return;
86
- }
87
- const skillsDir = join(dir, "skills");
88
- const skills = existsSync(skillsDir) ? discoverSkills(skillsDir) : [];
89
- rewriteSkillLoadPaths({
90
- packageName: name,
91
- packageRoot: dir,
92
- projectRoot: scanRoot,
93
- skills
94
- });
95
- packages.push({
96
- name,
97
- version: typeof pkg.version === "string" ? pkg.version : "0.0.0",
98
- description: typeof pkg.description === "string" ? pkg.description : "",
99
- skills
100
- });
101
- for (const depName of getDeps(pkg)) {
102
- const depDir = resolveDepDir(depName, dir);
103
- if (!depDir) continue;
104
- const depPkg = readPkgJson(depDir);
105
- if (depPkg && isIntentPackage(depPkg)) processPackage(depName, depDir);
106
- }
107
- }
108
- processPackage(homeName, homeDir);
109
- return {
110
- packages,
111
- warnings
112
- };
113
- }
114
-
115
- //#endregion
116
- export { scanLibrary as t };
@@ -1,16 +0,0 @@
1
- import { _ as SkillEntry } from "./types-Cq5cY9h9.mjs";
2
-
3
- //#region src/library-scanner.d.ts
4
- interface LibraryPackage {
5
- name: string;
6
- version: string;
7
- description: string;
8
- skills: Array<SkillEntry>;
9
- }
10
- interface LibraryScanResult {
11
- packages: Array<LibraryPackage>;
12
- warnings: Array<string>;
13
- }
14
- declare function scanLibrary(scriptPath: string, projectRoot?: string): LibraryScanResult;
15
- //#endregion
16
- export { LibraryPackage, LibraryScanResult, scanLibrary };
@@ -1,5 +0,0 @@
1
- import "./utils-BPDvfmcd.mjs";
2
- import "./skill-paths-BHbdWniB.mjs";
3
- import { t as scanLibrary } from "./library-scanner-BAJ7bXtW.mjs";
4
-
5
- export { scanLibrary };
@@ -1,6 +0,0 @@
1
- import "./utils-BPDvfmcd.mjs";
2
- import "./skill-paths-BHbdWniB.mjs";
3
- import { n as scanIntentPackageAtRoot, t as scanForIntents } from "./scanner-BGyQTQ3U.mjs";
4
- import "./workspace-patterns-CIJQCwbJ.mjs";
5
-
6
- export { scanForIntents };
@@ -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-BPDvfmcd.mjs";
2
-
3
- export { detectGlobalNodeModules, findSkillFiles, getDeps, listNodeModulesPackageDirs, parseFrontmatter, resolveDepDir, toPosixPath };