@bpmnkit/docspack 0.0.6 → 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.previewing-while-the-model-writes.md +57 -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.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-createcompactstream-options.md +41 -0
- package/.llms/chunks/packages.core.installation-joins-inferred-by-default-or-declared.md +3 -3
- 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 +511 -2
- package/README.md +1 -1
- package/llms.txt +33 -2
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Stability and Versioning — Deprecation
|
|
2
|
+
|
|
3
|
+
Nothing that is public API disappears without warning.
|
|
4
|
+
|
|
5
|
+
1. It is marked `@deprecated` in the type declarations, naming what to use instead. Your editor
|
|
6
|
+
and your build show it; nothing breaks.
|
|
7
|
+
2. It keeps working for **at least one minor release**, and is listed in the changelog entry
|
|
8
|
+
that deprecated it.
|
|
9
|
+
3. It is removed only in a major, and the major's release notes list every removal.
|
|
10
|
+
|
|
11
|
+
An alias kept purely for compatibility is documented as such — `ProcessBuilder`'s `strict`
|
|
12
|
+
option is the existing example, a deprecated alias for `explicitJoins`.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
Source: https://bpmnkit.com/docs/getting-started/stability
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Stability and Versioning — Support window
|
|
2
|
+
|
|
3
|
+
Fixes land on the **latest minor of the current major**. When a new major ships, the previous
|
|
4
|
+
major gets security fixes for **six months**; other fixes require an upgrade.
|
|
5
|
+
|
|
6
|
+
Security issues should be reported through
|
|
7
|
+
[GitHub](https://github.com/bpmnkit/monorepo/issues) rather than in a public pull request.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Which packages this covers
|
|
11
|
+
|
|
12
|
+
A package is covered by this page once it is at **1.0.0 or above**, and not before. The
|
|
13
|
+
distinction is deliberate: several packages are published, useful, and not yet ready to freeze
|
|
14
|
+
an API — shipping them as 1.0 to make the list tidy would be a promise the project could not
|
|
15
|
+
keep. Joining later costs nothing, because going from 0.x to 1.0 breaks no one, so the bar is
|
|
16
|
+
applied strictly rather than generously.
|
|
17
|
+
|
|
18
|
+
Three conditions, all of which must hold:
|
|
19
|
+
|
|
20
|
+
1. **A test suite that would catch its own breakage.**
|
|
21
|
+
2. **A documentation page** on this site.
|
|
22
|
+
3. **An API worth defending for a year.**
|
|
23
|
+
|
|
24
|
+
**Twelve packages** meet them today and carry the promise:
|
|
25
|
+
|
|
26
|
+
| | |
|
|
27
|
+
|---|---|
|
|
28
|
+
| [`@bpmnkit/core`](/docs/packages/core) | [`@bpmnkit/feel`](/docs/packages/feel) |
|
|
29
|
+
| [`@bpmnkit/canvas`](/docs/packages/canvas) | [`@bpmnkit/editor`](/docs/packages/editor) |
|
|
30
|
+
| [`@bpmnkit/engine`](/docs/packages/engine) | [`@bpmnkit/plugins`](/docs/packages/plugins) |
|
|
31
|
+
| [`@bpmnkit/api`](/docs/packages/api) | [`@bpmnkit/ascii`](/docs/packages/ascii) |
|
|
32
|
+
| [`@bpmnkit/connectors`](/docs/packages/connectors) | [`@bpmnkit/connector-gen`](/docs/packages/connector-gen) |
|
|
33
|
+
| [`@bpmnkit/docspack`](/docs/packages/docspack) | [`@bpmnkit/cli`](/docs/cli/casen) |
|
|
34
|
+
|
|
35
|
+
The other fourteen published packages stay on 0.x on purpose, and make no promise. Most are
|
|
36
|
+
short of the first two conditions; the rest are worked examples, scaffolders, or generated
|
|
37
|
+
builds with no API of their own to freeze.
|
|
38
|
+
|
|
39
|
+
The membership is not only prose. It lives in `STABLE` in
|
|
40
|
+
[`scripts/published-packages.mjs`](https://github.com/bpmnkit/monorepo/blob/main/scripts/published-packages.mjs),
|
|
41
|
+
and the repo's own checks enforce both directions of it: nothing on the list may lack tests or
|
|
42
|
+
a documentation page, and nothing at 1.0.0 or above may be missing from the list. A major
|
|
43
|
+
version cannot arrive by accident.
|
|
44
|
+
|
|
45
|
+
Whatever this page says, a package's current version on
|
|
46
|
+
[npm](https://www.npmjs.com/org/bpmnkit) is the authoritative answer.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
Source: https://bpmnkit.com/docs/getting-started/stability
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Stability and Versioning — Versions are per package, not per repo
|
|
2
|
+
|
|
3
|
+
Packages version independently. `@bpmnkit/core` reaching 2.0.0 does not make
|
|
4
|
+
`@bpmnkit/canvas` 2.0.0, and the two can sit many majors apart.
|
|
5
|
+
|
|
6
|
+
Sibling dependencies are declared as carets, so `@bpmnkit/plugins` depending on
|
|
7
|
+
`^1.2.0` of `@bpmnkit/core` resolves to one shared copy alongside your own `^1.4.0`.
|
|
8
|
+
Two copies of `@bpmnkit/core` in one tree is not a duplicate of one copy — class identity,
|
|
9
|
+
`instanceof` and module-level registries all stop matching across the seam — so keep BPMN Kit
|
|
10
|
+
packages within one major of each other.
|
|
11
|
+
|
|
12
|
+
Releases are cut by [Changesets](https://github.com/changesets/changesets). Every change that
|
|
13
|
+
reaches npm has a changeset naming its packages and its bump, and lands in that package's
|
|
14
|
+
`CHANGELOG.md`.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
Source: https://bpmnkit.com/docs/getting-started/stability
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Stability and Versioning — What counts as public API
|
|
2
|
+
|
|
3
|
+
**The public API of a package is what its `exports` entry points export, minus anything
|
|
4
|
+
marked `@internal`.** Nothing else.
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Bpmn } from "@bpmnkit/core" // ✅ API
|
|
8
|
+
import { minimap } from "@bpmnkit/plugins/minimap" // ✅ API — a declared subpath
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
These are **not** API, and may change in any release:
|
|
12
|
+
|
|
13
|
+
| Not API | Why |
|
|
14
|
+
|---|---|
|
|
15
|
+
| Deep paths into `dist/` | An implementation layout, not an entry point |
|
|
16
|
+
| Members marked `/** @internal */` | Reachable from the `.d.ts` because TypeScript has no other way to say "not yours" — `ProcessBuilder` carries several |
|
|
17
|
+
| Anything reachable only by structural inference | If you cannot import it by name from an entry point, it is not named in the contract |
|
|
18
|
+
| `src/` in the repo | The published package is the artifact; the repository is not |
|
|
19
|
+
|
|
20
|
+
Each package's entry points are listed in its `exports` map. `@bpmnkit/plugins` is the one to
|
|
21
|
+
watch: it has **no root export**, only 34 subpaths, one per plugin.
|
|
22
|
+
|
|
23
|
+
**For a package whose product is a command**, `exports` says nothing — `@bpmnkit/cli` has none
|
|
24
|
+
at all. Its public API is instead its **documented commands**: the command and flag names, the
|
|
25
|
+
meaning of its exit codes, and the shape of any `--format json` output. Prose written to a
|
|
26
|
+
terminal for a human to read is not API, and neither is the exact wording of an error.
|
|
27
|
+
|
|
28
|
+
For a package that renders UI, the **rendered DOM and its class names are not API** either.
|
|
29
|
+
Style through the documented CSS custom properties; a panel's internal markup can change in a
|
|
30
|
+
minor.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
Source: https://bpmnkit.com/docs/getting-started/stability
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Stability and Versioning — What is a breaking change
|
|
2
|
+
|
|
3
|
+
### Runtime behaviour
|
|
4
|
+
|
|
5
|
+
Breaking: removing or renaming an export or an entry point; removing a function parameter or
|
|
6
|
+
making an optional one required; throwing where a value used to be returned; changing a
|
|
7
|
+
documented default.
|
|
8
|
+
|
|
9
|
+
### Types
|
|
10
|
+
|
|
11
|
+
Type-level breakage is real breakage: a build that no longer compiles is a broken build. The
|
|
12
|
+
direction matters, and it is the opposite for things we hand you and things you hand us.
|
|
13
|
+
|
|
14
|
+
| Change | Verdict |
|
|
15
|
+
|---|---|
|
|
16
|
+
| Adding an export, or a new entry point | minor |
|
|
17
|
+
| Adding an **optional** property to an options object | minor |
|
|
18
|
+
| Adding a member to a union we **accept** | minor |
|
|
19
|
+
| Adding a member to a union we **return** | **major** — your exhaustive `switch` stops compiling |
|
|
20
|
+
| Adding a **required** property to anything you construct | **major** |
|
|
21
|
+
| Making a returned property optional | **major** — you now have to narrow it |
|
|
22
|
+
| Narrowing a return type | **major** |
|
|
23
|
+
| Widening a parameter type | minor |
|
|
24
|
+
| Renaming an exported type | **major**, even when the shape is identical |
|
|
25
|
+
|
|
26
|
+
### Generated BPMN, DMN and Form documents
|
|
27
|
+
|
|
28
|
+
This is the promise that matters most here, and the one a general semver policy has nothing
|
|
29
|
+
to say about. The rule is:
|
|
30
|
+
|
|
31
|
+
> **A change is breaking if it moves `semanticHash` for the same input. A change to the bytes
|
|
32
|
+
> alone is not.**
|
|
33
|
+
|
|
34
|
+
`semanticHash` is BPMN Kit's canonical, presentation-free projection of a model, and it is
|
|
35
|
+
exported for exactly this purpose. Verified against the current build:
|
|
36
|
+
|
|
37
|
+
| Property | Holds |
|
|
38
|
+
|---|---|
|
|
39
|
+
| The same input rebuilt produces the same hash | ✅ |
|
|
40
|
+
| `applyAutoLayout` does not move it | ✅ |
|
|
41
|
+
| Renaming an element moves it | ✅ |
|
|
42
|
+
| Changing an element **id** moves it | ✅ |
|
|
43
|
+
|
|
44
|
+
So, concretely:
|
|
45
|
+
|
|
46
|
+
- **Major** — different element ids, a changed document structure, a different default
|
|
47
|
+
attribute on an emitted element, a changed FEEL expression. Anyone diffing generated files
|
|
48
|
+
in review, or deploying them by id, sees these.
|
|
49
|
+
- **Minor or patch** — different layout coordinates, different attribute order, different
|
|
50
|
+
whitespace, a nicer waypoint route. The picture moved; the model did not.
|
|
51
|
+
|
|
52
|
+
For the avoidance of doubt about precedent: `@bpmnkit/core` 0.4.0 derived element ids from the
|
|
53
|
+
model instead of generating them randomly. That moved `semanticHash` for every document, and
|
|
54
|
+
shipped as a *minor*. Under this policy it is a major, and 0.x is the only reason it was not.
|
|
55
|
+
|
|
56
|
+
### Formats outside the package
|
|
57
|
+
|
|
58
|
+
These are contracts even though no TypeScript signature describes them, and the same rule
|
|
59
|
+
applies — a change that makes an existing file, store or caller stop working is major:
|
|
60
|
+
|
|
61
|
+
- The **`.bpmn.tests.json` sidecar** read by `casen test` and the runner's Tests tab.
|
|
62
|
+
- **Profile storage on disk** — `~/.config/casen` on Linux, `~/Library/Application Support/casen`
|
|
63
|
+
on macOS, `%APPDATA%\casen` on Windows. A format change must migrate existing profiles, not
|
|
64
|
+
invalidate them.
|
|
65
|
+
- The **`@bpmnkit/proxy` HTTP surface**, for the routes the documentation names.
|
|
66
|
+
- **Element template validation** — a template that validates today does not start failing in
|
|
67
|
+
a minor.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
Source: https://bpmnkit.com/docs/getting-started/stability
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Stability and Versioning — What is not a breaking change
|
|
2
|
+
|
|
3
|
+
- Adding a feature, an export, an entry point, or an optional parameter.
|
|
4
|
+
- Fixing a bug so behaviour matches its documentation. If you relied on the bug, this can
|
|
5
|
+
still move under you; it is a patch, and the changelog will say what changed.
|
|
6
|
+
- Performance, internal structure, dependency versions inside a compatible range.
|
|
7
|
+
- Anything about layout, formatting or diagram interchange that leaves `semanticHash` alone.
|
|
8
|
+
- Documentation, READMEs, or the contents of `@bpmnkit/docspack`.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Runtime support
|
|
12
|
+
|
|
13
|
+
The supported runtimes are listed under
|
|
14
|
+
[Runtime Requirements](/docs/getting-started/installation#runtime-requirements): Node.js 20
|
|
15
|
+
LTS and newer, Deno 1.40+, Bun 1.0+, and browsers supporting ES2022. Every package is
|
|
16
|
+
**ESM-only** — there is no CommonJS build, and there will not be one.
|
|
17
|
+
|
|
18
|
+
Raising the floor follows the runtime's own lifecycle:
|
|
19
|
+
|
|
20
|
+
- Dropping a Node.js major that is **still in LTS** is a **major**.
|
|
21
|
+
- Dropping one that has reached **end of life** is a **minor**, called out in the release notes.
|
|
22
|
+
- Raising the browser baseline past ES2022 is a **major**.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
Source: https://bpmnkit.com/docs/getting-started/stability
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Stability and Versioning — What this page is for
|
|
2
|
+
|
|
3
|
+
A version number is a promise about breakage. This page says exactly which promise BPMN Kit
|
|
4
|
+
makes, so you can decide what to write in your `package.json` and know what an upgrade can
|
|
5
|
+
do to you.
|
|
6
|
+
|
|
7
|
+
Every package follows [Semantic Versioning 2.0.0](https://semver.org). The rest of this page
|
|
8
|
+
is the part semver leaves open: what counts as *the API* in a toolkit that also emits XML
|
|
9
|
+
files, writes state to disk and speaks HTTP.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## What is covered today
|
|
13
|
+
|
|
14
|
+
The promises below take effect for a given package **when it reaches 1.0.0**. Twelve packages
|
|
15
|
+
do — they are listed at the end of this page. A package still on 0.x is **not** covered by
|
|
16
|
+
them, even though other packages in the workspace are: under semver, 0.x makes no
|
|
17
|
+
compatibility promise at all. Releases of those have been additive in practice, but *in
|
|
18
|
+
practice* is not a contract, so pin an exact version if one of them matters to you.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
Source: https://bpmnkit.com/docs/getting-started/stability
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# AI Integration — Previewing While the Model Writes
|
|
2
|
+
|
|
3
|
+
A diagram is visual, and a model takes seconds to write one. Waiting for the last token to
|
|
4
|
+
show anything means the user watches prose scroll past while the only interesting part of the
|
|
5
|
+
answer is already most of the way written.
|
|
6
|
+
|
|
7
|
+
Nothing downstream can use a half-written document, though — `JSON.parse` wants the closing
|
|
8
|
+
brace, and the outermost one is the very last character a tool call sends.
|
|
9
|
+
`createCompactStream` sidesteps that by not parsing the document at all. It takes complete
|
|
10
|
+
`{…}` literals as they close and keeps the ones shaped like an element or a flow, which are
|
|
11
|
+
the innermost objects and so the first to finish:
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { createCompactStream } from "@bpmnkit/core";
|
|
15
|
+
|
|
16
|
+
const stream = createCompactStream({ base: currentDiagram });
|
|
17
|
+
|
|
18
|
+
for await (const chunk of tokens) {
|
|
19
|
+
const frame = stream.push(chunk); // null until the frame changes
|
|
20
|
+
if (frame) canvas.loadDefinitions(frame, { keepViewport: true });
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Pass `base` when the model is editing something. It streams only what it is adding, so without
|
|
25
|
+
the diagram it started from a frame is a disconnected fragment rather than the process with the
|
|
26
|
+
fragment in it.
|
|
27
|
+
|
|
28
|
+
`keepViewport` matters as much as the frames do: without it the canvas re-frames the diagram on
|
|
29
|
+
every update and pulls the view out from under whoever is watching. With it, the process grows
|
|
30
|
+
in place — the layout is stable enough for that, because appending to a diagram does not move
|
|
31
|
+
what is already placed.
|
|
32
|
+
|
|
33
|
+
### Frames are advisory
|
|
34
|
+
|
|
35
|
+
Every frame is a guess at an unfinished document. `push` never throws, drops what it cannot
|
|
36
|
+
place, and strips a flow's `isDefault` rather than failing when the gateway it claims has not
|
|
37
|
+
arrived. That is the whole bargain: a frame that guesses wrong costs one render, so the
|
|
38
|
+
authoritative result is whatever the model finishes with, and that is what you save or deploy.
|
|
39
|
+
|
|
40
|
+
### Where the frames come from
|
|
41
|
+
|
|
42
|
+
The local proxy (`bpmn-ai-server`) sends them on `/chat` as `preview` events, from two places:
|
|
43
|
+
|
|
44
|
+
- **The tool call being written** — argument fragments as they stream, which is the only thing
|
|
45
|
+
that covers a process the model composes in a single call.
|
|
46
|
+
- **The MCP server's own state** — one frame per mutating tool call, once anything has been
|
|
47
|
+
written. These take over as soon as they exist; they are the model's own state rather than a
|
|
48
|
+
guess at an unfinished document.
|
|
49
|
+
|
|
50
|
+
A client renders `preview` as it likes and treats the `xml` event at the end of the stream as
|
|
51
|
+
the result. The editor's AI panel does this, and additionally outlines the elements the diagram
|
|
52
|
+
being edited does not have — so an edit reads as an edit rather than a rewrite. It marks
|
|
53
|
+
nothing when the diagram has no sequence flows yet: a process built from scratch is new all the
|
|
54
|
+
way through, and marking everything says no more than marking none of it.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
Source: https://bpmnkit.com/docs/guides/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,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
|