agdex 0.1.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.
Files changed (46) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +190 -0
  3. package/dist/cli/index.d.ts +3 -0
  4. package/dist/cli/index.d.ts.map +1 -0
  5. package/dist/cli/index.js +7289 -0
  6. package/dist/index-6dj5che8.js +859 -0
  7. package/dist/index-6e18afd7.js +1229 -0
  8. package/dist/index-7adbtddf.js +1123 -0
  9. package/dist/index-db6kreh4.js +1188 -0
  10. package/dist/index-exr11by8.js +708 -0
  11. package/dist/index-fxmpwsct.js +779 -0
  12. package/dist/index-gtzz9131.js +708 -0
  13. package/dist/index-hr5jh9yq.js +712 -0
  14. package/dist/index-k299aha0.js +1229 -0
  15. package/dist/index-ntpyfcve.js +1154 -0
  16. package/dist/index-pry8ssn1.js +636 -0
  17. package/dist/index-wgnqr8g3.js +882 -0
  18. package/dist/index-y6zqcrbh.js +788 -0
  19. package/dist/index.d.ts +43 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +70 -0
  22. package/dist/lib/agents-md.d.ts +55 -0
  23. package/dist/lib/agents-md.d.ts.map +1 -0
  24. package/dist/lib/providers/bun.d.ts +3 -0
  25. package/dist/lib/providers/bun.d.ts.map +1 -0
  26. package/dist/lib/providers/conda-forge.d.ts +3 -0
  27. package/dist/lib/providers/conda-forge.d.ts.map +1 -0
  28. package/dist/lib/providers/generic.d.ts +37 -0
  29. package/dist/lib/providers/generic.d.ts.map +1 -0
  30. package/dist/lib/providers/index.d.ts +26 -0
  31. package/dist/lib/providers/index.d.ts.map +1 -0
  32. package/dist/lib/providers/nextjs.d.ts +3 -0
  33. package/dist/lib/providers/nextjs.d.ts.map +1 -0
  34. package/dist/lib/providers/pixi.d.ts +3 -0
  35. package/dist/lib/providers/pixi.d.ts.map +1 -0
  36. package/dist/lib/providers/rattler-build.d.ts +3 -0
  37. package/dist/lib/providers/rattler-build.d.ts.map +1 -0
  38. package/dist/lib/providers/react.d.ts +3 -0
  39. package/dist/lib/providers/react.d.ts.map +1 -0
  40. package/dist/lib/providers/tauri.d.ts +3 -0
  41. package/dist/lib/providers/tauri.d.ts.map +1 -0
  42. package/dist/lib/skills.d.ts +53 -0
  43. package/dist/lib/skills.d.ts.map +1 -0
  44. package/dist/lib/types.d.ts +126 -0
  45. package/dist/lib/types.d.ts.map +1 -0
  46. package/package.json +54 -0
