@tokenroll/llmdoc 3.5.3 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/assets/viewer-app.js +11 -11
  2. package/assets/viewer-detail.js +4 -4
  3. package/assets/viewer-graph.js +3 -3
  4. package/assets/viewer.html +19 -19
  5. package/dist/cli.js +147 -71
  6. package/dist/commands/adopt.js +10 -6
  7. package/dist/commands/commit.js +232 -80
  8. package/dist/commands/context.js +85 -45
  9. package/dist/commands/dream.js +608 -0
  10. package/dist/commands/eval.js +379 -0
  11. package/dist/commands/fingerprint.js +9 -3
  12. package/dist/commands/hook.js +135 -28
  13. package/dist/commands/index.js +52 -7
  14. package/dist/commands/init-state.js +5 -5
  15. package/dist/commands/mv.js +33 -12
  16. package/dist/commands/new.js +12 -5
  17. package/dist/commands/prune.js +14 -3
  18. package/dist/commands/search.js +67 -4
  19. package/dist/commands/serve.js +1 -1
  20. package/dist/commands/show.js +40 -6
  21. package/dist/commands/status.js +46 -18
  22. package/dist/commands/tree.js +94 -6
  23. package/dist/commands/upgrade.js +15 -15
  24. package/dist/lib/config.js +502 -0
  25. package/dist/lib/constants.js +23 -0
  26. package/dist/lib/doc-shape.js +5 -5
  27. package/dist/lib/frontmatter.js +47 -0
  28. package/dist/lib/fs.js +8 -8
  29. package/dist/lib/git.js +147 -42
  30. package/dist/lib/markdown.js +8 -7
  31. package/dist/lib/output-schema.js +3 -3
  32. package/dist/lib/package-root.js +1 -1
  33. package/dist/lib/pagination.js +2 -2
  34. package/dist/lib/rewrite.js +9 -3
  35. package/dist/lib/routing.js +152 -0
  36. package/dist/lib/schema.js +16 -0
  37. package/dist/lib/search.js +35 -16
  38. package/dist/lib/source-id.js +49 -0
  39. package/dist/lib/sources.js +760 -0
  40. package/dist/lib/state.js +74 -25
  41. package/dist/lib/telemetry.js +726 -0
  42. package/dist/lib/viewer-http.js +2 -2
  43. package/dist/lib/workspace.js +187 -43
  44. package/package.json +1 -1
  45. package/schemas/config.schema.json +116 -0
  46. package/schemas/meta.schema.json +5 -1
  47. package/schemas/output.schema.json +442 -0
  48. package/schemas/probes.schema.json +90 -0
@@ -67,6 +67,97 @@
67
67
  "description": {
68
68
  "type": "string",
69
69
  "minLength": 1
70
+ },
71
+ "source": {
72
+ "type": [
73
+ "string",
74
+ "null"
75
+ ]
76
+ }
77
+ }
78
+ },
79
+ "sourceSummary": {
80
+ "type": "object",
81
+ "additionalProperties": false,
82
+ "required": [
83
+ "name",
84
+ "kind",
85
+ "target",
86
+ "status",
87
+ "documentCount"
88
+ ],
89
+ "properties": {
90
+ "name": {
91
+ "type": "string",
92
+ "minLength": 1
93
+ },
94
+ "kind": {
95
+ "type": "string",
96
+ "enum": [
97
+ "git",
98
+ "path"
99
+ ]
100
+ },
101
+ "target": {
102
+ "type": "string",
103
+ "minLength": 1
104
+ },
105
+ "ref": {
106
+ "type": [
107
+ "string",
108
+ "null"
109
+ ]
110
+ },
111
+ "dir": {
112
+ "type": [
113
+ "string",
114
+ "null"
115
+ ]
116
+ },
117
+ "status": {
118
+ "type": "string",
119
+ "enum": [
120
+ "ready",
121
+ "missing",
122
+ "error"
123
+ ]
124
+ },
125
+ "documentCount": {
126
+ "type": "integer",
127
+ "minimum": 0
128
+ },
129
+ "revision": {
130
+ "type": [
131
+ "string",
132
+ "null"
133
+ ]
134
+ },
135
+ "pinned": {
136
+ "type": "boolean"
137
+ },
138
+ "isSubmodule": {
139
+ "type": "boolean"
140
+ },
141
+ "lastSyncedAt": {
142
+ "type": [
143
+ "string",
144
+ "null"
145
+ ]
146
+ },
147
+ "stale": {
148
+ "type": "boolean"
149
+ },
150
+ "error": {
151
+ "type": [
152
+ "string",
153
+ "null"
154
+ ]
155
+ },
156
+ "remedy": {
157
+ "type": [
158
+ "string",
159
+ "null"
160
+ ]
70
161
  }
71
162
  }
72
163
  },
