@nanobpm/nano-ide-ext-types 1.6.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 +107 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -293,5 +293,112 @@ export interface ExtManifest {
293
293
  * canonical contract packs author against.
294
294
  */
295
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;
296
403
  }
297
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.6.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",