@tanstack/intent 0.0.40 → 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.
- package/dist/artifact-coverage-CbZALe7Q.mjs +3 -0
- package/dist/{cli-support-DtqVDiJv.mjs → cli-support-BHoEb9y1.mjs} +6 -6
- package/dist/{cli-support-Cb9lNXhL.mjs → cli-support-BxF1HIpw.mjs} +4 -4
- package/dist/cli.mjs +11 -11
- package/dist/command-runner-DJTliSTc.mjs +16 -0
- package/dist/{core-BOSjgetf.mjs → core-DEiRgUqe.mjs} +21 -19
- package/dist/core.d.mts +2 -1
- package/dist/core.mjs +7 -7
- package/dist/{display-DHNuzSqR.mjs → display-BPM-AJGc.mjs} +12 -2
- package/dist/display-lWCJg5Bo.mjs +5 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +11 -11
- package/dist/{install-CLkmoPOY.mjs → install-DCiBBx55.mjs} +14 -10
- package/dist/install-EVdqAy8f.mjs +7 -0
- package/dist/intent-library.mjs +8 -8
- package/dist/{library-scanner-BAJ7bXtW.mjs → library-scanner-BpEuR__1.mjs} +2 -2
- package/dist/library-scanner.d.mts +1 -1
- package/dist/library-scanner.mjs +3 -3
- package/dist/{list-CxSm8YYl.mjs → list-CpOcnLWv.mjs} +16 -10
- package/dist/{load-DF-zIT3-.mjs → load-BxmN8f0E.mjs} +9 -9
- package/dist/{meta-BNSVXFQu.mjs → meta-Dstclm2x.mjs} +2 -2
- package/dist/package-manager-DDZck142.mjs +48 -0
- package/dist/{project-context-Bv9BDh8B.mjs → project-context-D4mFnCs7.mjs} +1 -1
- package/dist/{resolver-BDsZ3kWg.mjs → resolver-B36uOK8c.mjs} +2 -2
- package/dist/{scanner-BGyQTQ3U.mjs → scanner-B6nnctK4.mjs} +39 -40
- package/dist/scanner-BWd4mS25.mjs +6 -0
- package/dist/{setup-DQMKxEoA.mjs → setup-J4A9UfBB.mjs} +2 -2
- package/dist/setup.d.mts +1 -1
- package/dist/setup.mjs +4 -4
- package/dist/{skill-paths-BHbdWniB.mjs → skill-paths-4kQXfQXo.mjs} +1 -1
- package/dist/{stale-flPZnWfI.mjs → stale-BD77r7KR.mjs} +1 -1
- package/dist/{staleness-CGLs-swr.mjs → staleness-DChVhbCN.mjs} +2 -2
- package/dist/staleness-Dm4laJFc.mjs +5 -0
- package/dist/{types-Cq5cY9h9.d.mts → types-DU_Z0qNT.d.mts} +3 -2
- package/dist/{utils-BPDvfmcd.mjs → utils-Chn-30vI.mjs} +60 -3
- package/dist/utils-Ctlz_JG-.mjs +3 -0
- package/dist/{validate-Divq4AiV.mjs → validate-CTSG3eDc.mjs} +6 -6
- package/dist/{workflow-review-CIdJXmKP.mjs → workflow-review-DcFipeG0.mjs} +1 -1
- package/dist/{workspace-patterns-CIJQCwbJ.mjs → workspace-patterns-C5O4Dfpl.mjs} +1 -1
- package/dist/{workspace-patterns-Diy5gtz_.mjs → workspace-patterns-CA-UGM5C.mjs} +2 -2
- package/package.json +1 -1
- package/dist/artifact-coverage-DA26utB1.mjs +0 -3
- package/dist/display-CmLzVAae.mjs +0 -5
- package/dist/install-ChddjnhO.mjs +0 -7
- package/dist/scanner-Ix6MmxfB.mjs +0 -6
- package/dist/staleness-Dl-m8JWM.mjs +0 -5
- package/dist/utils-DqdIC3RY.mjs +0 -3
- /package/dist/{artifact-coverage-DgWuVqUp.mjs → artifact-coverage-Cqphhpfo.mjs} +0 -0
- /package/dist/{cli-error-BrMXlbtx.mjs → cli-error-DOO5bLIG.mjs} +0 -0
- /package/dist/{edit-package-json-CzWlMXOf.mjs → edit-package-json-cPClxVZZ.mjs} +0 -0
- /package/dist/{scaffold-D2vwv9ls.mjs → scaffold-CaShIIUY.mjs} +0 -0
- /package/dist/{setup-2SE9zYJk.d.mts → setup-DL7qX_F-.d.mts} +0 -0
- /package/dist/{setup-github-actions-emXSyGy3.mjs → setup-github-actions-zzLUbyAL.mjs} +0 -0
- /package/dist/{skill-use-umYvZl94.mjs → skill-use-C0q2MEEX.mjs} +0 -0
- /package/dist/{workflow-review-CwcR2ge4.mjs → workflow-review--Gc_yplP.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as resolveProjectContext } from "./project-context-
|
|
2
|
-
import { t as fail } from "./cli-error-
|
|
1
|
+
import { t as resolveProjectContext } from "./project-context-D4mFnCs7.mjs";
|
|
2
|
+
import { t as fail } from "./cli-error-DOO5bLIG.mjs";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
import { dirname, join, relative, resolve } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
@@ -31,7 +31,7 @@ function getCheckSkillsWorkflowAdvisories(root) {
|
|
|
31
31
|
return [`Intent workflow update available: run \`npx @tanstack/intent@latest setup\` to refresh ${relative(process.cwd(), workflowPath) || workflowPath}.`];
|
|
32
32
|
}
|
|
33
33
|
async function scanIntentsOrFail(options) {
|
|
34
|
-
const { scanForIntents } = await import("./scanner-
|
|
34
|
+
const { scanForIntents } = await import("./scanner-BWd4mS25.mjs");
|
|
35
35
|
try {
|
|
36
36
|
return scanForIntents(void 0, options);
|
|
37
37
|
} catch (err) {
|
|
@@ -68,18 +68,18 @@ async function resolveStaleTargets(targetDir) {
|
|
|
68
68
|
targetPath: targetDir
|
|
69
69
|
});
|
|
70
70
|
const workflowAdvisories = getCheckSkillsWorkflowAdvisories(context.workspaceRoot ?? context.packageRoot ?? resolvedRoot);
|
|
71
|
-
const { buildWorkspaceCoverageSignals, checkStaleness, readPackageName } = await import("./staleness-
|
|
71
|
+
const { buildWorkspaceCoverageSignals, checkStaleness, readPackageName } = await import("./staleness-Dm4laJFc.mjs");
|
|
72
72
|
const isWorkspaceRootTarget = context.workspaceRoot !== null && resolvedRoot === context.workspaceRoot;
|
|
73
73
|
if (context.packageRoot && !isWorkspaceRootTarget && (context.targetSkillsDir !== null || context.workspaceRoot === null)) return {
|
|
74
74
|
reports: [await checkStaleness(context.packageRoot, readPackageName(context.packageRoot), context.workspaceRoot ?? context.packageRoot)],
|
|
75
75
|
workflowAdvisories
|
|
76
76
|
};
|
|
77
|
-
const { findWorkspaceRoot, getWorkspaceInfo } = await import("./workspace-patterns-
|
|
77
|
+
const { findWorkspaceRoot, getWorkspaceInfo } = await import("./workspace-patterns-CA-UGM5C.mjs");
|
|
78
78
|
const workspaceRoot = findWorkspaceRoot(resolvedRoot);
|
|
79
79
|
const workspaceInfo = workspaceRoot ? getWorkspaceInfo(workspaceRoot) : null;
|
|
80
80
|
if (workspaceInfo) {
|
|
81
81
|
const reports = await Promise.all(workspaceInfo.packageDirsWithSkills.map((packageDir) => checkStaleness(packageDir, readPackageName(packageDir), workspaceInfo.root)));
|
|
82
|
-
const { readIntentArtifacts } = await import("./artifact-coverage-
|
|
82
|
+
const { readIntentArtifacts } = await import("./artifact-coverage-CbZALe7Q.mjs");
|
|
83
83
|
const artifacts = existsSync(join(workspaceInfo.root, "_artifacts")) ? readIntentArtifacts(workspaceInfo.root) : null;
|
|
84
84
|
const coverageSignals = buildWorkspaceCoverageSignals({
|
|
85
85
|
artifactRoot: workspaceInfo.root,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./utils-
|
|
2
|
-
import "./workspace-patterns-
|
|
3
|
-
import "./project-context-
|
|
4
|
-
import { a as printDebugInfo, c as scanOptionsFromGlobalFlags, i as getMetaDir, l as printWarnings, n as coreOptionsFromGlobalFlags, o as resolveStaleTargets, r as getCheckSkillsWorkflowAdvisories, s as scanIntentsOrFail, t as INTENT_CHECK_SKILLS_WORKFLOW_VERSION } from "./cli-support-
|
|
1
|
+
import "./utils-Chn-30vI.mjs";
|
|
2
|
+
import "./workspace-patterns-C5O4Dfpl.mjs";
|
|
3
|
+
import "./project-context-D4mFnCs7.mjs";
|
|
4
|
+
import { a as printDebugInfo, c as scanOptionsFromGlobalFlags, i as getMetaDir, l as printWarnings, n as coreOptionsFromGlobalFlags, o as resolveStaleTargets, r as getCheckSkillsWorkflowAdvisories, s as scanIntentsOrFail, t as INTENT_CHECK_SKILLS_WORKFLOW_VERSION } from "./cli-support-BHoEb9y1.mjs";
|
|
5
5
|
|
|
6
6
|
export { INTENT_CHECK_SKILLS_WORKFLOW_VERSION, coreOptionsFromGlobalFlags, getCheckSkillsWorkflowAdvisories, getMetaDir, printDebugInfo, printWarnings, resolveStaleTargets, scanIntentsOrFail, scanOptionsFromGlobalFlags };
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as isCliFailure, t as fail } from "./cli-error-
|
|
2
|
+
import { n as isCliFailure, t as fail } from "./cli-error-DOO5bLIG.mjs";
|
|
3
3
|
import { realpathSync } from "node:fs";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { cac } from "cac";
|
|
@@ -9,43 +9,43 @@ function createCli() {
|
|
|
9
9
|
const cli = cac("intent");
|
|
10
10
|
cli.usage("<command> [options]");
|
|
11
11
|
cli.command("list", "Discover intent-enabled packages from the project or workspace").usage("list [--json] [--debug] [--exclude <pattern>] [--global] [--global-only]").option("--json", "Output JSON").option("--debug", "Print discovery debug details to stderr").option("--exclude <pattern>", "Exclude package name glob").option("--global", "Include global packages after project packages").option("--global-only", "List global packages only").example("list").example("list --json").example("list --global").action(async (options) => {
|
|
12
|
-
const { runListCommand } = await import("./list-
|
|
12
|
+
const { runListCommand } = await import("./list-CpOcnLWv.mjs");
|
|
13
13
|
await runListCommand(options);
|
|
14
14
|
});
|
|
15
15
|
cli.command("load [use]", "Load a compact skill use and print its SKILL.md").usage("load <use> [--path] [--json] [--debug] [--exclude <pattern>] [--global] [--global-only]").option("--path", "Print the resolved skill path instead of file content").option("--json", "Output JSON").option("--debug", "Print resolution debug details to stderr").option("--exclude <pattern>", "Exclude package name glob").option("--global", "Load from project packages, then global packages").option("--global-only", "Load from global packages only").example("load @tanstack/query#core").example("load @tanstack/query#core --path").action(async (use, options) => {
|
|
16
|
-
const { runLoadCommand } = await import("./load-
|
|
16
|
+
const { runLoadCommand } = await import("./load-BxmN8f0E.mjs");
|
|
17
17
|
await runLoadCommand(use, options);
|
|
18
18
|
});
|
|
19
19
|
cli.command("meta [name]", "List meta-skills, or print one by name").usage("meta [name]").example("meta").example("meta domain-discovery").action(async (name) => {
|
|
20
|
-
const [{ getMetaDir }, { runMetaCommand }] = await Promise.all([import("./cli-support-
|
|
20
|
+
const [{ getMetaDir }, { runMetaCommand }] = await Promise.all([import("./cli-support-BxF1HIpw.mjs"), import("./meta-Dstclm2x.mjs")]);
|
|
21
21
|
await runMetaCommand(name, getMetaDir());
|
|
22
22
|
});
|
|
23
23
|
cli.command("validate [dir]", "Validate skill files").usage("validate [dir] [--github-summary]").option("--github-summary", "Write a GitHub Actions step summary").example("validate").example("validate packages/query/skills").action(async (dir, options) => {
|
|
24
|
-
const { runValidateCommand } = await import("./validate-
|
|
24
|
+
const { runValidateCommand } = await import("./validate-CTSG3eDc.mjs");
|
|
25
25
|
await runValidateCommand(dir, options);
|
|
26
26
|
});
|
|
27
27
|
cli.command("install", "Create or update skill loading guidance in an agent config file").usage("install [--map] [--dry-run] [--print-prompt] [--global] [--global-only]").option("--map", "Write explicit skill-to-task mappings").option("--dry-run", "Print the generated block without writing").option("--print-prompt", "Print the legacy agent setup prompt instead of writing").option("--global", "Include global packages after project packages").option("--global-only", "Install mappings from global packages only").example("install").example("install --map").example("install --dry-run").example("install --print-prompt").example("install --global").action(async (options) => {
|
|
28
|
-
const [{ scanIntentsOrFail }, { runInstallCommand }] = await Promise.all([import("./cli-support-
|
|
28
|
+
const [{ scanIntentsOrFail }, { runInstallCommand }] = await Promise.all([import("./cli-support-BxF1HIpw.mjs"), import("./install-EVdqAy8f.mjs")]);
|
|
29
29
|
await runInstallCommand(options, scanIntentsOrFail);
|
|
30
30
|
});
|
|
31
31
|
cli.command("scaffold", "Print maintainer scaffold prompt").usage("scaffold").action(async () => {
|
|
32
|
-
const [{ getMetaDir }, { runScaffoldCommand }] = await Promise.all([import("./cli-support-
|
|
32
|
+
const [{ getMetaDir }, { runScaffoldCommand }] = await Promise.all([import("./cli-support-BxF1HIpw.mjs"), import("./scaffold-CaShIIUY.mjs")]);
|
|
33
33
|
runScaffoldCommand(getMetaDir());
|
|
34
34
|
});
|
|
35
35
|
cli.command("stale [dir]", "Check skills for staleness in the current package or workspace").usage("stale [dir] [--json] [--github-review]").option("--json", "Output JSON").option("--github-review", "Write GitHub Actions review PR files").option("--package-label <label>", "Fallback package label for review PRs").example("stale").example("stale packages/query").example("stale --json").action(async (targetDir, options) => {
|
|
36
|
-
const [{ resolveStaleTargets }, { runStaleCommand }] = await Promise.all([import("./cli-support-
|
|
36
|
+
const [{ resolveStaleTargets }, { runStaleCommand }] = await Promise.all([import("./cli-support-BxF1HIpw.mjs"), import("./stale-BD77r7KR.mjs")]);
|
|
37
37
|
await runStaleCommand(targetDir, options, resolveStaleTargets);
|
|
38
38
|
});
|
|
39
39
|
cli.command("edit-package-json", "Update package.json files so skills are published").usage("edit-package-json").action(async () => {
|
|
40
|
-
const { runEditPackageJsonCommand } = await import("./edit-package-json-
|
|
40
|
+
const { runEditPackageJsonCommand } = await import("./edit-package-json-cPClxVZZ.mjs");
|
|
41
41
|
await runEditPackageJsonCommand(process.cwd());
|
|
42
42
|
});
|
|
43
43
|
cli.command("setup", "Copy Intent CI workflow templates into .github/workflows/").usage("setup").action(async () => {
|
|
44
|
-
const [{ getMetaDir }, { runSetupGithubActionsCommand }] = await Promise.all([import("./cli-support-
|
|
44
|
+
const [{ getMetaDir }, { runSetupGithubActionsCommand }] = await Promise.all([import("./cli-support-BxF1HIpw.mjs"), import("./setup-github-actions-zzLUbyAL.mjs")]);
|
|
45
45
|
await runSetupGithubActionsCommand(process.cwd(), getMetaDir());
|
|
46
46
|
});
|
|
47
47
|
cli.command("setup-github-actions", "Copy Intent CI workflow templates into .github/workflows/").usage("setup-github-actions").action(async () => {
|
|
48
|
-
const [{ getMetaDir }, { runSetupGithubActionsCommand }] = await Promise.all([import("./cli-support-
|
|
48
|
+
const [{ getMetaDir }, { runSetupGithubActionsCommand }] = await Promise.all([import("./cli-support-BxF1HIpw.mjs"), import("./setup-github-actions-zzLUbyAL.mjs")]);
|
|
49
49
|
await runSetupGithubActionsCommand(process.cwd(), getMetaDir());
|
|
50
50
|
});
|
|
51
51
|
cli.command("help [command]", "Display help for a command").action((commandName) => {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/command-runner.ts
|
|
2
|
+
const runnerByPackageManager = {
|
|
3
|
+
bun: "bunx @tanstack/intent@latest",
|
|
4
|
+
npm: "npx @tanstack/intent@latest",
|
|
5
|
+
pnpm: "pnpm dlx @tanstack/intent@latest",
|
|
6
|
+
unknown: "npx @tanstack/intent@latest",
|
|
7
|
+
yarn: "yarn dlx @tanstack/intent@latest"
|
|
8
|
+
};
|
|
9
|
+
function formatIntentCommand(packageManager, args) {
|
|
10
|
+
const command = runnerByPackageManager[packageManager];
|
|
11
|
+
const trimmedArgs = args.trim();
|
|
12
|
+
return trimmedArgs ? `${command} ${trimmedArgs}` : command;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { formatIntentCommand as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as scanIntentPackageAtRoot, r as createIntentFsCache, t as scanForIntents } from "./scanner-
|
|
3
|
-
import { n as findWorkspacePackages } from "./workspace-patterns-
|
|
4
|
-
import { i as parseSkillUse, n as formatSkillUse } from "./skill-use-
|
|
5
|
-
import { t as resolveProjectContext } from "./project-context-
|
|
6
|
-
import { a as compileExcludePatterns, c as warningMentionsPackage, i as resolveSkillUse, o as getEffectiveExcludePatterns, r as resolveSkillEntry, s as isPackageExcluded, t as ResolveSkillUseError } from "./resolver-
|
|
1
|
+
import { c as resolveDepDir, i as getDeps, l as toPosixPath } from "./utils-Chn-30vI.mjs";
|
|
2
|
+
import { n as scanIntentPackageAtRoot, r as createIntentFsCache, t as scanForIntents } from "./scanner-B6nnctK4.mjs";
|
|
3
|
+
import { n as findWorkspacePackages } from "./workspace-patterns-C5O4Dfpl.mjs";
|
|
4
|
+
import { i as parseSkillUse, n as formatSkillUse } from "./skill-use-C0q2MEEX.mjs";
|
|
5
|
+
import { t as resolveProjectContext } from "./project-context-D4mFnCs7.mjs";
|
|
6
|
+
import { a as compileExcludePatterns, c as warningMentionsPackage, i as resolveSkillUse, o as getEffectiveExcludePatterns, r as resolveSkillEntry, s as isPackageExcluded, t as ResolveSkillUseError } from "./resolver-B36uOK8c.mjs";
|
|
7
7
|
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
8
8
|
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
9
9
|
|
|
@@ -365,20 +365,22 @@ function listIntentSkills(options = {}) {
|
|
|
365
365
|
const excludeMatchers = compileExcludePatterns(excludePatterns);
|
|
366
366
|
const excludedPackages = scanResult.packages.filter((pkg) => isPackageExcluded(pkg.name, excludeMatchers)).map((pkg) => pkg.name);
|
|
367
367
|
const packages = scanResult.packages.filter((pkg) => !isPackageExcluded(pkg.name, excludeMatchers));
|
|
368
|
+
const skills = packages.flatMap((pkg) => pkg.skills.map((skill) => {
|
|
369
|
+
return {
|
|
370
|
+
use: formatSkillUse(pkg.name, skill.name),
|
|
371
|
+
packageName: pkg.name,
|
|
372
|
+
packageRoot: pkg.packageRoot,
|
|
373
|
+
packageVersion: pkg.version,
|
|
374
|
+
packageSource: pkg.source,
|
|
375
|
+
skillName: skill.name,
|
|
376
|
+
description: skill.description,
|
|
377
|
+
type: skill.type,
|
|
378
|
+
framework: skill.framework
|
|
379
|
+
};
|
|
380
|
+
}));
|
|
368
381
|
const result = {
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
use: formatSkillUse(pkg.name, skill.name),
|
|
372
|
-
packageName: pkg.name,
|
|
373
|
-
packageRoot: pkg.packageRoot,
|
|
374
|
-
packageVersion: pkg.version,
|
|
375
|
-
packageSource: pkg.source,
|
|
376
|
-
skillName: skill.name,
|
|
377
|
-
description: skill.description,
|
|
378
|
-
type: skill.type,
|
|
379
|
-
framework: skill.framework
|
|
380
|
-
};
|
|
381
|
-
})),
|
|
382
|
+
packageManager: scanResult.packageManager,
|
|
383
|
+
skills,
|
|
382
384
|
packages: packages.map((pkg) => ({
|
|
383
385
|
name: pkg.name,
|
|
384
386
|
version: pkg.version,
|
package/dist/core.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as VersionConflict, _ as ScanStats, g as ScanScope, l as IntentPackage, p as PackageManager } from "./types-DU_Z0qNT.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/core/types.d.ts
|
|
4
4
|
interface IntentCoreOptions {
|
|
@@ -27,6 +27,7 @@ interface IntentPackageSummary {
|
|
|
27
27
|
skillCount: number;
|
|
28
28
|
}
|
|
29
29
|
interface IntentSkillList {
|
|
30
|
+
packageManager: PackageManager;
|
|
30
31
|
skills: Array<IntentSkillSummary>;
|
|
31
32
|
packages: Array<IntentPackageSummary>;
|
|
32
33
|
warnings: Array<string>;
|
package/dist/core.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./utils-
|
|
2
|
-
import "./skill-paths-
|
|
3
|
-
import "./scanner-
|
|
4
|
-
import "./workspace-patterns-
|
|
5
|
-
import "./project-context-
|
|
6
|
-
import "./resolver-
|
|
7
|
-
import { i as resolveIntentSkill, n as listIntentSkills, r as loadIntentSkill, t as IntentCoreError } from "./core-
|
|
1
|
+
import "./utils-Chn-30vI.mjs";
|
|
2
|
+
import "./skill-paths-4kQXfQXo.mjs";
|
|
3
|
+
import "./scanner-B6nnctK4.mjs";
|
|
4
|
+
import "./workspace-patterns-C5O4Dfpl.mjs";
|
|
5
|
+
import "./project-context-D4mFnCs7.mjs";
|
|
6
|
+
import "./resolver-B36uOK8c.mjs";
|
|
7
|
+
import { i as resolveIntentSkill, n as listIntentSkills, r as loadIntentSkill, t as IntentCoreError } from "./core-DEiRgUqe.mjs";
|
|
8
8
|
|
|
9
9
|
export { IntentCoreError, listIntentSkills, loadIntentSkill, resolveIntentSkill };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as isStableLoadPath, t as formatRuntimeSkillLookupHint } from "./skill-paths-
|
|
1
|
+
import { n as isStableLoadPath, t as formatRuntimeSkillLookupHint } from "./skill-paths-4kQXfQXo.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/display.ts
|
|
4
4
|
function padColumn(text, width) {
|
|
@@ -17,6 +17,7 @@ function printSkillLine(displayName, skill, indent, opts) {
|
|
|
17
17
|
const padding = " ".repeat(Math.max(2, opts.nameWidth - nameStr.length));
|
|
18
18
|
const typeCol = opts.showTypes ? (skill.type ? `[${skill.type}]` : "").padEnd(14) : "";
|
|
19
19
|
console.log(`${nameStr}${padding}${typeCol}${skill.description}`);
|
|
20
|
+
if (skill.loadCommand) console.log(`${" ".repeat(indent + 2)}Load: ${skill.loadCommand}`);
|
|
20
21
|
if (skill.path) {
|
|
21
22
|
const pathIndent = " ".repeat(indent + 2);
|
|
22
23
|
if (isStableLoadPath(skill.path)) console.log(`${pathIndent}${skill.path}`);
|
|
@@ -29,6 +30,7 @@ function printSkillLine(displayName, skill, indent, opts) {
|
|
|
29
30
|
function printSkillTree(skills, opts) {
|
|
30
31
|
const roots = [];
|
|
31
32
|
const children = /* @__PURE__ */ new Map();
|
|
33
|
+
const printedSkills = /* @__PURE__ */ new Set();
|
|
32
34
|
for (const skill of skills) {
|
|
33
35
|
const slashIdx = skill.name.indexOf("/");
|
|
34
36
|
if (slashIdx === -1) roots.push(skill.name);
|
|
@@ -45,7 +47,15 @@ function printSkillTree(skills, opts) {
|
|
|
45
47
|
const rootSkill = skills.find((s) => s.name === rootName);
|
|
46
48
|
if (!rootSkill) continue;
|
|
47
49
|
printSkillLine(rootName, rootSkill, 4, opts);
|
|
48
|
-
|
|
50
|
+
printedSkills.add(rootSkill.name);
|
|
51
|
+
for (const sub of children.get(rootName) ?? []) {
|
|
52
|
+
printSkillLine(sub.name.slice(sub.name.indexOf("/") + 1), sub, 6, opts);
|
|
53
|
+
printedSkills.add(sub.name);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
for (const skill of skills) {
|
|
57
|
+
if (printedSkills.has(skill.name)) continue;
|
|
58
|
+
printSkillLine(skill.name, skill, 4, opts);
|
|
49
59
|
}
|
|
50
60
|
}
|
|
51
61
|
function computeSkillNameWidth(allPackageSkills) {
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as runEditPackageJson, o as runSetupGithubActions, r as SetupGithubActionsResult, t as EditPackageJsonResult } from "./setup-
|
|
1
|
+
import { S as VersionConflict, a as IntentArtifactSet, b as StalenessReport, c as IntentConfig, d as MetaFeedbackPayload, f as MetaSkillName, h as ScanResult, i as IntentArtifactFile, l as IntentPackage, m as ScanOptions, n as FeedbackPayload, o as IntentArtifactSkill, r as IntentArtifactCoverageIgnore, s as IntentArtifactWarning, t as AgentName, u as IntentProjectConfig, v as SkillEntry, x as StalenessSignal, y as SkillStaleness } from "./types-DU_Z0qNT.mjs";
|
|
2
|
+
import { i as runEditPackageJson, o as runSetupGithubActions, r as SetupGithubActionsResult, t as EditPackageJsonResult } from "./setup-DL7qX_F-.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/scanner.d.ts
|
|
5
5
|
declare function scanForIntents(root?: string, options?: ScanOptions): ScanResult;
|
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./skill-paths-
|
|
3
|
-
import { t as scanForIntents } from "./scanner-
|
|
4
|
-
import "./workspace-patterns-
|
|
5
|
-
import { t as readIntentArtifacts } from "./artifact-coverage-
|
|
6
|
-
import { n as checkStaleness } from "./staleness-
|
|
7
|
-
import { n as collectStaleReviewItems, r as createFailedStaleReviewItem, t as buildStaleReviewBody } from "./workflow-review
|
|
8
|
-
import { i as parseSkillUse, n as formatSkillUse, r as isSkillUseParseError, t as SkillUseParseError } from "./skill-use-
|
|
9
|
-
import "./project-context-
|
|
10
|
-
import { i as resolveSkillUse, n as isResolveSkillUseError, t as ResolveSkillUseError } from "./resolver-
|
|
11
|
-
import { r as runSetupGithubActions, t as runEditPackageJson } from "./setup-
|
|
1
|
+
import { c as resolveDepDir, i as getDeps, r as findSkillFiles, s as parseFrontmatter } from "./utils-Chn-30vI.mjs";
|
|
2
|
+
import "./skill-paths-4kQXfQXo.mjs";
|
|
3
|
+
import { t as scanForIntents } from "./scanner-B6nnctK4.mjs";
|
|
4
|
+
import "./workspace-patterns-C5O4Dfpl.mjs";
|
|
5
|
+
import { t as readIntentArtifacts } from "./artifact-coverage-Cqphhpfo.mjs";
|
|
6
|
+
import { n as checkStaleness } from "./staleness-DChVhbCN.mjs";
|
|
7
|
+
import { n as collectStaleReviewItems, r as createFailedStaleReviewItem, t as buildStaleReviewBody } from "./workflow-review--Gc_yplP.mjs";
|
|
8
|
+
import { i as parseSkillUse, n as formatSkillUse, r as isSkillUseParseError, t as SkillUseParseError } from "./skill-use-C0q2MEEX.mjs";
|
|
9
|
+
import "./project-context-D4mFnCs7.mjs";
|
|
10
|
+
import { i as resolveSkillUse, n as isResolveSkillUseError, t as ResolveSkillUseError } from "./resolver-B36uOK8c.mjs";
|
|
11
|
+
import { r as runSetupGithubActions, t as runEditPackageJson } from "./setup-J4A9UfBB.mjs";
|
|
12
12
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
13
13
|
import { join } from "node:path";
|
|
14
14
|
import { execFileSync, execSync } from "node:child_process";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { t as detectPackageManager } from "./package-manager-DDZck142.mjs";
|
|
2
|
+
import { i as parseSkillUse, n as formatSkillUse } from "./skill-use-C0q2MEEX.mjs";
|
|
3
|
+
import { t as fail } from "./cli-error-DOO5bLIG.mjs";
|
|
4
|
+
import { t as formatIntentCommand } from "./command-runner-DJTliSTc.mjs";
|
|
5
|
+
import { c as scanOptionsFromGlobalFlags, l as printWarnings } from "./cli-support-BHoEb9y1.mjs";
|
|
4
6
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
7
|
import { dirname, join, relative } from "node:path";
|
|
6
8
|
import { parse } from "yaml";
|
|
@@ -126,7 +128,7 @@ function formatWhen(packageName, skill) {
|
|
|
126
128
|
function buildIntentSkillsBlock(scanResult) {
|
|
127
129
|
const lines = [
|
|
128
130
|
INTENT_SKILLS_START,
|
|
129
|
-
|
|
131
|
+
`# Skill mappings - load \`use\` with \`${formatIntentCommand(scanResult.packageManager, "load <use>")}\`.`,
|
|
130
132
|
"skills:"
|
|
131
133
|
];
|
|
132
134
|
let mappingCount = 0;
|
|
@@ -143,15 +145,17 @@ function buildIntentSkillsBlock(scanResult) {
|
|
|
143
145
|
mappingCount
|
|
144
146
|
};
|
|
145
147
|
}
|
|
146
|
-
function buildIntentSkillGuidanceBlock() {
|
|
148
|
+
function buildIntentSkillGuidanceBlock(packageManager = "unknown") {
|
|
149
|
+
const listCommand = formatIntentCommand(packageManager, "list");
|
|
150
|
+
const loadCommand = formatIntentCommand(packageManager, "load <package>#<skill>");
|
|
147
151
|
return {
|
|
148
152
|
block: `${[
|
|
149
153
|
INTENT_SKILLS_START,
|
|
150
154
|
"## Skill Loading",
|
|
151
155
|
"",
|
|
152
156
|
"Before substantial work:",
|
|
153
|
-
|
|
154
|
-
|
|
157
|
+
`- Skill check: run \`${listCommand}\`, or use skills already listed in context.`,
|
|
158
|
+
`- Skill guidance: if one local skill clearly matches the task, run \`${loadCommand}\` and follow the returned \`SKILL.md\`.`,
|
|
155
159
|
"- Monorepos: when working across packages, run the skill check from the workspace root and prefer the local skill for the package being changed.",
|
|
156
160
|
"- Multiple matches: prefer the most specific local skill for the package or concern you are changing; load additional skills only when the task spans multiple packages or concerns.",
|
|
157
161
|
INTENT_SKILLS_END
|
|
@@ -376,9 +380,9 @@ async function runInstallCommand(options, scanIntentsOrFail) {
|
|
|
376
380
|
console.log(INSTALL_PROMPT);
|
|
377
381
|
return;
|
|
378
382
|
}
|
|
379
|
-
scanOptionsFromGlobalFlags(options);
|
|
383
|
+
const scanOptions = scanOptionsFromGlobalFlags(options);
|
|
380
384
|
if (!options.map) {
|
|
381
|
-
const generated$1 = buildIntentSkillGuidanceBlock();
|
|
385
|
+
const generated$1 = buildIntentSkillGuidanceBlock(detectPackageManager());
|
|
382
386
|
if (options.dryRun) {
|
|
383
387
|
const targetPath = resolveIntentSkillsBlockTargetPath(process.cwd(), 1);
|
|
384
388
|
console.log(`Generated skill loading guidance for ${formatTargetPath(targetPath)}.`);
|
|
@@ -401,7 +405,7 @@ async function runInstallCommand(options, scanIntentsOrFail) {
|
|
|
401
405
|
printPlacementTip(result$1.targetPath);
|
|
402
406
|
return;
|
|
403
407
|
}
|
|
404
|
-
const scanResult = await scanIntentsOrFail(
|
|
408
|
+
const scanResult = await scanIntentsOrFail(scanOptions);
|
|
405
409
|
const generated = buildIntentSkillsBlock(scanResult);
|
|
406
410
|
if (options.dryRun) {
|
|
407
411
|
const targetPath = resolveIntentSkillsBlockTargetPath(process.cwd(), generated.mappingCount);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "./utils-Chn-30vI.mjs";
|
|
2
|
+
import "./workspace-patterns-C5O4Dfpl.mjs";
|
|
3
|
+
import "./project-context-D4mFnCs7.mjs";
|
|
4
|
+
import "./cli-support-BHoEb9y1.mjs";
|
|
5
|
+
import { n as runInstallCommand, t as INSTALL_PROMPT } from "./install-DCiBBx55.mjs";
|
|
6
|
+
|
|
7
|
+
export { INSTALL_PROMPT, runInstallCommand };
|
package/dist/intent-library.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./utils-
|
|
3
|
-
import "./skill-paths-
|
|
4
|
-
import "./workspace-patterns-
|
|
5
|
-
import "./project-context-
|
|
6
|
-
import { n as printSkillTree, r as printTable, t as computeSkillNameWidth } from "./display-
|
|
7
|
-
import "./cli-support-
|
|
8
|
-
import { t as INSTALL_PROMPT } from "./install-
|
|
9
|
-
import { t as scanLibrary } from "./library-scanner-
|
|
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
10
|
|
|
11
11
|
//#region src/intent-library.ts
|
|
12
12
|
function cmdList() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as rewriteSkillLoadPaths } from "./skill-paths-
|
|
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
3
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
4
4
|
import { dirname, join, relative } from "node:path";
|
|
5
5
|
|
package/dist/library-scanner.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./utils-
|
|
2
|
-
import "./skill-paths-
|
|
3
|
-
import { t as scanLibrary } from "./library-scanner-
|
|
1
|
+
import "./utils-Chn-30vI.mjs";
|
|
2
|
+
import "./skill-paths-4kQXfQXo.mjs";
|
|
3
|
+
import { t as scanLibrary } from "./library-scanner-BpEuR__1.mjs";
|
|
4
4
|
|
|
5
5
|
export { scanLibrary };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import "./utils-
|
|
2
|
-
import "./skill-paths-
|
|
3
|
-
import "./scanner-
|
|
4
|
-
import "./workspace-patterns-
|
|
5
|
-
import "./project-context-
|
|
6
|
-
import "./resolver-
|
|
7
|
-
import {
|
|
8
|
-
import { n as
|
|
1
|
+
import "./utils-Chn-30vI.mjs";
|
|
2
|
+
import "./skill-paths-4kQXfQXo.mjs";
|
|
3
|
+
import "./scanner-B6nnctK4.mjs";
|
|
4
|
+
import "./workspace-patterns-C5O4Dfpl.mjs";
|
|
5
|
+
import "./project-context-D4mFnCs7.mjs";
|
|
6
|
+
import "./resolver-B36uOK8c.mjs";
|
|
7
|
+
import { t as formatIntentCommand } from "./command-runner-DJTliSTc.mjs";
|
|
8
|
+
import { a as printDebugInfo, l as printWarnings, n as coreOptionsFromGlobalFlags } from "./cli-support-BHoEb9y1.mjs";
|
|
9
|
+
import { n as listIntentSkills } from "./core-DEiRgUqe.mjs";
|
|
9
10
|
|
|
10
11
|
//#region src/commands/list.ts
|
|
11
12
|
function printListDebug(result) {
|
|
@@ -47,15 +48,18 @@ function groupSkillsByPackageRoot(skills) {
|
|
|
47
48
|
function getPackageSkills(pkg, skillsByPackageRoot) {
|
|
48
49
|
return skillsByPackageRoot.get(pkg.packageRoot) ?? [];
|
|
49
50
|
}
|
|
51
|
+
function formatLoadCommand(skill, packageManager, scopeFlag) {
|
|
52
|
+
return formatIntentCommand(packageManager, `load ${skill.use}${scopeFlag}`);
|
|
53
|
+
}
|
|
50
54
|
async function runListCommand(options, _scanIntentsOrFail) {
|
|
51
55
|
const result = listIntentSkills(coreOptionsFromGlobalFlags(options));
|
|
52
56
|
printListDebug(result);
|
|
53
57
|
if (options.json) {
|
|
54
|
-
const { debug: _debug, ...jsonResult } = result;
|
|
58
|
+
const { debug: _debug, packageManager: _packageManager, ...jsonResult } = result;
|
|
55
59
|
console.log(JSON.stringify(jsonResult, null, 2));
|
|
56
60
|
return;
|
|
57
61
|
}
|
|
58
|
-
const { computeSkillNameWidth, printSkillTree, printTable } = await import("./display-
|
|
62
|
+
const { computeSkillNameWidth, printSkillTree, printTable } = await import("./display-lWCJg5Bo.mjs");
|
|
59
63
|
if (result.packages.length === 0) {
|
|
60
64
|
console.log("No intent-enabled packages found.");
|
|
61
65
|
if (result.warnings.length > 0) {
|
|
@@ -84,12 +88,14 @@ async function runListCommand(options, _scanIntentsOrFail) {
|
|
|
84
88
|
type: skill.type
|
|
85
89
|
}))));
|
|
86
90
|
const showTypes = result.skills.some((skill) => skill.type);
|
|
91
|
+
const scopeFlag = options.globalOnly ? " --global-only" : options.global ? " --global" : "";
|
|
87
92
|
console.log(`\nSkills:\n`);
|
|
88
93
|
for (const pkg of result.packages) {
|
|
89
94
|
console.log(` ${pkg.name}`);
|
|
90
95
|
printSkillTree(getPackageSkills(pkg, skillsByPackageRoot).map((skill) => ({
|
|
91
96
|
name: skill.skillName,
|
|
92
97
|
description: skill.description,
|
|
98
|
+
loadCommand: formatLoadCommand(skill, result.packageManager, scopeFlag),
|
|
93
99
|
type: skill.type
|
|
94
100
|
})), {
|
|
95
101
|
nameWidth,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./utils-
|
|
2
|
-
import "./skill-paths-
|
|
3
|
-
import "./scanner-
|
|
4
|
-
import "./workspace-patterns-
|
|
5
|
-
import "./project-context-
|
|
6
|
-
import "./resolver-
|
|
7
|
-
import { t as fail } from "./cli-error-
|
|
8
|
-
import { a as printDebugInfo, n as coreOptionsFromGlobalFlags } from "./cli-support-
|
|
9
|
-
import { i as resolveIntentSkill, r as loadIntentSkill, t as IntentCoreError } from "./core-
|
|
1
|
+
import "./utils-Chn-30vI.mjs";
|
|
2
|
+
import "./skill-paths-4kQXfQXo.mjs";
|
|
3
|
+
import "./scanner-B6nnctK4.mjs";
|
|
4
|
+
import "./workspace-patterns-C5O4Dfpl.mjs";
|
|
5
|
+
import "./project-context-D4mFnCs7.mjs";
|
|
6
|
+
import "./resolver-B36uOK8c.mjs";
|
|
7
|
+
import { t as fail } from "./cli-error-DOO5bLIG.mjs";
|
|
8
|
+
import { a as printDebugInfo, n as coreOptionsFromGlobalFlags } from "./cli-support-BHoEb9y1.mjs";
|
|
9
|
+
import { i as resolveIntentSkill, r as loadIntentSkill, t as IntentCoreError } from "./core-DEiRgUqe.mjs";
|
|
10
10
|
|
|
11
11
|
//#region src/commands/load.ts
|
|
12
12
|
function printLoadDebug(loaded) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as fail } from "./cli-error-
|
|
1
|
+
import { t as fail } from "./cli-error-DOO5bLIG.mjs";
|
|
2
2
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
|
|
@@ -16,7 +16,7 @@ async function runMetaCommand(name, metaDir) {
|
|
|
16
16
|
}
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
const { parseFrontmatter } = await import("./utils-
|
|
19
|
+
const { parseFrontmatter } = await import("./utils-Ctlz_JG-.mjs");
|
|
20
20
|
const entries = readdirSync(metaDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).filter((entry) => existsSync(join(metaDir, entry.name, "SKILL.md")));
|
|
21
21
|
if (entries.length === 0) {
|
|
22
22
|
console.log("No meta-skills found.");
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join, resolve } from "node:path";
|
|
3
|
+
|
|
4
|
+
//#region src/package-manager.ts
|
|
5
|
+
function readPackageManagerField(dir) {
|
|
6
|
+
try {
|
|
7
|
+
const parsed = JSON.parse(readFileSync(join(dir, "package.json"), "utf8"));
|
|
8
|
+
if (!parsed || typeof parsed !== "object") return null;
|
|
9
|
+
const value = parsed.packageManager;
|
|
10
|
+
if (typeof value !== "string") return null;
|
|
11
|
+
if (value.startsWith("pnpm@")) return "pnpm";
|
|
12
|
+
if (value.startsWith("yarn@")) return "yarn";
|
|
13
|
+
if (value.startsWith("bun@")) return "bun";
|
|
14
|
+
if (value.startsWith("npm@")) return "npm";
|
|
15
|
+
} catch {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
function detectPackageManagerInDir(dir) {
|
|
21
|
+
const packageManager = readPackageManagerField(dir);
|
|
22
|
+
if (packageManager) return packageManager;
|
|
23
|
+
if (existsSync(join(dir, ".pnp.cjs")) || existsSync(join(dir, ".pnp.js"))) return "yarn";
|
|
24
|
+
if (existsSync(join(dir, "pnpm-lock.yaml"))) return "pnpm";
|
|
25
|
+
if (existsSync(join(dir, "bun.lockb")) || existsSync(join(dir, "bun.lock"))) return "bun";
|
|
26
|
+
if (existsSync(join(dir, "yarn.lock"))) return "yarn";
|
|
27
|
+
if (existsSync(join(dir, "package-lock.json"))) return "npm";
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
function detectPackageManager(cwd = process.cwd(), extraDirs = []) {
|
|
31
|
+
const seen = /* @__PURE__ */ new Set();
|
|
32
|
+
const startDirs = [cwd, ...extraDirs].filter((dir) => Boolean(dir));
|
|
33
|
+
for (const startDir of startDirs) {
|
|
34
|
+
let dir = resolve(startDir);
|
|
35
|
+
while (!seen.has(dir)) {
|
|
36
|
+
seen.add(dir);
|
|
37
|
+
const packageManager = detectPackageManagerInDir(dir);
|
|
38
|
+
if (packageManager) return packageManager;
|
|
39
|
+
const next = dirname(dir);
|
|
40
|
+
if (next === dir) break;
|
|
41
|
+
dir = next;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return "unknown";
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { detectPackageManager as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as readWorkspacePatterns, r as findWorkspaceRoot } from "./workspace-patterns-
|
|
1
|
+
import { a as readWorkspacePatterns, r as findWorkspaceRoot } from "./workspace-patterns-C5O4Dfpl.mjs";
|
|
2
2
|
import { existsSync, statSync } from "node:fs";
|
|
3
3
|
import { dirname, join, relative, resolve } from "node:path";
|
|
4
4
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as parseSkillUse } from "./skill-use-
|
|
2
|
-
import { t as resolveProjectContext } from "./project-context-
|
|
1
|
+
import { i as parseSkillUse } from "./skill-use-C0q2MEEX.mjs";
|
|
2
|
+
import { t as resolveProjectContext } from "./project-context-D4mFnCs7.mjs";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
5
5
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { r as rewriteSkillLoadPaths } from "./skill-paths-
|
|
3
|
-
import { n as findWorkspacePackages, r as findWorkspaceRoot } from "./workspace-patterns-
|
|
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
|
+
import { r as rewriteSkillLoadPaths } from "./skill-paths-4kQXfQXo.mjs";
|
|
3
|
+
import { n as findWorkspacePackages, r as findWorkspaceRoot } from "./workspace-patterns-C5O4Dfpl.mjs";
|
|
4
|
+
import { t as detectPackageManager } from "./package-manager-DDZck142.mjs";
|
|
4
5
|
import { createRequire } from "node:module";
|
|
5
6
|
import { existsSync, readFileSync } from "node:fs";
|
|
6
7
|
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
@@ -10,21 +11,18 @@ import semver from "semver";
|
|
|
10
11
|
function isLocalToProject(dirPath, projectRoot) {
|
|
11
12
|
return dirPath.startsWith(projectRoot + sep) || dirPath.startsWith(projectRoot + "/");
|
|
12
13
|
}
|
|
13
|
-
function getFsIdentity(path) {
|
|
14
|
-
return resolve(path);
|
|
15
|
-
}
|
|
16
14
|
function createPackageRegistrar(opts) {
|
|
17
15
|
const attemptedPackageRoots = /* @__PURE__ */ new Set();
|
|
18
16
|
const scannedNodeModulesDirs = /* @__PURE__ */ new Set();
|
|
19
17
|
function shouldAttemptPackageRoot(dirPath) {
|
|
20
|
-
const key = getFsIdentity(dirPath);
|
|
18
|
+
const key = opts.getFsIdentity(dirPath);
|
|
21
19
|
if (attemptedPackageRoots.has(key)) return false;
|
|
22
20
|
attemptedPackageRoots.add(key);
|
|
23
21
|
return true;
|
|
24
22
|
}
|
|
25
23
|
function scanNodeModulesDir(nodeModulesDir, source = "local") {
|
|
26
24
|
if (!existsSync(nodeModulesDir)) return;
|
|
27
|
-
const key = getFsIdentity(nodeModulesDir);
|
|
25
|
+
const key = opts.getFsIdentity(nodeModulesDir);
|
|
28
26
|
if (scannedNodeModulesDirs.has(key)) return;
|
|
29
27
|
scannedNodeModulesDirs.add(key);
|
|
30
28
|
for (const dirPath of listNodeModulesPackageDirs(nodeModulesDir)) tryRegister(dirPath, "unknown", source);
|
|
@@ -93,10 +91,11 @@ function createDependencyWalker(opts) {
|
|
|
93
91
|
const walkVisited = /* @__PURE__ */ new Set();
|
|
94
92
|
const depDirCache = /* @__PURE__ */ new Map();
|
|
95
93
|
function resolveDepDirCached(depName, fromDir) {
|
|
96
|
-
|
|
94
|
+
const fromKey = opts.getFsIdentity(fromDir);
|
|
95
|
+
let byDepName = depDirCache.get(fromKey);
|
|
97
96
|
if (!byDepName) {
|
|
98
97
|
byDepName = /* @__PURE__ */ new Map();
|
|
99
|
-
depDirCache.set(
|
|
98
|
+
depDirCache.set(fromKey, byDepName);
|
|
100
99
|
}
|
|
101
100
|
if (!byDepName.has(depName)) byDepName.set(depName, resolveDepDir(depName, fromDir));
|
|
102
101
|
return byDepName.get(depName) ?? null;
|
|
@@ -104,14 +103,15 @@ function createDependencyWalker(opts) {
|
|
|
104
103
|
function walkDepsOf(pkgJson, fromDir, includeDevDeps = false) {
|
|
105
104
|
for (const depName of getDeps(pkgJson, includeDevDeps)) {
|
|
106
105
|
const depDir = resolveDepDirCached(depName, fromDir);
|
|
107
|
-
if (!depDir
|
|
106
|
+
if (!depDir) continue;
|
|
108
107
|
opts.tryRegister(depDir, depName);
|
|
109
108
|
walkDeps(depDir, depName);
|
|
110
109
|
}
|
|
111
110
|
}
|
|
112
111
|
function walkDeps(pkgDir, pkgName) {
|
|
113
|
-
|
|
114
|
-
walkVisited.
|
|
112
|
+
const pkgKey = opts.getFsIdentity(pkgDir);
|
|
113
|
+
if (walkVisited.has(pkgKey)) return;
|
|
114
|
+
walkVisited.add(pkgKey);
|
|
115
115
|
const pkgJson = opts.readPkgJson(pkgDir);
|
|
116
116
|
if (!pkgJson) {
|
|
117
117
|
opts.warnings.push(`Could not read package.json for ${pkgName} (skipping dependency walk)`);
|
|
@@ -142,7 +142,15 @@ function createDependencyWalker(opts) {
|
|
|
142
142
|
if (wsPkg) walkDepsOf(wsPkg, wsDir);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
+
function scanNestedNodeModulesDir(nodeModulesDir) {
|
|
146
|
+
for (const dirPath of listNestedNodeModulesPackageDirs(nodeModulesDir, opts.getFsIdentity)) {
|
|
147
|
+
if (!opts.tryRegister(dirPath, "unknown")) continue;
|
|
148
|
+
const pkgJson = opts.readPkgJson(dirPath);
|
|
149
|
+
walkDeps(dirPath, typeof pkgJson?.name === "string" ? pkgJson.name : "unknown");
|
|
150
|
+
}
|
|
151
|
+
}
|
|
145
152
|
return {
|
|
153
|
+
scanNestedNodeModulesDir,
|
|
146
154
|
walkKnownPackages,
|
|
147
155
|
walkProjectDeps,
|
|
148
156
|
walkWorkspacePackages
|
|
@@ -151,21 +159,19 @@ function createDependencyWalker(opts) {
|
|
|
151
159
|
|
|
152
160
|
//#endregion
|
|
153
161
|
//#region src/fs-cache.ts
|
|
154
|
-
function normalizeCacheKey(path) {
|
|
155
|
-
return resolve(path);
|
|
156
|
-
}
|
|
157
162
|
function isRecord(value) {
|
|
158
163
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
159
164
|
}
|
|
160
165
|
function createIntentFsCache() {
|
|
161
166
|
const packageJsonCache = /* @__PURE__ */ new Map();
|
|
162
167
|
const skillFilesCache = /* @__PURE__ */ new Map();
|
|
168
|
+
const getFsIdentity = createFsIdentityCache();
|
|
163
169
|
const stats = {
|
|
164
170
|
packageJsonReadCount: 0,
|
|
165
171
|
packageJsonCacheHits: 0
|
|
166
172
|
};
|
|
167
173
|
function readPackageJsonResult(dir) {
|
|
168
|
-
const key =
|
|
174
|
+
const key = getFsIdentity(dir);
|
|
169
175
|
const cached = packageJsonCache.get(key);
|
|
170
176
|
if (cached) {
|
|
171
177
|
stats.packageJsonCacheHits += 1;
|
|
@@ -193,7 +199,7 @@ function createIntentFsCache() {
|
|
|
193
199
|
return readPackageJsonResult(dir).packageJson;
|
|
194
200
|
}
|
|
195
201
|
function findSkillFiles$1(dir) {
|
|
196
|
-
const key =
|
|
202
|
+
const key = getFsIdentity(dir);
|
|
197
203
|
const cached = skillFilesCache.get(key);
|
|
198
204
|
if (cached) return [...cached];
|
|
199
205
|
const files = findSkillFiles(dir);
|
|
@@ -204,6 +210,7 @@ function createIntentFsCache() {
|
|
|
204
210
|
readPackageJson,
|
|
205
211
|
readPackageJsonResult,
|
|
206
212
|
findSkillFiles: findSkillFiles$1,
|
|
213
|
+
getFsIdentity,
|
|
207
214
|
getStats: () => ({ ...stats })
|
|
208
215
|
};
|
|
209
216
|
}
|
|
@@ -223,36 +230,22 @@ function findPnpFile(start) {
|
|
|
223
230
|
dir = next;
|
|
224
231
|
}
|
|
225
232
|
}
|
|
226
|
-
function isYarnPnpProject(root) {
|
|
227
|
-
return findPnpFile(root) !== null;
|
|
228
|
-
}
|
|
229
233
|
function assertLocalNodeModulesSupported(root) {
|
|
230
234
|
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.");
|
|
231
235
|
}
|
|
232
|
-
function detectPackageManager(root) {
|
|
233
|
-
const dirsToCheck = [root];
|
|
234
|
-
const wsRoot = findWorkspaceRoot(root);
|
|
235
|
-
if (wsRoot && wsRoot !== root) dirsToCheck.push(wsRoot);
|
|
236
|
-
for (const dir of dirsToCheck) {
|
|
237
|
-
if (isYarnPnpProject(dir)) return "yarn";
|
|
238
|
-
if (existsSync(join(dir, "pnpm-lock.yaml"))) return "pnpm";
|
|
239
|
-
if (existsSync(join(dir, "bun.lockb")) || existsSync(join(dir, "bun.lock"))) return "bun";
|
|
240
|
-
if (existsSync(join(dir, "yarn.lock"))) return "yarn";
|
|
241
|
-
if (existsSync(join(dir, "package-lock.json"))) return "npm";
|
|
242
|
-
}
|
|
243
|
-
return "unknown";
|
|
244
|
-
}
|
|
245
236
|
function loadPnpApi(root) {
|
|
246
237
|
const pnpPath = findPnpFile(root);
|
|
247
238
|
if (!pnpPath) return null;
|
|
248
239
|
try {
|
|
249
|
-
const foundApi = requireFromHere("node:module").findPnpApi?.(root);
|
|
250
|
-
if (foundApi) return foundApi;
|
|
251
240
|
const pnpModule = requireFromHere(pnpPath);
|
|
252
241
|
if (typeof pnpModule.setup === "function") pnpModule.setup();
|
|
253
242
|
if (typeof pnpModule.getDependencyTreeRoots === "function" && typeof pnpModule.getPackageInformation === "function") return pnpModule;
|
|
254
243
|
return createRequire(join(dirname(pnpPath), "package.json"))("pnpapi");
|
|
255
244
|
} catch (err) {
|
|
245
|
+
try {
|
|
246
|
+
const foundApi = requireFromHere("node:module").findPnpApi?.(root);
|
|
247
|
+
if (foundApi) return foundApi;
|
|
248
|
+
} catch {}
|
|
256
249
|
const msg = err instanceof Error ? err.message : String(err);
|
|
257
250
|
throw new Error(`Yarn PnP project detected, but Intent could not load Yarn's PnP API from ${pnpPath}: ${msg}`);
|
|
258
251
|
}
|
|
@@ -425,7 +418,8 @@ function scanForIntents(root, options = {}) {
|
|
|
425
418
|
const projectRoot = root ?? process.cwd();
|
|
426
419
|
const scanScope = getScanScope(options);
|
|
427
420
|
const fsCache = options.fsCache ?? createIntentFsCache();
|
|
428
|
-
const
|
|
421
|
+
const workspaceRoot = findWorkspaceRoot(projectRoot);
|
|
422
|
+
const packageManager = detectPackageManager(projectRoot, [workspaceRoot]);
|
|
429
423
|
const nodeModulesDir = join(projectRoot, "node_modules");
|
|
430
424
|
const explicitGlobalNodeModules = process.env.INTENT_GLOBAL_NODE_MODULES?.trim() || null;
|
|
431
425
|
const packages = [];
|
|
@@ -485,6 +479,7 @@ function scanForIntents(root, options = {}) {
|
|
|
485
479
|
deriveIntentConfig,
|
|
486
480
|
discoverSkills: (skillsDir) => discoverSkills(skillsDir, fsCache),
|
|
487
481
|
getPackageDepth,
|
|
482
|
+
getFsIdentity: fsCache.getFsIdentity,
|
|
488
483
|
packageIndexes,
|
|
489
484
|
packages,
|
|
490
485
|
projectRoot,
|
|
@@ -493,8 +488,9 @@ function scanForIntents(root, options = {}) {
|
|
|
493
488
|
validateIntentField,
|
|
494
489
|
warnings
|
|
495
490
|
});
|
|
496
|
-
const { walkKnownPackages, walkProjectDeps, walkWorkspacePackages } = createDependencyWalker({
|
|
491
|
+
const { scanNestedNodeModulesDir, walkKnownPackages, walkProjectDeps, walkWorkspacePackages } = createDependencyWalker({
|
|
497
492
|
fsCache,
|
|
493
|
+
getFsIdentity: fsCache.getFsIdentity,
|
|
498
494
|
packages,
|
|
499
495
|
projectRoot,
|
|
500
496
|
readPkgJson,
|
|
@@ -504,7 +500,6 @@ function scanForIntents(root, options = {}) {
|
|
|
504
500
|
});
|
|
505
501
|
function scanPnpPackages(api) {
|
|
506
502
|
const visited = /* @__PURE__ */ new Set();
|
|
507
|
-
const workspaceRoot = findWorkspaceRoot(projectRoot);
|
|
508
503
|
const projectLocator = api.findPackageLocator?.(projectRoot.endsWith(sep) ? projectRoot : `${projectRoot}${sep}`);
|
|
509
504
|
const roots = workspaceRoot && workspaceRoot !== projectRoot && projectLocator ? [projectLocator] : api.getDependencyTreeRoots?.() ?? (api.topLevel ? [api.topLevel] : []);
|
|
510
505
|
function visit(locator) {
|
|
@@ -530,12 +525,15 @@ function scanForIntents(root, options = {}) {
|
|
|
530
525
|
}
|
|
531
526
|
}
|
|
532
527
|
assertLocalNodeModulesSupported(projectRoot);
|
|
528
|
+
const packageCountBeforeLocalDiscovery = packages.length;
|
|
533
529
|
walkWorkspacePackages();
|
|
534
530
|
const packageCountBeforeDependencyDiscovery = packages.length;
|
|
535
531
|
scanTarget(nodeModules.local);
|
|
536
532
|
walkKnownPackages();
|
|
537
533
|
walkProjectDeps();
|
|
538
|
-
|
|
534
|
+
const shouldTryPnpFallback = packages.length === packageCountBeforeDependencyDiscovery;
|
|
535
|
+
if (nodeModules.local.path && nodeModules.local.exists && packages.length === packageCountBeforeLocalDiscovery) scanNestedNodeModulesDir(nodeModules.local.path);
|
|
536
|
+
if (shouldTryPnpFallback) {
|
|
539
537
|
const api = getPnpApi();
|
|
540
538
|
if (api) scanPnpPackages(api);
|
|
541
539
|
}
|
|
@@ -597,6 +595,7 @@ function scanIntentPackageAtRoot(packageRoot, options = {}) {
|
|
|
597
595
|
deriveIntentConfig,
|
|
598
596
|
discoverSkills: options.skillNameHint ? (skillsDir, packageName) => discoverSkillByNameHint(skillsDir, packageName, options.skillNameHint) : (skillsDir) => discoverSkills(skillsDir, fsCache),
|
|
599
597
|
getPackageDepth,
|
|
598
|
+
getFsIdentity: fsCache.getFsIdentity,
|
|
600
599
|
packageIndexes,
|
|
601
600
|
packages,
|
|
602
601
|
projectRoot,
|
|
@@ -1,5 +1,5 @@
|
|
|
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-C5O4Dfpl.mjs";
|
|
2
|
+
import { t as resolveProjectContext } from "./project-context-D4mFnCs7.mjs";
|
|
3
3
|
import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { basename, join, relative } from "node:path";
|
|
5
5
|
|
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-DL7qX_F-.mjs";
|
|
2
2
|
export { EditPackageJsonResult, MonorepoResult, SetupGithubActionsResult, findPackagesWithSkills, findWorkspaceRoot, readWorkspacePatterns, resolveWorkspacePackages, runEditPackageJson, runEditPackageJsonAll, runSetupGithubActions };
|
package/dist/setup.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./utils-
|
|
2
|
-
import { a as readWorkspacePatterns, o as resolveWorkspacePackages, r as findWorkspaceRoot, t as findPackagesWithSkills } from "./workspace-patterns-
|
|
3
|
-
import "./project-context-
|
|
4
|
-
import { n as runEditPackageJsonAll, r as runSetupGithubActions, t as runEditPackageJson } from "./setup-
|
|
1
|
+
import "./utils-Chn-30vI.mjs";
|
|
2
|
+
import { a as readWorkspacePatterns, o as resolveWorkspacePackages, r as findWorkspaceRoot, t as findPackagesWithSkills } from "./workspace-patterns-C5O4Dfpl.mjs";
|
|
3
|
+
import "./project-context-D4mFnCs7.mjs";
|
|
4
|
+
import { n as runEditPackageJsonAll, r as runSetupGithubActions, t as runEditPackageJson } from "./setup-J4A9UfBB.mjs";
|
|
5
5
|
|
|
6
6
|
export { findPackagesWithSkills, findWorkspaceRoot, readWorkspacePatterns, resolveWorkspacePackages, runEditPackageJson, runEditPackageJsonAll, runSetupGithubActions };
|
|
@@ -33,7 +33,7 @@ async function runStaleCommand(targetDir, options, resolveStaleTargets) {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
async function runGithubReview(targetDir, options, resolveStaleTargets) {
|
|
36
|
-
const { collectStaleReviewItems, createFailedStaleReviewItem, createWorkflowAdvisoryReviewItems, writeStaleReviewWorkflowFiles } = await import("./workflow-review-
|
|
36
|
+
const { collectStaleReviewItems, createFailedStaleReviewItem, createWorkflowAdvisoryReviewItems, writeStaleReviewWorkflowFiles } = await import("./workflow-review-DcFipeG0.mjs");
|
|
37
37
|
const packageLabel = options.packageLabel ?? "workspace";
|
|
38
38
|
try {
|
|
39
39
|
const { reports, workflowAdvisories = [] } = await resolveStaleTargets(targetDir);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as readIntentArtifacts } from "./artifact-coverage-
|
|
1
|
+
import { l as toPosixPath, r as findSkillFiles, s as parseFrontmatter } from "./utils-Chn-30vI.mjs";
|
|
2
|
+
import { t as readIntentArtifacts } from "./artifact-coverage-Cqphhpfo.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";
|
|
@@ -0,0 +1,5 @@
|
|
|
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 };
|
|
@@ -6,7 +6,7 @@ interface IntentConfig {
|
|
|
6
6
|
requires?: Array<string>;
|
|
7
7
|
}
|
|
8
8
|
interface ScanResult {
|
|
9
|
-
packageManager:
|
|
9
|
+
packageManager: PackageManager;
|
|
10
10
|
packages: Array<IntentPackage>;
|
|
11
11
|
warnings: Array<string>;
|
|
12
12
|
conflicts: Array<VersionConflict>;
|
|
@@ -16,6 +16,7 @@ interface ScanResult {
|
|
|
16
16
|
};
|
|
17
17
|
stats?: ScanStats;
|
|
18
18
|
}
|
|
19
|
+
type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun' | 'unknown';
|
|
19
20
|
type ScanScope = 'local' | 'local-and-global' | 'global';
|
|
20
21
|
interface ScanOptions {
|
|
21
22
|
includeGlobal?: boolean;
|
|
@@ -148,4 +149,4 @@ interface IntentProjectConfig {
|
|
|
148
149
|
};
|
|
149
150
|
}
|
|
150
151
|
//#endregion
|
|
151
|
-
export {
|
|
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,6 +11,22 @@ 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
|
*/
|
|
@@ -83,6 +99,47 @@ function listNodeModulesPackageDirs(nodeModulesDir) {
|
|
|
83
99
|
}
|
|
84
100
|
return packageDirs;
|
|
85
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
|
+
}
|
|
86
143
|
function detectGlobalNodeModules(packageManager) {
|
|
87
144
|
const envPath = process.env.INTENT_GLOBAL_NODE_MODULES?.trim();
|
|
88
145
|
if (envPath) return {
|
|
@@ -164,4 +221,4 @@ function parseFrontmatter(filePath) {
|
|
|
164
221
|
}
|
|
165
222
|
|
|
166
223
|
//#endregion
|
|
167
|
-
export {
|
|
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-
|
|
2
|
-
import { n as findWorkspacePackages } from "./workspace-patterns-
|
|
3
|
-
import { t as resolveProjectContext } from "./project-context-
|
|
4
|
-
import { n as isCliFailure, t as fail } from "./cli-error-
|
|
5
|
-
import { l as printWarnings } from "./cli-support-
|
|
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-
|
|
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
|
|
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 "./utils-
|
|
2
|
-
import { a as readWorkspacePatterns, i as getWorkspaceInfo, n as findWorkspacePackages, o as resolveWorkspacePackages, r as findWorkspaceRoot, t as findPackagesWithSkills } from "./workspace-patterns-
|
|
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,7 +0,0 @@
|
|
|
1
|
-
import "./utils-BPDvfmcd.mjs";
|
|
2
|
-
import "./workspace-patterns-CIJQCwbJ.mjs";
|
|
3
|
-
import "./project-context-Bv9BDh8B.mjs";
|
|
4
|
-
import "./cli-support-DtqVDiJv.mjs";
|
|
5
|
-
import { n as runInstallCommand, t as INSTALL_PROMPT } from "./install-CLkmoPOY.mjs";
|
|
6
|
-
|
|
7
|
-
export { INSTALL_PROMPT, runInstallCommand };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import "./utils-BPDvfmcd.mjs";
|
|
2
|
-
import "./artifact-coverage-DgWuVqUp.mjs";
|
|
3
|
-
import { n as checkStaleness, r as readPackageName, t as buildWorkspaceCoverageSignals } from "./staleness-CGLs-swr.mjs";
|
|
4
|
-
|
|
5
|
-
export { buildWorkspaceCoverageSignals, checkStaleness, readPackageName };
|
package/dist/utils-DqdIC3RY.mjs
DELETED
|
@@ -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 };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|