@@ -202,6 +293,12 @@
202
293
  }
203
294
  }
204
295
  },
296
+ "sources": {
297
+ "type": "array",
298
+ "items": {
299
+ "$ref": "#/$defs/sourceSummary"
300
+ }
301
+ },
205
302
  "pagination": {
206
303
  "$ref": "#/$defs/pagination"
207
304
  }
@@ -247,10 +344,22 @@
247
344
  "string",
248
345
  "null"
249
346
  ]
347
+ },
348
+ "source": {
349
+ "type": [
350
+ "string",
351
+ "null"
352
+ ]
250
353
  }
251
354
  }
252
355
  }
253
356
  },
357
+ "sources": {
358
+ "type": "array",
359
+ "items": {
360
+ "$ref": "#/$defs/sourceSummary"
361
+ }
362
+ },
254
363
  "pagination": {
255
364
  "$ref": "#/$defs/pagination"
256
365
  }
@@ -319,10 +428,23 @@
319
428
  }
320
429
  }
321
430
  }
431
+ },
432
+ "source": {
433
+ "type": [
434
+ "string",
435
+ "null"
436
+ ]
322
437
  }
323
438
  }
324
439
  }
325
440
  },
441
+ "warnings": {
442
+ "type": "array",
443
+ "items": {
444
+ "type": "string",
445
+ "minLength": 1
446
+ }
447
+ },
326
448
  "pagination": {
327
449
  "$ref": "#/$defs/pagination"
328
450
  }
@@ -360,6 +482,12 @@
360
482
  },
361
483
  "body": {
362
484
  "type": "string"
485
+ },
486
+ "source": {
487
+ "type": [
488
+ "string",
489
+ "null"
490
+ ]
363
491
  }
364
492
  }
365
493
  }
@@ -418,10 +546,23 @@
418
546
  },
419
547
  "score": {
420
548
  "type": "number"
549
+ },
550
+ "source": {
551
+ "type": [
552
+ "string",
553
+ "null"
554
+ ]
421
555
  }
422
556
  }
423
557
  }
424
558
  },
559
+ "warnings": {
560
+ "type": "array",
561
+ "items": {
562
+ "type": "string",
563
+ "minLength": 1
564
+ }
565
+ },
425
566
  "pagination": {
426
567
  "$ref": "#/$defs/pagination"
427
568
  }
@@ -449,6 +590,27 @@
449
590
  "$ref": "#/$defs/docRef"
450
591
  }
451
592
  },
593
+ "missingPrerequisites": {
594
+ "type": "array",
595
+ "items": {
596
+ "type": "object",
597
+ "additionalProperties": false,
598
+ "required": [
599
+ "path",
600
+ "reason"
601
+ ],
602
+ "properties": {
603
+ "path": {
604
+ "type": "string",
605
+ "minLength": 1
606
+ },
607
+ "reason": {
608
+ "type": "string",
609
+ "minLength": 1
610
+ }
611
+ }
612
+ }
613
+ },
452
614
  "unmappedFiles": {
453
615
  "type": "array",
454
616
  "items": {
@@ -456,6 +618,13 @@
456
618
  "minLength": 1
457
619
  }
458
620
  },
621
+ "warnings": {
622
+ "type": "array",
623
+ "items": {
624
+ "type": "string",
625
+ "minLength": 1
626
+ }
627
+ },
459
628
  "pagination": {
460
629
  "$ref": "#/$defs/pagination"
461
630
  }
@@ -587,6 +756,12 @@
587
756
  },
588
757
  "growth": {
589
758
  "$ref": "#/$defs/growth"
759
+ },
760
+ "sources": {
761
+ "type": "array",
762
+ "items": {
763
+ "$ref": "#/$defs/sourceSummary"
764
+ }
590
765
  }
591
766
  }
592
767
  },
@@ -727,6 +902,7 @@
727
902
  "status",
728
903
  "writable",
729
904
  "growth",
905
+ "startupPreloads",
730
906
  "duplicateCandidates",
731
907
  "mergeCandidates"
