@smeltjs/core 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 (199) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +55 -0
  3. package/THIRD-PARTY.md +140 -0
  4. package/dist/apply.d.ts +145 -0
  5. package/dist/apply.d.ts.map +1 -0
  6. package/dist/apply.js +244 -0
  7. package/dist/apply.js.map +1 -0
  8. package/dist/cache/prefix.d.ts +164 -0
  9. package/dist/cache/prefix.d.ts.map +1 -0
  10. package/dist/cache/prefix.js +361 -0
  11. package/dist/cache/prefix.js.map +1 -0
  12. package/dist/cli/args.d.ts +71 -0
  13. package/dist/cli/args.d.ts.map +1 -0
  14. package/dist/cli/args.js +308 -0
  15. package/dist/cli/args.js.map +1 -0
  16. package/dist/cli/bin.d.ts +3 -0
  17. package/dist/cli/bin.d.ts.map +1 -0
  18. package/dist/cli/bin.js +161 -0
  19. package/dist/cli/bin.js.map +1 -0
  20. package/dist/cli/config.d.ts +73 -0
  21. package/dist/cli/config.d.ts.map +1 -0
  22. package/dist/cli/config.js +144 -0
  23. package/dist/cli/config.js.map +1 -0
  24. package/dist/cli/init.d.ts +56 -0
  25. package/dist/cli/init.d.ts.map +1 -0
  26. package/dist/cli/init.js +449 -0
  27. package/dist/cli/init.js.map +1 -0
  28. package/dist/cli/report.d.ts +44 -0
  29. package/dist/cli/report.d.ts.map +1 -0
  30. package/dist/cli/report.js +113 -0
  31. package/dist/cli/report.js.map +1 -0
  32. package/dist/cli/resolve.d.ts +103 -0
  33. package/dist/cli/resolve.d.ts.map +1 -0
  34. package/dist/cli/resolve.js +106 -0
  35. package/dist/cli/resolve.js.map +1 -0
  36. package/dist/cli/run.d.ts +99 -0
  37. package/dist/cli/run.d.ts.map +1 -0
  38. package/dist/cli/run.js +351 -0
  39. package/dist/cli/run.js.map +1 -0
  40. package/dist/detect.d.ts +16 -0
  41. package/dist/detect.d.ts.map +1 -0
  42. package/dist/detect.js +18 -0
  43. package/dist/detect.js.map +1 -0
  44. package/dist/errors.d.ts +88 -0
  45. package/dist/errors.d.ts.map +1 -0
  46. package/dist/errors.js +107 -0
  47. package/dist/errors.js.map +1 -0
  48. package/dist/hash.d.ts +13 -0
  49. package/dist/hash.d.ts.map +1 -0
  50. package/dist/hash.js +16 -0
  51. package/dist/hash.js.map +1 -0
  52. package/dist/index.d.ts +121 -0
  53. package/dist/index.d.ts.map +1 -0
  54. package/dist/index.js +93 -0
  55. package/dist/index.js.map +1 -0
  56. package/dist/lang/bash.d.ts +3 -0
  57. package/dist/lang/bash.d.ts.map +1 -0
  58. package/dist/lang/bash.js +28 -0
  59. package/dist/lang/bash.js.map +1 -0
  60. package/dist/lang/c.d.ts +3 -0
  61. package/dist/lang/c.d.ts.map +1 -0
  62. package/dist/lang/c.js +39 -0
  63. package/dist/lang/c.js.map +1 -0
  64. package/dist/lang/c_sharp.d.ts +3 -0
  65. package/dist/lang/c_sharp.d.ts.map +1 -0
  66. package/dist/lang/c_sharp.js +37 -0
  67. package/dist/lang/c_sharp.js.map +1 -0
  68. package/dist/lang/cpp.d.ts +3 -0
  69. package/dist/lang/cpp.d.ts.map +1 -0
  70. package/dist/lang/cpp.js +46 -0
  71. package/dist/lang/cpp.js.map +1 -0
  72. package/dist/lang/go.d.ts +3 -0
  73. package/dist/lang/go.d.ts.map +1 -0
  74. package/dist/lang/go.js +31 -0
  75. package/dist/lang/go.js.map +1 -0
  76. package/dist/lang/java.d.ts +3 -0
  77. package/dist/lang/java.d.ts.map +1 -0
  78. package/dist/lang/java.js +34 -0
  79. package/dist/lang/java.js.map +1 -0
  80. package/dist/lang/javascript.d.ts +3 -0
  81. package/dist/lang/javascript.d.ts.map +1 -0
  82. package/dist/lang/javascript.js +28 -0
  83. package/dist/lang/javascript.js.map +1 -0
  84. package/dist/lang/kotlin.d.ts +3 -0
  85. package/dist/lang/kotlin.d.ts.map +1 -0
  86. package/dist/lang/kotlin.js +37 -0
  87. package/dist/lang/kotlin.js.map +1 -0
  88. package/dist/lang/php.d.ts +3 -0
  89. package/dist/lang/php.d.ts.map +1 -0
  90. package/dist/lang/php.js +37 -0
  91. package/dist/lang/php.js.map +1 -0
  92. package/dist/lang/profile.d.ts +130 -0
  93. package/dist/lang/profile.d.ts.map +1 -0
  94. package/dist/lang/profile.js +2 -0
  95. package/dist/lang/profile.js.map +1 -0
  96. package/dist/lang/python.d.ts +3 -0
  97. package/dist/lang/python.d.ts.map +1 -0
  98. package/dist/lang/python.js +33 -0
  99. package/dist/lang/python.js.map +1 -0
  100. package/dist/lang/registry.d.ts +31 -0
  101. package/dist/lang/registry.d.ts.map +1 -0
  102. package/dist/lang/registry.js +89 -0
  103. package/dist/lang/registry.js.map +1 -0
  104. package/dist/lang/ruby.d.ts +3 -0
  105. package/dist/lang/ruby.d.ts.map +1 -0
  106. package/dist/lang/ruby.js +47 -0
  107. package/dist/lang/ruby.js.map +1 -0
  108. package/dist/lang/rust.d.ts +3 -0
  109. package/dist/lang/rust.d.ts.map +1 -0
  110. package/dist/lang/rust.js +45 -0
  111. package/dist/lang/rust.js.map +1 -0
  112. package/dist/lang/swift.d.ts +3 -0
  113. package/dist/lang/swift.d.ts.map +1 -0
  114. package/dist/lang/swift.js +34 -0
  115. package/dist/lang/swift.js.map +1 -0
  116. package/dist/lang/tsx.d.ts +4 -0
  117. package/dist/lang/tsx.d.ts.map +1 -0
  118. package/dist/lang/tsx.js +11 -0
  119. package/dist/lang/tsx.js.map +1 -0
  120. package/dist/lang/typescript.d.ts +18 -0
  121. package/dist/lang/typescript.d.ts.map +1 -0
  122. package/dist/lang/typescript.js +61 -0
  123. package/dist/lang/typescript.js.map +1 -0
  124. package/dist/net/policy.d.ts +49 -0
  125. package/dist/net/policy.d.ts.map +1 -0
  126. package/dist/net/policy.js +120 -0
  127. package/dist/net/policy.js.map +1 -0
  128. package/dist/plan/grammar.d.ts +38 -0
  129. package/dist/plan/grammar.d.ts.map +1 -0
  130. package/dist/plan/grammar.js +85 -0
  131. package/dist/plan/grammar.js.map +1 -0
  132. package/dist/plan/lexical.d.ts +51 -0
  133. package/dist/plan/lexical.d.ts.map +1 -0
  134. package/dist/plan/lexical.js +167 -0
  135. package/dist/plan/lexical.js.map +1 -0
  136. package/dist/plan/planners.d.ts +35 -0
  137. package/dist/plan/planners.d.ts.map +1 -0
  138. package/dist/plan/planners.js +26 -0
  139. package/dist/plan/planners.js.map +1 -0
  140. package/dist/plan/structural.d.ts +68 -0
  141. package/dist/plan/structural.d.ts.map +1 -0
  142. package/dist/plan/structural.js +458 -0
  143. package/dist/plan/structural.js.map +1 -0
  144. package/dist/repomap/cache.d.ts +53 -0
  145. package/dist/repomap/cache.d.ts.map +1 -0
  146. package/dist/repomap/cache.js +139 -0
  147. package/dist/repomap/cache.js.map +1 -0
  148. package/dist/repomap/map.d.ts +161 -0
  149. package/dist/repomap/map.d.ts.map +1 -0
  150. package/dist/repomap/map.js +302 -0
  151. package/dist/repomap/map.js.map +1 -0
  152. package/dist/repomap/rank.d.ts +52 -0
  153. package/dist/repomap/rank.d.ts.map +1 -0
  154. package/dist/repomap/rank.js +155 -0
  155. package/dist/repomap/rank.js.map +1 -0
  156. package/dist/repomap/tags.d.ts +47 -0
  157. package/dist/repomap/tags.d.ts.map +1 -0
  158. package/dist/repomap/tags.js +101 -0
  159. package/dist/repomap/tags.js.map +1 -0
  160. package/dist/retrieve.d.ts +14 -0
  161. package/dist/retrieve.d.ts.map +1 -0
  162. package/dist/retrieve.js +44 -0
  163. package/dist/retrieve.js.map +1 -0
  164. package/dist/stages.d.ts +22 -0
  165. package/dist/stages.d.ts.map +1 -0
  166. package/dist/stages.js +33 -0
  167. package/dist/stages.js.map +1 -0
  168. package/dist/stats.d.ts +40 -0
  169. package/dist/stats.d.ts.map +1 -0
  170. package/dist/stats.js +37 -0
  171. package/dist/stats.js.map +1 -0
  172. package/dist/store-dir.d.ts +98 -0
  173. package/dist/store-dir.d.ts.map +1 -0
  174. package/dist/store-dir.js +379 -0
  175. package/dist/store-dir.js.map +1 -0
  176. package/dist/store.d.ts +36 -0
  177. package/dist/store.d.ts.map +1 -0
  178. package/dist/store.js +56 -0
  179. package/dist/store.js.map +1 -0
  180. package/dist/types.d.ts +298 -0
  181. package/dist/types.d.ts.map +1 -0
  182. package/dist/types.js +2 -0
  183. package/dist/types.js.map +1 -0
  184. package/grammars/tree-sitter-bash.wasm +0 -0
  185. package/grammars/tree-sitter-c.wasm +0 -0
  186. package/grammars/tree-sitter-c_sharp.wasm +0 -0
  187. package/grammars/tree-sitter-cpp.wasm +0 -0
  188. package/grammars/tree-sitter-go.wasm +0 -0
  189. package/grammars/tree-sitter-java.wasm +0 -0
  190. package/grammars/tree-sitter-javascript.wasm +0 -0
  191. package/grammars/tree-sitter-kotlin.wasm +0 -0
  192. package/grammars/tree-sitter-php.wasm +0 -0
  193. package/grammars/tree-sitter-python.wasm +0 -0
  194. package/grammars/tree-sitter-ruby.wasm +0 -0
  195. package/grammars/tree-sitter-rust.wasm +0 -0
  196. package/grammars/tree-sitter-swift.wasm +0 -0
  197. package/grammars/tree-sitter-tsx.wasm +0 -0
  198. package/grammars/tree-sitter-typescript.wasm +0 -0
  199. package/package.json +68 -0
