@bpmnkit/docspack 0.0.3 → 0.0.5

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 (38) hide show
  1. package/.llms/chunks/cli.diff.flags.md +46 -0
  2. package/.llms/chunks/cli.diff.md +43 -0
  3. package/.llms/chunks/cli.diff.the-same-diff-elsewhere.md +14 -0
  4. package/.llms/chunks/guides.building-processes.multi-instance.md +66 -0
  5. package/.llms/chunks/guides.drop.md +12 -0
  6. package/.llms/chunks/guides.drop.reviewing-it-together.md +45 -0
  7. package/.llms/chunks/guides.drop.running-your-own.md +21 -0
  8. package/.llms/chunks/guides.drop.sharing-a-file.md +42 -0
  9. package/.llms/chunks/guides.drop.what-drop-is-not.md +12 -0
  10. package/.llms/chunks/guides.vscode.commands.md +14 -0
  11. package/.llms/chunks/guides.vscode.installing.md +22 -0
  12. package/.llms/chunks/guides.vscode.md +13 -0
  13. package/.llms/chunks/guides.vscode.settings.md +19 -0
  14. package/.llms/chunks/guides.vscode.support.md +11 -0
  15. package/.llms/chunks/guides.vscode.what-it-does-a-feel-playground-on-your-selection.md +8 -0
  16. package/.llms/chunks/guides.vscode.what-it-does-a-visual-diff-in-source-control.md +11 -0
  17. package/.llms/chunks/guides.vscode.what-it-does-copy-the-diagram-as-text.md +8 -0
  18. package/.llms/chunks/guides.vscode.what-it-does-deploy-against-your-own-clusters.md +21 -0
  19. package/.llms/chunks/guides.vscode.what-it-does-editing-that-leaves-a-readable-diff.md +22 -0
  20. package/.llms/chunks/guides.vscode.what-it-does-findings-in-the-problems-panel.md +13 -0
  21. package/.llms/chunks/guides.vscode.what-it-does-preview-beside-the-source.md +12 -0
  22. package/.llms/chunks/guides.vscode.what-it-does-run-the-diagram-in-the-editor.md +9 -0
  23. package/.llms/chunks/packages.core.installation-ad-hoc-sub-processes-children-are-a-set-not-a-chain.md +42 -0
  24. package/.llms/chunks/packages.core.installation-compactify-definitions.md +9 -4
  25. package/.llms/chunks/packages.core.installation-createflowelement-id-type-options.md +7 -0
  26. package/.llms/chunks/packages.core.installation-diffdiagram-before-after.md +33 -0
  27. package/.llms/chunks/packages.core.installation-element-catalog.md +10 -0
  28. package/.llms/chunks/packages.core.installation-expand-compact.md +4 -0
  29. package/.llms/chunks/packages.core.installation-processbuilder-methods.md +15 -0
  30. package/.llms/chunks/packages.core.installation-retypeelement-element-type.md +20 -0
  31. package/.llms/chunks/packages.core.writing-files-bpmnkit-core-node-exportpreserving-original-definitions.md +51 -0
  32. package/.llms/chunks/packages.core.writing-files-bpmnkit-core-node-writebpmn-definitions-options.md +38 -0
  33. package/.llms/chunks/packages.core.writing-files-bpmnkit-core-node.md +0 -36
  34. package/.llms/manifest.json +438 -10
  35. package/README.md +2 -0
  36. package/dist/chunk.js +14 -4
  37. package/llms.txt +34 -6
  38. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://docspack.dev/schema/v1.json",
3
3
  "name": "@bpmnkit/docspack",
4
- "version": "0.0.3",
4
+ "version": "0.0.5",
5
5
  "documents": [
6
6
  "@bpmnkit/core",
7
7
  "@bpmnkit/canvas",
@@ -230,6 +230,47 @@
230
230
  "@bpmnkit/connector-gen"
231
231
  ]
232
232
  },