@@ -0,0 +1,43 @@
1
+ /**
2
+ * agdex - Embed compressed documentation indexes into AGENTS.md/CLAUDE.md
3
+ *
4
+ * This package helps AI coding agents (Claude, Cursor, etc.) work with
5
+ * version-matched framework documentation by embedding a compressed
6
+ * docs index directly into your project's AGENTS.md or CLAUDE.md file.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * import { embed, nextjsProvider } from 'agdex'
11
+ *
12
+ * // Embed Next.js docs
13
+ * const result = await embed({
14
+ * cwd: process.cwd(),
15
+ * provider: nextjsProvider,
16
+ * output: 'AGENTS.md'
17
+ * })
18
+ *
19
+ * // Or create a custom provider
20
+ * import { createProvider, embed } from 'agdex'
21
+ *
22
+ * const myProvider = createProvider({
23
+ * name: 'my-framework',
24
+ * displayName: 'My Framework',
25
+ * repo: 'myorg/myframework',
26
+ * docsPath: 'docs',
27
+ * packageName: 'my-framework'
28
+ * })
29
+ *
30
+ * await embed({
31
+ * cwd: process.cwd(),
32
+ * provider: myProvider,
33
+ * version: '1.0.0',
34
+ * output: 'CLAUDE.md'
35
+ * })
36
+ * ```
37
+ */
38
+ export { embed, pullDocs, collectDocFiles, buildDocTree, generateIndex, injectIndex, hasExistingIndex, removeDocsIndex, ensureGitignoreEntry, getGlobalCacheDir, getLocalCacheDir, } from './lib/agents-md';
39
+ export { nextjsProvider, reactProvider, pixiProvider, rattlerBuildProvider, tauriProvider, condaForgeProvider, bunProvider, createProvider, createLocalProvider, getProvider, listProviders, isProviderAvailable, } from './lib/providers';
40
+ export { embedSkills, collectAllSkills, parseSkillFrontmatter, discoverPluginSkills, discoverFlatSkills, generateSkillsIndex, injectSkillsIndex, hasExistingSkillsIndex, removeSkillsIndex, getDefaultSkillSources, } from './lib/skills';
41
+ export type { DocProvider, DocFile, DocSection, VersionResult, PullResult, GitignoreStatus, IndexOptions, EmbedOptions, EmbedResult, ProviderPreset, SkillFrontmatter, SkillEntry, SkillSource, SkillSourceConfig, SkillsEmbedOptions, SkillsEmbedResult, } from './lib/types';
42
+ export type { GenericProviderOptions } from './lib/providers/generic';
43
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,iBAAiB,CAAA;AAGxB,OAAO,EACL,cAAc,EACd,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,mBAAmB,GACpB,MAAM,iBAAiB,CAAA;AAGxB,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,cAAc,CAAA;AAGrB,YAAY,EACV,WAAW,EACX,OAAO,EACP,UAAU,EACV,aAAa,EACb,UAAU,EACV,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,cAAc,EACd,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 ADDED
@@ -0,0 +1,70 @@
1
+ import {
2
+ buildDocTree,
3
+ bunProvider,
4
+ collectAllSkills,
5
+ collectDocFiles,
6
+ condaForgeProvider,
7
+ createLocalProvider,
8
+ createProvider,
9
+ discoverFlatSkills,
10
+ discoverPluginSkills,
11
+ embed,
12
+ embedSkills,
13
+ ensureGitignoreEntry,
14
+ generateIndex,
15
+ generateSkillsIndex,
16
+ getDefaultSkillSources,
17
+ getGlobalCacheDir,
18
+ getLocalCacheDir,
19
+ getProvider,
20
+ hasExistingIndex,
21
+ hasExistingSkillsIndex,
22
+ injectIndex,
23
+ injectSkillsIndex,
24
+ isProviderAvailable,
25
+ listProviders,
26
+ nextjsProvider,
27
+ parseSkillFrontmatter,
28
+ pixiProvider,
29
+ pullDocs,
30
+ rattlerBuildProvider,
31
+ reactProvider,
32
+ removeDocsIndex,
33
+ removeSkillsIndex,
34
+ tauriProvider
35
+ } from "./index-k299aha0.js";
36
+ export {
37
+ tauriProvider,
38
+ removeSkillsIndex,
39
+ removeDocsIndex,
40
+ reactProvider,
41
+ rattlerBuildProvider,
42
+ pullDocs,
43
+ pixiProvider,
44
+ parseSkillFrontmatter,
45
+ nextjsProvider,
46
+ listProviders,
47
+ isProviderAvailable,
48
+ injectSkillsIndex,
49
+ injectIndex,
50
+ hasExistingSkillsIndex,
51
+ hasExistingIndex,
52
+ getProvider,
53
+ getLocalCacheDir,
54
+ getGlobalCacheDir,
55
+ getDefaultSkillSources,
56
+ generateSkillsIndex,
57
+ generateIndex,
58
+ ensureGitignoreEntry,
59
+ embedSkills,
60
+ embed,
61
+ discoverPluginSkills,
62
+ discoverFlatSkills,
63
+ createProvider,
64
+ createLocalProvider,
65
+ condaForgeProvider,
66
+ collectDocFiles,
67
+ collectAllSkills,
68
+ bunProvider,
69
+ buildDocTree
70
+ };
@@ -0,0 +1,55 @@
1
+ import type { DocProvider, DocFile, DocSection, PullResult, GitignoreStatus, IndexOptions, EmbedOptions, EmbedResult } from './types';
2
+ /**
3
+ * Pull documentation from a GitHub repository
4
+ */
5
+ export declare function pullDocs(provider: DocProvider, options: {
6
+ cwd: string;
7
+ version?: string;
8
+ docsDir?: string;
9
+ }): Promise<PullResult>;
10
+ /**
11
+ * Collect all documentation files from a directory
12
+ */
13
+ export declare function collectDocFiles(dir: string, options?: {
14
+ extensions?: string[];
15
+ excludePatterns?: string[];
16
+ }): DocFile[];
17
+ /**
18
+ * Build a tree structure from documentation files
19
+ */
20
+ export declare function buildDocTree(files: DocFile[]): DocSection[];
21
+ /**
22
+ * Generate a compressed index for AGENTS.md/CLAUDE.md
23
+ */
24
+ export declare function generateIndex(options: IndexOptions): string;
25
+ /**
26
+ * Check if content has an existing embedded index
27
+ */
28
+ export declare function hasExistingIndex(content: string): boolean;
29
+ /**
30
+ * Remove the docs index from content
31
+ * Returns the content with the index removed, or unchanged if no index exists
32
+ */
33
+ export declare function removeDocsIndex(content: string): string;
34
+ /**
35
+ * Inject index into AGENTS.md/CLAUDE.md content
36
+ */
37
+ export declare function injectIndex(existingContent: string, indexContent: string): string;
38
+ /**
39
+ * Ensure .gitignore has entry for docs directory
40
+ */
41
+ export declare function ensureGitignoreEntry(cwd: string, docsDir: string): GitignoreStatus;
42
+ /**
43
+ * Get the global cache directory path
44
+ */
45
+ export declare function getGlobalCacheDir(): string;
46
+ /**
47
+ * Get the local cache directory path
48
+ */
49
+ export declare function getLocalCacheDir(cwd: string): string;
50
+ /**
51
+ * High-level function to embed documentation into AGENTS.md/CLAUDE.md
52
+ */
53
+ export declare function embed(options: EmbedOptions): Promise<EmbedResult>;
54
+ export type { DocProvider, DocFile, DocSection, PullResult, GitignoreStatus, IndexOptions, EmbedOptions, EmbedResult, } from './types';
55
+ //# sourceMappingURL=agents-md.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents-md.d.ts","sourceRoot":"","sources":["../../src/lib/agents-md.ts"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EG;AACH,wBAAsB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CA2GvE;AAGD,YAAY,EACV,WAAW,EACX,OAAO,EACP,UAAU,EACV,UAAU,EACV,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,MAAM,SAAS,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { DocProvider } from '../types';
2
+ export declare const bunProvider: DocProvider;
3
+ //# sourceMappingURL=bun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bun.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/bun.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,UAAU,CAAA;AAmC1D,eAAO,MAAM,WAAW,EAAE,WAUzB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { DocProvider } from '../types';
2
+ export declare const condaForgeProvider: DocProvider;
3
+ //# sourceMappingURL=conda-forge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conda-forge.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/conda-forge.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,UAAU,CAAA;AAQ1D,eAAO,MAAM,kBAAkB,EAAE,WAiBhC,CAAA"}
@@ -0,0 +1,37 @@
1
+ import type { DocProvider } from '../types';
2
+ export interface GenericProviderOptions {
3
+ /** Unique identifier for this provider */
4
+ name: string;
5
+ /** Display name for CLI output */
6
+ displayName: string;
7
+ /** GitHub repository in format 'owner/repo' */
8
+ repo: string;
9
+ /** Path to docs folder within the repository */
10
+ docsPath: string;
11
+ /** File extensions to include (default: ['.mdx', '.md']) */
12
+ extensions?: string[];
13
+ /** Package name to detect version from (if applicable) */
14
+ packageName?: string;
15
+ /** Function to convert version to git tag */
16
+ versionToTag?: (version: string) => string;
17
+ /** Files to exclude from index (glob patterns) */
18
+ excludePatterns?: string[];
19
+ /** Custom instruction to include in the index */
20
+ instruction?: string;
21
+ }
22
+ /**
23
+ * Create a generic documentation provider from options
24
+ */
25
+ export declare function createProvider(options: GenericProviderOptions): DocProvider;
26
+ /**
27
+ * Create a provider from a local documentation directory (no GitHub)
28
+ */
29
+ export declare function createLocalProvider(options: {
30
+ name: string;
31
+ displayName: string;
32
+ localPath: string;
33
+ extensions?: string[];
34
+ excludePatterns?: string[];
35
+ instruction?: string;
36
+ }): DocProvider;
37
+ //# sourceMappingURL=generic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generic.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/generic.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,UAAU,CAAA;AAE1D,MAAM,WAAW,sBAAsB;IACrC,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAA;IAEZ,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAA;IAEnB,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAA;IAEZ,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAA;IAEhB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IAErB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,6CAA6C;IAC7C,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAA;IAE1C,kDAAkD;IAClD,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAE1B,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,sBAAsB,GAAG,WAAW,CA6D3E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE;IAC3C,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,GAAG,WAAW,CAYd"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Documentation providers
3
+ */
4
+ export { nextjsProvider } from './nextjs';
5
+ export { reactProvider } from './react';
6
+ export { pixiProvider } from './pixi';
7
+ export { rattlerBuildProvider } from './rattler-build';
8
+ export { tauriProvider } from './tauri';
9
+ export { condaForgeProvider } from './conda-forge';
10
+ export { bunProvider } from './bun';
11
+ export { createProvider, createLocalProvider } from './generic';
12
+ export type { GenericProviderOptions } from './generic';
13
+ import type { DocProvider, ProviderPreset } from '../types';
14
+ /**
15
+ * Get a built-in provider by name
16
+ */
17
+ export declare function getProvider(preset: ProviderPreset): DocProvider | null;
18
+ /**
19
+ * List all available provider presets
20
+ */
21
+ export declare function listProviders(): ProviderPreset[];
22
+ /**
23
+ * Check if a provider preset is available
24
+ */
25
+ export declare function isProviderAvailable(preset: ProviderPreset): boolean;
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAC/D,YAAY,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AASvD,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE3D;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,WAAW,GAAG,IAAI,CAyBtE;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,cAAc,EAAE,CAEhD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAEnE"}
@@ -0,0 +1,3 @@
1
+ import type { DocProvider } from '../types';
2
+ export declare const nextjsProvider: DocProvider;
3
+ //# sourceMappingURL=nextjs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nextjs.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/nextjs.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,UAAU,CAAA;AAqM1D,eAAO,MAAM,cAAc,EAAE,WAU5B,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { DocProvider } from '../types';
2
+ export declare const pixiProvider: DocProvider;
3
+ //# sourceMappingURL=pixi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pixi.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/pixi.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,UAAU,CAAA;AAoE1D,eAAO,MAAM,YAAY,EAAE,WAmB1B,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { DocProvider } from '../types';
2
+ export declare const rattlerBuildProvider: DocProvider;
3
+ //# sourceMappingURL=rattler-build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rattler-build.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/rattler-build.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,UAAU,CAAA;AA2D1D,eAAO,MAAM,oBAAoB,EAAE,WAkBlC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { DocProvider } from '../types';
2
+ export declare const reactProvider: DocProvider;
3
+ //# sourceMappingURL=react.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/react.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,UAAU,CAAA;AAmC1D,eAAO,MAAM,aAAa,EAAE,WAU3B,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { DocProvider } from '../types';
2
+ export declare const tauriProvider: DocProvider;
3
+ //# sourceMappingURL=tauri.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tauri.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/tauri.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,UAAU,CAAA;AA0D1D,eAAO,MAAM,aAAa,EAAE,WA2B3B,CAAA"}
@@ -0,0 +1,53 @@
1
+ import type { SkillFrontmatter, SkillEntry, SkillSource, SkillSourceConfig, SkillsEmbedOptions, SkillsEmbedResult } from './types';
2
+ /**
3
+ * Parse YAML frontmatter from a SKILL.md file
4
+ */
5
+ export declare function parseSkillFrontmatter(content: string): SkillFrontmatter | null;
6
+ /**
7
+ * Discover skills from a plugin repository structure.
8
+ * Expected structure: {pluginsPath}/plugins/{pluginName}/skills/{skillName}/SKILL.md
9
+ */
10
+ export declare function discoverPluginSkills(pluginsPath: string, label: string): SkillEntry[];
11
+ /**
12
+ * Discover skills from a flat directory structure.
13
+ * Expected structure: {skillsPath}/{skillName}/SKILL.md
14
+ */
15
+ export declare function discoverFlatSkills(skillsPath: string, source: SkillSource, label: string): SkillEntry[];
16
+ /**
17
+ * Collect all skills from multiple sources
18
+ */
19
+ export declare function collectAllSkills(sources: SkillSourceConfig[]): SkillEntry[];
20
+ /**
21
+ * Generate a compressed skills index in pipe-delimited format
22
+ * Format: [Skills Index]|plugin:pluginName:{skill1:desc[file1,file2];skill2:desc}|user:{...}|project:{...}|Regen: cmd
23
+ */
24
+ export declare function generateSkillsIndex(skills: SkillEntry[], options?: {
25
+ regenerateCommand?: string;
26
+ }): string;
27
+ /**
28
+ * Check if content has an existing skills index
29
+ */
30
+ export declare function hasExistingSkillsIndex(content: string): boolean;
31
+ /**
32
+ * Remove the skills index from content
33
+ * Returns the content with the index removed, or unchanged if no index exists
34
+ */
35
+ export declare function removeSkillsIndex(content: string): string;
36
+ /**
37
+ * Inject skills index into content
38
+ */
39
+ export declare function injectSkillsIndex(existingContent: string, indexContent: string): string;
40
+ /**
41
+ * Get default skill source configurations
42
+ */
43
+ export declare function getDefaultSkillSources(cwd: string, options?: {
44
+ includeUser?: boolean;
45
+ includeProject?: boolean;
46
+ pluginPaths?: string[];
47
+ }): SkillSourceConfig[];
48
+ /**
49
+ * High-level function to embed skills index into AGENTS.md
50
+ */
51
+ export declare function embedSkills(options: SkillsEmbedOptions): Promise<SkillsEmbedResult>;
52
+ export type { SkillFrontmatter, SkillEntry, SkillSource, SkillSourceConfig, SkillsEmbedOptions, SkillsEmbedResult, } from './types';
53
+ //# sourceMappingURL=skills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/lib/skills.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,SAAS,CAAA;AAKhB;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAwB9E;AAmBD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,EAAE,CA4CrF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,MAAM,GACZ,UAAU,EAAE,CAgCd;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG,UAAU,EAAE,CAY3E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,UAAU,EAAE,EACpB,OAAO,GAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3C,MAAM,CA2CR;AAsBD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAqBzD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,eAAe,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAgBvF;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE;IAC3D,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CAClB,GAAG,iBAAiB,EAAE,CAsC3B;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAuDzF;AAGD,YAAY,EACV,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,SAAS,CAAA"}
@@ -0,0 +1,126 @@
1
+ /**
2
+ * Core types for agdex
3
+ */
4
+ export interface DocFile {
5
+ relativePath: string;
6
+ }
7
+ export interface DocSection {
8
+ name: string;
9
+ files: DocFile[];
10
+ subsections: DocSection[];
11
+ }
12
+ export interface VersionResult {
13
+ version: string | null;
14
+ error?: string;
15
+ }
16
+ export interface PullResult {
17
+ success: boolean;
18
+ docsPath?: string;
19
+ version?: string;
20
+ error?: string;
21
+ }
22
+ export interface GitignoreStatus {
23
+ path: string;
24
+ updated: boolean;
25
+ alreadyPresent: boolean;
26
+ }
27
+ /**
28
+ * Configuration for a documentation provider
29
+ */
30
+ export interface DocProvider {
31
+ /** Unique identifier for this provider (e.g., 'nextjs', 'react', 'vue') */
32
+ name: string;
33
+ /** Display name for CLI output */
34
+ displayName: string;
35
+ /** GitHub repository in format 'owner/repo' */
36
+ repo: string;
37
+ /** Path to docs folder within the repository */
38
+ docsPath: string;
39
+ /** File extensions to include (default: ['.mdx', '.md']) */
40
+ extensions?: string[];
41
+ /** Function to detect version from a project directory */
42
+ detectVersion?: (cwd: string) => VersionResult;
43
+ /** Function to convert version to git tag (default: v prefix) */
44
+ versionToTag?: (version: string) => string;
45
+ /** Files to exclude from index (glob patterns) */
46
+ excludePatterns?: string[];
47
+ /** Custom instruction to include in the index */
48
+ instruction?: string;
49
+ }
50
+ /**
51
+ * Built-in provider presets
52
+ */
53
+ export type ProviderPreset = 'nextjs' | 'react' | 'pixi' | 'rattler-build' | 'tauri' | 'conda-forge' | 'bun' | 'vue' | 'svelte' | 'astro';
54
+ export interface IndexOptions {
55
+ /** Path where docs are stored */
56
+ docsPath: string;
57
+ /** Sections of documentation */
58
+ sections: DocSection[];
59
+ /** Target output file name */
60
+ outputFile?: string;
61
+ /** Provider name for the instruction */
62
+ providerName?: string;
63
+ /** Custom instruction to include */
64
+ instruction?: string;
65
+ /** Command to regenerate the docs */
66
+ regenerateCommand?: string;
67
+ }
68
+ export interface EmbedOptions {
69
+ /** Working directory */
70
+ cwd: string;
71
+ /** Documentation provider configuration */
72
+ provider: DocProvider;
73
+ /** Override version detection */
74
+ version?: string;
75
+ /** Target file (CLAUDE.md, AGENTS.md, etc.) */
76
+ output?: string;
77
+ /** Directory name for downloaded docs */
78
+ docsDir?: string;
79
+ /** Use global cache directory (~/.cache/agdex/) instead of local */
80
+ globalCache?: boolean;
81
+ }
82
+ export interface EmbedResult {
83
+ success: boolean;
84
+ targetFile?: string;
85
+ docsPath?: string;
86
+ version?: string;
87
+ sizeBefore?: number;
88
+ sizeAfter?: number;
89
+ isNewFile?: boolean;
90
+ gitignoreUpdated?: boolean;
91
+ error?: string;
92
+ }
93
+ export interface SkillFrontmatter {
94
+ name: string;
95
+ description: string;
96
+ }
97
+ export interface SkillEntry {
98
+ name: string;
99
+ description: string;
100
+ skillMdPath: string;
101
+ siblingFiles: string[];
102
+ source: SkillSource;
103
+ pluginName?: string;
104
+ }
105
+ export type SkillSource = 'plugin' | 'user' | 'project';
106
+ export interface SkillSourceConfig {
107
+ type: SkillSource;
108
+ path: string;
109
+ label: string;
110
+ }
111
+ export interface SkillsEmbedOptions {
112
+ cwd: string;
113
+ sources: SkillSourceConfig[];
114
+ output?: string;
115
+ }
116
+ export interface SkillsEmbedResult {
117
+ success: boolean;
118
+ targetFile?: string;
119
+ skillCount?: number;
120
+ sizeBefore?: number;
121
+ sizeAfter?: number;
122
+ isNewFile?: boolean;
123
+ error?: string;
124
+ sourceBreakdown?: Record<SkillSource, number>;
125
+ }
126
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,OAAO;IACtB,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,OAAO,EAAE,CAAA;IAChB,WAAW,EAAE,UAAU,EAAE,CAAA;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;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;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,eAAe,CAAC,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;CAC9C"}
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "agdex",
3
+ "version": "0.1.0",
4
+ "description": "Embed compressed documentation indexes into AGENTS.md/CLAUDE.md for AI coding agents",
5
+ "module": "dist/index.js",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "type": "module",
9
+ "bin": {
10
+ "agdex": "./dist/cli/index.js"
11
+ },
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/index.js",
15
+ "types": "./dist/index.d.ts"
16
+ }
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "scripts": {
22
+ "build": "bun build ./src/index.ts ./src/cli/index.ts --outdir ./dist --target node --splitting && bun run build:types",
23
+ "build:types": "tsc --emitDeclarationOnly --declaration --outDir dist",
24
+ "dev": "bun run --watch src/cli/index.ts",
25
+ "test": "bun test",
26
+ "prepublishOnly": "bun run build"
27
+ },
28
+ "dependencies": {
29
+ "commander": "^12.1.0",
30
+ "picocolors": "^1.1.1",
31
+ "prompts": "^2.4.2"
32
+ },
33
+ "devDependencies": {
34
+ "@types/bun": "latest",
35
+ "@types/prompts": "^2.4.9"
36
+ },
37
+ "peerDependencies": {
38
+ "typescript": "^5"
39
+ },
40
+ "keywords": [
41
+ "agents",
42
+ "claude",
43
+ "cursor",
44
+ "ai",
45
+ "documentation",
46
+ "coding-agents",
47
+ "agdex"
48
+ ],
49
+ "license": "MIT",
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "https://github.com/yourusername/agdex"
53
+ }
54
+ }