@tanstack/intent 0.0.29 → 0.0.32
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/LICENSE +21 -0
- package/README.md +18 -5
- package/dist/cli.d.mts +0 -0
- package/dist/cli.mjs +62 -73
- package/dist/display-DCRCp4-C.mjs +5 -0
- package/dist/{display-hdsqb4w-.mjs → display-DUgtRJkt.mjs} +10 -1
- package/dist/index.d.mts +57 -4
- package/dist/index.mjs +9 -6
- package/dist/install-BmVqcbEi.mjs +506 -0
- package/dist/intent-library.mjs +9 -5
- package/dist/{library-scanner-B51qV5aX.mjs → library-scanner-DFFreLjW.mjs} +10 -3
- package/dist/library-scanner.d.mts +2 -2
- package/dist/library-scanner.mjs +2 -1
- package/dist/{project-context-D6A5sBBO.mjs → project-context-CKG-q4rD.mjs} +1 -1
- package/dist/resolver-aFigTqXi.mjs +70 -0
- package/dist/scanner-CRZITpcY.mjs +6 -0
- package/dist/{scanner-B-bbXBLY.mjs → scanner-DKL8v8is.mjs} +176 -117
- package/dist/{setup-B4ZwN5Hg.mjs → setup-JJvjiGkM.mjs} +2 -2
- package/dist/setup.d.mts +1 -1
- package/dist/setup.mjs +3 -3
- package/dist/skill-paths-8k9K9y26.mjs +33 -0
- package/dist/skill-use-CXOnncWK.mjs +42 -0
- package/dist/staleness-NF-lxfXf.mjs +4 -0
- package/dist/{types-BTQ9efv-.d.mts → types-CsySN6Vw.d.mts} +7 -1
- package/dist/{workspace-patterns-D_y6rlqX.mjs → workspace-patterns-DbnA0peB.mjs} +1 -1
- package/package.json +3 -4
- package/dist/display-DdmZXLZm.mjs +0 -3
- package/dist/install-BzDmD5yI.mjs +0 -69
- package/dist/scanner-CP4U8F_n.mjs +0 -5
- package/dist/staleness-LRbiWWZK.mjs +0 -4
- /package/dist/{setup-BA9RkENh.d.mts → setup-DDoOLriA.d.mts} +0 -0
- /package/dist/{staleness-SY7-mZMH.mjs → staleness-DorwfGrf.mjs} +0 -0
- /package/dist/{workspace-patterns-Cndd-7vB.mjs → workspace-patterns-U35B5AO-.mjs} +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-present Tanner Linsley
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -34,20 +34,32 @@ If you use Deno, support is best-effort today via `npm:` interop with `node_modu
|
|
|
34
34
|
|
|
35
35
|
### For library consumers
|
|
36
36
|
|
|
37
|
-
Set up skill
|
|
37
|
+
Set up skill loading guidance in your project's agent config files (CLAUDE.md, .cursorrules, etc.):
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
40
|
npx @tanstack/intent@latest install
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
No per-library setup. No hunting for rules files. Install the package, run `npx @tanstack/intent@latest install` through your preferred command runner, and
|
|
43
|
+
No per-library setup. No hunting for rules files. Install the package, run `npx @tanstack/intent@latest install` through your preferred command runner, and Intent writes guidance that tells your agent to discover and load matching package skills. Update the package, and skills update too. Pass `--map` if you want explicit task-to-skill mappings in your agent config.
|
|
44
44
|
|
|
45
|
-
List available skills from installed packages:
|
|
45
|
+
List available skills from local installed packages:
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
48
|
npx @tanstack/intent@latest list
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
Include global packages explicitly:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx @tanstack/intent@latest list --global
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Load an installed skill:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx @tanstack/intent@latest load @tanstack/query#fetching
|
|
61
|
+
```
|
|
62
|
+
|
|
51
63
|
### For library maintainers
|
|
52
64
|
|
|
53
65
|
Generate skills for your library by telling your AI coding agent to run:
|
|
@@ -111,8 +123,9 @@ The feedback loop runs both directions. `npx @tanstack/intent@latest feedback` l
|
|
|
111
123
|
|
|
112
124
|
| Command | Description |
|
|
113
125
|
| -------------------------------------------------- | --------------------------------------------------- |
|
|
114
|
-
| `npx @tanstack/intent@latest install` | Set up skill
|
|
115
|
-
| `npx @tanstack/intent@latest list [--json]` | Discover intent-enabled packages
|
|
126
|
+
| `npx @tanstack/intent@latest install` | Set up skill loading guidance in agent config files |
|
|
127
|
+
| `npx @tanstack/intent@latest list [--json]` | Discover local intent-enabled packages |
|
|
128
|
+
| `npx @tanstack/intent@latest load <use>` | Load `<package>#<skill>` SKILL.md content |
|
|
116
129
|
| `npx @tanstack/intent@latest meta` | List meta-skills for library maintainers |
|
|
117
130
|
| `npx @tanstack/intent@latest scaffold` | Print the guided skill generation prompt |
|
|
118
131
|
| `npx @tanstack/intent@latest validate [dir]` | Validate SKILL.md files |
|
package/dist/cli.d.mts
CHANGED
|
File without changes
|
package/dist/cli.mjs
CHANGED
|
@@ -1,72 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import "./utils-COlDcU72.mjs";
|
|
3
|
-
import "./workspace-patterns-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import "./workspace-patterns-U35B5AO-.mjs";
|
|
4
|
+
import { i as parseSkillUse } from "./skill-use-CXOnncWK.mjs";
|
|
5
|
+
import { r as resolveSkillUse } from "./resolver-aFigTqXi.mjs";
|
|
6
|
+
import { t as resolveProjectContext } from "./project-context-CKG-q4rD.mjs";
|
|
7
|
+
import { a as scanIntentsOrFail, c as fail, i as resolveStaleTargets, l as isCliFailure, n as runInstallCommand, o as scanOptionsFromGlobalFlags, r as getMetaDir, s as printWarnings } from "./install-BmVqcbEi.mjs";
|
|
6
8
|
import { existsSync, readFileSync, readdirSync, realpathSync } from "node:fs";
|
|
7
|
-
import {
|
|
9
|
+
import { isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
8
10
|
import { fileURLToPath } from "node:url";
|
|
9
11
|
import { cac } from "cac";
|
|
10
12
|
|
|
11
|
-
//#region src/cli-error.ts
|
|
12
|
-
const CLI_FAILURE = Symbol("CliFailure");
|
|
13
|
-
function fail(message, exitCode = 1) {
|
|
14
|
-
throw {
|
|
15
|
-
[CLI_FAILURE]: true,
|
|
16
|
-
message,
|
|
17
|
-
exitCode
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function isCliFailure(value) {
|
|
21
|
-
return !!value && typeof value === "object" && CLI_FAILURE in value;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/cli-support.ts
|
|
26
|
-
function printWarnings(warnings) {
|
|
27
|
-
if (warnings.length === 0) return;
|
|
28
|
-
console.log("Warnings:");
|
|
29
|
-
for (const warning of warnings) console.log(` ⚠ ${warning}`);
|
|
30
|
-
}
|
|
31
|
-
function getMetaDir() {
|
|
32
|
-
return join(dirname(fileURLToPath(import.meta.url)), "..", "meta");
|
|
33
|
-
}
|
|
34
|
-
async function scanIntentsOrFail() {
|
|
35
|
-
const { scanForIntents } = await import("./scanner-CP4U8F_n.mjs");
|
|
36
|
-
try {
|
|
37
|
-
return scanForIntents();
|
|
38
|
-
} catch (err) {
|
|
39
|
-
fail(err instanceof Error ? err.message : String(err));
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function readPackageName(root) {
|
|
43
|
-
try {
|
|
44
|
-
const pkgJson = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
|
|
45
|
-
return typeof pkgJson.name === "string" ? pkgJson.name : relative(process.cwd(), root) || "unknown";
|
|
46
|
-
} catch {
|
|
47
|
-
return relative(process.cwd(), root) || "unknown";
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
async function resolveStaleTargets(targetDir) {
|
|
51
|
-
const resolvedRoot = targetDir ? resolve(process.cwd(), targetDir) : process.cwd();
|
|
52
|
-
const context = resolveProjectContext({
|
|
53
|
-
cwd: process.cwd(),
|
|
54
|
-
targetPath: targetDir
|
|
55
|
-
});
|
|
56
|
-
const { checkStaleness } = await import("./staleness-LRbiWWZK.mjs");
|
|
57
|
-
if (context.packageRoot && (context.targetSkillsDir !== null || resolvedRoot !== context.workspaceRoot)) return { reports: [await checkStaleness(context.packageRoot, readPackageName(context.packageRoot))] };
|
|
58
|
-
if (existsSync(join(resolvedRoot, "skills"))) return { reports: [await checkStaleness(resolvedRoot, readPackageName(resolvedRoot))] };
|
|
59
|
-
const { findPackagesWithSkills, findWorkspaceRoot } = await import("./workspace-patterns-D_y6rlqX.mjs");
|
|
60
|
-
const workspaceRoot = findWorkspaceRoot(resolvedRoot);
|
|
61
|
-
if (workspaceRoot) {
|
|
62
|
-
const packageDirs = findPackagesWithSkills(workspaceRoot);
|
|
63
|
-
if (packageDirs.length > 0) return { reports: await Promise.all(packageDirs.map((packageDir) => checkStaleness(packageDir, readPackageName(packageDir)))) };
|
|
64
|
-
}
|
|
65
|
-
const staleResult = await scanIntentsOrFail();
|
|
66
|
-
return { reports: await Promise.all(staleResult.packages.map((pkg) => checkStaleness(pkg.packageRoot, pkg.name))) };
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
//#endregion
|
|
70
13
|
//#region src/commands/edit-package-json.ts
|
|
71
14
|
async function runEditPackageJsonCommand(root) {
|
|
72
15
|
const { runEditPackageJsonAll } = await import("./setup.mjs");
|
|
@@ -95,12 +38,12 @@ function printVersionConflicts(result) {
|
|
|
95
38
|
}
|
|
96
39
|
}
|
|
97
40
|
async function runListCommand(options, scanIntentsOrFail$1) {
|
|
98
|
-
const
|
|
99
|
-
const result = await scanIntentsOrFail$1();
|
|
41
|
+
const result = await scanIntentsOrFail$1(scanOptionsFromGlobalFlags(options));
|
|
100
42
|
if (options.json) {
|
|
101
43
|
console.log(JSON.stringify(result, null, 2));
|
|
102
44
|
return;
|
|
103
45
|
}
|
|
46
|
+
const { computeSkillNameWidth, printSkillTree, printTable } = await import("./display-DCRCp4-C.mjs");
|
|
104
47
|
const scanCoverage = formatScanCoverage(result);
|
|
105
48
|
if (result.packages.length === 0) {
|
|
106
49
|
console.log("No intent-enabled packages found.");
|
|
@@ -116,11 +59,13 @@ async function runListCommand(options, scanIntentsOrFail$1) {
|
|
|
116
59
|
if (scanCoverage) console.log(`Scanned: ${scanCoverage}${result.nodeModules.global.scanned ? " (local packages take precedence)" : ""}\n`);
|
|
117
60
|
printTable([
|
|
118
61
|
"PACKAGE",
|
|
62
|
+
"SOURCE",
|
|
119
63
|
"VERSION",
|
|
120
64
|
"SKILLS",
|
|
121
65
|
"REQUIRES"
|
|
122
66
|
], result.packages.map((pkg) => [
|
|
123
67
|
pkg.name,
|
|
68
|
+
pkg.source,
|
|
124
69
|
pkg.version,
|
|
125
70
|
String(pkg.skills.length),
|
|
126
71
|
pkg.intent.requires?.join(", ") || "–"
|
|
@@ -133,6 +78,7 @@ async function runListCommand(options, scanIntentsOrFail$1) {
|
|
|
133
78
|
console.log(` ${pkg.name}`);
|
|
134
79
|
printSkillTree(pkg.skills, {
|
|
135
80
|
nameWidth,
|
|
81
|
+
packageName: pkg.name,
|
|
136
82
|
showTypes
|
|
137
83
|
});
|
|
138
84
|
console.log();
|
|
@@ -144,6 +90,46 @@ async function runListCommand(options, scanIntentsOrFail$1) {
|
|
|
144
90
|
printWarnings(result.warnings);
|
|
145
91
|
}
|
|
146
92
|
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/commands/load.ts
|
|
95
|
+
function resolveFromCwd(path) {
|
|
96
|
+
return resolve(process.cwd(), path);
|
|
97
|
+
}
|
|
98
|
+
function isPathInsidePackageRoot(path, packageRoot) {
|
|
99
|
+
const relativePath = relative(resolveFromCwd(packageRoot), resolveFromCwd(path));
|
|
100
|
+
return relativePath === "" || !relativePath.startsWith("..") && !isAbsolute(relativePath);
|
|
101
|
+
}
|
|
102
|
+
async function runLoadCommand(use, options, scanIntentsOrFail$1) {
|
|
103
|
+
if (!use) fail("Missing skill use. Expected: intent load <package>#<skill>");
|
|
104
|
+
if (options.json && options.path) fail("Use either --json or --path, not both.");
|
|
105
|
+
parseSkillUse(use);
|
|
106
|
+
const resolved = resolveSkillUse(use, await scanIntentsOrFail$1(scanOptionsFromGlobalFlags(options)));
|
|
107
|
+
const resolvedPath = resolveFromCwd(resolved.path);
|
|
108
|
+
if (!isPathInsidePackageRoot(resolved.path, resolved.packageRoot)) fail(`Resolved skill path for "${use}" is outside package root: ${resolved.path}`);
|
|
109
|
+
if (!existsSync(resolvedPath)) fail(`Resolved skill file was not found: ${resolved.path}`);
|
|
110
|
+
if (options.path) {
|
|
111
|
+
console.log(resolved.path);
|
|
112
|
+
for (const warning of resolved.warnings) console.error(`Warning: ${warning}`);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const content = readFileSync(resolvedPath, "utf8");
|
|
116
|
+
if (options.json) {
|
|
117
|
+
console.log(JSON.stringify({
|
|
118
|
+
package: resolved.packageName,
|
|
119
|
+
skill: resolved.skillName,
|
|
120
|
+
path: resolved.path,
|
|
121
|
+
packageRoot: resolved.packageRoot,
|
|
122
|
+
source: resolved.source,
|
|
123
|
+
version: resolved.version,
|
|
124
|
+
content,
|
|
125
|
+
warnings: resolved.warnings
|
|
126
|
+
}, null, 2));
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
process.stdout.write(content);
|
|
130
|
+
for (const warning of resolved.warnings) console.error(`Warning: ${warning}`);
|
|
131
|
+
}
|
|
132
|
+
|
|
147
133
|
//#endregion
|
|
148
134
|
//#region src/commands/meta.ts
|
|
149
135
|
async function runMetaCommand(name, metaDir) {
|
|
@@ -260,14 +246,14 @@ async function runSetupGithubActionsCommand(root, metaDir) {
|
|
|
260
246
|
//#region src/commands/stale.ts
|
|
261
247
|
async function runStaleCommand(targetDir, options, resolveStaleTargets$1) {
|
|
262
248
|
const { reports } = await resolveStaleTargets$1(targetDir);
|
|
263
|
-
if (reports.length === 0) {
|
|
264
|
-
console.log("No intent-enabled packages found.");
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
249
|
if (options.json) {
|
|
268
250
|
console.log(JSON.stringify(reports, null, 2));
|
|
269
251
|
return;
|
|
270
252
|
}
|
|
253
|
+
if (reports.length === 0) {
|
|
254
|
+
console.log("No intent-enabled packages found.");
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
271
257
|
for (const report of reports) {
|
|
272
258
|
const driftLabel = report.versionDrift ? ` [${report.versionDrift} drift]` : "";
|
|
273
259
|
const vLabel = report.skillVersion && report.currentVersion ? ` (${report.skillVersion} → ${report.currentVersion})` : "";
|
|
@@ -429,22 +415,25 @@ async function runValidateCommand(dir) {
|
|
|
429
415
|
function createCli() {
|
|
430
416
|
const cli = cac("intent");
|
|
431
417
|
cli.usage("<command> [options]");
|
|
432
|
-
cli.command("list", "Discover intent-enabled packages").usage("list [--json]").option("--json", "Output JSON").example("list").example("list --json").action(async (options) => {
|
|
418
|
+
cli.command("list", "Discover intent-enabled packages from the project or workspace").usage("list [--json] [--global] [--global-only]").option("--json", "Output JSON").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) => {
|
|
433
419
|
await runListCommand(options, scanIntentsOrFail);
|
|
434
420
|
});
|
|
421
|
+
cli.command("load [use]", "Load a compact skill use and print its SKILL.md").usage("load <use> [--path] [--json] [--global] [--global-only]").option("--path", "Print the resolved skill path instead of file content").option("--json", "Output JSON").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) => {
|
|
422
|
+
await runLoadCommand(use, options, scanIntentsOrFail);
|
|
423
|
+
});
|
|
435
424
|
cli.command("meta [name]", "List meta-skills, or print one by name").usage("meta [name]").example("meta").example("meta domain-discovery").action(async (name) => {
|
|
436
425
|
await runMetaCommand(name, getMetaDir());
|
|
437
426
|
});
|
|
438
427
|
cli.command("validate [dir]", "Validate skill files").usage("validate [dir]").example("validate").example("validate packages/query/skills").action(async (dir) => {
|
|
439
428
|
await runValidateCommand(dir);
|
|
440
429
|
});
|
|
441
|
-
cli.command("install", "
|
|
442
|
-
runInstallCommand();
|
|
430
|
+
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) => {
|
|
431
|
+
await runInstallCommand(options, scanIntentsOrFail);
|
|
443
432
|
});
|
|
444
433
|
cli.command("scaffold", "Print maintainer scaffold prompt").usage("scaffold").action(() => {
|
|
445
434
|
runScaffoldCommand(getMetaDir());
|
|
446
435
|
});
|
|
447
|
-
cli.command("stale [dir]", "Check skills for staleness").usage("stale [dir] [--json]").option("--json", "Output JSON").example("stale").example("stale packages/query").example("stale --json").action(async (targetDir, options) => {
|
|
436
|
+
cli.command("stale [dir]", "Check skills for staleness in the current package or workspace").usage("stale [dir] [--json]").option("--json", "Output JSON").example("stale").example("stale packages/query").example("stale --json").action(async (targetDir, options) => {
|
|
448
437
|
await runStaleCommand(targetDir, options, resolveStaleTargets);
|
|
449
438
|
});
|
|
450
439
|
cli.command("edit-package-json", "Update package.json files so skills are published").usage("edit-package-json").action(async () => {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { n as isStableLoadPath, t as formatRuntimeSkillLookupHint } from "./skill-paths-8k9K9y26.mjs";
|
|
2
|
+
|
|
1
3
|
//#region src/display.ts
|
|
2
4
|
function padColumn(text, width) {
|
|
3
5
|
return text.length >= width ? text + " " : text.padEnd(width);
|
|
@@ -15,7 +17,14 @@ function printSkillLine(displayName, skill, indent, opts) {
|
|
|
15
17
|
const padding = " ".repeat(Math.max(2, opts.nameWidth - nameStr.length));
|
|
16
18
|
const typeCol = opts.showTypes ? (skill.type ? `[${skill.type}]` : "").padEnd(14) : "";
|
|
17
19
|
console.log(`${nameStr}${padding}${typeCol}${skill.description}`);
|
|
18
|
-
if (skill.path)
|
|
20
|
+
if (skill.path) {
|
|
21
|
+
const pathIndent = " ".repeat(indent + 2);
|
|
22
|
+
if (isStableLoadPath(skill.path)) console.log(`${pathIndent}${skill.path}`);
|
|
23
|
+
else console.log(`${pathIndent}${formatRuntimeSkillLookupHint({
|
|
24
|
+
packageName: opts.packageName,
|
|
25
|
+
skillName: skill.name
|
|
26
|
+
})}`);
|
|
27
|
+
}
|
|
19
28
|
}
|
|
20
29
|
function printSkillTree(skills, opts) {
|
|
21
30
|
const roots = [];
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as IntentProjectConfig, c as
|
|
2
|
-
import { i as runEditPackageJson, o as runSetupGithubActions, r as SetupGithubActionsResult, t as EditPackageJsonResult } from "./setup-
|
|
1
|
+
import { a as IntentProjectConfig, c as ScanOptions, d as SkillStaleness, f as StalenessReport, i as IntentPackage, l as ScanResult, n as FeedbackPayload, o as MetaFeedbackPayload, p as VersionConflict, r as IntentConfig, s as MetaSkillName, t as AgentName, u as SkillEntry } from "./types-CsySN6Vw.mjs";
|
|
2
|
+
import { i as runEditPackageJson, o as runSetupGithubActions, r as SetupGithubActionsResult, t as EditPackageJsonResult } from "./setup-DDoOLriA.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/scanner.d.ts
|
|
5
|
-
declare function scanForIntents(root?: string): ScanResult;
|
|
5
|
+
declare function scanForIntents(root?: string, options?: ScanOptions): ScanResult;
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/staleness.d.ts
|
|
8
8
|
declare function checkStaleness(packageDir: string, packageName?: string): Promise<StalenessReport>;
|
|
@@ -55,4 +55,57 @@ declare function resolveDepDir(depName: string, parentDir: string): string | nul
|
|
|
55
55
|
*/
|
|
56
56
|
declare function parseFrontmatter(filePath: string): Record<string, unknown> | null;
|
|
57
57
|
//#endregion
|
|
58
|
-
|
|
58
|
+
//#region src/skill-use.d.ts
|
|
59
|
+
interface SkillUse {
|
|
60
|
+
packageName: string;
|
|
61
|
+
skillName: string;
|
|
62
|
+
}
|
|
63
|
+
type SkillUseParseErrorCode = 'missing-separator' | 'empty-package' | 'empty-skill';
|
|
64
|
+
declare class SkillUseParseError extends Error {
|
|
65
|
+
readonly code: SkillUseParseErrorCode;
|
|
66
|
+
readonly value: string;
|
|
67
|
+
constructor(code: SkillUseParseErrorCode, value: string);
|
|
68
|
+
}
|
|
69
|
+
declare function isSkillUseParseError(error: unknown): error is SkillUseParseError;
|
|
70
|
+
declare function formatSkillUse(packageName: string, skillName: string): string;
|
|
71
|
+
declare function parseSkillUse(value: string): SkillUse;
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/resolver.d.ts
|
|
74
|
+
interface ResolveSkillResult {
|
|
75
|
+
packageName: string;
|
|
76
|
+
skillName: string;
|
|
77
|
+
path: string;
|
|
78
|
+
source: IntentPackage['source'];
|
|
79
|
+
version: string;
|
|
80
|
+
packageRoot: string;
|
|
81
|
+
warnings: Array<string>;
|
|
82
|
+
conflict: VersionConflict | null;
|
|
83
|
+
}
|
|
84
|
+
type ResolveSkillUseErrorCode = 'package-not-found' | 'skill-not-found';
|
|
85
|
+
declare class ResolveSkillUseError extends Error {
|
|
86
|
+
readonly code: ResolveSkillUseErrorCode;
|
|
87
|
+
readonly use: string;
|
|
88
|
+
readonly packageName: string;
|
|
89
|
+
readonly skillName: string;
|
|
90
|
+
readonly availablePackages: Array<string>;
|
|
91
|
+
readonly availableSkills: Array<string>;
|
|
92
|
+
constructor({
|
|
93
|
+
availablePackages,
|
|
94
|
+
availableSkills,
|
|
95
|
+
code,
|
|
96
|
+
packageName,
|
|
97
|
+
skillName,
|
|
98
|
+
use
|
|
99
|
+
}: {
|
|
100
|
+
availablePackages?: Array<string>;
|
|
101
|
+
availableSkills?: Array<string>;
|
|
102
|
+
code: ResolveSkillUseErrorCode;
|
|
103
|
+
packageName: string;
|
|
104
|
+
skillName: string;
|
|
105
|
+
use: string;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
declare function isResolveSkillUseError(error: unknown): error is ResolveSkillUseError;
|
|
109
|
+
declare function resolveSkillUse(use: string, scanResult: ScanResult): ResolveSkillResult;
|
|
110
|
+
//#endregion
|
|
111
|
+
export { type AgentName, type EditPackageJsonResult, type FeedbackPayload, type IntentConfig, type IntentPackage, type IntentProjectConfig, type MetaFeedbackPayload, type MetaSkillName, type ResolveSkillResult, ResolveSkillUseError, type ResolveSkillUseErrorCode, type ScanOptions, type ScanResult, type SetupGithubActionsResult, type SkillEntry, type SkillStaleness, type SkillUse, SkillUseParseError, type SkillUseParseErrorCode, type StalenessReport, checkStaleness, containsSecrets, findSkillFiles, formatSkillUse, getDeps, hasGhCli, isResolveSkillUseError, isSkillUseParseError, metaToMarkdown, parseFrontmatter, parseSkillUse, resolveDepDir, resolveFrequency, resolveSkillUse, runEditPackageJson, runSetupGithubActions, scanForIntents, submitFeedback, submitMetaFeedback, toMarkdown, validateMetaPayload, validatePayload };
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { a as parseFrontmatter, n as findSkillFiles, o as resolveDepDir, r as getDeps } from "./utils-COlDcU72.mjs";
|
|
2
|
-
import "./
|
|
3
|
-
import { t as scanForIntents } from "./scanner-
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
6
|
-
import { r as
|
|
2
|
+
import "./skill-paths-8k9K9y26.mjs";
|
|
3
|
+
import { t as scanForIntents } from "./scanner-DKL8v8is.mjs";
|
|
4
|
+
import "./workspace-patterns-U35B5AO-.mjs";
|
|
5
|
+
import { t as checkStaleness } from "./staleness-DorwfGrf.mjs";
|
|
6
|
+
import { i as parseSkillUse, n as formatSkillUse, r as isSkillUseParseError, t as SkillUseParseError } from "./skill-use-CXOnncWK.mjs";
|
|
7
|
+
import { n as isResolveSkillUseError, r as resolveSkillUse, t as ResolveSkillUseError } from "./resolver-aFigTqXi.mjs";
|
|
8
|
+
import "./project-context-CKG-q4rD.mjs";
|
|
9
|
+
import { r as runSetupGithubActions, t as runEditPackageJson } from "./setup-JJvjiGkM.mjs";
|
|
7
10
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
8
11
|
import { join } from "node:path";
|
|
9
12
|
import { execFileSync, execSync } from "node:child_process";
|
|
@@ -271,4 +274,4 @@ function submitMetaFeedback(payload, opts) {
|
|
|
271
274
|
}
|
|
272
275
|
|
|
273
276
|
//#endregion
|
|
274
|
-
export { checkStaleness, containsSecrets, findSkillFiles, getDeps, hasGhCli, metaToMarkdown, parseFrontmatter, resolveDepDir, resolveFrequency, runEditPackageJson, runSetupGithubActions, scanForIntents, submitFeedback, submitMetaFeedback, toMarkdown, validateMetaPayload, validatePayload };
|
|
277
|
+
export { ResolveSkillUseError, SkillUseParseError, checkStaleness, containsSecrets, findSkillFiles, formatSkillUse, getDeps, hasGhCli, isResolveSkillUseError, isSkillUseParseError, metaToMarkdown, parseFrontmatter, parseSkillUse, resolveDepDir, resolveFrequency, resolveSkillUse, runEditPackageJson, runSetupGithubActions, scanForIntents, submitFeedback, submitMetaFeedback, toMarkdown, validateMetaPayload, validatePayload };
|