233
+ {
234
+ "id": "cli.diff",
235
+ "file": "chunks/cli.diff.md",
236
+ "tokens": 412,
237
+ "tags": [
238
+ "cli",
239
+ "diff"
240
+ ],
241
+ "entities": [
242
+ "diffSemantics()",
243
+ "targetNamespace"
244
+ ]
245
+ },
246
+ {
247
+ "id": "cli.diff.flags",
248
+ "file": "chunks/cli.diff.flags.md",
249
+ "tokens": 301,
250
+ "tags": [
251
+ "cli",
252
+ "diff",
253
+ "flags"
254
+ ],
255
+ "entities": []
256
+ },
257
+ {
258
+ "id": "cli.diff.the-same-diff-elsewhere",
259
+ "file": "chunks/cli.diff.the-same-diff-elsewhere.md",
260
+ "tokens": 128,
261
+ "tags": [
262
+ "cli",
263
+ "diff",
264
+ "same",
265
+ "elsewhere"
266
+ ],
267
+ "entities": [
268
+ "diffDiagram()",
269
+ "@bpmnkit/core",
270
+ "createBpmnDiff()",
271
+ "@bpmnkit/plugins"
272
+ ]
273
+ },
233
274
  {
234
275
  "id": "cli.generate",
235
276
  "file": "chunks/cli.generate.md",
@@ -1009,13 +1050,16 @@
1009
1050
  {
1010
1051
  "id": "guides.building-processes.multi-instance",
1011
1052
  "file": "chunks/guides.building-processes.multi-instance.md",
1012
- "tokens": 92,
1053
+ "tokens": 687,
1013
1054
  "tags": [
1014
1055
  "guides",
1015
1056
  "building-processes",
1016
1057
  "multi-instance"
1017
1058
  ],
1018
- "entities": []
1059
+ "entities": [
1060
+ "defaultFlow",
1061
+ "continueProcess()"
1062
+ ]
1019
1063
  },
1020
1064
  {
1021
1065
  "id": "guides.claude-code-plugin",
@@ -1135,6 +1179,69 @@
1135
1179
  ],
1136
1180
  "entities": []
1137
1181
  },
1182
+ {
1183
+ "id": "guides.drop",
1184
+ "file": "chunks/guides.drop.md",
1185
+ "tokens": 141,
1186
+ "tags": [
1187
+ "guides",
1188
+ "drop"
1189
+ ],
1190
+ "entities": []
1191
+ },
1192
+ {
1193
+ "id": "guides.drop.sharing-a-file",
1194
+ "file": "chunks/guides.drop.sharing-a-file.md",
1195
+ "tokens": 410,
1196
+ "tags": [
1197
+ "guides",
1198
+ "drop",
1199
+ "sharing",
1200
+ "file"
1201
+ ],
1202
+ "entities": []
1203
+ },
1204
+ {
1205
+ "id": "guides.drop.reviewing-it-together",
1206
+ "file": "chunks/guides.drop.reviewing-it-together.md",
1207
+ "tokens": 604,
1208
+ "tags": [
1209
+ "guides",
1210
+ "drop",
1211
+ "reviewing",
1212
+ "together"
1213
+ ],
1214
+ "entities": [
1215
+ "@bpmnkit/plugins"
1216
+ ]
1217
+ },
1218
+ {
1219
+ "id": "guides.drop.running-your-own",
1220
+ "file": "chunks/guides.drop.running-your-own.md",
1221
+ "tokens": 200,
1222
+ "tags": [
1223
+ "guides",
1224
+ "drop",
1225
+ "running",
1226
+ "own"
1227
+ ],
1228
+ "entities": [
1229
+ "apps/drop",
1230
+ "@bpmnkit/core",
1231
+ "apps/drop/DEPLOY.md"
1232
+ ]
1233
+ },
1234
+ {
1235
+ "id": "guides.drop.what-drop-is-not",
1236
+ "file": "chunks/guides.drop.what-drop-is-not.md",
1237
+ "tokens": 136,
1238
+ "tags": [
1239
+ "guides",
1240
+ "drop",
1241
+ "not"
1242
+ ],
1243
+ "entities": []
1244
+ },
1138
1245
  {
1139
1246
  "id": "guides.gateways.exclusive-gateway-xor",
1140
1247
  "file": "chunks/guides.gateways.exclusive-gateway-xor.md",
@@ -1347,6 +1454,189 @@
1347
1454
  "engine.getDeployedProcesses()"
1348
1455
  ]
