@tanstack/intent 0.1.1 → 0.2.1
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-CXX6wav1.mjs +2 -0
- package/dist/{artifact-coverage-nGwun1tt.mjs → artifact-coverage-DFtI6V_H.mjs} +1 -3
- package/dist/{cli-error-BrMXlbtx.mjs → cli-error-DDAO6DIL.mjs} +1 -2
- package/dist/{cli-support-BADtMg6z.mjs → cli-support-BANzHEBM.mjs} +2 -6
- package/dist/{cli-support-C8SKYTA4.mjs → cli-support-z64kSJOO.mjs} +8 -11
- package/dist/cli.d.mts +0 -1
- package/dist/cli.mjs +14 -16
- package/dist/{command-runner-fstUIUhe.mjs → command-runner-B5OofX0E.mjs} +1 -2
- package/dist/{core-hEMP5GMV.mjs → core-DaAr5MBD.mjs} +11 -15
- package/dist/core.d.mts +3 -4
- package/dist/core.mjs +2 -11
- package/dist/{display-CFnFnrtx.mjs → display-CnpA7XuV.mjs} +3 -7
- package/dist/{edit-package-json-DKyJ04t1.mjs → edit-package-json-D8xfcy2X.mjs} +1 -2
- package/dist/{exclude-CBxkyK3Q.mjs → exclude-DbHwcgQQ.mjs} +6 -11
- package/dist/{excludes-DDMe-4iu.mjs → excludes-ByvSbmmj.mjs} +3 -6
- package/dist/index.d.mts +2 -3
- package/dist/index.mjs +9 -14
- package/dist/{install-BE7gVoNT.mjs → install-Bv2qdHwd.mjs} +18 -24
- package/dist/{list-UqYivAcV.mjs → list-C-eGocZP.mjs} +5 -15
- package/dist/{load-Dgw151E3.mjs → load-DDNrmeBz.mjs} +4 -14
- package/dist/{meta-BZMVgIzJ.mjs → meta-CF4XIYOo.mjs} +3 -5
- package/dist/{package-manager-BUgTjW9Q.mjs → package-manager-Dw7lYcI0.mjs} +1 -3
- package/dist/{project-context-DDCie6Ro.mjs → project-context-oi_m7paK.mjs} +2 -4
- package/dist/{resolver-CZXZ0rft.mjs → resolver-Uwx8B5jv.mjs} +4 -6
- package/dist/{scaffold-D2vwv9ls.mjs → scaffold-D8TAMXvs.mjs} +1 -3
- package/dist/{scanner-2XDBAsbm.mjs → scanner-C5bzzri5.mjs} +21 -14
- package/dist/{setup-DW3pn0QW.d.mts → setup-CdfBc7Oe.d.mts} +0 -1
- package/dist/{setup-CMec7fht.mjs → setup-Cx1r2y-1.mjs} +3 -5
- package/dist/{setup-github-actions-emXSyGy3.mjs → setup-github-actions-IxZTZihi.mjs} +1 -2
- package/dist/setup.d.mts +1 -1
- package/dist/setup.mjs +3 -6
- package/dist/{skill-paths-Cr74uFk4.mjs → skill-paths-Bm1P6IYe.mjs} +2 -4
- package/dist/{skill-use-CUrNHf-u.mjs → skill-use-B2xRF1i9.mjs} +1 -2
- package/dist/source-policy-CTeI29oF.mjs +2 -0
- package/dist/{source-policy-rGOtjQSM.mjs → source-policy-D__bcpoU.mjs} +4 -7
- package/dist/{stale-DxZyYibt.mjs → stale-DhjSTIt-.mjs} +3 -5
- package/dist/staleness-B5Cqe77_.mjs +2 -0
- package/dist/{staleness-B8IvDS_9.mjs → staleness-DoZU3lzy.mjs} +9 -16
- package/dist/{types-oEflMSso.d.mts → types-ByXUTBJ2.d.mts} +2 -1
- package/dist/{utils-Dj49bkF_.mjs → utils-6FtqhOYf.mjs} +1 -3
- package/dist/{utils-BuNMwKct.mjs → utils-BKBDYbCx.mjs} +2 -3
- package/dist/{validate-B3pkTIZl.mjs → validate-BAU0uzvQ.mjs} +133 -46
- package/dist/{workflow-review-wL1Iu2Sf.mjs → workflow-review-B4AfwtHH.mjs} +1 -3
- package/dist/{workflow-review-CtOR1bgh.mjs → workflow-review-Bo2kPVXV.mjs} +2 -3
- package/dist/{workspace-patterns-Cz_lNhwz.mjs → workspace-patterns-BDoJIWk-.mjs} +2 -4
- package/dist/workspace-patterns-CrL8hAbd.mjs +2 -0
- package/meta/generate-skill/SKILL.md +34 -20
- package/meta/tree-generator/SKILL.md +42 -38
- package/package.json +5 -6
- package/dist/artifact-coverage-BfJ7f-S9.mjs +0 -3
- package/dist/source-policy-D4slvwwI.mjs +0 -9
- package/dist/staleness-Ctzy2Zac.mjs +0 -5
- package/dist/workspace-patterns-BBW4c1gr.mjs +0 -4
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import { dirname, join, resolve } from "node:path";
|
|
3
|
-
|
|
4
3
|
//#region src/package-manager.ts
|
|
5
4
|
function readPackageManagerField(dir) {
|
|
6
5
|
try {
|
|
@@ -43,6 +42,5 @@ function detectPackageManager(cwd = process.cwd(), extraDirs = []) {
|
|
|
43
42
|
}
|
|
44
43
|
return "unknown";
|
|
45
44
|
}
|
|
46
|
-
|
|
47
45
|
//#endregion
|
|
48
|
-
export { detectPackageManager as t };
|
|
46
|
+
export { detectPackageManager as t };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { a as readWorkspacePatterns, r as findWorkspaceRoot } from "./workspace-patterns-
|
|
1
|
+
import { a as readWorkspacePatterns, r as findWorkspaceRoot } from "./workspace-patterns-BDoJIWk-.mjs";
|
|
2
2
|
import { existsSync, statSync } from "node:fs";
|
|
3
3
|
import { dirname, join, relative, resolve } from "node:path";
|
|
4
|
-
|
|
5
4
|
//#region src/core/project-context.ts
|
|
6
5
|
/**
|
|
7
6
|
* Resolves project structure by walking up from targetPath (or cwd) to find the
|
|
@@ -49,6 +48,5 @@ function isWithinOrEqual(path, parentDir) {
|
|
|
49
48
|
const rel = relative(parentDir, path);
|
|
50
49
|
return rel === "" || !rel.startsWith("..") && !rel.startsWith("/");
|
|
51
50
|
}
|
|
52
|
-
|
|
53
51
|
//#endregion
|
|
54
|
-
export { resolveProjectContext as t };
|
|
52
|
+
export { resolveProjectContext as t };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { i as parseSkillUse } from "./skill-use-
|
|
2
|
-
import { o as warningMentionsPackage } from "./excludes-
|
|
3
|
-
|
|
1
|
+
import { i as parseSkillUse } from "./skill-use-B2xRF1i9.mjs";
|
|
2
|
+
import { o as warningMentionsPackage } from "./excludes-ByvSbmmj.mjs";
|
|
4
3
|
//#region src/resolver.ts
|
|
5
4
|
var ResolveSkillUseError = class extends Error {
|
|
6
5
|
constructor({ availablePackages = [], availableSkills = [], code, packageName, skillName, suggestedSkills = [], use }) {
|
|
@@ -65,7 +64,7 @@ function resolveSkillEntry(packageName, skillName, skills) {
|
|
|
65
64
|
}
|
|
66
65
|
function resolveSkillUse(use, scanResult) {
|
|
67
66
|
const { packageName, skillName } = parseSkillUse(use);
|
|
68
|
-
const packages = scanResult.packages.filter((pkg
|
|
67
|
+
const packages = scanResult.packages.filter((pkg) => pkg.name === packageName);
|
|
69
68
|
const pkg = packages.find((candidate) => candidate.source === "local") ?? packages[0];
|
|
70
69
|
if (!pkg) throw new ResolveSkillUseError({
|
|
71
70
|
availablePackages: scanResult.packages.map((candidate) => candidate.name),
|
|
@@ -107,6 +106,5 @@ function formatSkillSuggestions(packageName, skillNames) {
|
|
|
107
106
|
if (uses.length <= 2) return uses.join(" or ");
|
|
108
107
|
return `${uses.slice(0, -1).join(", ")}, or ${uses.at(-1)}`;
|
|
109
108
|
}
|
|
110
|
-
|
|
111
109
|
//#endregion
|
|
112
|
-
export { resolveSkillUse as i, isResolveSkillUseError as n, resolveSkillEntry as r, ResolveSkillUseError as t };
|
|
110
|
+
export { resolveSkillUse as i, isResolveSkillUseError as n, resolveSkillEntry as r, ResolveSkillUseError as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
-
|
|
3
2
|
//#region src/commands/scaffold.ts
|
|
4
3
|
function runScaffoldCommand(metaDir) {
|
|
5
4
|
function metaSkillPath(name) {
|
|
@@ -70,6 +69,5 @@ This produces: individual SKILL.md files.
|
|
|
70
69
|
`;
|
|
71
70
|
console.log(prompt);
|
|
72
71
|
}
|
|
73
|
-
|
|
74
72
|
//#endregion
|
|
75
|
-
export { runScaffoldCommand };
|
|
73
|
+
export { runScaffoldCommand };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { a as listNestedNodeModulesPackageDirs, c as parseFrontmatter, d as toPosixPath, i as getDeps, l as readScalarField, n as detectGlobalNodeModules, o as listNodeModulesPackageDirs, r as findSkillFiles, s as nodeReadFs, t as createFsIdentityCache, u as resolveDepDir } from "./utils-
|
|
2
|
-
import { r as rewriteSkillLoadPaths } from "./skill-paths-
|
|
3
|
-
import { n as findWorkspacePackages, r as findWorkspaceRoot } from "./workspace-patterns-
|
|
4
|
-
import { t as detectPackageManager } from "./package-manager-
|
|
1
|
+
import { a as listNestedNodeModulesPackageDirs, c as parseFrontmatter, d as toPosixPath, i as getDeps, l as readScalarField, n as detectGlobalNodeModules, o as listNodeModulesPackageDirs, r as findSkillFiles, s as nodeReadFs, t as createFsIdentityCache, u as resolveDepDir } from "./utils-6FtqhOYf.mjs";
|
|
2
|
+
import { r as rewriteSkillLoadPaths } from "./skill-paths-Bm1P6IYe.mjs";
|
|
3
|
+
import { n as findWorkspacePackages, r as findWorkspaceRoot } from "./workspace-patterns-BDoJIWk-.mjs";
|
|
4
|
+
import { t as detectPackageManager } from "./package-manager-Dw7lYcI0.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import { existsSync } from "node:fs";
|
|
7
7
|
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
8
8
|
import semver from "semver";
|
|
9
|
-
|
|
10
9
|
//#region src/discovery/register.ts
|
|
11
10
|
function isLocalToProject(dirPath, projectRoot) {
|
|
12
11
|
return dirPath.startsWith(projectRoot + sep) || dirPath.startsWith(projectRoot + "/");
|
|
@@ -61,6 +60,7 @@ function createPackageRegistrar(opts) {
|
|
|
61
60
|
intent,
|
|
62
61
|
skills,
|
|
63
62
|
packageRoot: dirPath,
|
|
63
|
+
kind: opts.getPackageKind(dirPath),
|
|
64
64
|
source
|
|
65
65
|
};
|
|
66
66
|
const existingIndex = opts.packageIndexes.get(name);
|
|
@@ -84,7 +84,6 @@ function createPackageRegistrar(opts) {
|
|
|
84
84
|
tryRegister
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
|
-
|
|
88
87
|
//#endregion
|
|
89
88
|
//#region src/discovery/walk.ts
|
|
90
89
|
function createDependencyWalker(opts) {
|
|
@@ -156,7 +155,6 @@ function createDependencyWalker(opts) {
|
|
|
156
155
|
walkWorkspacePackages
|
|
157
156
|
};
|
|
158
157
|
}
|
|
159
|
-
|
|
160
158
|
//#endregion
|
|
161
159
|
//#region src/fs-cache.ts
|
|
162
160
|
function isRecord(value) {
|
|
@@ -220,7 +218,6 @@ function createIntentFsCache() {
|
|
|
220
218
|
exists: (path) => activeFs.existsSync(path)
|
|
221
219
|
};
|
|
222
220
|
}
|
|
223
|
-
|
|
224
221
|
//#endregion
|
|
225
222
|
//#region src/scanner.ts
|
|
226
223
|
const requireFromHere = createRequire(import.meta.url);
|
|
@@ -325,12 +322,10 @@ function deriveIntentConfig(pkgJson) {
|
|
|
325
322
|
}
|
|
326
323
|
function readSkillEntry(skillsDir, childDir, skillFile, readFs = nodeReadFs) {
|
|
327
324
|
const fm = parseFrontmatter(skillFile, readFs);
|
|
328
|
-
const relName = toPosixPath(relative(skillsDir, childDir));
|
|
329
|
-
const desc = typeof fm?.description === "string" ? fm.description.replace(/\s+/g, " ").trim() : "";
|
|
330
325
|
return {
|
|
331
|
-
name:
|
|
326
|
+
name: toPosixPath(relative(skillsDir, childDir)),
|
|
332
327
|
path: skillFile,
|
|
333
|
-
description:
|
|
328
|
+
description: typeof fm?.description === "string" ? fm.description.replace(/\s+/g, " ").trim() : "",
|
|
334
329
|
type: readScalarField(fm, "type"),
|
|
335
330
|
framework: readScalarField(fm, "framework")
|
|
336
331
|
};
|
|
@@ -436,6 +431,15 @@ function toVersionConflict(packageName, variants, chosen) {
|
|
|
436
431
|
function getScanScope(options) {
|
|
437
432
|
return options.scope ?? (options.includeGlobal ? "local-and-global" : "local");
|
|
438
433
|
}
|
|
434
|
+
function createWorkspacePackageKeySet(workspaceRoot, getFsIdentity) {
|
|
435
|
+
if (!workspaceRoot) return /* @__PURE__ */ new Set();
|
|
436
|
+
return new Set(findWorkspacePackages(workspaceRoot).map((dir) => getFsIdentity(dir)));
|
|
437
|
+
}
|
|
438
|
+
function createPackageKindResolver(workspacePackageKeys, getFsIdentity) {
|
|
439
|
+
return (packageRoot) => {
|
|
440
|
+
return workspacePackageKeys.has(getFsIdentity(packageRoot)) ? "workspace" : "npm";
|
|
441
|
+
};
|
|
442
|
+
}
|
|
439
443
|
function scanForIntents(root, options = {}) {
|
|
440
444
|
const projectRoot = root ?? process.cwd();
|
|
441
445
|
const scanScope = getScanScope(options);
|
|
@@ -465,6 +469,7 @@ function scanForIntents(root, options = {}) {
|
|
|
465
469
|
const packageIndexes = /* @__PURE__ */ new Map();
|
|
466
470
|
const packageVariants = /* @__PURE__ */ new Map();
|
|
467
471
|
let pnpApi;
|
|
472
|
+
const getPackageKind = createPackageKindResolver(createWorkspacePackageKeySet(workspaceRoot, fsCache.getFsIdentity), fsCache.getFsIdentity);
|
|
468
473
|
function getPnpApi() {
|
|
469
474
|
if (scanScope === "global") return null;
|
|
470
475
|
if (pnpApi === void 0) {
|
|
@@ -505,6 +510,7 @@ function scanForIntents(root, options = {}) {
|
|
|
505
510
|
deriveIntentConfig,
|
|
506
511
|
discoverSkills: (skillsDir) => discoverSkills(skillsDir, fsCache),
|
|
507
512
|
getPackageDepth,
|
|
513
|
+
getPackageKind,
|
|
508
514
|
getFsIdentity: fsCache.getFsIdentity,
|
|
509
515
|
exists: fsCache.exists,
|
|
510
516
|
packageIndexes,
|
|
@@ -616,6 +622,7 @@ function scanIntentPackageAtRoot(packageRoot, options = {}) {
|
|
|
616
622
|
const warnings = [];
|
|
617
623
|
const packageIndexes = /* @__PURE__ */ new Map();
|
|
618
624
|
const fsCache = options.fsCache ?? createIntentFsCache();
|
|
625
|
+
const getPackageKind = createPackageKindResolver(createWorkspacePackageKeySet(findWorkspaceRoot(projectRoot), fsCache.getFsIdentity), fsCache.getFsIdentity);
|
|
619
626
|
function readPkgJson(dirPath) {
|
|
620
627
|
return fsCache.readPackageJson(dirPath);
|
|
621
628
|
}
|
|
@@ -624,6 +631,7 @@ function scanIntentPackageAtRoot(packageRoot, options = {}) {
|
|
|
624
631
|
deriveIntentConfig,
|
|
625
632
|
discoverSkills: options.skillNameHint ? (skillsDir, packageName) => discoverSkillByNameHint(skillsDir, packageName, options.skillNameHint, fsCache.getReadFs()) : (skillsDir) => discoverSkills(skillsDir, fsCache),
|
|
626
633
|
getPackageDepth,
|
|
634
|
+
getPackageKind,
|
|
627
635
|
getFsIdentity: fsCache.getFsIdentity,
|
|
628
636
|
exists: fsCache.exists,
|
|
629
637
|
packageIndexes,
|
|
@@ -640,6 +648,5 @@ function scanIntentPackageAtRoot(packageRoot, options = {}) {
|
|
|
640
648
|
warnings
|
|
641
649
|
};
|
|
642
650
|
}
|
|
643
|
-
|
|
644
651
|
//#endregion
|
|
645
|
-
export { scanIntentPackageAtRoot as n, createIntentFsCache as r, scanForIntents as t };
|
|
652
|
+
export { scanIntentPackageAtRoot as n, createIntentFsCache as r, scanForIntents as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/workspace-patterns.d.ts
|
|
2
|
-
|
|
3
2
|
declare function readWorkspacePatterns(root: string): Array<string> | null;
|
|
4
3
|
declare function resolveWorkspacePackages(root: string, patterns: Array<string>): Array<string>;
|
|
5
4
|
declare function findWorkspaceRoot(start: string): string | null;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { a as readWorkspacePatterns, r as findWorkspaceRoot, t as findPackagesWithSkills } from "./workspace-patterns-
|
|
2
|
-
import { t as resolveProjectContext } from "./project-context-
|
|
1
|
+
import { a as readWorkspacePatterns, r as findWorkspaceRoot, t as findPackagesWithSkills } from "./workspace-patterns-BDoJIWk-.mjs";
|
|
2
|
+
import { t as resolveProjectContext } from "./project-context-oi_m7paK.mjs";
|
|
3
3
|
import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { basename, join, relative } from "node:path";
|
|
5
|
-
|
|
6
5
|
//#region src/setup.ts
|
|
7
6
|
function isGenericWorkspaceName(name, root) {
|
|
8
7
|
const normalized = name.trim().toLowerCase();
|
|
@@ -195,6 +194,5 @@ function runSetupGithubActions(root, metaDir) {
|
|
|
195
194
|
}
|
|
196
195
|
return result;
|
|
197
196
|
}
|
|
198
|
-
|
|
199
197
|
//#endregion
|
|
200
|
-
export { runEditPackageJsonAll as n, runSetupGithubActions as r, runEditPackageJson as t };
|
|
198
|
+
export { runEditPackageJsonAll as n, runSetupGithubActions as r, runEditPackageJson as t };
|
|
@@ -3,6 +3,5 @@ async function runSetupGithubActionsCommand(root, metaDir) {
|
|
|
3
3
|
const { runSetupGithubActions } = await import("./setup.mjs");
|
|
4
4
|
runSetupGithubActions(root, metaDir);
|
|
5
5
|
}
|
|
6
|
-
|
|
7
6
|
//#endregion
|
|
8
|
-
export { runSetupGithubActionsCommand };
|
|
7
|
+
export { runSetupGithubActionsCommand };
|
package/dist/setup.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as runEditPackageJsonAll, c as findWorkspaceRoot, i as runEditPackageJson, l as readWorkspacePatterns, n as MonorepoResult, o as runSetupGithubActions, r as SetupGithubActionsResult, s as findPackagesWithSkills, t as EditPackageJsonResult, u as resolveWorkspacePackages } from "./setup-
|
|
1
|
+
import { a as runEditPackageJsonAll, c as findWorkspaceRoot, i as runEditPackageJson, l as readWorkspacePatterns, n as MonorepoResult, o as runSetupGithubActions, r as SetupGithubActionsResult, s as findPackagesWithSkills, t as EditPackageJsonResult, u as resolveWorkspacePackages } from "./setup-CdfBc7Oe.mjs";
|
|
2
2
|
export { EditPackageJsonResult, MonorepoResult, SetupGithubActionsResult, findPackagesWithSkills, findWorkspaceRoot, readWorkspacePatterns, resolveWorkspacePackages, runEditPackageJson, runEditPackageJsonAll, runSetupGithubActions };
|
package/dist/setup.mjs
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { n as runEditPackageJsonAll, r as runSetupGithubActions, t as runEditPackageJson } from "./setup-CMec7fht.mjs";
|
|
5
|
-
|
|
6
|
-
export { findPackagesWithSkills, findWorkspaceRoot, readWorkspacePatterns, resolveWorkspacePackages, runEditPackageJson, runEditPackageJsonAll, runSetupGithubActions };
|
|
1
|
+
import { a as readWorkspacePatterns, o as resolveWorkspacePackages, r as findWorkspaceRoot, t as findPackagesWithSkills } from "./workspace-patterns-BDoJIWk-.mjs";
|
|
2
|
+
import { n as runEditPackageJsonAll, r as runSetupGithubActions, t as runEditPackageJson } from "./setup-Cx1r2y-1.mjs";
|
|
3
|
+
export { findPackagesWithSkills, findWorkspaceRoot, readWorkspacePatterns, resolveWorkspacePackages, runEditPackageJson, runEditPackageJsonAll, runSetupGithubActions };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { d as toPosixPath } from "./utils-
|
|
1
|
+
import { d as toPosixPath } from "./utils-6FtqhOYf.mjs";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { join, relative } from "node:path";
|
|
4
|
-
|
|
5
4
|
//#region src/skill-paths.ts
|
|
6
5
|
function isAbsolutePath(path) {
|
|
7
6
|
return path.startsWith("/") || path.startsWith("\\") || /^[A-Za-z]:[\\/]/.test(path);
|
|
@@ -28,6 +27,5 @@ function formatRuntimeSkillLookupComment(target) {
|
|
|
28
27
|
function formatRuntimeSkillLookupHint(target) {
|
|
29
28
|
return `Lookup: ${formatRuntimeSkillLookupComment(target)}`;
|
|
30
29
|
}
|
|
31
|
-
|
|
32
30
|
//#endregion
|
|
33
|
-
export { isStableLoadPath as n, rewriteSkillLoadPaths as r, formatRuntimeSkillLookupHint as t };
|
|
31
|
+
export { isStableLoadPath as n, rewriteSkillLoadPaths as r, formatRuntimeSkillLookupHint as t };
|
|
@@ -37,6 +37,5 @@ function formatSkillUseParseErrorMessage(code, value) {
|
|
|
37
37
|
case "empty-skill": return `Invalid skill use "${value}": skill is required.`;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
|
|
41
40
|
//#endregion
|
|
42
|
-
export { parseSkillUse as i, formatSkillUse as n, isSkillUseParseError as r, SkillUseParseError as t };
|
|
41
|
+
export { parseSkillUse as i, formatSkillUse as n, isSkillUseParseError as r, SkillUseParseError as t };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { t as scanForIntents } from "./scanner-
|
|
2
|
-
import { t as resolveProjectContext } from "./project-context-
|
|
3
|
-
import { a as isSkillExcluded, i as isPackageExcluded, n as getConfigDirs, o as warningMentionsPackage, r as getEffectiveExcludePatterns, s as readPackageJson, t as compileExcludePatterns } from "./excludes-
|
|
4
|
-
|
|
1
|
+
import { t as scanForIntents } from "./scanner-C5bzzri5.mjs";
|
|
2
|
+
import { t as resolveProjectContext } from "./project-context-oi_m7paK.mjs";
|
|
3
|
+
import { a as isSkillExcluded, i as isPackageExcluded, n as getConfigDirs, o as warningMentionsPackage, r as getEffectiveExcludePatterns, s as readPackageJson, t as compileExcludePatterns } from "./excludes-ByvSbmmj.mjs";
|
|
5
4
|
//#region src/core/skill-sources.ts
|
|
6
5
|
var SkillSourcesParseError = class extends Error {
|
|
7
6
|
constructor(issues) {
|
|
@@ -135,7 +134,6 @@ function describeType(value) {
|
|
|
135
134
|
function formatIssues(issues) {
|
|
136
135
|
return ["Invalid intent.skills configuration:", ...issues.map((issue) => issue.raw === null ? ` - ${issue.message}` : ` - "${issue.raw}": ${issue.message}`)].join("\n");
|
|
137
136
|
}
|
|
138
|
-
|
|
139
137
|
//#endregion
|
|
140
138
|
//#region src/core/source-policy.ts
|
|
141
139
|
const ALLOW_ALL_NOTICE = "All skill sources allowed (intent.skills: [\"*\"]) — unvetted skills may be surfaced into agent guidance.";
|
|
@@ -242,6 +240,5 @@ function scanForPolicedIntents(params) {
|
|
|
242
240
|
excludePatterns
|
|
243
241
|
};
|
|
244
242
|
}
|
|
245
|
-
|
|
246
243
|
//#endregion
|
|
247
|
-
export { checkLoadAllowed as a, applySourcePolicy as i, EMPTY_NOTE as n, readSkillSourcesConfig as o, MIGRATION_NOTICE as r, scanForPolicedIntents as s, ALLOW_ALL_NOTICE as t };
|
|
244
|
+
export { checkLoadAllowed as a, applySourcePolicy as i, EMPTY_NOTE as n, readSkillSourcesConfig as o, MIGRATION_NOTICE as r, scanForPolicedIntents as s, ALLOW_ALL_NOTICE as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { n as isCliFailure } from "./cli-error-
|
|
2
|
-
|
|
1
|
+
import { n as isCliFailure } from "./cli-error-DDAO6DIL.mjs";
|
|
3
2
|
//#region src/commands/stale.ts
|
|
4
3
|
async function runStaleCommand(targetDir, options, resolveStaleTargets) {
|
|
5
4
|
if (options.githubReview) {
|
|
@@ -35,7 +34,7 @@ async function runStaleCommand(targetDir, options, resolveStaleTargets) {
|
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
36
|
async function runGithubReview(targetDir, options, resolveStaleTargets) {
|
|
38
|
-
const { collectStaleReviewItems, createFailedStaleReviewItem, createWorkflowAdvisoryReviewItems, writeStaleReviewWorkflowFiles } = await import("./workflow-review-
|
|
37
|
+
const { collectStaleReviewItems, createFailedStaleReviewItem, createWorkflowAdvisoryReviewItems, writeStaleReviewWorkflowFiles } = await import("./workflow-review-Bo2kPVXV.mjs");
|
|
39
38
|
const packageLabel = options.packageLabel ?? "workspace";
|
|
40
39
|
try {
|
|
41
40
|
const { reports, workflowAdvisories = [] } = await resolveStaleTargets(targetDir);
|
|
@@ -50,6 +49,5 @@ async function runGithubReview(targetDir, options, resolveStaleTargets) {
|
|
|
50
49
|
console.log("Wrote a review PR body so maintainers can inspect the logs.");
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
|
-
|
|
54
52
|
//#endregion
|
|
55
|
-
export { runStaleCommand };
|
|
53
|
+
export { runStaleCommand };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { c as parseFrontmatter, d as toPosixPath, l as readScalarField, r as findSkillFiles } from "./utils-
|
|
2
|
-
import { t as readIntentArtifacts } from "./artifact-coverage-
|
|
1
|
+
import { c as parseFrontmatter, d as toPosixPath, l as readScalarField, r as findSkillFiles } from "./utils-6FtqhOYf.mjs";
|
|
2
|
+
import { t as readIntentArtifacts } from "./artifact-coverage-DFtI6V_H.mjs";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
import { isAbsolute, join, relative, resolve } from "node:path";
|
|
5
5
|
import semver from "semver";
|
|
6
|
-
|
|
7
6
|
//#region src/staleness.ts
|
|
8
7
|
function classifyVersionDrift(oldVer, newVer) {
|
|
9
8
|
const oldVersion = normalizeVersion(oldVer);
|
|
@@ -126,10 +125,7 @@ function findMatchingSkill(artifact, skillMetas, packageDir, artifactRoot) {
|
|
|
126
125
|
if (match) return match;
|
|
127
126
|
}
|
|
128
127
|
const skillsByName = /* @__PURE__ */ new Map();
|
|
129
|
-
for (const skill of skillMetas)
|
|
130
|
-
skillsByName.set(skill.name, skill);
|
|
131
|
-
skillsByName.set(skill.relName, skill);
|
|
132
|
-
}
|
|
128
|
+
for (const skill of skillMetas) skillsByName.set(skill.relName, skill);
|
|
133
129
|
return (artifact.slug ? skillsByName.get(artifact.slug) : void 0) ?? (artifact.name ? skillsByName.get(artifact.name) : void 0) ?? null;
|
|
134
130
|
}
|
|
135
131
|
function buildArtifactSignals({ artifactRoot, artifacts, library, packageDir, skillMetas }) {
|
|
@@ -167,7 +163,7 @@ function buildArtifactSignals({ artifactRoot, artifacts, library, packageDir, sk
|
|
|
167
163
|
reasons: ["artifact sources differ from SKILL.md frontmatter sources"],
|
|
168
164
|
needsReview: true,
|
|
169
165
|
artifactPath: artifact.artifactPath,
|
|
170
|
-
skill: matchingSkill.
|
|
166
|
+
skill: matchingSkill.relName
|
|
171
167
|
});
|
|
172
168
|
const artifactVersion = artifactFiles.get(artifact.artifactPath)?.libraryVersion;
|
|
173
169
|
if (artifactVersion && matchingSkill.libraryVersion && artifactVersion !== matchingSkill.libraryVersion) signals.push({
|
|
@@ -177,7 +173,7 @@ function buildArtifactSignals({ artifactRoot, artifacts, library, packageDir, sk
|
|
|
177
173
|
reasons: [`artifact library.version (${artifactVersion}) differs from SKILL.md library_version (${matchingSkill.libraryVersion})`],
|
|
178
174
|
needsReview: true,
|
|
179
175
|
artifactPath: artifact.artifactPath,
|
|
180
|
-
skill: matchingSkill.
|
|
176
|
+
skill: matchingSkill.relName
|
|
181
177
|
});
|
|
182
178
|
}
|
|
183
179
|
return signals;
|
|
@@ -217,10 +213,8 @@ async function checkStaleness(packageDir, packageName, artifactRoot = packageDir
|
|
|
217
213
|
const library = packageName ?? readPackageName(packageDir);
|
|
218
214
|
const skillMetas = findSkillFiles(skillsDir).map((filePath) => {
|
|
219
215
|
const fm = parseFrontmatter(filePath);
|
|
220
|
-
const relName = toPosixPath(relative(skillsDir, filePath)).replace(/[/\\]SKILL\.md$/, "");
|
|
221
216
|
return {
|
|
222
|
-
|
|
223
|
-
relName,
|
|
217
|
+
relName: toPosixPath(relative(skillsDir, filePath)).replace(/[/\\]SKILL\.md$/, ""),
|
|
224
218
|
filePath,
|
|
225
219
|
libraryVersion: readScalarField(fm, "library_version"),
|
|
226
220
|
sources: Array.isArray(fm?.sources) ? fm.sources : void 0
|
|
@@ -239,12 +233,12 @@ async function checkStaleness(packageDir, packageName, artifactRoot = packageDir
|
|
|
239
233
|
skills: skillMetas.map((skill) => {
|
|
240
234
|
const reasons = [];
|
|
241
235
|
if (currentVersion && skill.libraryVersion && classifyVersionDrift(skill.libraryVersion, currentVersion) !== null) reasons.push(`version drift (${skill.libraryVersion} → ${currentVersion})`);
|
|
242
|
-
const storedShas = syncState?.skills?.[skill.
|
|
236
|
+
const storedShas = syncState?.skills?.[skill.relName]?.sources_sha ?? {};
|
|
243
237
|
if (skill.sources && Object.keys(storedShas).length > 0) {
|
|
244
238
|
for (const source of skill.sources) if (!storedShas[source]) reasons.push(`new source (${source})`);
|
|
245
239
|
}
|
|
246
240
|
return {
|
|
247
|
-
name: skill.
|
|
241
|
+
name: skill.relName,
|
|
248
242
|
reasons,
|
|
249
243
|
needsReview: reasons.length > 0
|
|
250
244
|
};
|
|
@@ -258,6 +252,5 @@ async function checkStaleness(packageDir, packageName, artifactRoot = packageDir
|
|
|
258
252
|
})
|
|
259
253
|
};
|
|
260
254
|
}
|
|
261
|
-
|
|
262
255
|
//#endregion
|
|
263
|
-
export { checkStaleness as n, readPackageName as r, buildWorkspaceCoverageSignals as t };
|
|
256
|
+
export { checkStaleness as n, readPackageName as r, buildWorkspaceCoverageSignals as t };
|
|
@@ -15,7 +15,7 @@ interface ScanResult {
|
|
|
15
15
|
local: NodeModulesScanTarget;
|
|
16
16
|
global: NodeModulesScanTarget;
|
|
17
17
|
};
|
|
18
|
-
stats
|
|
18
|
+
stats: ScanStats;
|
|
19
19
|
}
|
|
20
20
|
type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun' | 'unknown';
|
|
21
21
|
type ScanScope = 'local' | 'local-and-global' | 'global';
|
|
@@ -40,6 +40,7 @@ interface IntentPackage {
|
|
|
40
40
|
intent: IntentConfig;
|
|
41
41
|
skills: Array<SkillEntry>;
|
|
42
42
|
packageRoot: string;
|
|
43
|
+
kind: 'npm' | 'workspace';
|
|
43
44
|
source: 'local' | 'global';
|
|
44
45
|
}
|
|
45
46
|
interface InstalledVariant {
|
|
@@ -3,7 +3,6 @@ import { closeSync, existsSync, lstatSync, openSync, readFileSync, readSync, rea
|
|
|
3
3
|
import { dirname, join, resolve, sep } from "node:path";
|
|
4
4
|
import { execFileSync } from "node:child_process";
|
|
5
5
|
import { parse } from "yaml";
|
|
6
|
-
|
|
7
6
|
//#region src/utils.ts
|
|
8
7
|
const nodeReadFs = {
|
|
9
8
|
existsSync,
|
|
@@ -290,6 +289,5 @@ function readFrontmatterRegion(filePath, fs) {
|
|
|
290
289
|
return null;
|
|
291
290
|
}
|
|
292
291
|
}
|
|
293
|
-
|
|
294
292
|
//#endregion
|
|
295
|
-
export { listNestedNodeModulesPackageDirs as a, parseFrontmatter as c, toPosixPath as d, getDeps as i, readScalarField as l, detectGlobalNodeModules as n, listNodeModulesPackageDirs as o, findSkillFiles as r, nodeReadFs as s, createFsIdentityCache as t, resolveDepDir as u };
|
|
293
|
+
export { listNestedNodeModulesPackageDirs as a, parseFrontmatter as c, toPosixPath as d, getDeps as i, readScalarField as l, detectGlobalNodeModules as n, listNodeModulesPackageDirs as o, findSkillFiles as r, nodeReadFs as s, createFsIdentityCache as t, resolveDepDir as u };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { a as listNestedNodeModulesPackageDirs, c as parseFrontmatter, d as toPosixPath, i as getDeps, l as readScalarField, n as detectGlobalNodeModules, o as listNodeModulesPackageDirs, r as findSkillFiles, s as nodeReadFs, t as createFsIdentityCache, u as resolveDepDir } from "./utils-
|
|
2
|
-
|
|
3
|
-
export { createFsIdentityCache, detectGlobalNodeModules, findSkillFiles, getDeps, listNestedNodeModulesPackageDirs, listNodeModulesPackageDirs, nodeReadFs, parseFrontmatter, readScalarField, resolveDepDir, toPosixPath };
|
|
1
|
+
import { a as listNestedNodeModulesPackageDirs, c as parseFrontmatter, d as toPosixPath, i as getDeps, l as readScalarField, n as detectGlobalNodeModules, o as listNodeModulesPackageDirs, r as findSkillFiles, s as nodeReadFs, t as createFsIdentityCache, u as resolveDepDir } from "./utils-6FtqhOYf.mjs";
|
|
2
|
+
export { createFsIdentityCache, detectGlobalNodeModules, findSkillFiles, getDeps, listNestedNodeModulesPackageDirs, listNodeModulesPackageDirs, nodeReadFs, parseFrontmatter, readScalarField, resolveDepDir, toPosixPath };
|