@tanstack/intent 0.0.41 → 0.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/artifact-coverage-DA26utB1.mjs +3 -0
- package/dist/{cli-support-BxF1HIpw.mjs → cli-support-B26oUGbf.mjs} +4 -4
- package/dist/{cli-support-BHoEb9y1.mjs → cli-support-C-t4xQw0.mjs} +6 -6
- package/dist/cli.d.mts +2 -1
- package/dist/cli.mjs +21 -17
- package/dist/{core-DEiRgUqe.mjs → core-CEeo37aT.mjs} +12 -11
- package/dist/core.d.mts +1 -1
- package/dist/core.mjs +7 -7
- package/dist/{display-BPM-AJGc.mjs → display-BdSvrwWJ.mjs} +3 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +11 -11
- package/dist/{install-DCiBBx55.mjs → install-t4jkDdD0.mjs} +9 -6
- package/dist/{list-CpOcnLWv.mjs → list-DQxqa1AT.mjs} +10 -10
- package/dist/{load-BxmN8f0E.mjs → load-3ACx3170.mjs} +9 -9
- package/dist/{meta-Dstclm2x.mjs → meta-DZgsju5x.mjs} +2 -2
- package/dist/{project-context-D4mFnCs7.mjs → project-context-4wzbLY9c.mjs} +6 -5
- package/dist/{resolver-B36uOK8c.mjs → resolver-D8sX72Lg.mjs} +6 -7
- package/dist/scanner-BK8rIEA3.mjs +6 -0
- package/dist/{scanner-B6nnctK4.mjs → scanner-QujEINYm.mjs} +9 -8
- package/dist/{setup-J4A9UfBB.mjs → setup-BElEzHxS.mjs} +2 -2
- package/dist/setup.d.mts +1 -1
- package/dist/setup.mjs +4 -4
- package/dist/{skill-paths-4kQXfQXo.mjs → skill-paths-Cc0-Y331.mjs} +1 -1
- package/dist/{stale-BD77r7KR.mjs → stale-C6dPKQ98.mjs} +1 -1
- package/dist/{staleness-DChVhbCN.mjs → staleness-BwcLygsY.mjs} +2 -2
- package/dist/staleness-Dd1kWwCz.mjs +5 -0
- package/dist/{utils-Chn-30vI.mjs → utils-CF7OL__5.mjs} +4 -4
- package/dist/{utils-Ctlz_JG-.mjs → utils-DTvYXAsM.mjs} +1 -1
- package/dist/{validate-CTSG3eDc.mjs → validate-D0n-rBpp.mjs} +6 -6
- package/dist/{workflow-review-DcFipeG0.mjs → workflow-review-CrWkP7Hc.mjs} +1 -1
- package/dist/{workflow-review--Gc_yplP.mjs → workflow-review-D9Fg1G0P.mjs} +15 -15
- package/dist/{workspace-patterns-CA-UGM5C.mjs → workspace-patterns-CnGMcicG.mjs} +2 -2
- package/dist/{workspace-patterns-C5O4Dfpl.mjs → workspace-patterns-FljtM2Xb.mjs} +7 -8
- package/package.json +3 -8
- package/dist/artifact-coverage-CbZALe7Q.mjs +0 -3
- package/dist/display-lWCJg5Bo.mjs +0 -5
- package/dist/install-EVdqAy8f.mjs +0 -7
- package/dist/intent-library.d.mts +0 -1
- package/dist/intent-library.mjs +0 -84
- package/dist/library-scanner-BpEuR__1.mjs +0 -116
- package/dist/library-scanner.d.mts +0 -16
- package/dist/library-scanner.mjs +0 -5
- package/dist/scanner-BWd4mS25.mjs +0 -6
- package/dist/staleness-Dm4laJFc.mjs +0 -5
- /package/dist/{artifact-coverage-Cqphhpfo.mjs → artifact-coverage-DgWuVqUp.mjs} +0 -0
- /package/dist/{cli-error-DOO5bLIG.mjs → cli-error-BrMXlbtx.mjs} +0 -0
- /package/dist/{command-runner-DJTliSTc.mjs → command-runner-C0yCOHLi.mjs} +0 -0
- /package/dist/{edit-package-json-cPClxVZZ.mjs → edit-package-json-CtuelQ_q.mjs} +0 -0
- /package/dist/{package-manager-DDZck142.mjs → package-manager-BUgTjW9Q.mjs} +0 -0
- /package/dist/{scaffold-CaShIIUY.mjs → scaffold-CLM6bt3c.mjs} +0 -0
- /package/dist/{setup-DL7qX_F-.d.mts → setup-DhMqESd3.d.mts} +0 -0
- /package/dist/{setup-github-actions-zzLUbyAL.mjs → setup-github-actions-CUd1oncY.mjs} +0 -0
- /package/dist/{skill-use-C0q2MEEX.mjs → skill-use-umYvZl94.mjs} +0 -0
- /package/dist/{types-DU_Z0qNT.d.mts → types-CIha6LtJ.d.mts} +0 -0
|
@@ -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-CF7OL__5.mjs";
|
|
2
|
+
import "./workspace-patterns-FljtM2Xb.mjs";
|
|
3
|
+
import "./project-context-4wzbLY9c.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-C-t4xQw0.mjs";
|
|
5
5
|
|
|
6
6
|
export { INTENT_CHECK_SKILLS_WORKFLOW_VERSION, coreOptionsFromGlobalFlags, getCheckSkillsWorkflowAdvisories, getMetaDir, printDebugInfo, printWarnings, resolveStaleTargets, scanIntentsOrFail, scanOptionsFromGlobalFlags };
|
|
@@ -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-4wzbLY9c.mjs";
|
|
2
|
+
import { t as fail } from "./cli-error-BrMXlbtx.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-BK8rIEA3.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-Dd1kWwCz.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-CnGMcicG.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-DA26utB1.mjs");
|
|
83
83
|
const artifacts = existsSync(join(workspaceInfo.root, "_artifacts")) ? readIntentArtifacts(workspaceInfo.root) : null;
|
|
84
84
|
const coverageSignals = buildWorkspaceCoverageSignals({
|
|
85
85
|
artifactRoot: workspaceInfo.root,
|
package/dist/cli.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
//#region src/cli.d.ts
|
|
3
3
|
declare function main(argv?: Array<string>): Promise<number>;
|
|
4
|
+
declare function isMainModule(metaUrl: string, argvPath: string | undefined, realpath?: (path: string) => string): boolean;
|
|
4
5
|
//#endregion
|
|
5
|
-
export { main };
|
|
6
|
+
export { isMainModule, main };
|
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-BrMXlbtx.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-DQxqa1AT.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-3ACx3170.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-B26oUGbf.mjs"), import("./meta-DZgsju5x.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-D0n-rBpp.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-B26oUGbf.mjs"), import("./install-t4jkDdD0.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-B26oUGbf.mjs"), import("./scaffold-CLM6bt3c.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-B26oUGbf.mjs"), import("./stale-C6dPKQ98.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-CtuelQ_q.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-B26oUGbf.mjs"), import("./setup-github-actions-CUd1oncY.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-B26oUGbf.mjs"), import("./setup-github-actions-CUd1oncY.mjs")]);
|
|
49
49
|
await runSetupGithubActionsCommand(process.cwd(), getMetaDir());
|
|
50
50
|
});
|
|
51
51
|
cli.command("help [command]", "Display help for a command").action((commandName) => {
|
|
@@ -91,14 +91,18 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
91
91
|
throw err;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
function isMainModule(metaUrl, argvPath, realpath = realpathSync) {
|
|
95
|
+
if (argvPath === void 0) return false;
|
|
96
|
+
try {
|
|
97
|
+
return fileURLToPath(metaUrl) === realpath(argvPath);
|
|
98
|
+
} catch {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (isMainModule(import.meta.url, process.argv[1])) {
|
|
99
103
|
const exitCode = await main();
|
|
100
104
|
process.exit(exitCode);
|
|
101
105
|
}
|
|
102
106
|
|
|
103
107
|
//#endregion
|
|
104
|
-
export { main };
|
|
108
|
+
export { isMainModule, main };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as resolveDepDir, i as getDeps, l as toPosixPath } from "./utils-
|
|
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-CF7OL__5.mjs";
|
|
2
|
+
import { n as scanIntentPackageAtRoot, r as createIntentFsCache, t as scanForIntents } from "./scanner-QujEINYm.mjs";
|
|
3
|
+
import { n as findWorkspacePackages } from "./workspace-patterns-FljtM2Xb.mjs";
|
|
4
|
+
import { i as parseSkillUse, n as formatSkillUse } from "./skill-use-umYvZl94.mjs";
|
|
5
|
+
import { t as resolveProjectContext } from "./project-context-4wzbLY9c.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-D8sX72Lg.mjs";
|
|
7
7
|
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
8
8
|
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
9
9
|
|
|
@@ -239,13 +239,14 @@ function addCandidateDir(candidates, seen, dir) {
|
|
|
239
239
|
}
|
|
240
240
|
function findVisibleDependencyDir(packageName, fromDir) {
|
|
241
241
|
let dir = fromDir;
|
|
242
|
-
|
|
242
|
+
let prev;
|
|
243
|
+
while (dir !== prev) {
|
|
243
244
|
const candidate = join(dir, "node_modules", packageName);
|
|
244
245
|
if (existsSync(join(candidate, "package.json"))) return candidate;
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
dir = next;
|
|
246
|
+
prev = dir;
|
|
247
|
+
dir = dirname(dir);
|
|
248
248
|
}
|
|
249
|
+
return null;
|
|
249
250
|
}
|
|
250
251
|
function resolveDependencyPackageDir(packageName, fromDir) {
|
|
251
252
|
return findVisibleDependencyDir(packageName, fromDir) ?? resolveDepDir(packageName, fromDir);
|
|
@@ -266,7 +267,7 @@ function getDirectLoadFastPathCandidateDirs(packageName, context, cwd) {
|
|
|
266
267
|
addCandidateDir(candidates, seen, resolveDependencyPackageDir(packageName, context.packageRoot ?? cwd));
|
|
267
268
|
return candidates;
|
|
268
269
|
}
|
|
269
|
-
addCandidateDir(candidates, seen, resolveDependencyPackageDir(packageName, context.packageRoot ?? context.workspaceRoot
|
|
270
|
+
addCandidateDir(candidates, seen, resolveDependencyPackageDir(packageName, context.packageRoot ?? context.workspaceRoot));
|
|
270
271
|
if (context.workspaceRoot && context.workspaceRoot !== context.packageRoot) addCandidateDir(candidates, seen, resolveDependencyPackageDir(packageName, context.workspaceRoot));
|
|
271
272
|
return candidates;
|
|
272
273
|
}
|
package/dist/core.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as VersionConflict, _ as ScanStats, g as ScanScope, l as IntentPackage, p as PackageManager } from "./types-
|
|
1
|
+
import { S as VersionConflict, _ as ScanStats, g as ScanScope, l as IntentPackage, p as PackageManager } from "./types-CIha6LtJ.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/core/types.d.ts
|
|
4
4
|
interface IntentCoreOptions {
|
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-CF7OL__5.mjs";
|
|
2
|
+
import "./skill-paths-Cc0-Y331.mjs";
|
|
3
|
+
import "./scanner-QujEINYm.mjs";
|
|
4
|
+
import "./workspace-patterns-FljtM2Xb.mjs";
|
|
5
|
+
import "./project-context-4wzbLY9c.mjs";
|
|
6
|
+
import "./resolver-D8sX72Lg.mjs";
|
|
7
|
+
import { i as resolveIntentSkill, n as listIntentSkills, r as loadIntentSkill, t as IntentCoreError } from "./core-CEeo37aT.mjs";
|
|
8
8
|
|
|
9
9
|
export { IntentCoreError, listIntentSkills, loadIntentSkill, resolveIntentSkill };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./utils-CF7OL__5.mjs";
|
|
2
|
+
import { n as isStableLoadPath, t as formatRuntimeSkillLookupHint } from "./skill-paths-Cc0-Y331.mjs";
|
|
2
3
|
|
|
3
4
|
//#region src/display.ts
|
|
4
5
|
function padColumn(text, width) {
|
|
@@ -70,4 +71,4 @@ function computeSkillNameWidth(allPackageSkills) {
|
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
//#endregion
|
|
73
|
-
export { printSkillTree
|
|
74
|
+
export { computeSkillNameWidth, printSkillTree, printTable };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
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-CIha6LtJ.mjs";
|
|
2
|
+
import { i as runEditPackageJson, o as runSetupGithubActions, r as SetupGithubActionsResult, t as EditPackageJsonResult } from "./setup-DhMqESd3.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 { c as resolveDepDir, i as getDeps, r as findSkillFiles, s as parseFrontmatter } from "./utils-
|
|
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-CF7OL__5.mjs";
|
|
2
|
+
import "./skill-paths-Cc0-Y331.mjs";
|
|
3
|
+
import { t as scanForIntents } from "./scanner-QujEINYm.mjs";
|
|
4
|
+
import "./workspace-patterns-FljtM2Xb.mjs";
|
|
5
|
+
import { t as readIntentArtifacts } from "./artifact-coverage-DgWuVqUp.mjs";
|
|
6
|
+
import { n as checkStaleness } from "./staleness-BwcLygsY.mjs";
|
|
7
|
+
import { n as collectStaleReviewItems, r as createFailedStaleReviewItem, t as buildStaleReviewBody } from "./workflow-review-D9Fg1G0P.mjs";
|
|
8
|
+
import { i as parseSkillUse, n as formatSkillUse, r as isSkillUseParseError, t as SkillUseParseError } from "./skill-use-umYvZl94.mjs";
|
|
9
|
+
import "./project-context-4wzbLY9c.mjs";
|
|
10
|
+
import { i as resolveSkillUse, n as isResolveSkillUseError, t as ResolveSkillUseError } from "./resolver-D8sX72Lg.mjs";
|
|
11
|
+
import { r as runSetupGithubActions, t as runEditPackageJson } from "./setup-BElEzHxS.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,8 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import "./utils-CF7OL__5.mjs";
|
|
2
|
+
import "./workspace-patterns-FljtM2Xb.mjs";
|
|
3
|
+
import { t as detectPackageManager } from "./package-manager-BUgTjW9Q.mjs";
|
|
4
|
+
import { i as parseSkillUse, n as formatSkillUse } from "./skill-use-umYvZl94.mjs";
|
|
5
|
+
import "./project-context-4wzbLY9c.mjs";
|
|
6
|
+
import { t as fail } from "./cli-error-BrMXlbtx.mjs";
|
|
7
|
+
import { c as scanOptionsFromGlobalFlags, l as printWarnings } from "./cli-support-C-t4xQw0.mjs";
|
|
8
|
+
import { t as formatIntentCommand } from "./command-runner-C0yCOHLi.mjs";
|
|
6
9
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
7
10
|
import { dirname, join, relative } from "node:path";
|
|
8
11
|
import { parse } from "yaml";
|
|
@@ -439,4 +442,4 @@ async function runInstallCommand(options, scanIntentsOrFail) {
|
|
|
439
442
|
}
|
|
440
443
|
|
|
441
444
|
//#endregion
|
|
442
|
-
export {
|
|
445
|
+
export { INSTALL_PROMPT, runInstallCommand };
|
|
@@ -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 {
|
|
8
|
-
import { a as printDebugInfo, l as printWarnings, n as coreOptionsFromGlobalFlags } from "./cli-support-
|
|
9
|
-
import {
|
|
1
|
+
import "./utils-CF7OL__5.mjs";
|
|
2
|
+
import "./skill-paths-Cc0-Y331.mjs";
|
|
3
|
+
import "./scanner-QujEINYm.mjs";
|
|
4
|
+
import "./workspace-patterns-FljtM2Xb.mjs";
|
|
5
|
+
import "./project-context-4wzbLY9c.mjs";
|
|
6
|
+
import "./resolver-D8sX72Lg.mjs";
|
|
7
|
+
import { n as listIntentSkills } from "./core-CEeo37aT.mjs";
|
|
8
|
+
import { a as printDebugInfo, l as printWarnings, n as coreOptionsFromGlobalFlags } from "./cli-support-C-t4xQw0.mjs";
|
|
9
|
+
import { t as formatIntentCommand } from "./command-runner-C0yCOHLi.mjs";
|
|
10
10
|
|
|
11
11
|
//#region src/commands/list.ts
|
|
12
12
|
function printListDebug(result) {
|
|
@@ -59,7 +59,7 @@ async function runListCommand(options, _scanIntentsOrFail) {
|
|
|
59
59
|
console.log(JSON.stringify(jsonResult, null, 2));
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
const { computeSkillNameWidth, printSkillTree, printTable } = await import("./display-
|
|
62
|
+
const { computeSkillNameWidth, printSkillTree, printTable } = await import("./display-BdSvrwWJ.mjs");
|
|
63
63
|
if (result.packages.length === 0) {
|
|
64
64
|
console.log("No intent-enabled packages found.");
|
|
65
65
|
if (result.warnings.length > 0) {
|
|
@@ -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 {
|
|
9
|
-
import {
|
|
1
|
+
import "./utils-CF7OL__5.mjs";
|
|
2
|
+
import "./skill-paths-Cc0-Y331.mjs";
|
|
3
|
+
import "./scanner-QujEINYm.mjs";
|
|
4
|
+
import "./workspace-patterns-FljtM2Xb.mjs";
|
|
5
|
+
import "./project-context-4wzbLY9c.mjs";
|
|
6
|
+
import "./resolver-D8sX72Lg.mjs";
|
|
7
|
+
import { t as fail } from "./cli-error-BrMXlbtx.mjs";
|
|
8
|
+
import { i as resolveIntentSkill, r as loadIntentSkill, t as IntentCoreError } from "./core-CEeo37aT.mjs";
|
|
9
|
+
import { a as printDebugInfo, n as coreOptionsFromGlobalFlags } from "./cli-support-C-t4xQw0.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-BrMXlbtx.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-DTvYXAsM.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.");
|
|
@@ -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-FljtM2Xb.mjs";
|
|
2
2
|
import { existsSync, statSync } from "node:fs";
|
|
3
3
|
import { dirname, join, relative, resolve } from "node:path";
|
|
4
4
|
|
|
@@ -26,12 +26,13 @@ function resolveProjectContext({ cwd, targetPath }) {
|
|
|
26
26
|
}
|
|
27
27
|
function findOwningPackageRoot(startPath) {
|
|
28
28
|
let dir = toSearchDir(startPath);
|
|
29
|
-
|
|
29
|
+
let prev;
|
|
30
|
+
while (dir !== prev) {
|
|
30
31
|
if (existsSync(join(dir, "package.json"))) return dir;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
dir = next;
|
|
32
|
+
prev = dir;
|
|
33
|
+
dir = dirname(dir);
|
|
34
34
|
}
|
|
35
|
+
return null;
|
|
35
36
|
}
|
|
36
37
|
function toSearchDir(path) {
|
|
37
38
|
if (!existsSync(path)) return path;
|
|
@@ -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-umYvZl94.mjs";
|
|
2
|
+
import { t as resolveProjectContext } from "./project-context-4wzbLY9c.mjs";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
5
5
|
|
|
@@ -73,15 +73,14 @@ function isPackageExcluded(packageName, matchers) {
|
|
|
73
73
|
return matchers.some((matcher) => matcher.matches(packageName));
|
|
74
74
|
}
|
|
75
75
|
function warningMentionsPackage(warning, packageName) {
|
|
76
|
-
let
|
|
77
|
-
while (
|
|
78
|
-
const idx = warning.indexOf(packageName, fromIndex);
|
|
79
|
-
if (idx === -1) return false;
|
|
76
|
+
let idx = warning.indexOf(packageName);
|
|
77
|
+
while (idx !== -1) {
|
|
80
78
|
const before = warning[idx - 1];
|
|
81
79
|
const after = warning[idx + packageName.length];
|
|
82
80
|
if ((before === void 0 || PACKAGE_NAME_BOUNDARY.test(before)) && (after === void 0 || PACKAGE_NAME_BOUNDARY.test(after))) return true;
|
|
83
|
-
|
|
81
|
+
idx = warning.indexOf(packageName, idx + packageName.length);
|
|
84
82
|
}
|
|
83
|
+
return false;
|
|
85
84
|
}
|
|
86
85
|
|
|
87
86
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
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-
|
|
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 resolveDepDir, i as getDeps, l as toPosixPath, n as detectGlobalNodeModules, o as listNodeModulesPackageDirs, r as findSkillFiles, s as parseFrontmatter, t as createFsIdentityCache } from "./utils-CF7OL__5.mjs";
|
|
2
|
+
import { r as rewriteSkillLoadPaths } from "./skill-paths-Cc0-Y331.mjs";
|
|
3
|
+
import { n as findWorkspacePackages, r as findWorkspaceRoot } from "./workspace-patterns-FljtM2Xb.mjs";
|
|
4
|
+
import { t as detectPackageManager } from "./package-manager-BUgTjW9Q.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import { existsSync, readFileSync } from "node:fs";
|
|
7
7
|
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
@@ -220,15 +220,16 @@ function createIntentFsCache() {
|
|
|
220
220
|
const requireFromHere = createRequire(import.meta.url);
|
|
221
221
|
function findPnpFile(start) {
|
|
222
222
|
let dir = resolve(start);
|
|
223
|
-
|
|
223
|
+
let prev;
|
|
224
|
+
while (dir !== prev) {
|
|
224
225
|
for (const fileName of [".pnp.cjs", ".pnp.js"]) {
|
|
225
226
|
const pnpPath = join(dir, fileName);
|
|
226
227
|
if (existsSync(pnpPath)) return pnpPath;
|
|
227
228
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
dir = next;
|
|
229
|
+
prev = dir;
|
|
230
|
+
dir = dirname(dir);
|
|
231
231
|
}
|
|
232
|
+
return null;
|
|
232
233
|
}
|
|
233
234
|
function assertLocalNodeModulesSupported(root) {
|
|
234
235
|
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.");
|
|
@@ -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-FljtM2Xb.mjs";
|
|
2
|
+
import { t as resolveProjectContext } from "./project-context-4wzbLY9c.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-DhMqESd3.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-CF7OL__5.mjs";
|
|
2
|
+
import { a as readWorkspacePatterns, o as resolveWorkspacePackages, r as findWorkspaceRoot, t as findPackagesWithSkills } from "./workspace-patterns-FljtM2Xb.mjs";
|
|
3
|
+
import "./project-context-4wzbLY9c.mjs";
|
|
4
|
+
import { n as runEditPackageJsonAll, r as runSetupGithubActions, t as runEditPackageJson } from "./setup-BElEzHxS.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-CrWkP7Hc.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 { l as toPosixPath, r as findSkillFiles, s as parseFrontmatter } from "./utils-
|
|
2
|
-
import { t as readIntentArtifacts } from "./artifact-coverage-
|
|
1
|
+
import { l as toPosixPath, r as findSkillFiles, s as parseFrontmatter } from "./utils-CF7OL__5.mjs";
|
|
2
|
+
import { t as readIntentArtifacts } from "./artifact-coverage-DgWuVqUp.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-CF7OL__5.mjs";
|
|
2
|
+
import "./artifact-coverage-DgWuVqUp.mjs";
|
|
3
|
+
import { n as checkStaleness, r as readPackageName, t as buildWorkspaceCoverageSignals } from "./staleness-BwcLygsY.mjs";
|
|
4
|
+
|
|
5
|
+
export { buildWorkspaceCoverageSignals, checkStaleness, readPackageName };
|
|
@@ -192,12 +192,12 @@ function resolveDepDir(depName, parentDir) {
|
|
|
192
192
|
if (code && code !== "MODULE_NOT_FOUND" && code !== "ERR_PACKAGE_PATH_NOT_EXPORTED") console.warn(`Warning: could not resolve ${depName} from ${parentDir}: ${err instanceof Error ? err.message : String(err)}`);
|
|
193
193
|
}
|
|
194
194
|
let dir = parentDir;
|
|
195
|
-
|
|
195
|
+
let prev;
|
|
196
|
+
while (dir !== prev) {
|
|
196
197
|
const candidate = join(dir, "node_modules", depName);
|
|
197
198
|
if (existsSync(join(candidate, "package.json"))) return candidate;
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
dir = parent;
|
|
199
|
+
prev = dir;
|
|
200
|
+
dir = dirname(dir);
|
|
201
201
|
}
|
|
202
202
|
return null;
|
|
203
203
|
}
|
|
@@ -1,3 +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-
|
|
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-CF7OL__5.mjs";
|
|
2
2
|
|
|
3
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-CF7OL__5.mjs";
|
|
2
|
+
import { n as findWorkspacePackages } from "./workspace-patterns-FljtM2Xb.mjs";
|
|
3
|
+
import { t as resolveProjectContext } from "./project-context-4wzbLY9c.mjs";
|
|
4
|
+
import { n as isCliFailure, t as fail } from "./cli-error-BrMXlbtx.mjs";
|
|
5
|
+
import { l as printWarnings } from "./cli-support-C-t4xQw0.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-DTvYXAsM.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-D9Fg1G0P.mjs";
|
|
2
2
|
|
|
3
3
|
export { collectStaleReviewItems, createFailedStaleReviewItem, createWorkflowAdvisoryReviewItems, writeStaleReviewWorkflowFiles };
|
|
@@ -4,26 +4,26 @@ import { appendFileSync, writeFileSync } from "node:fs";
|
|
|
4
4
|
function collectStaleReviewItems(reports) {
|
|
5
5
|
const items = [];
|
|
6
6
|
for (const report of reports) {
|
|
7
|
-
for (const skill of report.skills
|
|
8
|
-
if (!skill
|
|
7
|
+
for (const skill of report.skills) {
|
|
8
|
+
if (!skill.needsReview) continue;
|
|
9
9
|
items.push({
|
|
10
10
|
type: "stale-skill",
|
|
11
11
|
library: report.library,
|
|
12
12
|
subject: skill.name,
|
|
13
|
-
reasons: skill.reasons
|
|
13
|
+
reasons: skill.reasons
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
for (const signal of report.signals
|
|
17
|
-
if (signal
|
|
16
|
+
for (const signal of report.signals) {
|
|
17
|
+
if (signal.needsReview === false) continue;
|
|
18
18
|
items.push({
|
|
19
|
-
type: signal
|
|
20
|
-
library: signal
|
|
21
|
-
subject: signal
|
|
22
|
-
reasons: signal
|
|
23
|
-
artifactPath: signal
|
|
24
|
-
packageName: signal
|
|
25
|
-
packageRoot: signal
|
|
26
|
-
skill: signal
|
|
19
|
+
type: signal.type,
|
|
20
|
+
library: signal.library ?? report.library,
|
|
21
|
+
subject: signal.packageName ?? signal.packageRoot ?? signal.skill ?? signal.artifactPath ?? signal.subject ?? report.library,
|
|
22
|
+
reasons: signal.reasons,
|
|
23
|
+
artifactPath: signal.artifactPath,
|
|
24
|
+
packageName: signal.packageName,
|
|
25
|
+
packageRoot: signal.packageRoot,
|
|
26
|
+
skill: signal.skill
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -51,12 +51,12 @@ function buildStaleReviewBody(items) {
|
|
|
51
51
|
const signalRows = [...grouped.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([type, count]) => `| \`${type}\` | ${count} |`);
|
|
52
52
|
const itemRows = items.map((item) => {
|
|
53
53
|
const subject = item.subject ? `\`${item.subject}\`` : "-";
|
|
54
|
-
const reasons = item.reasons
|
|
54
|
+
const reasons = item.reasons.length ? item.reasons.join("; ") : "-";
|
|
55
55
|
return `| \`${item.type}\` | ${subject} | \`${item.library}\` | ${reasons} |`;
|
|
56
56
|
});
|
|
57
57
|
const reasonBullets = items.map((item) => {
|
|
58
58
|
const subject = item.subject ? `\`${item.subject}\`` : "`unknown`";
|
|
59
|
-
const reasons = item.reasons
|
|
59
|
+
const reasons = item.reasons.length ? item.reasons.join("; ") : "Intent did not emit a detailed reason for this signal.";
|
|
60
60
|
return `- \`${item.type}\` for ${subject}: ${reasons}`;
|
|
61
61
|
});
|
|
62
62
|
const prompt = [
|
|
@@ -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-CF7OL__5.mjs";
|
|
2
|
+
import { a as readWorkspacePatterns, i as getWorkspaceInfo, n as findWorkspacePackages, o as resolveWorkspacePackages, r as findWorkspaceRoot, t as findPackagesWithSkills } from "./workspace-patterns-FljtM2Xb.mjs";
|
|
3
3
|
|
|
4
4
|
export { findWorkspaceRoot, getWorkspaceInfo };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as findSkillFiles } from "./utils-
|
|
1
|
+
import { r as findSkillFiles } from "./utils-CF7OL__5.mjs";
|
|
2
2
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import { parse } from "yaml";
|
|
@@ -164,8 +164,9 @@ function readChildDirectories(dir) {
|
|
|
164
164
|
}
|
|
165
165
|
function findWorkspaceRoot(start) {
|
|
166
166
|
let dir = start;
|
|
167
|
+
let prev;
|
|
167
168
|
const visited = [];
|
|
168
|
-
while (
|
|
169
|
+
while (dir !== prev) {
|
|
169
170
|
const cached = workspaceRootCache.get(dir);
|
|
170
171
|
if (cached !== void 0) {
|
|
171
172
|
for (const visitedDir of visited) workspaceRootCache.set(visitedDir, cached);
|
|
@@ -176,13 +177,11 @@ function findWorkspaceRoot(start) {
|
|
|
176
177
|
for (const visitedDir of visited) workspaceRootCache.set(visitedDir, dir);
|
|
177
178
|
return dir;
|
|
178
179
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
for (const visitedDir of visited) workspaceRootCache.set(visitedDir, null);
|
|
182
|
-
return null;
|
|
183
|
-
}
|
|
184
|
-
dir = next;
|
|
180
|
+
prev = dir;
|
|
181
|
+
dir = dirname(dir);
|
|
185
182
|
}
|
|
183
|
+
for (const visitedDir of visited) workspaceRootCache.set(visitedDir, null);
|
|
184
|
+
return null;
|
|
186
185
|
}
|
|
187
186
|
function findPackagesWithSkills(root) {
|
|
188
187
|
return getWorkspaceInfo(root)?.packageDirsWithSkills ?? [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/intent",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.42",
|
|
4
4
|
"description": "Ship compositional knowledge for AI coding agents alongside your npm packages",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -13,18 +13,13 @@
|
|
|
13
13
|
"import": "./dist/index.mjs",
|
|
14
14
|
"types": "./dist/index.d.mts"
|
|
15
15
|
},
|
|
16
|
-
"./intent-library": {
|
|
17
|
-
"import": "./dist/intent-library.mjs",
|
|
18
|
-
"types": "./dist/intent-library.d.mts"
|
|
19
|
-
},
|
|
20
16
|
"./core": {
|
|
21
17
|
"import": "./dist/core.mjs",
|
|
22
18
|
"types": "./dist/core.d.mts"
|
|
23
19
|
}
|
|
24
20
|
},
|
|
25
21
|
"bin": {
|
|
26
|
-
"intent": "dist/cli.mjs"
|
|
27
|
-
"intent-library": "dist/intent-library.mjs"
|
|
22
|
+
"intent": "dist/cli.mjs"
|
|
28
23
|
},
|
|
29
24
|
"files": [
|
|
30
25
|
"dist",
|
|
@@ -43,7 +38,7 @@
|
|
|
43
38
|
"verdaccio": "^6.3.2"
|
|
44
39
|
},
|
|
45
40
|
"scripts": {
|
|
46
|
-
"build": "tsdown src/index.ts src/cli.ts src/setup.ts src/
|
|
41
|
+
"build": "tsdown src/index.ts src/cli.ts src/setup.ts src/core.ts --format esm --dts",
|
|
47
42
|
"test:smoke": "pnpm run build && node dist/cli.mjs --help > /dev/null && node dist/cli.mjs load --help > /dev/null",
|
|
48
43
|
"test:lib": "vitest run --exclude 'tests/integration/**'",
|
|
49
44
|
"test:integration": "vitest run tests/integration/",
|
|
@@ -1,7 +0,0 @@
|
|
|
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 };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
package/dist/intent-library.mjs
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import "./utils-Chn-30vI.mjs";
|
|
3
|
-
import "./skill-paths-4kQXfQXo.mjs";
|
|
4
|
-
import "./workspace-patterns-C5O4Dfpl.mjs";
|
|
5
|
-
import "./project-context-D4mFnCs7.mjs";
|
|
6
|
-
import { n as printSkillTree, r as printTable, t as computeSkillNameWidth } from "./display-BPM-AJGc.mjs";
|
|
7
|
-
import "./cli-support-BHoEb9y1.mjs";
|
|
8
|
-
import { t as INSTALL_PROMPT } from "./install-DCiBBx55.mjs";
|
|
9
|
-
import { t as scanLibrary } from "./library-scanner-BpEuR__1.mjs";
|
|
10
|
-
|
|
11
|
-
//#region src/intent-library.ts
|
|
12
|
-
function cmdList() {
|
|
13
|
-
let result;
|
|
14
|
-
try {
|
|
15
|
-
result = scanLibrary(process.argv[1], process.cwd());
|
|
16
|
-
} catch (err) {
|
|
17
|
-
console.error(err.message);
|
|
18
|
-
process.exit(1);
|
|
19
|
-
}
|
|
20
|
-
if (result.packages.length === 0) {
|
|
21
|
-
console.log("No intent-enabled packages found.");
|
|
22
|
-
if (result.warnings.length > 0) {
|
|
23
|
-
console.log("\nWarnings:");
|
|
24
|
-
for (const w of result.warnings) console.log(` ⚠ ${w}`);
|
|
25
|
-
}
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const totalSkills = result.packages.reduce((sum, p) => sum + p.skills.length, 0);
|
|
29
|
-
console.log(`\n${result.packages.length} intent-enabled packages, ${totalSkills} skills\n`);
|
|
30
|
-
printTable([
|
|
31
|
-
"PACKAGE",
|
|
32
|
-
"VERSION",
|
|
33
|
-
"SKILLS"
|
|
34
|
-
], result.packages.map((pkg) => [
|
|
35
|
-
pkg.name,
|
|
36
|
-
pkg.version,
|
|
37
|
-
String(pkg.skills.length)
|
|
38
|
-
]));
|
|
39
|
-
const nameWidth = computeSkillNameWidth(result.packages.map((p) => p.skills));
|
|
40
|
-
const showTypes = result.packages.some((p) => p.skills.some((s) => s.type));
|
|
41
|
-
console.log(`\nSkills:\n`);
|
|
42
|
-
for (const pkg of result.packages) {
|
|
43
|
-
console.log(` ${pkg.name}`);
|
|
44
|
-
printSkillTree(pkg.skills, {
|
|
45
|
-
nameWidth,
|
|
46
|
-
packageName: pkg.name,
|
|
47
|
-
showTypes
|
|
48
|
-
});
|
|
49
|
-
console.log();
|
|
50
|
-
}
|
|
51
|
-
console.log(`Feedback:`);
|
|
52
|
-
console.log(` Submit feedback on skill usage to help maintainers improve the skills.`);
|
|
53
|
-
console.log(` Load: node_modules/@tanstack/intent/meta/feedback-collection/SKILL.md`);
|
|
54
|
-
console.log();
|
|
55
|
-
if (result.warnings.length > 0) {
|
|
56
|
-
console.log(`Warnings:`);
|
|
57
|
-
for (const w of result.warnings) console.log(` ⚠ ${w}`);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
function cmdInstall() {
|
|
61
|
-
console.log(INSTALL_PROMPT);
|
|
62
|
-
}
|
|
63
|
-
const USAGE = `TanStack Intent
|
|
64
|
-
|
|
65
|
-
Usage:
|
|
66
|
-
intent list List all available skills from this library and its dependencies
|
|
67
|
-
intent install Print a skill that guides your coding agent to scan the project
|
|
68
|
-
and set up skill loading guidance in your agent config`;
|
|
69
|
-
const command = process.argv[2];
|
|
70
|
-
switch (command) {
|
|
71
|
-
case "list":
|
|
72
|
-
case void 0:
|
|
73
|
-
cmdList();
|
|
74
|
-
break;
|
|
75
|
-
case "install":
|
|
76
|
-
cmdInstall();
|
|
77
|
-
break;
|
|
78
|
-
default:
|
|
79
|
-
console.log(USAGE);
|
|
80
|
-
process.exit(command ? 1 : 0);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
//#endregion
|
|
84
|
-
export { };
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { c as resolveDepDir, i as getDeps, l as toPosixPath, s as parseFrontmatter } from "./utils-Chn-30vI.mjs";
|
|
2
|
-
import { r as rewriteSkillLoadPaths } from "./skill-paths-4kQXfQXo.mjs";
|
|
3
|
-
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
4
|
-
import { dirname, join, relative } from "node:path";
|
|
5
|
-
|
|
6
|
-
//#region src/library-scanner.ts
|
|
7
|
-
function readPkgJson(dir) {
|
|
8
|
-
try {
|
|
9
|
-
return JSON.parse(readFileSync(join(dir, "package.json"), "utf8"));
|
|
10
|
-
} catch {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
function findHomeDir(scriptPath) {
|
|
15
|
-
let dir = dirname(scriptPath);
|
|
16
|
-
for (;;) {
|
|
17
|
-
if (existsSync(join(dir, "package.json"))) return dir;
|
|
18
|
-
const parent = dirname(dir);
|
|
19
|
-
if (parent === dir) return null;
|
|
20
|
-
dir = parent;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
function isIntentPackage(pkg) {
|
|
24
|
-
const keywords = pkg.keywords;
|
|
25
|
-
if (Array.isArray(keywords) && keywords.includes("tanstack-intent")) return true;
|
|
26
|
-
const bin = pkg.bin;
|
|
27
|
-
if (bin && typeof bin === "object" && "intent" in bin) return true;
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
function discoverSkills(skillsDir) {
|
|
31
|
-
const skills = [];
|
|
32
|
-
function walk(dir) {
|
|
33
|
-
let entries;
|
|
34
|
-
try {
|
|
35
|
-
entries = readdirSync(dir, {
|
|
36
|
-
withFileTypes: true,
|
|
37
|
-
encoding: "utf8"
|
|
38
|
-
});
|
|
39
|
-
} catch {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
for (const entry of entries) {
|
|
43
|
-
if (!entry.isDirectory()) continue;
|
|
44
|
-
const childDir = join(dir, entry.name);
|
|
45
|
-
const skillFile = join(childDir, "SKILL.md");
|
|
46
|
-
if (existsSync(skillFile)) {
|
|
47
|
-
const fm = parseFrontmatter(skillFile);
|
|
48
|
-
const relName = toPosixPath(relative(skillsDir, childDir));
|
|
49
|
-
skills.push({
|
|
50
|
-
name: typeof fm?.name === "string" ? fm.name : relName,
|
|
51
|
-
path: skillFile,
|
|
52
|
-
description: typeof fm?.description === "string" ? fm.description.replace(/\s+/g, " ").trim() : "",
|
|
53
|
-
type: typeof fm?.type === "string" ? fm.type : void 0,
|
|
54
|
-
framework: typeof fm?.framework === "string" ? fm.framework : void 0
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
walk(childDir);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
walk(skillsDir);
|
|
61
|
-
return skills;
|
|
62
|
-
}
|
|
63
|
-
function scanLibrary(scriptPath, projectRoot) {
|
|
64
|
-
const packages = [];
|
|
65
|
-
const warnings = [];
|
|
66
|
-
const visited = /* @__PURE__ */ new Set();
|
|
67
|
-
const homeDir = findHomeDir(scriptPath);
|
|
68
|
-
if (!homeDir) return {
|
|
69
|
-
packages,
|
|
70
|
-
warnings: ["Could not determine home package directory"]
|
|
71
|
-
};
|
|
72
|
-
const homePkg = readPkgJson(homeDir);
|
|
73
|
-
if (!homePkg) return {
|
|
74
|
-
packages,
|
|
75
|
-
warnings: ["Could not read home package.json"]
|
|
76
|
-
};
|
|
77
|
-
const homeName = typeof homePkg.name === "string" ? homePkg.name : "";
|
|
78
|
-
const scanRoot = projectRoot ?? homeDir;
|
|
79
|
-
function processPackage(name, dir) {
|
|
80
|
-
if (visited.has(name)) return;
|
|
81
|
-
visited.add(name);
|
|
82
|
-
const pkg = readPkgJson(dir);
|
|
83
|
-
if (!pkg) {
|
|
84
|
-
warnings.push(`Could not read package.json for ${name}`);
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
const skillsDir = join(dir, "skills");
|
|
88
|
-
const skills = existsSync(skillsDir) ? discoverSkills(skillsDir) : [];
|
|
89
|
-
rewriteSkillLoadPaths({
|
|
90
|
-
packageName: name,
|
|
91
|
-
packageRoot: dir,
|
|
92
|
-
projectRoot: scanRoot,
|
|
93
|
-
skills
|
|
94
|
-
});
|
|
95
|
-
packages.push({
|
|
96
|
-
name,
|
|
97
|
-
version: typeof pkg.version === "string" ? pkg.version : "0.0.0",
|
|
98
|
-
description: typeof pkg.description === "string" ? pkg.description : "",
|
|
99
|
-
skills
|
|
100
|
-
});
|
|
101
|
-
for (const depName of getDeps(pkg)) {
|
|
102
|
-
const depDir = resolveDepDir(depName, dir);
|
|
103
|
-
if (!depDir) continue;
|
|
104
|
-
const depPkg = readPkgJson(depDir);
|
|
105
|
-
if (depPkg && isIntentPackage(depPkg)) processPackage(depName, depDir);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
processPackage(homeName, homeDir);
|
|
109
|
-
return {
|
|
110
|
-
packages,
|
|
111
|
-
warnings
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
//#endregion
|
|
116
|
-
export { scanLibrary as t };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { v as SkillEntry } from "./types-DU_Z0qNT.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/library-scanner.d.ts
|
|
4
|
-
interface LibraryPackage {
|
|
5
|
-
name: string;
|
|
6
|
-
version: string;
|
|
7
|
-
description: string;
|
|
8
|
-
skills: Array<SkillEntry>;
|
|
9
|
-
}
|
|
10
|
-
interface LibraryScanResult {
|
|
11
|
-
packages: Array<LibraryPackage>;
|
|
12
|
-
warnings: Array<string>;
|
|
13
|
-
}
|
|
14
|
-
declare function scanLibrary(scriptPath: string, projectRoot?: string): LibraryScanResult;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { LibraryPackage, LibraryScanResult, scanLibrary };
|
package/dist/library-scanner.mjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import "./utils-Chn-30vI.mjs";
|
|
2
|
-
import "./artifact-coverage-Cqphhpfo.mjs";
|
|
3
|
-
import { n as checkStaleness, r as readPackageName, t as buildWorkspaceCoverageSignals } from "./staleness-DChVhbCN.mjs";
|
|
4
|
-
|
|
5
|
-
export { buildWorkspaceCoverageSignals, checkStaleness, readPackageName };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|