@nanobpm/nano-ide-ext-types 1.5.0 → 1.7.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 +165 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -201,6 +201,47 @@ export interface TriggerSourceSpec {
201
201
  */
202
202
  driver?: string;
203
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
+ }
204
245
  export interface ExtManifest {
205
246
  id: string;
206
247
  kind: ExtKind;
@@ -235,5 +276,129 @@ export interface ExtManifest {
235
276
  * §6). Each entry registers a `type` a manifest trigger can use; the pack's
236
277
  * out-of-process driver emits events over the trigger ingress. */
237
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[];
296
+ /**
297
+ * Guided journeys this pack contributes (ADR 0049 §7) — short, outcome-shaped
298
+ * onboarding paths offered in the console's journey picker.
299
+ *
300
+ * This is how onboarding scales with the pack ecosystem rather than living in a
301
+ * hardcoded list in the console: a pack that adds a capability can teach it.
302
+ * A pack journey is only ever offered when its pack is installed, which falls
303
+ * out of it being a pack journey.
304
+ */
305
+ tours?: TourSpec[];
306
+ }
307
+ /**
308
+ * A named gate from the console's shared precondition library
309
+ * (`lib/tour/preconditions.ts`).
310
+ *
311
+ * A pack ships **data, never code**, so it cannot supply the predicate functions
312
+ * the console's own journeys use — it names one of these and the console resolves
313
+ * it. Deliberately a closed set: an open expression language here would be a
314
+ * second, weaker copy of the precondition library, and would drift from it.
315
+ *
316
+ * - `hasJsRuntime` — Node or Deno is present, so Run can actually start something.
317
+ * - `hasProject` — at least one project exists.
318
+ * - `hasCluster` — more than one node, so the cluster views show something real.
319
+ * - `hasTraces` — traces have been captured.
320
+ */
321
+ export type TourGate = "hasJsRuntime" | "hasProject" | "hasCluster" | "hasTraces";
322
+ /**
323
+ * Which affordance a step renders as.
324
+ *
325
+ * - `spotlight` (the default) — highlights the `data-tour` anchor in `selector`.
326
+ * - `note` — anchorless, centered framing with nothing to point at.
327
+ * - `handoff` — a copyable terminal command or URL, for a step whose work happens
328
+ * outside the console.
329
+ */
330
+ export type TourStepKind = "spotlight" | "note" | "handoff";
331
+ /** One step of a pack-contributed journey. */
332
+ export interface TourStepSpec {
333
+ /** Stable across edits — this is the analytics key. */
334
+ id: string;
335
+ /** Defaults to `spotlight`, so the common case needs no boilerplate. */
336
+ kind?: TourStepKind;
337
+ title: string;
338
+ body: string;
339
+ /** Absolute console path to navigate to before showing the step. */
340
+ route?: string;
341
+ /** Gate for this step. `hasJsRuntime`/`hasCluster` can demand a `repair`. */
342
+ precondition?: TourGate;
343
+ /**
344
+ * Shown **instead** when `precondition` is not satisfied but the target is
345
+ * still present — e.g. "here is how to install a runtime" rather than a step
346
+ * telling the user to press Run on a host where Run cannot work. Without a
347
+ * `repair`, such a step is skipped rather than shown, because showing it would
348
+ * assert exactly what the precondition just ruled out. A repair step does not
349
+ * nest: a `repair` inside a `repair` is rejected at publish time, and ignored
350
+ * by the console as a safety net if one ever slips through.
351
+ */
352
+ repair?: TourStepSpec;
353
+ /** Advisory: a step whose absence does not weaken the journey. */
354
+ optional?: boolean;
355
+ /** `spotlight`: the `data-tour` anchor to highlight, e.g. `[data-tour="run"]`. */
356
+ selector?: string;
357
+ side?: "top" | "right" | "bottom" | "left";
358
+ align?: "start" | "center" | "end";
359
+ /**
360
+ * `handoff`: the command or URL offered for copying.
361
+ *
362
+ * **Requires a trusted pack.** A handoff's `copy` is a command the user is
363
+ * invited to paste into a shell, so the host strips handoff steps from
364
+ * untrusted packs before they ever reach the browser (and drops a journey left
365
+ * with no steps). Nothing is ever executed by the console — it renders this as
366
+ * inert text — but that is not a reason for an untrusted pack to put arbitrary
367
+ * text where a user expects a trustworthy command. Spotlight and note steps
368
+ * need no trust.
369
+ */
370
+ copy?: string;
371
+ /** `handoff`: button label. Defaults to "Copy". */
372
+ copyLabel?: string;
373
+ /**
374
+ * `handoff`: auto-advance once an external worker is seen polling this job
375
+ * type. The only verification a pack can declare, because it is the only one
376
+ * expressible without code. Absent means the user self-reports ("I've done
377
+ * it") — honest, since the console cannot watch a terminal.
378
+ */
379
+ verifyPollingJobType?: string;
380
+ }
381
+ /** A guided journey a pack contributes. Keep it to five steps or fewer. */
382
+ export interface TourSpec {
383
+ /** Stable, unique across installed packs. */
384
+ id: string;
385
+ title: string;
386
+ /** One line for the journey-picker card. */
387
+ blurb: string;
388
+ /**
389
+ * Console profiles this journey is offered in. Empty (or omitted) means
390
+ * `studio` only — the conservative default, since most pack capabilities are
391
+ * authoring surfaces the lean operator build does not ship.
392
+ */
393
+ profiles?: ("studio" | "observe")[];
394
+ /** Journey-level gates: not offered at all unless every one is satisfied. */
395
+ preconditions?: TourGate[];
396
+ steps: TourStepSpec[];
397
+ /**
398
+ * What must actually have happened for the journey to have worked. Omit for an
399
+ * orientation-only journey: the console then records completion without
400
+ * claiming an outcome, exactly as its own overview journey does.
401
+ */
402
+ successWhen?: TourGate;
238
403
  }
239
404
  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.5.0",
3
+ "version": "1.7.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",