@tanstack/intent 0.0.14 → 0.0.20
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/README.md +42 -5
- package/dist/cli.d.mts +6 -1
- package/dist/cli.mjs +253 -170
- package/dist/display-CuCDLPP_.mjs +3 -0
- package/dist/index.d.mts +10 -11
- package/dist/index.mjs +37 -14
- package/dist/install-prompt-C0M-U3WZ.mjs +59 -0
- package/dist/intent-library.mjs +5 -49
- package/dist/{library-scanner-B1tmOzwf.mjs → library-scanner-DBOEhfm8.mjs} +4 -5
- package/dist/library-scanner.d.mts +5 -5
- package/dist/library-scanner.mjs +2 -2
- package/dist/scanner-BHPl60jH.mjs +5 -0
- package/dist/scanner-DVepyEwz.mjs +365 -0
- package/dist/setup-B-zdCBu4.d.mts +36 -0
- package/dist/setup-mGV2dZrq.mjs +367 -0
- package/dist/setup.d.mts +2 -2
- package/dist/setup.mjs +3 -2
- package/dist/{staleness-DJfMKH62.mjs → staleness-DZKvsLVq.mjs} +24 -3
- package/dist/staleness-Dr5-5wj5.mjs +4 -0
- package/dist/{types-BmnI8kFB.d.mts → types-ddLtccfV.d.mts} +30 -7
- package/dist/utils-BfjM1mQe.mjs +152 -0
- package/dist/utils-D7OKi0Rn.mjs +3 -0
- package/meta/domain-discovery/SKILL.md +95 -20
- package/meta/feedback-collection/SKILL.md +20 -1
- package/meta/generate-skill/SKILL.md +56 -5
- package/meta/templates/workflows/check-skills.yml +4 -4
- package/meta/templates/workflows/{notify-playbooks.yml → notify-intent.yml} +4 -4
- package/meta/tree-generator/SKILL.md +2 -2
- package/package.json +9 -5
- package/dist/scanner-CECGXgox.mjs +0 -4
- package/dist/scanner-CY40iozO.mjs +0 -218
- package/dist/setup-CANkTz55.d.mts +0 -18
- package/dist/setup-Nif1-nhS.mjs +0 -211
- package/dist/staleness-C1h7RuZ9.mjs +0 -4
- package/dist/utils-CDJzAdjD.mjs +0 -79
- /package/dist/{display-D_XzuGnu.mjs → display-DhsUxNJW.mjs} +0 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { a as parseFrontmatter, i as listNodeModulesPackageDirs, o as resolveDepDir, r as getDeps, t as detectGlobalNodeModules } from "./utils-BfjM1mQe.mjs";
|
|
2
|
+
import { i as resolveWorkspacePackages, n as findWorkspaceRoot, r as readWorkspacePatterns } from "./setup-mGV2dZrq.mjs";
|
|
3
|
+
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
4
|
+
import { join, relative, sep } from "node:path";
|
|
5
|
+
|
|
6
|
+
//#region src/scanner.ts
|
|
7
|
+
function detectPackageManager(root) {
|
|
8
|
+
if (existsSync(join(root, ".pnp.cjs")) || existsSync(join(root, ".pnp.js"))) throw new Error("Yarn PnP is not yet supported. Add `nodeLinker: node-modules` to your .yarnrc.yml to use intent.");
|
|
9
|
+
if (existsSync(join(root, "deno.json")) && !existsSync(join(root, "node_modules"))) throw new Error("Deno without node_modules is not yet supported. Add `\"nodeModulesDir\": \"auto\"` to your deno.json to use intent.");
|
|
10
|
+
const dirsToCheck = [root];
|
|
11
|
+
const wsRoot = findWorkspaceRoot(root);
|
|
12
|
+
if (wsRoot && wsRoot !== root) dirsToCheck.push(wsRoot);
|
|
13
|
+
for (const dir of dirsToCheck) {
|
|
14
|
+
if (existsSync(join(dir, "pnpm-lock.yaml"))) return "pnpm";
|
|
15
|
+
if (existsSync(join(dir, "bun.lockb")) || existsSync(join(dir, "bun.lock"))) return "bun";
|
|
16
|
+
if (existsSync(join(dir, "yarn.lock"))) return "yarn";
|
|
17
|
+
if (existsSync(join(dir, "package-lock.json"))) return "npm";
|
|
18
|
+
}
|
|
19
|
+
return "unknown";
|
|
20
|
+
}
|
|
21
|
+
function validateIntentField(_pkgName, intent) {
|
|
22
|
+
if (!intent || typeof intent !== "object") return null;
|
|
23
|
+
const pb = intent;
|
|
24
|
+
if (pb.version !== 1) return null;
|
|
25
|
+
if (typeof pb.repo !== "string" || !pb.repo) return null;
|
|
26
|
+
if (typeof pb.docs !== "string" || !pb.docs) return null;
|
|
27
|
+
const requires = Array.isArray(pb.requires) ? pb.requires.filter((r) => typeof r === "string") : void 0;
|
|
28
|
+
return {
|
|
29
|
+
version: 1,
|
|
30
|
+
repo: pb.repo,
|
|
31
|
+
docs: pb.docs,
|
|
32
|
+
requires
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Derive an IntentConfig from standard package.json fields when no explicit
|
|
37
|
+
* `intent` field is present. A package with a `skills/` directory signals
|
|
38
|
+
* intent support; `repo` and `docs` are derived from `repository` and
|
|
39
|
+
* `homepage`.
|
|
40
|
+
*/
|
|
41
|
+
function deriveIntentConfig(pkgJson) {
|
|
42
|
+
let repo = null;
|
|
43
|
+
if (typeof pkgJson.repository === "string") repo = pkgJson.repository;
|
|
44
|
+
else if (pkgJson.repository && typeof pkgJson.repository === "object" && typeof pkgJson.repository.url === "string") {
|
|
45
|
+
repo = pkgJson.repository.url;
|
|
46
|
+
repo = repo.replace(/^git\+/, "").replace(/\.git$/, "").replace(/^https?:\/\/github\.com\//, "");
|
|
47
|
+
}
|
|
48
|
+
const docs = typeof pkgJson.homepage === "string" ? pkgJson.homepage : void 0;
|
|
49
|
+
if (!repo) return null;
|
|
50
|
+
const intentPartial = pkgJson.intent;
|
|
51
|
+
const requires = intentPartial && Array.isArray(intentPartial.requires) ? intentPartial.requires.filter((r) => typeof r === "string") : void 0;
|
|
52
|
+
return {
|
|
53
|
+
version: 1,
|
|
54
|
+
repo,
|
|
55
|
+
docs: docs ?? "",
|
|
56
|
+
requires
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function discoverSkills(skillsDir, _baseName) {
|
|
60
|
+
const skills = [];
|
|
61
|
+
function walk(dir) {
|
|
62
|
+
let entries;
|
|
63
|
+
try {
|
|
64
|
+
entries = readdirSync(dir, {
|
|
65
|
+
withFileTypes: true,
|
|
66
|
+
encoding: "utf8"
|
|
67
|
+
});
|
|
68
|
+
} catch {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
for (const entry of entries) {
|
|
72
|
+
if (!entry.isDirectory()) continue;
|
|
73
|
+
const childDir = join(dir, entry.name);
|
|
74
|
+
const skillFile = join(childDir, "SKILL.md");
|
|
75
|
+
if (existsSync(skillFile)) {
|
|
76
|
+
const fm = parseFrontmatter(skillFile);
|
|
77
|
+
const relName = relative(skillsDir, childDir).split(sep).join("/");
|
|
78
|
+
const desc = typeof fm?.description === "string" ? fm.description.replace(/\s+/g, " ").trim() : "";
|
|
79
|
+
skills.push({
|
|
80
|
+
name: typeof fm?.name === "string" ? fm.name : relName,
|
|
81
|
+
path: skillFile,
|
|
82
|
+
description: desc,
|
|
83
|
+
type: typeof fm?.type === "string" ? fm.type : void 0,
|
|
84
|
+
framework: typeof fm?.framework === "string" ? fm.framework : void 0
|
|
85
|
+
});
|
|
86
|
+
walk(childDir);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
walk(skillsDir);
|
|
91
|
+
return skills;
|
|
92
|
+
}
|
|
93
|
+
function topoSort(packages) {
|
|
94
|
+
const byName = new Map(packages.map((p) => [p.name, p]));
|
|
95
|
+
const visited = /* @__PURE__ */ new Set();
|
|
96
|
+
const sorted = [];
|
|
97
|
+
function visit(name) {
|
|
98
|
+
if (visited.has(name)) return;
|
|
99
|
+
visited.add(name);
|
|
100
|
+
const pkg = byName.get(name);
|
|
101
|
+
if (!pkg) return;
|
|
102
|
+
for (const dep of pkg.intent.requires ?? []) visit(dep);
|
|
103
|
+
sorted.push(pkg);
|
|
104
|
+
}
|
|
105
|
+
for (const pkg of packages) visit(pkg.name);
|
|
106
|
+
return sorted;
|
|
107
|
+
}
|
|
108
|
+
function getPackageDepth(packageRoot, projectRoot) {
|
|
109
|
+
return relative(projectRoot, packageRoot).split(sep).length;
|
|
110
|
+
}
|
|
111
|
+
function parseSemver(version) {
|
|
112
|
+
const match = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/.exec(version);
|
|
113
|
+
if (!match) return null;
|
|
114
|
+
const prerelease = match[4] ? match[4].split(".").map((identifier) => {
|
|
115
|
+
return /^\d+$/.test(identifier) ? Number(identifier) : identifier;
|
|
116
|
+
}) : [];
|
|
117
|
+
return {
|
|
118
|
+
major: Number(match[1]),
|
|
119
|
+
minor: Number(match[2]),
|
|
120
|
+
patch: Number(match[3]),
|
|
121
|
+
prerelease
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function comparePrereleaseIdentifiers(a, b) {
|
|
125
|
+
if (a === void 0) return b === void 0 ? 0 : 1;
|
|
126
|
+
if (b === void 0) return -1;
|
|
127
|
+
if (typeof a === "number" && typeof b === "number") return a - b;
|
|
128
|
+
if (typeof a === "number") return -1;
|
|
129
|
+
if (typeof b === "number") return 1;
|
|
130
|
+
return a.localeCompare(b);
|
|
131
|
+
}
|
|
132
|
+
function comparePackageVersions(a, b) {
|
|
133
|
+
const parsedA = parseSemver(a);
|
|
134
|
+
const parsedB = parseSemver(b);
|
|
135
|
+
if (!parsedA || !parsedB) {
|
|
136
|
+
if (parsedA) return 1;
|
|
137
|
+
if (parsedB) return -1;
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
for (const key of [
|
|
141
|
+
"major",
|
|
142
|
+
"minor",
|
|
143
|
+
"patch"
|
|
144
|
+
]) {
|
|
145
|
+
const diff = parsedA[key] - parsedB[key];
|
|
146
|
+
if (diff !== 0) return diff;
|
|
147
|
+
}
|
|
148
|
+
const length = Math.max(parsedA.prerelease.length, parsedB.prerelease.length);
|
|
149
|
+
for (let i = 0; i < length; i++) {
|
|
150
|
+
const diff = comparePrereleaseIdentifiers(parsedA.prerelease[i], parsedB.prerelease[i]);
|
|
151
|
+
if (diff !== 0) return diff;
|
|
152
|
+
}
|
|
153
|
+
return 0;
|
|
154
|
+
}
|
|
155
|
+
function formatVariantWarning(name, variants, chosen) {
|
|
156
|
+
const uniqueVersions = new Set(variants.map((variant) => variant.version));
|
|
157
|
+
if (uniqueVersions.size <= 1) return null;
|
|
158
|
+
const details = variants.map((variant) => `${variant.version} at ${variant.packageRoot}`).join(", ");
|
|
159
|
+
return `Found ${variants.length} installed variants of ${name} across ${uniqueVersions.size} versions (${details}). Using ${chosen.version} from ${chosen.packageRoot}.`;
|
|
160
|
+
}
|
|
161
|
+
function toVersionConflict(packageName, variants, chosen) {
|
|
162
|
+
if (new Set(variants.map((variant) => variant.version)).size <= 1) return null;
|
|
163
|
+
return {
|
|
164
|
+
packageName,
|
|
165
|
+
chosen: {
|
|
166
|
+
version: chosen.version,
|
|
167
|
+
packageRoot: chosen.packageRoot
|
|
168
|
+
},
|
|
169
|
+
variants
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
async function scanForIntents(root) {
|
|
173
|
+
const projectRoot = root ?? process.cwd();
|
|
174
|
+
const packageManager = detectPackageManager(projectRoot);
|
|
175
|
+
const nodeModulesDir = join(projectRoot, "node_modules");
|
|
176
|
+
const explicitGlobalNodeModules = process.env.INTENT_GLOBAL_NODE_MODULES?.trim() || null;
|
|
177
|
+
const packages = [];
|
|
178
|
+
const warnings = [];
|
|
179
|
+
const conflicts = [];
|
|
180
|
+
const nodeModules = {
|
|
181
|
+
local: {
|
|
182
|
+
path: nodeModulesDir,
|
|
183
|
+
detected: true,
|
|
184
|
+
exists: existsSync(nodeModulesDir),
|
|
185
|
+
scanned: false
|
|
186
|
+
},
|
|
187
|
+
global: {
|
|
188
|
+
path: explicitGlobalNodeModules,
|
|
189
|
+
detected: Boolean(explicitGlobalNodeModules),
|
|
190
|
+
exists: explicitGlobalNodeModules ? existsSync(explicitGlobalNodeModules) : false,
|
|
191
|
+
scanned: false,
|
|
192
|
+
source: explicitGlobalNodeModules ? "INTENT_GLOBAL_NODE_MODULES" : void 0
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
const packageIndexes = /* @__PURE__ */ new Map();
|
|
196
|
+
const packageJsonCache = /* @__PURE__ */ new Map();
|
|
197
|
+
const packageVariants = /* @__PURE__ */ new Map();
|
|
198
|
+
function rememberVariant(pkg) {
|
|
199
|
+
let variants = packageVariants.get(pkg.name);
|
|
200
|
+
if (!variants) {
|
|
201
|
+
variants = /* @__PURE__ */ new Map();
|
|
202
|
+
packageVariants.set(pkg.name, variants);
|
|
203
|
+
}
|
|
204
|
+
variants.set(pkg.packageRoot, {
|
|
205
|
+
version: pkg.version,
|
|
206
|
+
packageRoot: pkg.packageRoot
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
function ensureGlobalNodeModules() {
|
|
210
|
+
if (!nodeModules.global.path && !explicitGlobalNodeModules) {
|
|
211
|
+
const detected = detectGlobalNodeModules(packageManager);
|
|
212
|
+
nodeModules.global.path = detected.path;
|
|
213
|
+
nodeModules.global.source = detected.source;
|
|
214
|
+
nodeModules.global.detected = Boolean(detected.path);
|
|
215
|
+
nodeModules.global.exists = detected.path ? existsSync(detected.path) : false;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function readPkgJson(dirPath) {
|
|
219
|
+
if (packageJsonCache.has(dirPath)) return packageJsonCache.get(dirPath) ?? null;
|
|
220
|
+
try {
|
|
221
|
+
const pkgJson = JSON.parse(readFileSync(join(dirPath, "package.json"), "utf8"));
|
|
222
|
+
packageJsonCache.set(dirPath, pkgJson);
|
|
223
|
+
return pkgJson;
|
|
224
|
+
} catch {
|
|
225
|
+
packageJsonCache.set(dirPath, null);
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function scanTarget(target) {
|
|
230
|
+
if (!target.path || !target.exists || target.scanned) return;
|
|
231
|
+
target.scanned = true;
|
|
232
|
+
for (const dirPath of listNodeModulesPackageDirs(target.path)) tryRegister(dirPath, "unknown");
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Try to register a package with a skills/ directory. Reads its
|
|
236
|
+
* package.json, validates intent config, discovers skills, and pushes
|
|
237
|
+
* to `packages`. Returns true if the package was registered.
|
|
238
|
+
*/
|
|
239
|
+
function tryRegister(dirPath, fallbackName) {
|
|
240
|
+
const skillsDir = join(dirPath, "skills");
|
|
241
|
+
if (!existsSync(skillsDir)) return false;
|
|
242
|
+
const pkgJson = readPkgJson(dirPath);
|
|
243
|
+
if (!pkgJson) {
|
|
244
|
+
warnings.push(`Could not read package.json for ${dirPath}`);
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
247
|
+
const name = typeof pkgJson.name === "string" ? pkgJson.name : fallbackName;
|
|
248
|
+
const version = typeof pkgJson.version === "string" ? pkgJson.version : "0.0.0";
|
|
249
|
+
const intent = validateIntentField(name, pkgJson.intent) ?? deriveIntentConfig(pkgJson);
|
|
250
|
+
if (!intent) {
|
|
251
|
+
warnings.push(`${name} has a skills/ directory but could not determine repo/docs from package.json (add a "repository" field or explicit "intent" config)`);
|
|
252
|
+
return false;
|
|
253
|
+
}
|
|
254
|
+
const candidate = {
|
|
255
|
+
name,
|
|
256
|
+
version,
|
|
257
|
+
intent,
|
|
258
|
+
skills: discoverSkills(skillsDir, name),
|
|
259
|
+
packageRoot: dirPath
|
|
260
|
+
};
|
|
261
|
+
const existingIndex = packageIndexes.get(name);
|
|
262
|
+
if (existingIndex === void 0) {
|
|
263
|
+
rememberVariant(candidate);
|
|
264
|
+
packageIndexes.set(name, packages.push(candidate) - 1);
|
|
265
|
+
return true;
|
|
266
|
+
}
|
|
267
|
+
const existing = packages[existingIndex];
|
|
268
|
+
if (existing.packageRoot === candidate.packageRoot) return false;
|
|
269
|
+
rememberVariant(existing);
|
|
270
|
+
rememberVariant(candidate);
|
|
271
|
+
const existingDepth = getPackageDepth(existing.packageRoot, projectRoot);
|
|
272
|
+
const candidateDepth = getPackageDepth(candidate.packageRoot, projectRoot);
|
|
273
|
+
if (candidateDepth < existingDepth || candidateDepth === existingDepth && comparePackageVersions(candidate.version, existing.version) > 0) packages[existingIndex] = candidate;
|
|
274
|
+
return true;
|
|
275
|
+
}
|
|
276
|
+
scanTarget(nodeModules.local);
|
|
277
|
+
const walkVisited = /* @__PURE__ */ new Set();
|
|
278
|
+
function walkDeps(pkgDir, pkgName) {
|
|
279
|
+
if (walkVisited.has(pkgDir)) return;
|
|
280
|
+
walkVisited.add(pkgDir);
|
|
281
|
+
const pkgJson = readPkgJson(pkgDir);
|
|
282
|
+
if (!pkgJson) {
|
|
283
|
+
warnings.push(`Could not read package.json for ${pkgName} (skipping dependency walk)`);
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
for (const depName of getDeps(pkgJson)) {
|
|
287
|
+
const depDir = resolveDepDir(depName, pkgDir);
|
|
288
|
+
if (!depDir || walkVisited.has(depDir)) continue;
|
|
289
|
+
tryRegister(depDir, depName);
|
|
290
|
+
walkDeps(depDir, depName);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
function walkKnownPackages() {
|
|
294
|
+
for (const pkg of [...packages]) walkDeps(pkg.packageRoot, pkg.name);
|
|
295
|
+
}
|
|
296
|
+
function walkProjectDeps() {
|
|
297
|
+
let projectPkg = null;
|
|
298
|
+
try {
|
|
299
|
+
projectPkg = JSON.parse(readFileSync(join(projectRoot, "package.json"), "utf8"));
|
|
300
|
+
} catch (err) {
|
|
301
|
+
if (!(err && typeof err === "object" && "code" in err && err.code === "ENOENT")) warnings.push(`Could not read project package.json: ${err instanceof Error ? err.message : String(err)}`);
|
|
302
|
+
}
|
|
303
|
+
if (!projectPkg) return;
|
|
304
|
+
walkDepsFromPkgJson(projectPkg, projectRoot, true);
|
|
305
|
+
}
|
|
306
|
+
/** Resolve and walk deps listed in a package.json. */
|
|
307
|
+
function walkDepsFromPkgJson(pkgJson, fromDir, includeDevDeps = false) {
|
|
308
|
+
for (const depName of getDeps(pkgJson, includeDevDeps)) {
|
|
309
|
+
const depDir = resolveDepDir(depName, fromDir);
|
|
310
|
+
if (depDir && !walkVisited.has(depDir)) {
|
|
311
|
+
tryRegister(depDir, depName);
|
|
312
|
+
walkDeps(depDir, depName);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* In monorepos, discover workspace packages and walk their deps.
|
|
318
|
+
* Handles pnpm monorepos (workspace-specific node_modules) and ensures
|
|
319
|
+
* transitive skills packages are found through workspace package dependencies.
|
|
320
|
+
*/
|
|
321
|
+
function walkWorkspacePackages() {
|
|
322
|
+
const workspacePatterns = readWorkspacePatterns(projectRoot);
|
|
323
|
+
if (!workspacePatterns) return;
|
|
324
|
+
for (const wsDir of resolveWorkspacePackages(projectRoot, workspacePatterns)) {
|
|
325
|
+
const wsNodeModules = join(wsDir, "node_modules");
|
|
326
|
+
if (existsSync(wsNodeModules)) for (const dirPath of listNodeModulesPackageDirs(wsNodeModules)) tryRegister(dirPath, "unknown");
|
|
327
|
+
const wsPkg = readPkgJson(wsDir);
|
|
328
|
+
if (wsPkg) walkDepsFromPkgJson(wsPkg, wsDir);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
walkWorkspacePackages();
|
|
332
|
+
walkKnownPackages();
|
|
333
|
+
walkProjectDeps();
|
|
334
|
+
if (explicitGlobalNodeModules || packages.length === 0 || !nodeModules.local.exists) {
|
|
335
|
+
ensureGlobalNodeModules();
|
|
336
|
+
scanTarget(nodeModules.global);
|
|
337
|
+
walkKnownPackages();
|
|
338
|
+
walkProjectDeps();
|
|
339
|
+
}
|
|
340
|
+
if (!nodeModules.local.exists && !nodeModules.global.exists) return {
|
|
341
|
+
packageManager,
|
|
342
|
+
packages,
|
|
343
|
+
warnings,
|
|
344
|
+
conflicts,
|
|
345
|
+
nodeModules
|
|
346
|
+
};
|
|
347
|
+
for (const pkg of packages) {
|
|
348
|
+
const variants = packageVariants.get(pkg.name);
|
|
349
|
+
if (!variants) continue;
|
|
350
|
+
const conflict = toVersionConflict(pkg.name, [...variants.values()], pkg);
|
|
351
|
+
if (conflict) conflicts.push(conflict);
|
|
352
|
+
const warning = formatVariantWarning(pkg.name, [...variants.values()], pkg);
|
|
353
|
+
if (warning) warnings.push(warning);
|
|
354
|
+
}
|
|
355
|
+
return {
|
|
356
|
+
packageManager,
|
|
357
|
+
packages: topoSort(packages),
|
|
358
|
+
warnings,
|
|
359
|
+
conflicts,
|
|
360
|
+
nodeModules
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
//#endregion
|
|
365
|
+
export { scanForIntents as t };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//#region src/setup.d.ts
|
|
2
|
+
interface AddLibraryBinResult {
|
|
3
|
+
shim: string | null;
|
|
4
|
+
skipped: string | null;
|
|
5
|
+
}
|
|
6
|
+
interface EditPackageJsonResult {
|
|
7
|
+
added: Array<string>;
|
|
8
|
+
alreadyPresent: Array<string>;
|
|
9
|
+
}
|
|
10
|
+
interface SetupGithubActionsResult {
|
|
11
|
+
workflows: Array<string>;
|
|
12
|
+
skipped: Array<string>;
|
|
13
|
+
}
|
|
14
|
+
interface MonorepoResult<T> {
|
|
15
|
+
package: string;
|
|
16
|
+
result: T;
|
|
17
|
+
}
|
|
18
|
+
declare function runAddLibraryBin(root: string): AddLibraryBinResult;
|
|
19
|
+
declare function runEditPackageJson(root: string): EditPackageJsonResult;
|
|
20
|
+
declare function readWorkspacePatterns(root: string): Array<string> | null;
|
|
21
|
+
/**
|
|
22
|
+
* Resolve workspace glob patterns to actual package directories.
|
|
23
|
+
* Handles simple patterns like "packages/*" and "packages/**".
|
|
24
|
+
* Each resolved directory must contain a package.json.
|
|
25
|
+
*/
|
|
26
|
+
declare function resolveWorkspacePackages(root: string, patterns: Array<string>): Array<string>;
|
|
27
|
+
declare function findWorkspaceRoot(start: string): string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Find workspace packages that contain at least one SKILL.md file.
|
|
30
|
+
*/
|
|
31
|
+
declare function findPackagesWithSkills(root: string): Array<string>;
|
|
32
|
+
declare function runEditPackageJsonAll(root: string): Array<MonorepoResult<EditPackageJsonResult>> | EditPackageJsonResult;
|
|
33
|
+
declare function runAddLibraryBinAll(root: string): Array<MonorepoResult<AddLibraryBinResult>> | AddLibraryBinResult;
|
|
34
|
+
declare function runSetupGithubActions(root: string, metaDir: string): SetupGithubActionsResult;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { findPackagesWithSkills as a, resolveWorkspacePackages as c, runEditPackageJson as d, runEditPackageJsonAll as f, SetupGithubActionsResult as i, runAddLibraryBin as l, EditPackageJsonResult as n, findWorkspaceRoot as o, runSetupGithubActions as p, MonorepoResult as r, readWorkspacePatterns as s, AddLibraryBinResult as t, runAddLibraryBinAll as u };
|