@nac3/runtime 2.5.2 → 2.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.
package/dist/nac.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // Generated by build.mjs -- do not edit. Source: js/nac.js
2
- // Core runtime surface for @nac3/runtime v2.5.2.
2
+ // Core runtime surface for @nac3/runtime v2.6.0.
3
3
  // The data-table (dt_*) + brownfield primitives live in the
4
4
  // extensions entry: import '@nac3/runtime/extensions' and see
5
5
  // the NACExtensions interface in nac-v2-extensions.d.ts.
@@ -61,6 +61,50 @@ export interface ValidateGlobalReport {
61
61
  timestamp: number;
62
62
  }
63
63
 
64
+ /** A verb argument as the manifest declares it (V26-01, SPEC 15.11). */
65
+ export interface ParamDecl {
66
+ name: string;
67
+ type: 'string' | 'number' | 'boolean' | 'object' | 'array';
68
+ required?: boolean;
69
+ unit?: string;
70
+ min?: number;
71
+ max?: number;
72
+ enum?: unknown[];
73
+ label?: string;
74
+ hint?: string;
75
+ }
76
+
77
+ /** What NAC.plugins() / NAC.describePlugin() hand back (V26-01, SPEC 15.10).
78
+ It is a COPY: mutating it cannot reach the live registry. */
79
+ export interface PluginDescriptor {
80
+ slug: string;
81
+ label: string | null;
82
+ hint: string | null;
83
+ verbs: Array<{
84
+ verb_path: string;
85
+ backend: string | null;
86
+ label: string | null;
87
+ hint: string | null;
88
+ params: ParamDecl[] | null;
89
+ handle?: string;
90
+ }>;
91
+ state: Array<{
92
+ state_path: string;
93
+ backends: Array<string | null>;
94
+ label: string | null;
95
+ hint: string | null;
96
+ unit: string | null;
97
+ }>;
98
+ events: Array<{
99
+ event_path: string;
100
+ backend: string | null;
101
+ label: string | null;
102
+ hint: string | null;
103
+ observe: string[] | null;
104
+ event?: string;
105
+ }>;
106
+ }
107
+
64
108
  /** Subscription handle returned by NAC.subscribe (V25-01). */
65
109
  export interface SubscriptionHandle {
66
110
  __v25_sub: true;
@@ -139,12 +183,21 @@ export interface NACRuntime {
139
183
  revoke_authority(scope: string): void;
140
184
 
141
185
  /* v2.5 V25-01 Block A -- plugin extension contract (canvas + API) */
142
- registerPlugin(slug: string, manifest: { verbs?: object; state?: object; events?: object }): void;
186
+ registerPlugin(slug: string, manifest: { label?: string; hint?: string; verbs?: object; state?: object; events?: object }): void;
143
187
  call(plugin: string, verb_path: string, args?: unknown): Promise<unknown>;
144
188
  read(plugin: string, state_path: string): Promise<unknown>;
145
189
  subscribe(plugin: string, event_path: string, cb: (...args: unknown[]) => void): SubscriptionHandle;
146
190
  unsubscribe(handle: SubscriptionHandle): void;
147
191
 
192
+ /* v2.6 V26-01 -- discovery (SPEC 15.10) + self-description (15.11) +
193
+ API handles for an object that never lands on window (15.4). The
194
+ first two are SYNCHRONOUS: they read a local object. */
195
+ plugins(): PluginDescriptor[];
196
+ describePlugin(slug: string): PluginDescriptor;
197
+ registerApiHandle(name: string, obj: object): void;
198
+ unregisterApiHandle(name: string): boolean;
199
+ apiHandles(): string[];
200
+
148
201
  /* v2.5 V25-03 Block C -- asistive labels */
149
202
  narrate(plugin: string | null, nac_id: string): string | null;
150
203