1349
1456
  },
1457
+ {
1458
+ "id": "guides.vscode",
1459
+ "file": "chunks/guides.vscode.md",
1460
+ "tokens": 139,
1461
+ "tags": [
1462
+ "guides",
1463
+ "vscode"
1464
+ ],
1465
+ "entities": [
1466
+ "@bpmnkit/canvas"
1467
+ ]
1468
+ },
1469
+ {
1470
+ "id": "guides.vscode.installing",
1471
+ "file": "chunks/guides.vscode.installing.md",
1472
+ "tokens": 140,
1473
+ "tags": [
1474
+ "guides",
1475
+ "vscode",
1476
+ "installing"
1477
+ ],
1478
+ "entities": []
1479
+ },
1480
+ {
1481
+ "id": "guides.vscode.what-it-does-preview-beside-the-source",
1482
+ "file": "chunks/guides.vscode.what-it-does-preview-beside-the-source.md",
1483
+ "tokens": 131,
1484
+ "tags": [
1485
+ "guides",
1486
+ "vscode",
1487
+ "preview",
1488
+ "beside",
1489
+ "source"
1490
+ ],
1491
+ "entities": [
1492
+ "workbench.editorAssociations"
1493
+ ]
1494
+ },
1495
+ {
1496
+ "id": "guides.vscode.what-it-does-editing-that-leaves-a-readable-diff",
1497
+ "file": "chunks/guides.vscode.what-it-does-editing-that-leaves-a-readable-diff.md",
1498
+ "tokens": 302,
1499
+ "tags": [
1500
+ "guides",
1501
+ "vscode",
1502
+ "editing",
1503
+ "leaves",
1504
+ "readable",
1505
+ "diff"
1506
+ ],
1507
+ "entities": [
1508
+ "TextDocument",
1509
+ "exportPreserving()",
1510
+ "@bpmnkit/core"
1511
+ ]
1512
+ },
1513
+ {
1514
+ "id": "guides.vscode.what-it-does-findings-in-the-problems-panel",
1515
+ "file": "chunks/guides.vscode.what-it-does-findings-in-the-problems-panel.md",
1516
+ "tokens": 150,
1517
+ "tags": [
1518
+ "guides",
1519
+ "vscode",
1520
+ "findings",
1521
+ "problems",
1522
+ "panel"
1523
+ ],
1524
+ "entities": [
1525
+ "bpmnkit.lint.forceEngineRules"
1526
+ ]
1527
+ },
1528
+ {
1529
+ "id": "guides.vscode.what-it-does-a-visual-diff-in-source-control",
1530
+ "file": "chunks/guides.vscode.what-it-does-a-visual-diff-in-source-control.md",
1531
+ "tokens": 146,
1532
+ "tags": [
1533
+ "guides",
1534
+ "vscode",
1535
+ "visual",
1536
+ "diff",
1537
+ "source",
1538
+ "control"
1539
+ ],
1540
+ "entities": []
1541
+ },
1542
+ {
1543
+ "id": "guides.vscode.what-it-does-run-the-diagram-in-the-editor",
1544
+ "file": "chunks/guides.vscode.what-it-does-run-the-diagram-in-the-editor.md",
1545
+ "tokens": 105,
1546
+ "tags": [
1547
+ "guides",
1548
+ "vscode",
1549
+ "run",
1550
+ "diagram",
1551
+ "editor"
1552
+ ],
1553
+ "entities": [
1554
+ "@bpmnkit/engine"
1555
+ ]
1556
+ },
1557
+ {
1558
+ "id": "guides.vscode.what-it-does-a-feel-playground-on-your-selection",
1559
+ "file": "chunks/guides.vscode.what-it-does-a-feel-playground-on-your-selection.md",
1560
+ "tokens": 75,
1561
+ "tags": [
1562
+ "guides",
1563
+ "vscode",
1564
+ "feel",
1565
+ "playground",
1566
+ "selection"
1567
+ ],
1568
+ "entities": []
1569
+ },
1570
+ {
1571
+ "id": "guides.vscode.what-it-does-deploy-against-your-own-clusters",
1572
+ "file": "chunks/guides.vscode.what-it-does-deploy-against-your-own-clusters.md",
1573
+ "tokens": 208,
1574
+ "tags": [
1575
+ "guides",
1576
+ "vscode",
1577
+ "deploy",
1578
+ "against",
1579
+ "own",
1580
+ "clusters"
1581
+ ],
1582
+ "entities": []
1583
+ },
1584
+ {
1585
+ "id": "guides.vscode.what-it-does-copy-the-diagram-as-text",
1586
+ "file": "chunks/guides.vscode.what-it-does-copy-the-diagram-as-text.md",
1587
+ "tokens": 84,
1588
+ "tags": [
1589
+ "guides",
1590
+ "vscode",
1591
+ "copy",
1592
+ "diagram",
1593
+ "text"
1594
+ ],
1595
+ "entities": []
1596
+ },
1597
+ {
1598
+ "id": "guides.vscode.commands",
1599
+ "file": "chunks/guides.vscode.commands.md",
1600
+ "tokens": 181,
1601
+ "tags": [
1602
+ "guides",
1603
+ "vscode",
1604
+ "commands"
1605
+ ],
1606
+ "entities": []
1607
+ },
1608
+ {
1609
+ "id": "guides.vscode.settings",
1610
+ "file": "chunks/guides.vscode.settings.md",
1611
+ "tokens": 241,
1612
+ "tags": [
1613
+ "guides",
1614
+ "vscode",
1615
+ "settings"
1616
+ ],
1617
+ "entities": [
1618
+ "bpmnkit.lint.enabled",
1619
+ "bpmnkit.lint.run",
1620
+ "onType",
1621
+ "onSave",
1622
+ "bpmnkit.lint.forceEngineRules",
1623
+ "bpmnkit.viewer.grid",
1624
+ "bpmnkit.viewer.minimap",
1625
+ "bpmnkit.simulation.enabled",
1626
+ "bpmnkit.editing.enabled"
1627
+ ]
1628
+ },
1629
+ {
1630
+ "id": "guides.vscode.support",
1631
+ "file": "chunks/guides.vscode.support.md",
1632
+ "tokens": 99,
1633
+ "tags": [
1634
+ "guides",
1635
+ "vscode",
1636
+ "support"
1637
+ ],
1638
+ "entities": []
1639
+ },
1350
1640
  {
1351
1641
  "id": "guides.workers-standalone",
1352
1642
  "file": "chunks/guides.workers-standalone.md",
@@ -1845,6 +2135,25 @@
1845
2135
  ],
