@bpmnkit/docspack 0.0.5 → 1.0.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/.llms/chunks/getting-started.stability.deprecation.md +15 -0
- package/.llms/chunks/getting-started.stability.support-window.md +49 -0
- package/.llms/chunks/getting-started.stability.versions-are-per-package-not-per-repo.md +17 -0
- package/.llms/chunks/getting-started.stability.what-counts-as-public-api.md +33 -0
- package/.llms/chunks/getting-started.stability.what-is-a-breaking-change.md +70 -0
- package/.llms/chunks/getting-started.stability.what-is-not-a-breaking-change.md +25 -0
- package/.llms/chunks/getting-started.stability.what-this-page-is-for.md +21 -0
- package/.llms/chunks/guides.ai.minimal-empty-diagram.md +1 -0
- package/.llms/chunks/guides.ai.previewing-while-the-model-writes.md +57 -0
- package/.llms/chunks/guides.using-bpmnkit-with-ai.asking.md +47 -0
- package/.llms/chunks/guides.using-bpmnkit-with-ai.from-the-library-instead-of-the-cli-the-other-route-docspack-index.md +56 -0
- package/.llms/chunks/guides.using-bpmnkit-with-ai.from-the-library-instead-of-the-cli.md +86 -0
- package/.llms/chunks/guides.using-bpmnkit-with-ai.md +17 -0
- package/.llms/chunks/guides.using-bpmnkit-with-ai.runnable-examples.md +31 -0
- package/.llms/chunks/guides.using-bpmnkit-with-ai.telling-an-agent-they-exist.md +23 -0
- package/.llms/chunks/guides.using-bpmnkit-with-ai.the-two-packs-bpmn-kit-ships.md +20 -0
- package/.llms/chunks/guides.using-bpmnkit-with-ai.the-whole-loop-five-markdown-files-to-a-bpmn-diagram.md +64 -0
- package/.llms/chunks/guides.using-bpmnkit-with-ai.where-to-go-next.md +13 -0
- package/.llms/chunks/packages.ascii.from-the-command-line.md +23 -0
- package/.llms/chunks/packages.ascii.installation.md +34 -0
- package/.llms/chunks/packages.ascii.overview.md +15 -0
- package/.llms/chunks/packages.ascii.rendering-a-decision-table.md +29 -0
- package/.llms/chunks/packages.ascii.rendering-a-form.md +39 -0
- package/.llms/chunks/packages.camunda-docspack.a-note-on-the-pack-s-name.md +15 -0
- package/.llms/chunks/packages.camunda-docspack.installation.md +41 -0
- package/.llms/chunks/packages.camunda-docspack.overview.md +28 -0
- package/.llms/chunks/packages.camunda-docspack.rebuilding-it.md +27 -0
- package/.llms/chunks/packages.camunda-docspack.what-makes-this-corpus-different.md +16 -0
- package/.llms/chunks/packages.connectors.api-reference.md +22 -0
- package/.llms/chunks/packages.connectors.applying-a-template.md +64 -0
- package/.llms/chunks/packages.connectors.installation.md +45 -0
- package/.llms/chunks/packages.connectors.overview.md +16 -0
- package/.llms/chunks/packages.connectors.stability.md +16 -0
- package/.llms/chunks/packages.connectors.validating-a-template.md +27 -0
- package/.llms/chunks/packages.connectors.workspace-templates.md +20 -0
- package/.llms/chunks/packages.core.installation-compactify-definitions.md +8 -0
- package/.llms/chunks/packages.core.installation-createcompactstream-options.md +41 -0
- package/.llms/chunks/packages.core.installation-joins-inferred-by-default-or-declared.md +3 -3
- package/.llms/chunks/{packages.docspack.installation.md → packages.docspack.giving-an-agent-access.md} +5 -10
- package/.llms/chunks/packages.docspack.reading-it-yourself.md +6 -0
- package/.llms/chunks/packages.docspack.the-other-pack.md +24 -0
- package/.llms/chunks/packages.feel.api-reference.md +34 -0
- package/.llms/chunks/packages.feel.formatting-and-highlighting.md +24 -0
- package/.llms/chunks/packages.feel.installation.md +45 -0
- package/.llms/chunks/packages.feel.overview.md +15 -0
- package/.llms/chunks/packages.feel.stability.md +7 -0
- package/.llms/chunks/packages.feel.unary-tests.md +46 -0
- package/.llms/chunks/packages.plugins.installation.md +28 -0
- package/.llms/chunks/packages.plugins.overview.md +18 -0
- package/.llms/chunks/packages.plugins.styles.md +26 -0
- package/.llms/chunks/packages.plugins.what-is-available.md +68 -0
- package/.llms/manifest.json +763 -10
- package/README.md +11 -4
- package/dist/cli.js +11 -1
- package/dist/load.d.ts +10 -2
- package/dist/load.js +15 -3
- package/dist/search.d.ts +5 -1
- package/dist/search.js +12 -1
- package/llms.txt +52 -6
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Using BPMN Kit with AI — Where to go next
|
|
2
|
+
|
|
3
|
+
- [AI Integration](/docs/guides/ai) — the compact format, prompting, the Claude
|
|
4
|
+
and OpenAI calls, and the MCP server
|
|
5
|
+
- [Building Processes with AI](/docs/guides/ai-implement) — the `ProcessPlan`
|
|
6
|
+
pipeline, which compiles rather than generating XML
|
|
7
|
+
- [AI Agents](/docs/guides/ai-agents) — putting an LLM *inside* a process as a
|
|
8
|
+
Camunda AI Agent Sub-process
|
|
9
|
+
- [Claude Code Plugin](/docs/guides/claude-code-plugin) — the slash commands that
|
|
10
|
+
drive all of it
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
Source: https://bpmnkit.com/docs/guides/using-bpmnkit-with-ai
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# @bpmnkit/ascii — From the command line
|
|
2
|
+
|
|
3
|
+
`casen view` wraps all three, picking the renderer from the file extension:
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
casen view order.bpmn
|
|
7
|
+
casen view risk-score.dmn
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
See [`casen view`](/docs/cli/view) for the flags it adds on top.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Stability
|
|
14
|
+
|
|
15
|
+
`@bpmnkit/ascii` carries the [1.0 stability promise](/docs/getting-started/stability): its
|
|
16
|
+
exports will not change shape without a major version.
|
|
17
|
+
|
|
18
|
+
The promise covers the three function signatures and `RenderOptions`. It does **not** cover
|
|
19
|
+
the exact characters that come out — box-drawing details, column widths and truncation are
|
|
20
|
+
presentation, and improving them is a minor. Do not assert on the rendering byte for byte.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
Source: https://bpmnkit.com/docs/packages/ascii
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# @bpmnkit/ascii — Installation
|
|
2
|
+
|
|
3
|
+
```sh
|
|
4
|
+
npm install @bpmnkit/ascii
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Rendering a process
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
import { renderBpmnAscii } from "@bpmnkit/ascii";
|
|
12
|
+
import { readFileSync } from "node:fs";
|
|
13
|
+
|
|
14
|
+
console.log(renderBpmnAscii(readFileSync("order.bpmn", "utf-8")));
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
╭─────────╮ ┌──────────────────────┐ ╭─────────╮
|
|
19
|
+
│ ○ Start │──────────►│ [svc] Process Order │─────────►│ ● End │
|
|
20
|
+
╰─────────╯ └──────────────────────┘ ╰─────────╯
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Shapes follow BPMN. Events are rounded boxes carrying a marker — `○` start, `●` end, `◎`
|
|
24
|
+
intermediate catch, `◉` throw, `◈` boundary. Activities are square boxes with a three-letter
|
|
25
|
+
type tag — `[svc]`, `[usr]`, `[scr]`, `[snd]`, `[rcv]`, `[dmn]`, `[man]`, `[cal]`, `[sub]`,
|
|
26
|
+
`[txn]`. Gateways are diamonds — `×` exclusive, `+` parallel, `◇` inclusive, `?` event-based,
|
|
27
|
+
`✱` complex. Labels are truncated to the box, which keeps columns aligned on a wide process.
|
|
28
|
+
|
|
29
|
+
The layout comes from the diagram's own coordinates, so what you get is the shape someone drew
|
|
30
|
+
rather than a re-layout. A model with no diagram interchange has nothing to place — run
|
|
31
|
+
`applyAutoLayout` from `@bpmnkit/core` first if you built it in code.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
Source: https://bpmnkit.com/docs/packages/ascii
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @bpmnkit/ascii — Overview
|
|
2
|
+
|
|
3
|
+
`@bpmnkit/ascii` turns a diagram into text. It takes the XML and returns a string — no canvas,
|
|
4
|
+
no DOM, no headless browser — so a process can be shown somewhere a picture cannot go: a
|
|
5
|
+
terminal, a CI log, a pull-request comment, or a prompt.
|
|
6
|
+
|
|
7
|
+
That last one is the reason it exists. A model reading a diagram as a grid of labelled boxes
|
|
8
|
+
gets the topology in a few hundred tokens, which is a great deal cheaper than the XML and a
|
|
9
|
+
great deal more legible than a screenshot. `casen view` is this package with a file path in
|
|
10
|
+
front of it.
|
|
11
|
+
|
|
12
|
+
Three renderers, one per artifact kind, and no dependencies beyond `@bpmnkit/core`.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
Source: https://bpmnkit.com/docs/packages/ascii
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @bpmnkit/ascii — Rendering a decision table
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { renderDmnAscii } from "@bpmnkit/ascii";
|
|
5
|
+
|
|
6
|
+
console.log(renderDmnAscii(readFileSync("risk-score.dmn", "utf-8")));
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
DRD
|
|
11
|
+
───
|
|
12
|
+
|
|
13
|
+
Risk score [FIRST]
|
|
14
|
+
──────────────────
|
|
15
|
+
|
|
16
|
+
╔═══╦═════════╦════════════╦════════╗
|
|
17
|
+
║ F ║ Amount ║ Country ║ Risk ║
|
|
18
|
+
╠═══╬═════════╬════════════╬════════╣
|
|
19
|
+
║ 1 ║ < 1000 ║ "DE", "AT" ║ "low" ║
|
|
20
|
+
║ 2 ║ >= 1000 ║ ║ "high" ║
|
|
21
|
+
╚═══╩═════════╩════════════╩════════╝
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The hit policy is shown beside the table name and in the corner cell, because a table read
|
|
25
|
+
without it means something different — an empty cell under `FIRST` is "anything, and stop
|
|
26
|
+
here", which is not what it looks like.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
Source: https://bpmnkit.com/docs/packages/ascii
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# @bpmnkit/ascii — Rendering a form
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { renderFormAscii } from "@bpmnkit/ascii";
|
|
5
|
+
|
|
6
|
+
console.log(renderFormAscii(readFileSync("approval.form", "utf-8")));
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Fields are listed in layout order with their keys, types and validation, so a form can be
|
|
10
|
+
reviewed in the same place as the process that raises it.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## API Reference
|
|
14
|
+
|
|
15
|
+
| Export | Signature |
|
|
16
|
+
|---|---|
|
|
17
|
+
| `renderBpmnAscii` | `(xml: string, options?: RenderOptions) => string` |
|
|
18
|
+
| `renderDmnAscii` | `(xml: string, options?: RenderOptions) => string` |
|
|
19
|
+
| `renderFormAscii` | `(json: string, options?: RenderOptions) => string` |
|
|
20
|
+
|
|
21
|
+
Each takes the file's text and returns the rendering. Parsing is strict — a document that is
|
|
22
|
+
not valid BPMN throws, naming what it found — so wrap the call if you are rendering a
|
|
23
|
+
directory. A document that parses but holds no flow elements
|
|
24
|
+
renders as `(empty)`.
|
|
25
|
+
|
|
26
|
+
### `RenderOptions`
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
interface RenderOptions {
|
|
30
|
+
/**
|
|
31
|
+
* Heading shown above the diagram.
|
|
32
|
+
* Defaults to the process name from the XML; pass `false` for no heading.
|
|
33
|
+
*/
|
|
34
|
+
title?: string | false;
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
Source: https://bpmnkit.com/docs/packages/ascii
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @bpmnkit/camunda-docspack — A note on the pack's name
|
|
2
|
+
|
|
3
|
+
A vendor that redistributes somebody else's documentation needs a second pack, so
|
|
4
|
+
this one is `@bpmnkit/camunda-docspack` rather than a second `@bpmnkit/docspack`.
|
|
5
|
+
The name is still a pure check inside a scope BPMN Kit owns, so the pack carries
|
|
6
|
+
the same trust as `@bpmnkit/docspack`.
|
|
7
|
+
|
|
8
|
+
The docspack spec originally named one pack per npm scope, and `bpmnkit-docs`
|
|
9
|
+
read the `-docspack` suffix ahead of it. Upstream adopted the shape in
|
|
10
|
+
**`docspack@1.2.0`**, so both readers now find this pack — but a `docspack` CLI
|
|
11
|
+
older than 1.2.0 will not, and will answer Camunda questions out of
|
|
12
|
+
`@bpmnkit/docspack` instead. `bpmnkit-docs` has no such floor.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
Source: https://bpmnkit.com/docs/packages/camunda-docspack
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# @bpmnkit/camunda-docspack — Installation
|
|
2
|
+
|
|
3
|
+
```sh
|
|
4
|
+
pnpm add -D @bpmnkit/camunda-docspack
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
There is no second CLI to learn: `bpmnkit-docs`, from
|
|
8
|
+
[`@bpmnkit/docspack`](/docs/packages/docspack), reads every pack installed.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Asking it
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npx bpmnkit-docs ask "how should I name an exclusive gateway" \
|
|
15
|
+
--pack @bpmnkit/camunda-docspack
|
|
16
|
+
npx bpmnkit-docs ask "POST /jobs/activation" --pack @bpmnkit/camunda-docspack
|
|
17
|
+
npx bpmnkit-docs ask "what permissions does creating a process instance need" \
|
|
18
|
+
--pack @bpmnkit/camunda-docspack
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`--pack` both disambiguates and pays for itself: the index is built by reading
|
|
22
|
+
every chunk off disk, so narrowing to one pack is roughly 150ms against 650ms
|
|
23
|
+
across both. Leave it off when you do not know which pack answers.
|
|
24
|
+
|
|
25
|
+
Confirm it is installed before relying on it:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
npx bpmnkit-docs list
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
@bpmnkit/camunda-docspack@0.1.1 1054 chunks
|
|
33
|
+
@bpmnkit/docspack@0.0.5 206 chunks
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
A pack missing from that list is a pack no answer can come from. See
|
|
37
|
+
[Using BPMN Kit with AI](/docs/guides/using-bpmnkit-with-ai) for the paragraph to
|
|
38
|
+
put in `AGENTS.md` or `CLAUDE.md` so an agent knows to ask both.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
Source: https://bpmnkit.com/docs/packages/camunda-docspack
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# @bpmnkit/camunda-docspack — Overview
|
|
2
|
+
|
|
3
|
+
`@bpmnkit/camunda-docspack` packages the **Camunda 8 documentation** as a
|
|
4
|
+
[docspack](https://docspack.dev/spec) pack you can search offline: BPMN and FEEL
|
|
5
|
+
references, engine concepts, the best-practice pages, and one digest per
|
|
6
|
+
Orchestration Cluster API operation.
|
|
7
|
+
|
|
8
|
+
It is the companion to [`@bpmnkit/docspack`](/docs/packages/docspack), and the
|
|
9
|
+
split is the point. Ask ours how to *drive the library*; ask this one what the
|
|
10
|
+
*engine* does — gateway semantics, FEEL syntax, job activation, permissions.
|
|
11
|
+
Those are different questions and the right answer to one is the wrong answer to
|
|
12
|
+
the other.
|
|
13
|
+
|
|
14
|
+
> **This is Camunda's documentation, not BPMN Kit's.** The content is the work of
|
|
15
|
+
> Camunda Services GmbH and copyright in it remains with them. This package adds
|
|
16
|
+
> only the tooling that stages, chunks and indexes it. It is redistributed under
|
|
17
|
+
> **CC BY-SA 3.0**, the licence Camunda publishes it under — which is why this
|
|
18
|
+
> package is CC BY-SA 3.0 rather than MIT like the rest of BPMN Kit. BPMN Kit is
|
|
19
|
+
> not affiliated with, endorsed by or sponsored by Camunda. For canonical and
|
|
20
|
+
> current documentation prefer [docs.camunda.io](https://docs.camunda.io).
|
|
21
|
+
|
|
22
|
+
It is built from the `docs/` tree of
|
|
23
|
+
[camunda/camunda-docs](https://github.com/camunda/camunda-docs) — the unreleased
|
|
24
|
+
**8.10** documentation — plus the Orchestration Cluster API specification, and
|
|
25
|
+
rebuilt weekly.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
Source: https://bpmnkit.com/docs/packages/camunda-docspack
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# @bpmnkit/camunda-docspack — Rebuilding it
|
|
2
|
+
|
|
3
|
+
A weekly workflow (`.github/workflows/camunda-docspack.yml`) rebuilds the pack
|
|
4
|
+
from upstream. By hand you need a camunda-docs checkout:
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
node packages/camunda-docspack/dist/cli.js --camunda-docs ../camunda-docs
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## API Reference
|
|
12
|
+
|
|
13
|
+
The published artefact is the `.llms/` payload; these exports are the build that
|
|
14
|
+
produces it.
|
|
15
|
+
|
|
16
|
+
| Export | Purpose |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| `build(options)` | Stage a camunda-docs checkout and write the `.llms/` payload |
|
|
19
|
+
| `stage(options)` | Run the staging transforms only, to a directory |
|
|
20
|
+
| `bpmnToText(xml)` | Render a BPMN diagram as a compact flow description |
|
|
21
|
+
| `readOperations(entry)` | Read one digest per operation from an OpenAPI document |
|
|
22
|
+
| `stripMdx(source, options)` | Reduce Camunda's MDX to indexable Markdown |
|
|
23
|
+
| `absoluteLinks(markdown, slug)` | Rewrite relative links to `docs.camunda.io` URLs |
|
|
24
|
+
| `notice(commit)` | The CC BY-SA 3.0 attribution written on every build |
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
Source: https://bpmnkit.com/docs/packages/camunda-docspack
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# @bpmnkit/camunda-docspack — What makes this corpus different
|
|
2
|
+
|
|
3
|
+
- **Diagrams as text.** The best-practice pages argue through embedded BPMN
|
|
4
|
+
diagrams, and Camunda's own Markdown export drops them. Each one is rendered as
|
|
5
|
+
a flow description instead, so a page about naming gateways still contains the
|
|
6
|
+
gateway, its question and its conditions.
|
|
7
|
+
- **227 API operations.** One digest per endpoint, read from the specification
|
|
8
|
+
rather than from the generated reference pages, with required permissions
|
|
9
|
+
decoded, the version it appeared in, and its consistency guarantee.
|
|
10
|
+
- **Every chunk cites its page.** Links are rewritten to absolute
|
|
11
|
+
`docs.camunda.io` URLs and each chunk ends with the page it came from.
|
|
12
|
+
- **Nothing dropped silently.** An MDX component the build does not recognise
|
|
13
|
+
fails the build by file and line rather than quietly thinning the corpus.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
Source: https://bpmnkit.com/docs/packages/camunda-docspack
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# @bpmnkit/connectors — API Reference
|
|
2
|
+
|
|
3
|
+
| Export | Description |
|
|
4
|
+
|---|---|
|
|
5
|
+
| `listConnectors()` | Every connector in the catalog, as summaries |
|
|
6
|
+
| `searchConnectors(query)` | Summaries matching name, description or keywords |
|
|
7
|
+
| `getTemplate(id)` | The full `ElementTemplate` for an id |
|
|
8
|
+
| `summarizeTemplate(template)` | `ConnectorSummary` from a template you hold |
|
|
9
|
+
| `propertyKey(property)` | The variable name a template property binds to |
|
|
10
|
+
| `applyConnectorTemplate(id, values)` | Catalog template → builder options + problems |
|
|
11
|
+
| `applyElementTemplate(template, values)` | Template object → builder options + problems |
|
|
12
|
+
| `validateElementTemplate(template)` | `{ valid, problems, warnings }` |
|
|
13
|
+
| `readTemplateDocument(text)` | Parse a file holding one template or many |
|
|
14
|
+
| `registerElementTemplates(templates)` | Merge templates into the catalog |
|
|
15
|
+
| `clearRegisteredTemplates()` | Drop everything registered |
|
|
16
|
+
| `CAMUNDA_CONNECTOR_TEMPLATES` | The 116 bundled templates, raw |
|
|
17
|
+
|
|
18
|
+
From `@bpmnkit/connectors/node`: `discoverElementTemplates`, `collectElementTemplates`,
|
|
19
|
+
`DEFAULT_CONFIG_FOLDER`, `TEMPLATES_SUBFOLDER`.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
Source: https://bpmnkit.com/docs/packages/connectors
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# @bpmnkit/connectors — Applying a template
|
|
2
|
+
|
|
3
|
+
Applying does not mutate an element. It turns a template plus your values into the **builder
|
|
4
|
+
options** for whichever element kind the template applies to, which you hand to
|
|
5
|
+
`@bpmnkit/core`:
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { applyConnectorTemplate } from "@bpmnkit/connectors";
|
|
9
|
+
import { Bpmn } from "@bpmnkit/core";
|
|
10
|
+
|
|
11
|
+
const { serviceTask, problems } = applyConnectorTemplate("io.camunda.connectors.Slack.v1", {
|
|
12
|
+
token: "=secrets.SLACK_TOKEN",
|
|
13
|
+
"data.channel": "#alerts",
|
|
14
|
+
"data.text": "=message",
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// serviceTask = {
|
|
18
|
+
// name: "Slack connector",
|
|
19
|
+
// taskType: "io.camunda:slack:1",
|
|
20
|
+
// ioMapping: { inputs: [...], outputs: [] },
|
|
21
|
+
// modelerTemplate: "io.camunda.connectors.Slack.v1",
|
|
22
|
+
// modelerTemplateVersion: "1",
|
|
23
|
+
// modelerTemplateIcon: "data:image/svg+xml;utf8,...",
|
|
24
|
+
// }
|
|
25
|
+
|
|
26
|
+
Bpmn.createProcess("alerting").startEvent("in").serviceTask("notify", serviceTask).build();
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`applyElementTemplate(template, values)` is the same operation against a template object
|
|
30
|
+
rather than a catalog id — the path a workspace template takes.
|
|
31
|
+
|
|
32
|
+
The result carries exactly one populated element key, so the template decides what it applies
|
|
33
|
+
to rather than the caller guessing:
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
interface ApplyResult {
|
|
37
|
+
serviceTask?: ServiceTaskOptions;
|
|
38
|
+
adHocSubProcess?: Partial<AdHocSubProcessOptions>;
|
|
39
|
+
startEvent?: Partial<StartEventOptions>;
|
|
40
|
+
boundaryEvent?: Partial<BoundaryEventOptions>;
|
|
41
|
+
intermediateEvent?: Partial<IntermediateCatchEventOptions>;
|
|
42
|
+
problems: ApplyProblem[];
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Nothing throws — "this value does not belong to this template" and "this required value is
|
|
47
|
+
missing" are answers a UI has to show, so they come back as `problems` alongside whatever
|
|
48
|
+
could be built:
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
applyConnectorTemplate("io.camunda.connectors.Slack.v1", {}).problems;
|
|
52
|
+
// [{ key: "token", kind: "missing-required",
|
|
53
|
+
// message: 'Missing required value for "OAuth token" (token)' }, …]
|
|
54
|
+
|
|
55
|
+
applyConnectorTemplate("nope.does.not.exist", {}).problems;
|
|
56
|
+
// [{ message: 'Unknown connector template "nope.does.not.exist"' }]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Application is deterministic: property order and the emitted bindings depend only on the
|
|
60
|
+
template and the values, never on iteration order or the clock. That is what lets a diagram be
|
|
61
|
+
rebuilt in CI and diffed.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
Source: https://bpmnkit.com/docs/packages/connectors
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# @bpmnkit/connectors — Installation
|
|
2
|
+
|
|
3
|
+
```sh
|
|
4
|
+
npm install @bpmnkit/connectors
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Browsing the catalog
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
import { listConnectors, searchConnectors, getTemplate } from "@bpmnkit/connectors";
|
|
12
|
+
|
|
13
|
+
listConnectors().length; // 116
|
|
14
|
+
searchConnectors("slack"); // 6 matches, inbound and outbound
|
|
15
|
+
|
|
16
|
+
const template = getTemplate("io.camunda.connectors.Slack.v1");
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
`listConnectors` and `searchConnectors` return `ConnectorSummary` — the shape a picker needs,
|
|
20
|
+
without the full template:
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
interface ConnectorSummary {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
taskType: string; // e.g. "io.camunda:http-json:1"
|
|
28
|
+
appliesTo: string[]; // e.g. ["bpmn:Task"]
|
|
29
|
+
direction: ConnectorDirection; // "outbound" | "inbound"
|
|
30
|
+
keywords: string[];
|
|
31
|
+
requiredInputs: ConnectorInputSpec[];
|
|
32
|
+
optionalInputs: ConnectorInputSpec[];
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Each `ConnectorInputSpec` carries what a form needs to render the field — `label`,
|
|
37
|
+
`description`, `default`, `choices`, whether it is `isSecret` or `isFeel`, and the `condition`
|
|
38
|
+
that decides whether it applies at all. `summarizeTemplate` produces the same shape from a
|
|
39
|
+
template you hold yourself.
|
|
40
|
+
|
|
41
|
+
`CAMUNDA_CONNECTOR_TEMPLATES` is the raw bundled array if you would rather work with the
|
|
42
|
+
templates directly.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
Source: https://bpmnkit.com/docs/packages/connectors
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# @bpmnkit/connectors — Overview
|
|
2
|
+
|
|
3
|
+
`@bpmnkit/connectors` answers two questions about Camunda 8 connectors: **which ones exist**,
|
|
4
|
+
and **what happens to a task when you apply one**.
|
|
5
|
+
|
|
6
|
+
It bundles the 116 out-of-the-box Camunda connector templates as data, so a catalog, a search
|
|
7
|
+
box or an AI tool call can work offline. And it resolves a template plus a set of values into
|
|
8
|
+
the `zeebe:taskDefinition`, `zeebe:ioMapping` and `zeebe:modelerTemplate` bookkeeping the
|
|
9
|
+
Modeler would write — deterministically, so the same template and values always produce the
|
|
10
|
+
same XML.
|
|
11
|
+
|
|
12
|
+
The package root is browser-safe. Everything that touches the filesystem lives behind
|
|
13
|
+
`@bpmnkit/connectors/node`.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
Source: https://bpmnkit.com/docs/packages/connectors
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# @bpmnkit/connectors — Stability
|
|
2
|
+
|
|
3
|
+
`@bpmnkit/connectors` carries the [1.0 stability promise](/docs/getting-started/stability):
|
|
4
|
+
its exports will not change shape without a major version.
|
|
5
|
+
|
|
6
|
+
Two things the promise does **not** freeze, because both track Camunda rather than this
|
|
7
|
+
package:
|
|
8
|
+
|
|
9
|
+
- **The catalog's contents.** Connectors are added, and upstream templates gain versions and
|
|
10
|
+
properties. A changed `CAMUNDA_CONNECTOR_TEMPLATES` is a minor; the types describing it are
|
|
11
|
+
covered as usual.
|
|
12
|
+
- **Template validation being strict about new upstream shapes.** A template that validates
|
|
13
|
+
today will not start failing in a minor — that direction *is* covered.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
Source: https://bpmnkit.com/docs/packages/connectors
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# @bpmnkit/connectors — Validating a template
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { validateElementTemplate } from "@bpmnkit/connectors";
|
|
5
|
+
|
|
6
|
+
validateElementTemplate(template);
|
|
7
|
+
// {
|
|
8
|
+
// valid: false,
|
|
9
|
+
// problems: [
|
|
10
|
+
// { path: 'properties[0].type',
|
|
11
|
+
// message: 'unknown property type "nope" — expected one of String, Text, Hidden, Dropdown, Boolean, Number' },
|
|
12
|
+
// { path: 'properties[0].binding', message: 'binding is required' },
|
|
13
|
+
// ],
|
|
14
|
+
// warnings: [],
|
|
15
|
+
// }
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Problems are reported by **path** rather than as a JSON-schema `oneOf` dump, and every problem
|
|
19
|
+
is collected rather than stopping at the first. Warnings are kept separate from problems, so a
|
|
20
|
+
CI gate can fail on one and not the other. `readTemplateDocument` parses a file that may hold
|
|
21
|
+
one template or an array of them.
|
|
22
|
+
|
|
23
|
+
The CLI wraps this as [`casen connector validate`](/docs/cli/connector), which exits non-zero
|
|
24
|
+
for CI and takes `--format json`.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
Source: https://bpmnkit.com/docs/packages/connectors
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# @bpmnkit/connectors — Workspace templates
|
|
2
|
+
|
|
3
|
+
A project can ship its own `.camunda/element-templates/`. The filesystem half lives behind its
|
|
4
|
+
own entry point so importing the catalog in a browser never pulls in `node:fs`:
|
|
5
|
+
|
|
6
|
+
```typescript
|
|
7
|
+
import { discoverElementTemplates, collectElementTemplates } from "@bpmnkit/connectors/node";
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
- `discoverElementTemplates` walks **upward** from a diagram to the project root, nearest
|
|
11
|
+
winning — the resolution a modeler needs.
|
|
12
|
+
- `collectElementTemplates` walks **downward** from a root — the sweep a CI check needs, so a
|
|
13
|
+
broken template in a sub-folder is reported rather than skipped because the root looked fine.
|
|
14
|
+
|
|
15
|
+
`registerElementTemplates` merges what you found into the catalog, later registration winning
|
|
16
|
+
on an id collision, so `listConnectors`, `searchConnectors` and `getTemplate` then see a
|
|
17
|
+
project's own templates alongside the bundled ones. `clearRegisteredTemplates` undoes it.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
Source: https://bpmnkit.com/docs/packages/connectors
|
|
@@ -6,6 +6,14 @@ Zeebe bindings, and drops collaborations, participants, message flows, lanes, da
|
|
|
6
6
|
artifacts, root-level messages and errors, multi-instance loop characteristics, full
|
|
7
7
|
`zeebe:ioMapping` entries and diagram interchange.
|
|
8
8
|
|
|
9
|
+
A sequence flow leaving an exclusive, inclusive or complex gateway carries `isDefault: true`
|
|
10
|
+
when the gateway names it in `bpmn:default`. It sits on the flow rather than on the gateway
|
|
11
|
+
because that is where its alternative, `condition`, sits — a model writing the branches of a
|
|
12
|
+
decision marks one of them instead of pointing back at a flow id. `expand` turns it into the
|
|
13
|
+
attribute; a flow marked `isDefault` that leaves anything else, or a gateway with two of them,
|
|
14
|
+
throws rather than being dropped, because a lost default is a gateway that deadlocks the first
|
|
15
|
+
time every condition is false.
|
|
16
|
+
|
|
9
17
|
`documentation` is carried on every element and on the process itself, because in Camunda 8 it
|
|
10
18
|
is not decoration: on an ad-hoc sub-process child it is the tool description handed to the LLM,
|
|
11
19
|
and on a start event it is where the process input contract is written. It had been dropped, so
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# @bpmnkit/core — Installation — `createCompactStream(options?)`
|
|
2
|
+
|
|
3
|
+
Reads a diagram out of a model's token stream, so it can be rendered while it is still being
|
|
4
|
+
written. A model emits a diagram one character at a time, and the outermost `}` — the one
|
|
5
|
+
`JSON.parse` waits for — is the last character it sends, so the seconds before it arrives are
|
|
6
|
+
unusable to everything downstream.
|
|
7
|
+
|
|
8
|
+
This does not parse the document. It takes complete `{…}` literals as they close and keeps the
|
|
9
|
+
ones shaped like a `CompactElement` or a `CompactFlow` — the innermost objects, and therefore
|
|
10
|
+
the first to finish.
|
|
11
|
+
|
|
12
|
+
```typescript
|
|
13
|
+
import { createCompactStream } from "@bpmnkit/core";
|
|
14
|
+
|
|
15
|
+
// `base` is the diagram being edited, so a frame shows the whole process rather
|
|
16
|
+
// than the fragment the model is adding to it. Omit it to build from nothing.
|
|
17
|
+
const stream = createCompactStream({ base: currentDiagram });
|
|
18
|
+
|
|
19
|
+
for await (const chunk of tokens) {
|
|
20
|
+
const frame = stream.push(chunk); // null until the frame changes
|
|
21
|
+
if (frame) canvas.loadDefinitions(frame, { keepViewport: true });
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Not parsing is also what makes it indifferent to what it is reading: a tool-call argument, a
|
|
26
|
+
fenced JSON block in an assistant's prose, and the body of a code-mode snippet all carry the
|
|
27
|
+
same literals, and none of them has to be valid as a whole.
|
|
28
|
+
|
|
29
|
+
**Frames are advisory.** Every one is a guess at an unfinished document, and the caller is
|
|
30
|
+
expected to have an authoritative result coming. `push` never throws on input, drops what it
|
|
31
|
+
cannot place, and strips `isDefault` from a flow rather than failing when the gateway it claims
|
|
32
|
+
has not been written yet — a preview without the marker beats no preview. Use the model's
|
|
33
|
+
finished output, not a frame, as the thing you save or deploy.
|
|
34
|
+
|
|
35
|
+
A single pass over a brace stack reads each character once and considers each literal once,
|
|
36
|
+
innermost first, so a sub-process is seen after the children it reclaims from the top level.
|
|
37
|
+
On a recorded Claude run writing a seven-element order process, the first renderable frame
|
|
38
|
+
arrived 16% of the way into the tool argument, with 15 frames following.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
Source: https://bpmnkit.com/docs/packages/core
|
|
@@ -20,9 +20,9 @@ with `explicitJoins` that refusal is the only thing that tells you.
|
|
|
20
20
|
the whole topology, and on a document you were handed that means rewriting edges you never
|
|
21
21
|
touched.
|
|
22
22
|
|
|
23
|
-
`{ strict: true }`
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
`{ strict: true }` was the former name for this option. It was removed in 1.0.0 — "strict"
|
|
24
|
+
says nothing about what it is strict *about*, and `applyBpmnOperations` takes a `strict` that
|
|
25
|
+
means something else entirely. Rename it to `explicitJoins`; the behaviour is identical.
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
Source: https://bpmnkit.com/docs/packages/core
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
# @bpmnkit/docspack —
|
|
2
|
-
|
|
3
|
-
```sh
|
|
4
|
-
pnpm add -D @bpmnkit/docspack
|
|
5
|
-
```
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
## Giving an agent access
|
|
1
|
+
# @bpmnkit/docspack — Giving an agent access
|
|
9
2
|
|
|
10
3
|
Any agent with a shell can run the command, so one paragraph in `AGENTS.md`, `CLAUDE.md`
|
|
11
4
|
or `.cursor/rules` is the whole setup:
|
|
12
5
|
|
|
13
6
|
```md
|
|
14
|
-
Run `npx bpmnkit-docs ask "<question>"` for BPMN Kit documentation
|
|
15
|
-
|
|
7
|
+
Run `npx bpmnkit-docs ask "<question>"` for BPMN Kit documentation, and
|
|
8
|
+
`npx bpmnkit-docs ask "<question>" --pack @bpmnkit/camunda-docspack` for Camunda 8
|
|
9
|
+
documentation — BPMN semantics, FEEL, engine behaviour, the REST API. Both answer
|
|
10
|
+
from the versions this project installed. Prefer what they return over recalled
|
|
16
11
|
knowledge — when the two disagree, the retrieved chunk is right.
|
|
17
12
|
```
|
|
18
13
|
|
|
@@ -30,5 +30,11 @@ with the versions installed.
|
|
|
30
30
|
|
|
31
31
|
Options: `--limit <n>`, `--max-tokens <n>`, `--pack <name>`, `--cwd <dir>`.
|
|
32
32
|
|
|
33
|
+
`--pack` narrows before the index is built, not after, so asking one pack a
|
|
34
|
+
question does not pay for reading the others — roughly 150ms against 650ms
|
|
35
|
+
across both packs. A name that is not installed is an error listing what is,
|
|
36
|
+
rather than an empty answer that would read as "the documentation does not cover
|
|
37
|
+
this".
|
|
38
|
+
|
|
33
39
|
---
|
|
34
40
|
Source: https://bpmnkit.com/docs/packages/docspack
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# @bpmnkit/docspack — The other pack
|
|
2
|
+
|
|
3
|
+
BPMN Kit publishes a second pack:
|
|
4
|
+
**[`@bpmnkit/camunda-docspack`](/docs/packages/camunda-docspack)**, the Camunda 8
|
|
5
|
+
documentation — BPMN and FEEL references, engine concepts, best practices and the
|
|
6
|
+
Orchestration Cluster API. `bpmnkit-docs` reads both, so ask this package how to
|
|
7
|
+
drive the library and that one what the engine does:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npx bpmnkit-docs ask "how should I name an exclusive gateway" --pack @bpmnkit/camunda-docspack
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Install them together, and tell your agent about both — see
|
|
14
|
+
[Using BPMN Kit with AI](/docs/guides/using-bpmnkit-with-ai).
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
pnpm add -D @bpmnkit/docspack @bpmnkit/camunda-docspack
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
Source: https://bpmnkit.com/docs/packages/docspack
|