skilld 0.10.2 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/detect-imports.mjs +12 -4
- package/dist/_chunks/detect-imports.mjs.map +1 -1
- package/dist/_chunks/markdown.mjs +76 -0
- package/dist/_chunks/markdown.mjs.map +1 -0
- package/dist/_chunks/npm.mjs +54 -27
- package/dist/_chunks/npm.mjs.map +1 -1
- package/dist/_chunks/package-registry.mjs +445 -0
- package/dist/_chunks/package-registry.mjs.map +1 -0
- package/dist/_chunks/utils.d.mts +15 -1
- package/dist/_chunks/utils.d.mts.map +1 -1
- package/dist/_chunks/yaml.mjs +1 -443
- package/dist/_chunks/yaml.mjs.map +1 -1
- package/dist/agent/index.d.mts.map +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/cli.mjs +51 -29
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/retriv/index.d.mts.map +1 -1
- package/dist/retriv/index.mjs +1 -4
- package/dist/retriv/index.mjs.map +1 -1
- package/dist/sources/index.d.mts +2 -2
- package/dist/sources/index.mjs +4 -3
- package/package.json +9 -4
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk.mjs";
|
|
2
2
|
import { _ as writeSections, b as sanitizeMarkdown, h as readCachedSection, y as repairMarkdown } from "./storage.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { t as yamlEscape } from "./yaml.mjs";
|
|
4
|
+
import { i as getPackageRules, r as getFilePatterns } from "./package-registry.mjs";
|
|
4
5
|
import { homedir } from "node:os";
|
|
5
6
|
import { dirname, join, relative } from "pathe";
|
|
6
7
|
import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, realpathSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
|
|
@@ -915,7 +916,7 @@ function buildSectionPrompt(opts) {
|
|
|
915
916
|
"- **Read `_INDEX.md` first** in issues/releases/discussions — only drill into files that look relevant. Skip stub/placeholder files.",
|
|
916
917
|
"- **Skip files starting with `PROMPT_`** — these are generation prompts, not reference material.",
|
|
917
918
|
"- **Stop exploring once you have enough high-quality items** to fill the budget. Do not read additional files just to be thorough.",
|
|
918
|
-
"- **To verify API exports:** Read the `.d.ts` file directly (see Types row in references).
|
|
919
|
+
"- **To verify API exports:** Read the `.d.ts` file directly (see Types row in references). Package directories are often gitignored — if you search `pkg/`, pass `no_ignore: true` to avoid silent empty results."
|
|
919
920
|
];
|
|
920
921
|
return `${preamble}${sectionDef.referenceWeights?.length ? `\n\n## Reference Priority\n\n| Reference | Path | Score | Use For |\n|-----------|------|:-----:|--------|\n${sectionDef.referenceWeights.map((w) => `| ${w.name} | [\`${w.path.split("/").pop()}\`](${w.path}) | ${w.score}/10 | ${w.useFor} |`).join("\n")}` : ""}
|
|
921
922
|
|
|
@@ -1033,7 +1034,7 @@ function formatShortDate(isoDate) {
|
|
|
1033
1034
|
"Dec"
|
|
1034
1035
|
][date.getUTCMonth()]} ${date.getUTCFullYear()}`;
|
|
1035
1036
|
}
|
|
1036
|
-
function generatePackageHeader({ name, description, version, releasedAt, dependencies, distTags, repoUrl, hasIssues, hasDiscussions, hasReleases, pkgFiles, packages, eject }) {
|
|
1037
|
+
function generatePackageHeader({ name, description, version, releasedAt, dependencies, distTags, repoUrl, hasIssues, hasDiscussions, hasReleases, docsType, pkgFiles, packages, eject }) {
|
|
1037
1038
|
let title = `# ${name}`;
|
|
1038
1039
|
if (repoUrl) {
|
|
1039
1040
|
const url = repoUrl.startsWith("http") ? repoUrl : `https://github.com/${repoUrl}`;
|
|
@@ -1068,6 +1069,7 @@ function generatePackageHeader({ name, description, version, releasedAt, depende
|
|
|
1068
1069
|
}
|
|
1069
1070
|
if (pkgFiles?.includes("README.md")) refs.push(`[README](${refBase}/pkg/README.md) — setup, basic usage`);
|
|
1070
1071
|
}
|
|
1072
|
+
if (docsType && docsType !== "readme") refs.push(`[Docs](${refBase}/docs/_INDEX.md) — API reference, guides`);
|
|
1071
1073
|
if (hasIssues) refs.push(`[GitHub Issues](${refBase}/issues/_INDEX.md) — bugs, workarounds, edge cases`);
|
|
1072
1074
|
if (hasDiscussions) refs.push(`[GitHub Discussions](${refBase}/discussions/_INDEX.md) — Q&A, patterns, recipes`);
|
|
1073
1075
|
if (hasReleases) refs.push(`[Releases](${refBase}/releases/_INDEX.md) — changelog, breaking changes, new APIs`);
|
|
@@ -1498,7 +1500,13 @@ async function getAvailableModels() {
|
|
|
1498
1500
|
function resolveReferenceDirs(skillDir) {
|
|
1499
1501
|
const refsDir = join(skillDir, ".skilld");
|
|
1500
1502
|
if (!existsSync(refsDir)) return [];
|
|
1501
|
-
|
|
1503
|
+
const resolved = readdirSync(refsDir).map((entry) => join(refsDir, entry)).filter((p) => lstatSync(p).isSymbolicLink() && existsSync(p)).map((p) => realpathSync(p));
|
|
1504
|
+
const parents = /* @__PURE__ */ new Set();
|
|
1505
|
+
for (const p of resolved) {
|
|
1506
|
+
const parent = dirname(p);
|
|
1507
|
+
if (!resolved.includes(parent)) parents.add(parent);
|
|
1508
|
+
}
|
|
1509
|
+
return [...resolved, ...parents];
|
|
1502
1510
|
}
|
|
1503
1511
|
const CACHE_DIR = join(homedir(), ".skilld", "llm-cache");
|
|
1504
1512
|
function normalizePromptForHash(prompt) {
|