@camunda8/cli 4.6.0-alpha.7 → 4.6.1-alpha.1
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/README.md +4 -0
- package/dist/default-plugins/element-template/AGENTS.md +24 -27
- package/dist/default-plugins/element-template/README.md +19 -15
- package/dist/default-plugins/element-template/c8ctl-plugin.js +338 -461
- package/dist/default-plugins/element-template/docs/design.md +38 -75
- package/dist/default-plugins/element-template/package.json +1 -1
- package/dist/vendor/bpmn-element-templates.cjs +4713 -4599
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,6 +29,10 @@ _Full transparency_:
|
|
|
29
29
|
this cli is also a pilot-coding experiment, practicing [Agentic Engineering](https://addyosmani.com/blog/agentic-engineering/).
|
|
30
30
|
Guided by humans, the codebase is (mostly) built by your friendly neighborhood LLM, fully dogfooding the Human-in-the-Loop pattern.
|
|
31
31
|
|
|
32
|
+
Repository automation is documented in the
|
|
33
|
+
[agentic workflows operator guide](.github/AGENTIC-WORKFLOWS.md). Issue implementation,
|
|
34
|
+
dual-engine review, and guarded auto-merge are inactive until explicitly enabled.
|
|
35
|
+
|
|
32
36
|
## Installation
|
|
33
37
|
|
|
34
38
|
### Requirements
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# AGENTS.md — `element-template` plugin
|
|
2
2
|
|
|
3
3
|
Read [docs/design.md](./docs/design.md) before changing this plugin. It
|
|
4
|
-
covers the **why**: vendor bundle,
|
|
5
|
-
strategy (`
|
|
4
|
+
covers the **why**: vendor bundle, npm package source choice, cache
|
|
5
|
+
strategy (`id@version`-keyed dedup), explicit bootstrap, and semver-based
|
|
6
6
|
version resolution.
|
|
7
7
|
|
|
8
8
|
## Where things live
|
|
@@ -14,9 +14,7 @@ version resolution.
|
|
|
14
14
|
| `migration/` | The migration engine behind `update`: recipe parser (`recipe.ts`, schema in `migrates-from.schema.json`), step resolution (`steps.ts`), value resolution (`plan.ts`), applying to a headless modeler (`apply.ts`) and the report model (`report.ts`). **Self-contained: nothing in this folder may import from c8ctl or from the rest of the plugin**, so it can be lifted out into a library. `migration-output.ts` (outside it) renders the report. |
|
|
15
15
|
| `template-ref.ts` | `parseTemplateRef`, `readBpmnInput`, `getExecutionPlatformVersion`, `findLocalTemplates` (Modeler-aligned `.camunda/element-templates/` + Modeler user-data lookup), `resolveOotbTemplate`, `resolveTemplateId` (local first, then OOTB — every subcommand's id path), `loadTemplate` |
|
|
16
16
|
| `cache.ts` | Cache I/O, sync, search, version resolution |
|
|
17
|
-
| `releases.ts` | `camunda/connectors` GitHub releases: listing, newest-release-per-minor selection, bundle download, tar.gz reader |
|
|
18
17
|
| `helpers.ts` | `--set` parsing, file/URL fetch, glob → regex, multi-binding lookup, condition warnings, `atomicOverwriteFile` |
|
|
19
|
-
| `binding.ts` | Binding-target resolution shared by `apply`/`edit` — which moddle child + property a `zeebe:input`/etc. binding writes to. Hand-rolled stand-in for bpmn-js-element-templates' internal `setPropertyValue`; see the note at the top of the file about replacing it once bpmn-io/bpmn-js-element-templates#236 ships. |
|
|
20
18
|
| `vendor.ts` | `resolveVendorBundle()` + the minimal bpmn-js `Modeler`/`modeling` type surface shared by `apply`/`edit` |
|
|
21
19
|
| `vendor-src/bundle-entry.js` | esbuild entry — re-exports `Modeler`, `CloudElementTemplatesCoreModule`, `ZeebeModdleExtension` |
|
|
22
20
|
|
|
@@ -28,16 +26,16 @@ version resolution.
|
|
|
28
26
|
esbuild bundles.
|
|
29
27
|
- **Cache file shape mirrors Desktop Modeler's
|
|
30
28
|
`.camunda-connector-templates.json`.** Don't change the format
|
|
31
|
-
without reason —
|
|
32
|
-
|
|
29
|
+
without reason — current package templates replace cached entries
|
|
30
|
+
by `id@version`; `metadata.upstreamRef` records their origin.
|
|
33
31
|
- **No subcommand auto-bootstraps the cache.** OOTB-id resolution
|
|
34
32
|
is guarded by `requireCachePresent()` in `cache.ts`, which
|
|
35
33
|
throws the shared `CACHE_NOT_FOUND_MESSAGE` when the cache is
|
|
36
34
|
absent. The reason auto-bootstrap is forbidden: bootstrap progress
|
|
37
35
|
goes through `logger.info`, which writes to stdout in text mode —
|
|
38
36
|
it would corrupt `apply | bpmn lint` and `get <id> > template.json`
|
|
39
|
-
pipelines, and racing cold-cache invocations would both
|
|
40
|
-
same
|
|
37
|
+
pipelines, and racing cold-cache invocations would both install the
|
|
38
|
+
same package. Don't re-add a bootstrap call to any subcommand
|
|
41
39
|
without changing the logger story first.
|
|
42
40
|
- **Path/URL refs and local id hits must not trigger the cache check.**
|
|
43
41
|
Detection happens in `parseTemplateRef()` in `template-ref.ts`
|
|
@@ -69,12 +67,14 @@ version resolution.
|
|
|
69
67
|
call — correct for first-time application or a version upgrade, but
|
|
70
68
|
it silently clobbers any hand-authored customization layered into a
|
|
71
69
|
Hidden-owned extension attribute (see c8ctl#466). `edit` never calls
|
|
72
|
-
`applyTemplate()` — it only writes
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
70
|
+
`applyTemplate()` — it only writes the `--set` properties via the
|
|
71
|
+
library's `elementTemplates.setPropertyValue` (gated by
|
|
72
|
+
`isConditionMet`), so it can't reset anything the template doesn't
|
|
73
|
+
explicitly touch. `edit` must also never register the template via
|
|
74
|
+
`elementTemplates.set()`: the library's ConditionalBehavior would then
|
|
75
|
+
re-run template application whenever a write changes the active
|
|
76
|
+
property set. Don't collapse these back into one code path without
|
|
77
|
+
re-solving that tension.
|
|
78
78
|
- **JSON output uses element-templates schema field names verbatim.**
|
|
79
79
|
No invented derivations — `binding`, `optional`, `value`, `condition`,
|
|
80
80
|
`group` (id), `elementType: { value }`, `engines: { camunda }`. The
|
|
@@ -87,16 +87,12 @@ version resolution.
|
|
|
87
87
|
WeakMap-based `sourceByDetail` side table in `loadTemplate` preserves
|
|
88
88
|
this identity so `get-properties` doesn't collapse them and `--set`
|
|
89
89
|
writes to all matching duplicates.
|
|
90
|
-
- **Templates come from
|
|
91
|
-
`
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
failed — otherwise one transient error would drop a whole minor line.
|
|
97
|
-
The release listing endpoint is overridable via
|
|
98
|
-
`C8CTL_CONNECTORS_RELEASES_URL` — useful for tests against a local
|
|
99
|
-
fixture server.
|
|
90
|
+
- **Templates come from `@camunda/connectors-element-templates` via
|
|
91
|
+
`c8ctl.npm`**. Sync installs into a temporary directory under the locked
|
|
92
|
+
cache, then reads `src/element-templates/*.json`;
|
|
93
|
+
`C8CTL_ELEMENT_TEMPLATES_PACKAGE` allows package specs, URLs, and local
|
|
94
|
+
paths. Failed installs or malformed template files retain the old cache
|
|
95
|
+
and skip `--prune`.
|
|
100
96
|
|
|
101
97
|
## Testing
|
|
102
98
|
|
|
@@ -113,10 +109,11 @@ Agent v1 to v2 migration against the real templates, fetched at a pinned
|
|
|
113
109
|
C8CTL_FIDELITY=1 node --experimental-strip-types --test tests/unit/element-template-migration-upstream-fidelity.test.ts
|
|
114
110
|
```
|
|
115
111
|
|
|
116
|
-
Smoke-test against the live
|
|
112
|
+
Smoke-test against the live npm package (writes to a throwaway
|
|
117
113
|
dir):
|
|
118
114
|
|
|
119
115
|
```bash
|
|
120
|
-
C8CTL_DATA_DIR=/tmp/c8ctl-smoke
|
|
121
|
-
|
|
116
|
+
export C8CTL_DATA_DIR=/tmp/c8ctl-smoke
|
|
117
|
+
node --experimental-strip-types src/index.ts element-template sync
|
|
118
|
+
node --experimental-strip-types src/index.ts element-template search "AWS S3"
|
|
122
119
|
```
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
A default [c8ctl](https://github.com/camunda/c8ctl) plugin for applying
|
|
4
4
|
Camunda element templates to BPMN diagrams, inspecting their properties,
|
|
5
5
|
and exporting raw template JSON. Supports out-of-the-box (OOTB)
|
|
6
|
-
connector templates by id (
|
|
7
|
-
|
|
6
|
+
connector templates by id (cached from the Camunda npm package), plus
|
|
7
|
+
arbitrary local paths and URLs.
|
|
8
8
|
|
|
9
9
|
## Subcommands
|
|
10
10
|
|
|
@@ -99,9 +99,19 @@ c8ctl element-template get io.camunda.connectors.HttpJson.v2 --no-icon # drop t
|
|
|
99
99
|
|
|
100
100
|
# Refresh the local OOTB template cache
|
|
101
101
|
c8ctl element-template sync
|
|
102
|
-
c8ctl element-template sync --prune # also drop entries
|
|
102
|
+
c8ctl element-template sync --prune # also drop entries absent from the installed package
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
+
`sync` installs `@camunda/connectors-element-templates` into a temporary
|
|
106
|
+
directory using npm's user, global, and environment registry, authentication,
|
|
107
|
+
proxy, and CA settings. A project `.npmrc` in the invoking directory is not
|
|
108
|
+
read, because npm runs the install in the temporary directory. Set
|
|
109
|
+
`C8CTL_ELEMENT_TEMPLATES_PACKAGE` to a package spec, tarball URL, or local
|
|
110
|
+
package path for pinned or offline use. Every sync installs afresh, so changes
|
|
111
|
+
to a local source are picked up.
|
|
112
|
+
The override must resolve to one package that ships `src/element-templates`; a
|
|
113
|
+
package that depends on another template package is not supported.
|
|
114
|
+
|
|
105
115
|
## Migrating to a newer template
|
|
106
116
|
|
|
107
117
|
`update <template-id>` moves every element that uses that template to a newer
|
|
@@ -314,7 +324,7 @@ but sources, groups, guard lists, and value-map rules must be non-empty.
|
|
|
314
324
|
|
|
315
325
|
c8ctl ships no connector recipes. The AI Agent v2 templates in
|
|
316
326
|
`camunda/connectors` embed their v1 recipes as `metadata.migratesFrom`,
|
|
317
|
-
so `update` picks them up
|
|
327
|
+
so `update` picks them up after syncing the npm package.
|
|
318
328
|
|
|
319
329
|
## Inspecting a template
|
|
320
330
|
|
|
@@ -517,14 +527,9 @@ warning at the end (the property won't be applied).
|
|
|
517
527
|
|
|
518
528
|
## How OOTB templates are resolved
|
|
519
529
|
|
|
520
|
-
1. **Source**: the
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
and downloads
|
|
524
|
-
each one's `connectors-bundle-templates-<tag>.tar.gz` asset from
|
|
525
|
-
`github.com`. `raw.githubusercontent.com` is deliberately not used:
|
|
526
|
-
it is blocked in many enterprise networks. Override the release
|
|
527
|
-
listing endpoint via `C8CTL_CONNECTORS_RELEASES_URL` for testing.
|
|
530
|
+
1. **Source**: the
|
|
531
|
+
[`@camunda/connectors-element-templates` npm package](https://www.npmjs.com/package/@camunda/connectors-element-templates).
|
|
532
|
+
`sync` uses npm to install it in a temporary directory.
|
|
528
533
|
2. **Populate the cache once** via `c8ctl element-template sync`.
|
|
529
534
|
Subcommands that resolve OOTB ids (`search`, `info`, `get-properties`,
|
|
530
535
|
`apply`, `get`) exit non-zero with a hint to run `sync` when the
|
|
@@ -539,8 +544,7 @@ warning at the end (the property won't be applied).
|
|
|
539
544
|
`engines.camunda` constraint. Without `@<version>`, the highest
|
|
540
545
|
compatible version wins.
|
|
541
546
|
5. **Stale cache** (>7 days) prints a hint to run `sync`. No automatic
|
|
542
|
-
refresh —
|
|
543
|
-
assets are tag-pinned, so incremental sync is free).
|
|
547
|
+
refresh — each explicit sync stages a new installation.
|
|
544
548
|
6. **Concurrent syncs** are serialised by an advisory lock at
|
|
545
549
|
`<cache-dir>/.sync.lock`. A second `sync` started while one is
|
|
546
550
|
already running exits non-zero rather than racing.
|
|
@@ -558,5 +562,5 @@ Set `C8CTL_DATA_DIR` to override.
|
|
|
558
562
|
## Design
|
|
559
563
|
|
|
560
564
|
See [`docs/design.md`](./docs/design.md) for the full reasoning behind
|
|
561
|
-
the
|
|
565
|
+
the npm source choice, the vendor bundle, the cache strategy
|
|
562
566
|
(mirrored from Desktop Modeler), and version resolution.
|