@bpmnkit/docspack 0.0.4 → 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.
- package/.llms/manifest.json +1 -1
- package/README.md +1 -0
- package/dist/chunk.js +14 -4
- package/llms.txt +1 -1
- package/package.json +1 -1
package/.llms/manifest.json
CHANGED
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 |
|
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 =
|
|
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
|
-
|
|
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}
|
|
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));
|
package/llms.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> BPMN Kit documentation as an offline, version-locked docspack package with a built-in search CLI for AI agents
|
|
4
4
|
|
|
5
|
-
Version 0.0.
|
|
5
|
+
Version 0.0.5. 191 chunks documenting @bpmnkit/core, @bpmnkit/canvas, @bpmnkit/editor, @bpmnkit/engine, @bpmnkit/feel, @bpmnkit/plugins, @bpmnkit/api, @bpmnkit/ascii, @bpmnkit/connector-gen, @bpmnkit/connectors, @bpmnkit/patterns, @bpmnkit/worker-client, @bpmnkit/cli.
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
8
|
npm i -D @bpmnkit/docspack
|