732
908
  ],
@@ -742,6 +918,13 @@
742
918
  "growth": {
743
919
  "$ref": "#/$defs/growth"
744
920
  },
921
+ "startupPreloads": {
922
+ "type": "array",
923
+ "items": {
924
+ "type": "string",
925
+ "minLength": 1
926
+ }
927
+ },
745
928
  "duplicateCandidates": {
746
929
  "type": "array",
747
930
  "items": {
@@ -912,6 +1095,7 @@
912
1095
  "additionalProperties": false,
913
1096
  "required": [
914
1097
  "moved",
1098
+ "rewrittenConfig",
915
1099
  "rewrittenDocuments"
916
1100
  ],
917
1101
  "properties": {
@@ -939,6 +1123,9 @@
939
1123
  "type": "string",
940
1124
  "minLength": 1
941
1125
  }
1126
+ },
1127
+ "rewrittenConfig": {
1128
+ "type": "boolean"
942
1129
  }
943
1130
  }
944
1131
  },
@@ -1018,6 +1205,261 @@
1018
1205
  },
1019
1206
  "baselineAdvanced": {
1020
1207
  "type": "boolean"
1208
+ },
1209
+ "convergenceRefreshed": {
1210
+ "type": "boolean"
1211
+ }
1212
+ }
1213
+ },
1214
+ "dream": {
1215
+ "type": "object",
1216
+ "additionalProperties": false,
1217
+ "required": [
1218
+ "status",
1219
+ "actionable",
1220
+ "writable",
1221
+ "windowDays",
1222
+ "staleDays",
1223
+ "hotThreshold",
1224
+ "telemetryEvents",
1225
+ "reasons",
1226
+ "hotStaleDocs",
1227
+ "reflectionClusters",
1228
+ "searchBlindSpots",
1229
+ "unmappedProbes",
1230
+ "preload",
1231
+ "borgesRiskDocs",
1232
+ "growth"
1233
+ ],
1234
+ "properties": {
1235
+ "status": {
1236
+ "type": "string",
1237
+ "enum": ["quiet", "actionable"]
1238
+ },
1239
+ "actionable": {
1240
+ "type": "boolean"
1241
+ },
1242
+ "writable": {
1243
+ "type": "boolean",
1244
+ "const": false
1245
+ },
1246
+ "windowDays": {
1247
+ "type": "integer",
1248
+ "minimum": 1
1249
+ },
1250
+ "staleDays": {
1251
+ "type": "integer",
1252
+ "minimum": 1
1253
+ },
1254
+ "hotThreshold": {
1255
+ "type": "integer",
1256
+ "minimum": 1
1257
+ },
1258
+ "telemetryEvents": {
1259
+ "type": "integer",
1260
+ "minimum": 0
1261
+ },
1262
+ "reasons": {
1263
+ "type": "array",
1264
+ "items": { "type": "string", "minLength": 1 }
1265
+ },
1266
+ "hotStaleDocs": {
1267
+ "type": "array",
1268
+ "items": {
1269
+ "type": "object",
1270
+ "additionalProperties": false,
1271
+ "required": [
1272
+ "path",
1273
+ "activeReads",
1274
+ "preloadCount",
1275
+ "totalTouches",
1276
+ "daysSinceValidated",
1277
+ "validatedRevision",
1278
+ "reason"
1279
+ ],
1280
+ "properties": {
1281
+ "path": { "type": "string", "minLength": 1 },
1282
+ "activeReads": { "type": "integer", "minimum": 0 },
1283
+ "preloadCount": { "type": "integer", "minimum": 0 },
1284
+ "totalTouches": { "type": "integer", "minimum": 0 },
1285
+ "daysSinceValidated": { "type": ["integer", "null"] },
1286
+ "validatedRevision": { "type": ["string", "null"] },
1287
+ "reason": { "type": "string", "minLength": 1 }
1288
+ }
1289
+ }
1290
+ },
1291
+ "reflectionClusters": {
1292
+ "type": "array",
1293
+ "items": {
1294
+ "type": "object",
1295
+ "additionalProperties": false,
1296
+ "required": ["key", "targetDoc", "scope", "count", "candidates"],
1297
+ "properties": {
1298
+ "key": { "type": "string", "minLength": 1 },
1299
+ "targetDoc": { "type": ["string", "null"] },
1300
+ "scope": { "type": ["string", "null"] },
1301
+ "count": { "type": "integer", "minimum": 1 },
1302
+ "candidates": {
1303
+ "type": "array",
1304
+ "items": {
1305
+ "type": "object",
1306
+ "additionalProperties": false,
1307
+ "required": ["path", "title", "trigger", "confidence", "createdAt"],
1308
+ "properties": {
1309
+ "path": { "type": "string", "minLength": 1 },
1310
+ "title": { "type": "string", "minLength": 1 },
1311
+ "trigger": { "type": "string", "minLength": 1 },
1312
+ "confidence": { "type": "string", "minLength": 1 },
1313
+ "createdAt": { "type": ["string", "null"] }
1314
+ }
1315
+ }
1316
+ }
1317
+ }
1318
+ }
1319
+ },
1320
+ "searchBlindSpots": {
1321
+ "type": "array",
1322
+ "items": {
1323
+ "type": "object",
1324
+ "additionalProperties": false,
1325
+ "required": ["query", "occurrences", "zeroHitCount", "bigramFallbackCount", "lastSeenAt"],
1326
+ "properties": {
1327
+ "query": { "type": "string", "minLength": 1 },
1328
+ "occurrences": { "type": "integer", "minimum": 1 },
1329
+ "zeroHitCount": { "type": "integer", "minimum": 0 },
1330
+ "bigramFallbackCount": { "type": "integer", "minimum": 0 },
1331
+ "lastSeenAt": { "type": "string", "minLength": 1 }
1332
+ }
1333
+ }
1334
+ },
1335
+ "unmappedProbes": {
1336
+ "type": "array",
1337
+ "items": {
1338
+ "type": "object",
1339
+ "additionalProperties": false,
1340
+ "required": ["filePath", "occurrences", "lastSeenAt"],
1341
+ "properties": {
1342
+ "filePath": { "type": "string", "minLength": 1 },
1343
+ "occurrences": { "type": "integer", "minimum": 1 },
1344
+ "lastSeenAt": { "type": "string", "minLength": 1 }
1345
+ }
1346
+ }
1347
+ },
1348
+ "preload": {
1349
+ "type": "object",
1350
+ "additionalProperties": false,
1351
+ "required": [
1352
+ "totalEstimatedTokens",
1353
+ "budgetTokens",
1354
+ "exceedsBudget",
1355
+ "configured",
1356
+ "promoteCandidates",
1357
+ "demoteCandidates"
1358
+ ],
1359
+ "properties": {
1360
+ "totalEstimatedTokens": { "type": "integer", "minimum": 0 },
1361
+ "budgetTokens": { "type": "integer", "minimum": 1 },
1362
+ "exceedsBudget": { "type": "boolean" },
1363
+ "configured": {
1364
+ "type": "array",
1365
+ "items": { "type": "string", "minLength": 1 }
1366
+ },
1367
+ "promoteCandidates": {
1368
+ "type": "array",
1369
+ "items": {
1370
+ "type": "object",
1371
+ "additionalProperties": false,
1372
+ "required": ["path", "showCount", "estimatedTokens", "reason"],
1373
+ "properties": {
1374
+ "path": { "type": "string", "minLength": 1 },
1375
+ "showCount": { "type": "integer", "minimum": 1 },
1376
+ "estimatedTokens": { "type": "integer", "minimum": 0 },
1377
+ "reason": { "type": "string", "minLength": 1 }
1378
+ }
1379
+ }
1380
+ },
1381
+ "demoteCandidates": {
1382
+ "type": "array",
1383
+ "items": {
1384
+ "type": "object",
1385
+ "additionalProperties": false,
1386
+ "required": ["path", "activeReads", "estimatedTokens", "reason"],
1387
+ "properties": {
1388
+ "path": { "type": "string", "minLength": 1 },
1389
+ "activeReads": { "type": "integer", "minimum": 0 },
1390
+ "estimatedTokens": { "type": "integer", "minimum": 0 },
1391
+ "reason": { "type": "string", "minLength": 1 }
1392
+ }
1393
+ }
1394
+ }
1395
+ }
1396
+ },
1397
+ "borgesRiskDocs": {
1398
+ "type": "array",
1399
+ "items": {
1400
+ "type": "object",
1401
+ "additionalProperties": false,
1402
+ "required": ["path", "docTokens", "mappedSourceTokens", "mappedFileCount", "ratio"],
1403
+ "properties": {
1404
+ "path": { "type": "string", "minLength": 1 },
1405
+ "docTokens": { "type": "integer", "minimum": 0 },
1406
+ "mappedSourceTokens": { "type": "integer", "minimum": 1 },
1407
+ "mappedFileCount": { "type": "integer", "minimum": 1 },
1408
+ "ratio": { "type": "number", "minimum": 0 }
1409
+ }
1410
+ }
1411
+ },
1412
+ "growth": {
1413
+ "$ref": "#/$defs/growth"
1414
+ }
1415
+ }
1416
+ },
1417
+ "eval": {
1418
+ "type": "object",
1419
+ "additionalProperties": false,
1420
+ "required": ["status", "ok", "file", "total", "passed", "failed", "results"],
1421
+ "properties": {
1422
+ "status": {
1423
+ "type": "string",
1424
+ "enum": ["pass", "fail", "no_probes"]
1425
+ },
1426
+ "ok": {
1427
+ "type": "boolean"
1428
+ },
1429
+ "file": {
1430
+ "type": "string",
1431
+ "minLength": 1
1432
+ },
1433
+ "total": {
1434
+ "type": "integer",
1435
+ "minimum": 0
1436
+ },
1437
+ "passed": {
1438
+ "type": "integer",
1439
+ "minimum": 0
1440
+ },
1441
+ "failed": {
1442
+ "type": "integer",
1443
+ "minimum": 0
1444
+ },
1445
+ "results": {
1446
+ "type": "array",
1447
+ "items": {
1448
+ "type": "object",
1449
+ "additionalProperties": false,
1450
+ "required": ["kind", "target", "expected", "passed", "actual"],
1451
+ "properties": {
1452
+ "kind": {
1453
+ "type": "string",
1454
+ "enum": ["concept", "file", "negative"]
1455
+ },
1456
+ "target": { "type": "string", "minLength": 1 },
1457
+ "expected": { "type": "string", "minLength": 1 },
1458
+ "passed": { "type": "boolean" },
1459
+ "actual": { "type": "string", "minLength": 1 },
1460
+ "reason": { "type": "string", "minLength": 1 }
1461
+ }
1462
+ }
1021
1463
  }
1022
1464
  }
1023
1465
  }
