@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.
- package/dist/artifact-coverage-DA26utB1.mjs +3 -0
- package/dist/{cli-support-BxF1HIpw.mjs → cli-support-DV41R1Re.mjs} +4 -4
- package/dist/{cli-support-BHoEb9y1.mjs → cli-support-DzDBzS3-.mjs} +6 -6
- package/dist/cli.d.mts +2 -1
- package/dist/cli.mjs +21 -17
- package/dist/{core-DEiRgUqe.mjs → core-C7hpf0Tt.mjs} +20 -18
- package/dist/core.d.mts +1 -1
- package/dist/core.mjs +7 -7
- package/dist/{display-BPM-AJGc.mjs → display-0FnzlKRq.mjs} +3 -2
- package/dist/index.d.mts +42 -23
- package/dist/index.mjs +11 -11
- package/dist/{install-DCiBBx55.mjs → install-BW__b6st.mjs} +9 -6
- package/dist/{list-CpOcnLWv.mjs → list-DQvWxgPM.mjs} +10 -10
- package/dist/{load-BxmN8f0E.mjs → load-D5MM8OW9.mjs} +9 -9
- package/dist/{meta-Dstclm2x.mjs → meta-BEJIfnPG.mjs} +2 -2
- package/dist/{project-context-D4mFnCs7.mjs → project-context-BRIMzhi4.mjs} +6 -5
- package/dist/{resolver-B36uOK8c.mjs → resolver-D9cjsz11.mjs} +6 -7
- package/dist/{scanner-B6nnctK4.mjs → scanner-D3tAqvbj.mjs} +54 -26
- package/dist/scanner-DNM8orwt.mjs +6 -0
- package/dist/{setup-J4A9UfBB.mjs → setup-BklJkH_6.mjs} +2 -2
- package/dist/setup.d.mts +1 -1
- package/dist/setup.mjs +4 -4
- package/dist/{skill-paths-4kQXfQXo.mjs → skill-paths-B-j0dWDA.mjs} +1 -1
- package/dist/{stale-BD77r7KR.mjs → stale-C6dPKQ98.mjs} +1 -1
- package/dist/{staleness-DChVhbCN.mjs → staleness-BGFfic-Y.mjs} +2 -2
- package/dist/staleness-CB3qpVCq.mjs +5 -0
- package/dist/{utils-Chn-30vI.mjs → utils-9fhWAVua.mjs} +80 -22
- package/dist/utils-CSPzvaFu.mjs +3 -0
- package/dist/{validate-CTSG3eDc.mjs → validate-CZ65_6Li.mjs} +6 -6
- package/dist/{workflow-review-DcFipeG0.mjs → workflow-review-CrWkP7Hc.mjs} +1 -1
- package/dist/{workflow-review--Gc_yplP.mjs → workflow-review-D9Fg1G0P.mjs} +15 -15
- package/dist/{workspace-patterns-C5O4Dfpl.mjs → workspace-patterns-BffPlZ1D.mjs} +7 -8
- package/dist/{workspace-patterns-CA-UGM5C.mjs → workspace-patterns-Bjq_cXww.mjs} +2 -2
- package/package.json +3 -8
- package/dist/artifact-coverage-CbZALe7Q.mjs +0 -3
- package/dist/display-lWCJg5Bo.mjs +0 -5
- package/dist/install-EVdqAy8f.mjs +0 -7
- package/dist/intent-library.d.mts +0 -1
- package/dist/intent-library.mjs +0 -84
- package/dist/library-scanner-BpEuR__1.mjs +0 -116
- package/dist/library-scanner.d.mts +0 -16
- package/dist/library-scanner.mjs +0 -5
- package/dist/scanner-BWd4mS25.mjs +0 -6
- package/dist/staleness-Dm4laJFc.mjs +0 -5
- package/dist/utils-Ctlz_JG-.mjs +0 -3
- /package/dist/{artifact-coverage-Cqphhpfo.mjs → artifact-coverage-DgWuVqUp.mjs} +0 -0
- /package/dist/{cli-error-DOO5bLIG.mjs → cli-error-BrMXlbtx.mjs} +0 -0
- /package/dist/{command-runner-DJTliSTc.mjs → command-runner-C0yCOHLi.mjs} +0 -0
- /package/dist/{edit-package-json-cPClxVZZ.mjs → edit-package-json-CtuelQ_q.mjs} +0 -0
- /package/dist/{package-manager-DDZck142.mjs → package-manager-BUgTjW9Q.mjs} +0 -0
- /package/dist/{scaffold-CaShIIUY.mjs → scaffold-CLM6bt3c.mjs} +0 -0
- /package/dist/{setup-DL7qX_F-.d.mts → setup-DhMqESd3.d.mts} +0 -0
- /package/dist/{setup-github-actions-zzLUbyAL.mjs → setup-github-actions-CUd1oncY.mjs} +0 -0
- /package/dist/{skill-use-C0q2MEEX.mjs → skill-use-umYvZl94.mjs} +0 -0
- /package/dist/{types-DU_Z0qNT.d.mts → types-CIha6LtJ.d.mts} +0 -0
package/dist/intent-library.mjs
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import "./utils-Chn-30vI.mjs";
|
|
3
|
-
import "./skill-paths-4kQXfQXo.mjs";
|
|
4
|
-
import "./workspace-patterns-C5O4Dfpl.mjs";
|
|
5
|
-
import "./project-context-D4mFnCs7.mjs";
|
|
6
|
-
import { n as printSkillTree, r as printTable, t as computeSkillNameWidth } from "./display-BPM-AJGc.mjs";
|
|
7
|
-
import "./cli-support-BHoEb9y1.mjs";
|
|
8
|
-
import { t as INSTALL_PROMPT } from "./install-DCiBBx55.mjs";
|
|
9
|
-
import { t as scanLibrary } from "./library-scanner-BpEuR__1.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 { c as resolveDepDir, i as getDeps, l as toPosixPath, s as parseFrontmatter } from "./utils-Chn-30vI.mjs";
|
|
2
|
-
import { r as rewriteSkillLoadPaths } from "./skill-paths-4kQXfQXo.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 { v as SkillEntry } from "./types-DU_Z0qNT.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 };
|
package/dist/library-scanner.mjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import "./utils-Chn-30vI.mjs";
|
|
2
|
-
import "./artifact-coverage-Cqphhpfo.mjs";
|
|
3
|
-
import { n as checkStaleness, r as readPackageName, t as buildWorkspaceCoverageSignals } from "./staleness-DChVhbCN.mjs";
|
|
4
|
-
|
|
5
|
-
export { buildWorkspaceCoverageSignals, checkStaleness, readPackageName };
|
package/dist/utils-Ctlz_JG-.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
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 };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|