@emeryld/manager 1.3.0 → 1.4.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 +96 -0
- package/dist/create-package/cli-args.js +78 -0
- package/dist/create-package/prompts.js +138 -0
- package/dist/create-package/shared/configs.js +309 -0
- package/dist/create-package/shared/constants.js +5 -0
- package/dist/create-package/shared/fs-utils.js +69 -0
- package/dist/create-package/tasks.js +89 -0
- package/dist/create-package/types.js +1 -0
- package/dist/create-package/variant-info.js +67 -0
- package/dist/create-package/variants/client/expo-react-native/lib-files.js +168 -0
- package/dist/create-package/variants/client/expo-react-native/package-files.js +94 -0
- package/dist/create-package/variants/client/expo-react-native/scaffold.js +59 -0
- package/dist/create-package/variants/client/expo-react-native/ui-files.js +215 -0
- package/dist/create-package/variants/client/vite-react/health-page.js +251 -0
- package/dist/create-package/variants/client/vite-react/lib-files.js +176 -0
- package/dist/create-package/variants/client/vite-react/package-files.js +79 -0
- package/dist/create-package/variants/client/vite-react/scaffold.js +68 -0
- package/dist/create-package/variants/client/vite-react/ui-files.js +154 -0
- package/dist/create-package/variants/fullstack/files.js +129 -0
- package/dist/create-package/variants/fullstack/index.js +86 -0
- package/dist/create-package/variants/fullstack/utils.js +241 -0
- package/dist/llm-pack.js +2 -0
- package/dist/robot/cli/prompts.js +84 -27
- package/dist/robot/cli/settings.js +131 -56
- package/dist/robot/config.js +123 -50
- package/dist/robot/coordinator.js +10 -105
- package/dist/robot/extractors/classes.js +14 -13
- package/dist/robot/extractors/components.js +17 -10
- package/dist/robot/extractors/constants.js +9 -6
- package/dist/robot/extractors/functions.js +11 -8
- package/dist/robot/extractors/shared.js +6 -1
- package/dist/robot/extractors/types.js +5 -8
- package/dist/robot/llm-pack.js +1226 -0
- package/dist/robot/pack/builder.js +374 -0
- package/dist/robot/pack/cli.js +65 -0
- package/dist/robot/pack/exemplars.js +573 -0
- package/dist/robot/pack/globs.js +119 -0
- package/dist/robot/pack/selection.js +44 -0
- package/dist/robot/pack/symbols.js +309 -0
- package/dist/robot/pack/type-registry.js +285 -0
- package/dist/robot/pack/types.js +48 -0
- package/dist/robot/pack/utils.js +36 -0
- package/dist/robot/serializer.js +97 -0
- package/dist/robot/v2/cli.js +86 -0
- package/dist/robot/v2/globs.js +103 -0
- package/dist/robot/v2/parser/bundles.js +55 -0
- package/dist/robot/v2/parser/candidates.js +63 -0
- package/dist/robot/v2/parser/exemplars.js +114 -0
- package/dist/robot/v2/parser/exports.js +57 -0
- package/dist/robot/v2/parser/symbols.js +179 -0
- package/dist/robot/v2/parser.js +114 -0
- package/dist/robot/v2/types.js +42 -0
- package/dist/utils/export.js +39 -18
- package/package.json +2 -1
|
@@ -0,0 +1,1226 @@
|
|
|
1
|
+
EXPORTS: src / robot / cli / prompts.ts;
|
|
2
|
+
-confirmExecution(function () { });
|
|
3
|
+
() => ;
|
|
4
|
+
src / robot / cli / prompts.ts
|
|
5
|
+
- promptBoolean(function () { });
|
|
6
|
+
(label, fallback) => ;
|
|
7
|
+
src / robot / cli / prompts.ts
|
|
8
|
+
- promptChoice(function () { });
|
|
9
|
+
(label);
|
|
10
|
+
string, fallback;
|
|
11
|
+
T, options;
|
|
12
|
+
T[];
|
|
13
|
+
Promise;
|
|
14
|
+
src / robot / cli / prompts.ts
|
|
15
|
+
- promptKinds(function () { });
|
|
16
|
+
(fallback) => ;
|
|
17
|
+
src / robot / cli / prompts.ts
|
|
18
|
+
- promptList(function () { });
|
|
19
|
+
(label, fallback) => ;
|
|
20
|
+
src / robot / cli / prompts.ts
|
|
21
|
+
- promptPositiveNumber(function () { });
|
|
22
|
+
(label, fallback) => ;
|
|
23
|
+
src / robot / cli / prompts.ts
|
|
24
|
+
- promptRobotSettings(function () { });
|
|
25
|
+
(defaults) => ;
|
|
26
|
+
src / robot / cli / prompts.ts
|
|
27
|
+
- promptRobotSettingsInteractive(function () { });
|
|
28
|
+
(defaults) => ;
|
|
29
|
+
src / robot / cli / prompts.ts
|
|
30
|
+
- promptRobotSettingsSequential(function () { });
|
|
31
|
+
(defaults) => ;
|
|
32
|
+
src / robot / cli / prompts.ts
|
|
33
|
+
- promptTokenBudget(function () { });
|
|
34
|
+
(label, fallback) => ;
|
|
35
|
+
src / robot / cli / prompts.ts
|
|
36
|
+
- READY_PROMPT();
|
|
37
|
+
const ;
|
|
38
|
+
const READY_PROMPT, src;
|
|
39
|
+
/robot/cli / prompts.ts;
|
|
40
|
+
src / robot / cli / settings.ts;
|
|
41
|
+
-formatValue(function () { });
|
|
42
|
+
(value, descriptor, src) => ;
|
|
43
|
+
/robot/cli / settings.ts
|
|
44
|
+
- parseBooleanInput(function () { });
|
|
45
|
+
(raw) => ;
|
|
46
|
+
src / robot / cli / settings.ts
|
|
47
|
+
- parseInteractiveValue(function () { });
|
|
48
|
+
(descriptor, buffer) => src;
|
|
49
|
+
/robot/cli / settings.ts
|
|
50
|
+
- parseKindsInput(function () { });
|
|
51
|
+
(raw) => ;
|
|
52
|
+
src / robot / cli / settings.ts
|
|
53
|
+
- parsePositiveInteger(function () { });
|
|
54
|
+
(input) => ;
|
|
55
|
+
src / robot / cli / settings.ts
|
|
56
|
+
- parseStringList(function () { });
|
|
57
|
+
(input) => ;
|
|
58
|
+
src / robot / cli / settings.ts
|
|
59
|
+
- RobotSettingDescriptor(type - alias);
|
|
60
|
+
src / robot / cli / settings.ts
|
|
61
|
+
- SETTING_DESCRIPTORS();
|
|
62
|
+
const ;
|
|
63
|
+
const SETTING_DESCRIPTORS, src;
|
|
64
|
+
/robot/cli / settings.ts
|
|
65
|
+
- validateRobotSettings(function () { });
|
|
66
|
+
(settings) => src;
|
|
67
|
+
/robot/config.ts;
|
|
68
|
+
-coerceBoolean(function () { });
|
|
69
|
+
(value, fallback) => ;
|
|
70
|
+
src / robot / config.ts
|
|
71
|
+
- coerceClosure(function () { });
|
|
72
|
+
(value, fallback) => ;
|
|
73
|
+
src / robot / config.ts
|
|
74
|
+
- coerceExportMode(function () { });
|
|
75
|
+
(value, fallback) => ;
|
|
76
|
+
src / robot / config.ts
|
|
77
|
+
- coerceKinds(function () { });
|
|
78
|
+
(value, fallback) => ;
|
|
79
|
+
src / robot / config.ts
|
|
80
|
+
- coerceOptionalNumber(function () { });
|
|
81
|
+
(value) => ;
|
|
82
|
+
src / robot / config.ts
|
|
83
|
+
- coercePositiveInteger(function () { });
|
|
84
|
+
(value, fallback) => ;
|
|
85
|
+
src / robot / config.ts
|
|
86
|
+
- coercePositiveNumber(function () { });
|
|
87
|
+
(value, fallback) => ;
|
|
88
|
+
src / robot / config.ts
|
|
89
|
+
- coerceStringArray(function () { });
|
|
90
|
+
(value, fallback) => ;
|
|
91
|
+
src / robot / config.ts
|
|
92
|
+
- coerceVisibility(function () { });
|
|
93
|
+
(value, exportedOnly, fallback) => ;
|
|
94
|
+
src / robot / config.ts
|
|
95
|
+
- ensureTagPrefix(function () { });
|
|
96
|
+
(tag) => ;
|
|
97
|
+
src / robot / config.ts
|
|
98
|
+
- loadRobotSettings(function () { });
|
|
99
|
+
() => ;
|
|
100
|
+
src / robot / config.ts
|
|
101
|
+
- SETTINGS_SECTION();
|
|
102
|
+
const ;
|
|
103
|
+
const SETTINGS_SECTION, src;
|
|
104
|
+
/robot/config.ts
|
|
105
|
+
- workspaceSettingsPath();
|
|
106
|
+
const ;
|
|
107
|
+
const workspaceSettingsPath, src;
|
|
108
|
+
/robot/config.ts;
|
|
109
|
+
src / robot / coordinator.ts;
|
|
110
|
+
-robotSettingsSummary(function () { });
|
|
111
|
+
(settings) => ;
|
|
112
|
+
src / robot / coordinator.ts
|
|
113
|
+
- runRobot(function () { });
|
|
114
|
+
() => ;
|
|
115
|
+
src / robot / coordinator.ts;
|
|
116
|
+
src / robot / index.ts;
|
|
117
|
+
-runRobot(function () { });
|
|
118
|
+
() => ;
|
|
119
|
+
src / robot / coordinator.ts;
|
|
120
|
+
src / robot / pack / builder.ts;
|
|
121
|
+
-applyTokenBudget(function () { });
|
|
122
|
+
(pack, settings, registry) => ;
|
|
123
|
+
src / robot / pack / builder.ts
|
|
124
|
+
- buildClassMemberSignatures(function () { });
|
|
125
|
+
(className, modulePath, declaration, checker) => ;
|
|
126
|
+
src / robot / pack / builder.ts
|
|
127
|
+
- buildClassMemberSignatureText(function () { });
|
|
128
|
+
(member, checker) => ;
|
|
129
|
+
src / robot / pack / builder.ts
|
|
130
|
+
- buildClassSignature(function () { });
|
|
131
|
+
(declaration, checker) => ;
|
|
132
|
+
src / robot / pack / builder.ts
|
|
133
|
+
- buildConstSignature(function () { });
|
|
134
|
+
(symbol, declaration, checker) => ;
|
|
135
|
+
src / robot / pack / builder.ts
|
|
136
|
+
- buildExemplarCandidates(function () { });
|
|
137
|
+
(symbols, candidates, settings) => src;
|
|
138
|
+
/robot/pack / builder.ts
|
|
139
|
+
- buildFunctionSignature(function () { });
|
|
140
|
+
(symbol, declaration, checker) => ;
|
|
141
|
+
src / robot / pack / builder.ts
|
|
142
|
+
- buildModuleExports(function () { });
|
|
143
|
+
(symbols) => ;
|
|
144
|
+
src / robot / pack / builder.ts
|
|
145
|
+
- buildPackText(function () { });
|
|
146
|
+
(exportsByModule, types, signatures, exemplars) => ;
|
|
147
|
+
src / robot / pack / builder.ts
|
|
148
|
+
- buildRobotPack(function () { });
|
|
149
|
+
(options) => ;
|
|
150
|
+
src / robot / pack / builder.ts
|
|
151
|
+
- buildSymbolId(function () { });
|
|
152
|
+
(symbol, declaration) => ;
|
|
153
|
+
src / robot / pack / builder.ts
|
|
154
|
+
- buildSymbolSignature(function () { });
|
|
155
|
+
(symbol, declaration, checker, kind) => ;
|
|
156
|
+
src / robot / pack / builder.ts
|
|
157
|
+
- buildTypeSignature(function () { });
|
|
158
|
+
(declaration) => ;
|
|
159
|
+
src / robot / pack / builder.ts
|
|
160
|
+
- CandidateInfo(type - alias);
|
|
161
|
+
src / robot / pack / builder.ts
|
|
162
|
+
- ClassMemberSignatureDeclaration(type - alias);
|
|
163
|
+
src / robot / pack / builder.ts
|
|
164
|
+
- collectPublicSymbols(function () { });
|
|
165
|
+
(program, checker, candidates, entrypoints, settings) => ;
|
|
166
|
+
src / robot / pack / builder.ts
|
|
167
|
+
- computeExemplarScore(function () { });
|
|
168
|
+
(fanIn, complexity, annotationBoost, bodySize, heuristics) => ;
|
|
169
|
+
src / robot / pack / builder.ts
|
|
170
|
+
- determineSymbolKind(function () { });
|
|
171
|
+
(symbol, declaration) => ;
|
|
172
|
+
src / robot / pack / builder.ts
|
|
173
|
+
- ensureModuleExposure(function () { });
|
|
174
|
+
(moduleEntrypoints, queue, targetPath, exposures) => ;
|
|
175
|
+
src / robot / pack / builder.ts
|
|
176
|
+
- ensureTagPrefix(function () { });
|
|
177
|
+
(tag) => ;
|
|
178
|
+
src / robot / pack / builder.ts
|
|
179
|
+
- escapeRegExp(function () { });
|
|
180
|
+
(value) => ;
|
|
181
|
+
src / robot / pack / builder.ts
|
|
182
|
+
- estimateComplexity(function () { });
|
|
183
|
+
(node) => ;
|
|
184
|
+
src / robot / pack / builder.ts
|
|
185
|
+
- estimateFanIn(function () { });
|
|
186
|
+
(name, candidates) => ;
|
|
187
|
+
src / robot / pack / builder.ts
|
|
188
|
+
- estimateTokens(function () { });
|
|
189
|
+
(text) => ;
|
|
190
|
+
src / robot / pack / builder.ts
|
|
191
|
+
- extractDocTags(function () { });
|
|
192
|
+
(symbol, keepTags) => ;
|
|
193
|
+
src / robot / pack / builder.ts
|
|
194
|
+
- formatExportSignature(function () { });
|
|
195
|
+
(signature, kind) => ;
|
|
196
|
+
src / robot / pack / builder.ts
|
|
197
|
+
- formatParameters(function () { });
|
|
198
|
+
(parameters, checker) => ;
|
|
199
|
+
src / robot / pack / builder.ts
|
|
200
|
+
- getClassMemberName(function () { });
|
|
201
|
+
(member) => ;
|
|
202
|
+
src / robot / pack / builder.ts
|
|
203
|
+
- handleSymbol(function () { });
|
|
204
|
+
(symbols, sourceSymbol, exposures, moduleInfo, checker, se, src) => ;
|
|
205
|
+
/robot/pack / builder.ts
|
|
206
|
+
- includeLocalDeclarations(function () { });
|
|
207
|
+
(symbols, moduleInfo, exposures, checker, settings, src) => ;
|
|
208
|
+
/robot/pack / builder.ts
|
|
209
|
+
- isClassMemberSignature(function () { });
|
|
210
|
+
(member) => ;
|
|
211
|
+
src / robot / pack / builder.ts
|
|
212
|
+
- isPathInside(function () { });
|
|
213
|
+
(child, parent) => ;
|
|
214
|
+
src / robot / pack / builder.ts
|
|
215
|
+
- isTypeSymbol(function () { });
|
|
216
|
+
(kind) => ;
|
|
217
|
+
src / robot / pack / builder.ts
|
|
218
|
+
- MAX_EXPORT_SIGNATURE_LENGTH();
|
|
219
|
+
const ;
|
|
220
|
+
const MAX_EXPORT_SIGNATURE_LENGTH, src;
|
|
221
|
+
/robot/pack / builder.ts
|
|
222
|
+
- minifyImplementation(function () { });
|
|
223
|
+
(text, keepTags) => ;
|
|
224
|
+
src / robot / pack / builder.ts
|
|
225
|
+
- normalizeRelativePath(function () { });
|
|
226
|
+
(value) => ;
|
|
227
|
+
src / robot / pack / builder.ts
|
|
228
|
+
- normalizeSettings(function () { });
|
|
229
|
+
(options) => ;
|
|
230
|
+
src / robot / pack / builder.ts
|
|
231
|
+
- normalizeTypeText(function () { });
|
|
232
|
+
(text) => ;
|
|
233
|
+
src / robot / pack / builder.ts
|
|
234
|
+
- PRINTER();
|
|
235
|
+
const ;
|
|
236
|
+
const PRINTER, src;
|
|
237
|
+
/robot/pack / builder.ts
|
|
238
|
+
- PublicSymbolRecord(type - alias);
|
|
239
|
+
src / robot / pack / builder.ts
|
|
240
|
+
- resolveEntrypoints(function () { });
|
|
241
|
+
(candidates, settings) => ;
|
|
242
|
+
src / robot / pack / builder.ts
|
|
243
|
+
- resolveModuleSpecifier(function () { });
|
|
244
|
+
(value, source, compilerOptions) => ;
|
|
245
|
+
src / robot / pack / builder.ts
|
|
246
|
+
- resolveTsConfig(function () { });
|
|
247
|
+
(rootDir, explicit) => ;
|
|
248
|
+
src / robot / pack / builder.ts
|
|
249
|
+
- selectCandidateFiles(function () { });
|
|
250
|
+
(sourceFiles, settings) => ;
|
|
251
|
+
src / robot / pack / builder.ts
|
|
252
|
+
- selectExemplars(function () { });
|
|
253
|
+
(candidates, settings) => ;
|
|
254
|
+
src / robot / pack / builder.ts
|
|
255
|
+
- stripComments(function () { });
|
|
256
|
+
(source, keepTags) => ;
|
|
257
|
+
src / robot / pack / builder.ts
|
|
258
|
+
- TypeEntry(type - alias);
|
|
259
|
+
dependenci;
|
|
260
|
+
src / robot / pack / builder.ts
|
|
261
|
+
- TypeRegistry(class {
|
|
262
|
+
});
|
|
263
|
+
class TypeRegistry {
|
|
264
|
+
entries;
|
|
265
|
+
depthDirty;
|
|
266
|
+
}
|
|
267
|
+
/robot/pack / builder.ts;
|
|
268
|
+
src / robot / pack / cli.ts;
|
|
269
|
+
-runRobotPack(function () { });
|
|
270
|
+
(settings, exportMode) => ;
|
|
271
|
+
src / robot / pack / cli.ts;
|
|
272
|
+
src / robot / pack / globs.ts;
|
|
273
|
+
-createGlobMatchers(function () { });
|
|
274
|
+
(patterns) => ;
|
|
275
|
+
src / robot / pack / globs.ts
|
|
276
|
+
- ESCAPE_REGEX();
|
|
277
|
+
const ;
|
|
278
|
+
const ESCAPE_REGEX, src;
|
|
279
|
+
/robot/pack / globs.ts
|
|
280
|
+
- escapeLiteral(function () { });
|
|
281
|
+
(value) => ;
|
|
282
|
+
src / robot / pack / globs.ts
|
|
283
|
+
- expandBraces(function () { });
|
|
284
|
+
(pattern) => ;
|
|
285
|
+
src / robot / pack / globs.ts
|
|
286
|
+
- globToRegExp(function () { });
|
|
287
|
+
(pattern) => ;
|
|
288
|
+
src / robot / pack / globs.ts
|
|
289
|
+
- matchesAnyGlob(function () { });
|
|
290
|
+
(value, matchers) => ;
|
|
291
|
+
src / robot / pack / globs.ts
|
|
292
|
+
- normalizePatternInput(function () { });
|
|
293
|
+
(value) => ;
|
|
294
|
+
src / robot / pack / globs.ts
|
|
295
|
+
- normalizeTargetPath(function () { });
|
|
296
|
+
(value) => ;
|
|
297
|
+
src / robot / pack / globs.ts
|
|
298
|
+
- splitAlternatives(function () { });
|
|
299
|
+
(value) => ;
|
|
300
|
+
src / robot / pack / globs.ts;
|
|
301
|
+
src / robot / pack / types.ts;
|
|
302
|
+
-ExemplarHeuristicWeights(interface);
|
|
303
|
+
src / robot / pack / types.ts
|
|
304
|
+
- ExemplarRecord(interface);
|
|
305
|
+
src / robot / pack / types.ts
|
|
306
|
+
- ModuleExportSummary(interface);
|
|
307
|
+
src / robot / pack / types.ts
|
|
308
|
+
- ROBOT_PACK_DEFAULT_SETTINGS();
|
|
309
|
+
const ;
|
|
310
|
+
const ROBOT_PACK_DEFAULT_SETTINGS, src;
|
|
311
|
+
/robot/pack / types.ts
|
|
312
|
+
- ROBOT_PACK_SYMBOL_KINDS();
|
|
313
|
+
const ;
|
|
314
|
+
const ROBOT_PACK_SYMBOL_KINDS, src;
|
|
315
|
+
/robot/pack / types.ts
|
|
316
|
+
- RobotPack(interface);
|
|
317
|
+
src / robot / pack / types.ts
|
|
318
|
+
- RobotPackClosure(type - alias);
|
|
319
|
+
src / robot / pack / types.ts
|
|
320
|
+
- RobotPackExportMode(type - alias);
|
|
321
|
+
src / robot / pack / types.ts
|
|
322
|
+
- RobotPackJson(interface);
|
|
323
|
+
src / robot / pack / types.ts
|
|
324
|
+
- RobotPackOptions(interface);
|
|
325
|
+
src / robot / pack / types.ts
|
|
326
|
+
- RobotPackSettings(interface);
|
|
327
|
+
src / robot / pack / types.ts
|
|
328
|
+
- RobotPackSummary(interface);
|
|
329
|
+
signatu;
|
|
330
|
+
src / robot / pack / types.ts
|
|
331
|
+
- RobotPackSymbolKind(type - alias);
|
|
332
|
+
src / robot / pack / types.ts
|
|
333
|
+
- RobotPackVisibility(type - alias);
|
|
334
|
+
src / robot / pack / types.ts
|
|
335
|
+
- SignatureDefinition(interface);
|
|
336
|
+
src / robot / pack / types.ts
|
|
337
|
+
- SymbolSummary(interface);
|
|
338
|
+
isR;
|
|
339
|
+
src / robot / pack / types.ts
|
|
340
|
+
- TypeDefinition(interface);
|
|
341
|
+
src / robot / pack / types.ts;
|
|
342
|
+
TYPES: -CandidateInfo(type - alias);
|
|
343
|
+
-ClassMemberSignatureDeclaration(type - alias);
|
|
344
|
+
-ExemplarHeuristicWeights(interface);
|
|
345
|
+
-RobotPackClosure(type - alias);
|
|
346
|
+
-RobotPackExportMode(type - alias);
|
|
347
|
+
-RobotPackSummary(interface);
|
|
348
|
+
-RobotPackSymbolKind(type - alias);
|
|
349
|
+
-ExemplarRecord(interface);
|
|
350
|
+
-RobotPackOptions(interface);
|
|
351
|
+
-RobotPackVisibility(type - alias);
|
|
352
|
+
-RobotPackSettings(interface);
|
|
353
|
+
-RobotSettingDescriptor(type - alias);
|
|
354
|
+
-SignatureDefinition(interface);
|
|
355
|
+
-SymbolSummary(interface);
|
|
356
|
+
-ModuleExportSummary(interface);
|
|
357
|
+
-PublicSymbolRecord(type - alias);
|
|
358
|
+
-TypeDefinition(interface);
|
|
359
|
+
-RobotPackJson(interface);
|
|
360
|
+
-RobotPack(interface);
|
|
361
|
+
-TypeEntry(type - alias);
|
|
362
|
+
SIGNATURES: -src / robot / pack / types.ts;
|
|
363
|
+
ROBOT_PACK_SYMBOL_KINDS();
|
|
364
|
+
const ;
|
|
365
|
+
const ROBOT_PACK_SYMBOL_KINDS;
|
|
366
|
+
-src / robot / pack / types.ts;
|
|
367
|
+
ROBOT_PACK_DEFAULT_SETTINGS();
|
|
368
|
+
const ;
|
|
369
|
+
const ROBOT_PACK_DEFAULT_SETTINGS;
|
|
370
|
+
-src / robot / config.ts;
|
|
371
|
+
loadRobotSettings(function () { })();
|
|
372
|
+
Promise < RobotPackSettings >
|
|
373
|
+
-src / robot / config.ts;
|
|
374
|
+
SETTINGS_SECTION();
|
|
375
|
+
const ;
|
|
376
|
+
const SETTINGS_SECTION;
|
|
377
|
+
-src / robot / config.ts;
|
|
378
|
+
workspaceSettingsPath();
|
|
379
|
+
const ;
|
|
380
|
+
const workspaceSettingsPath;
|
|
381
|
+
-src / robot / config.ts;
|
|
382
|
+
coerceBoolean(function () { })(value, unknown, fallback, boolean);
|
|
383
|
+
boolean
|
|
384
|
+
- src / robot / config.ts;
|
|
385
|
+
coercePositiveNumber(function () { })(value, unknown, fallback, number);
|
|
386
|
+
number
|
|
387
|
+
- src / robot / config.ts;
|
|
388
|
+
coercePositiveInteger(function () { })(value, unknown, fallback, number);
|
|
389
|
+
number
|
|
390
|
+
- src / robot / config.ts;
|
|
391
|
+
coerceOptionalNumber(function () { })(value, unknown);
|
|
392
|
+
number | undefined
|
|
393
|
+
- src / robot / config.ts;
|
|
394
|
+
coerceStringArray(function () { })(value, unknown, fallback, string[]);
|
|
395
|
+
string[]
|
|
396
|
+
- src / robot / config.ts;
|
|
397
|
+
coerceKinds(function () { })(value, unknown, fallback, RobotPackSymbolKind[]);
|
|
398
|
+
RobotPackSymbolKind[]
|
|
399
|
+
- src / robot / config.ts;
|
|
400
|
+
coerceExportMode(function () { })(value, unknown, fallback, RobotPackExportMode);
|
|
401
|
+
RobotPackExportMode
|
|
402
|
+
- src / robot / config.ts;
|
|
403
|
+
coerceVisibility(function () { })(value, unknown, exportedOnly, unknown, fallback, RobotPackVisibility);
|
|
404
|
+
RobotPackVisibility
|
|
405
|
+
- src / robot / config.ts;
|
|
406
|
+
coerceClosure(function () { })(value, unknown, fallback, RobotPackClosure);
|
|
407
|
+
RobotPackClosure
|
|
408
|
+
- src / robot / config.ts;
|
|
409
|
+
ensureTagPrefix(function () { })(tag, string);
|
|
410
|
+
string
|
|
411
|
+
- src / robot / cli / settings.ts;
|
|
412
|
+
formatValue(function () { })(value, string | number | boolean | RobotPackSymbolKind[] | string[] | ExemplarHeuristicWeights | undefined, descriptor, RobotSettingDescriptor);
|
|
413
|
+
string
|
|
414
|
+
- src / robot / cli / settings.ts;
|
|
415
|
+
parseInteractiveValue(function () { })(descriptor, RobotSettingDescriptor, buffer, string);
|
|
416
|
+
{
|
|
417
|
+
value ? : string | number | boolean | RobotPackSymbolKind[] | string[] | ExemplarHeuristicWeights | undefined;
|
|
418
|
+
error ? : string | undefined;
|
|
419
|
+
}
|
|
420
|
+
-src / robot / cli / settings.ts;
|
|
421
|
+
validateRobotSettings(function () { })(settings, RobotPackSettings);
|
|
422
|
+
"Specify at least one include glob." | "Specify at least one entrypoint pattern." | "Choose at least one kind to include." | "Maximum exemplars must be a positive number." | "Token budget must be greater than zero or blank for unlimited." | undefined
|
|
423
|
+
- src / robot / cli / settings.ts;
|
|
424
|
+
parseKindsInput(function () { })(raw, string);
|
|
425
|
+
{
|
|
426
|
+
value ? : RobotPackSymbolKind[] | undefined;
|
|
427
|
+
error ? : string | undefined;
|
|
428
|
+
}
|
|
429
|
+
-src / robot / cli / settings.ts;
|
|
430
|
+
SETTING_DESCRIPTORS();
|
|
431
|
+
const ;
|
|
432
|
+
const SETTING_DESCRIPTORS;
|
|
433
|
+
-src / robot / cli / settings.ts;
|
|
434
|
+
parseStringList(function () { })(input, string);
|
|
435
|
+
string[]
|
|
436
|
+
- src / robot / cli / settings.ts;
|
|
437
|
+
parsePositiveInteger(function () { })(input, string);
|
|
438
|
+
number | undefined
|
|
439
|
+
- src / robot / cli / settings.ts;
|
|
440
|
+
parseBooleanInput(function () { })(raw, string);
|
|
441
|
+
{
|
|
442
|
+
value: boolean;
|
|
443
|
+
error ? : undefined;
|
|
444
|
+
}
|
|
445
|
+
| { error: string, value: undefined }
|
|
446
|
+
- src / robot / cli / prompts.ts;
|
|
447
|
+
promptRobotSettings(function () { })(defaults, RobotPackSettings);
|
|
448
|
+
Promise < RobotPackSettings >
|
|
449
|
+
-src / robot / cli / prompts.ts;
|
|
450
|
+
READY_PROMPT();
|
|
451
|
+
const ;
|
|
452
|
+
const READY_PROMPT;
|
|
453
|
+
-src / robot / cli / prompts.ts;
|
|
454
|
+
confirmExecution(function () { })();
|
|
455
|
+
Promise < boolean >
|
|
456
|
+
-src / robot / cli / prompts.ts;
|
|
457
|
+
promptRobotSettingsSequential(function () { })(defaults, RobotPackSettings);
|
|
458
|
+
Promise < { includeGlobs: string[], excludeGlobs: string[], entrypoints: string[], exportMode: RobotPackExportMode, visibility: RobotPackVisibility, ...10, more, ..., keepJSDocTags: string[] } >
|
|
459
|
+
-src / robot / cli / prompts.ts;
|
|
460
|
+
promptList(function () { })(label, string, fallback, string[]);
|
|
461
|
+
Promise < string[] >
|
|
462
|
+
-src / robot / cli / prompts.ts;
|
|
463
|
+
promptChoice(function () { })(label, string, fallback, T, options, readonly, T[]);
|
|
464
|
+
Promise < T >
|
|
465
|
+
-src / robot / cli / prompts.ts;
|
|
466
|
+
promptKinds(function () { })(fallback, RobotPackSymbolKind[]);
|
|
467
|
+
Promise < RobotPackSymbolKind[] >
|
|
468
|
+
-src / robot / cli / prompts.ts;
|
|
469
|
+
promptPositiveNumber(function () { })(label, string, fallback, number);
|
|
470
|
+
Promise < number >
|
|
471
|
+
-src / robot / cli / prompts.ts;
|
|
472
|
+
promptTokenBudget(function () { })(label, string, fallback, number | undefined);
|
|
473
|
+
Promise < number | undefined >
|
|
474
|
+
-src / robot / cli / prompts.ts;
|
|
475
|
+
promptBoolean(function () { })(label, string, fallback, boolean);
|
|
476
|
+
Promise < boolean >
|
|
477
|
+
-src / robot / cli / prompts.ts;
|
|
478
|
+
promptRobotSettingsInteractive(function () { })(defaults, RobotPackSettings);
|
|
479
|
+
Promise < RobotPackSettings >
|
|
480
|
+
-src / robot / pack / globs.ts;
|
|
481
|
+
createGlobMatchers(function () { })(patterns, string[]);
|
|
482
|
+
RegExp[]
|
|
483
|
+
- src / robot / pack / globs.ts;
|
|
484
|
+
matchesAnyGlob(function () { })(value, string, matchers, RegExp[]);
|
|
485
|
+
boolean
|
|
486
|
+
- src / robot / pack / globs.ts;
|
|
487
|
+
ESCAPE_REGEX();
|
|
488
|
+
const ;
|
|
489
|
+
const ESCAPE_REGEX;
|
|
490
|
+
-src / robot / pack / globs.ts;
|
|
491
|
+
escapeLiteral(function () { })(value, string);
|
|
492
|
+
string
|
|
493
|
+
- src / robot / pack / globs.ts;
|
|
494
|
+
normalizePatternInput(function () { })(value, string);
|
|
495
|
+
string
|
|
496
|
+
- src / robot / pack / globs.ts;
|
|
497
|
+
normalizeTargetPath(function () { })(value, string);
|
|
498
|
+
string
|
|
499
|
+
- src / robot / pack / globs.ts;
|
|
500
|
+
splitAlternatives(function () { })(value, string);
|
|
501
|
+
string[]
|
|
502
|
+
- src / robot / pack / globs.ts;
|
|
503
|
+
expandBraces(function () { })(pattern, string);
|
|
504
|
+
string[]
|
|
505
|
+
- src / robot / pack / globs.ts;
|
|
506
|
+
globToRegExp(function () { })(pattern, string);
|
|
507
|
+
string
|
|
508
|
+
- src / robot / pack / builder.ts;
|
|
509
|
+
buildRobotPack(function () { })(options, RobotPackOptions);
|
|
510
|
+
Promise < RobotPack >
|
|
511
|
+
-src / robot / pack / builder.ts;
|
|
512
|
+
PRINTER();
|
|
513
|
+
const ;
|
|
514
|
+
const PRINTER;
|
|
515
|
+
-src / robot / pack / builder.ts;
|
|
516
|
+
normalizeSettings(function () { })(options, RobotPackOptions);
|
|
517
|
+
RobotPackSettings
|
|
518
|
+
- src / robot / pack / builder.ts;
|
|
519
|
+
ensureTagPrefix(function () { })(tag, string);
|
|
520
|
+
string
|
|
521
|
+
- src / robot / pack / builder.ts;
|
|
522
|
+
resolveTsConfig(function () { })(rootDir, string, explicit ? : string | undefined);
|
|
523
|
+
string | undefined
|
|
524
|
+
- src / robot / pack / builder.ts;
|
|
525
|
+
selectCandidateFiles(function () { })(sourceFiles, readonly, SourceFile[], settings, RobotPackSettings);
|
|
526
|
+
CandidateInfo[]
|
|
527
|
+
- src / robot / pack / builder.ts;
|
|
528
|
+
resolveEntrypoints(function () { })(candidates, CandidateInfo[], settings, RobotPackSettings);
|
|
529
|
+
Map < string, Set < string >>
|
|
530
|
+
-src / robot / pack / builder.ts;
|
|
531
|
+
collectPublicSymbols(function () { })(program, Program, checker, TypeChecker, candidates, CandidateInfo[], entrypoints, (Map), settings, RobotPackSettings);
|
|
532
|
+
Map < ;
|
|
533
|
+
>
|
|
534
|
+
-src / robot / pack / builder.ts;
|
|
535
|
+
includeLocalDeclarations(function () { })(symbols, (Map), moduleInfo, CandidateInfo, exposures, (Set), checker, TypeChecker, settings, RobotPackSettings);
|
|
536
|
+
void -src / robot / pack / builder.ts;
|
|
537
|
+
handleSymbol(function () { })(symbols, (Map), sourceSymbol, Symbol, exposures, (Set), moduleInfo, CandidateInfo, checker, TypeChecker, settings, RobotPackSettings, isReexport, boolean);
|
|
538
|
+
void -src / robot / pack / builder.ts;
|
|
539
|
+
determineSymbolKind(function () { })(symbol, Symbol, declaration, Declaration);
|
|
540
|
+
RobotPackSymbolKind | undefined
|
|
541
|
+
- src / robot / pack / builder.ts;
|
|
542
|
+
buildSymbolSignature(function () { })(symbol, Symbol, declaration, Declaration, checker, TypeChecker, kind, RobotPackSymbolKind);
|
|
543
|
+
string
|
|
544
|
+
- src / robot / pack / builder.ts;
|
|
545
|
+
buildFunctionSignature(function () { })(symbol, Symbol, declaration, Declaration, checker, TypeChecker);
|
|
546
|
+
string
|
|
547
|
+
- src / robot / pack / builder.ts;
|
|
548
|
+
buildClassSignature(function () { })(declaration, Declaration, checker, TypeChecker);
|
|
549
|
+
string
|
|
550
|
+
- src / robot / pack / builder.ts;
|
|
551
|
+
buildClassMemberSignatures(function () { })(className, string, modulePath, string, declaration, Declaration, checker, TypeChecker);
|
|
552
|
+
SignatureDefinition[]
|
|
553
|
+
- src / robot / pack / builder.ts;
|
|
554
|
+
isClassMemberSignature(function () { })(member, Node);
|
|
555
|
+
member;
|
|
556
|
+
is;
|
|
557
|
+
ClassMemberSignatureDeclaration
|
|
558
|
+
- src / robot / pack / builder.ts;
|
|
559
|
+
getClassMemberName(function () { })(member, ClassMemberSignatureDeclaration);
|
|
560
|
+
string | undefined
|
|
561
|
+
- src / robot / pack / builder.ts;
|
|
562
|
+
buildClassMemberSignatureText(function () { })(member, ClassMemberSignatureDeclaration, checker, TypeChecker);
|
|
563
|
+
string | undefined
|
|
564
|
+
- src / robot / pack / builder.ts;
|
|
565
|
+
formatParameters(function () { })(parameters, (NodeArray), checker, TypeChecker);
|
|
566
|
+
string
|
|
567
|
+
- src / robot / pack / builder.ts;
|
|
568
|
+
buildConstSignature(function () { })(symbol, Symbol, declaration, Declaration, checker, TypeChecker);
|
|
569
|
+
string
|
|
570
|
+
- src / robot / pack / builder.ts;
|
|
571
|
+
buildTypeSignature(function () { })(declaration, Declaration);
|
|
572
|
+
string
|
|
573
|
+
- src / robot / pack / builder.ts;
|
|
574
|
+
buildSymbolId(function () { })(symbol, Symbol, declaration, Declaration);
|
|
575
|
+
string
|
|
576
|
+
- src / robot / pack / builder.ts;
|
|
577
|
+
extractDocTags(function () { })(symbol, Symbol, keepTags, string[]);
|
|
578
|
+
string[]
|
|
579
|
+
- src / robot / pack / builder.ts;
|
|
580
|
+
resolveModuleSpecifier(function () { })(value, string, source, SourceFile, compilerOptions, CompilerOptions);
|
|
581
|
+
string | undefined
|
|
582
|
+
- src / robot / pack / builder.ts;
|
|
583
|
+
ensureModuleExposure(function () { })(moduleEntrypoints, (Map), queue, string[], targetPath, string, exposures, (Set));
|
|
584
|
+
void -src / robot / pack / builder.ts;
|
|
585
|
+
buildModuleExports(function () { })(symbols, (Map));
|
|
586
|
+
ModuleExportSummary[]
|
|
587
|
+
- src / robot / pack / builder.ts;
|
|
588
|
+
buildPackText(function () { })(exportsByModule, ModuleExportSummary[], types, TypeDefinition[], signatures, SignatureDefinition[], exemplars, ExemplarRecord[]);
|
|
589
|
+
string
|
|
590
|
+
- src / robot / pack / builder.ts;
|
|
591
|
+
MAX_EXPORT_SIGNATURE_LENGTH();
|
|
592
|
+
const ;
|
|
593
|
+
const MAX_EXPORT_SIGNATURE_LENGTH;
|
|
594
|
+
-src / robot / pack / builder.ts;
|
|
595
|
+
formatExportSignature(function () { })(signature, string, kind, RobotPackSymbolKind);
|
|
596
|
+
string
|
|
597
|
+
- src / robot / pack / builder.ts;
|
|
598
|
+
applyTokenBudget(function () { })(pack, RobotPack, settings, RobotPackSettings, registry, TypeRegistry);
|
|
599
|
+
void -src / robot / pack / builder.ts;
|
|
600
|
+
estimateTokens(function () { })(text, string);
|
|
601
|
+
number
|
|
602
|
+
- src / robot / pack / builder.ts;
|
|
603
|
+
normalizeTypeText(function () { })(text, string);
|
|
604
|
+
string
|
|
605
|
+
- src / robot / pack / builder.ts;
|
|
606
|
+
normalizeRelativePath(function () { })(value, string);
|
|
607
|
+
string
|
|
608
|
+
- src / robot / pack / builder.ts;
|
|
609
|
+
isPathInside(function () { })(child, string, parent, string);
|
|
610
|
+
boolean
|
|
611
|
+
- src / robot / pack / builder.ts;
|
|
612
|
+
isTypeSymbol(function () { })(kind, RobotPackSymbolKind);
|
|
613
|
+
kind;
|
|
614
|
+
is;
|
|
615
|
+
"interface" | "type-alias" | "enum"
|
|
616
|
+
- src / robot / pack / builder.ts;
|
|
617
|
+
TypeRegistry.constructor(function () { })(checker, TypeChecker, rootDir, string, candidateFiles, (Set));
|
|
618
|
+
TypeRegistry
|
|
619
|
+
- src / robot / pack / builder.ts;
|
|
620
|
+
TypeRegistry.ensureTypeDeclaration(function () { })(symbol, Symbol, declaration, Declaration);
|
|
621
|
+
string | undefined
|
|
622
|
+
- src / robot / pack / builder.ts;
|
|
623
|
+
TypeRegistry.collectDependenciesForType(function () { })(key, string, symbol, Symbol, declaration, Declaration);
|
|
624
|
+
string[]
|
|
625
|
+
- src / robot / pack / builder.ts;
|
|
626
|
+
TypeRegistry.collectDependenciesForSymbol(function () { })(record, PublicSymbolRecord);
|
|
627
|
+
string[]
|
|
628
|
+
- src / robot / pack / builder.ts;
|
|
629
|
+
TypeRegistry.buildDefinitions(function () { })();
|
|
630
|
+
{
|
|
631
|
+
name: string;
|
|
632
|
+
kind: "interface" | "type-alias" | "enum";
|
|
633
|
+
text: string;
|
|
634
|
+
}
|
|
635
|
+
[]
|
|
636
|
+
- src / robot / pack / builder.ts;
|
|
637
|
+
TypeRegistry.dropNextDependency(function () { })();
|
|
638
|
+
boolean
|
|
639
|
+
- src / robot / pack / builder.ts;
|
|
640
|
+
TypeRegistry.ensureEntry(function () { });
|
|
641
|
+
private(symbol, Symbol, declaration, Declaration, isSurface, boolean);
|
|
642
|
+
string | undefined
|
|
643
|
+
- src / robot / pack / builder.ts;
|
|
644
|
+
TypeRegistry.traverseType(function () { });
|
|
645
|
+
private(type, Type | undefined, ownerKey, string | undefined, dependencyNames, (Set), visited, (Set));
|
|
646
|
+
void -src / robot / pack / builder.ts;
|
|
647
|
+
TypeRegistry.traverseSignature(function () { });
|
|
648
|
+
private(signature, Signature, ownerKey, string | undefined, dependencyNames, (Set), visited, (Set));
|
|
649
|
+
void -src / robot / pack / builder.ts;
|
|
650
|
+
TypeRegistry.getTypeId(function () { });
|
|
651
|
+
private(type, Type);
|
|
652
|
+
number | undefined
|
|
653
|
+
- src / robot / pack / builder.ts;
|
|
654
|
+
TypeRegistry.isCandidateDeclaration(function () { });
|
|
655
|
+
private(declaration, Declaration);
|
|
656
|
+
boolean
|
|
657
|
+
- src / robot / pack / builder.ts;
|
|
658
|
+
TypeRegistry.determineDeclarationKind(function () { });
|
|
659
|
+
private(declaration, Declaration);
|
|
660
|
+
"interface" | "type-alias" | "enum" | undefined
|
|
661
|
+
- src / robot / pack / builder.ts;
|
|
662
|
+
TypeRegistry.buildTypeKey(function () { });
|
|
663
|
+
private(symbol, Symbol, declaration, Declaration);
|
|
664
|
+
string
|
|
665
|
+
- src / robot / pack / builder.ts;
|
|
666
|
+
TypeRegistry.orderEntries(function () { });
|
|
667
|
+
private();
|
|
668
|
+
TypeEntry[]
|
|
669
|
+
- src / robot / pack / builder.ts;
|
|
670
|
+
TypeRegistry.computeDepths(function () { });
|
|
671
|
+
private();
|
|
672
|
+
void -src / robot / pack / builder.ts;
|
|
673
|
+
TypeRegistry.ensureDepths(function () { });
|
|
674
|
+
private();
|
|
675
|
+
void -src / robot / pack / builder.ts;
|
|
676
|
+
TypeRegistry.getDependencyCandidates(function () { });
|
|
677
|
+
private();
|
|
678
|
+
TypeEntry[]
|
|
679
|
+
- src / robot / pack / builder.ts;
|
|
680
|
+
TypeRegistry.sortedArray(function () { });
|
|
681
|
+
private(set, (Set));
|
|
682
|
+
string[]
|
|
683
|
+
- src / robot / pack / builder.ts;
|
|
684
|
+
buildExemplarCandidates(function () { })(symbols, (Map), candidates, CandidateInfo[], settings, RobotPackSettings);
|
|
685
|
+
{
|
|
686
|
+
record: PublicSymbolRecord;
|
|
687
|
+
score: number;
|
|
688
|
+
body: string;
|
|
689
|
+
}
|
|
690
|
+
[]
|
|
691
|
+
- src / robot / pack / builder.ts;
|
|
692
|
+
selectExemplars(function () { })(candidates, { record: PublicSymbolRecord, score: number, body: string }[], settings, RobotPackSettings);
|
|
693
|
+
ExemplarRecord[]
|
|
694
|
+
- src / robot / pack / builder.ts;
|
|
695
|
+
escapeRegExp(function () { })(value, string);
|
|
696
|
+
string
|
|
697
|
+
- src / robot / pack / builder.ts;
|
|
698
|
+
minifyImplementation(function () { })(text, string, keepTags, (Set));
|
|
699
|
+
string
|
|
700
|
+
- src / robot / pack / builder.ts;
|
|
701
|
+
stripComments(function () { })(source, string, keepTags, string[]);
|
|
702
|
+
string
|
|
703
|
+
- src / robot / pack / builder.ts;
|
|
704
|
+
estimateComplexity(function () { })(node, Node);
|
|
705
|
+
number
|
|
706
|
+
- src / robot / pack / builder.ts;
|
|
707
|
+
estimateFanIn(function () { })(name, string, candidates, CandidateInfo[]);
|
|
708
|
+
number
|
|
709
|
+
- src / robot / pack / builder.ts;
|
|
710
|
+
computeExemplarScore(function () { })(fanIn, number, complexity, number, annotationBoost, number, bodySize, number, heuristics, ExemplarHeuristicWeights);
|
|
711
|
+
number
|
|
712
|
+
- src / robot / pack / cli.ts;
|
|
713
|
+
runRobotPack(function () { })(settings, RobotPackSettings, exportMode, ExportMode);
|
|
714
|
+
Promise < void >
|
|
715
|
+
-src / robot / coordinator.ts;
|
|
716
|
+
runRobot(function () { })();
|
|
717
|
+
Promise < void >
|
|
718
|
+
-src / robot / coordinator.ts;
|
|
719
|
+
robotSettingsSummary(function () { })(settings, RobotPackSettings);
|
|
720
|
+
string;
|
|
721
|
+
EXEMPLARS:
|
|
722
|
+
// TypeRegistry (class) [score=18.64]
|
|
723
|
+
class TypeRegistry {
|
|
724
|
+
checker;
|
|
725
|
+
rootDir;
|
|
726
|
+
candidateFiles;
|
|
727
|
+
entries = new Map();
|
|
728
|
+
depthDirty = true;
|
|
729
|
+
constructor(checker, rootDir, candidateFiles) {
|
|
730
|
+
this.checker = checker;
|
|
731
|
+
this.rootDir = rootDir;
|
|
732
|
+
this.candidateFiles = candidateFiles;
|
|
733
|
+
}
|
|
734
|
+
ensureTypeDeclaration(symbol, declaration) {
|
|
735
|
+
return this.ensureEntry(symbol, declaration, true);
|
|
736
|
+
}
|
|
737
|
+
collectDependenciesForType(key, symbol, declaration) {
|
|
738
|
+
const dependencies = new Set();
|
|
739
|
+
const declaredType = this.checker.getDeclaredTypeOfSymbol(symbol);
|
|
740
|
+
if (declaredType) {
|
|
741
|
+
this.traverseType(declaredType, key, dependencies, new Set());
|
|
742
|
+
}
|
|
743
|
+
return this.sortedArray(dependencies);
|
|
744
|
+
}
|
|
745
|
+
collectDependenciesForSymbol(record) {
|
|
746
|
+
const dependencies = new Set();
|
|
747
|
+
const type = this.checker.getTypeOfSymbolAtLocation(record.symbol, record.declaration);
|
|
748
|
+
if (record.summary.kind === 'function') {
|
|
749
|
+
const signatures = this.checker.getSignaturesOfType(type, ts.SignatureKind.Call);
|
|
750
|
+
for (const signature of signatures) {
|
|
751
|
+
this.traverseSignature(signature, undefined, dependencies, new Set());
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
else {
|
|
755
|
+
this.traverseType(type, undefined, dependencies, new Set());
|
|
756
|
+
}
|
|
757
|
+
return this.sortedArray(dependencies);
|
|
758
|
+
}
|
|
759
|
+
buildDefinitions() {
|
|
760
|
+
const ordered = this.orderEntries();
|
|
761
|
+
return ordered.map((entry) => ({
|
|
762
|
+
name: entry.name,
|
|
763
|
+
kind: entry.kind,
|
|
764
|
+
text: entry.text,
|
|
765
|
+
}));
|
|
766
|
+
}
|
|
767
|
+
dropNextDependency() {
|
|
768
|
+
const candidates = this.getDependencyCandidates();
|
|
769
|
+
if (!candidates.length)
|
|
770
|
+
return false;
|
|
771
|
+
const target = candidates[0];
|
|
772
|
+
this.entries.delete(target.key);
|
|
773
|
+
for (const entry of this.entries.values()) {
|
|
774
|
+
entry.dependencies.delete(target.key);
|
|
775
|
+
}
|
|
776
|
+
this.depthDirty = true;
|
|
777
|
+
return true;
|
|
778
|
+
}
|
|
779
|
+
ensureEntry(symbol, declaration, isSurface) {
|
|
780
|
+
if (!this.isCandidateDeclaration(declaration))
|
|
781
|
+
return undefined;
|
|
782
|
+
const kind = this.determineDeclarationKind(declaration);
|
|
783
|
+
if (!kind)
|
|
784
|
+
return undefined;
|
|
785
|
+
const key = this.buildTypeKey(symbol, declaration);
|
|
786
|
+
let entry = this.entries.get(key);
|
|
787
|
+
if (!entry) {
|
|
788
|
+
entry = {
|
|
789
|
+
key,
|
|
790
|
+
name: symbol.getName(),
|
|
791
|
+
kind,
|
|
792
|
+
text: normalizeTypeText(PRINTER.printNode(ts.EmitHint.Unspecified, declaration, declaration.getSourceFile())),
|
|
793
|
+
sourcePath: normalizeRelativePath(path.relative(this.rootDir, declaration.getSourceFile().fileName)),
|
|
794
|
+
dependencies: new Set(),
|
|
795
|
+
isSurface,
|
|
796
|
+
};
|
|
797
|
+
this.entries.set(key, entry);
|
|
798
|
+
}
|
|
799
|
+
else if (isSurface) {
|
|
800
|
+
entry.isSurface = true;
|
|
801
|
+
}
|
|
802
|
+
this.depthDirty = true;
|
|
803
|
+
return entry.key;
|
|
804
|
+
}
|
|
805
|
+
traverseType(type, ownerKey, dependencyNames, visited) {
|
|
806
|
+
if (!type)
|
|
807
|
+
return;
|
|
808
|
+
const typeId = this.getTypeId(type);
|
|
809
|
+
if (typeId !== undefined && visited.has(typeId))
|
|
810
|
+
return;
|
|
811
|
+
if (typeId !== undefined)
|
|
812
|
+
visited.add(typeId);
|
|
813
|
+
const referencedSymbol = type.aliasSymbol ?? type.getSymbol();
|
|
814
|
+
if (referencedSymbol) {
|
|
815
|
+
const declaration = referencedSymbol.valueDeclaration ?? referencedSymbol.declarations?.[0];
|
|
816
|
+
if (declaration) {
|
|
817
|
+
const childKey = this.ensureEntry(referencedSymbol, declaration, false);
|
|
818
|
+
if (childKey && ownerKey && ownerKey !== childKey) {
|
|
819
|
+
this.entries.get(ownerKey)?.dependencies.add(childKey);
|
|
820
|
+
}
|
|
821
|
+
if (childKey) {
|
|
822
|
+
dependencyNames.add(this.entries.get(childKey).name);
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
if (type.isUnionOrIntersection()) {
|
|
827
|
+
for (const part of type.types) {
|
|
828
|
+
this.traverseType(part, ownerKey, dependencyNames, visited);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
const reference = type;
|
|
832
|
+
const typeArguments = reference.typeArguments ?? type.aliasTypeArguments;
|
|
833
|
+
if (typeArguments) {
|
|
834
|
+
for (const arg of typeArguments) {
|
|
835
|
+
this.traverseType(arg, ownerKey, dependencyNames, visited);
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
if (reference.target) {
|
|
839
|
+
this.traverseType(reference.target, ownerKey, dependencyNames, visited);
|
|
840
|
+
}
|
|
841
|
+
for (const signature of type.getCallSignatures()) {
|
|
842
|
+
this.traverseSignature(signature, ownerKey, dependencyNames, visited);
|
|
843
|
+
}
|
|
844
|
+
for (const signature of type.getConstructSignatures()) {
|
|
845
|
+
this.traverseSignature(signature, ownerKey, dependencyNames, visited);
|
|
846
|
+
}
|
|
847
|
+
const properties = type.getProperties();
|
|
848
|
+
for (const property of properties) {
|
|
849
|
+
const decl = property.valueDeclaration ?? property.declarations?.[0];
|
|
850
|
+
if (!decl)
|
|
851
|
+
continue;
|
|
852
|
+
const propType = this.checker.getTypeAtLocation(decl);
|
|
853
|
+
this.traverseType(propType, ownerKey, dependencyNames, visited);
|
|
854
|
+
}
|
|
855
|
+
const stringIndex = type.getStringIndexType();
|
|
856
|
+
if (stringIndex)
|
|
857
|
+
this.traverseType(stringIndex, ownerKey, dependencyNames, visited);
|
|
858
|
+
const numberIndex = type.getNumberIndexType();
|
|
859
|
+
if (numberIndex)
|
|
860
|
+
this.traverseType(numberIndex, ownerKey, dependencyNames, visited);
|
|
861
|
+
for (const base of type.getBaseTypes() ?? []) {
|
|
862
|
+
this.traverseType(base, ownerKey, dependencyNames, visited);
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
traverseSignature(signature, ownerKey, dependencyNames, visited) {
|
|
866
|
+
this.traverseType(signature.getReturnType(), ownerKey, dependencyNames, visited);
|
|
867
|
+
for (const parameter of signature.getParameters()) {
|
|
868
|
+
const decl = parameter.valueDeclaration ?? parameter.declarations?.[0];
|
|
869
|
+
if (!decl)
|
|
870
|
+
continue;
|
|
871
|
+
this.traverseType(this.checker.getTypeAtLocation(decl), ownerKey, dependencyNames, visited);
|
|
872
|
+
}
|
|
873
|
+
for (const typeParam of signature.typeParameters ?? []) {
|
|
874
|
+
const constraint = typeParam.getConstraint();
|
|
875
|
+
if (constraint) {
|
|
876
|
+
this.traverseType(constraint, ownerKey, dependencyNames, visited);
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
getTypeId(type) {
|
|
881
|
+
return type.id;
|
|
882
|
+
}
|
|
883
|
+
isCandidateDeclaration(declaration) {
|
|
884
|
+
const file = path.resolve(declaration.getSourceFile().fileName);
|
|
885
|
+
return this.candidateFiles.has(file);
|
|
886
|
+
}
|
|
887
|
+
determineDeclarationKind(declaration) {
|
|
888
|
+
if (ts.isInterfaceDeclaration(declaration))
|
|
889
|
+
return 'interface';
|
|
890
|
+
if (ts.isTypeAliasDeclaration(declaration))
|
|
891
|
+
return 'type-alias';
|
|
892
|
+
if (ts.isEnumDeclaration(declaration))
|
|
893
|
+
return 'enum';
|
|
894
|
+
return undefined;
|
|
895
|
+
}
|
|
896
|
+
buildTypeKey(symbol, declaration) {
|
|
897
|
+
const relative = normalizeRelativePath(path.relative(this.rootDir, declaration.getSourceFile().fileName));
|
|
898
|
+
return `${symbol.getName()}@${relative}:${declaration.getStart()}`;
|
|
899
|
+
}
|
|
900
|
+
orderEntries() {
|
|
901
|
+
const dependencyCounts = new Map();
|
|
902
|
+
const dependents = new Map();
|
|
903
|
+
for (const entry of this.entries.values()) {
|
|
904
|
+
const filtered = Array.from(entry.dependencies).filter((dep) => this.entries.has(dep));
|
|
905
|
+
dependencyCounts.set(entry.key, filtered.length);
|
|
906
|
+
for (const dep of filtered) {
|
|
907
|
+
const parents = dependents.get(dep) ?? new Set();
|
|
908
|
+
parents.add(entry.key);
|
|
909
|
+
dependents.set(dep, parents);
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
const compare = (a, b) => {
|
|
913
|
+
if (a.name !== b.name)
|
|
914
|
+
return a.name.localeCompare(b.name);
|
|
915
|
+
return a.sourcePath.localeCompare(b.sourcePath);
|
|
916
|
+
};
|
|
917
|
+
const available = Array.from(this.entries.values()).filter((entry) => (dependencyCounts.get(entry.key) ?? 0) === 0);
|
|
918
|
+
available.sort(compare);
|
|
919
|
+
const ordered = [];
|
|
920
|
+
const processed = new Set();
|
|
921
|
+
while (available.length > 0) {
|
|
922
|
+
const current = available.shift();
|
|
923
|
+
ordered.push(current);
|
|
924
|
+
processed.add(current.key);
|
|
925
|
+
const children = dependents.get(current.key);
|
|
926
|
+
if (children) {
|
|
927
|
+
for (const childKey of Array.from(children)) {
|
|
928
|
+
const count = (dependencyCounts.get(childKey) ?? 0) - 1;
|
|
929
|
+
dependencyCounts.set(childKey, count);
|
|
930
|
+
if (count <= 0 && !processed.has(childKey)) {
|
|
931
|
+
const child = this.entries.get(childKey);
|
|
932
|
+
if (child) {
|
|
933
|
+
available.push(child);
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
dependents.delete(current.key);
|
|
938
|
+
}
|
|
939
|
+
available.sort(compare);
|
|
940
|
+
}
|
|
941
|
+
if (ordered.length < this.entries.size) {
|
|
942
|
+
const remaining = Array.from(this.entries.values()).filter((entry) => !processed.has(entry.key));
|
|
943
|
+
remaining.sort(compare);
|
|
944
|
+
ordered.push(...remaining);
|
|
945
|
+
}
|
|
946
|
+
return ordered;
|
|
947
|
+
}
|
|
948
|
+
computeDepths() {
|
|
949
|
+
const surfaceKeys = new Set();
|
|
950
|
+
for (const entry of this.entries.values()) {
|
|
951
|
+
if (entry.isSurface)
|
|
952
|
+
surfaceKeys.add(entry.key);
|
|
953
|
+
}
|
|
954
|
+
for (const entry of this.entries.values()) {
|
|
955
|
+
entry.depth = undefined;
|
|
956
|
+
}
|
|
957
|
+
const queue = [];
|
|
958
|
+
for (const key of surfaceKeys) {
|
|
959
|
+
const entry = this.entries.get(key);
|
|
960
|
+
if (entry) {
|
|
961
|
+
entry.depth = 0;
|
|
962
|
+
queue.push(key);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
while (queue.length) {
|
|
966
|
+
const parentKey = queue.shift();
|
|
967
|
+
const parent = this.entries.get(parentKey);
|
|
968
|
+
if (!parent)
|
|
969
|
+
continue;
|
|
970
|
+
for (const dependencyKey of parent.dependencies) {
|
|
971
|
+
const child = this.entries.get(dependencyKey);
|
|
972
|
+
if (!child)
|
|
973
|
+
continue;
|
|
974
|
+
const depthCandidate = (parent.depth ?? 0) + 1;
|
|
975
|
+
if (child.depth === undefined || depthCandidate < child.depth) {
|
|
976
|
+
child.depth = depthCandidate;
|
|
977
|
+
queue.push(child.key);
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
this.depthDirty = false;
|
|
982
|
+
}
|
|
983
|
+
ensureDepths() {
|
|
984
|
+
if (this.depthDirty) {
|
|
985
|
+
this.computeDepths();
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
getDependencyCandidates() {
|
|
989
|
+
this.ensureDepths();
|
|
990
|
+
const candidates = Array.from(this.entries.values()).filter((entry) => !entry.isSurface);
|
|
991
|
+
candidates.sort((a, b) => {
|
|
992
|
+
const depthDiff = (b.depth ?? 0) - (a.depth ?? 0);
|
|
993
|
+
if (depthDiff !== 0)
|
|
994
|
+
return depthDiff;
|
|
995
|
+
if (a.name !== b.name)
|
|
996
|
+
return a.name.localeCompare(b.name);
|
|
997
|
+
return a.sourcePath.localeCompare(b.sourcePath);
|
|
998
|
+
});
|
|
999
|
+
return candidates;
|
|
1000
|
+
}
|
|
1001
|
+
sortedArray(set) {
|
|
1002
|
+
return Array.from(set).sort();
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
// parseInteractiveValue (function) [score=6.04]
|
|
1006
|
+
export function parseInteractiveValue(descriptor, buffer) {
|
|
1007
|
+
const trimmed = buffer.trim();
|
|
1008
|
+
if (!trimmed) {
|
|
1009
|
+
if (descriptor.allowEmpty) {
|
|
1010
|
+
return { value: undefined };
|
|
1011
|
+
}
|
|
1012
|
+
return { value: undefined };
|
|
1013
|
+
}
|
|
1014
|
+
switch (descriptor.type) {
|
|
1015
|
+
case 'list':
|
|
1016
|
+
if (descriptor.key === 'includeKinds') {
|
|
1017
|
+
return parseKindsInput(trimmed);
|
|
1018
|
+
}
|
|
1019
|
+
return { value: parseStringList(trimmed) };
|
|
1020
|
+
case 'choice':
|
|
1021
|
+
if (!descriptor.options)
|
|
1022
|
+
return { value: undefined };
|
|
1023
|
+
if (!descriptor.options.includes(trimmed)) {
|
|
1024
|
+
return { error: `Choose one of: ${descriptor.options.join(', ')}.` };
|
|
1025
|
+
}
|
|
1026
|
+
return { value: trimmed };
|
|
1027
|
+
case 'number':
|
|
1028
|
+
if (descriptor.allowEmpty && trimmed === '') {
|
|
1029
|
+
return { value: undefined };
|
|
1030
|
+
}
|
|
1031
|
+
const parsed = parsePositiveInteger(trimmed);
|
|
1032
|
+
if (parsed === undefined) {
|
|
1033
|
+
return { error: `${descriptor.label} requires a positive integer.` };
|
|
1034
|
+
}
|
|
1035
|
+
return { value: parsed };
|
|
1036
|
+
case 'boolean': {
|
|
1037
|
+
const parsedBool = parseBooleanInput(trimmed);
|
|
1038
|
+
if (parsedBool.error)
|
|
1039
|
+
return { error: parsedBool.error };
|
|
1040
|
+
return { value: parsedBool.value };
|
|
1041
|
+
}
|
|
1042
|
+
default:
|
|
1043
|
+
return { value: undefined };
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
// buildClassSignature (function) [score=5.21]
|
|
1047
|
+
function buildClassSignature(declaration, checker) {
|
|
1048
|
+
if (!ts.isClassLike(declaration))
|
|
1049
|
+
return declaration.getText();
|
|
1050
|
+
const name = declaration.name?.getText() ?? 'Anonymous';
|
|
1051
|
+
const heritage = declaration.heritageClauses
|
|
1052
|
+
? declaration.heritageClauses
|
|
1053
|
+
.map((clause) => clause.getText())
|
|
1054
|
+
.join(' ')
|
|
1055
|
+
.trim()
|
|
1056
|
+
: '';
|
|
1057
|
+
const header = `export declare class ${name}${heritage ? ` ${heritage}` : ''}`;
|
|
1058
|
+
const memberParts = [];
|
|
1059
|
+
for (const member of declaration.members) {
|
|
1060
|
+
if (ts.isConstructorDeclaration(member)) {
|
|
1061
|
+
memberParts.push(`constructor(${formatParameters(member.parameters, checker)})`);
|
|
1062
|
+
continue;
|
|
1063
|
+
}
|
|
1064
|
+
if (ts.isMethodDeclaration(member) || ts.isMethodSignature(member)) {
|
|
1065
|
+
const memberName = member.name?.getText() ?? 'anonymous';
|
|
1066
|
+
const signature = checker.getSignatureFromDeclaration(member);
|
|
1067
|
+
const text = signature
|
|
1068
|
+
? checker.signatureToString(signature)
|
|
1069
|
+
: `${memberName}()`;
|
|
1070
|
+
memberParts.push(`${memberName}${text.slice(memberName.length)}`);
|
|
1071
|
+
continue;
|
|
1072
|
+
}
|
|
1073
|
+
if (ts.isPropertyDeclaration(member) || ts.isPropertySignature(member)) {
|
|
1074
|
+
const nameText = member.name?.getText() ?? '';
|
|
1075
|
+
const type = member.type
|
|
1076
|
+
? checker.getTypeAtLocation(member.type)
|
|
1077
|
+
: checker.getTypeAtLocation(member);
|
|
1078
|
+
const typeText = checker.typeToString(type);
|
|
1079
|
+
const optional = member.questionToken ? '?' : '';
|
|
1080
|
+
memberParts.push(`${nameText}${optional}: ${typeText}`);
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
const body = memberParts.length ? ` { ${memberParts.join('; ')} }` : ' {}';
|
|
1084
|
+
return `${header}${body}`;
|
|
1085
|
+
}
|
|
1086
|
+
// normalizeSettings (function) [score=4.98]
|
|
1087
|
+
function normalizeSettings(options) {
|
|
1088
|
+
const defaults = ROBOT_PACK_DEFAULT_SETTINGS;
|
|
1089
|
+
const rootDir = path.resolve(options.rootDir);
|
|
1090
|
+
const candidateScope = options.scopeDir
|
|
1091
|
+
? path.resolve(rootDir, options.scopeDir)
|
|
1092
|
+
: rootDir;
|
|
1093
|
+
const scopeDir = isPathInside(candidateScope, rootDir) ? candidateScope : rootDir;
|
|
1094
|
+
return {
|
|
1095
|
+
reportMethod: options.reportMethod ?? defaults.reportMethod,
|
|
1096
|
+
rootDir,
|
|
1097
|
+
scopeDir,
|
|
1098
|
+
tsconfigPath: options.tsconfigPath,
|
|
1099
|
+
includeGlobs: options.includeGlobs && options.includeGlobs.length > 0
|
|
1100
|
+
? [...options.includeGlobs]
|
|
1101
|
+
: [...defaults.includeGlobs],
|
|
1102
|
+
excludeGlobs: options.excludeGlobs && options.excludeGlobs.length > 0
|
|
1103
|
+
? [...options.excludeGlobs]
|
|
1104
|
+
: [...defaults.excludeGlobs],
|
|
1105
|
+
entrypoints: options.entrypoints && options.entrypoints.length > 0
|
|
1106
|
+
? [...options.entrypoints]
|
|
1107
|
+
: [...defaults.entrypoints],
|
|
1108
|
+
exportMode: options.exportMode ?? defaults.exportMode,
|
|
1109
|
+
visibility: options.visibility ?? defaults.visibility,
|
|
1110
|
+
includeKinds: options.includeKinds && options.includeKinds.length > 0
|
|
1111
|
+
? [...options.includeKinds]
|
|
1112
|
+
: [...defaults.includeKinds],
|
|
1113
|
+
closure: options.closure ?? defaults.closure,
|
|
1114
|
+
maxExemplars: options.maxExemplars ?? defaults.maxExemplars,
|
|
1115
|
+
tokenBudget: options.tokenBudget ?? defaults.tokenBudget,
|
|
1116
|
+
preferTypeSurface: options.preferTypeSurface ?? defaults.preferTypeSurface,
|
|
1117
|
+
exemplarHeuristics: {
|
|
1118
|
+
...defaults.exemplarHeuristics,
|
|
1119
|
+
...(options.exemplarHeuristics ?? {}),
|
|
1120
|
+
},
|
|
1121
|
+
keepJSDocTags: (options.keepJSDocTags && options.keepJSDocTags.length > 0
|
|
1122
|
+
? options.keepJSDocTags
|
|
1123
|
+
: defaults.keepJSDocTags).map((tag) => ensureTagPrefix(tag)),
|
|
1124
|
+
};
|
|
1125
|
+
}
|
|
1126
|
+
// includeLocalDeclarations (function) [score=4.89]
|
|
1127
|
+
function includeLocalDeclarations(symbols, moduleInfo, exposures, checker, settings) {
|
|
1128
|
+
for (const stmt of moduleInfo.sourceFile.statements) {
|
|
1129
|
+
const candidates = [];
|
|
1130
|
+
if (ts.isFunctionDeclaration(stmt) ||
|
|
1131
|
+
ts.isClassDeclaration(stmt) ||
|
|
1132
|
+
ts.isInterfaceDeclaration(stmt) ||
|
|
1133
|
+
ts.isTypeAliasDeclaration(stmt) ||
|
|
1134
|
+
ts.isEnumDeclaration(stmt)) {
|
|
1135
|
+
const symbol = stmt.name ? checker.getSymbolAtLocation(stmt.name) : undefined;
|
|
1136
|
+
if (symbol)
|
|
1137
|
+
candidates.push(symbol);
|
|
1138
|
+
}
|
|
1139
|
+
if (ts.isVariableStatement(stmt)) {
|
|
1140
|
+
for (const declaration of stmt.declarationList.declarations) {
|
|
1141
|
+
const symbol = declaration.name
|
|
1142
|
+
? checker.getSymbolAtLocation(declaration.name)
|
|
1143
|
+
: undefined;
|
|
1144
|
+
if (symbol)
|
|
1145
|
+
candidates.push(symbol);
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
for (const candidate of candidates) {
|
|
1149
|
+
handleSymbol(symbols, candidate, exposures, moduleInfo, checker, settings, false);
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
// formatValue (function) [score=4.82]
|
|
1154
|
+
export function formatValue(value, descriptor) {
|
|
1155
|
+
if (descriptor.type === 'boolean') {
|
|
1156
|
+
return value ? 'true' : 'false';
|
|
1157
|
+
}
|
|
1158
|
+
if (descriptor.type === 'list') {
|
|
1159
|
+
const items = value;
|
|
1160
|
+
if (!items.length)
|
|
1161
|
+
return 'none';
|
|
1162
|
+
return items.join(', ');
|
|
1163
|
+
}
|
|
1164
|
+
if (descriptor.type === 'choice') {
|
|
1165
|
+
return `${value}`;
|
|
1166
|
+
}
|
|
1167
|
+
if (descriptor.type === 'number') {
|
|
1168
|
+
if (descriptor.key === 'tokenBudget' && value === undefined) {
|
|
1169
|
+
return 'unlimited';
|
|
1170
|
+
}
|
|
1171
|
+
return `${value}`;
|
|
1172
|
+
}
|
|
1173
|
+
return `${value}`;
|
|
1174
|
+
}
|
|
1175
|
+
// parseKindsInput (function) [score=4.04]
|
|
1176
|
+
export function parseKindsInput(raw) {
|
|
1177
|
+
const normalized = raw
|
|
1178
|
+
.split(',')
|
|
1179
|
+
.map((chunk) => chunk.trim().toLowerCase())
|
|
1180
|
+
.filter(Boolean);
|
|
1181
|
+
if (!normalized.length) {
|
|
1182
|
+
return { error: 'Enter at least one kind or "all".' };
|
|
1183
|
+
}
|
|
1184
|
+
if (normalized.length === 1 && normalized[0] === 'all') {
|
|
1185
|
+
return { value: [...ROBOT_PACK_SYMBOL_KINDS] };
|
|
1186
|
+
}
|
|
1187
|
+
const invalid = [];
|
|
1188
|
+
const unique = [];
|
|
1189
|
+
const seen = new Set();
|
|
1190
|
+
for (const entry of normalized) {
|
|
1191
|
+
if (!ROBOT_PACK_SYMBOL_KINDS.includes(entry)) {
|
|
1192
|
+
invalid.push(entry);
|
|
1193
|
+
continue;
|
|
1194
|
+
}
|
|
1195
|
+
const kind = entry;
|
|
1196
|
+
if (!seen.has(kind)) {
|
|
1197
|
+
seen.add(kind);
|
|
1198
|
+
unique.push(kind);
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
if (invalid.length > 0) {
|
|
1202
|
+
return {
|
|
1203
|
+
error: `Unknown kinds: ${invalid.join(', ')}. Valid kinds are ${ROBOT_PACK_SYMBOL_KINDS.join(', ')}.`,
|
|
1204
|
+
};
|
|
1205
|
+
}
|
|
1206
|
+
if (!unique.length) {
|
|
1207
|
+
return { error: 'Provide at least one valid kind.' };
|
|
1208
|
+
}
|
|
1209
|
+
return { value: unique };
|
|
1210
|
+
}
|
|
1211
|
+
// validateRobotSettings (function) [score=3.93]
|
|
1212
|
+
export function validateRobotSettings(settings) {
|
|
1213
|
+
if (!settings.includeGlobs.length)
|
|
1214
|
+
return 'Specify at least one include glob.';
|
|
1215
|
+
if (!settings.entrypoints.length)
|
|
1216
|
+
return 'Specify at least one entrypoint pattern.';
|
|
1217
|
+
if (!settings.includeKinds.length)
|
|
1218
|
+
return 'Choose at least one kind to include.';
|
|
1219
|
+
if (!Number.isFinite(settings.maxExemplars) || settings.maxExemplars <= 0) {
|
|
1220
|
+
return 'Maximum exemplars must be a positive number.';
|
|
1221
|
+
}
|
|
1222
|
+
if (settings.tokenBudget !== undefined && settings.tokenBudget <= 0) {
|
|
1223
|
+
return 'Token budget must be greater than zero or blank for unlimited.';
|
|
1224
|
+
}
|
|
1225
|
+
return undefined;
|
|
1226
|
+
}
|