bpmnlint-plugin-camunda-compat 2.58.0 → 2.58.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpmnlint-plugin-camunda-compat",
3
- "version": "2.58.0",
3
+ "version": "2.58.2",
4
4
  "description": "A bpmnlint plug-in for Camunda compatibility",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -524,13 +524,19 @@ module.exports.findAncestorAdHocSubProcess = findAncestorAdHocSubProcess;
524
524
  // detached tools ad-hoc sub-process as a tool container to lint. This is
525
525
  // read-only and has no execution effect; it parses on the current moddle with
526
526
  // no schema change. The marker is an independent boolean, not a single-valued
527
- // role enum, because a Camunda agent element can carry both the
528
- // `toolContainer` role (hosts tools) and the `agent` role at once; a
529
- // single-valued `io.camunda.agenticai.role` property could not represent
530
- // both roles on the same element.
527
+ // role enum: the original design paired it with an `io.camunda.agenticai.agent`
528
+ // value so a single element could in principle declare both, but no template
529
+ // ever shipped that value, so this plugin only checks for `toolContainer`.
531
530
  const TOOL_CONTAINER_PROPERTY = 'io.camunda.agenticai.toolContainer';
532
531
 
533
- function hasToolContainerRoleProperty(node) {
532
+ // The AI Agent job-worker template applied to an ad-hoc sub-process. Its id is
533
+ // stable across template versions (versioning is tracked separately via
534
+ // zeebe:modelerTemplateVersion), so matching it recognizes every version. Older
535
+ // versions of this template predate the TOOL_CONTAINER_PROPERTY marker, so
536
+ // their AHSPs are agentic but carry no marker; the template id identifies them.
537
+ const LEGACY_AI_AGENT_TEMPLATE = 'io.camunda.connectors.agenticai.aiagent.jobworker.v1';
538
+
539
+ function hasToolContainerProperty(node) {
534
540
  const properties = findExtensionElement(node, 'zeebe:Properties');
535
541
 
536
542
  if (!properties) {
@@ -543,7 +549,7 @@ function hasToolContainerRoleProperty(node) {
543
549
  );
544
550
  }
545
551
 
546
- module.exports.hasToolContainerRoleProperty = hasToolContainerRoleProperty;
552
+ module.exports.hasToolContainerProperty = hasToolContainerProperty;
547
553
 
548
554
  // Whether an ad-hoc sub-process should have agent tool contracts linted.
549
555
  //
@@ -556,8 +562,16 @@ module.exports.hasToolContainerRoleProperty = hasToolContainerRoleProperty;
556
562
  // Deliberately does not fall back to a bare `zeebe:AdHoc` extension: that
557
563
  // extension is also carried by plain ad-hoc sub-processes using output
558
564
  // collection, so it can't reliably distinguish agentic from non-agentic ones.
565
+ //
566
+ // Older AI Agent job-worker templates predate the property marker; they are
567
+ // still agentic and are recognized by their (version-agnostic) element template
568
+ // id (see LEGACY_AI_AGENT_TEMPLATE).
559
569
  function isAgenticAdHocSubProcess(ahsp, version) {
560
- if (hasToolContainerRoleProperty(ahsp)) {
570
+ if (hasToolContainerProperty(ahsp)) {
571
+ return true;
572
+ }
573
+
574
+ if (ahsp.get('modelerTemplate') === LEGACY_AI_AGENT_TEMPLATE) {
561
575
  return true;
562
576
  }
563
577