@nanobpm/nano-ide-ext-types 1.4.0 → 1.6.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +71 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -48,7 +48,20 @@ export interface RunConfig {
48
48
  }
49
49
  export interface TemplateSpec {
50
50
  id: string;
51
+ /** Short human-facing title rendered on the New Project template card. */
51
52
  label: string;
53
+ /** One-line description rendered on the template card. Older packs instead
54
+ * cram "Title — description" into `label`; the console's template menu
55
+ * splits that on the em-dash as a fallback, but new packs should set this.
56
+ * Hosts that don't understand `description` render `label` alone, so if you
57
+ * must support such a host, keep the combined "Title — description" `label`
58
+ * (the em-dash split then keeps modern cards correct too). */
59
+ description?: string;
60
+ /** Language pack id this template's project uses, when it differs from what
61
+ * the pack implies (lang packs → the pack id; app/example packs →
62
+ * `requires[0]`, else "deno"). Drives the card's language icon AND the
63
+ * scaffolded project's `lang`. */
64
+ lang?: string;
52
65
  }
53
66
  /**
54
67
  * The console's design-token vocabulary (nanobpmn
@@ -188,6 +201,47 @@ export interface TriggerSourceSpec {
188
201
  */
189
202
  driver?: string;
190
203
  }
204
+ /**
205
+ * One worker a connector pack contributes — the **outbound/compute** edge of the
206
+ * I/O surface (ADR 0050, amending ADR 0033 §4). "Connector" is the *planned* pack
207
+ * kind for two-edge I/O packs; it is not yet a member of {@link ExtKind}, so today
208
+ * these packs ship as `kind: "trigger"` and carry `workers[]` alongside their
209
+ * `triggerSources[]`. Where {@link TriggerSourceSpec} is the *inbound* edge
210
+ * (external event → engine), a worker is the *outbound* edge (engine job →
211
+ * external effect, e.g. "post a Slack message").
212
+ *
213
+ * The `type` is the design→runtime **seam**: it must equal the
214
+ * `zeebe:taskDefinition:type` of the element template (a {@link ExtManifest.components}
215
+ * entry) that this worker backs, so a task dragged from the palette resolves to
216
+ * a running worker (ADR 0033 §1). The worker is **long-lived**: it subscribes by
217
+ * `type` (Zeebe-style, via `@nanobpm/worker`'s `defineWorker`), is started when
218
+ * the connector is enabled and the App runs, and is supervised — restarted with
219
+ * backoff on crash, killed on stop — reusing the trigger-driver supervisor
220
+ * (ADR 0025 §4 / 0036 / 0038). At-least-once outbound delivery is inherited from
221
+ * the engine's durable job queue (the job *is* the outbox), so no new durable
222
+ * subsystem is needed — the symmetric dual of the inbound inbox (ADR 0025 §2).
223
+ */
224
+ export interface WorkerSpec {
225
+ /** The BPMN job type this worker serves. MUST equal the backing element
226
+ * template's `zeebe:taskDefinition:type` (the design→runtime seam). */
227
+ type: string;
228
+ /** Pack-relative entrypoint (a Node/Deno `.ts`/`.js`/`.mjs`) that calls
229
+ * `@nanobpm/worker`'s `defineWorker`. Runs on Node >=22.6
230
+ * (`--experimental-strip-types`) or Deno, like a trigger driver. */
231
+ entry: string;
232
+ /** Human label for the console. */
233
+ displayName?: string;
234
+ /** Max concurrent jobs (maps to `defineWorker`'s `maxParallelJobs`). */
235
+ maxParallelJobs?: number;
236
+ /**
237
+ * Config fields surfaced **per-connector** in the project config surface when
238
+ * the connector is enabled — e.g. the shared connection/API token. Defaults
239
+ * are env-pointers (`env`), never inline secrets, so the committed manifest
240
+ * carries no credentials (ADR 0027 §5). Distinct from the element template's
241
+ * per-instance `zeebe:input` fields (channel, message text).
242
+ */
243
+ configFields?: ConfigField[];
244
+ }
191
245
  export interface ExtManifest {
192
246
  id: string;
193
247
  kind: ExtKind;
@@ -222,5 +276,22 @@ export interface ExtManifest {
222
276
  * §6). Each entry registers a `type` a manifest trigger can use; the pack's
223
277
  * out-of-process driver emits events over the trigger ingress. */
224
278
  triggerSources?: TriggerSourceSpec[];
279
+ /**
280
+ * Pack-relative paths to Camunda **element-template** JSON files (each a
281
+ * single template or an array of them) — the design-time **components** this
282
+ * pack contributes to the modeler palette (ADR 0033 §4). The host resolves +
283
+ * parses them (`extensions::pack_component_templates`, path-escape-guarded)
284
+ * and layers them into the palette / template chooser. Mirrors the host's
285
+ * `ExtManifest.components: Vec<String>`.
286
+ */
287
+ components?: string[];
288
+ /**
289
+ * connector packs: the **workers** this pack contributes — the outbound edge
290
+ * bound to its `components` element templates by matching job `type` (ADR
291
+ * 0050, amending ADR 0033 §4). Host consumption (launch + supervision +
292
+ * project-enablement gating) is the ADR 0050 host increment; the field is the
293
+ * canonical contract packs author against.
294
+ */
295
+ workers?: WorkerSpec[];
225
296
  }
226
297
  export declare const MANIFEST_FILE = "nano-ide.ext.json";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanobpm/nano-ide-ext-types",
3
- "version": "1.4.0",
3
+ "version": "1.6.0",
4
4
  "description": "TypeScript types for the nano-ide.ext.json extension manifest (ADR 0007).",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",