@@ -0,0 +1,121 @@
1
+ import type { ApplyOptions, MarkerBuilder, MarkerInfo } from './apply.ts';
2
+ import type { LexicalPlannerOptions } from './plan/lexical.ts';
3
+ import type { Strategy } from './plan/planners.ts';
4
+ import type { StructuralPlannerOptions } from './plan/structural.ts';
5
+ import type { DetectedLanguage, ElisionStore, Measure, Planner, RetrieveStats, RetrieveTool, SmeltResult } from './types.ts';
6
+ export type { ApplyOptions, MarkerBuilder, MarkerInfo };
7
+ export { applyPlan, defaultMarker, MARKER_FORMAT_VERSION, markerPricing, reconstruct, } from './apply.ts';
8
+ export { detectLanguage, SUPPORTED_LANGUAGES } from './detect.ts';
9
+ export * from './errors.ts';
10
+ export { contentHash, HASH_LENGTH } from './hash.ts';
11
+ export { ALLOWED_NODE_BUILTINS, ALLOWED_PACKAGES, ALLOWED_URL_SCHEMES, assertLocalResource, FORBIDDEN_GLOBALS, FORBIDDEN_NODE_MODULES, FORBIDDEN_PACKAGES, } from './net/policy.ts';
12
+ export { clearGrammarCache, grammarPath, loadGrammar, WASM_BY_LANGUAGE } from './plan/grammar.ts';
13
+ export { LEXICAL_PLANNER_ID, LexicalPlanner, planLexical } from './plan/lexical.ts';
14
+ export type { LexicalPlannerOptions } from './plan/lexical.ts';
15
+ export { isStrategy, PLANNERS, STRATEGIES } from './plan/planners.ts';
16
+ export type { PlannerFactoryOptions } from './plan/planners.ts';
17
+ export { planStructural, STRUCTURAL_LANGUAGES, STRUCTURAL_PLANNER_ID, StructuralPlanner, } from './plan/structural.ts';
18
+ export type { StructuralLanguage, StructuralPlannerOptions } from './plan/structural.ts';
19
+ export { createRetrieveTool, RETRIEVE_TOOL_NAME } from './retrieve.ts';
20
+ export { unconfiguredDistillStage, unconfiguredRerankStage } from './stages.ts';
21
+ export { MemoryElisionStore } from './store.ts';
22
+ export { DIRECTORY_STORE_FORMAT, DIRECTORY_STORE_VERSION, DirectoryElisionStore, } from './store-dir.ts';
23
+ export type { DirectoryElisionStoreOptions } from './store-dir.ts';
24
+ export * from './types.ts';
25
+ export { CLI_JSON_FORMAT, CLI_NAME, cliUsage, EXIT, formatReport, parseSmeltArgs, runCli, } from './cli/run.ts';
26
+ export type { CliIo, CliJsonEnvelope, SmeltInvocation } from './cli/run.ts';
27
+ export { ANTHROPIC_PROMPT_CACHE_FACTS, CACHE_BREAKER_RULES, detectCacheBreakers, findPrefixDivergence, } from './cache/prefix.ts';
28
+ export type { CacheWarning, PrefixDivergence, PromptStructure, PromptTool, } from './cache/prefix.ts';
29
+ export { MARKER_LINE_COMMENT_LEADERS, markerForLanguage } from './apply.ts';
30
+ export { buildRepoMap, DEFAULT_REPO_IGNORE, REPO_MAP_CACHE_CORRUPT_RULE, REPO_MAP_ID, REPO_MAP_PATH_ONLY_RULE, REPO_MAP_RANKED_RULE, REPO_MAP_UNREFERENCED_RULE, } from './repomap/map.ts';
31
+ export type { RepoMap, RepoMapCacheCounts, RepoMapEntry, RepoMapOptions, RepoMapPathEntry, RepoMapReason, RepoMapWarning, } from './repomap/map.ts';
32
+ export { PAGERANK_DAMPING, PAGERANK_ITERATIONS, rankDefinitions } from './repomap/rank.ts';
33
+ export type { FileTagsEntry, RankedDefinition } from './repomap/rank.ts';
34
+ export { extractTags } from './repomap/tags.ts';
35
+ export type { DefinitionTag, FileTags, ReferenceTag } from './repomap/tags.ts';
36
+ export { TAGS_CACHE_FORMAT, TAGS_CACHE_VERSION, tagsCacheKey } from './repomap/cache.ts';
37
+ export { CONFIG_FILE_NAME, CONFIG_VERSION, findConfigFile, loadNearestConfig, parseConfig, resolveStorePath, } from './cli/config.ts';
38
+ export type { LoadedConfig, SmeltConfig, SmeltConfigStore } from './cli/config.ts';
39
+ export { MEASURE_STUB_FILE, measureStubSource, renderConfig, RERANK_STUB_FILE, rerankStubSource, runInit, } from './cli/init.ts';
40
+ export type { InitIo } from './cli/init.ts';
41
+ export { retrieveStats } from './stats.ts';
42
+ export type { RawRetrieveCounters } from './stats.ts';
43
+ export { LANGUAGE_PROFILES, profileFor, profileForPath, structuralLanguages, } from './lang/registry.ts';
44
+ export type { LanguageProfile, LanguageStructure, RepoMapFacts } from './lang/profile.ts';
45
+ export { resolveRun } from './cli/resolve.ts';
46
+ export type { ResolvedRun } from './cli/resolve.ts';
47
+ export { REPO_MAP_FOCUS_RULE } from './repomap/map.ts';
48
+ export { CLI_MAP_JSON_FORMAT, formatMapReport, resolveMapRun } from './cli/run.ts';
49
+ export type { CliInvocation, CliMapJsonEnvelope, MapInvocation } from './cli/run.ts';
50
+ export type { MapReportInput } from './cli/report.ts';
51
+ export type { ResolvedMapRun } from './cli/resolve.ts';
52
+ /**
53
+ * Which planner a smelter uses, named by string. The names, their factories, and this
54
+ * type all come from the one {@link PLANNERS} registry in `src/plan/planners.ts`, so
55
+ * the CLI's validation and help text cannot drift from what `createSmelter` builds.
56
+ */
57
+ export type { Strategy } from './plan/planners.ts';
58
+ export interface SmelterConfig {
59
+ /** Where elided bytes live. Defaults to a fresh {@link MemoryElisionStore}. */
60
+ readonly store?: ElisionStore;
61
+ /** Used when a `smelt()` call omits `budgetBytes`. No global default is assumed. */
62
+ readonly defaultBudgetBytes?: number;
63
+ /**
64
+ * A constructed planner instance. Wins over `strategy`: the registry is a
65
+ * convenience for the shipped planners, and an instance you built yourself is
66
+ * always more specific than a name.
67
+ */
68
+ readonly planner?: Planner;
69
+ readonly strategy?: Strategy;
70
+ readonly marker?: MarkerBuilder;
71
+ /**
72
+ * Your own counter, so results carry a number in your unit as well as in bytes.
73
+ * The budget stays in bytes — see {@link Measure} and `docs/HANDOFF.md` § "Decision 1".
74
+ */
75
+ readonly measure?: Measure;
76
+ readonly lexical?: LexicalPlannerOptions;
77
+ readonly structural?: StructuralPlannerOptions;
78
+ }
79
+ /** Options for one `smelt()` call. `budgetBytes` may come from the smelter instead. */
80
+ export interface SmeltCallOptions {
81
+ readonly budgetBytes?: number;
82
+ readonly path?: string;
83
+ readonly language?: DetectedLanguage;
84
+ readonly focus?: readonly string[];
85
+ }
86
+ /**
87
+ * One smelter, one store, one set of counters. The store is the reason this is an
88
+ * object rather than a free function: elisions are only reversible for as long as
89
+ * something holds them, so the thing that cuts and the thing that remembers have the
90
+ * same lifetime by construction.
91
+ */
92
+ export interface Smelter {
93
+ /** Shrink one blob of text. Never mutates its input. */
94
+ smelt(text: string, options?: SmeltCallOptions): Promise<SmeltResult>;
95
+ /** The exact original text of a previous result. @throws {UnknownHashError} */
96
+ reconstruct(result: SmeltResult): string;
97
+ /** One elided run, counted as a retrieval. @throws {UnknownHashError} */
98
+ retrieve(hash: string): string;
99
+ /** The tool to expose to your model. See {@link RetrieveTool}. */
100
+ readonly tool: RetrieveTool;
101
+ /** Live counters, including the expansion rate. See {@link RetrieveStats}. */
102
+ stats(): RetrieveStats;
103
+ /** The underlying store, for consumers that persist or inspect it. */
104
+ readonly store: ElisionStore;
105
+ }
106
+ /**
107
+ * Build a smelter.
108
+ *
109
+ * ```ts
110
+ * const smelter = createSmelter();
111
+ * const result = await smelter.smelt(toolOutput, {
112
+ * path: 'src/server.ts',
113
+ * budgetBytes: 4_000,
114
+ * focus: ['handleRequest'],
115
+ * });
116
+ * // result.text goes to the model; smelter.tool lets it ask for the rest back.
117
+ * // smelter.stats().expansionRate tells you whether you cut too much.
118
+ * ```
119
+ */
120
+ export declare function createSmelter(config?: SmelterConfig): Smelter;
121
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAG1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAGrE,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,OAAO,EAEP,OAAO,EACP,aAAa,EACb,YAAY,EACZ,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC;AACxD,OAAO,EACL,SAAS,EACT,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClE,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,GAC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E,gBAAgB,CAAC;IACrC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,wDAAwD;IACxD,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACtE,+EAA+E;IAC/E,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAAC;IACzC,yEAAyE;IACzE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,8EAA8E;IAC9E,KAAK,IAAI,aAAa,CAAC;IACvB,sEAAsE;IACtE,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;CAC9B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,MAAM,GAAE,aAAkB,GAAG,OAAO,CA8CjE"}
package/dist/index.js ADDED
@@ -0,0 +1,93 @@
1
+ import { applyPlan, markerForLanguage, markerPricing, reconstruct } from './apply.js';
2
+ import { detectLanguage } from './detect.js';
3
+ import { SmeltError } from './errors.js';
4
+ import { PLANNERS } from './plan/planners.js';
5
+ import { createRetrieveTool } from './retrieve.js';
6
+ import { MemoryElisionStore } from './store.js';
7
+ export { applyPlan, defaultMarker, MARKER_FORMAT_VERSION, markerPricing, reconstruct, } from './apply.js';
8
+ export { detectLanguage, SUPPORTED_LANGUAGES } from './detect.js';
9
+ export * from './errors.js';
10
+ export { contentHash, HASH_LENGTH } from './hash.js';
11
+ export { ALLOWED_NODE_BUILTINS, ALLOWED_PACKAGES, ALLOWED_URL_SCHEMES, assertLocalResource, FORBIDDEN_GLOBALS, FORBIDDEN_NODE_MODULES, FORBIDDEN_PACKAGES, } from './net/policy.js';
12
+ export { clearGrammarCache, grammarPath, loadGrammar, WASM_BY_LANGUAGE } from './plan/grammar.js';
13
+ export { LEXICAL_PLANNER_ID, LexicalPlanner, planLexical } from './plan/lexical.js';
14
+ export { isStrategy, PLANNERS, STRATEGIES } from './plan/planners.js';
15
+ export { planStructural, STRUCTURAL_LANGUAGES, STRUCTURAL_PLANNER_ID, StructuralPlanner, } from './plan/structural.js';
16
+ export { createRetrieveTool, RETRIEVE_TOOL_NAME } from './retrieve.js';
17
+ export { unconfiguredDistillStage, unconfiguredRerankStage } from './stages.js';
18
+ export { MemoryElisionStore } from './store.js';
19
+ export { DIRECTORY_STORE_FORMAT, DIRECTORY_STORE_VERSION, DirectoryElisionStore, } from './store-dir.js';
20
+ export * from './types.js';
21
+ export { CLI_JSON_FORMAT, CLI_NAME, cliUsage, EXIT, formatReport, parseSmeltArgs, runCli, } from './cli/run.js';
22
+ export { ANTHROPIC_PROMPT_CACHE_FACTS, CACHE_BREAKER_RULES, detectCacheBreakers, findPrefixDivergence, } from './cache/prefix.js';
23
+ export { MARKER_LINE_COMMENT_LEADERS, markerForLanguage } from './apply.js';
24
+ export { buildRepoMap, DEFAULT_REPO_IGNORE, REPO_MAP_CACHE_CORRUPT_RULE, REPO_MAP_ID, REPO_MAP_PATH_ONLY_RULE, REPO_MAP_RANKED_RULE, REPO_MAP_UNREFERENCED_RULE, } from './repomap/map.js';
25
+ export { PAGERANK_DAMPING, PAGERANK_ITERATIONS, rankDefinitions } from './repomap/rank.js';
26
+ export { extractTags } from './repomap/tags.js';
27
+ export { TAGS_CACHE_FORMAT, TAGS_CACHE_VERSION, tagsCacheKey } from './repomap/cache.js';
28
+ export { CONFIG_FILE_NAME, CONFIG_VERSION, findConfigFile, loadNearestConfig, parseConfig, resolveStorePath, } from './cli/config.js';
29
+ export { MEASURE_STUB_FILE, measureStubSource, renderConfig, RERANK_STUB_FILE, rerankStubSource, runInit, } from './cli/init.js';
30
+ export { retrieveStats } from './stats.js';
31
+ export { LANGUAGE_PROFILES, profileFor, profileForPath, structuralLanguages, } from './lang/registry.js';
32
+ export { resolveRun } from './cli/resolve.js';
33
+ export { REPO_MAP_FOCUS_RULE } from './repomap/map.js';
34
+ export { CLI_MAP_JSON_FORMAT, formatMapReport, resolveMapRun } from './cli/run.js';
35
+ /**
36
+ * Build a smelter.
37
+ *
38
+ * ```ts
39
+ * const smelter = createSmelter();
40
+ * const result = await smelter.smelt(toolOutput, {
41
+ * path: 'src/server.ts',
42
+ * budgetBytes: 4_000,
43
+ * focus: ['handleRequest'],
44
+ * });
45
+ * // result.text goes to the model; smelter.tool lets it ask for the rest back.
46
+ * // smelter.stats().expansionRate tells you whether you cut too much.
47
+ * ```
48
+ */
49
+ export function createSmelter(config = {}) {
50
+ const store = config.store ?? new MemoryElisionStore();
51
+ // A constructed instance wins over a strategy name; the registry serves the names.
52
+ const planner = config.planner ?? PLANNERS[config.strategy ?? 'lexical'](config);
53
+ const applyOptions = {
54
+ ...(config.marker === undefined ? {} : { marker: config.marker }),
55
+ ...(config.measure === undefined ? {} : { measure: config.measure }),
56
+ };
57
+ return {
58
+ store,
59
+ tool: createRetrieveTool(store),
60
+ stats: () => store.stats(),
61
+ retrieve: (hash) => store.retrieve(hash),
62
+ reconstruct: (result) => reconstruct(result, store),
63
+ async smelt(text, options = {}) {
64
+ const budgetBytes = options.budgetBytes ?? config.defaultBudgetBytes;
65
+ if (budgetBytes === undefined) {
66
+ throw new SmeltError('smelt: no budget. Pass `budgetBytes` to smelt() or `defaultBudgetBytes` to ' +
67
+ 'createSmelter(). There is no built-in default, because a budget smelt ' +
68
+ 'invented would silently decide how much of your context to throw away.');
69
+ }
70
+ const language = options.language ?? detectLanguage(options.path);
71
+ const input = {
72
+ text,
73
+ language,
74
+ budgetBytes,
75
+ // The MarkerPricing seam, constructed centrally — here, and nowhere else in
76
+ // the shipped pipeline — from the exact builder the applyPlan call below will
77
+ // use: a caller-supplied `config.marker` prices with its own rendering (a
78
+ // longer custom marker makes small cuts unprofitable, and the planner must
79
+ // see that), otherwise the language's leader-wrapped default.
80
+ pricing: markerPricing(language, config.marker),
81
+ ...(options.focus === undefined ? {} : { focus: options.focus }),
82
+ };
83
+ const plan = await planner.plan(input);
84
+ // The marker follows the *result's* language: it lands behind the language's
85
+ // line-comment leader (see MARKER_LINE_COMMENT_LEADERS), because a bare marker
86
+ // line breaks the survivor's syntax in every grammar tested. A caller-supplied
87
+ // marker builder always wins.
88
+ const marker = config.marker ?? markerForLanguage(plan.language);
89
+ return applyPlan(text, plan, store, { ...applyOptions, marker });
90
+ },
91
+ };
92
+ }
93
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEtF,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAahD,OAAO,EACL,SAAS,EACT,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClE,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAClG,OAAO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C;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { LanguageProfile } from './profile.ts';
2
+ export declare const bash: LanguageProfile;
3
+ //# sourceMappingURL=bash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/lang/bash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,IAAI,EAAE,eA0BlB,CAAC"}
@@ -0,0 +1,28 @@
1
+ export const bash = {
2
+ id: 'bash',
3
+ extensions: ['sh', 'bash'],
4
+ wasm: 'tree-sitter-bash.wasm',
5
+ markerLeader: '# ',
6
+ structure: {
7
+ commentTypes: new Set(['comment']),
8
+ attributeTypes: new Set(),
9
+ // The shebang decides which interpreter runs the file. It parses as an ordinary
10
+ // comment node, so it is pinned the way go's build tag is — never collapsed.
11
+ pinnedCommentPattern: /^#!/,
12
+ wrapperTypes: {},
13
+ kindLabels: {
14
+ function_definition: 'function',
15
+ command: 'command',
16
+ variable_assignment: 'variable assignment',
17
+ declaration_command: 'variable assignment',
18
+ comment: 'comment',
19
+ },
20
+ },
21
+ // No def kinds: bash function names are `word` nodes, not identifiers, so they are
22
+ // omitted from the map rather than guessed at.
23
+ repomap: {
24
+ defKinds: {},
25
+ refTypes: ['variable_name'],
26
+ },
27
+ };
28
+ //# sourceMappingURL=bash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bash.js","sourceRoot":"","sources":["../../src/lang/bash.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,IAAI,GAAoB;IACnC,EAAE,EAAE,MAAM;IACV,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,uBAAuB;IAC7B,YAAY,EAAE,IAAI;IAClB,SAAS,EAAE;QACT,YAAY,EAAE,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;QAClC,cAAc,EAAE,IAAI,GAAG,EAAE;QACzB,gFAAgF;QAChF,6EAA6E;QAC7E,oBAAoB,EAAE,KAAK;QAC3B,YAAY,EAAE,EAAE;QAChB,UAAU,EAAE;YACV,mBAAmB,EAAE,UAAU;YAC/B,OAAO,EAAE,SAAS;YAClB,mBAAmB,EAAE,qBAAqB;YAC1C,mBAAmB,EAAE,qBAAqB;YAC1C,OAAO,EAAE,SAAS;SACnB;KACF;IACD,mFAAmF;IACnF,+CAA+C;IAC/C,OAAO,EAAE;QACP,QAAQ,EAAE,EAAE;QACZ,QAAQ,EAAE,CAAC,eAAe,CAAC;KAC5B;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { LanguageProfile } from './profile.ts';
2
+ export declare const c: LanguageProfile;
3
+ //# sourceMappingURL=c.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"c.d.ts","sourceRoot":"","sources":["../../src/lang/c.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,CAAC,EAAE,eAqCf,CAAC"}
package/dist/lang/c.js ADDED
@@ -0,0 +1,39 @@
1
+ export const c = {
2
+ id: 'c',
3
+ extensions: ['c', 'h'],
4
+ wasm: 'tree-sitter-c.wasm',
5
+ markerLeader: '// ',
6
+ structure: {
7
+ commentTypes: new Set(['comment']),
8
+ attributeTypes: new Set(),
9
+ // Every `#pragma` is a preproc_call; only `#pragma once` governs what including
10
+ // the file *means*, so only it is pinned — the `//go:build` law again.
11
+ pinnedPatternsByType: { preproc_call: /^#\s*pragma\s+once\b/ },
12
+ wrapperTypes: {},
13
+ kindLabels: {
14
+ function_definition: 'function',
15
+ declaration: 'declaration',
16
+ struct_specifier: 'struct',
17
+ union_specifier: 'union',
18
+ enum_specifier: 'enum',
19
+ type_definition: 'type definition',
20
+ preproc_include: 'include directive',
21
+ preproc_def: 'macro definition',
22
+ preproc_function_def: 'macro definition',
23
+ // `#pragma`, `#if`/`#ifdef` regions — read off the tree, never "declaration".
24
+ preproc_call: 'preprocessor directive',
25
+ preproc_if: 'preprocessor conditional',
26
+ preproc_ifdef: 'preprocessor conditional',
27
+ preproc_else: 'preprocessor conditional',
28
+ },
29
+ },
30
+ repomap: {
31
+ defKinds: {
32
+ struct_specifier: 'struct',
33
+ union_specifier: 'union',
34
+ enum_specifier: 'enum',
35
+ },
36
+ refTypes: ['identifier', 'type_identifier'],
37
+ },
38
+ };
39
+ //# sourceMappingURL=c.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"c.js","sourceRoot":"","sources":["../../src/lang/c.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,CAAC,GAAoB;IAChC,EAAE,EAAE,GAAG;IACP,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;IACtB,IAAI,EAAE,oBAAoB;IAC1B,YAAY,EAAE,KAAK;IACnB,SAAS,EAAE;QACT,YAAY,EAAE,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;QAClC,cAAc,EAAE,IAAI,GAAG,EAAE;QACzB,gFAAgF;QAChF,uEAAuE;QACvE,oBAAoB,EAAE,EAAE,YAAY,EAAE,sBAAsB,EAAE;QAC9D,YAAY,EAAE,EAAE;QAChB,UAAU,EAAE;YACV,mBAAmB,EAAE,UAAU;YAC/B,WAAW,EAAE,aAAa;YAC1B,gBAAgB,EAAE,QAAQ;YAC1B,eAAe,EAAE,OAAO;YACxB,cAAc,EAAE,MAAM;YACtB,eAAe,EAAE,iBAAiB;YAClC,eAAe,EAAE,mBAAmB;YACpC,WAAW,EAAE,kBAAkB;YAC/B,oBAAoB,EAAE,kBAAkB;YACxC,8EAA8E;YAC9E,YAAY,EAAE,wBAAwB;YACtC,UAAU,EAAE,0BAA0B;YACtC,aAAa,EAAE,0BAA0B;YACzC,YAAY,EAAE,0BAA0B;SACzC;KACF;IACD,OAAO,EAAE;QACP,QAAQ,EAAE;YACR,gBAAgB,EAAE,QAAQ;YAC1B,eAAe,EAAE,OAAO;YACxB,cAAc,EAAE,MAAM;SACvB;QACD,QAAQ,EAAE,CAAC,YAAY,EAAE,iBAAiB,CAAC;KAC5C;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { LanguageProfile } from './profile.ts';
2
+ export declare const c_sharp: LanguageProfile;
3
+ //# sourceMappingURL=c_sharp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"c_sharp.d.ts","sourceRoot":"","sources":["../../src/lang/c_sharp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,OAAO,EAAE,eAmCrB,CAAC"}
@@ -0,0 +1,37 @@
1
+ export const c_sharp = {
2
+ id: 'c_sharp',
3
+ extensions: ['cs'],
4
+ wasm: 'tree-sitter-c_sharp.wasm',
5
+ markerLeader: '// ',
6
+ structure: {
7
+ // `///` doc comments and `//` line comments are both plain comment nodes.
8
+ commentTypes: new Set(['comment']),
9
+ attributeTypes: new Set(),
10
+ wrapperTypes: {},
11
+ kindLabels: {
12
+ class_declaration: 'class',
13
+ interface_declaration: 'interface',
14
+ struct_declaration: 'struct',
15
+ enum_declaration: 'enum',
16
+ record_declaration: 'record',
17
+ delegate_declaration: 'delegate',
18
+ namespace_declaration: 'namespace',
19
+ file_scoped_namespace_declaration: 'namespace',
20
+ using_directive: 'using directive',
21
+ global_statement: 'statement',
22
+ },
23
+ },
24
+ repomap: {
25
+ defKinds: {
26
+ class_declaration: 'class',
27
+ interface_declaration: 'interface',
28
+ struct_declaration: 'struct',
29
+ enum_declaration: 'enum',
30
+ record_declaration: 'record',
31
+ delegate_declaration: 'delegate',
32
+ method_declaration: 'method',
33
+ },
34
+ refTypes: ['identifier'],
35
+ },
36
+ };
37
+ //# sourceMappingURL=c_sharp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"c_sharp.js","sourceRoot":"","sources":["../../src/lang/c_sharp.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAoB;IACtC,EAAE,EAAE,SAAS;IACb,UAAU,EAAE,CAAC,IAAI,CAAC;IAClB,IAAI,EAAE,0BAA0B;IAChC,YAAY,EAAE,KAAK;IACnB,SAAS,EAAE;QACT,0EAA0E;QAC1E,YAAY,EAAE,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;QAClC,cAAc,EAAE,IAAI,GAAG,EAAE;QACzB,YAAY,EAAE,EAAE;QAChB,UAAU,EAAE;YACV,iBAAiB,EAAE,OAAO;YAC1B,qBAAqB,EAAE,WAAW;YAClC,kBAAkB,EAAE,QAAQ;YAC5B,gBAAgB,EAAE,MAAM;YACxB,kBAAkB,EAAE,QAAQ;YAC5B,oBAAoB,EAAE,UAAU;YAChC,qBAAqB,EAAE,WAAW;YAClC,iCAAiC,EAAE,WAAW;YAC9C,eAAe,EAAE,iBAAiB;YAClC,gBAAgB,EAAE,WAAW;SAC9B;KACF;IACD,OAAO,EAAE;QACP,QAAQ,EAAE;YACR,iBAAiB,EAAE,OAAO;YAC1B,qBAAqB,EAAE,WAAW;YAClC,kBAAkB,EAAE,QAAQ;YAC5B,gBAAgB,EAAE,MAAM;YACxB,kBAAkB,EAAE,QAAQ;YAC5B,oBAAoB,EAAE,UAAU;YAChC,kBAAkB,EAAE,QAAQ;SAC7B;QACD,QAAQ,EAAE,CAAC,YAAY,CAAC;KACzB;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { LanguageProfile } from './profile.ts';
2
+ export declare const cpp: LanguageProfile;
3
+ //# sourceMappingURL=cpp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpp.d.ts","sourceRoot":"","sources":["../../src/lang/cpp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,GAAG,EAAE,eA4CjB,CAAC"}
@@ -0,0 +1,46 @@
1
+ export const cpp = {
2
+ id: 'cpp',
3
+ extensions: ['cc', 'cpp', 'hpp'],
4
+ wasm: 'tree-sitter-cpp.wasm',
5
+ markerLeader: '// ',
6
+ structure: {
7
+ commentTypes: new Set(['comment']),
8
+ attributeTypes: new Set(),
9
+ // Same preprocessor, same `#pragma once` pin as c.
10
+ pinnedPatternsByType: { preproc_call: /^#\s*pragma\s+once\b/ },
11
+ // `template <typename T> class Box {}` — the marker should say what the template
12
+ // declares, not just that it is a template.
13
+ wrapperTypes: { template_declaration: 'template' },
14
+ kindLabels: {
15
+ function_definition: 'function',
16
+ declaration: 'declaration',
17
+ struct_specifier: 'struct',
18
+ class_specifier: 'class',
19
+ union_specifier: 'union',
20
+ enum_specifier: 'enum',
21
+ type_definition: 'type definition',
22
+ alias_declaration: 'type alias',
23
+ namespace_definition: 'namespace',
24
+ using_declaration: 'using declaration',
25
+ linkage_specification: 'extern block',
26
+ preproc_include: 'include directive',
27
+ preproc_def: 'macro definition',
28
+ preproc_function_def: 'macro definition',
29
+ preproc_call: 'preprocessor directive',
30
+ preproc_if: 'preprocessor conditional',
31
+ preproc_ifdef: 'preprocessor conditional',
32
+ preproc_else: 'preprocessor conditional',
33
+ },
34
+ },
35
+ repomap: {
36
+ defKinds: {
37
+ class_specifier: 'class',
38
+ struct_specifier: 'struct',
39
+ union_specifier: 'union',
40
+ enum_specifier: 'enum',
41
+ namespace_definition: 'namespace',
42
+ },
43
+ refTypes: ['identifier', 'type_identifier'],
44
+ },
45
+ };
46
+ //# sourceMappingURL=cpp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpp.js","sourceRoot":"","sources":["../../src/lang/cpp.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,GAAG,GAAoB;IAClC,EAAE,EAAE,KAAK;IACT,UAAU,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC;IAChC,IAAI,EAAE,sBAAsB;IAC5B,YAAY,EAAE,KAAK;IACnB,SAAS,EAAE;QACT,YAAY,EAAE,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;QAClC,cAAc,EAAE,IAAI,GAAG,EAAE;QACzB,mDAAmD;QACnD,oBAAoB,EAAE,EAAE,YAAY,EAAE,sBAAsB,EAAE;QAC9D,iFAAiF;QACjF,4CAA4C;QAC5C,YAAY,EAAE,EAAE,oBAAoB,EAAE,UAAU,EAAE;QAClD,UAAU,EAAE;YACV,mBAAmB,EAAE,UAAU;YAC/B,WAAW,EAAE,aAAa;YAC1B,gBAAgB,EAAE,QAAQ;YAC1B,eAAe,EAAE,OAAO;YACxB,eAAe,EAAE,OAAO;YACxB,cAAc,EAAE,MAAM;YACtB,eAAe,EAAE,iBAAiB;YAClC,iBAAiB,EAAE,YAAY;YAC/B,oBAAoB,EAAE,WAAW;YACjC,iBAAiB,EAAE,mBAAmB;YACtC,qBAAqB,EAAE,cAAc;YACrC,eAAe,EAAE,mBAAmB;YACpC,WAAW,EAAE,kBAAkB;YAC/B,oBAAoB,EAAE,kBAAkB;YACxC,YAAY,EAAE,wBAAwB;YACtC,UAAU,EAAE,0BAA0B;YACtC,aAAa,EAAE,0BAA0B;YACzC,YAAY,EAAE,0BAA0B;SACzC;KACF;IACD,OAAO,EAAE;QACP,QAAQ,EAAE;YACR,eAAe,EAAE,OAAO;YACxB,gBAAgB,EAAE,QAAQ;YAC1B,eAAe,EAAE,OAAO;YACxB,cAAc,EAAE,MAAM;YACtB,oBAAoB,EAAE,WAAW;SAClC;QACD,QAAQ,EAAE,CAAC,YAAY,EAAE,iBAAiB,CAAC;KAC5C;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { LanguageProfile } from './profile.ts';
2
+ export declare const go: LanguageProfile;
3
+ //# sourceMappingURL=go.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"go.d.ts","sourceRoot":"","sources":["../../src/lang/go.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,EAAE,EAAE,eA6BhB,CAAC"}
@@ -0,0 +1,31 @@
1
+ export const go = {
2
+ id: 'go',
3
+ extensions: ['go'],
4
+ wasm: 'tree-sitter-go.wasm',
5
+ markerLeader: '// ',
6
+ structure: {
7
+ commentTypes: new Set(['comment']),
8
+ attributeTypes: new Set(),
9
+ // `//go:build` (and the legacy `// +build`) constrain the whole file's builds.
10
+ pinnedCommentPattern: /^\/\/(go:build|\s*\+build)\s/,
11
+ wrapperTypes: {},
12
+ kindLabels: {
13
+ function_declaration: 'function',
14
+ method_declaration: 'method',
15
+ type_declaration: 'type declaration',
16
+ const_declaration: 'constant',
17
+ var_declaration: 'variable',
18
+ import_declaration: 'import declaration',
19
+ package_clause: 'package clause',
20
+ },
21
+ },
22
+ repomap: {
23
+ defKinds: {
24
+ function_declaration: 'function',
25
+ method_declaration: 'method',
26
+ type_spec: 'type',
27
+ },
28
+ refTypes: ['identifier', 'type_identifier'],
29
+ },
30
+ };
31
+ //# sourceMappingURL=go.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"go.js","sourceRoot":"","sources":["../../src/lang/go.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,EAAE,GAAoB;IACjC,EAAE,EAAE,IAAI;IACR,UAAU,EAAE,CAAC,IAAI,CAAC;IAClB,IAAI,EAAE,qBAAqB;IAC3B,YAAY,EAAE,KAAK;IACnB,SAAS,EAAE;QACT,YAAY,EAAE,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;QAClC,cAAc,EAAE,IAAI,GAAG,EAAE;QACzB,+EAA+E;QAC/E,oBAAoB,EAAE,8BAA8B;QACpD,YAAY,EAAE,EAAE;QAChB,UAAU,EAAE;YACV,oBAAoB,EAAE,UAAU;YAChC,kBAAkB,EAAE,QAAQ;YAC5B,gBAAgB,EAAE,kBAAkB;YACpC,iBAAiB,EAAE,UAAU;YAC7B,eAAe,EAAE,UAAU;YAC3B,kBAAkB,EAAE,oBAAoB;YACxC,cAAc,EAAE,gBAAgB;SACjC;KACF;IACD,OAAO,EAAE;QACP,QAAQ,EAAE;YACR,oBAAoB,EAAE,UAAU;YAChC,kBAAkB,EAAE,QAAQ;YAC5B,SAAS,EAAE,MAAM;SAClB;QACD,QAAQ,EAAE,CAAC,YAAY,EAAE,iBAAiB,CAAC;KAC5C;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { LanguageProfile } from './profile.ts';
2
+ export declare const java: LanguageProfile;
3
+ //# sourceMappingURL=java.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"java.d.ts","sourceRoot":"","sources":["../../src/lang/java.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,IAAI,EAAE,eAgClB,CAAC"}
@@ -0,0 +1,34 @@
1
+ export const java = {
2
+ id: 'java',
3
+ extensions: ['java'],
4
+ wasm: 'tree-sitter-java.wasm',
5
+ markerLeader: '// ',
6
+ structure: {
7
+ // `//` is line_comment, `/** … */` javadoc is block_comment — both attach.
8
+ commentTypes: new Set(['line_comment', 'block_comment']),
9
+ attributeTypes: new Set(),
10
+ wrapperTypes: {},
11
+ kindLabels: {
12
+ class_declaration: 'class',
13
+ interface_declaration: 'interface',
14
+ enum_declaration: 'enum',
15
+ record_declaration: 'record',
16
+ annotation_type_declaration: 'annotation type',
17
+ package_declaration: 'package declaration',
18
+ import_declaration: 'import declaration',
19
+ module_declaration: 'module declaration',
20
+ },
21
+ },
22
+ repomap: {
23
+ defKinds: {
24
+ class_declaration: 'class',
25
+ interface_declaration: 'interface',
26
+ enum_declaration: 'enum',
27
+ record_declaration: 'record',
28
+ annotation_type_declaration: 'annotation type',
29
+ method_declaration: 'method',
30
+ },
31
+ refTypes: ['identifier', 'type_identifier'],
32
+ },
33
+ };
34
+ //# sourceMappingURL=java.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"java.js","sourceRoot":"","sources":["../../src/lang/java.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,IAAI,GAAoB;IACnC,EAAE,EAAE,MAAM;IACV,UAAU,EAAE,CAAC,MAAM,CAAC;IACpB,IAAI,EAAE,uBAAuB;IAC7B,YAAY,EAAE,KAAK;IACnB,SAAS,EAAE;QACT,2EAA2E;QAC3E,YAAY,EAAE,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;QACxD,cAAc,EAAE,IAAI,GAAG,EAAE;QACzB,YAAY,EAAE,EAAE;QAChB,UAAU,EAAE;YACV,iBAAiB,EAAE,OAAO;YAC1B,qBAAqB,EAAE,WAAW;YAClC,gBAAgB,EAAE,MAAM;YACxB,kBAAkB,EAAE,QAAQ;YAC5B,2BAA2B,EAAE,iBAAiB;YAC9C,mBAAmB,EAAE,qBAAqB;YAC1C,kBAAkB,EAAE,oBAAoB;YACxC,kBAAkB,EAAE,oBAAoB;SACzC;KACF;IACD,OAAO,EAAE;QACP,QAAQ,EAAE;YACR,iBAAiB,EAAE,OAAO;YAC1B,qBAAqB,EAAE,WAAW;YAClC,gBAAgB,EAAE,MAAM;YACxB,kBAAkB,EAAE,QAAQ;YAC5B,2BAA2B,EAAE,iBAAiB;YAC9C,kBAAkB,EAAE,QAAQ;SAC7B;QACD,QAAQ,EAAE,CAAC,YAAY,EAAE,iBAAiB,CAAC;KAC5C;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { LanguageProfile } from './profile.ts';
2
+ export declare const javascript: LanguageProfile;
3
+ //# sourceMappingURL=javascript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"javascript.d.ts","sourceRoot":"","sources":["../../src/lang/javascript.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,eAAO,MAAM,UAAU,EAAE,eAyBxB,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { TS_DEF_KINDS, TS_REF_TYPES } from './typescript.js';
2
+ export const javascript = {
3
+ id: 'javascript',
4
+ extensions: ['js', 'mjs', 'cjs', 'jsx'],
5
+ wasm: 'tree-sitter-javascript.wasm',
6
+ markerLeader: '// ',
7
+ structure: {
8
+ commentTypes: new Set(['comment']),
9
+ attributeTypes: new Set(),
10
+ // `#!/usr/bin/env node` parses as a hash_bang_line node, and it decides how the
11
+ // file executes — a collapse that swallowed it would break every direct invocation.
12
+ pinnedTypes: new Set(['hash_bang_line']),
13
+ wrapperTypes: { export_statement: 'export' },
14
+ kindLabels: {
15
+ function_declaration: 'function',
16
+ generator_function_declaration: 'function',
17
+ class_declaration: 'class',
18
+ lexical_declaration: 'variable',
19
+ variable_declaration: 'variable',
20
+ import_statement: 'import statement',
21
+ expression_statement: 'statement',
22
+ hash_bang_line: 'shebang',
23
+ comment: 'comment',
24
+ },
25
+ },
26
+ repomap: { defKinds: TS_DEF_KINDS, refTypes: TS_REF_TYPES },
27
+ };
28
+ //# sourceMappingURL=javascript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"javascript.js","sourceRoot":"","sources":["../../src/lang/javascript.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,CAAC,MAAM,UAAU,GAAoB;IACzC,EAAE,EAAE,YAAY;IAChB,UAAU,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;IACvC,IAAI,EAAE,6BAA6B;IACnC,YAAY,EAAE,KAAK;IACnB,SAAS,EAAE;QACT,YAAY,EAAE,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;QAClC,cAAc,EAAE,IAAI,GAAG,EAAE;QACzB,gFAAgF;QAChF,oFAAoF;QACpF,WAAW,EAAE,IAAI,GAAG,CAAC,CAAC,gBAAgB,CAAC,CAAC;QACxC,YAAY,EAAE,EAAE,gBAAgB,EAAE,QAAQ,EAAE;QAC5C,UAAU,EAAE;YACV,oBAAoB,EAAE,UAAU;YAChC,8BAA8B,EAAE,UAAU;YAC1C,iBAAiB,EAAE,OAAO;YAC1B,mBAAmB,EAAE,UAAU;YAC/B,oBAAoB,EAAE,UAAU;YAChC,gBAAgB,EAAE,kBAAkB;YACpC,oBAAoB,EAAE,WAAW;YACjC,cAAc,EAAE,SAAS;YACzB,OAAO,EAAE,SAAS;SACnB;KACF;IACD,OAAO,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE;CAC5D,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { LanguageProfile } from './profile.ts';
2
+ export declare const kotlin: LanguageProfile;
3
+ //# sourceMappingURL=kotlin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kotlin.d.ts","sourceRoot":"","sources":["../../src/lang/kotlin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,MAAM,EAAE,eAmCpB,CAAC"}
@@ -0,0 +1,37 @@
1
+ export const kotlin = {
2
+ id: 'kotlin',
3
+ extensions: ['kt', 'kts'],
4
+ wasm: 'tree-sitter-kotlin.wasm',
5
+ markerLeader: '// ',
6
+ structure: {
7
+ // `//` is line_comment; `/** … */` KDoc is multiline_comment.
8
+ commentTypes: new Set(['line_comment', 'multiline_comment']),
9
+ attributeTypes: new Set(),
10
+ // `#!/usr/bin/env kotlin` parses as a shebang_line node; same law as the rest.
11
+ pinnedTypes: new Set(['shebang_line']),
12
+ // tree-sitter-kotlin extends import_list over a doc comment that directly
13
+ // follows it — the KDoc of the first documented declaration after the imports.
14
+ // Split it back out, or that declaration loses its doc to the import collapse.
15
+ trailingCommentSplitTypes: new Set(['import_list']),
16
+ wrapperTypes: {},
17
+ kindLabels: {
18
+ function_declaration: 'function',
19
+ // tree-sitter-kotlin parses class, interface and enum headers all as
20
+ // class_declaration — "type declaration" is the honest word for the union.
21
+ class_declaration: 'type declaration',
22
+ object_declaration: 'object',
23
+ property_declaration: 'property',
24
+ type_alias: 'type alias',
25
+ package_header: 'package header',
26
+ import_list: 'import list',
27
+ shebang_line: 'shebang',
28
+ },
29
+ },
30
+ // No def kinds: tree-sitter-kotlin's declarations carry no identifier `name`
31
+ // field the extraction walk can read, so kotlin symbols are omitted, not guessed.
32
+ repomap: {
33
+ defKinds: {},
34
+ refTypes: ['simple_identifier', 'type_identifier'],
35
+ },
36
+ };
37
+ //# sourceMappingURL=kotlin.js.map