agdex 0.8.0 → 0.9.0
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/README.md +36 -8
- package/dist/cli/index.js +76 -86
- package/dist/{url-scraper-fme0jdje.js → index-az2g46dy.js} +11 -42
- package/dist/index-pyanjjwn.js +21 -0
- package/dist/{index-38fpcrpr.js → index-xbmyce2p.js} +262 -25
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -4
- package/dist/lib/agents-md.d.ts +77 -2
- package/dist/lib/agents-md.d.ts.map +1 -1
- package/dist/lib/index-maintenance.d.ts +6 -0
- package/dist/lib/index-maintenance.d.ts.map +1 -1
- package/dist/lib/lockfile.d.ts +9 -0
- package/dist/lib/lockfile.d.ts.map +1 -1
- package/dist/lib/providers/generic.d.ts +12 -1
- package/dist/lib/providers/generic.d.ts.map +1 -1
- package/dist/lib/providers/index.d.ts +1 -2
- package/dist/lib/providers/index.d.ts.map +1 -1
- package/dist/lib/types.d.ts +18 -0
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/url-scraper.d.ts +0 -11
- package/dist/lib/url-scraper.d.ts.map +1 -1
- package/dist/url-scraper-9bqyj00r.js +7 -0
- package/package.json +2 -2
- package/dist/index-3d051m1n.js +0 -2557
- package/dist/index-e7c8d7rq.js +0 -2357
- package/dist/index-gg9mmf42.js +0 -2357
- package/dist/index-thmt54kg.js +0 -2302
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
__require
|
|
3
|
-
|
|
4
|
-
} from "./url-scraper-fme0jdje.js";
|
|
2
|
+
__require
|
|
3
|
+
} from "./index-pyanjjwn.js";
|
|
5
4
|
|
|
6
5
|
// src/lib/lockfile.ts
|
|
7
6
|
import fs from "fs";
|
|
@@ -68,6 +67,23 @@ function upsertIndexLockEntry(cwd, entry) {
|
|
|
68
67
|
writeIndexLockfile(cwd, lockfile);
|
|
69
68
|
return nextEntry;
|
|
70
69
|
}
|
|
70
|
+
function removeIndexLockEntries(cwd, criteria) {
|
|
71
|
+
const lockfile = readIndexLockfile(cwd);
|
|
72
|
+
const normalizedTarget = criteria.targetFile ? normalizeRelativePath(criteria.targetFile) : undefined;
|
|
73
|
+
const removed = [];
|
|
74
|
+
const kept = lockfile.indexes.filter((entry) => {
|
|
75
|
+
const matches = (criteria.kind === undefined || entry.kind === criteria.kind) && (criteria.marker === undefined || entry.marker === criteria.marker) && (normalizedTarget === undefined || entry.targetFile === normalizedTarget);
|
|
76
|
+
if (matches) {
|
|
77
|
+
removed.push(entry.id);
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
return true;
|
|
81
|
+
});
|
|
82
|
+
if (removed.length > 0) {
|
|
83
|
+
writeIndexLockfile(cwd, { schemaVersion: LOCKFILE_SCHEMA_VERSION, indexes: kept });
|
|
84
|
+
}
|
|
85
|
+
return removed;
|
|
86
|
+
}
|
|
71
87
|
|
|
72
88
|
// src/lib/agents-md.ts
|
|
73
89
|
import { execSync } from "child_process";
|
|
@@ -77,6 +93,9 @@ import os from "os";
|
|
|
77
93
|
var START_MARKER_PREFIX = "<!-- AGENTS-MD-EMBED-START";
|
|
78
94
|
var END_MARKER_PREFIX = "<!-- AGENTS-MD-EMBED-END";
|
|
79
95
|
var MARKER_SUFFIX = " -->";
|
|
96
|
+
var DEFAULT_DOC_INDEX_FILE = "DOCINDEX.md";
|
|
97
|
+
var DOC_SUMMARY_START_MARKER = "<!-- AGENTS-MD-DOCINDEX-SUMMARY-START -->";
|
|
98
|
+
var DOC_SUMMARY_END_MARKER = "<!-- AGENTS-MD-DOCINDEX-SUMMARY-END -->";
|
|
80
99
|
function getStartMarker(providerName) {
|
|
81
100
|
return providerName ? `${START_MARKER_PREFIX}:${providerName}${MARKER_SUFFIX}` : `${START_MARKER_PREFIX}${MARKER_SUFFIX}`;
|
|
82
101
|
}
|
|
@@ -85,7 +104,7 @@ function getEndMarker(providerName) {
|
|
|
85
104
|
}
|
|
86
105
|
async function pullDocs(provider, options) {
|
|
87
106
|
if (provider.urlConfig) {
|
|
88
|
-
const { pullDocsFromUrl } = await import("./url-scraper-
|
|
107
|
+
const { pullDocsFromUrl } = await import("./url-scraper-9bqyj00r.js");
|
|
89
108
|
const docsPath2 = options.docsDir ?? fs2.mkdtempSync(path2.join(os.tmpdir(), "agdex-"));
|
|
90
109
|
return pullDocsFromUrl(provider.urlConfig, docsPath2, { onProgress: options.onProgress });
|
|
91
110
|
}
|
|
@@ -368,6 +387,10 @@ function injectIndex(existingContent, indexContent, providerName) {
|
|
|
368
387
|
const endIdx = existingContent.indexOf(endMarker) + endMarker.length;
|
|
369
388
|
return existingContent.slice(0, startIdx) + wrappedContent + existingContent.slice(endIdx);
|
|
370
389
|
}
|
|
390
|
+
if (existingContent.length === 0) {
|
|
391
|
+
return wrappedContent + `
|
|
392
|
+
`;
|
|
393
|
+
}
|
|
371
394
|
const separator = existingContent.endsWith(`
|
|
372
395
|
`) ? `
|
|
373
396
|
` : `
|
|
@@ -376,6 +399,178 @@ function injectIndex(existingContent, indexContent, providerName) {
|
|
|
376
399
|
return existingContent + separator + wrappedContent + `
|
|
377
400
|
`;
|
|
378
401
|
}
|
|
402
|
+
function getDocIndexEntries(content) {
|
|
403
|
+
const entries = [];
|
|
404
|
+
const regex = /<!-- AGENTS-MD-EMBED-START:(\S+?) -->\r?\n([\s\S]*?)<!-- AGENTS-MD-EMBED-END:\1 -->/g;
|
|
405
|
+
let match;
|
|
406
|
+
while ((match = regex.exec(content)) !== null) {
|
|
407
|
+
const name = match[1];
|
|
408
|
+
const block = match[2];
|
|
409
|
+
const headerMatch = block.match(/\[(.+?)\]/);
|
|
410
|
+
let displayName = name;
|
|
411
|
+
if (headerMatch) {
|
|
412
|
+
const parsed = headerMatch[1].replace(/\s*Docs Index$/, "").trim();
|
|
413
|
+
displayName = parsed || name;
|
|
414
|
+
}
|
|
415
|
+
entries.push({ name, displayName });
|
|
416
|
+
}
|
|
417
|
+
return entries;
|
|
418
|
+
}
|
|
419
|
+
function generateDocIndexSummary(entries, docIndexFile = DEFAULT_DOC_INDEX_FILE) {
|
|
420
|
+
const lines = [
|
|
421
|
+
"## Document Indices",
|
|
422
|
+
"",
|
|
423
|
+
`IMPORTANT: Prefer retrieval-led reasoning over pre-training-led reasoning for any of the docs found in ${docIndexFile} .`,
|
|
424
|
+
""
|
|
425
|
+
];
|
|
426
|
+
if (entries.length === 0) {
|
|
427
|
+
lines.push("_No documentation indices available yet._");
|
|
428
|
+
} else {
|
|
429
|
+
for (const entry of entries) {
|
|
430
|
+
lines.push(`- ${entry.displayName} (\`${entry.name}\`)`);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return lines.join(`
|
|
434
|
+
`);
|
|
435
|
+
}
|
|
436
|
+
function hasDocIndexSummary(content) {
|
|
437
|
+
return content.includes(DOC_SUMMARY_START_MARKER);
|
|
438
|
+
}
|
|
439
|
+
function injectDocIndexSummary(existingContent, summaryContent) {
|
|
440
|
+
const wrappedContent = `${DOC_SUMMARY_START_MARKER}
|
|
441
|
+
${summaryContent}
|
|
442
|
+
${DOC_SUMMARY_END_MARKER}`;
|
|
443
|
+
if (hasDocIndexSummary(existingContent)) {
|
|
444
|
+
const startIdx = existingContent.indexOf(DOC_SUMMARY_START_MARKER);
|
|
445
|
+
const endIdx = existingContent.indexOf(DOC_SUMMARY_END_MARKER) + DOC_SUMMARY_END_MARKER.length;
|
|
446
|
+
return existingContent.slice(0, startIdx) + wrappedContent + existingContent.slice(endIdx);
|
|
447
|
+
}
|
|
448
|
+
if (existingContent.length === 0) {
|
|
449
|
+
return wrappedContent + `
|
|
450
|
+
`;
|
|
451
|
+
}
|
|
452
|
+
const separator = existingContent.endsWith(`
|
|
453
|
+
`) ? `
|
|
454
|
+
` : `
|
|
455
|
+
|
|
456
|
+
`;
|
|
457
|
+
return existingContent + separator + wrappedContent + `
|
|
458
|
+
`;
|
|
459
|
+
}
|
|
460
|
+
function removeDocIndexSummary(content) {
|
|
461
|
+
if (!hasDocIndexSummary(content)) {
|
|
462
|
+
return content;
|
|
463
|
+
}
|
|
464
|
+
const startIdx = content.indexOf(DOC_SUMMARY_START_MARKER);
|
|
465
|
+
const endIdx = content.indexOf(DOC_SUMMARY_END_MARKER) + DOC_SUMMARY_END_MARKER.length;
|
|
466
|
+
let result = content.slice(0, startIdx) + content.slice(endIdx);
|
|
467
|
+
result = result.replace(/\n{3,}/g, `
|
|
468
|
+
|
|
469
|
+
`);
|
|
470
|
+
result = result.trimEnd();
|
|
471
|
+
if (result.length > 0) {
|
|
472
|
+
result += `
|
|
473
|
+
`;
|
|
474
|
+
}
|
|
475
|
+
return result;
|
|
476
|
+
}
|
|
477
|
+
function applyDocIndex(options) {
|
|
478
|
+
const { cwd, agentFile, providerName, indexContent } = options;
|
|
479
|
+
const docIndexFile = options.docIndexFile || DEFAULT_DOC_INDEX_FILE;
|
|
480
|
+
const docIndexPath = path2.join(cwd, docIndexFile);
|
|
481
|
+
const agentPath = path2.join(cwd, agentFile);
|
|
482
|
+
let docIndexContent = "";
|
|
483
|
+
let docIndexSizeBefore = 0;
|
|
484
|
+
if (fs2.existsSync(docIndexPath)) {
|
|
485
|
+
docIndexContent = fs2.readFileSync(docIndexPath, "utf-8");
|
|
486
|
+
docIndexSizeBefore = Buffer.byteLength(docIndexContent, "utf-8");
|
|
487
|
+
}
|
|
488
|
+
const newDocIndexContent = injectIndex(docIndexContent, indexContent, providerName);
|
|
489
|
+
fs2.writeFileSync(docIndexPath, newDocIndexContent, "utf-8");
|
|
490
|
+
const docIndexSizeAfter = Buffer.byteLength(newDocIndexContent, "utf-8");
|
|
491
|
+
let agentContent = "";
|
|
492
|
+
let agentSizeBefore = 0;
|
|
493
|
+
let isNewAgentFile = true;
|
|
494
|
+
if (fs2.existsSync(agentPath)) {
|
|
495
|
+
agentContent = fs2.readFileSync(agentPath, "utf-8");
|
|
496
|
+
agentSizeBefore = Buffer.byteLength(agentContent, "utf-8");
|
|
497
|
+
isNewAgentFile = false;
|
|
498
|
+
}
|
|
499
|
+
const entries = getDocIndexEntries(newDocIndexContent);
|
|
500
|
+
const summary = generateDocIndexSummary(entries, docIndexFile);
|
|
501
|
+
const newAgentContent = injectDocIndexSummary(agentContent, summary);
|
|
502
|
+
fs2.writeFileSync(agentPath, newAgentContent, "utf-8");
|
|
503
|
+
const agentSizeAfter = Buffer.byteLength(newAgentContent, "utf-8");
|
|
504
|
+
return {
|
|
505
|
+
docIndexFile,
|
|
506
|
+
docIndexPath,
|
|
507
|
+
agentFile,
|
|
508
|
+
agentPath,
|
|
509
|
+
isNewAgentFile,
|
|
510
|
+
agentSizeBefore,
|
|
511
|
+
agentSizeAfter,
|
|
512
|
+
docIndexSizeBefore,
|
|
513
|
+
docIndexSizeAfter,
|
|
514
|
+
entries
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
function removeDocIndexEntry(options) {
|
|
518
|
+
const { cwd, agentFile, providerName } = options;
|
|
519
|
+
const docIndexFile = options.docIndexFile || DEFAULT_DOC_INDEX_FILE;
|
|
520
|
+
const docIndexPath = path2.join(cwd, docIndexFile);
|
|
521
|
+
const agentPath = path2.join(cwd, agentFile);
|
|
522
|
+
const base = {
|
|
523
|
+
removed: false,
|
|
524
|
+
removedProviders: [],
|
|
525
|
+
docIndexFile,
|
|
526
|
+
docIndexDeleted: false,
|
|
527
|
+
agentFile,
|
|
528
|
+
agentSizeBefore: 0,
|
|
529
|
+
agentSizeAfter: 0,
|
|
530
|
+
docIndexSizeBefore: 0,
|
|
531
|
+
docIndexSizeAfter: 0
|
|
532
|
+
};
|
|
533
|
+
if (!fs2.existsSync(docIndexPath)) {
|
|
534
|
+
return base;
|
|
535
|
+
}
|
|
536
|
+
const docIndexContent = fs2.readFileSync(docIndexPath, "utf-8");
|
|
537
|
+
base.docIndexSizeBefore = Buffer.byteLength(docIndexContent, "utf-8");
|
|
538
|
+
if (!hasExistingIndex(docIndexContent, providerName)) {
|
|
539
|
+
base.docIndexSizeAfter = base.docIndexSizeBefore;
|
|
540
|
+
return base;
|
|
541
|
+
}
|
|
542
|
+
const before = getEmbeddedProviders(docIndexContent);
|
|
543
|
+
const newDocIndexContent = removeDocsIndex(docIndexContent, providerName);
|
|
544
|
+
const after = getEmbeddedProviders(newDocIndexContent);
|
|
545
|
+
base.removedProviders = before.filter((p) => !after.includes(p));
|
|
546
|
+
base.removed = true;
|
|
547
|
+
const remainingEntries = getDocIndexEntries(newDocIndexContent);
|
|
548
|
+
let agentContent = "";
|
|
549
|
+
if (fs2.existsSync(agentPath)) {
|
|
550
|
+
agentContent = fs2.readFileSync(agentPath, "utf-8");
|
|
551
|
+
base.agentSizeBefore = Buffer.byteLength(agentContent, "utf-8");
|
|
552
|
+
}
|
|
553
|
+
if (remainingEntries.length === 0) {
|
|
554
|
+
fs2.rmSync(docIndexPath);
|
|
555
|
+
base.docIndexDeleted = true;
|
|
556
|
+
base.docIndexSizeAfter = 0;
|
|
557
|
+
const newAgentContent = removeDocIndexSummary(agentContent);
|
|
558
|
+
if (fs2.existsSync(agentPath)) {
|
|
559
|
+
fs2.writeFileSync(agentPath, newAgentContent, "utf-8");
|
|
560
|
+
}
|
|
561
|
+
base.agentSizeAfter = Buffer.byteLength(newAgentContent, "utf-8");
|
|
562
|
+
} else {
|
|
563
|
+
fs2.writeFileSync(docIndexPath, newDocIndexContent, "utf-8");
|
|
564
|
+
base.docIndexSizeAfter = Buffer.byteLength(newDocIndexContent, "utf-8");
|
|
565
|
+
const summary = generateDocIndexSummary(remainingEntries, docIndexFile);
|
|
566
|
+
const newAgentContent = injectDocIndexSummary(agentContent, summary);
|
|
567
|
+
if (fs2.existsSync(agentPath) || newAgentContent.length > 0) {
|
|
568
|
+
fs2.writeFileSync(agentPath, newAgentContent, "utf-8");
|
|
569
|
+
}
|
|
570
|
+
base.agentSizeAfter = Buffer.byteLength(newAgentContent, "utf-8");
|
|
571
|
+
}
|
|
572
|
+
return base;
|
|
573
|
+
}
|
|
379
574
|
function ensureGitignoreEntry(cwd, docsDir) {
|
|
380
575
|
const gitignorePath = path2.join(cwd, ".gitignore");
|
|
381
576
|
const entry = docsDir.endsWith("/") ? docsDir : `${docsDir}/`;
|
|
@@ -413,7 +608,8 @@ async function embed(options) {
|
|
|
413
608
|
output = "CLAUDE.local.md",
|
|
414
609
|
docsDir: customDocsDir,
|
|
415
610
|
globalCache = false,
|
|
416
|
-
description
|
|
611
|
+
description,
|
|
612
|
+
docIndexFile = DEFAULT_DOC_INDEX_FILE
|
|
417
613
|
} = options;
|
|
418
614
|
let docsPath;
|
|
419
615
|
let docsLinkPath;
|
|
@@ -432,15 +628,6 @@ async function embed(options) {
|
|
|
432
628
|
docsPath = path2.join(cwd, docsDir);
|
|
433
629
|
docsLinkPath = `./${docsDir}`;
|
|
434
630
|
}
|
|
435
|
-
const targetPath = path2.join(cwd, output);
|
|
436
|
-
let sizeBefore = 0;
|
|
437
|
-
let isNewFile = true;
|
|
438
|
-
let existingContent = "";
|
|
439
|
-
if (fs2.existsSync(targetPath)) {
|
|
440
|
-
existingContent = fs2.readFileSync(targetPath, "utf-8");
|
|
441
|
-
sizeBefore = Buffer.byteLength(existingContent, "utf-8");
|
|
442
|
-
isNewFile = false;
|
|
443
|
-
}
|
|
444
631
|
const cacheHit = fs2.existsSync(docsPath) && fs2.readdirSync(docsPath).length > 0;
|
|
445
632
|
let pullResult;
|
|
446
633
|
if (cacheHit) {
|
|
@@ -483,9 +670,13 @@ async function embed(options) {
|
|
|
483
670
|
description,
|
|
484
671
|
regenerateCommand
|
|
485
672
|
});
|
|
486
|
-
const
|
|
487
|
-
|
|
488
|
-
|
|
673
|
+
const applied = applyDocIndex({
|
|
674
|
+
cwd,
|
|
675
|
+
agentFile: output,
|
|
676
|
+
providerName: provider.name,
|
|
677
|
+
indexContent,
|
|
678
|
+
docIndexFile
|
|
679
|
+
});
|
|
489
680
|
let gitignoreUpdated = false;
|
|
490
681
|
if (!globalCache && !customDocsDir) {
|
|
491
682
|
const gitignoreResult = ensureGitignoreEntry(cwd, ".agdex");
|
|
@@ -517,11 +708,14 @@ async function embed(options) {
|
|
|
517
708
|
targetFile: output,
|
|
518
709
|
docsPath: globalCache ? docsPath : docsDir,
|
|
519
710
|
version: pullResult.version,
|
|
520
|
-
sizeBefore,
|
|
521
|
-
sizeAfter,
|
|
522
|
-
isNewFile,
|
|
711
|
+
sizeBefore: applied.agentSizeBefore,
|
|
712
|
+
sizeAfter: applied.agentSizeAfter,
|
|
713
|
+
isNewFile: applied.isNewAgentFile,
|
|
523
714
|
gitignoreUpdated,
|
|
524
|
-
cacheHit
|
|
715
|
+
cacheHit,
|
|
716
|
+
docIndexFile: applied.docIndexFile,
|
|
717
|
+
docIndexSizeBefore: applied.docIndexSizeBefore,
|
|
718
|
+
docIndexSizeAfter: applied.docIndexSizeAfter
|
|
525
719
|
};
|
|
526
720
|
}
|
|
527
721
|
|
|
@@ -1828,6 +2022,18 @@ function createLocalProvider(options) {
|
|
|
1828
2022
|
instruction: options.instruction || `IMPORTANT: Prefer retrieval-led reasoning over pre-training-led reasoning for any ${options.displayName} tasks.`
|
|
1829
2023
|
};
|
|
1830
2024
|
}
|
|
2025
|
+
function createUrlProvider(options) {
|
|
2026
|
+
return {
|
|
2027
|
+
name: options.name,
|
|
2028
|
+
displayName: options.displayName,
|
|
2029
|
+
repo: "",
|
|
2030
|
+
docsPath: "",
|
|
2031
|
+
extensions: options.extensions || [".md"],
|
|
2032
|
+
excludePatterns: options.excludePatterns || [],
|
|
2033
|
+
instruction: options.instruction || `IMPORTANT: Prefer retrieval-led reasoning over pre-training-led reasoning for any ${options.displayName} tasks.`,
|
|
2034
|
+
urlConfig: options.urlConfig
|
|
2035
|
+
};
|
|
2036
|
+
}
|
|
1831
2037
|
// src/lib/providers/sveltekit.ts
|
|
1832
2038
|
import fs21 from "fs";
|
|
1833
2039
|
import path21 from "path";
|
|
@@ -2444,6 +2650,20 @@ import fs25 from "fs";
|
|
|
2444
2650
|
import path25 from "path";
|
|
2445
2651
|
var DOCS_MARKER_REGEX = /<!-- AGENTS-MD-EMBED-START:(\S+?) -->/g;
|
|
2446
2652
|
var SKILLS_START_MARKER2 = "<!-- AGENTS-MD-SKILLS-START -->";
|
|
2653
|
+
var DOC_INDEX_FILE = "DOCINDEX.md";
|
|
2654
|
+
function readDocIndexMarkers(cwd) {
|
|
2655
|
+
const docIndexPath = path25.join(cwd, DOC_INDEX_FILE);
|
|
2656
|
+
const names = new Set;
|
|
2657
|
+
if (!fs25.existsSync(docIndexPath))
|
|
2658
|
+
return names;
|
|
2659
|
+
const content = fs25.readFileSync(docIndexPath, "utf-8");
|
|
2660
|
+
const regex = new RegExp(DOCS_MARKER_REGEX.source, "g");
|
|
2661
|
+
let match;
|
|
2662
|
+
while ((match = regex.exec(content)) !== null) {
|
|
2663
|
+
names.add(match[1]);
|
|
2664
|
+
}
|
|
2665
|
+
return names;
|
|
2666
|
+
}
|
|
2447
2667
|
function getDefaultStatusTargets(cwd) {
|
|
2448
2668
|
const targets = [
|
|
2449
2669
|
getDefaultOutput(cwd),
|
|
@@ -2474,16 +2694,21 @@ function createStatusReport(options) {
|
|
|
2474
2694
|
const lockfile = readIndexLockfile(cwd);
|
|
2475
2695
|
const scannedFiles = options.targetFile ? [options.targetFile] : getScannedFiles(cwd, lockfile);
|
|
2476
2696
|
const markers = scannedFiles.flatMap((targetFile) => readEmbeddedMarkers(cwd, targetFile));
|
|
2697
|
+
const docIndexMarkers = readDocIndexMarkers(cwd);
|
|
2477
2698
|
const indexes = [];
|
|
2478
2699
|
const seenMarkers = new Set;
|
|
2700
|
+
const trackedDocsMarkers = new Set;
|
|
2479
2701
|
for (const entry of lockfile.indexes) {
|
|
2480
2702
|
if (options.targetFile && entry.targetFile !== options.targetFile)
|
|
2481
2703
|
continue;
|
|
2482
2704
|
const markerKey = getMarkerKey(entry.kind, entry.marker, entry.targetFile);
|
|
2483
|
-
const
|
|
2484
|
-
|
|
2705
|
+
const markerInFile = markers.find((candidate) => candidate.kind === entry.kind && candidate.marker === entry.marker && candidate.targetFile === entry.targetFile);
|
|
2706
|
+
const hasMarker = entry.kind === "docs" ? Boolean(markerInFile) || docIndexMarkers.has(entry.marker) : Boolean(markerInFile);
|
|
2707
|
+
if (markerInFile)
|
|
2485
2708
|
seenMarkers.add(markerKey);
|
|
2486
|
-
|
|
2709
|
+
if (entry.kind === "docs")
|
|
2710
|
+
trackedDocsMarkers.add(entry.marker);
|
|
2711
|
+
indexes.push(analyzeLockfileEntry(cwd, entry, hasMarker));
|
|
2487
2712
|
}
|
|
2488
2713
|
for (const marker of markers) {
|
|
2489
2714
|
const markerKey = getMarkerKey(marker.kind, marker.marker, marker.targetFile);
|
|
@@ -2498,6 +2723,18 @@ function createStatusReport(options) {
|
|
|
2498
2723
|
suggestedAction: "Run `agdex migrate` or rerun the embed command to create a lockfile entry."
|
|
2499
2724
|
});
|
|
2500
2725
|
}
|
|
2726
|
+
for (const name of docIndexMarkers) {
|
|
2727
|
+
if (trackedDocsMarkers.has(name))
|
|
2728
|
+
continue;
|
|
2729
|
+
indexes.push({
|
|
2730
|
+
id: `untracked:docs:${name}:${DOC_INDEX_FILE}`,
|
|
2731
|
+
kind: "docs",
|
|
2732
|
+
health: "untracked-marker",
|
|
2733
|
+
targetFile: DOC_INDEX_FILE,
|
|
2734
|
+
marker: name,
|
|
2735
|
+
suggestedAction: "Run `agdex migrate` or rerun the embed command to create a lockfile entry."
|
|
2736
|
+
});
|
|
2737
|
+
}
|
|
2501
2738
|
return {
|
|
2502
2739
|
cwd,
|
|
2503
2740
|
lockfilePath: path25.join(cwd, ".agdex", "agdex.lock"),
|
|
@@ -2555,4 +2792,4 @@ function getMarkerKey(kind, marker, targetFile) {
|
|
|
2555
2792
|
return `${kind}:${marker}:${targetFile}`;
|
|
2556
2793
|
}
|
|
2557
2794
|
|
|
2558
|
-
export { getLockfilePath, createIndexId, readIndexLockfile, writeIndexLockfile, upsertIndexLockEntry, pullDocs, collectDocFiles, buildDocTree, generateIndex, hasExistingIndex, getEmbeddedProviders, removeDocsIndex, injectIndex, ensureGitignoreEntry, getGlobalCacheDir, getLocalCacheDir, embed, nextjsProvider, reactProvider, pixiProvider, rattlerBuildProvider, tauriProvider, condaForgeProvider, bunProvider, svelteProvider, tailwindProvider, ruffProvider, tyProvider, basedpyrightProvider, convexProvider, polarsProvider, deltaRsProvider, obsidianProvider, obsidianExcalidrawProvider, ffmpegProvider, manimProvider, tensorrtProvider, createProvider, createLocalProvider, getProvider, listProviders, isProviderAvailable, fetchSkillsShSearch, getEnabledPluginSources, parseSkillFrontmatter, discoverPluginSkills, discoverFlatSkills, discoverSkillsShRepo, collectAllSkills, generateSkillsIndex, hasExistingSkillsIndex, removeSkillsIndex, injectSkillsIndex, getDefaultSkillSources, embedSkills, loadConfig, getDefaultOutput, getDefaultStatusTargets, readEmbeddedMarkers, createStatusReport };
|
|
2795
|
+
export { getLockfilePath, createIndexId, readIndexLockfile, writeIndexLockfile, upsertIndexLockEntry, removeIndexLockEntries, DEFAULT_DOC_INDEX_FILE, pullDocs, collectDocFiles, buildDocTree, generateIndex, hasExistingIndex, getEmbeddedProviders, removeDocsIndex, injectIndex, getDocIndexEntries, generateDocIndexSummary, hasDocIndexSummary, injectDocIndexSummary, removeDocIndexSummary, applyDocIndex, removeDocIndexEntry, ensureGitignoreEntry, getGlobalCacheDir, getLocalCacheDir, embed, nextjsProvider, reactProvider, pixiProvider, rattlerBuildProvider, tauriProvider, condaForgeProvider, bunProvider, svelteProvider, tailwindProvider, ruffProvider, tyProvider, basedpyrightProvider, convexProvider, polarsProvider, deltaRsProvider, obsidianProvider, obsidianExcalidrawProvider, ffmpegProvider, manimProvider, tensorrtProvider, createProvider, createLocalProvider, createUrlProvider, getProvider, listProviders, isProviderAvailable, fetchSkillsShSearch, getEnabledPluginSources, parseSkillFrontmatter, discoverPluginSkills, discoverFlatSkills, discoverSkillsShRepo, collectAllSkills, generateSkillsIndex, hasExistingSkillsIndex, removeSkillsIndex, injectSkillsIndex, getDefaultSkillSources, embedSkills, loadConfig, getDefaultOutput, readDocIndexMarkers, getDefaultStatusTargets, readEmbeddedMarkers, createStatusReport };
|
package/dist/index.d.ts
CHANGED
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
* })
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
export { embed, pullDocs, collectDocFiles, buildDocTree, generateIndex, injectIndex, hasExistingIndex, removeDocsIndex, getEmbeddedProviders, ensureGitignoreEntry, getGlobalCacheDir, getLocalCacheDir, } from './lib/agents-md';
|
|
38
|
+
export { embed, pullDocs, collectDocFiles, buildDocTree, generateIndex, injectIndex, hasExistingIndex, removeDocsIndex, getEmbeddedProviders, ensureGitignoreEntry, getGlobalCacheDir, getLocalCacheDir, DEFAULT_DOC_INDEX_FILE, getDocIndexEntries, generateDocIndexSummary, hasDocIndexSummary, injectDocIndexSummary, removeDocIndexSummary, applyDocIndex, removeDocIndexEntry, } from './lib/agents-md';
|
|
39
39
|
export { nextjsProvider, reactProvider, pixiProvider, rattlerBuildProvider, tauriProvider, condaForgeProvider, bunProvider, tensorrtProvider, createProvider, createLocalProvider, createUrlProvider, getProvider, listProviders, isProviderAvailable, } from './lib/providers';
|
|
40
40
|
export { pullDocsFromUrl } from './lib/url-scraper';
|
|
41
41
|
export { embedSkills, collectAllSkills, parseSkillFrontmatter, discoverPluginSkills, discoverFlatSkills, generateSkillsIndex, injectSkillsIndex, hasExistingSkillsIndex, removeSkillsIndex, getDefaultSkillSources, getEnabledPluginSources, } from './lib/skills';
|
|
42
42
|
export { loadConfig, getDefaultOutput } from './lib/config';
|
|
43
43
|
export type { AgdexConfig } from './lib/config';
|
|
44
|
-
export { createIndexId, getLockfilePath, readIndexLockfile, writeIndexLockfile, upsertIndexLockEntry, } from './lib/lockfile';
|
|
45
|
-
export { createStatusReport, getDefaultStatusTargets, readEmbeddedMarkers, } from './lib/index-maintenance';
|
|
44
|
+
export { createIndexId, getLockfilePath, readIndexLockfile, writeIndexLockfile, upsertIndexLockEntry, removeIndexLockEntries, } from './lib/lockfile';
|
|
45
|
+
export { createStatusReport, getDefaultStatusTargets, readEmbeddedMarkers, readDocIndexMarkers, } from './lib/index-maintenance';
|
|
46
46
|
export type { IndexLockEntry, IndexLockSource, IndexLockfile, IndexSourceType, } from './lib/lockfile';
|
|
47
47
|
export type { EmbeddedMarker, IndexHealth, IndexStatus, StatusOptions, StatusReport, } from './lib/index-maintenance';
|
|
48
|
-
export type { DocProvider, DocFile, DocSection, VersionResult, PullResult, GitignoreStatus, IndexOptions, EmbedOptions, EmbedResult, ProviderPreset, UrlDocConfig, SkillFrontmatter, SkillEntry, SkillSource, SkillSourceConfig, SkillsEmbedOptions, SkillsEmbedResult, } from './lib/types';
|
|
48
|
+
export type { DocProvider, DocFile, DocSection, DocIndexEntry, VersionResult, PullResult, GitignoreStatus, IndexOptions, EmbedOptions, EmbedResult, ProviderPreset, UrlDocConfig, SkillFrontmatter, SkillEntry, SkillSource, SkillSourceConfig, SkillsEmbedOptions, SkillsEmbedResult, } from './lib/types';
|
|
49
49
|
export type { GenericProviderOptions } from './lib/providers/generic';
|
|
50
50
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAGH,OAAO,EACL,KAAK,EACL,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAGH,OAAO,EACL,KAAK,EACL,QAAQ,EACR,eAAe,EACf,YAAY,EAC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EACP,UAAU,EACV,aAAa,EACb,aAAa,EACb,UAAU,EACV,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,aAAa,CAAA;AAEpB,YAAY,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
+
DEFAULT_DOC_INDEX_FILE,
|
|
3
|
+
applyDocIndex,
|
|
2
4
|
buildDocTree,
|
|
3
5
|
bunProvider,
|
|
4
6
|
collectAllSkills,
|
|
@@ -8,24 +10,29 @@ import {
|
|
|
8
10
|
createLocalProvider,
|
|
9
11
|
createProvider,
|
|
10
12
|
createStatusReport,
|
|
13
|
+
createUrlProvider,
|
|
11
14
|
discoverFlatSkills,
|
|
12
15
|
discoverPluginSkills,
|
|
13
16
|
embed,
|
|
14
17
|
embedSkills,
|
|
15
18
|
ensureGitignoreEntry,
|
|
19
|
+
generateDocIndexSummary,
|
|
16
20
|
generateIndex,
|
|
17
21
|
generateSkillsIndex,
|
|
18
22
|
getDefaultOutput,
|
|
19
23
|
getDefaultSkillSources,
|
|
20
24
|
getDefaultStatusTargets,
|
|
25
|
+
getDocIndexEntries,
|
|
21
26
|
getEmbeddedProviders,
|
|
22
27
|
getEnabledPluginSources,
|
|
23
28
|
getGlobalCacheDir,
|
|
24
29
|
getLocalCacheDir,
|
|
25
30
|
getLockfilePath,
|
|
26
31
|
getProvider,
|
|
32
|
+
hasDocIndexSummary,
|
|
27
33
|
hasExistingIndex,
|
|
28
34
|
hasExistingSkillsIndex,
|
|
35
|
+
injectDocIndexSummary,
|
|
29
36
|
injectIndex,
|
|
30
37
|
injectSkillsIndex,
|
|
31
38
|
isProviderAvailable,
|
|
@@ -37,28 +44,36 @@ import {
|
|
|
37
44
|
pullDocs,
|
|
38
45
|
rattlerBuildProvider,
|
|
39
46
|
reactProvider,
|
|
47
|
+
readDocIndexMarkers,
|
|
40
48
|
readEmbeddedMarkers,
|
|
41
49
|
readIndexLockfile,
|
|
50
|
+
removeDocIndexEntry,
|
|
51
|
+
removeDocIndexSummary,
|
|
42
52
|
removeDocsIndex,
|
|
53
|
+
removeIndexLockEntries,
|
|
43
54
|
removeSkillsIndex,
|
|
44
55
|
tauriProvider,
|
|
45
56
|
tensorrtProvider,
|
|
46
57
|
upsertIndexLockEntry,
|
|
47
58
|
writeIndexLockfile
|
|
48
|
-
} from "./index-
|
|
59
|
+
} from "./index-xbmyce2p.js";
|
|
49
60
|
import {
|
|
50
|
-
createUrlProvider,
|
|
51
61
|
pullDocsFromUrl
|
|
52
|
-
} from "./
|
|
62
|
+
} from "./index-az2g46dy.js";
|
|
63
|
+
import"./index-pyanjjwn.js";
|
|
53
64
|
export {
|
|
54
65
|
writeIndexLockfile,
|
|
55
66
|
upsertIndexLockEntry,
|
|
56
67
|
tensorrtProvider,
|
|
57
68
|
tauriProvider,
|
|
58
69
|
removeSkillsIndex,
|
|
70
|
+
removeIndexLockEntries,
|
|
59
71
|
removeDocsIndex,
|
|
72
|
+
removeDocIndexSummary,
|
|
73
|
+
removeDocIndexEntry,
|
|
60
74
|
readIndexLockfile,
|
|
61
75
|
readEmbeddedMarkers,
|
|
76
|
+
readDocIndexMarkers,
|
|
62
77
|
reactProvider,
|
|
63
78
|
rattlerBuildProvider,
|
|
64
79
|
pullDocsFromUrl,
|
|
@@ -71,19 +86,23 @@ export {
|
|
|
71
86
|
isProviderAvailable,
|
|
72
87
|
injectSkillsIndex,
|
|
73
88
|
injectIndex,
|
|
89
|
+
injectDocIndexSummary,
|
|
74
90
|
hasExistingSkillsIndex,
|
|
75
91
|
hasExistingIndex,
|
|
92
|
+
hasDocIndexSummary,
|
|
76
93
|
getProvider,
|
|
77
94
|
getLockfilePath,
|
|
78
95
|
getLocalCacheDir,
|
|
79
96
|
getGlobalCacheDir,
|
|
80
97
|
getEnabledPluginSources,
|
|
81
98
|
getEmbeddedProviders,
|
|
99
|
+
getDocIndexEntries,
|
|
82
100
|
getDefaultStatusTargets,
|
|
83
101
|
getDefaultSkillSources,
|
|
84
102
|
getDefaultOutput,
|
|
85
103
|
generateSkillsIndex,
|
|
86
104
|
generateIndex,
|
|
105
|
+
generateDocIndexSummary,
|
|
87
106
|
ensureGitignoreEntry,
|
|
88
107
|
embedSkills,
|
|
89
108
|
embed,
|
|
@@ -98,5 +117,7 @@ export {
|
|
|
98
117
|
collectDocFiles,
|
|
99
118
|
collectAllSkills,
|
|
100
119
|
bunProvider,
|
|
101
|
-
buildDocTree
|
|
120
|
+
buildDocTree,
|
|
121
|
+
applyDocIndex,
|
|
122
|
+
DEFAULT_DOC_INDEX_FILE
|
|
102
123
|
};
|
package/dist/lib/agents-md.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { DocProvider, DocFile, DocSection, PullResult, GitignoreStatus, IndexOptions, EmbedOptions, EmbedResult } from './types';
|
|
1
|
+
import type { DocProvider, DocFile, DocSection, DocIndexEntry, PullResult, GitignoreStatus, IndexOptions, EmbedOptions, EmbedResult } from './types';
|
|
2
|
+
/** Default file the full docs index is written to (progressive disclosure). */
|
|
3
|
+
export declare const DEFAULT_DOC_INDEX_FILE = "DOCINDEX.md";
|
|
2
4
|
/**
|
|
3
5
|
* Pull documentation from a GitHub repository or URL
|
|
4
6
|
*/
|
|
@@ -45,6 +47,79 @@ export declare function removeDocsIndex(content: string, providerName?: string):
|
|
|
45
47
|
* If providerName specified, only replaces that provider's index (or appends if not present)
|
|
46
48
|
*/
|
|
47
49
|
export declare function injectIndex(existingContent: string, indexContent: string, providerName?: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* Parse the documentation indices present in a DOCINDEX.md file.
|
|
52
|
+
*
|
|
53
|
+
* Each index is wrapped in AGENTS-MD-EMBED-START/END markers and begins with a
|
|
54
|
+
* `[<displayName> Docs Index]` header. Returns the marker name plus a readable
|
|
55
|
+
* display name for each index, in document order.
|
|
56
|
+
*/
|
|
57
|
+
export declare function getDocIndexEntries(content: string): DocIndexEntry[];
|
|
58
|
+
/**
|
|
59
|
+
* Generate the progressive-disclosure summary section that lives in
|
|
60
|
+
* AGENTS.md/CLAUDE.md. It points agents at the full index file and lists the
|
|
61
|
+
* documentation indices currently available there.
|
|
62
|
+
*/
|
|
63
|
+
export declare function generateDocIndexSummary(entries: DocIndexEntry[], docIndexFile?: string): string;
|
|
64
|
+
/**
|
|
65
|
+
* Check whether content already contains the Document Indices summary section
|
|
66
|
+
*/
|
|
67
|
+
export declare function hasDocIndexSummary(content: string): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Inject (or replace) the Document Indices summary section in AGENTS.md/CLAUDE.md
|
|
70
|
+
*/
|
|
71
|
+
export declare function injectDocIndexSummary(existingContent: string, summaryContent: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* Remove the Document Indices summary section from content
|
|
74
|
+
*/
|
|
75
|
+
export declare function removeDocIndexSummary(content: string): string;
|
|
76
|
+
export interface ApplyDocIndexResult {
|
|
77
|
+
docIndexFile: string;
|
|
78
|
+
docIndexPath: string;
|
|
79
|
+
agentFile: string;
|
|
80
|
+
agentPath: string;
|
|
81
|
+
isNewAgentFile: boolean;
|
|
82
|
+
agentSizeBefore: number;
|
|
83
|
+
agentSizeAfter: number;
|
|
84
|
+
docIndexSizeBefore: number;
|
|
85
|
+
docIndexSizeAfter: number;
|
|
86
|
+
entries: DocIndexEntry[];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Apply a generated index using the progressive-disclosure strategy:
|
|
90
|
+
* 1. Write/replace the full index block in DOCINDEX.md (keyed by providerName)
|
|
91
|
+
* 2. Refresh the "## Document Indices" summary section in the agent file
|
|
92
|
+
* (AGENTS.md/CLAUDE.md) so it lists every index currently in DOCINDEX.md.
|
|
93
|
+
*/
|
|
94
|
+
export declare function applyDocIndex(options: {
|
|
95
|
+
cwd: string;
|
|
96
|
+
agentFile: string;
|
|
97
|
+
providerName: string;
|
|
98
|
+
indexContent: string;
|
|
99
|
+
docIndexFile?: string;
|
|
100
|
+
}): ApplyDocIndexResult;
|
|
101
|
+
export interface RemoveDocIndexResult {
|
|
102
|
+
removed: boolean;
|
|
103
|
+
removedProviders: string[];
|
|
104
|
+
docIndexFile: string;
|
|
105
|
+
docIndexDeleted: boolean;
|
|
106
|
+
agentFile: string;
|
|
107
|
+
agentSizeBefore: number;
|
|
108
|
+
agentSizeAfter: number;
|
|
109
|
+
docIndexSizeBefore: number;
|
|
110
|
+
docIndexSizeAfter: number;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Remove one (or all) documentation indices from DOCINDEX.md and refresh the
|
|
114
|
+
* summary section in the agent file. If no indices remain, DOCINDEX.md is
|
|
115
|
+
* deleted and the summary section is removed from the agent file.
|
|
116
|
+
*/
|
|
117
|
+
export declare function removeDocIndexEntry(options: {
|
|
118
|
+
cwd: string;
|
|
119
|
+
agentFile: string;
|
|
120
|
+
providerName?: string;
|
|
121
|
+
docIndexFile?: string;
|
|
122
|
+
}): RemoveDocIndexResult;
|
|
48
123
|
/**
|
|
49
124
|
* Ensure .gitignore has entry for docs directory
|
|
50
125
|
*/
|
|
@@ -61,5 +136,5 @@ export declare function getLocalCacheDir(cwd: string): string;
|
|
|
61
136
|
* High-level function to embed documentation into an agent instruction file.
|
|
62
137
|
*/
|
|
63
138
|
export declare function embed(options: EmbedOptions): Promise<EmbedResult>;
|
|
64
|
-
export type { DocProvider, DocFile, DocSection, PullResult, GitignoreStatus, IndexOptions, EmbedOptions, EmbedResult, } from './types';
|
|
139
|
+
export type { DocProvider, DocFile, DocSection, DocIndexEntry, PullResult, GitignoreStatus, IndexOptions, EmbedOptions, EmbedResult, } from './types';
|
|
65
140
|
//# sourceMappingURL=agents-md.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents-md.d.ts","sourceRoot":"","sources":["../../src/lib/agents-md.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,WAAW,EACX,OAAO,EACP,UAAU,EACV,UAAU,EACV,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,WAAW,EACZ,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"agents-md.d.ts","sourceRoot":"","sources":["../../src/lib/agents-md.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,WAAW,EACX,OAAO,EACP,UAAU,EACV,aAAa,EACb,UAAU,EACV,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,WAAW,EACZ,MAAM,SAAS,CAAA;AAOhB,+EAA+E;AAC/E,eAAO,MAAM,sBAAsB,gBAAgB,CAAA;AAkBnD;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GAChI,OAAO,CAAC,UAAU,CAAC,CA0DrB;AAiDD;;GAEG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAC9D,OAAO,EAAE,CA4CX;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,CA8E3D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAkC3D;AAkCD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EA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} from './lockfile';
|
|
2
|
+
/**
|
|
3
|
+
* Read the docs marker names present in DOCINDEX.md. Under progressive
|
|
4
|
+
* disclosure the full per-provider index blocks live here rather than inline
|
|
5
|
+
* in the agent instruction file.
|
|
6
|
+
*/
|
|
7
|
+
export declare function readDocIndexMarkers(cwd: string): Set<string>;
|
|
2
8
|
export type IndexHealth = 'ok' | 'missing-target' | 'missing-marker' | 'missing-cache' | 'stale-lockfile-entry' | 'untracked-marker' | 'needs-migration';
|
|
3
9
|
export interface EmbeddedMarker {
|
|
4
10
|
kind: 'docs' | 'skills';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-maintenance.d.ts","sourceRoot":"","sources":["../../src/lib/index-maintenance.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"index-maintenance.d.ts","sourceRoot":"","sources":["../../src/lib/index-maintenance.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,YAAY,CAAA;AAWnB;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAY5D;AAED,MAAM,MAAM,WAAW,GACnB,IAAI,GACJ,gBAAgB,GAChB,gBAAgB,GAChB,eAAe,GACf,sBAAsB,GACtB,kBAAkB,GAClB,iBAAiB,CAAA;AAErB,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAA;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAA;IACvB,MAAM,EAAE,WAAW,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;IACjC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,CAAC,EAAE,cAAc,CAAA;CAC/B;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,OAAO,EAAE,WAAW,EAAE,CAAA;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAU7D;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,cAAc,EAAE,CAiBrF;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,YAAY,CAuEvE"}
|
package/dist/lib/lockfile.d.ts
CHANGED
|
@@ -33,4 +33,13 @@ export declare function resolveStoredPath(cwd: string, storedPath: string): stri
|
|
|
33
33
|
export declare function readIndexLockfile(cwd: string): IndexLockfile;
|
|
34
34
|
export declare function writeIndexLockfile(cwd: string, lockfile: IndexLockfile): void;
|
|
35
35
|
export declare function upsertIndexLockEntry(cwd: string, entry: Omit<IndexLockEntry, 'updatedAt'>): IndexLockEntry;
|
|
36
|
+
/**
|
|
37
|
+
* Remove lockfile entries matching the given criteria. Returns the ids removed.
|
|
38
|
+
* Omitting a field treats it as a wildcard for that field.
|
|
39
|
+
*/
|
|
40
|
+
export declare function removeIndexLockEntries(cwd: string, criteria: {
|
|
41
|
+
kind?: 'docs' | 'skills';
|
|
42
|
+
marker?: string;
|
|
43
|
+
targetFile?: string;
|
|
44
|
+
}): string[];
|
|
36
45
|
//# sourceMappingURL=lockfile.d.ts.map
|