1846
2136
  "entities": []
1847
2137
  },
2138
+ {
2139
+ "id": "packages.core.installation-diffdiagram-before-after",
2140
+ "file": "chunks/packages.core.installation-diffdiagram-before-after.md",
2141
+ "tokens": 331,
2142
+ "tags": [
2143
+ "packages",
2144
+ "core",
2145
+ "installation",
2146
+ "diffdiagram",
2147
+ "before",
2148
+ "after"
2149
+ ],
2150
+ "entities": [
2151
+ "diffSemantics()",
2152
+ "targetNamespace",
2153
+ "createBpmnDiff()",
2154
+ "@bpmnkit/plugins"
2155
+ ]
2156
+ },
1848
2157
  {
1849
2158
  "id": "packages.core.installation-applybpmnoperations-definitions-operations-options",
1850
2159
  "file": "chunks/packages.core.installation-applybpmnoperations-definitions-operations-options.md",
@@ -1905,7 +2214,7 @@
1905
2214
  {
1906
2215
  "id": "packages.core.installation-compactify-definitions",
1907
2216
  "file": "chunks/packages.core.installation-compactify-definitions.md",
1908
- "tokens": 111,
2217
+ "tokens": 204,
1909
2218
  "tags": [
1910
2219
  "packages",
1911
2220
  "core",
@@ -1921,7 +2230,7 @@
1921
2230
  {
1922
2231
  "id": "packages.core.installation-expand-compact",
1923
2232
  "file": "chunks/packages.core.installation-expand-compact.md",
1924
- "tokens": 106,
2233
+ "tokens": 164,
1925
2234
  "tags": [
1926
2235
  "packages",
1927
2236
  "core",
@@ -1931,7 +2240,61 @@
1931
2240
  ],
1932
2241
  "entities": [
1933
2242
  "BpmnDefinitions",
1934
- "CompactDiagram"
2243
+ "CompactDiagram",
2244
+ "BpmnElementType",
2245
+ "dataObject",
2246
+ "dataObjectReference",
2247
+ "dataStoreReference"
2248
+ ]
2249
+ },
2250
+ {
2251
+ "id": "packages.core.installation-retypeelement-element-type",
2252
+ "file": "chunks/packages.core.installation-retypeelement-element-type.md",
2253
+ "tokens": 189,
2254
+ "tags": [
2255
+ "packages",
2256
+ "core",
2257
+ "installation",
2258
+ "retypeelement",
2259
+ "element",
2260
+ "type"
2261
+ ],
2262
+ "entities": [
2263
+ "ensureZeebeExtension",
2264
+ "serviceTask",
2265
+ "manualTask"
2266
+ ]
2267
+ },
2268
+ {
2269
+ "id": "packages.core.installation-createflowelement-id-type-options",
2270
+ "file": "chunks/packages.core.installation-createflowelement-id-type-options.md",
2271
+ "tokens": 61,
2272
+ "tags": [
2273
+ "packages",
2274
+ "core",
2275
+ "installation",
2276
+ "createflowelement",
2277
+ "type",
2278
+ "options"
2279
+ ],
2280
+ "entities": [
2281
+ "BpmnElementType"
2282
+ ]
2283
+ },
2284
+ {
2285
+ "id": "packages.core.installation-element-catalog",
2286
+ "file": "chunks/packages.core.installation-element-catalog.md",
2287
+ "tokens": 96,
2288
+ "tags": [
2289
+ "packages",
2290
+ "core",
2291
+ "installation",
2292
+ "element",
2293
+ "catalog"
2294
+ ],
2295
+ "entities": [
2296
+ "BpmnElementType",
2297
+ "allElementTypes()"
1935
2298
  ]
1936
2299
  },
1937
2300
  {
@@ -1953,7 +2316,7 @@
1953
2316
  {
1954
2317
  "id": "packages.core.installation-processbuilder-methods",
1955
2318
  "file": "chunks/packages.core.installation-processbuilder-methods.md",
1956
- "tokens": 412,
2319
+ "tokens": 698,
1957
2320
  "tags": [
1958
2321
  "packages",
1959
2322
  "core",
@@ -1963,9 +2326,29 @@
1963
2326
  ],
1964
2327
  "entities": [
1965
2328
  "addStartEvent",
1966
- "BpmnDefinitions"
2329
+ "BpmnDefinitions",
2330
+ "dataObject",
2331
+ "dataObjectReference",
2332
+ "dataStoreReference"
1967
2333
  ]
1968
2334
  },
2335
+ {
2336
+ "id": "packages.core.installation-ad-hoc-sub-processes-children-are-a-set-not-a-chain",
2337
+ "file": "chunks/packages.core.installation-ad-hoc-sub-processes-children-are-a-set-not-a-chain.md",
2338
+ "tokens": 368,
2339
+ "tags": [
2340
+ "packages",
2341
+ "core",
2342
+ "installation",
2343
+ "ad-hoc",
2344
+ "sub-processes",
2345
+ "children",
2346
+ "set",
2347
+ "not",
2348
+ "chain"
2349
+ ],
2350
+ "entities": []
2351
+ },
1969
2352
  {
1970
2353
  "id": "packages.core.installation-joins-inferred-by-default-or-declared",
1971
2354
  "file": "chunks/packages.core.installation-joins-inferred-by-default-or-declared.md",
@@ -1989,7 +2372,7 @@
1989
2372
  {
1990
2373
  "id": "packages.core.writing-files-bpmnkit-core-node",
1991
2374
  "file": "chunks/packages.core.writing-files-bpmnkit-core-node.md",
1992
- "tokens": 474,
2375
+ "tokens": 52,
1993
2376
  "tags": [
1994
2377
  "packages",
1995
2378
  "core",
@@ -2000,12 +2383,57 @@
2000
2383
  ],
2001
2384
  "entities": [
2002
2385
  "@bpmnkit/core/node",
2003
- "@bpmnkit/core",
2386
+ "@bpmnkit/core"
2387
+ ]
2388
+ },
2389
+ {
2390
+ "id": "packages.core.writing-files-bpmnkit-core-node-writebpmn-definitions-options",
2391
+ "file": "chunks/packages.core.writing-files-bpmnkit-core-node-writebpmn-definitions-options.md",
2392
+ "tokens": 440,
2393
+ "tags": [
2394
+ "packages",
2395
+ "core",
2396
+ "writing",
2397
+ "files",
2398
+ "bpmnkit",
2399
+ "node",
2400
+ "writebpmn",
2401
+ "definitions",
2402
+ "options"
2403
+ ],
2404
+ "entities": [
2004
2405
  "WriteVerificationError",
2005
2406
  "WriteError",
2006
2407
  "Bpmn.export()"
2007
2408
  ]
2008
2409
  },
2410
+ {
2411
+ "id": "packages.core.writing-files-bpmnkit-core-node-exportpreserving-original-definitions",
2412
+ "file": "chunks/packages.core.writing-files-bpmnkit-core-node-exportpreserving-original-definitions.md",
2413
+ "tokens": 598,
2414
+ "tags": [
2415
+ "packages",
2416
+ "core",
2417
+ "writing",
2418
+ "files",
2419
+ "bpmnkit",
2420
+ "node",
2421
+ "exportpreserving",
2422
+ "original",
2423
+ "definitions"
2424
+ ],
2425
+ "entities": [
2426
+ "Bpmn.export()",
2427
+ "@bpmnkit/core",
2428
+ "flowElements",
2429
+ "sequenceFlows",
2430
+ "exportXml()",
2431
+ "exportDmnPreserving",
2432
+ "preserveDmnFormatting",
2433
+ "exportFormPreserving",
2434
+ "preserveFormFormatting"
2435
+ ]
2436
+ },
2009
2437
  {
2010
2438
  "id": "packages.core.dmn-support",
2011
2439
  "file": "chunks/packages.core.dmn-support.md",
package/README.md CHANGED
@@ -125,6 +125,7 @@ Options: `--limit <n>`, `--max-tokens <n>`, `--pack <name>`, `--cwd <dir>`.
125
125
  | [`@bpmnkit/plugins`](https://www.npmjs.com/package/@bpmnkit/plugins) | 22 composable canvas plugins |
126
126
  | [`@bpmnkit/api`](https://www.npmjs.com/package/@bpmnkit/api) | Camunda 8 REST API TypeScript client |
127
127
  | [`@bpmnkit/ascii`](https://www.npmjs.com/package/@bpmnkit/ascii) | Render BPMN diagrams as Unicode ASCII art |
128
+ | [`@bpmnkit/camunda-docspack`](https://www.npmjs.com/package/@bpmnkit/camunda-docspack) | Camunda 8 docs as an offline docspack package for AI agents |
128
129
  | [`@bpmnkit/ui`](https://www.npmjs.com/package/@bpmnkit/ui) | Shared design tokens and UI components |
129
130
  | [`@bpmnkit/profiles`](https://www.npmjs.com/package/@bpmnkit/profiles) | Shared auth, profile storage, and client factories for CLI & proxy |
130
131
  | [`@bpmnkit/operate`](https://www.npmjs.com/package/@bpmnkit/operate) | Monitoring & operations frontend for Camunda clusters |
@@ -135,6 +136,7 @@ Options: `--limit <n>`, `--max-tokens <n>`, `--pack <name>`, `--cwd <dir>`.
135
136
  | [`@bpmnkit/patterns`](https://www.npmjs.com/package/@bpmnkit/patterns) | Domain process patterns for BPMNKit AIKit |
136
137
  | [`@bpmnkit/reebe-wasm`](https://www.npmjs.com/package/@bpmnkit/reebe-wasm) | WebAssembly BPMN engine for browser simulation |
137
138
  | [`@bpmnkit/worker-client`](https://www.npmjs.com/package/@bpmnkit/worker-client) | Thin Zeebe REST client for standalone workers |
139
+ | [`@bpmnkit/user-tasks`](https://www.npmjs.com/package/@bpmnkit/user-tasks) | Embeddable user task widget for Camunda 8 |
138
140
  | [`@bpmnkit/cli-sdk`](https://www.npmjs.com/package/@bpmnkit/cli-sdk) | Plugin authoring SDK for the casen CLI |
139
141
  | [`@bpmnkit/create-casen-plugin`](https://www.npmjs.com/package/@bpmnkit/create-casen-plugin) | Scaffold a new casen CLI plugin in seconds |
140
142
  | [`@bpmnkit/casen-report`](https://www.npmjs.com/package/@bpmnkit/casen-report) | HTML reports from Camunda 8 incident and SLA data |
package/dist/chunk.js CHANGED
@@ -25,7 +25,7 @@ export function chunkDocument(doc, options = {}) {
25
25
  if (text === "")
26
26
  continue;
27
27
  const directives = readDirectives(part.lines);
28
- const chunkTitle = part.heading === "" ? title : `${title} — ${part.heading}`;
28
+ const chunkTitle = joinHeadings(title, part.heading);
29
29
  const source = options.siteUrl ? `\n\n---\nSource: ${options.siteUrl}/${doc.slug}` : "";
30
30
  const bodyText = `# ${chunkTitle}\n\n${stripDirectives(text)}${source}\n`;
31
31
  chunks.push({
@@ -116,8 +116,7 @@ function subdivide(section, maxTokens) {
116
116
  return [section];
117
117
  const parts = [];
118
118
  for (const sub of splitByHeading(section.lines.join("\n"), 3)) {
119
- const heading = sub.heading === "" ? section.heading : `${section.heading} — ${sub.heading}`;
120
- parts.push(...byParagraph({ heading, lines: sub.lines }, maxTokens));
119
+ parts.push(...byParagraph({ heading: joinHeadings(section.heading, sub.heading), lines: sub.lines }, maxTokens));
121
120
  }
122
121
  return parts.length > 0 ? parts : [section];
123
122
  }
@@ -132,7 +131,7 @@ function byParagraph(section, maxTokens) {
132
131
  if (current.join("").trim() === "")
133
132
  return;
134
133
  const suffix = parts.length === 0 ? "" : ` (${parts.length + 1})`;
135
- parts.push({ heading: `${section.heading}${suffix}`, lines: current });
134
+ parts.push({ heading: `${section.heading}${suffix}`.trim(), lines: current });
136
135
  current = [];
137
136
  };
138
137
  for (const line of section.lines) {
@@ -177,6 +176,17 @@ function stripDirectives(text) {
177
176
  .join("\n")
178
177
  .trim();
179
178
  }
179
+ /**
180
+ * Join a chunk's heading trail, dropping the levels that have no heading of their own.
181
+ *
182
+ * A document whose text before the first `##` is shorter than `minTokens` is merged into the
183
+ * section after it, and the merged section keeps the preamble's empty heading. Composing that
184
+ * blindly produced a hole in the middle of the trail — `Naming BPMN elements — — Naming
185
+ * gateways` — which is what a reader sees at the top of the chunk and what an answer cites.
186
+ */
187
+ function joinHeadings(...parts) {
188
+ return parts.filter((part) => part.trim() !== "").join(" — ");
189
+ }
180
190
  /** Heading words carry the topic; function words carry nothing worth weighting 3x. */
181
191
  function headingTags(heading) {
182
192
  return tokenize(heading).filter((word) => word.length > 2 && !STOP_WORDS.has(word));