@@ -0,0 +1,90 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://llmdoc.tokenroll.ai/schemas/probes.schema.json",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": ["schema"],
7
+ "properties": {
8
+ "$schema": {
9
+ "type": "string"
10
+ },
11
+ "schema": {
12
+ "type": "string",
13
+ "const": "llmdoc.probes/v1"
14
+ },
15
+ "concept": {
16
+ "type": "array",
17
+ "items": {
18
+ "type": "object",
19
+ "additionalProperties": false,
20
+ "required": ["query", "expectOwner"],
21
+ "properties": {
22
+ "query": {
23
+ "type": "string",
24
+ "minLength": 1
25
+ },
26
+ "expectOwner": {
27
+ "type": "string",
28
+ "minLength": 1
29
+ },
30
+ "maxRank": {
31
+ "type": "integer",
32
+ "minimum": 1,
33
+ "default": 1
34
+ },
35
+ "allowFallback": {
36
+ "type": "boolean",
37
+ "default": false
38
+ }
39
+ }
40
+ },
41
+ "default": []
42
+ },
43
+ "file": {
44
+ "type": "array",
45
+ "items": {
46
+ "type": "object",
47
+ "additionalProperties": false,
48
+ "required": ["path", "expectOwner"],
49
+ "properties": {
50
+ "path": {
51
+ "type": "string",
52
+ "minLength": 1
53
+ },
54
+ "expectOwner": {
55
+ "type": "string",
56
+ "minLength": 1
57
+ },
58
+ "expectRequires": {
59
+ "type": "array",
60
+ "items": {
61
+ "type": "string",
62
+ "minLength": 1
63
+ },
64
+ "default": []
65
+ }
66
+ }
67
+ },
68
+ "default": []
69
+ },
70
+ "negative": {
71
+ "type": "array",
72
+ "items": {
73
+ "type": "object",
74
+ "additionalProperties": false,
75
+ "required": ["path", "forbidOwner"],
76
+ "properties": {
77
+ "path": {
78
+ "type": "string",
79
+ "minLength": 1
80
+ },
81
+ "forbidOwner": {
82
+ "type": "string",
83
+ "minLength": 1
84
+ }
85
+ }
86
+ },
87
+ "default": []
88
+ }
89
+ }
90
+ }