@nanobpm/nano-ide-ext-types 1.0.0 → 1.1.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.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type ExtKind = "lang" | "app" | "example";
1
+ export type ExtKind = "lang" | "app" | "example" | "theme";
2
2
  export interface FileType {
3
3
  /** File extension including the dot, e.g. ".rs". */
4
4
  ext: string;
@@ -8,17 +8,61 @@ export interface FileType {
8
8
  export interface Toolchain {
9
9
  /** Probe argv proving the toolchain is installed (e.g. ["cargo","--version"]). */
10
10
  detect?: string[];
11
- /** argv to run the project (cwd = project dir). Empty => built-in Deno runner. */
11
+ /** argv to run the project (cwd = project dir). Empty => built-in Deno runner.
12
+ * Serves as a fallback when the active run config's `run` argv is empty. */
12
13
  run?: string[];
13
- /** argv to compile the project. Empty => Deno compile. */
14
+ /** argv to compile the project. Empty => Deno compile. Serves as a fallback
15
+ * when the active run config's `compile` argv is empty. */
14
16
  compile?: string[];
15
17
  /** Cross-compile target triples this toolchain offers. */
16
18
  targets?: string[];
19
+ /** Named run configurations the console surfaces in a Run/Target dropdown.
20
+ * When set, the supervisor prefers the active one (pinned →
21
+ * `default: true` → first) over the flat `run`/`compile`. */
22
+ runConfigs?: RunConfig[];
23
+ }
24
+ /**
25
+ * One named run/compile combo a pack exposes — e.g. an example that swaps
26
+ * transports or build profiles. The console persists the picked id in the
27
+ * project's `nanobpm.project.json` as `toolchain.activeRunConfig`.
28
+ */
29
+ export interface RunConfig {
30
+ /** Stable id, unique within the pack (e.g. "stock-grpc"). */
31
+ id: string;
32
+ /** Human-facing label shown in the Run dropdown. */
33
+ label: string;
34
+ /** When no id is pinned by the user, this entry is picked; else the first. */
35
+ default?: boolean;
36
+ /** argv override for this config. Empty => fall back to `Toolchain.run`. */
37
+ run?: string[];
38
+ /** argv override for this config. Empty => fall back to `Toolchain.compile`. */
39
+ compile?: string[];
40
+ /** Env vars layered on top of the base spawn env (last wins on key clash). */
41
+ env?: Record<string, string>;
17
42
  }
18
43
  export interface TemplateSpec {
19
44
  id: string;
20
45
  label: string;
21
46
  }
47
+ /**
48
+ * The console's design-token vocabulary (nanobpmn
49
+ * console/src/theme/tokens.css). A theme restyles the whole console by giving
50
+ * CSS colours for these keys; missing keys fall back to the base appearance.
51
+ */
52
+ export declare const THEME_TOKEN_KEYS: readonly ["app", "panel", "raised", "inset", "hover", "edge", "edgeStrong", "text", "textMuted", "textFaint", "accent", "accentStrong", "accent2", "onAccent", "ok", "warn", "danger", "info"];
53
+ export type ThemeTokenKey = (typeof THEME_TOKEN_KEYS)[number];
54
+ /** One console colour theme a `kind: "theme"` pack contributes. Pure data. */
55
+ export interface ThemeSpec {
56
+ /** Stable id, unique across packs (e.g. "nord-dark"). */
57
+ id: string;
58
+ /** Human-facing name shown in the console's theme picker. */
59
+ label: string;
60
+ /** Base palette the tokens override — controls color-scheme and any token
61
+ * the theme doesn't specify. */
62
+ appearance: "light" | "dark";
63
+ /** Design-token name -> CSS colour. Unknown keys are ignored by the host. */
64
+ tokens: Partial<Record<ThemeTokenKey, string>>;
65
+ }
22
66
  export interface ExtManifest {
23
67
  id: string;
24
68
  kind: ExtKind;
@@ -26,12 +70,19 @@ export interface ExtManifest {
26
70
  fileTypes?: FileType[];
27
71
  templates?: TemplateSpec[];
28
72
  toolchain?: Toolchain;
29
- /** example packs: lang pack ids required to build/run this example. */
73
+ /** example/app packs: lang pack ids required to build/run this pack's
74
+ * projects. The FIRST entry sets the scaffolded project's language — which
75
+ * drives the host's run/compile toolchain — so any app or example pack that
76
+ * isn't Deno-based must declare it (else new projects fall back to the Deno
77
+ * runtime). Required for example packs; required for app packs whose
78
+ * toolchain declares a detect probe. */
30
79
  requires?: string[];
31
80
  /** example packs: subdir holding the ready-to-copy project. */
32
81
  appDir?: string;
33
82
  /** example packs: one-line description for the picker. */
34
83
  summary?: string;
84
+ /** theme packs: the console colour themes this pack contributes. */
85
+ themes?: ThemeSpec[];
35
86
  /** Built-in packs set this; published packs omit it. */
36
87
  builtin?: boolean;
37
88
  }
package/dist/index.js CHANGED
@@ -1,3 +1,28 @@
1
1
  // nano-ide.ext.json manifest contract (ADR 0007). Mirrors the host parser in
2
2
  // nanobpmn server/src/console/extensions.rs — keep in sync.
3
+ /**
4
+ * The console's design-token vocabulary (nanobpmn
5
+ * console/src/theme/tokens.css). A theme restyles the whole console by giving
6
+ * CSS colours for these keys; missing keys fall back to the base appearance.
7
+ */
8
+ export const THEME_TOKEN_KEYS = [
9
+ "app",
10
+ "panel",
11
+ "raised",
12
+ "inset",
13
+ "hover",
14
+ "edge",
15
+ "edgeStrong",
16
+ "text",
17
+ "textMuted",
18
+ "textFaint",
19
+ "accent",
20
+ "accentStrong",
21
+ "accent2",
22
+ "onAccent",
23
+ "ok",
24
+ "warn",
25
+ "danger",
26
+ "info",
27
+ ];
3
28
  export 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.0.0",
3
+ "version": "1.1.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",